← Back to team overview

yade-dev team mailing list archive

Re: inherited PhysicalParameters for InteractionPhysicsEngineUnit

 


I've got a problem with 'SimpleViscoelasticRelationships'. This
2d-functor needs 2 'PhysicalParameters' that are casted into
'SimpleViscoelasticBodyParameters' in the method 'go'.

I want to use BcpConnection that inherit from
SimpleViscoelasticBodyParameters for one of the parameters.
The problem is that call 'SimpleViscoelasticRelationships::go' fail
(before entering the function).
I've got the following message:

terminate called after throwing an instance of 'std::runtime_error'
  what():  DynLibDispatcher: ambiguous or undefined dispatch for 2d
multivirtual function, classes: SimpleViscoelasticBodyParameters
BcpConnection


You need own 2d-functor "*Relationships" for your PhysicalParameters (BcpConnection). SimpleViscoelasticRelationships only for SimpleViscoelasticBodyParameters,
see line 29 in SimpleViscoelasticRelationships.hpp:

FUNCTOR2D (SimpleViscoelasticBodyParameters,SimpleViscoelasticBodyParameters);

It calculate InteractionPhysics (SimpleViscoelasticInteraction) from
PhysicalParameters of contacting bodys.

So, if you have own PhysicalParameters, you need own Relationships for calculating InteractionPhysics from this parameters. (or you can modify exant classes with take care of their default behavior without changes)...


Thank for your answer Sega,

There is still something boring:
as I said, BcpConnection IS a SimpleViscoelasticBodyParameters.
If I write my own functor, it will do exactly the same job as SimpleViscoelasticRelationships ! Besides, casting BcpConnection into SimpleViscoelasticBodyParameters is possible
without any problem. Maybe the 'problem' come from the DynLibDispatcher?

Vincent






Follow ups

References