← Back to team overview

yade-users team mailing list archive

Re: [Question #702096]: Learning of ig2_ Sphere_ Sphere_ ScGeom.cpp

 

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

    Status: Answered => Open

xuanshenyu is still having a problem:
Hi, Jan

Thank you very much for your kind reply. I have understood several
questions above.

But I still have questions about the following functions.

1########ScGeom6D::go()########
bool Ig2_Sphere_Sphere_ScGeom6D::go(
        const shared_ptr<Shape>&       cm1,
        const shared_ptr<Shape>&       cm2,
        const State&                   state1,
        const State&                   state2,
        const Vector3r&                shift2,
        const bool&                    force,
        const shared_ptr<Interaction>& c)
{
	bool isNew = !c->geom;
	if (Ig2_Sphere_Sphere_ScGeom::go(cm1, cm2, state1, state2, shift2, force, c)) { //the 3 DOFS from ScGeom are updated here
		if (isNew) { //generate a 6DOF interaction from the 3DOF one generated by Ig2_Sphere_Sphere_ScGeom
			shared_ptr<ScGeom6D> sc(new ScGeom6D());
			*(YADE_PTR_CAST<ScGeom>(sc)) = *(YADE_PTR_CAST<ScGeom>(c->geom));
			c->geom                      = sc;
		}
		if (updateRotations) YADE_PTR_CAST<ScGeom6D>(c->geom)->precomputeRotations(state1, state2, isNew, creep);
		return true;
	} else
		return false;
}
##############

2#####ScGeom6D::goReverse()######
bool Ig2_Sphere_Sphere_ScGeom6D::goReverse(
        const shared_ptr<Shape>&       cm1,
        const shared_ptr<Shape>&       cm2,
        const State&                   state1,
        const State&                   state2,
        const Vector3r&                shift2,
        const bool&                    force,
        const shared_ptr<Interaction>& c)
{
	return go(cm1, cm2, state2, state1, -shift2, force, c);
}

YADE_PLUGIN((Ig2_Sphere_Sphere_ScGeom6D));

} // namespace yade
##################

What do these the functions of go() and goReverse() do?

3#############
bool               isNew = !c->geom;

what does this sentence mean?

##############

Shenyu

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