Re: [Yade-users] [Question #691584]: About periodic simple shear

2020-06-29 Thread Lei Hang
Question #691584 on Yade changed:
https://answers.launchpad.net/yade/+question/691584

Status: Solved => Open

Lei Hang is still having a problem:
Hello,

When I study the yade script about periodic simple shear test, I don't
understand some places. The periodic simple shear script link is
following:

https://gitlab.com/yade-dev/trunk/blob/master/doc/sphinx/tutorial/04
-periodic-simple-shear.py

I want to ask several questions:
1.What is the meaning of "O.cell.hSize=Matrix3(2,0,0, 0,2,0, 0,0,2)"? What is 
the meaning of the numbers in the Matrix?

2."pack.regularHexa(pack.inAlignedBox((0,0,0),(2,2,2)),radius=.1,gap=0,color=(0,0,1))".
What is the meaning of the "color=(0,0,1)"? In some other scripts I also
see "color=(1,1,1)"

3.What is the meaning of "O.cell.velGrad=Matrix3(-.1,0,0, 0,-.1,0,
0,0,-.1)"? What is the meaning of the numbers in the Matrix? In the
"Checkstress()" part, it changes to "O.cell.velGrad=Matrix3(0,0,.1,
0,0,0, 0,0,0)"

4.What is the meaning of "O.cell.trsf[0,2]" in the "checkDistorsion"
part? What do the numbers in the "trsf" mean?

5.In
"plot.addData(exz=O.cell.trsf[0,2],szz=stress[2,2],sxz=stress[0,2],tanPhi=(stress[0,2]/stress[2,2])
if stress[2,2]!=0 else 0,i=O.iter)" part,What is the meaning of the
number in the "streess[]"? For example, "stress[2,2]" or "stess[0,2]"

Thank you very much for your kindly help!

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691584]: About periodic simple shear

2020-06-29 Thread Lei Hang
Question #691584 on Yade changed:
https://answers.launchpad.net/yade/+question/691584

Status: Answered => Solved

Lei Hang confirmed that the question is solved:
Thanks Jan Stránský, that solved my question.

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691584]: About periodic simple shear

2020-06-29 Thread Jan Stránský
Question #691584 on Yade changed:
https://answers.launchpad.net/yade/+question/691584

Status: Open => Answered

Jan Stránský proposed the following answer:
Because you can easily choose one scenario or the other just by replacing 0 
with 1 or vice versa.
The value "0" or "1" is not hardcoded, it is there to enable quick and easy 
selection.


If you know your final script needs just the "else" scenario, then just write 
that one.

But in the case of the chosen script, you can choose loose packing or you can 
choose densePacking.
If you let "if 0:", then you are using loose packing
If you change it to "if 1:", then you are using dense packing.
Then if you change it back to "if 0:", you use loose packing.
Then ...
everything by changing just one symbol. That is the meaning of it. 

You could modify it e.g. in a more readable (but more verbose at the same time) 
code:
###
useLoosePacking = True
useDensePacking = False
# check that exactly one value is set to True
assert useLoosePacking or useDensePacking is True # at least one is True
assert useLoosePacking and useDensePacking is False # not both are True
#
if useLoosePacking:
   createLoosePacking() # possibly a long code block
elif useDensePacking:
   createDensePacking() # possibly a long code block
###

cheers
Jan

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691584]: About periodic simple shear

2020-06-29 Thread Lei Hang
Question #691584 on Yade changed:
https://answers.launchpad.net/yade/+question/691584

Status: Answered => Open

Lei Hang is still having a problem:
Thanks for your quick help Jan! But I still don't understand (as the "if
0:" block is never executed and therefore "else" is always executed).
The "if 0:" block is never executed, why we add the "if 0:"block? why we
not just write the content of "else:" block? The same in "if 1:...,
else:..."block, why we not just write the content of "if 1:"?

