← Back to team overview

yade-users team mailing list archive

[Question #695821]: PeriTriaxController Load

 

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

Hi I'm having a little problem with the PeriTriaxController and saving and loading of simulations. Maybe one of you can help me.
I provided a MWE below. 

My Problems are:
 - When I first run the simulation everything works fine, but simulation doesn't stop when the strain -0.4 is reached, so I think the doneHook isn't triggered, but I don't know why 
 - When I rund the simulation for the second time, there is already the file 'three.yade.gz' containing the information of the first run. The problem here is that the shearing of the sample doesn't start. When looking at the output, it goes to phase 2, but there nothing happens. 

Thank you in advance for your help.
Johannes


# encoding: utf-8
from yade import pack, qt, plot

sigmaIso=-25000

Filename = 'three.yade.gz'
savedState = os.path.exists(Filename)

if not savedState:
    O.periodic=True
    O.cell.setBox(5,5,10)

    compFricDegree = 35
sphere=O.materials.append(FrictMat(young=1e7,poisson=0.5,density=2650,frictionAngle=radians(compFricDegree),label='sphere'))
    psdSizes,psdCumm = [0.99,1.01],[0,1.0]

    sp=pack.SpherePack()
    sp.makeCloud(Vector3(0,0,0),O.cell.refSize,psdSizes=psdSizes,psdCumm=psdCumm,num=1000,seed=1,distributeMass=True,periodic=True)
    sp.toSimulation()
else:
    O.load(Filename)

O.engines=[
    ForceResetter(),
    InsertionSortCollider([Bo1_Sphere_Aabb()]),
    InteractionLoop([Ig2_Sphere_Sphere_ScGeom()],
                    [Ip2_FrictMat_FrictMat_FrictPhys()],
                    [Law2_ScGeom_FrictPhys_CundallStrack()]
                    ),
    PeriTriaxController(    label='triax',
                            goal=(sigmaIso,sigmaIso,sigmaIso),
                            stressMask=7,
                            dynCell=True,
                            maxStrainRate=(1000,1000,1000),
                            maxUnbalanced=1e-3,
                            relStressTol=1e-3,
                            doneHook='triaxFinished()'
                        ),
    NewtonIntegrator(damping=.1),
]

O.dt=.5*PWaveTimeStep()

def triaxFinished():
    
    print 'Making decision'
    
    if not savedState:
        print 'Going to Phase 1'
        triax.doneHook = 'Phase_1()'
    else:
        print 'Going to Phase 2'
        triax.doneHook = 'Phase_2()'
    
def Phase_2():
    print 'Phase 2'
    O.cell.setBox(O.cell.size[0],O.cell.size[1],O.cell.size[2])
    triax.goal = (sigmaIso,sigmaIso,-0.4)
    triax.stressMask = 3
    triax.maxStrainRate = (0,0,0.05)
    triax.maxUnbalanced = 0.1
    triax.doneHook='Stop()'

def Phase_1():
    print 'Phase 1'
    O.save(Filename)
    print 'Saved'
    triax.doneHook = 'Phase_2()'

def Stop():
    O.pause()

def UnbalancedForce():
    print unbalancedForce(), triax.strain[2]

O.engines += [PyRunner(command='UnbalancedForce()',iterPeriod=1000)]


O.run()
O.SaveTmp()



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