stressMask

Asked by dan.wang

Hi!
I want to know the stressMask 's meanning in Peri3dController.
in your official document, it sais:

stressMask(=0, all strains)¶

    mask determining whether components of goal are strain (0) or stress (1). The order is 00,11,22,12,02,01 from the least significant bit. (e.g. 0b000011 is stress 00 and stress 11).

can u explain what is it mean?i cant understand it.

 if i use the order
label.stressMask=0b000011

or if i use
label.stressMask=0b100001
what does it mean?
---------------------------------------------------------------------------------------------------------------------------------------------------------------
you can use the following code:
#!/usr/bin/python # This is server.py file
import string
from yade import plot,qt
from yade.pack import *
from yade import pack, plot
import socket # Import socket module

O.materials.append(CpmMat(damLaw=0,young=170e9,density=4800,frictionAngle=atan(0.8),poisson=0.4,sigmaT=20e8,epsCrackOnset=0.8e-4,relDuctility=300))
initSize=0.028

sp=pack.randomPeriPack(radius=.000625,initSize=Vector3(initSize,initSize,initSize))
O.periodic=True
sp.toSimulation()

O.save('/tmp/cccc.gz')

O.dt=1e-7

plot.plots={'ex':('sx',)}
def plotAddData():
 plot.addData(
  sx=p3d.stress[1],
  ex=p3d.strain[1],
 )

EnlargeFactor=1.5
EnlargeFactor=1.0
O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=EnlargeFactor,label='bo1s')]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=EnlargeFactor,label='ig2ss')],
  [Ip2_CpmMat_CpmMat_CpmPhys()],[Law2_ScGeom_CpmPhys_Cpm()]),
 NewtonIntegrator(),
 Peri3dController(

       nSteps=10000, # how many time steps the simulation will last
       # after reaching nSteps do doneHook action
       doneHook='print "Simulation with Peri3dController finished."; O.pause()',

       label='p3d'
       ),
 PyRunner(command='plotAddData()',iterPeriod=1),
]

p3d.stressMask=0b100001 # prescribed ex,ey,sz,syz,ezx,sxy; e..strain; s..stress
p3d.goal=(0,-0.008,0,0,0,0) #xx, yy, zz, yz, zx, xy

O.step()
bo1s.aabbEnlargeFactor=ig2ss.interactionDetectionFactor=1.
O.run(); O.wait()
plot.saveDataTxt('biaozhun.txt')
plot.plot(subPlots=False)

-----------------------------------------------------------------------------------------------
the model is used to add strain on the model till the stain is [0,-0.008,0,0,0,0],so what is the use of stressMask?
if i delete "p3d.stressMask=0b100001 ", what will it happen?

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Hi,
It is simpler to manipulate the bitmask as an integer value.
00,11,22,12,02,01 are represented respectively by 1,2,4,8,16,32 (i.e. 2^k)
Now (00 AND 02) is represented by stressMask=1+16=17.
stressMask=0 means none of them are stress-controlled.
I hope it helps
Bruno

Revision history for this message
Jan Stránský (honzik) said :
#2

in binary representation:
1 means stress controlled direction
0 means strain controlled direction

you can use this functions to play with:
##########
def array2mask(xx,yy,zz,yz,zx,xy):
 ret = 0
 ret |= xx << 0
 ret |= yy << 1
 ret |= zz << 2
 ret |= yz << 3
 ret |= zx << 4
 ret |= xy << 5
 return ret

def pprint(v):
 print "0b{:06b}".format(v)
pprint(array2mask(0,0,0, 0,0,0)) # everything strain controlled
pprint(array2mask(1,1,1, 1,1,1)) # everythin stress controlled
pprint(array2mask(0,1,1, 1,1,1)) # xx strain controled, otherwise stress controled. With goal=(v,0,0, 0,0,0) = uniaxial strain with all stress 0 except axial xx stress
pprint(array2mask(0,0,1, 0,1,0)) # something random
##########

label.stressMask=0b000011:
stress controlled: xx,yy
strain controlled: zz,yz,zx,xy

label.stressMask=0b100001
stress controlled: xx, xy
strain controlled: yy,zz,yz,zx

cheers
Jan

Can you help with this problem?

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

To post a message you must log in.