Stop Sim After Reaching StressTriaxController Goal from doneHook?
Hello,
I'm compacting a specimen with the PeriTriaxContro
Normally when I am using just the PeriTriaxContro
Any suggestions?
MWE below:
#######
from __future__ import print_function
from yade import pack, qt, plot, export
sigmaIso = -1e5
# define materials
O.materials.
isCohesive=
O.materials.
density=0, isCohesive=False, momentRotationL
# set periodic boundaries
O.periodic = False
# define log-linear psd
dmin, dmax = 0.07, 0.13
start, end = numpy.log10(dmin), numpy.log10(dmax)
psdSizes = numpy.logspace(
psdCumm = numpy.linspace(0, 1., len(psdSizes))
# make packing
sp = pack.SpherePack()
sp.makeCloud((0, 0, 0), (1, 1, 1), psdSizes=psdSizes, psdCumm=psdCumm, periodic=True)
sp.toSimulation
O.engines = [
# use adaptive stiffness-based timestepper
# set to True for domain decomp
),
# specify target values and whether they are strains or stresses
# type of servo-control
# wait until the unbalanced force goes below this value
# call this function when goal is reached and the packing is stable
),
]
def addPlotData():
plot.addData(
i=O.iter,
**O.energy
)
# enable energy tracking in the code
O.trackEnergy = True
# define what to plot
plot.plots = {
'i': ('unbalanced',),
'i ': ('sxx', 'syy', 'szz', 'pmw'),
' i': ('exx', 'eyy', 'ezz'),
# energy plot
' i ': (O.energy.keys, None, 'Etot'),
}
# show the plot
plot.plot()
def changeBC():
# turn off periodic boundaries
O.periodic=
# deactivate PeriTriaxController
triax.dead=True
# Update engines for walls
collider.
interaction
## switch to wall TriaxialStressC
# create and append 4 walls of a cube sized to our mn, mx parameters
mn, mx = yade._utils.
walls = aabbWalls([mn, mx], thickness=0, material='walls')
wallIds = O.bodies.
# update wall triax goals, assign aabbWall Ids to triax..
triaxw.
triaxw.
triaxw.
triaxw.
triaxw.
triaxw.
triaxw.
triaxw.
triaxw.
triaxw.
# activate wall triax
triaxw.
# Stop once reach goal stress (does not work?)
O.run()
while True:
if unbalancedForce() < 1e-5 and abs((sigmaIso-
break
O.pause()
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jan Stránský
- Solved:
- Last query:
- Last reply: