[Yade-users] [Question #652968]: Implementing Local Damping

2017-07-24 Thread Nima Goudarzi
New question #652968 on Yade:
https://answers.launchpad.net/yade/+question/652968

Hello All,

I am trying to implement a new code using c++. My model is mainly based on HM 
but due to the quasi-static nature of the simulations, I first prefer to avoid 
using viscous damping (cn=cs=0) and implement Cundall none viscous damping  
(local damping in PFC). I don't know how to do that. Is there any source code 
(for a contact law) which has implemented none -viscous damping. I  need to 
know in which header class I need to introduce this and how I can use this 
parameter to update my forces.

Sincerely yours,

Nima Goudarzi

-- 
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 #652260]: Graphical Interface

2017-07-24 Thread mohsen
Question #652260 on Yade changed:
https://answers.launchpad.net/yade/+question/652260

mohsen posted a new comment:
Hi Robert Thansk

@1. May you please give an example of how does Reference button make changes?
Indeed I do not know 'orbital center'

@2 Thanks

@ 3 I am using KUbuntu 16.04

-- 
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 #652966]: utils.getStressAndTangent()

2017-07-24 Thread Wang Wang
New question #652966 on Yade:
https://answers.launchpad.net/yade/+question/652966

from your website, i can see there is a command called 
utlis.getStressAndTangent() which can give a macroscopic Tangent.   However, 
the program with such command has error:

AttributeError: 'module' object has no attribute 'getStressAndTangent'

Yade on my computer is 1.07.0, i am wondering it is the version problem.

And also, if it is the version problem, how can i update the Yade version, for 
i have input " sudo apt-get install yade"  in terminal and it says the version 
is the newest.

You can use such codes to test what i met:
-
#!/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
import numpy# initial the math of matrix compute (needed in ns) 

# initial the global variables
arrcc =[0]*3  # last step strain(commit)
arrtt =[0]*3  # last step strain(trail)
scc=[0]*3 # last step stress
orst=1   # initialize the orginal save document(trial)
check=[0]*1 # I need to calculate the first step when ag=0
check[0]=0
theTangent=(0)
# load the identical package
O.load('/tmp/.gz')  # only load the package, because the O.cell.velGrad is 
not compatible with the peri3dcontroller eigine


#O.periodic=True   ### note!!!  add
O.dt=1e-8 

# see the example of peri3dcontroller, 1.5 is used to speed up the computation
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(),

#VTKRecorder(fileName='3dfirst-vtk-',recorders=['all','cpm'],iterPeriod=4999),

]

O.cell.velGrad=utils.Matrix3(0,0,0,0,0,0,0,0,0)
O.step()
bo1s.aabbEnlargeFactor=ig2ss.interactionDetectionFactor=1.   # 
O.step and change 1.5 back to 1. , because the concrete model is developed in 
the 1. environment


if orst==1:
print "orst1"   

for b in O.bodies:
b.material.young = 1.0001*17e10



orst=2
ag = [0]*3   #  current - last   ie. the changed strain
ag[0] = 0
ag[1]= 0
ag[2] =0
ns=100 
dstrain = utils.Matrix3(ag[0],ag[2],0,0,ag[1],0,0,0,0)  # the goal 
strain xx xy xz, yx yy yz, zx zy zz   
O.cell.velGrad=dstrain/(ns*O.dt)
O.run(ns,True)   
stressValue=utils.getStress()
stressxx=stressValue[0,0]   # the 
return stress xx
stressyy=stressValue[1,1]   # the 
return stress yy
stressxy=(stressValue[0,1]+stressValue[1,0])/2  # the 
return stress xy = (xy + yx)/2

print "stress here from strain[0,0,0] step 1"
print stressxx
print stressyy
print stressxy

theTangent=utils.getStressAndTangent()
print theTangent
O.saveTmp('first')   

-



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 #652261]: at the beginning steps, the stresses are the same when i use different young of balls

2017-07-24 Thread Wang Wang
Question #652261 on Yade changed:
https://answers.launchpad.net/yade/+question/652261

Status: Answered => Open

Wang Wang is still having a problem:
OK, I have edit the code in Yade so that you can see what i met.
the code is :

---
#!/usr/bin/python   # This is server.py file
# initial yade and the socket
import string
from yade import plot,qt
from yade.pack import *
from yade import pack, plot
import socket   # Import socket module
import numpy# initial the math of matrix compute (needed in ns) 

# initial the global variables
arrcc =[0]*3  # last step strain(commit)
arrtt =[0]*3  # last step strain(trail)
scc=[0]*3 # last step stress
orst=1   # initialize the orginal save document(trial)
check=[0]*1 # I need to calculate the first step when ag=0
check[0]=0

# load the identical package
O.load('/tmp/.gz')  # only load the package, because the O.cell.velGrad is 
not compatible with the peri3dcontroller eigine


#O.periodic=True   ### note!!!  add
O.dt=1e-8 

# see the example of peri3dcontroller, 1.5 is used to speed up the computation
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(),

#VTKRecorder(fileName='3dfirst-vtk-',recorders=['all','cpm'],iterPeriod=4999),

]

O.cell.velGrad=utils.Matrix3(0,0,0,0,0,0,0,0,0)
O.step()
bo1s.aabbEnlargeFactor=ig2ss.interactionDetectionFactor=1.   # 
O.step and change 1.5 back to 1. , because the concrete model is developed in 
the 1. environment


if orst==1:
print "orst1"   

for b in O.bodies:
b.material.young = 1.0001*17e10

orst=2
ag = [0]*3   #  current - last   ie. the changed strain
ag[0] = 0
ag[1]= 0
ag[2] =0
ns=100 
dstrain = utils.Matrix3(ag[0],ag[2],0,0,ag[1],0,0,0,0)  # the goal 
strain xx xy xz, yx yy yz, zx zy zz   
O.cell.velGrad=dstrain/(ns*O.dt)
O.run(ns,True)   
stressValue=utils.getStress()
stressxx=stressValue[0,0]   # the 
return stress xx
stressyy=stressValue[1,1]   # the 
return stress yy
stressxy=(stressValue[0,1]+stressValue[1,0])/2  # the 
return stress xy = (xy + yx)/2

print "stress here from strain[0,0,0] step 1"
print stressxx
print stressyy
print stressxy

O.saveTmp('first')  # initialize the orginal save 
document(trial)   



O.loadTmp('first')  #step 2
print "orst2"   
ag = [0]*3   #  current - last   ie. the changed strain
ag[0] = 0
ag[1] = 0
ag[2] = 0

ns=100

dstrain = utils.Matrix3(ag[0],ag[2],0,0,ag[1],0,0,0,0)  # the goal 
strain xx xy xz, yx yy yz, zx zy zz
# the critical time step
O.cell.velGrad=dstrain/(ns*O.dt)

O.run(ns,True)   
  # the velocity gradient

stressValue=utils.getStress()
stressxx=stressValue[0,0]   # the 
return stress xx
stressyy=stressValue[1,1]   # the 
return stress yy
stressxy=(stressValue[0,1]+stressValue[1,0])/2  # the 
return stress xy = (xy + yx)/2
print "stress here from strain[0,0,0] step 2"
print stressxx
print stressyy
print stressxy



O.loadTmp('first')  #step 3
print "orst2"   
ag = [0]*3   #  current - last   ie. the changed strain
ag[0] = 1e-7
ag[1] = 0
ag[2] = 0

ns=100

dstrain = utils.Matrix3(ag[0],ag[2],0,0,ag[1],0,0,0,0)  # the goal 
strain xx xy xz, yx yy yz, zx zy zz
  # the critical time step
O.cell.velGrad=dstrain/(ns*O.dt)

O.run(ns,True)   
   # the velocity gradient

stressValue=utils.getStress()
stressxx=stressValue[0,0]   # the 
return stress xx
stressyy=stressValue[1,1]   

Re: [Yade-users] [Question #652260]: Graphical Interface

2017-07-24 Thread Robert Caulk
Question #652260 on Yade changed:
https://answers.launchpad.net/yade/+question/652260

Status: Open => Answered

Robert Caulk proposed the following answer:
1- In simulation tab, what does the Reference button do?

Reference resets the orbital center

2- In Display tan, when i check/uncheck intrWire (or intrGeom)box,
nothing happen. What does this button do? (I generated a triaxial test
with 40 grains)

It uses wires to represent interactions if you are rendering them [1].

3- How can I use Python tab? when i enter in the box: 2+2 there is no
outputs in terminal!

What version of Ubuntu are you using? In 16.04 I assume it would not
work because of recent still-unfixed issues regarding Qt.

[1] https://yade-
dem.org/doc/yade.wrapper.html#yade.wrapper.OpenGLRenderer.intrWire

-- 
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 #652282]: Why do the particles go up when all the forces(including gravity) are applied in the downward direction?

2017-07-24 Thread Robert Caulk
Question #652282 on Yade changed:
https://answers.launchpad.net/yade/+question/652282

Status: Open => Answered

Robert Caulk proposed the following answer:
Hello Hashir,

You apply gravity in the upward direction with:

NewtonIntegrator(damping=0,gravity=[0,0,9.81],label='newtonInt')

If you want gravity to act in the downward direction, you should use
-9.81.

Cheers,

Robert

-- 
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 #652267]: How to reverse the direction of an axis in the plot?

2017-07-24 Thread Bruno Chareyre
Question #652267 on Yade changed:
https://answers.launchpad.net/yade/+question/652267

Status: Open => Answered

Bruno Chareyre proposed the following answer:
Hello,
yade.plot is just a simple interface between yade and matplotlib and I'm not 
sure it will let you revert an axis easily.
Well... I think I see a way how to do it but I wouldn't even test it 
(overwriting the content of plot.data after each call to plot.addData). For 
more advanced plottings you advise to simply use matplotlib directly.
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 #647852]: Using openmp in a python script.

2017-07-24 Thread Bruno Chareyre
Question #647852 on Yade changed:
https://answers.launchpad.net/yade/+question/647852

Bruno Chareyre proposed the following answer:
>so I re-phrase my question: Is there a possible way on how I could loop
through the objects and addforces every timestep without compromising on
the performance?

Does it mean that the question is unrelated to OpenMP, and that the real 
problem is the inefficiency of python loops (not a surprise)?
A cure could be to implement the loops in c++, i.e. give a python array to a 
yade module and let it loop (in c++) through the data and set values.

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


[Yade-users] [Question #652297]: Feng Chen's Yade-OpenFoam coupling model.

2017-07-24 Thread Ed Carlos Alves Rocha
New question #652297 on Yade:
https://answers.launchpad.net/yade/+question/652297

Hello everyone!
In Feng Chen's Yade-OpenFoam coupling model how can I start the Yade loop with 
OpenFoam? How do I write the FluidDragForceEngine function / engine in the 
simulation python file on the CFD-DEM coupling?

(https://translate.googleusercontent.com/translate_c?act=url=1=pt-BR=UTF8=_t=translate.google.com.br=en=nmt4=pt-BR=https://sites.google.com/site/fchen3/home/yade-openfoam-src=ALkJrhhn1XzfWcXdprHY9pNuv7gs8cng-g)

For example, I wrote a python file on yade that simulates the trajectory of a 
tennis ball (a spheres). Now I want to implement a wind flow transverse to the 
trajectory of that sphere. How do I call the FluidDragForceEngine function / 
engine and the OpenFoam?



-- 
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 #652282]: Why do the particles go up when all the forces(including gravity) are applied in the downward direction?

2017-07-24 Thread Hashir Ahmad
Question #652282 on Yade changed:
https://answers.launchpad.net/yade/+question/652282

Hashir Ahmad posted a new comment:
Hi Jan

Sorry for that. You can put "young = 5e6".

-- 
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 #650740]: How to apply force on a certain area normally and at an angle?

2017-07-24 Thread Hashir Ahmad
Question #650740 on Yade changed:
https://answers.launchpad.net/yade/+question/650740

Status: Answered => Open

Hashir Ahmad is still having a problem:
Hi Jan

This really helped. I took reference from PIDController.py
How to apply the same force at an angle?

Regards
Hashir

-- 
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 #652282]: Why do the particles go up when all the forces(including gravity) are applied in the downward direction?

2017-07-24 Thread Jan Stránský
Question #652282 on Yade changed:
https://answers.launchpad.net/yade/+question/652282

Jan Stránský posted a new comment:
Hi Hashir,
please try the scripts to be working before posting them. Here I got 
"NameError: name 'young' is not defined".
thanks
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


[Yade-users] [Question #652282]: Why do the particles go up when all the forces(including gravity) are applied in the downward direction?

2017-07-24 Thread Hashir Ahmad
New question #652282 on Yade:
https://answers.launchpad.net/yade/+question/652282

I have constructed a rectangular box of particles with walls surrounding it and 
opened at the top. I applied some downward force on a facetCylinder with 
wallMask=2(i.e a circular plate) kept on the top of the box. When the 
facetCylinder reaches the bottom of the box, all the particles in the box move 
up and come out of the box. Here's my code:

from yade import pack
from yade import ymport

def createSandBox(length, height, width, radSpheres, variance, color):
boxpred = pack.inAlignedBox((0,0.5,-0.5),(length,height,width)) 
packing = pack.randomDensePack(boxpred, spheresInCell = 250, 
radius=radSpheres, rRelFuzz=variance, color=color, returnSpherePack = False)
return O.bodies.append(packing)

idBox = createSandBox(2,1.5,0.5,1e-1,0,(1,0.917,0.659))
mWalls = 
O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0))

idBoxWalls = 
O.bodies.append(geom.facetBox(center,extents,orientation=Quaternion((0,0,0),0),wallMask=wMask,
 color=co, material=mWalls, wire=True))
idCylWalls = 
O.bodies.append(geom.facetCylinder((1,1,-0.25),0.3,0.5,wallMask=2,material=mWalls,segmentsNumber=20,color=co))

o.engines = [
  ForceResetter(),
  InsertionSortCollider([Bo1_Sphere_Aabb(), 
Bo1_Facet_Aabb()],verletDist=1.0,label='collider'),
  InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()],
  ),
  NewtonIntegrator(damping=0,gravity=[0,0,9.81],label='newtonInt'),
  TranslationEngine(translationAxis=[0,0,1],velocity=3.0,ids=idCylWalls, 
label='translat'),
  CombinedKinematicEngine(ids=idCylWalls,label='combEngine',dead=True) + 

ServoPIDController(axis=[0,0,1],maxVelocity=5.0,iterPeriod=1000,ids=idCylWalls,target=1.0e7,kP=1.0,kI=1.0,kD=1.0)
 + 
RotationEngine(rotationAxis=(0,0,1), angularVelocity=10.0, 
rotateAroundZero=True, zeroPoint=(0,0,0)),
  #PyRunner(command='addPlotData()',iterPeriod=100, label='graph'),
  PyRunner(command='switchTranslationEngine()',iterPeriod=45000, nDo = 2, 
label='switchEng'),
]
O.step()
qt.View()

def switchTranslationEngine():
  print "\nSwitch from TranslationEngine engine to ServoPIDController"
  translat.dead = True
  combEngine.dead = False

I want the particles to only redistribute. And the ones at the top to move up 
by some distance. 


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