Access to body material properties
Hi,
I have a problem with the access to some properties which are assigned to a particle (sphere). Could you help me to solve the problem? Here are segments of code.
From .hpp file:
class CpmMat : public FrictMat {
public:
shared_ptr<State> newAssocState() const override { return shared_
bool stateTypeOk(State* s) const override { return (bool)dynamic_
// clang-format off
YADE_CLASS_
((Real,
((Real,
((Real,
((Real,
((Real,
((Real,
((Real,
((Real,
((Real,
((Real,
createIndex();
And from .cpp file:
FOREACH(
{
CpmPhys* mat = dynamic_
const Real& CP1(mat->CP1);
const Real& CP2(B->
const Real& CP3(B->
const Real& K1(B->material.K1);
const Real& K2(B->material.K2);
const Real& K3(B->material.K3);
const Real& K4(B->material.K4);
if (!B) continue;
const Body::id_t& id = B->getId();
// add damaged contacts that have already been deleted
CpmState* state = dynamic_
if (!state) continue;
state->stress = bodyStats[
Sphere* sphere = dynamic_
if (!sphere) continue;
Real& r = sphere->radius;
state->stress = bodyStats[
//state->oldTemp = state->temp; // przypisanie wartosci temperatury
state->Cp = CP1 + CP2 * state->temp + CP3 * pow(state->temp,2);
state->k = K1 + K2 * state->temp + K3 * pow(state->temp, 2) + K4 * pow(state->temp, 3);
}
And here is the example message form terminal:
/home/przemek/
492 | const Real& K2(B->material.K2);
Have you any suggestions?
BR
Przemek
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Przemek for more information if necessary.