Re: [Yade-users] [Question #686131]: flow.nCells() != "cell number" recorded by flow.saveVtk()

2019-11-22 Thread Lingran Zhang
Question #686131 on Yade changed:
https://answers.launchpad.net/yade/+question/686131

Status: Needs information => Open

Lingran Zhang gave more information on the question:
Hello Robert,

Thank you.

In my simulation, I get  flow.nCells()=383;  flow.getVertices(0)= [5, 68, 69, 
71].
It means that the particle ids comprising the the cell id=0 are 5, 68, 69, 71, 
right?

While when I open the VTK file printed by flow.saveVTK(), I read the following 
lines: 
CELLS 242 1210
4 38 41 37 39
4 31 28 36 11
…
>From my understanding, the VTK file tells me that I have 242 cells, each cell 
>include 4 vertices, the particle ids comprising the cell id=0 are 38, 41, 37, 
>39. Am I wrong?

So my questions are: how many finite cells are produced by the
triangulation, 383 or 242? What are the particle ids comprising each
cell, shall I find the answer from flow.getVertices(i) or
flow.saveVTK()?

Cheers,
Lingran

-- 
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 #684846]: what is the plastic part of normal displacement in law2-cohesionMoment

2019-11-22 Thread Leonard
Question #684846 on Yade changed:
https://answers.launchpad.net/yade/+question/684846

Status: Answered => Solved

Leonard confirmed that the question is solved:
Thanks Robert Caulk, 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 #686024]: micro strain-paraview

2019-11-22 Thread Alireza Sadeghi
Question #686024 on Yade changed:
https://answers.launchpad.net/yade/+question/686024

Status: Answered => Open

Alireza Sadeghi is still having a problem:
Dear Bruno,

Thank you very much for your reply.
I am not sure that the problem is in post processing. Because in low particles 
sample, the strain on the boundary is occurding to prescribed deformation, but 
when I increased the number of particles, the strain on the boundary does not 
follow the prescribed deformation. That is my problem.
What do you mean about prescribed motion to all bodies?Do you mean that I set a 
motion to each particle?What can it show?
thank you very much.

Best Regards,

Alireza

-- 
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 #686136]: Introducing a wide distribution of the value of a parameter in a contact law

2019-11-22 Thread Robert Caulk
Question #686136 on Yade changed:
https://answers.launchpad.net/yade/+question/686136

Status: Open => Answered

Robert Caulk proposed the following answer:
You can achieve this by looping on interaction physics and modifying the
values of interest [1]. Maybe it is obvious, but worth noting that you
need to do this *after* the interaction is created in yade.

for i in O.interactions:
i.phys.normalAdhesion = randomlyDistributedVariable


It is also worth mentioning that JCFpmPhys (a type of cohesive model) already 
has this functionality for a weibull distribution of contact strengths [2]. 

Cheers,

Robert

[1] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.CohFrictPhys
[2]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Ip2_JCFpmMat_JCFpmMat_JCFpmPhys.xSectionWeibullShapeParameter

-- 
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 #686131]: flow.nCells() != "cell number" recorded by flow.saveVtk()

2019-11-22 Thread Robert Caulk
Question #686131 on Yade changed:
https://answers.launchpad.net/yade/+question/686131

Status: Open => Needs information

Robert Caulk requested more information:
Hello Lingran,

I am not sure I understand the question:

flow.nCells() returns the total number of finite cells in the
triangulation [1].

flow.saveVTK() prints the individual cell IDs for each cell (the ones
you can index with getVertices(i)).

flow.getVertices(i) gives the vertex IDs for the particles comprising
cell i.

Are you trying to say the maximum ID printed by saveVTK is not equal to the 
single value returned by nCells()? 
What makes you say the vertices are inconsistent? What are the vertices 
inconsistent with? The particle body IDs?

Cheers,

Robert


[1]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.FlowEngine.nCells

-- 
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 #686136]: Introducing a wide distribution of the value of a parameter in a contact law

2019-11-22 Thread Rioual
New question #686136 on Yade:
https://answers.launchpad.net/yade/+question/686136

Hello,

I would like to use the cohesive contact law 
Law2_ScGeom6D_CohFrictPhys_CohesionMoment between the particles of
my packing but I would like to introduce a wide given stochastic distribution 
of the value of the adhesion, tensile strength and shear strength in the model, 
which are among the parameters of the contact law. How can  I handle that ??

Best regards,

V.

-- 
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 #686131]: flow.nCells() != "cell number" recorded by flow.saveVtk()

2019-11-22 Thread Lingran Zhang
New question #686131 on Yade:
https://answers.launchpad.net/yade/+question/686131

Hello,

One question for FlowEngine and DFNFlowEngine: why the flow.nCells() != "cell 
number" recorded by flow.saveVtk()?

I would like to record the Ids of initial fractured cells and then impose 
different pressures within them, but I find that the ids (and vertices) are not 
consistent given by these two ways.

Below is an example.
Thank you in advance for your help.
Best regards,
Lingran


from yade import pack, ymport

### material
def sphereMat(): return 
JCFpmMat(type=1,density=3000,young=9e9,poisson=0.2,frictionAngle=radians(18))
def wallMat(): return 
JCFpmMat(type=0,density=3000,young=9e9,poisson=0.2,frictionAngle=radians(0))

### bodies
mn,mx=Vector3(0,0,0),Vector3(1,1,1)
O.bodies.append(aabbWalls([mn,mx],oversizeFactor=1.5,thickness=0.1,material=wallMat))
sps=SpherePack()
sp=pack.randomDensePack(pack.inAlignedBox((0.,0.,0.),(1,1.,1.)),spheresInCell=100,radius=1/10.,memoizeDb='/tmp/triaxPackCache.sqlite',returnSpherePack=True)
sp.toSimulation(material=sphereMat)

dim=utils.aabbExtrema()
xinf=dim[0][0]
xsup=dim[1][0]
X=xsup-xinf
yinf=dim[0][1]
ysup=dim[1][1]
Y=ysup-yinf
zinf=dim[0][2]
zsup=dim[1][2]
Z=zsup-zinf

### engines
flow=FlowEngine(
isActivated=1,
### choose solver to use (0: Gauss Seidel, 1: Taucs, 2: Pardiso, 3: 
CHOLMOD)
useSolver=3, # 3 should be used by default but does not work 
everytime...
 boundaryUseMaxMin = [0,0,0,0,0,0],
bndCondIsPressure = [1,1,0,0,0,0],
bndCondValue = [1,0,0,0,0,0],
permeabilityFactor=1,
viscosity=0.001,
#debug=1
)

intR=1.1
O.engines=[
 ForceResetter()
 
,InsertionSortCollider([Bo1_Box_Aabb(),Bo1_Sphere_Aabb(aabbEnlargeFactor=intR,label='Saabb')])
 ,InteractionLoop(
  
[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=intR,label='SSgeom'),Ig2_Box_Sphere_ScGeom()],
  [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],
  [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM()]
 )
 ,flow
 
,GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=10,timestepSafetyCoefficient=0.8)
 ,NewtonIntegrator()
]

### simulation starts here

## to block the particles (better for permeability test)
for o in O.bodies:
 o.state.blockedDOFs+='xyzXYZ'

O.run(1,True)
## getBoundaryFlux get the total discharge [m3/s]
Qin = flow.getBoundaryFlux(0)
Qout = flow.getBoundaryFlux(1)


permeability = abs(Qout)*flow.viscosity*X/(Y*Z) # !!! if Pout=1, Pin=0
permeability2 = flow.averageVelocity()*flow.viscosity*X # !!! if Pout=1, Pin=0
conductivity = permeability*1000*9.82/flow.viscosity # K=rho*g*k/nu
print "Qin=",Qin," Qout=",Qout," ARE THEY EQUAL? IF NOT-> NO FLOW!"
print "Permeability [m2]=",permeability," || Hydraulic conductivity 
[m/s]=",conductivity
flow.saveVtk() # to see the result in Paraview


for i in range(flow.nCells()):
   print i, flow.getVertices(i)

-- 
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 #685539]: shape orientation for Potential Block

2019-11-22 Thread Ali Rafiee
Question #685539 on Yade changed:
https://answers.launchpad.net/yade/+question/685539

Status: Expired => Open

Ali Rafiee is still having a problem:
Hi Vasileios,
I looked at this code in C ++, but I do not have much experience in C ++.
but I think, there is no problem on finding vertex coordinates, but there is a 
problem on the rotation operation.
I'm counting on you as soon as you find time to try to fix this problem.

Thank you very much
Best regards
Ali

-- 
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 #685867]: polyhedron in pfacets- mass center

2019-11-22 Thread Ali Rafiee
Question #685867 on Yade changed:
https://answers.launchpad.net/yade/+question/685867

Ali Rafiee posted a new comment:
Hi every one,
for my question about polyhedron in pfacet, I have not had any answer yet.
Am I wrong?

Best regards
Ali

-- 
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 #686076]: Problem of Bodies rotation

2019-11-22 Thread yang yi
Question #686076 on Yade changed:
https://answers.launchpad.net/yade/+question/686076

Status: Answered => Solved

yang yi 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 #686076]: Problem of Bodies rotation

2019-11-22 Thread Jan Stránský
Question #686076 on Yade changed:
https://answers.launchpad.net/yade/+question/686076

Jan Stránský proposed the following answer:
1) you have to change velocity directly of RotationEngine (see my
previous anwer #5). This way, you change a global velocity variable, byt
RotationEngine has its copy and the change has no effect on it.

2) again see #5, should be
q = Quaternion(rotationAxis, angVel* O.dt) # without any AngleAxis stuff

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 #686076]: Problem of Bodies rotation

2019-11-22 Thread yang yi
Question #686076 on Yade changed:
https://answers.launchpad.net/yade/+question/686076

yang yi posted a new comment:
Thank you very much!! Jan Stránský
Now  I  have two problem

(1) for  using RotationEngine,   I hope the following code can change
the direction of the plane by  the PyRunner function ChangeVelocity, but
it cannot, the value of Velocity can be changed, but the plane still
Rotation as the initial speed and direction.

velocity = 10 
def ChangeVelocity():
global velocity
velocity = -1 * velocity


O.engines = [
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(), Bo1_Facet_Aabb()]),
InteractionLoop(
# handle sphere+sphere and facet+sphere collisions
[Ig2_Sphere_Sphere_ScGeom(), Ig2_Facet_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]),
# [Ip2_ViscElMat_ViscElMat_ViscElPhys()],
# [Law2_ScGeom_ViscElPhys_Basic()]),
NewtonIntegrator(gravity=(-9.8, 0, 0), damping=0.001, label='down'),
RotationEngine(rotationAxis=(0, 0, 1), angularVelocity=velocity, 
rotateAroundZero=True, zeroPoint=(0, 0, 0)),
PyRunner(command="ChangeVelocity()", iterPeriod=10)

]

(2)  The problem of transform the C++ code  of RotationEngine to python,
I hope I can control the rotation velocity of the plane.

def myRotation():
ZeroPos = Vector3(1, 1, 0)
rotationAxis = Vector3(0, 0, 1)
angVel = 10
for i in IDGround:
O.bodies[i].state.angVel += rotationAxis * angVel
l = O.bodies[i].state.pos - ZeroPos
q = Quaternion(AngleAxis(rotationAxis, angVel* O.dt))
# q = Quaternion(rotationAxis, angVel * O.dt)
newp = q*l + ZeroPos
O.bodies[i].state.vel += (newp - O.bodies[i].state.pos)/O.dt

O.engines = [
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(), Bo1_Facet_Aabb()]),
InteractionLoop(
# handle sphere+sphere and facet+sphere collisions
[Ig2_Sphere_Sphere_ScGeom(), Ig2_Facet_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]),
# [Ip2_ViscElMat_ViscElMat_ViscElPhys()],
# [Law2_ScGeom_ViscElPhys_Basic()]),
NewtonIntegrator(gravity=(-9.8, 0, 0), damping=0.001, label='down'),
PyRunner(command="myRotation()",iterPeriod=40)
# RotationEngine(rotationAxis=(0, 0, 1), angularVelocity=velocity, 
rotateAroundZero=True, zeroPoint=(0, 0, 0)),
# PyRunner(command="ChangeVelocity()", iterPeriod=10)
]

I  can find the "AngleAxis", and the error is "name 'AngleAxis' is
not defined".  The above code is follow the C++ in the
KinematicEngines.cpp.   I don't know if the  transform is correct or
not.

 Please help me,Thank you very much,

-- 
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 #686076]: Problem of Bodies rotation

2019-11-22 Thread Jan Stránský
Question #686076 on Yade changed:
https://answers.launchpad.net/yade/+question/686076

Jan Stránský proposed the following answer:
> However, the speed I cound not change during simulation.
> But the velocity can not changed.

Why?
Please always try to be specific. Did you get an error? What error? The 
velocity did not change? How did you investigate it? ...
###
RotationEngine(..., label="rotEngine")
...
def myRotation():
   rotEngine.angularVelocity = whatever
###

Concerning axis-angle, in Python Quaternion can be constructed directly from 
axis and angle:
C++: Quaternionr q(AngleAxisr(angularVelocity*scene->dt,rotationAxis));
Python: q = Quaternion(rotationAxis,angularVelocity*O.dt)

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