Problem with CpmStateUpdater
Hi everyone,
I have a problem with CpmStateUpdater. I don't know why, but if I want to get the stress tensor (matrix) it is always zero matrix. It looks like, that the updater doesn't launch. Did you have that problem before?
Here is a code (with some modifications)...
CREATE_
//Real CpmStateUpdater
//Real CpmStateUpdater
void CpmStateUpdater
{
// declaration of ‘scene’ shadows a member of ‘yade::
Scene* scene2 = _scene ? _scene : Omega::
vector<BodyStats> bodyStats;
bodyStats.
// assert(
//Matrix3r identity = Matrix3r:
// Matrix3r incr;
FOREACH(const shared_
{
if (!I) continue;
if (!I->isReal()) continue;
shared_
if (!phys) continue;
const Body::id_t id1 = I->getId1(), id2 = I->getId2();
GenericSphere
const Vector3r& n = geom->normal;
const Real& Fn = phys->Fn;
const Vector3r& Fs = phys->Fs;
LOG_FATAL("Fn: "<<Fn<<" ");
LOG_FATAL("Fs: "<<Fs<<" ");
LOG_FATAL("n: "<<n<<" ");
LOG_FATAL(
//stress[i,j] += geom->refLength
//stress += geom->refLength
Matrix3r stress = phys->refLength * (Fn * n * n.transpose() + .5 * (Fs * n.transpose() + n * Fs.transpose()));
// LOG_FATAL("Stress: "<<stress<<" ");
// LOG_FATAL("matrix: "<<n*n.
bodyStats[
bodyStats[
//bodyStats[
//bodyStats[
}
// Real tr;
FOREACH(
{
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[
}
}
#undef YADE_VERIFY
#undef NNAN
#undef NNANV
And from .hpp file:
class CpmStateUpdater : public PeriodicEngine {
struct BodyStats {
Matrix3r stress;
BodyStats()
: stress(
{
}
};
public:
virtual void action() override { update(scene); }
void update(Scene* rb = NULL);
// clang-format off
YADE_CLASS_
,
initRun=true;
);
// clang-format on
DECLARE_LOGGER;
};
REGISTER_
} // namespace yade
BR
Przemek
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: