[Yade-users] [Question #669824]: Problem about material

2018-06-01 Thread xjin
New question #669824 on Yade:
https://answers.launchpad.net/yade/+question/669824

I write a code like this:
--
O.reset()


density=float(1600)
young=100e6
po=0.4
frictionAngle= float(atan(0.32))
sigmaT=1e3
epsCrackOnset=1e-4
relDuctility=30
globals()['density']=locals()['density']
globals()['young']=locals()['young']
globals()['po']=locals()['po']
globals()['frictionAngle']=locals()['frictionAngle']
globals()['sigmaT']=locals()['sigmaT']
globals()['epsCrackOnset']=locals()['epsCrackOnset']
globals()['relDuctility']=locals()['relDuctility']


density1=8000
young1=209e9
po1=0.29
frictionAngle1=float(atan(0.7))
globals()['density1']=locals()['density1']
globals()['young1']=locals()['young1']
globals()['po1']=locals()['po1']
globals()['frictionAngle1']=locals()['frictionAngle1']

qiu=O.materials.append(CpmMat(density=density,young=young,poisson=po,frictionAngle=frictionAngle,sigmaT=sigmaT,epsCrackOnset=epsCrackOnset,relDuctility=relDuctility,label='qiu'))

dao=O.materials.append(FrictMat(density=density1,young=young1,poisson=po1,frictionAngle=frictionAngle1,label='dao'))


O.bodies.append(geom.facetBox((.5,.5,.5),(.5,.5,.5),wallMask=15))
O.bodies.append(facet([(0,0,0),(1,1,0),(1,0,0)]))
O.bodies.append(facet([(0,0,0),(1,1,0),(0,1,0)]))
O.bodies.append(facet([(0,0,1),(1,1,1),(1,0,1)]))
O.bodies.append(facet([(0,0,1),(1,1,1),(0,1,1)]))



Nb1=len(O.bodies)
globals()['Nb1']=locals()['Nb1']

from yade import pack
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(1,1,.8),rMean=.08)
sp.toSimulation()


Nb2=len(O.bodies)
globals()['Nb2']=locals()['Nb2']

for i in xrange(0,Nb1):
O.bodies[i].material=O.materials[dao]

for i in xrange(Nb1,Nb2):
O.bodies[i].material=O.materials[qiu]



O.bodies[8].state.vel=(0,0,0.1)
O.bodies[9].state.vel=(0,0,0.1)
O.bodies[10].state.vel=(0,0,-0.1)
O.bodies[11].state.vel=(0,0,-0.1)


O.engines=[
   ForceResetter(),
   InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
   InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()], 
[Ip2_CpmMat_CpmMat_CpmPhys(),Ip2_FrictMat_CpmMat_FrictPhys(),Ip2_FrictMat_FrictMat_FrictPhys()],
 
[Law2_ScGeom_CpmPhys_Cpm(),Law2_ScGeom_FrictPhys_CundallStrack()]),
   NewtonIntegrator(gravity=(0,0,-9.81),damping=0.4),
   
]
O.dt=0.05*PWaveTimeStep()

-

when I run it, I ge the message:

 FATAL /home/dj/yade/trunk/core/ThreadRunner.cpp:30 run: Exception occured: 
Body #12: Body::material type CpmMat doesn't correspond to Body::state type 
State (should be CpmState instead).


 Could you give me some suggestion?Thanks a lot!

-- 
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 #669827]: Simulate plastic particle

2018-06-01 Thread xjin
New question #669827 on Yade:
https://answers.launchpad.net/yade/+question/669827

I want to simulate a kind of ball which is soft.It will produce deformation 
under the compressive stress, but when there is no any forces,it will be 
returned to a ball,like it has large plasticity.  Is the body using Sphere?Or 
choose the which material? Can you give saome suggestion? Thanks a lot!

-- 
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 #669824]: Problem about material

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

Status: Open => Answered

Jérôme Duriez proposed the following answer:
Hi,

The error message suggests your Body #12 (with 12 as id) has a CpmMat material 
but a state attribute [1] of the generic State type/class [2].
This is not accepted as bodies with CpmMat should have a state attribute of the 
derived/inherited/more specialized CpmState class [3]

Once you check my guess is true (asking for O.bodies[12].state and
.material) the question is "how to consistently define a CpmState for
bodies with CpmMat" which I do not know the answer for, being not
familiar with concrete particle model.

Other answers will thus probably be necessary, and with this respect
it's somewhat inconvenient you did not provide us with a real MinimumWE
[4] ;-)


[1] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Body.state
[2] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.State
[3] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.CpmState
[4] https://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


Re: [Yade-users] [Question #669845]: uodate len(O.bodies) after erasing particles

2018-06-01 Thread azim
Question #669845 on Yade changed:
https://answers.launchpad.net/yade/+question/669845

azim posted a new comment:
Hi Jan

thanks for your reply.

>>please specify your problem, I did not find any in your description..

I  want to update len(O.bodies) after erasing some of particles.
Their existence as a None/nullptr will be a problem for me in next parts of my 
simulation.
If you believe that it is optional and  every future problems with or without 
updating has a solution,or, updating len(O.bodies ) will cause problem in 
performance {you said in [1]}, then we can skip updating, otherwise, I need to 
update len(O.bodies).
I read [1] and all other related questions before asking these question. they 
did not answer me.
thanks again Dear Jan
Azim

-- 
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 #669824]: Problem about material

2018-06-01 Thread xjin
Question #669824 on Yade changed:
https://answers.launchpad.net/yade/+question/669824

Status: Answered => Solved

xjin 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 #669048]: CU triaxial (PFV)

2018-06-01 Thread SayedHessam
Question #669048 on Yade changed:
https://answers.launchpad.net/yade/+question/669048

Status: Answered => Open

SayedHessam is still having a problem:
Dear Robert,

Thank you for your valuable comment.

BTW,  I have just two more questions about your last comment (#5).  You 
mentioned I am trying to compress an incompressible fluid, whereas Water is 
incompressible fluid and so what do you mean exactly about it??
Also, you said I  imposed the pressure at the centre and my boundary conditions 
are not flow. While I want to model Triaxial CU (Undrained Condition) and water 
cannot flow out from the assembly??

Regards
Sam


You can find herewith MWE.py, as you requested:


from yade import pack


### DEFINING VARIABLES AND MATERIALS ###


nRead=readParamsFromTable(
 num_spheres=700,
 compFricDegree = 35, 
 key='_Triax_PFV_CU_', 
 unknownOk=True
)
from yade.params import table

num_spheres=table.num_spheres
key=table.key
targetPorosity = 0.425 
compFricDegree = table.compFricDegree 
finalFricDegree = 35 
rate=-0.01 
damp=0.2 
stabilityThreshold=0.01 
young=1e8 
mn,mx=Vector3(0,0,0),Vector3(1,1,1) 

O.materials.append(FrictMat(young=young,poisson=0.3,frictionAngle=radians(compFricDegree),density=2650,label='spheres'))
O.materials.append(FrictMat(young=young,poisson=0.3,frictionAngle=0,density=0,label='walls'))

walls=aabbWalls([mn,mx],thickness=0,material='walls')


### DEFINING ENGINES ###


triax=TriaxialStressController(
 maxMultiplier=1.+2e4/young, 
 finalMaxMultiplier=1.+2e3/young, 
 thickness = 0,
 stressMask = 7,
 internalCompaction=True, 
)

newton=NewtonIntegrator(damping=damp)

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()]
 ),
 FlowEngine(dead=1,label="flow"),
 
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
 triax,
 TriaxialStateRecorder(iterPeriod=100,file='WallStresses'+table.key),
 newton,
]
O.dt=.5*utils.PWaveTimeStep()

Gl1_Sphere.stripes=0
if nRead==0: yade.qt.Controller(), yade.qt.View()

###
### APPLYING CONFINING PRESSURE ###
###

triax.goal1=triax.goal2=triax.goal3=-10

while 1:
  O.run(1000, True)
  unb=unbalancedForce()
  print 'unbalanced force:',unb,' mean stress: ',triax.meanStress
  if unbtargetPorosity:
 compFricDegree = 0.95*compFricDegree
 setContactFriction(radians(compFricDegree))
 print "\r Friction: ",compFricDegree," porosity:",triax.porosity,
 sys.stdout.flush()
 O.run(500,1)

O.save('compactedState'+key+'.yade.gz')
print "### Compacted state saved ###"

while 1:
  O.run(100, True)
  unb=unbalancedForce()
  print 'unbalanced force:',unb,' mean stress: ',triax.meanStress
  if unbhttps://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 #669048]: CU triaxial (PFV)

2018-06-01 Thread Robert Caulk
Question #669048 on Yade changed:
https://answers.launchpad.net/yade/+question/669048

Status: Open => Answered

Robert Caulk proposed the following answer:
Hello Sam,

The script you posted on Comment #6 does not contain a fluid model (it
is inactive when you set flow.dead=1). Actually, the script from Comment
#6 also does not contain a packing, so it is pretty far from yielding
any kind of FlowEngine error like the one you posted in the OP. You are
welcome to post the script that causes the FlowEngine error shown in the
OP and we can try to help fix it. Or if you are having problems related
to a different topic, please open a new thread.

My responses below are w.r.t to your other partial script posted in
Comment #4, since that is the script pertaining to your questions.

>>
You mentioned I am trying to compress an incompressible fluid, whereas Water is 
incompressible fluid and so what do you mean exactly about it??
>>

Actually, looking at your script from Comment #4, I see you are choosing
to model the water as a compressible fluid when you set
flow.fluidBulkModulus=2e9 [1]. So I was mistaken when I said you were
trying to compress an incompressible fluid. Instead, you are compressing
a compressible fluid so your problem may actually be well-posed. But you
still have not posted an MWE that yields the error shown in the OP (is
that what we are trying to fix?), so I am still speculating.

>>
Also, you said I imposed the pressure at the centre and my boundary conditions 
are not flow. While I want to model Triaxial CU (Undrained Condition) and water 
cannot flow out from the assembly??
>>

I'm sorry, what is the question? I will just give information in an
attempt to answer: you are choosing to model the boundaries as no-flux
boundaries when you set flow.bndCondIsPressure=[0,0,0,0,0,0] [2].
Similarly, you are imposing a constant pressure in the center of your
system when you set
flow.imposePressure(Vector3(triax.width/2,triax.height/2,triax.depth/2),0.001)
[3].

Cheers,

Robert

[1]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.FlowEngine.fluidBulkModulus
[2https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.FlowEngine.bndCondIsPressure
[3]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.FlowEngine.imposePressure

-- 
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 #669845]: uodate len(O.bodies) after erasing particles

2018-06-01 Thread Jan Stránský
Question #669845 on Yade changed:
https://answers.launchpad.net/yade/+question/669845

Status: Open => Needs information

Jan Stránský requested more information:
Hi Azim,

> but neither of them solve my problem

please specify your problem, I did not find any in your description..

Unchanged length of O.bodies is an implementation choice, see e.g. [1]

cheers
Jan

[1] https://answers.launchpad.net/yade/+question/660861

-- 
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 #665314]: save/load precedure

2018-06-01 Thread Luc Scholtès
Question #665314 on Yade changed:
https://answers.launchpad.net/yade/+question/665314

Luc Scholtès posted a new comment:
I just gave a solution to solve De Zhang's problem which was, basically:

How to reload a simulation without suffering from the undefined
functions and variables?

But of course, you are absolutely right, we should anticipate such
problem by including the dedicated lines in the initial script.

-- 
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 #665314]: save/load precedure

2018-06-01 Thread Bruno Chareyre
Question #665314 on Yade changed:
https://answers.launchpad.net/yade/+question/665314

Bruno Chareyre posted a new comment:
>copy/paste from initial script

If it fits in a file, why would you generate a second file with the same
content?

Not a good idea. As the functions will be progressively modified and improved 
it will lead to different versions of them in different scripts in many cases 
(or painful editing to go change the same function in every scripts in the 
list, but pain is why people will forget that part). Same remark for 
parameters, instead of changing them in one place you have to change them in 
multiple places, it can make benchmark execution very difficult.
That's why I would suggest self-contained scripts like [1] in answer #6.
In my view the multiscript approach is not something we want to advise to 
standard yade users: no clear advantage over a single script, leads to bad 
practices such as duplicated code, generates a lot of questions on launchpad. 
In complex cases it may be required, but not here.
Bruno

-- 
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 #669827]: Simulate plastic particle

2018-06-01 Thread Jan Stránský
Question #669827 on Yade changed:
https://answers.launchpad.net/yade/+question/669827

Status: Open => Answered

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

what would you like to simulate and what should be expected results?

> like it has large plasticity

did you mean elasticity? (according to the rest of the content)

> Is the body using Sphere

did not get this point, sorry.. what "the body" refers to? what Sphere means 
and why is it with capital S?
the behavior you describe can be modeled by an agglomerate of spheres

> Or choose the which material?

assuming elasticity (?), any cohesive material can be used (CohFrictMat,
CpmMat, JCFpmMat

> Can you give saome suggestion?

please clarify your question, creating an example should not be
difficult.

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 #669824]: Problem about material

2018-06-01 Thread Jan Stránský
Question #669824 on Yade changed:
https://answers.launchpad.net/yade/+question/669824

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

do not change the material of spheres, i.e. delete these lines
###
for i in xrange(0,Nb1):
  O.bodies[i].material=O.materials[dao]
for i in xrange(Nb1,Nb2):
  O.bodies[i].material=O.materials[qiu]
###

Instead, specify the material when particles are created:
###
# material=dao not needed as lastly appended material is used by default
O.bodies.append(geom.facetBox((.5,.5,.5),(.5,.5,.5),wallMask=15,material=dao)) 
O.bodies.append(facet([(0,0,0),(1,1,0),(1,0,0)],material=dao))
...
sp.toSimulation(material=qiu)
###

cheers
Jan

PS: change of particle material is of course possible, but might need
something more, as you experienced

-- 
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 #669845]: uodate len(O.bodies) after erasing particles

2018-06-01 Thread azim
New question #669845 on Yade:
https://answers.launchpad.net/yade/+question/669845

Dear all
I deleted some particles in my simulation. Particles and their interactions  
are erased without a problem.
But the length of O.bodies is the same as before deletion. I did that with 
looping over bodies and also with looping  over len(O.bodies) but neither of 
them solve my problem.
Thanks in advance.


Here is my script:



# -*- coding: utf-8 -*-
from yade import pack
num_spheres=1000
compFricDegree = 30
targetPorosity = 0.43
finalFricDegree = 30
rate=-0.02
damp=0.2
stabilityThreshold=0.01
young=5e6
mn,mx=Vector3(0,0,0),Vector3(1,1,1)
O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=2600,label='spheres'))
O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls'))
walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)
sp=pack.SpherePack()


clumps=False
if clumps:
 volume = (mx[0]-mn[0])*(mx[1]-mn[1])*(mx[2]-mn[2])
 mean_rad = pow(0.09*volume/num_spheres,0.)
 
c1=pack.SpherePack([((-0.2*mean_rad,0,0),0.5*mean_rad),((0.2*mean_rad,0,0),0.5*mean_rad)])
 sp.makeClumpCloud(mn,mx,[c1],periodic=False)
 sp.toSimulation(material='spheres')
 O.bodies.updateClumpProperties()
else:
 sp.makeCloud(mn,mx,-1,0.,num_spheres,False, 0.95,seed=1)
 O.bodies.append([sphere(center,rad,material='spheres') for center,rad in sp])
triax=TriaxialStressController(
maxMultiplier=1.0+2e4/young,
finalMaxMultiplier=1.0+2e3/young,
thickness = 0,
stressMask = 7,
internalCompaction=True,
)

newton=NewtonIntegrator(damping=damp)

O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
triax,
newton
]
triax.goal1=triax.goal2=triax.goal3=-1

while 1:
  O.run(1000, True)
  unb=unbalancedForce()
  print 'unbalanced force:',unb,' mean stress: ',triax.meanStress
  if unb5:
if b.state.pos[0]<.5:
O.bodies.erase(b.id)

# 2   loop over len(O.bodies)
#triax.internalCompaction=False
#for b in range(len(O.bodies)):
#   if O.bodies[b].id in range(6):
#   continue
#   else:
#   if O.bodies[b].state.pos[0]<.5:
#   O.bodies.erase(O.bodies[b].id)



-- 
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