Question #698253 on Yade changed:
https://answers.launchpad.net/yade/+question/698253

Przemek posted a new comment:
Hi Jan,

thank you for reply. I modified code:

State*            state = b->state.get();
                CpmMat* mat = dynamic_cast<CpmMat*>(b->material.get());
                const Body::id_t& id    = b->getId();
                Vector3r          f     = Vector3r::Zero();
                Vector3r          m     = Vector3r::Zero();
                state->oldTemp = state->temp;
                state->Cp = mat->CP1 + mat->CP2 * state->oldTemp + mat->CP3 * 
pow(state->oldTemp,2);
                state->k = mat->K1 + mat->K2 * state->oldTemp + mat->K3 * 
pow(state->oldTemp, 2) + mat->K4 * pow(state->oldTemp, 3);

But now I get those messages:

/home/przemek/DEMlab/trunk/pkg/dem/NewtonIntegrator.cpp: In member function 
‘virtual void yade::NewtonIntegrator::action()’:
/home/przemek/DEMlab/trunk/pkg/dem/NewtonIntegrator.cpp:181:3: error: ‘CpmPhys’ 
was not declared in this scope; did you mean ‘IPhys’?
  181 |   CpmPhys* mat = dynamic_cast<CpmPhys*>(b->material.get());
      |   ^~~~~~~
      |   IPhys
/home/przemek/DEMlab/trunk/pkg/dem/NewtonIntegrator.cpp:181:12: error: ‘mat’ 
was not declared in this scope; did you mean ‘math’?
  181 |   CpmPhys* mat = dynamic_cast<CpmPhys*>(b->material.get());
      |            ^~~
      |            math
/home/przemek/DEMlab/trunk/pkg/dem/NewtonIntegrator.cpp:181:31: error: 
‘CpmPhys’ does not name a type; did you mean ‘IPhys’?
  181 |   CpmPhys* mat = dynamic_cast<CpmPhys*>(b->material.get());
      |                               ^~~~~~~
      |                               IPhys
/home/przemek/DEMlab/trunk/pkg/dem/NewtonIntegrator.cpp:181:38: error: expected 
‘>’ before ‘*’ token
  181 |   CpmPhys* mat = dynamic_cast<CpmPhys*>(b->material.get());
      |                                      ^
/home/przemek/DEMlab/trunk/pkg/dem/NewtonIntegrator.cpp:181:38: error: expected 
‘(’ before ‘*’ token
  181 |   CpmPhys* mat = dynamic_cast<CpmPhys*>(b->material.get());
      |                                      ^
      |                                      (
/home/przemek/DEMlab/trunk/pkg/dem/NewtonIntegrator.cpp:181:39: error: expected 
primary-expression before ‘>’ token
  181 |   CpmPhys* mat = dynamic_cast<CpmPhys*>(b->material.get());
      |                                       ^
/home/przemek/DEMlab/trunk/pkg/dem/NewtonIntegrator.cpp:181:59: error: expected 
‘)’ before ‘;’ token
  181 |   CpmPhys* mat = dynamic_cast<CpmPhys*>(b->material.get());
      |                                                           ^
      |                                                           )
make[2]: *** [CMakeFiles/dem.dir/build.make:583: 
CMakeFiles/dem.dir/pkg/dem/NewtonIntegrator.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:247: CMakeFiles/dem.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

How to declare the CpmMat in NewtonIntegrator?

BR
Przemek

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to