JCFpmState Error

Asked by mohsen on 2018-12-11

In the name of God
Dear all

When i trying to replace my spheres in a triaxial test by clumps with the material of JCFpmMat, i encounter this error:

RuntimeError: Body #14: Body::material type JCFpmMat doesn't correspond to Body::state type State (should be JCFpmState instead).

Please note that with no replacement with clumps, there is no problem. The other point is that if i reduce the Rmean to generate more spheres, then script would not be run. Any idea?!

the MWE is as following:

from yade import pack,plot
from yade import export, ymport
import random
from yade import utils

############################################
### DEFINING VARIABLES AND MATERIALS ###
############################################

key='_Triax-J2_'
intRadius= 1

mn,mx=Vector3(0,0,0),Vector3(.1,.1,.1) # corners of the initial packing

## create materials for spheres and plates
id_Mat=O.materials.append(JCFpmMat())
Mat=O.materials[id_Mat]

#frictionless walls
O.materials.append(FrictMat(label='walls'))

## create walls around the packing
walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)

## use a SpherePack object to generate a random loose particles packing
sp=pack.SpherePack()
sp.makeCloud(minCorner=mn,maxCorner=mx,rMean=.029,rRelFuzz=0.0,periodic=False,num=5000)
O.bodies.append([sphere(c,r,material=Mat) for c,r in sp])

relRadList1=[1,1]
relPosList1=[[0,0,0],[.5,.5,.5]]
templates= []
templates.append(clumpTemplate(relRadii=relRadList1,relPositions=relPosList1))
O.bodies.replaceByClumps(templates,[1.0], discretization=5)

###########################
## DEFINING ENGINES ###
###########################

triax=TriaxialStressController(
 thickness = 0,
 stressMask = 7,
 internalCompaction=False,
)

newton=NewtonIntegrator(damping=.2, gravity=[0,0,0])
########################################
#Modified engine
##################################
O.engines=[
        ForceResetter(),
        InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=intRadius),Bo1_Box_Aabb()]),
        InteractionLoop(
                [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=intRadius),Ig2_Box_Sphere_ScGeom()],
                [Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=10, label='jcf')],
                [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=True,label='interactionLaw', recordCracks=True),Law2_ScGeom_FrictPhys_CundallStrack()]
        ),
        GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.5),
        triax,
        TriaxialStateRecorder(iterPeriod=100,file='J2_Triaxial,'+key),
        newton
]

triax.goal1=triax.goal2=triax.goal3=-150000
O.step()

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
2018-12-11
Last reply:
2018-12-23
mohsen (agha-mohsena) said : #2

Hi Jan,
So I continue posting in this question or the one you referred?

Jan Stránský (honzik) said : #3

No, it is just for future reference if a user find this or the other question that there is something similar discussed in another thread.
It is no problem to stay in this question.
Cheers
Jan

mohsen (agha-mohsena) said : #4

To clarify the problem i should say that every thing is ok when using sphere and runing with sphres. however the problem rises up when we use the reaplaceByClump() where the generated spheres of one clump are defined with ordinary 'state' not 'JCFpmState'! however the material of new generated clumps is JCFpmMat.

mohsen (agha-mohsena) said : #5

I think it is a bug!
It should be solve in the source

Chareyre (bruno-chareyre-9) said : #6

It is probably because some clumping function use regular State for new
body. There must be a way to overwrite state in your script yet a fix in
source would be better.
Do you want to try and fix it?
Bruno

Le dim. 16 déc. 2018 13:58, mohsen <email address hidden> a
écrit :

> Question #676746 on Yade changed:
> https://answers.launchpad.net/yade/+question/676746
>
> mohsen posted a new comment:
> I think it is a bug!
> It should be solve in the source
>
> --
> 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 address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>
>

mohsen (agha-mohsena) said : #7

@ Bruno

I tried to overwrite the state; however after overwriting JCFpmState parameters have no initial value and parameters should be assigned again that is not sensible.
I think the source should be modified.

Chareyre (bruno-chareyre-9) said : #8

>
>
> I think the source should be modified.
>

Feel free.
Bruno

>

Can you help with this problem?

Provide an answer of your own, or ask mohsen for more information if necessary.

To post a message you must log in.