Thank you for your help!

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691593]: avoid this message : "The constructor with a shareWidget is deprecated, use the regular contructor instead."

2020-06-29 Thread Jérôme Duriez
Question #691593 on Yade changed:
https://answers.launchpad.net/yade/+question/691593

Jérôme Duriez posted a new comment:
Hi,

I guess it comes from graphical-display-related files like this one [*],
which should be updated to account for a new behaviour of some third
party library. At least, that message does not come directly from YADE
[**]

[*]
https://gitlab.com/yade-dev/trunk/-/blob/master/gui/qt5/GLViewer.cpp

[**]
mkdir Test
cd Test
git clone https://gitlab.com/yade-dev/trunk.git
cd trunk
grep -r 'The constructor with a shareWidget is deprecated, use the regular 
contructor instead.' # returns nothing

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691171]: add uniform fibers to the cylinder-shape specimen

2020-06-29 Thread Jan Stránský
Question #691171 on Yade changed:
https://answers.launchpad.net/yade/+question/691171

Jan Stránský posted a new comment:
Concerning randomOrientation, it is now part of Yade as utils.randomOrientation 
[1]
cheers
Jan

[1] https://gitlab.com/yade-
dev/trunk/-/commit/def6c071a181a83dd00c270179bd7d531311ab9d

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691285]: Extract Normals and Shears/tangentials forces on a ballMill

2020-06-29 Thread Jan Stránský
Question #691285 on Yade changed:
https://answers.launchpad.net/yade/+question/691285

Status: Needs information => Answered

Jan Stránský proposed the following answer:
You have access to the interactions and forces both in Python and in the
saved files, you can do whatever you want with them.. getting number of
them as well as the summation seems like trivial task..

Yes, simple summation of the forces will give you the result of the total 
force, which is the sum of the (x,y,z) components..
If it is not what you are looking for, then please describe more in detail what 
you are looking for.

Also next time please provide the code, there might be some
misunderstanding in the words.

in Python:
###
# extract relevant interactions
inrs = [i for i in O.interactions if isinstance(O.bodies[i.id1].shape,Facet) or 
isinstance(O.bodies[i.id2].shape,Facet)]
# get data
numberOfInteractions = len(intrs)
totalNormalForce = sum((i.phys.normalForce for i in intrs), Vector3.Zero)
totalNormalForceMagnitude = sum(i.phys.normalForce.norm() for i in intrs)
###

cheers
Jan

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691285]: Extract Normals and Shears/tangentials forces on a ballMill

2020-06-29 Thread NGANDU KALALA Gauthier
Question #691285 on Yade changed:
https://answers.launchpad.net/yade/+question/691285

NGANDU KALALA Gauthier posted a new comment:
The problem is that I'm not sure that a simple somation for each
interaction force will give me the result of the total forces of the
interactions during each iteration (time step).

When I use the sum function, instead of getting the total sum of interactions, 
it calculates the sum of the components (x,y,z) in a vector; this is not at all 
what I'm looking for.
I don't know if there is a way to insert a loop over the itérations (time 
step), in which  oui can extract the resultant of the interaction forces for 
each iteration.

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691548]: periodic boundary in axial direction for particles in cylinder pipe

2020-06-29 Thread Son Tung Dang
Question #691548 on Yade changed:
https://answers.launchpad.net/yade/+question/691548

Status: Answered => Solved

Son Tung Dang confirmed that the question is solved:
I got it. 
Thank you for your time and effort. 
All best,
Tung

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691285]: Extract Normals and Shears/tangentials forces on a ballMill

2020-06-29 Thread Jan Stránský
Question #691285 on Yade changed:
https://answers.launchpad.net/yade/+question/691285

Status: Open => Needs information

Jan Stránský requested more information:
Hello,

> I can calculate for each interaction the normal impact force between a ball 
> and the cylinder at each time step.
> I would rather record for each time step, the number of interactions, as well 
> as the total normal force due to all its interactions in a time t.

if you have data for all interaction, what is the problem to get overall
data?

cheers
Jan

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691548]: periodic boundary in axial direction for particles in cylinder pipe

2020-06-29 Thread Jan Stránský
Question #691548 on Yade changed:
https://answers.launchpad.net/yade/+question/691548

Status: Open => Answered

Jan Stránský proposed the following answer:
> how can I modify the size of periodic cell?

O.cell.setBox(x,y,z) # [1]

but the cell size has no effect on this "4 pieces problem" if the center of 
cylinder is at (0,0,0).
My suggestion was to let the cell as it is, just "shift" the simulation: 
increase all x and y coordinates by a number to shift the cylinder "in the 
middle".

> In addition, It also have the same observation as you are after
O.step(). Is that normal?

no, it is not... I have no idea about the reason, especially as the first 
iteration is OK.. I have checked b.state.pos, vel, angVel and everything looks 
OK..
(sometimes I have this issue if my simulation is unstable and the particle fly 
away to "infinity", but it is not this case)

cheers
Jan

[1] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Cell.setBox

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691285]: Extract Normals and Shears/tangentials forces on a ballMill

2020-06-29 Thread NGANDU KALALA Gauthier
Question #691285 on Yade changed:
https://answers.launchpad.net/yade/+question/691285

Status: Solved => Open

NGANDU KALALA Gauthier is still having a problem:
Dear All,

With this piece of code, I can calculate for each interaction the normal impact 
force between a ball and the cylinder at each time step. The result is such 
that, by recording the time vector with time = O.time, the code registers the 
time of interaction. This is a good thing. However if I have ten interactions 
at the instant 0.0502s for instance, O.time, gives me a vector with 0.0502s 
repeated 10 times. This makes it difficult for me to calculate the spectrum of 
my signal with such a time vector.
What I would like to improve in my code is :
Rather than recording for each interaction the normal force and the time of 
interaction, I would rather record for each time step, the number of 
interactions, as well as the total normal force due to all its interactions in 
a time t.
 That way, I would have an easier signal to interpret.

Someone could help me to improve my code?

###
O.engines=[
  ForceResetter(),
  InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Wall_Aabb()]),

  InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),
 Ig2_Facet_Sphere_ScGeom(),
 Ig2_Wall_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_MindlinPhys()],
[Law2_ScGeom_MindlinPhys_Mindlin()]
  ),

  NewtonIntegrator(damping=0,gravity=[0,0,-9.81]),

  RotationEngine(ids=liner,rotationAxis=[0,-1,0],rotateAroundZero=True,
 angularVelocity=omega),
  PyRunner(command='saveForces()',iterPeriod=1)
]

def saveForces():

  for i in O.interactions:

if isinstance(O.bodies[i.id1].shape,Facet) or 
isinstance(O.bodies[i.id2].shape,Facet):
  fn = tuple((i.phys.normalForce))
  time  = O.time

# Save Total force 
  out=open(os.getcwd()+'/output/normalForce','a')
  out.write('%s\n'%str(fn))
  out.close()

O.dt = .95*PWaveTimeStep()
O.run(int(math.ceil(tEnd/O.dt))+1)

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


[Yade-users] [Question #691593]: avoid this message : "The constructor with a shareWidget is deprecated, use the regular contructor instead."

2020-06-29 Thread Luc OGER
New question #691593 on Yade:
https://answers.launchpad.net/yade/+question/691593

Dear sir,

It i not a crucial point... but I want to avoid having this warning message at 
each run of a yade script:"The constructor with a shareWidget is deprecated, 
use the regular contructor instead."
I am using the latest compiled version of yade from june : 
2020-06-23.git-f03a37c on  Opensuse 15.1

how and where to modifiy things to do it?

Luc 

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691548]: periodic boundary in axial direction for particles in cylinder pipe

2020-06-29 Thread Son Tung Dang
Question #691548 on Yade changed:
https://answers.launchpad.net/yade/+question/691548

Status: Answered => Open

Son Tung Dang is still having a problem:
I got it. Thanks!
Could you please tell me how can I modify the size of periodic cell?  
In addition, It also have the same observation as you are after O.step(). Is 
that normal?
All best,
Tung

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691407]: Paraview crashes when pressing apply buttom of the micro-strain vtk file

2020-06-29 Thread Chien-Cheng Hung
Question #691407 on Yade changed:
https://answers.launchpad.net/yade/+question/691407

Chien-Cheng Hung posted a new comment:
Hi Jan,

Sorry for my inconsistency and thank you for your time.
I will keep looking for other possibilities.

Cheers,
Chien-Cheng

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691407]: Paraview crashes when pressing apply buttom of the micro-strain vtk file

2020-06-29 Thread Jan Stránský
Question #691407 on Yade changed:
https://answers.launchpad.net/yade/+question/691407

Jan Stránský posted a new comment:
>> Are you using the script from [1], or something else?
> I am using the same script from [1].
> Maybe it's related to my code.

next time please be more consistent, I have tested everything on [1]

with your code, my paraview crashes while trying to load the oustout strain.vtk 
file, too..
I had a look, but did not find anything suspicious..
I have no idea what could be the reason..

cheers
Jan

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691548]: periodic boundary in axial direction for particles in cylinder pipe

2020-06-29 Thread Jan Stránský
Question #691548 on Yade changed:
https://answers.launchpad.net/yade/+question/691548

Status: Open => Answered

Jan Stránský proposed the following answer:
The split in 4 pieces is perfectly OK because for the visualization purposes, 
the true position is wrapped into the periodic cell. If you have cylinder 
around point (0,0,0), its negative coordinates are displayed in corresponding 
"image" corners.
It has no effect on the simulation, which (being periodic) still simulates the 
cylinder as a compact cylinder.

If you don't like it, shift the simulation by half size of the periodic
cell (to have the cylinder "in the middle") or switch to another
visualization tool.

Just to make it clear, splitting in 4 pieces or shifting the simulation
has no effect on the simulation, it is just visualization and its
adjustment.

cheers
Jan

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691548]: periodic boundary in axial direction for particles in cylinder pipe

2020-06-29 Thread Son Tung Dang
Question #691548 on Yade changed:
https://answers.launchpad.net/yade/+question/691548

Status: Needs information => Open

Son Tung Dang gave more information on the question:
Hi Jan.
Thank you for your comment.
I have a cylinder splitting in 4 pieces. And it is a strange result I observed.
All best,
Tung

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691407]: Paraview crashes when pressing apply buttom of the micro-strain vtk file

2020-06-29 Thread Chien-Cheng Hung
Question #691407 on Yade changed:
https://answers.launchpad.net/yade/+question/691407

Chien-Cheng Hung gave more information on the question:
Hi Jan,

Thanks for your email.

I've tested your microstrain vtk file and it works with my Paraview. So
I think the crash is not related to the Paraview version (btw my
Paraview version is 5.0.1 (64-bit)). Maybe it's related to my code.
Could you help me have a look? I'd appreciate that.

### My simplified code (direct shear simulation of a granular layer)
from yade import pack,plot,export
import numpy as np
import math

sp1=pack.SpherePack()
sp2=pack.SpherePack()
sp3=pack.SpherePack()

O.periodic=True

# dimensions of sample
RADIUS=0.25
a=15
b=1
c=1
length=a*(2*RADIUS)
height=length/b
width=length/c
thickness=RADIUS

### Guassian distribution
psdSizes=[.456,.5,.544]
psdCumm=[0,0.5,1]

# friction angles 
wallFRIC=0
boundaryFRIC=0.5
spFRIC=0.5

# boundary conditions
PI=1.e5
SN=5.e6 # normal stress
RATE_NS1=1 # velocity of top plate during compaction
RATE_NS2=1 # velocity of top plate during shear
RATE_shear=1 # shear velocity
roll_stiff=0
roll_fric=0

# simulation control
DAMPSHEAR=0.

O.cell.hSize=Matrix3(length,0,0,0,3*height,0,0,0,width)

O.materials.append(FrictMat(density=3000,young=1e8,poisson=0.5,frictionAngle=wallFRIC,label='boxMat'))
O.materials.append(FrictMat(density=3000,young=1e8,poisson=0.5,frictionAngle=boundaryFRIC,label='boundaryMat'))
O.materials.append(FrictMat(density=3000,young=1e8,poisson=0.5,frictionAngle=spFRIC,label='sphereMat'))

upBox = 
utils.box(center=(length/2,2*height+thickness,1.5*width),orientation=Quaternion(1,0,0,0),extents=(2*length,thickness/2.,width),fixed=1,wire=False,color=(1,0,0),material='boxMat')
lowBox = 
utils.box(center=(length/2,height-thickness,1.5*width),orientation=Quaternion(1,0,0,0),extents=(2*length,thickness/2.,width),fixed=1,wire=False,color=(1,0,0),material='boxMat')

O.bodies.append([upBox,lowBox])

sp1.makeCloud((0,height+3*RADIUS,width),(length,2*height-3*RADIUS,2*width), 
psdSizes =psdSizes, psdCumm =psdCumm, periodic=True, seed =1)
sp2.makeCloud((0,height+RADIUS,width),(length,height+RADIUS-1e-10,2*width), 
rMean=RADIUS, periodic=True, seed =1)
sp3.makeCloud((0,2*height-RADIUS,width),(length,2*height-RADIUS-1e-10,2*width), 
rMean=RADIUS, periodic=True, seed =1)

sphere_id = 
O.bodies.append([utils.sphere(s[0],s[1],color=(0,0,1),material='sphereMat') for 
s in sp1])
bottomLayer_id = 
O.bodies.append([utils.sphere(s[0],s[1],color=(1,0,1),material='boundaryMat') 
for s in sp2])
topLayer_id = 
O.bodies.append([utils.sphere(s[0],s[1],color=(1,0,1),material='boundaryMat') 
for s in sp3])

effCellVol=(O.bodies[0].state.pos[1]-O.bodies[1].state.pos[1])*O.cell.hSize[0,0]*O.cell.hSize[2,2]
volRatio=(O.cell.hSize[0,0]*O.cell.hSize[1,1]*O.cell.hSize[2,2])/effCellVol

O.engines=[
 ForceResetter()
 
,InsertionSortCollider([Bo1_Box_Aabb(),Bo1_Sphere_Aabb()],verletDist=-0.1,allowBiggerThanPeriod=True)
 ,InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Box_Sphere_ScGeom6D()],
  [Ip2_FrictMat_FrictMat_MindlinPhys(krot=roll_stiff,eta=roll_fric)],
  [Law2_ScGeom_MindlinPhys_Mindlin(includeMoment=True)]
 )
 
,GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=1,timestepSafetyCoefficient=0.8,defaultDt=-1)
 
,PyRunner(command='fixVelocity(RATE_shear)',iterPeriod=1,label='fixVel',dead=True)
 
,PeriTriaxController(dynCell=True,mass=10,maxUnbalanced=1e-3,relStressTol=1e-4,stressMask=7,goal=(-PI/volRatio,-PI/volRatio,-PI/volRatio),globUpdate=1,maxStrainRate=(1,1,1),doneHook='triaxDone()',label='triax')
 ,NewtonIntegrator(gravity=(0,0,0),damping=0.3,label='newton')
 ]

def triaxDone():
 global phase
 
volRatio=(O.cell.hSize[0,0]*O.cell.hSize[1,1]*O.cell.hSize[2,2])/((O.bodies[0].state.pos[1]-O.bodies[1].state.pos[1])*O.cell.hSize[0,0]*O.cell.hSize[2,2])
 h=O.bodies[0].state.pos[1]-O.bodies[1].state.pos[1]
 vol=h*O.cell.hSize[0,0]*O.cell.hSize[2,2]
 contactStress=getStress(vol)
 vol_s=Rmean=Rmax=nbSph=0
 Rmin=1e6
 x_ref=O.bodies[0].state.pos[0]
 for o in O.bodies:
  if isinstance(o.shape,Sphere):
   nbSph+=1
   Rmean+=o.shape.radius
   if o.shape.radius>Rmax: Rmax=o.shape.radius
   if o.shape.radius 1:
O.pause()

O.run(1,1)

TW=TesselationWrapper()
TW.triangulate()
TW.computeVolumes()
TW.volume(10)
TW.setState(0)
O.run(100,True)
TW.setState(1)
TW.defToVtk("strain.vtk")

###

Cheers,
Chien-Cheng

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691407]: Paraview crashes when pressing apply buttom of the micro-strain vtk file

2020-06-29 Thread Jan Stránský
Question #691407 on Yade changed:
https://answers.launchpad.net/yade/+question/691407

Jan Stránský posted a new comment:
What version is the Paraview you use?

> Is it possible that Paraview cannot read the output microstrain file
(a plain text file)?

it is possible (e.g. there can be some NaN with which the export code
creator did not count)

> Or perhaps you could share me a workable microstrain file for letting
me test it?

sent to personal email

cheers
Jan

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691407]: Paraview crashes when pressing apply buttom of the micro-strain vtk file

2020-06-29 Thread Chien-Cheng Hung
Question #691407 on Yade changed:
https://answers.launchpad.net/yade/+question/691407

Chien-Cheng Hung gave more information on the question:
Hi Jan,

I've updated my Yade version to the latest one - 2020-06-23.git-f03a37c and 
reran the simulation to get a new microstrain file.
But the Paraview still crashes when I apply the file.
Is it possible that Paraview cannot read the output microstrain file (a plain 
text file)? Or perhaps you could share me a workable microstrain file for 
letting me test it?
Thank you.

Cheers,
Chien-Cheng

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691590]: what is the equivelant command of O.bodies[].dynamic=False for pfacet

2020-06-29 Thread Jan Stránský
Question #691590 on Yade changed:
https://answers.launchpad.net/yade/+question/691590

Status: Open => Needs information

Jan Stránský requested more information:
Hello,

> i am new user in yade

welcome :-)

and please read [1], especially:
- point 5 (next time please split your question, here clearly problem 1 and 2 
are unrelated)
- section "Please, no external links!" (related to .gts files)

> i have 2 problems:

how is the title of your question related to these 2 problems and to the
question in general? After a quick look it seems like a 3rd problem..

> 1. the whole geometry is falling down
>
> fixed=False
> nodesIds1,cylIds1,pfIds1 = gtsPFacet(...,fixed=fixed,...)
> NewtonIntegrator(gravity=(0,0,-9.81),damping=0.1,label='newton')

you have explicitly set gravity and explicitly made the bodies not to be
fixed, why is falling a problem then?

> 2.how to save in a text file (or list) the ids of pfacet

please be more specific.
one specific pfacet or all pfacetS?
what does "save in a list" mean?
what is "ids of pfacet"? ids of its nodes?

cheers
Jan

[1] https://www.yade-dem.org/wiki/Howtoask

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


