← Back to team overview

yade-dev team mailing list archive

how to get flow parameter into TSC

 

Hi,

I tried to cast FlowEngine in TSC, like it was done in MicroMarcoAnalyser.

#ifdef FLOW_ENGINE
//#include<yade/pkg/pfv/FlowEngine.hpp> //not working
#include "FlowEngine_FlowEngineT.hpp"  //not sure
#endif

...

void TriaxialStressController::updateStiffness() {
  Real fluidStiffness = 0.;
  #ifdef FLOW_ENGINE
  vector<shared_ptr<Engine> >::iterator it = scene->engines.begin();
  vector<shared_ptr<Engine> >::iterator itLast = scene->engines.end();
  for (;it!=itLast; ++it) {
    if ((*it)->getClassName() == "FlowEngine") {
      shared_ptr<FlowEngine> flow =  YADE_PTR_CAST<FlowEngine> (*it);
    }
  }
  #endif

...


compiler says:


/home/me/YADE/trunk/pkg/dem/TriaxialStressController.cpp: In member function 'void TriaxialStressController::updateStiffness()': /home/me/YADE/trunk/pkg/dem/TriaxialStressController.cpp:48: error: 'FlowEngine' was not declared in this scope /home/me/YADE/trunk/pkg/dem/TriaxialStressController.cpp:48: error: template argument 1 is invalid /home/me/YADE/trunk/pkg/dem/TriaxialStressController.cpp:48: error: invalid type in declaration before '=' token /home/me/YADE/trunk/pkg/dem/TriaxialStressController.cpp:48: error: 'FlowEngine' cannot appear in a constant-expression /home/me/YADE/trunk/pkg/dem/TriaxialStressController.cpp:48: error: no matching function for call to 'static_pointer_cast(boost::shared_ptr<Engine>&)'


Is there way to declare and cast this engine and get parameters from there somehow?

Regards,

Christian



Follow ups