← Back to team overview

yade-users team mailing list archive

Re: How to communicate between two independent Engines

 

If you are sure that you will always have at most one
ConvergenceEstimator engine running, I would use static variable for that:

in the header:

class ConvergenceEstimator{
/* ... */
public:
static Real someValue;
}

create memory space for that in the .cpp file:

Real ConvergenceEstimator::someValue;

Then you can retrieve the value in DampingAdjustment by saying
ConvergenceEstimator::someValue.

Vaclav

> Hi, all:
> I am recently having such kind of problem, I have two costomized
> engines, one is called "ConvergenceEstimator", which is used to
> evaluate some maximumUnBalanceForce over the contactForce ratio (this
> will return a CCValue to evaluate whether the whole particle system is
> close to equilibrium), then I have another engine "DampingAdjustment"
> designed to change the initial simulation parameter, in my case, the
> damping coefficient, for example, from 0.3 to 0.4.
> I have one piece of code in the preprocessor (similar to
> SDECSpheresPlane) which looks like this:
> ///--------------------
> ...
> rootBody->engines.push_back(ConvergenceEstimator);
> rootBody->engines.push_back(DampingAdjustment);
> ///--------------------
> This means my DampingAdjustment Engine needs the return values of the
> previous engine, I need to have something in DampingAdjustment like(I
> think should be in DampingAdjustment::applyCondition(Body* body)):
> if (convergenceEstimator->getCCVaue() <=eps)
> dampingCoefficient = 0.3;
> else
> dampingCoefficient =0.5;
> I think this is purely a programming problem, how to access the
> ConvergenceEstimator which is the other engine?
> I hope I have made my problem clear. Thank you very much!
> Feng Chen
> ------------------------------------------------------------------------
>
> _______________________________________________
> Yade-users mailing list
> Yade-users@xxxxxxxxxxxxxxxx
> https://lists.berlios.de/mailman/listinfo/yade-users
>   

_______________________________________________
Yade-users mailing list
Yade-users@xxxxxxxxxxxxxxxx
https://lists.berlios.de/mailman/listinfo/yade-users



References