# how to get fabric tensor and micro information?

Asked by ehsan benabbas on 2019-10-11

Hi,

I'm new with Yade and using it for my Ph.D. work in Geotechnics. I have coded a simple triaxial test but don't know how can I get micro-scale information such as fabric tensor, contact normal, branch vectors, interparticle forces, strains, etc.

My supervisor asked me to provide all of those in 2 days and I have no idea what should I do :-(

Would you please tell me how I can get that information? (and also if my code has any issue)

This is my code:
*********

# encoding: utf-8
# the script demonstrates a simple case of triaxial simulation using TriaxialCompressionEngine.

sp=pack.Spherepack()

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

## box between mn and mx, average radius -+ 1/2(20%) , 2k spheres
sp.makeCloud(minCorner=mn,maxCorner=mx,rRelFuzz=0.2,num=2000) # it can be defined based on porosity instead of num or even use a range of radius instead of a fixed radius

## create material #0, which will be used as defult
O.materials.append(FrictMat(young=15e6,poisson=0.4,frictionAngle=0,density=0,label='frictionless')) # for walls # density is 0 because these walls are not exist in real and they ae kind of virtual to force particles to be in our virtual box (we want walls just to be as boundaries)

## Assign section, copy spheres from the packing into the scene
## use defult material, don't care about that for now
## create walls around the packing
walls=aabbWalls(thickness=1e-10,material='frictionless') # assign material to walls # aabb models a cube boundary for the problem and Walls defines that the square will be created as walls ,,, thickness is so small due to not existence of walls (walls are virtual)
wallIds=O.bodies.append(walls) # assign ID to the walls

triax=TriaxialCompressionEngine(
wall_bottom_id=wallIds[2],
wall_top_id=wallIds[3],
wall_left_id=wallIds[0],
wall_right_id=wallIds[1],
wall_back_id=wallIds[4],
wall_front_id=wallIds[5],
internalCompaction=False,
## define the rest of triaxial parameters here, see in pkg/dem/PreProcessor/TriaxialTest.cpp:524 etc, which are assigned in the c++ preprocessor actually
sigmaIsoCompaction=-50e3,
sigmaLateralConfinement=-50e3,
max_vel=10,
strainRate=0.01,
label="triax",
)

O.engines=[
ForceResetter(), # reset forces on boundaries in each step
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]), # first arugemnt is a radisu which defines a certain lentgh to define collision between 2 particles, this lentgh consider as a spherical space or a circle and that's why we need a radius here
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()], # interaction between 2 particles or a particle and box
[Ip2_FrictMat_FrictMat_FrictPhys()], # FrictPhys is the Linear Elastic-Plastic Interaction
[Law2_ScGeom_FrictPhys_CundallStrack()] # # CundallStrack is the Linear Elastic-Plastic Interaction
),
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
triax,
# you can add TriaxialStateRecorder and such here...
NewtonIntegrato(damping=0.4)
]

O.engines=O.engines[0:5]+[PyRunner(iterPeriod=20,command='history()',label='recorder')]+O.engines[5:7]
def history():
s11=-triax.stress(0)[0],
s22=-triax.stress(2)[1],
s33=-triax.stress(4)[2],
i=O.iter)

plot.plots={'i':('e11','e22','e33',Non,'s11','s22','s33')}

O.saveTmp()
plot.plot()

*********
Thankyou

## Question information

Language:
English Edit question
Status:
For:
Assignee:
No assignee Edit question
Last query:
2019-10-11
2019-10-14
 Jérôme Duriez (jduriez) said on 2019-10-14: #1

Hi,

For instance, fabric tensor is at [*], contact normal is typically [**] and obtained typing
cont.geom.normal # with cont one Interaction object

If I were your supervisor, I would first ask you to read YADE documentation and get some YADE practice (this may take more than 2 days). It will help !