← Back to team overview

yade-users team mailing list archive

[Question #696759]: How can polyhedron use CpmMat 、Ip2_CpmMat_CpmMat_CpmPhys()and Law2_ScGeom_CpmPhys_Cpm() ?

 

New question #696759 on Yade:
https://answers.launchpad.net/yade/+question/696759

Dear all,

I want to use polyhedron to simulate coarse aggregate of concrete. After I create interactions for non-overlapping polyhedron -polyhedron and sphere -polyhedron[1], I find that polyhedron can't use CpmMat. The script and error are as follows:

script:
##################
concrete = O.materials.append(CpmMat(
	young = young,
	poisson = poisson,
	frictionAngle = frictionAngle,
	epsCrackOnset = epsCrackOnset,
	relDuctility = relDuctility,
	sigmaT = sigmaT,
))
poly1= polyhedra_utils.polyhedra(material=concrete,size=(1,1,1),seed=5) 
#########################
error:
#########################
poly1= polyhedra_utils.polyhedra(material=concrete,size=(1,1,1),seed=5)
  File "/home/wj/myYade/install/lib/x86_64-linux-gnu/yade-Unknown/py/yade/polyhedra_utils.py", line 44, in polyhedra
    b.mat = material
Boost.Python.ArgumentError: Python argument types in
    None.None(Body, int)
did not match C++ signature:
    None(yade::Body {lvalue}, boost::shared_ptr<yade::Material>)
#########################

1)How can I modify the source code so that polyhedron can use CpmMat correctly?
2)How can I modify the source code so that polyhedron can use Ip2_CpmMat_CpmMat_CpmPhys()and Law2_ScGeom_CpmPhys_Cpm()?

For law2, I found a place that may need to be modified[2]. The calculation of reflength, crosssection and refpd for polyhedron - polyhedron as well as polyhedron - sphere is added.I don't know whether this modification is correct or whether there are any other places that need to be modified. The added code is as follows:
###################################
		const int              polyIndex=Polyhedra::getClassIndexStatic();
		if(b1index ==  polyIndex && b2index ==  polyIndex) {
			const Vector3r& pos1   = Body::byId(I->id1, scene)->state->pos;
			const Vector3r& pos2   = Body::byId(I->id2, scene)->state->pos;
			Real            minRad = (geom->refR1 <= 0 ? geom->refR2 : (geom->refR2 <= 0 ? geom->refR1 : math::min(geom->refR1, geom->refR2)));
			Vector3r     shift2 = scene->cell->hSize * I->cellDist.cast<Real>();
			phys->refLength        = (pos2 - pos1 + shift2).norm();
			phys->crossSection     = Mathr::PI * pow(minRad, 2);
			phys->refPD            = geom->refR1 + geom->refR2 - phys->refLength;
		}
		if((b1index ==   sphereIndex && b2index ==  polyIndex)||(b1index ==  polyIndex && b2index ==  sphereIndex)) {
			const Vector3r& pos1   = Body::byId(I->id1, scene)->state->pos;
			const Vector3r& pos2   = Body::byId(I->id2, scene)->state->pos;
			Real            minRad = (geom->refR1 <= 0 ? geom->refR2 : (geom->refR2 <= 0 ? geom->refR1 : math::min(geom->refR1, geom->refR2)));
			Vector3r     shift2 = scene->cell->hSize * I->cellDist.cast<Real>();
			phys->refLength        = (pos2 - pos1 + shift2).norm();
			phys->crossSection     = Mathr::PI * pow(minRad, 2);
			phys->refPD            = geom->refR1 + geom->refR2 - phys->refLength;
		}	
######################################

Thanks in advance.
Jie

[1]https://answers.launchpad.net/yade/+question/696515
[2]https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/ConcretePM.cpp#L319

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