[Yade-users] [Question #691590]: what is the equivelant command of O.bodies[].dynamic=False for pfacet

2020-06-29 Thread hiba khalifeh
New question #691590 on Yade:
https://answers.launchpad.net/yade/+question/691590

i am new user in yade. i am using 
Welcome to Yade 20200528-3950~da5194f~xenial1 
Using python version: 3.5.2 (default, Apr 16 2020, 17:47:17) 
[GCC 5.4.0 20160609]
Ubunto 16.04

***
i have 2 problems:

   1. the whole geometry is falling down
   2.how to save in a text file (or list) the ids of pfacet 


hiba

#Script

from __future__ import print_function
from yade import qt
from yade.gridpfacet import *
import gts, os.path, locale
from builtins import range
from numpy import arange
import numpy as np
import random
from yade import plot
from yade import pack


locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')   # Note: gts is 
locale-dependent. If, for example, german locale is used, gts.read()-function 
does not import floats normally

#'''if you get "Error: unsupported locale setting"-> type as root: 
"dpkg-reconfigure locales"-> choose "en_US.UTF-8" (press space to choose)'''

#ENGINES***
#***
def checkUnbalanced():
   print ('iter %d, time elapsed %f, unbalanced forces = %f'%(O.iter, 
O.realtime, utils.unbalancedForce()))
   #if unbalancedForce()<.05:  # to ensure stability
  #O.pause()
  #plot.saveDataTxt('strawbale-static-state.txt.bz2')

for b in O.bodies:
   b.state.refPos = b.state.pos

def addPlotData():
   Fz=O.forces.f(1)[2]
   w=O.bodies[1].state.pos[2]-O.bodies[1].state.refPos[2]
   plot.addData(Fz=Fz,w=w,unbalanced=unbalancedForce(),i=O.iter,p=O.realtime)


O.engines=[
ForceResetter(),
InsertionSortCollider([
Bo1_Wall_Aabb(),
Bo1_PFacet_Aabb(),
],sortThenCollide=True),
InteractionLoop(
[
Ig2_GridNode_GridNode_GridNodeGeom6D(),
Ig2_Wall_PFacet_ScGeom(),Ig2_Wall_Sphere_ScGeom()
],
[

Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=True),
Ip2_FrictMat_FrictMat_FrictPhys()],
[
Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
Law2_ScGeom_FrictPhys_CundallStrack(),
Law2_ScGridCoGeom_FrictPhys_CundallStrack(),
Law2_GridCoGridCoGeom_FrictPhys_CundallStrack()
]),
GlobalStiffnessTimeStepper(timestepSafetyCoefficient=0.005,label='ts'), 
NewtonIntegrator(gravity=(0,0,-9.81),damping=0.1,label='newton')
]

#MATERIAL*
#Straw material
O.materials.append(LinCohesiveStiffPropDampElastMat(youngmodulus=3e7,density=120,label='pFacetMat'))
O.materials.append(CohFrictMat(young=3e7,poisson=0.2,density=120,frictionAngle=radians(45),normalCohesion=1e100,shearCohesion=1e100,momentRotationLaw=True,label='gridNodeMat'))

# wood material
O.materials.append(LinCohesiveStiffPropDampElastMat(youngmodulus=8.5e9,density=740,label='pFacetMatwood'))
O.materials.append(CohFrictMat(young=8.5e9,poisson=0.2,density=740,frictionAngle=radians(38),normalCohesion=1e100,shearCohesion=1e100,momentRotationLaw=True,label='gridNodeMatwood'))



#IMPORT MESH *

radius=1e-02
wire=False
fixed=False


color1=[0,0,1]
color2=[0,0,3]

# COMPOSITION OF RANGE 1 level 1   
***
#*

nodesIds1,cylIds1,pfIds1 =  
gtsPFacet('strawbalehor.gts',shift=(0.36,0.18,.23),scale=1,radius=radius,wire=wire,fixed=fixed,materialNodes='gridNodeMat',material='pFacetMat',color=color1)
nodesIds2,cylIds2,pfIds2 =  
gtsPFacet('strawbalehor.gts',shift=(1.08,0.18,.23),scale=1,radius=radius,wire=wire,fixed=fixed,materialNodes='gridNodeMat',material='pFacetMat',color=color2)
nodesIds3,cylIds3,pfIds3 =  
gtsPFacet('strawbalehor.gts',shift=(1.8,0.18,.23),scale=1,radius=radius,wire=wire,fixed=fixed,materialNodes='gridNodeMat',material='pFacetMat',color=color1)
nodesIds4,cylIds4,pfIds4 =  
gtsPFacet('strawbalever.gts',shift=(1.98,0.72,.23),scale=1,radius=radius,wire=wire,fixed=fixed,materialNodes='gridNodeMat',material='pFacetMat',color=color2)
nodesIds5,cylIds5,pfIds5 =  
gtsPFacet('strawbalever.gts',shift=(1.98,1.44,.23),scale=1,radius=radius,wire=wire,fixed=fixed,materialNodes='gridNodeMat',material='pFacetMat',color=color1)
nodesIds6,cylIds6,pfIds6 =  
gtsPFacet('strawbalehor.gts',shift=(1.8,1.98,.23),scale=1,radius=radius,wire=wire,fixed=fixed,materialNodes='gridNodeMat',material='pFacetMat',color=color2)
nodesIds7,cylIds7,pfIds7 =  
gtsPFacet('strawbalehor.gts',shift=(1.08,1.98,.23),scale=1,radius=radius,wire=wire,fixed=fixed,materialNodes='gridNodeMat',material='pFacetMat',color=color1)
nodesIds8,cylIds8,pfIds8 =  

Re: [Yade-users] [Question #691573]: How to creat 2D random dense pack in a disc-shape plane?

2020-06-29 Thread Jan Stránský
Question #691573 on Yade changed:
https://answers.launchpad.net/yade/+question/691573

Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,

it seems you will have to write your own randomDensePack, i.e. creating a loose 
packing and compressing it.
You can (depending on your needs):
- create a dense rectangle and "crop" it to be a circle
- or using a circular boundary* for compaction

* circular boundary might be:
- facets or boxes discretizing the circle
- new Shape dedicated for this task

cheers
Jan

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691548]: periodic boundary in axial direction for particles in cylinder pipe

2020-06-29 Thread Jan Stránský
Question #691548 on Yade changed:
https://answers.launchpad.net/yade/+question/691548

Status: Open => Needs information

Jan Stránský requested more information:
Hello,

why exactly you find the results strange (cylinder split in 4 pieces, ...)?
What exactly are actually "results" (GUI view, some saved data, ...)
What is the meaning of the wall?

I have tried the code, but after O.step(), the step takes too much time,
do you have same observations?

cheers
Jan

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691584]: About periodic simple shear

2020-06-29 Thread Jan Stránský
Question #691584 on Yade changed:
https://answers.launchpad.net/yade/+question/691584

Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,

> I am a new user for yade

welcome :-)

next time please provide also a link to the script

This pattern is to easy switch between two different scenarios
Suppose:
###
if 0:
   createLoosePacking() # possibly a long code block
else:
   createDensePacking() # possibly a long code block
###

As it is, with "if 0:", is equivalent to (as the "if 0:" block is never 
executed and therefore "else" is always executed):
createDensePacking() # possibly a long code block

If you change it to
###
if 1:
   createLoosePacking() # possibly a long code block
else:
   createDensePacking() # possibly a long code block
###

then it is equivalent to (as "if 1" is always executed and therefore "else" is 
never executed):
createLoosePacking() # possibly a long code block

This way you can choose one scenario or the other just by altering 0/1
after the "if" keyword.

HTH
cheers
Jan

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #691560]: contact normal is not spherical

2020-06-29 Thread Jan Stránský
Question #691560 on Yade changed:
https://answers.launchpad.net/yade/+question/691560

Status: Open => Needs information

Jan Stránský requested more information:
Hello,
please provide a MWE [1] illustrating result, how you measured "contact normal".
To not-just-guess (out of mny possible reasons), we need your code.
cheers
Jan

[1] https://www.yade-dem.org/wiki/Howtoask

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp