Re: [Yade-users] [Question #691874]: batch-table

2020-07-15 Thread Jan Stránský
Question #691874 on Yade changed:
https://answers.launchpad.net/yade/+question/691874

Status: Open => Answered

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

please provide also the content of the table and which OS and Yade
version you are using

> #0 (damping=.6) FAILED (exit status 34304), duration 00:00:13, log
1batch.py.damping=.6.log

FAILED means that there was some problem. Have a look at
"1batch.py.damping=.6.log" file to see the problem (basically it is
redirected output of the Yade run)

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 #691808]: Mesoscale modeling in YADE

2020-07-15 Thread Faqih Maarif
Question #691808 on Yade changed:
https://answers.launchpad.net/yade/+question/691808

Faqih Maarif posted a new comment:
Dear Jan,
Thank you very much for your explanation and solution. I will try it. 
For macroscale to mesoscale particle, I would like to discuss later.

Regards,
Faqih

-- 
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 #691808]: Mesoscale modeling in YADE

2020-07-15 Thread Faqih Maarif
Question #691808 on Yade changed:
https://answers.launchpad.net/yade/+question/691808

Status: Answered => Solved

Faqih Maarif 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 #691874]: batch-table

2020-07-15 Thread Lei Hang
Question #691874 on Yade changed:
https://answers.launchpad.net/yade/+question/691874

Status: Answered => Open

Lei Hang is still having a problem:
Hello,

Sorry, I don't know the meaning of 'OS'. I f it means operation system,
the OS is Linux. The Yade version is  2020.01a. There is a "Fatal Python
error" in the "1batch.py.damping=.6.log" file . But I don't understand
this error and don't know how to deal with this error. The content of
the table and the  "1batch.py.damping=.6.log" file are as follows,

The content of the table:
#
damping
.6
.4
.2
#
The "1batch.py.damping=.6.log" file:
#
Welcome to Yade 2020.01a 
Using python version: 3.8.2 (default, Apr 27 2020, 15:53:34) 
[GCC 9.3.0]
Warning: no X rendering available (see 
https://bbs.archlinux.org/viewtopic.php?id=13189)
XMLRPC info provider on http://localhost:21000
TCP python prompt on localhost:9000, auth cookie `assduk'
Running script 1batch.py
/usr/lib/x86_64-linux-gnu/yade/py/yade/plot.py:444: 
MatplotlibDeprecationWarning: 
The 'verts' kwarg was deprecated in Matplotlib 3.0 and will be removed in 3.2. 
Use 'marker' instead.
  scatter=pylab.scatter(scatterPt[0] if not math.isnan(scatterPt[0]) else 
0,scatterPt[1] if not math.isnan(scatterPt[1]) else 
0,s=scatterSize,color=line.get_color(),**scatterMarkerKw)
No handles with labels found to put in legend.
yade.plot: creating fake plot, since there are no y-data yet
Fatal Python error: This thread state must be current when releasing
Python runtime state: finalizing (tstate=0x15783b0)

Current thread 0x7f83e1660700 (most recent call first):
  File "/usr/lib/python3.8/bz2.py", line 125 in close
  File "/usr/lib/x86_64-linux-gnu/yade/py/yade/plot.py", line 664 in saveDataTxt
  File "1batch.py", line 37 in checkUnbalanced
  File "", line 1 in 

Thread 0x7f83e43d4700 (most recent call first):
  File "/usr/lib/python3.8/selectors.py", line 415 in select
  File "/usr/lib/python3.8/socketserver.py", line 232 in serve_forever

Thread 0x7f83e4bd5700 (most recent call first):
  File "/usr/lib/python3.8/selectors.py", line 415 in select
  File "/usr/lib/python3.8/socketserver.py", line 232 in serve_forever

Thread 0x7f83f9e50740 (most recent call first):
  File "/usr/lib/python3.8/_weakrefset.py", line 38 in _remove
Aborted (core dumped)

=== JOB SUMMARY 
id  : damping=.6
status  : 34304 (FAILED)
duration: 00:00:13
command : YADE_BATCH=params.txt:2 DISPLAY=  /usr/bin/yade --threads=1 --nice=10 
-x 1batch.py> 1batch.py.damping=.6.log 2>&1
started : Wed Jul 15 09:02:36 2020
finished: Wed Jul 15 09:02:49 2020
#
Many thanks

-- 
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 #691808]: Mesoscale modeling in YADE

2020-07-15 Thread Jan Stránský
Question #691808 on Yade changed:
https://answers.launchpad.net/yade/+question/691808

Jan Stránský posted a new comment:
I also think Luc Scholtes did some work on this topic, but currently I
cannot find it..

Just to note, there is really many options and approaches, this is just
one of them.

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 #691874]: batch-table

2020-07-15 Thread Jan Stránský
Question #691874 on Yade changed:
https://answers.launchpad.net/yade/+question/691874

Status: Open => Answered

Jan Stránský proposed the following answer:
yes, OS is operating system. Linux is too general, what is meant is
distribution (Debian, Ubuntu) and version (e.g. Ubuntu 18.04)

> File "/usr/lib/x86_64-linux-gnu/yade/py/yade/plot.py", line 664 in saveDataTxt
> File "1batch.py", line 37 in checkUnbalanced

as the error says, the problem is on line 37, something about
plot.saveDataTxt

> plot.saveDataTxt(O.tags['d.id']+'.data.bz2')

This worked for me:
###
...
def checkUnbalanced():
 if unbalancedForce()<.05:
  O.pause()
...
O.run()
waitIfBatch()
plot.saveDataTxt(O.tags['d.id']+'.data.bz2')
###

The problem is O.pause with O.wait (or waitIfBatch).
When O.pause() is called, the waiting is released. The only other (probably 
very quick) Python command is O.saveTmp().
This very quick command is executed and the script finishes, no matter that 
saving is in progress (it is called from C++ in another thread).

In the modified version, after waiting there are still Python commands
(plot.saveDataTxt) to be processed and the script finishes after it is
executed.

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 #691874]: batch-table

2020-07-15 Thread Lei Hang
Question #691874 on Yade changed:
https://answers.launchpad.net/yade/+question/691874

Status: Answered => Open

Lei Hang is still having a problem:
Thank you Jan,

The OS information is(Linux version 5.4.0-37-generic
(buildd@lcy01-amd64-001) (gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2))
#41-Ubuntu SMP Wed Jun 3 18:57:02 UTC 2020)

The method you provided solved my problem. But when I conduct the below script, 
why it can run normally? The position of 
"plot.saveDataTxt(O.tags['d.id']+'.data.bz2')" fllows the "O.pause()". It is 
not changed to behind the "waitIfBatch()". 
The script:
#
readParamsFromTable(damping=.2) 
from yade.params import table 

from yade import pack, plot

O.bodies.append(geom.facetBox((.5,.5,.5),(.5,.5,.5),wallMask=31))

# create empty sphere packing
# sphere packing is not equivalent to particles in simulation, it contains only 
the pure geometry
sp=pack.SpherePack()
# generate randomly spheres with uniform radius distribution
sp.makeCloud((0,0,0),(1,1,1),rMean=.05,rRelFuzz=.5)
# add the sphere pack to the simulation   

sp.toSimulation()

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()]
),
NewtonIntegrator(gravity=(0,0,-9.81),damping=table.damping),
# call the checkUnbalanced function (defined below) every 2 seconds
PyRunner(command='checkUnbalanced()',realPeriod=2),
# call the addPlotData function every 200 steps
PyRunner(command='addPlotData()',iterPeriod=100)
]
O.dt=.5*PWaveTimeStep()

# enable energy tracking; any simulation parts supporting it
# can create and update arbitrary energy types, which can be
# accessed as O.energy['energyName'] subsequently
O.trackEnergy=True

# if the unbalanced forces goes below .05, the packing
# is considered stabilized, therefore we stop collected
# data history and stop
def checkUnbalanced():
if unbalancedForce()<.05:
O.pause()
plot.saveDataTxt(O.tags['d.id']+'.data.bz2')
# plot.saveGnuplot('bbb') is also possible

# collect history of data which will be plotted
def addPlotData():
# each item is given a names, by which it can be the unsed in plot.plots
# the **O.energy converts dictionary-like O.energy to plot.addData 
arguments
plot.addData(i=O.iter,unbalanced=unbalancedForce(),**O.energy)

# define how to plot data: 'i' (step number) on the x-axis, unbalanced force
# on the left y-axis, all energies on the right y-axis
# (O.energy.keys is function which will be called to get all defined energies)
# None separates left and right y-axis
plot.plots={'i':('unbalanced',None,O.energy.keys)}

# show the plot on the screen, and update while the simulation runs
plot.plot()

O.run()   # run forever, until stopped by checkUnbalancedForce()
waitIfBatch()

O.saveTmp()
#

-- 
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 #691829]: Filterpack predicate definition issue

2020-07-15 Thread Yuxuan Wang
Question #691829 on Yade changed:
https://answers.launchpad.net/yade/+question/691829

Status: Answered => Open

Yuxuan Wang is still having a problem:
Hi Jan,
Thank you for the suggestions and they worked quite well for me upon 
implementation. I saw a significant reduction of particles going from the 
compressed pack to the filtered pack. 

There is only one thing that I'm still confused about now: I was not
able to see any of the particles after "assembly.toSimulation()" in the
simulation view, even though I could output their locations. Would you
mind giving me a hand on that again?

Thanks again!
Best,
Yuxuan

-
#!/usr/bin/python
# -*- coding: utf-8 -*-
#modifications from trial 10: incorporating Jan's advice on filterpack.

from __future__ import print_function
import matplotlib; matplotlib.rc('axes',grid=True)
import pylab
from yade import pack, plot, qt
from yade import export


### DEFINING VARIABLES AND MATERIALS ###


#geometry definition
Ri,Rs,Ro=6.5,8.5,10.5
H=3.5
p=H/2
k=0.01 
Hs=H*k 
hs=Hs/2 
Rx=2*Ro
Hx=2*H

c1=geom.facetCylinder(center=(0,0,p),radius=Ro, height=H, segmentsNumber=20, 
wallMask=6) 
c2=geom.facetCylinder(center=(0,0,hs),radius=Rs, height=Hs, segmentsNumber=20, 
wallMask=7)
c3=geom.facetCylinder(center=(0,0,p),radius=Ri, height=H, segmentsNumber=20, 
wallMask=7)


nRead=readParamsFromTable(
 num_spheres=5000,
 compFricDegree = 30, 
 unknownOk=True
)

from yade.params import table
num_spheres=table.num_spheres
compFricDegree = table.compFricDegree 
damp=0.2 
young=5e6 # contact stiffness
mn,mx=Vector3(-12,-12,-12),Vector3(12,12,12) # corners of the initial packing

## create materials for spheres and plates
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'))

## create walls around the packing
walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)

## use a SpherePack object to generate a psd loose particles packing
global sp
sp=pack.SpherePack()
sp.makeCloud(mn,mx,num=1000,psdSizes=[0.399,0.4,0.799,0.8],psdCumm=[0,0.5,0.5,1])
 
sp.toSimulation(material='spheres')


### DEFINING ENGINES ###


triax=TriaxialStressController(
 thickness = 0,
 stressMask = 7,
 internalCompaction=False, 
 label='controller'
)

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()]
 ),

 PyRunner(command='stop()',iterPeriod=1,label='checker'),
 
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
 triax,
 newton
]

#Display spheres with 2 colors for seeing rotations better
Gl1_Sphere.stripes=0
if nRead==0: yade.qt.Controller(), yade.qt.View()

###
### APPLYING CONFINING PRESSURE ###
###
 
triax.goal1=triax.goal2=triax.goal3=-100

def stop():
 if O.iter<100:return
 else:
  controller.dead=True
  for wall in walls:
   wall.state.vel = Vector3.Zero
  for b in O.bodies:
   b.state.vel = Vector3.Zero
  sp.fromSimulation() # update sp from original loose pack to compressed dense 
pack
  checker.command='gravityDeposition()'

def gravityDeposition():
 if O.iter==101:
  
pred=pack.inCylinder((0,0,0),(0,0,H),Ro)-pack.inCylinder((0,0,0),(0,0,Hs),Rs)-pack.inCylinder((0,0,0),(0,0,H),Ri)
  assembly=pack.filterSpherePack(pred,sp,True)
  O.bodies.clear() #delete compressed pack sp
  
  print(len(O.bodies))
  assembly.toSimulation()
  print(len(O.bodies))
  for b in O.bodies:print(b.id,b.state.pos,b.shape.radius)
 else: 
  print ('done')
  O.pause()
#...connect to next steps in simulation

-- 
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 #691828]: Deactivate triaxial stress controller

2020-07-15 Thread Yuxuan Wang
Question #691828 on Yade changed:
https://answers.launchpad.net/yade/+question/691828

Status: Answered => Solved

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


[Yade-users] [Question #691885]: thermo-hydro-mechanical modeling

2020-07-15 Thread Zoheir Khademian
New question #691885 on Yade:
https://answers.launchpad.net/yade/+question/691885

I’m interested in the THM modeling by Yade and was wondering if someone could 
post a version of codes used for this paper [1].

And also, can we do THM with any kind of body in Yade like box elements, walls, 
or clumps?

Thanks
Zoheir

[1] R. Caulk, B. Chareyre, 2019. An open framework for the simulation of 
coupled Thermo-Hydro-Mechanical processes in Discrete Element Systems. 
https://www.researchgate.net/publication/335272631_An_open_framework_for_the_simulation_of_coupled_Thermo-Hydro-Mechanical_processes_in_Discrete_Element_Systems


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