Re: [Yade-users] [Question #705052]: Particle Water Absorption

2023-03-05 Thread Luis Barbosa
Question #705052 on Yade changed:
https://answers.launchpad.net/yade/+question/705052

Status: Answered => Solved

Luis Barbosa confirmed that the question is solved:
Thanks Jérôme Duriez, 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 #705052]: Particle Water Absorption

2023-02-15 Thread Luis Barbosa
New question #705052 on Yade:
https://answers.launchpad.net/yade/+question/705052

Dear community,

I'm working with hygroscopic materials.

Do you know if we have any development in Yade, where particles can 
absorb/release water?

Kind regards,
Luis

-- 
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 #702448]: 2PFV - update Triangulation

2022-07-30 Thread Luis Barbosa
Question #702448 on Yade changed:
https://answers.launchpad.net/yade/+question/702448

Status: Answered => Solved

Luis Barbosa confirmed that the question is solved:
Thanks Bruno Chareyre, 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 #702448]: 2PFV - update Triangulation

2022-07-26 Thread Luis Barbosa
Question #702448 on Yade changed:
https://answers.launchpad.net/yade/+question/702448

Status: Answered => Open

Luis Barbosa is still having a problem:
Thanks Bruno,

So, what is the updateTriangulation doing?

Cheers,
Luis

-- 
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 #702534]: Two Phase Flow Engine - Mimicking evaporation

2022-07-21 Thread Luis Barbosa
New question #702534 on Yade:
https://answers.launchpad.net/yade/+question/702534

Hey guys,

I have a problem where my soil has all boundary conditions blocked from air 
intake except the top.

Initially the sample is saturated, loses water from the top and shrinks along 
time.

I have some experience with 2PFV, but I don't know if it would be possible to 
reproduce these boundary conditions in the current code.

My question is: would be possible to set in the top boundary pressure zero (to 
allow air intake) and negative pressure (to promote water suction). For this I 
would use some faces of the triangulation to be negative pressure and some 
other to be pressure. But how to figure out the water reservoir position.

Anyway, I may be using the wrong approach. But if you see any possibility, let 
me know.
Kind regards,
Luis

-- 
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 #702459]: Relative Velocity - cellVelocity 2PFV

2022-07-13 Thread Luis Barbosa
Question #702459 on Yade changed:
https://answers.launchpad.net/yade/+question/702459

Luis Barbosa gave more information on the question:
The model is 2 phase flow, so there are air and water velocities in the
cell, aren't there?

-- 
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 #702459]: Relative Velocity - cellVelocity 2PFV

2022-07-12 Thread Luis Barbosa
New question #702459 on Yade:
https://answers.launchpad.net/yade/+question/702459

Hi guys,

I am analising the distribution of Cell Velocity within a pack during drainage. 
But I am not sure if the values I am getting are coherent .

For example, when using averageVelocity (2PFV) I have:
Vector3(-0.004874323346091374159,-0.007408252653754272658,-0.00447746732082271795)

Calculating hydraulic conductivity, permeability from the average velocity, the 
model is reproducing my experiment. So, in overall that is working.

But when I go for the cellVelocity I plotted a histogram, and  have a lot of 
values around zero, as expected, but few values can reach up to 500. The unit 
are all in SI, so this should be m.s-1.

The pore throat radius I am getting from my pack is within 2.5e-6 m and 1e-5 m.

I am working with soil drainage, but never saw such high values in literature.
Althout, it is localized and instantaneous, I wounder if this would be 
physically consistent.

Any insight would be helpful.

Kind regards
Luis

-- 
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 #702448]: 2PFV - update Triangulation

2022-07-12 Thread Luis Barbosa
Question #702448 on Yade changed:
https://answers.launchpad.net/yade/+question/702448

Status: Needs information => Open

Luis Barbosa gave more information on the question:
Sorry Robert, I was playing with cellVelocity an sent the wrong MWE.

Here is the right one:


#!/usr/bin/python
# -*- encoding=utf-8 -*-
#*
#  Copyright (C) 2010 by Bruno Chareyre  *
#  bruno.chareyre_at_grenoble-inp.fr *
#*
#  This program is free software; it is licensed under the terms of the  *
#  GNU General Public License v2 or later. See file LICENSE for details. *
#*/

from yade import pack
from yade import bodiesHandling
from yade import export
from yade import utils
from yade import ymport
import math
import numpy


###   DEFINING VARIABLES AND MATERIALS   ###


# The following 5 lines will be used later for batch execution
nRead=readParamsFromTable(
num_spheres=3000,# number of spheres
compFricDegree = 1, # contact friction during the confining phase
key='_triax_base_', # put you simulation's name here
unknownOk=True
)
from yade.params import table

num_spheres=table.num_spheres# number of spheres
key=table.key

targetPorosity = 0.55 #the porosity we want for the packing
compFricDegree = table.compFricDegree # initial contact friction during the 
confining phase (will be decreased during the REFD compaction process)
finalFricDegree = 30 # contact friction during the deviatoric loading
rate=0 # loading rate (strain rate)
damp=0.8 # damping coefficient
stabilityThreshold=0.01 # we test unbalancedForce against this value in 
different loops (see below)
#2e4+70e4medio 1e4+70e4bom 1e4+60e4bom 3e4+90e4+w3,1,-1-the best
young=80e5 # contact stiffness200e4
young2=80e5
youngcoat=80e5
bondstr=1e3#2e7
bondstr2=1e3
bondstrcoat=1e6


## create materials for spheres and plates
mat=O.materials.append(JCFpmMat(type=1,young=young,poisson=0.3,frictionAngle=radians(compFricDegree),density=2000,tensileStrength=bondstr,cohesion=bondstr,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=bondstr,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='spheres'))
O.materials.append(JCFpmMat(type=1,young=20e7,poisson=0.3,frictionAngle=radians(0),density=2600,tensileStrength=0,cohesion=0,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=0,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='walls'))
O.materials.append(JCFpmMat(type=1,young=youngcoat,poisson=0.3,frictionAngle=radians(1),density=1500,tensileStrength=bondstrcoat,cohesion=bondstrcoat,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=bondstrcoat,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='spherescoat'))

## create walls around the packing

mn,mx=Vector3(0,0,0),Vector3(0.0015,0.0015,0.0015)
mnbox,mxbox=Vector3(-0.0003,-0.0002,0.0003),Vector3(0.0025,0.0025,0.0025)#Vector3(0.002,0.00195,0.002)
walls=aabbWalls([mnbox,mxbox],thickness=0,material='walls')
wallIds=O.bodies.append(walls)

sp=pack.SpherePack()
sp.makeCloud(minCorner=mnbox, maxCorner=mxbox,rMean=0.0001)
O.bodies.append([sphere(center,rad,material='spheres') for center,rad in sp])
#O.bodies.append(ymport.textExt("matrix_vtest6.txt", format='x_y_z_r', 
shift=Vector3(0,0.0001,0), scale=1.0,material='spheres',color=(0,1,1)))#0.5
#O.bodies.append(ymport.textExt("coat_vtest6r756.txt", format='x_y_z_r', 
shift=Vector3(0,0,0), scale=1.0,material='spherescoat',color=(0,1,1)))
#O.bodies.append(ymport.textExt("coat_vtest6r56.txt", format='x_y_z_r', 
shift=Vector3(0,0,0), scale=1.0,material='spherescoat',color=(0,1,1)))


###
##   DEFINING ENGINES   ###
###

triax=TriaxialStressController(
## TriaxialStressController will be used to control stress and strain. It 
controls particles size and plates positions.
## this control of boundary conditions was used for instance in 
http://dx.doi.org/10.1016/j.ijengsci.2008.07.002
maxMultiplier=1.+2e4/young, # spheres growing factor (fast growth)
finalMaxMultiplier=1.+2e3/young, # spheres growing factor (slow growth)
thickness = 0,
## switch stress/strain control using a bitmask. What is a bitmask, huh?!
## Say x=1 if stess is controlled on x, else x=0. Same for for y and z, 
which are 1 or 0.
## Then an integer uniquely defining the combination of all these tests is: 
mask = x*1 + y*2 + z*4
## to put it differently, the mask is the integer whose binary 
representation is xyz, i.e.
## "100" (1) means "x", "110" (3) means "x and y", "111" (7) means "x and y 
and z", etc.
stressMask

[Yade-users] [Question #702448]: 2PFV - update Triangulation

2022-07-11 Thread Luis Barbosa
New question #702448 on Yade:
https://answers.launchpad.net/yade/+question/702448

Hi all,

I am investigating how the mesh evolves during the drainage using 2PFV.

I my original problem, I have a significant particle deformation/movement 
during the drying process, but tracking "getPoreThroatRadiusList()" in 
different instants I got the exactly same values. This also for the CellVolume, 
CellPorosity. It seems that the cell is constant even the pack is changing over 
time.

Any clue?

Here you have a simplified idea of my original script:

#!/usr/bin/python
# -*- encoding=utf-8 -*-
#*
#  Copyright (C) 2010 by Bruno Chareyre  *
#  bruno.chareyre_at_grenoble-inp.fr *
#*
#  This program is free software; it is licensed under the terms of the  *
#  GNU General Public License v2 or later. See file LICENSE for details. *
#*/

from yade import pack
from yade import bodiesHandling
from yade import export
from yade import utils
from yade import ymport
import math
import numpy


###   DEFINING VARIABLES AND MATERIALS   ###


# The following 5 lines will be used later for batch execution
nRead=readParamsFromTable(
num_spheres=3000,# number of spheres
compFricDegree = 1, # contact friction during the confining phase
key='_triax_base_', # put you simulation's name here
unknownOk=True
)
from yade.params import table

num_spheres=table.num_spheres# number of spheres
key=table.key

targetPorosity = 0.55 #the porosity we want for the packing
compFricDegree = table.compFricDegree # initial contact friction during the 
confining phase (will be decreased during the REFD compaction process)
finalFricDegree = 30 # contact friction during the deviatoric loading
rate=0 # loading rate (strain rate)
damp=0.8 # damping coefficient
stabilityThreshold=0.01 # we test unbalancedForce against this value in 
different loops (see below)
#2e4+70e4medio 1e4+70e4bom 1e4+60e4bom 3e4+90e4+w3,1,-1-the best
young=80e5 # contact stiffness200e4
young2=80e5
youngcoat=80e5
bondstr=1e3#2e7
bondstr2=1e3
bondstrcoat=1e6


## create materials for spheres and plates
mat=O.materials.append(JCFpmMat(type=1,young=young,poisson=0.3,frictionAngle=radians(compFricDegree),density=2000,tensileStrength=bondstr,cohesion=bondstr,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=bondstr,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='spheres'))
O.materials.append(JCFpmMat(type=1,young=20e7,poisson=0.3,frictionAngle=radians(0),density=2600,tensileStrength=0,cohesion=0,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=0,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='walls'))
O.materials.append(JCFpmMat(type=1,young=youngcoat,poisson=0.3,frictionAngle=radians(1),density=1500,tensileStrength=bondstrcoat,cohesion=bondstrcoat,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=bondstrcoat,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='spherescoat'))

## create walls around the packing

mn,mx=Vector3(0,0,0),Vector3(0.0015,0.0015,0.0015)
mnbox,mxbox=Vector3(-0.0003,-0.0002,0.0003),Vector3(0.0025,0.0025,0.0025)#Vector3(0.002,0.00195,0.002)
walls=aabbWalls([mnbox,mxbox],thickness=0,material='walls')
wallIds=O.bodies.append(walls)

sp=pack.SpherePack()
sp.makeCloud(minCorner=mnbox, maxCorner=mxbox,rMean=0.0001)
O.bodies.append([sphere(center,rad,material='spheres') for center,rad in sp])
#O.bodies.append(ymport.textExt("matrix_vtest6.txt", format='x_y_z_r', 
shift=Vector3(0,0.0001,0), scale=1.0,material='spheres',color=(0,1,1)))#0.5
#O.bodies.append(ymport.textExt("coat_vtest6r756.txt", format='x_y_z_r', 
shift=Vector3(0,0,0), scale=1.0,material='spherescoat',color=(0,1,1)))
#O.bodies.append(ymport.textExt("coat_vtest6r56.txt", format='x_y_z_r', 
shift=Vector3(0,0,0), scale=1.0,material='spherescoat',color=(0,1,1)))


###
##   DEFINING ENGINES   ###
###

triax=TriaxialStressController(
## TriaxialStressController will be used to control stress and strain. It 
controls particles size and plates positions.
## this control of boundary conditions was used for instance in 
http://dx.doi.org/10.1016/j.ijengsci.2008.07.002
maxMultiplier=1.+2e4/young, # spheres growing factor (fast growth)
finalMaxMultiplier=1.+2e3/young, # spheres growing factor (slow growth)
thickness = 0,
## switch stress/strain control using a bitmask. What is a bitmask, huh?!
## Say x=1 if stess is controlled on x, else x=0. Same for for y and z, 
which are 1 or 0.
## Then an integer uniquely defining the combination of all these tests is: 
mask = x*1 + y*2 + z*4
## to put it 

Re: [Yade-users] [Question #702425]: 2PFV - Cell Velocity

2022-07-11 Thread Luis Barbosa
Question #702425 on Yade changed:
https://answers.launchpad.net/yade/+question/702425

Status: Answered => Solved

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


[Yade-users] [Question #702425]: 2PFV - Cell Velocity

2022-07-08 Thread Luis Barbosa
New question #702425 on Yade:
https://answers.launchpad.net/yade/+question/702425

Hi guys,

I am using 2PFV, but have trouble to getCellVelocity.

Triangulation does not exist. Sorry.
Traceback (most recent call last):
  File "/usr/bin/yade", line 343, in runScript
execfile(script,globals())
  File "/usr/lib/python3/dist-packages/past/builtins/misc.py", line 87, in 
execfile
exec_(code, myglobals, mylocals)
  File "matrix_drain_scaled21_Calibrado2.py", line 344, in 
celsVel1=unsat.getCellVelocity(ii)
Boost.Python.ArgumentError: Python argument types in
TwoPhaseFlowEngineT.getCellVelocity(TwoPhaseFlowEngine, int)
did not match C++ signature:

getCellVelocity(yade::TemplateFlowEngine_TwoPhaseFlowEngineT >, 
yade::CGT::FlowBoundingSphereLinSolv >, 
yade::CGT::FlowBoundingSphere > > > > {lvalue}, Eigen::Matrix 
pos)




I modified the example - 
https://gitlab.com/yade-dev/trunk/-/blob/master/examples/FluidCouplingPFV/oedometer.py


###
## Drainage Test under oedometer conditions ###
###
##Instantiate a two-phase engine
unsat=TwoPhaseFlowEngine()
#meanDiameter=(O.bodies[-1].shape.radius + O.bodies[6].shape.radius) / 2.

##set boundary conditions, the drainage is controlled by decreasing W-phase 
pressure and keeping NW-phase pressure constant
unsat.bndCondIsPressure=[0,0,1,1,0,0]
unsat.bndCondIsWaterReservoir=[0,0,1,0,0,0]
unsat.bndCondValue=[0,0,-1e8,0,0,0]
unsat.isPhaseTrapped=True #the W-phase can be disconnected from its reservoir
unsat.initialization()
unsat.surfaceTension = 0.0728
unsat.updateTriangulation=True
unsat.meshUpdateInterval=200
unsat.defTolerance=0.3

#unsat.breakControlledRemesh=True


#start invasion, the data of normalized pc-sw-strain will be written into 
pcSwStrain.txt

f1=open('MatrixCellsa4'+str(YM)+'_'+str(BS)+'.txt',"w")

ts=O.dt
pgstep= 40 #4500*ts #30Pa/s
print (pgstep)
pgmax= 1#9316 #Pa
mi=0.00089 #Pa.s

for pg in arange(1.0e-8,pgmax,pgstep):
  unsat.bndCondValue=[0,0,(-1.0)*pg,0,0,0]
  unsat.invasion()
  unsat.computeCapillaryForce()
  unsat.permeabilityMap=True

  q=unsat.averageVelocity()
  L=0.0016*(1+triax.strain[1]+ei1)
  P=abs((mi*q*L)/pg)
  
print(unsat.getSaturation(isSideBoundaryIncluded=False),pg,-triax.strain[1],P,triax.porosity)

  for b in O.bodies:
O.forces.setPermF(b.id, unsat.fluidForce(b.id))

  if pg==520.0001:
cels=unsat.nCells()
celsW1 = [0.0]*cels
celsV1 = [0.0]*cels
celsBar1 = [0.0]*cels
celsPore1 = [0.0]*cels
celsVel1 = [0.0]*cels
celsSA1 = [0.0]*cels
for ii in range(cels):
  celsW1=unsat.getCellIsWRes(ii)
  celsV1=unsat.getCellVolume(ii)
  celsBar1=unsat.getCellCenter(ii)
  celsPore1=unsat.getPoreThroatRadiusList(ii)
  celsVel1=unsat.getCellVelocity(ii)
  celsSA1=unsat.getSolidSurfaceAreaPerParticle(ii)
  f1.write(str(celsW1)+" "+str(celsV1)+" "+str(celsBar1)+" 
"+str(celsPore1)+" "+str(celsVel1)+" "+str(celsSA1)+"\n")
f1.close()

-- 
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 #700611]: TwoPhaseFlow - double free or corruption

2022-03-08 Thread Luis Barbosa
Question #700611 on Yade changed:
https://answers.launchpad.net/yade/+question/700611

Status: Needs information => Open

Luis Barbosa gave more information on the question:
There is no overlapping.

-- 
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 #700611]: TwoPhaseFlow - double free or corruption

2022-03-05 Thread Luis Barbosa
Question #700611 on Yade changed:
https://answers.launchpad.net/yade/+question/700611

Luis Barbosa gave more information on the question:
Here is how I am running:

+ singularity run
/beegfs/common/singularity/yade/yade_debian_bookwarm_1.0.sif yadedaily
-j80 drain_importMatrixTriax7_10_c3.py


Here is the output:
double free or corruption (!prev)


Interesting to note:

1.
I have used tcmalloc, as suggested here:
https://github.com/tensorflow/tensorflow/issues/6968
https://www.google.com/search?client=firefox-b-d=apt-get+install+google-perftools
https://riptutorial.com/tensorflow/example/13427/use-the-tcmalloc-allocator

But, it just gave me another output: "Core dumped"

2.
>From the TwoPhaseFlowEngine I played around to see where exactly the error 
>happens and discovered that it is related to  unsat.invasion(), Invasion 1 or 
>invasion 2 in the hpp file. In some scripts that I have double free or 
>corruption (!prev), when I switch .isPhaseTrapped=False, than it worked, but 
>in the script I provided above it still did not worked.

3.
Sometimes, I am getting the message, when using Yadedaily, but not for Yade.
<NOFILTER> :750 void 
yade::CGT::Network::lineSolidPore(yade::CGT::Network::CellHandle,
 int) [with Tesselation = 
yade::CGT::_Tesselation >; yade::CGT::Network::CellHandle = 
CGAL::internal::CC_iterator,
 CGAL::Triangulation_cell_base_with_info_3, CGAL::Regular_triangulation_cell_base_3, 
CGAL::Triangulation_cell_base_3, 
CGAL::Triangulation_ds_cell_base_3,
 CGAL::Triangulation_vertex_base_with_info_3, CGAL::Regular_triangulation_vertex_base_3 > 
>, CGAL::Boolean_tag, CGAL::Boolean_tag >, 
CGAL::Alpha_shape_cell_base_3, 
CGAL::Triangulation_cell_base_with_info_3, CGAL::Regular_triangulation_cell_base_3 > >, 
CGAL::Boolean_tag, CGAL::Boolean_tag >, CGAL::Sequential_tag> > 
>, CGAL::Hidden_points_memory_policy >, 
std::__cxx11::list >, 
std::allocator > > > > >, 
CGAL::Boolean_tag, CGAL::Boolean_tag >, CGAL::Default, 
CGAL::Default, CGAL::Default>, false>]: Unhandled switch case:3

-- 
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 #700611]: TwoPhaseFlow - double free or corruption

2022-03-05 Thread Luis Barbosa
Question #700611 on Yade changed:
https://answers.launchpad.net/yade/+question/700611

Status: Answered => Open

Luis Barbosa is still having a problem:
For this I have to provide txt files for the creation of the packs.
Sorry for the external links:



https://drive.google.com/file/d/16y5Ia4kUUm6oap8QlnSvQf9uCuMzJ7TN/view?usp=sharing

https://drive.google.com/file/d/1_rUoO-6b2j6e3LSRsMlh8C4vKRu8txoN/view?usp=sharing

https://drive.google.com/file/d/1oR9bHoru-
Us6wvHwn7UpkZwt9IX6GRvE/view?usp=sharing

https://drive.google.com/file/d/1cLyeXTjNuavGRxuFv27HyPxvtn-2EW5i/view?usp=sharing


=

from yade import pack
from yade import bodiesHandling
from yade import export
from yade import utils
from yade import ymport
import math


###   DEFINING VARIABLES AND MATERIALS   ###


# The following 5 lines will be used later for batch execution
nRead=readParamsFromTable(
num_spheres=3000,# number of spheres
compFricDegree = 1, # contact friction during the confining phase
key='_triax_base_', # put you simulation's name here
unknownOk=True
)
from yade.params import table

num_spheres=table.num_spheres# number of spheres
key=table.key

targetPorosity = 0.50 #the porosity we want for the packing
compFricDegree = table.compFricDegree # initial contact friction during the 
confining phase (will be decreased during the REFD compaction process)
finalFricDegree = 30 # contact friction during the deviatoric loading
rate=0 # loading rate (strain rate)
damp=0.8 # damping coefficient
stabilityThreshold=0.01 # we test unbalancedForce against this value in 
different loops (see below)
young=80e5 # contact stiffness200e4
young2=80e5
youngcoat=50e5
bondstr=1000#2e7
bondstr2=1000
bondstrcoat=10


## create materials for spheres and plates
mat=O.materials.append(JCFpmMat(type=1,young=young,poisson=0.3,frictionAngle=radians(compFricDegree),density=2000,tensileStrength=bondstr,cohesion=bondstr,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=bondstr,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='spheres'))
O.materials.append(JCFpmMat(type=1,young=20e7,poisson=0.3,frictionAngle=radians(0),density=2600,tensileStrength=0,cohesion=0,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=0,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='walls'))
O.materials.append(JCFpmMat(type=1,young=youngcoat,poisson=0.3,frictionAngle=radians(1),density=1500,tensileStrength=bondstrcoat,cohesion=bondstrcoat,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=bondstrcoat,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='spherescoat'))

## create walls around the packing

mn,mx=Vector3(0,0,0),Vector3(0.0015,0.0015,0.0015)
mnbox,mxbox=Vector3(0,0,0),Vector3(0.002,0.00195,0.002)
walls=aabbWalls([mnbox,mxbox],thickness=0,material='walls')
wallIds=O.bodies.append(walls)

O.bodies.append(ymport.textExt("matrix_vtest6.txt", format='x_y_z_r', 
shift=Vector3(0,0.00025,0), scale=1.0,material='spheres',color=(0,1,1)))
O.bodies.append(ymport.textExt("coat_vtest5e5.txt", format='x_y_z_r', 
shift=Vector3(0,0,0), scale=1.0,material='spherescoat',color=(0,1,1)))


Particle substitution by large 
aggregate##

bodid=[]
for b in O.bodies:
if b and isinstance(b.shape,Sphere):
#   print (b.shape.radius)
if b.state.pos[1]>0.00175:
bodid.append(b.id)
i=0
for p in bodid:
O.bodies.erase(bodid[i])
i=i+1

bodid=[]
a=[]
for b in O.bodies:# in sp:
if b and isinstance(b.shape,Sphere):
#   print (b.shape.radius)
if b.shape.radius==0.0002:
bodid.append(b.id)
a.append(b.state.pos)

i=0
for p in bodid:
t=a[i]
f1=O.bodies.append(ymport.textExt("agg2e4_10e6.txt", format='x_y_z_r', 
shift=t-Vector3(0,0,0.0002), scale=1.0,material='spheres',color=(0,1,1)))
O.bodies.erase(bodid[i])
i=i+1

bodiddd=[]
aaa=[]
for bbb in O.bodies:# in sp:
if bbb and isinstance(bbb.shape,Sphere):
#   print (b.shape.radius)
if bbb.shape.radius==0.0005:
bodiddd.append(bbb.id)
aaa.append(bbb.state.pos)

iii=0
for ppp in bodiddd:
ttt=aaa[iii]
f3=O.bodies.append(ymport.textExt("agg5e5_18e6.txt", format='x_y_z_r', 
shift=ttt-Vector3(0,0,0.0005), scale=1.0,material='spheres',color=(0,1,1)))

Re: [Yade-users] [Question #700611]: TwoPhaseFlow - double free or corruption

2022-02-28 Thread Luis Barbosa
Question #700611 on Yade changed:
https://answers.launchpad.net/yade/+question/700611

Luis Barbosa posted a new comment:
>>So you have crashes without MPI and without aggregates when using many 
>>particles?
Yes.

I also tried without singularity using Yade 2022124 -6294 bionic and got
the same issue.

-- 
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 #700611]: TwoPhaseFlow - double free or corruption

2022-02-15 Thread Luis Barbosa
Question #700611 on Yade changed:
https://answers.launchpad.net/yade/+question/700611

Status: Answered => Open

Luis Barbosa is still having a problem:
Maybe this is not from the source code itself. But, somenthing in the
python script allocating memory.

-- 
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 #700611]: TwoPhaseFlow - double free or corruption

2022-02-15 Thread Luis Barbosa
Question #700611 on Yade changed:
https://answers.launchpad.net/yade/+question/700611

Luis Barbosa posted a new comment:
Hi,

The main topic is the use of TwoPhaseFlowEngine with large number of
particles.

I am runnig singularity:
Yade 2021.01a 
python version: 3.9.7 (default, Sep 24 2021, 09:43:00) 

Luis

-- 
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 #700611]: TwoPhaseFlow - double free or corruption

2022-02-14 Thread Luis Barbosa
Question #700611 on Yade changed:
https://answers.launchpad.net/yade/+question/700611

Status: Answered => Open

Luis Barbosa is still having a problem:
Thanks Bruno.

This may just play a bad MPI efficiency, but still it works for lower
number of particles.


But anyway, I ran this example without MPI to check, and obtained:

corrupted size vs. prev_size while consolidating

Again, this error just happens when using agglomerates.
The error appears when the drainage starts. If I use the same script but with 
less particles, it works.

-- 
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 #700561]: Convert script to Openmpi

2022-02-14 Thread Luis Barbosa
Question #700561 on Yade changed:
https://answers.launchpad.net/yade/+question/700561

Status: Open => Solved

Luis Barbosa confirmed that the question is solved:
I worked with the time steps and mass flow, and it works now.

-- 
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 #700470]: verletDist - Box Factory

2022-02-14 Thread Luis Barbosa
Question #700470 on Yade changed:
https://answers.launchpad.net/yade/+question/700470

Status: Open => Solved

Luis Barbosa confirmed that the question is solved:
I worked with the time steps and mass flow, and it works now.

-- 
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 #700611]: TwoPhaseFlow - double free or corruption

2022-02-14 Thread Luis Barbosa
New question #700611 on Yade:
https://answers.launchpad.net/yade/+question/700611

Hi all,

I am running the script [1] in OpenMpi with increased domain and smaller 
particles.
[1] 
https://gitlab.com/yade-dev/trunk/-/blob/master/examples/FluidCouplingPFV/drainage-2PFV-Yuan_and_Chareyre_2017.py


The pack is filled with 680 particles of radius 5e-4, 1520 particles of radius 
3e-4 and 3590 particles of radius 2e-4.

This pack (matrix_vtest.txt) was inported to the drainage simulation 2PFV [1] 
and each particle was substituted by agglomarate of particles as:
particle size 5e-4 were substituted by agglomerates of particles of radius5e-5 
(agg5e4_5e5.txt)
particle size 3e-4 were substituted by agglomerates of particles of radius 3e-5 
(agg3e4_3e5.txt)
particle size 2e-4 were substituted by agglomerates of particles of radius 2e-5 
(agg2e4_2e5.txt)

When I run the drainage simulation 2PFV [1] without substituting the pack by 
agglomerate (just to check its functionality) it works.
But, when I substitute the particles by the agglomerates I get the following 
error when the drainage starts:

double free or corruption (!prev)
[node030:278860] *** Process received signal ***
[node030:278860] Signal: Aborted (6)
[node030:278860] Signal code:  (-6)
[node030:278860] [ 0] 
/lib/x86_64-linux-gnu/libpthread.so.0(+0x138e0)[0x2ae56996a8e0]
[node030:278860] [ 1] 
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x141)[0x2ae5699b6e71]
[node030:278860] [ 2] 
/lib/x86_64-linux-gnu/libc.so.6(abort+0x112)[0x2ae5699a0536]
[node030:278860] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x7e2b8)[0x2ae5699f82b8]
[node030:278860] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x85d0a)[0x2ae5699ffd0a]
[node030:278860] [ 5] /lib/x86_64-linux-gnu/libc.so.6(+0x8757c)[0x2ae569a0157c]
[node030:278860] [ 6] 
/usr/lib/x86_64-linux-gnu/yade/libyade.so(_ZN4yade3CGT7NetworkINS0_12_TesselationINS0_18TriangulationTypesINS_18TwoPhaseVertexInfoENS_16TwoPhaseCellInfoEE19defineFictiousCellsEv+0x1c5)[0x2ae56d60ae55]
[node030:278860] [ 7] 
/usr/lib/x86_64-linux-gnu/yade/libyade.so(_ZN4yade38TemplateFlowEngine_TwoPhaseFlowEngineTINS_16TwoPhaseCellInfoENS_18TwoPhaseVertexInfoENS_3CGT12_TesselationINS3_18TriangulationTypesIS2_S1_NS3_25FlowBoundingSphereLinSolvIS7_NS3_18FlowBoundingSphereIS7_E18buildTriangulationEdRSB_+0xa18)[0x2ae56d6341b8]
[node030:278860] [ 8] 
/usr/lib/x86_64-linux-gnu/yade/libyade.so(_ZN4yade18TwoPhaseFlowEngine14initializationEv+0x4f)[0x2ae56d5a4e8f]
[node030:278860] [ 9] 
/usr/lib/x86_64-linux-gnu/yade/libyade.so(_ZN5boost6python7objects23caller_py_function_implINS0_6detail6callerIMN4yade18TwoPhaseFlowEngineEFvvENS0_21default_call_policiesENS_3mpl7vector2IvRS6_EclEP7_objectSH_+0x43)[0x2ae56d5aff03]
[node030:278860] [10] 
/usr/lib/x86_64-linux-gnu/libboost_python39.so.1.74.0(_ZNK5boost6python7objects8function4callEP7_objectS4_+0x2bb)[0x2ae56e8596db]
[node030:278860] [11] 
/usr/lib/x86_64-linux-gnu/libboost_python39.so.1.74.0(+0x20968)[0x2ae56e859968]
[node030:278860] [12] 
/usr/lib/x86_64-linux-gnu/libboost_python39.so.1.74.0(_ZN5boost6python21handle_exception_implENS_9function0IvEE+0x73)[0x2ae56e85e893]
[node030:278860] [13] 
/usr/lib/x86_64-linux-gnu/libboost_python39.so.1.74.0(+0x1e0c2)[0x2ae56e8570c2]
[node030:278860] [14] /usr/bin/python3.9(_PyObject_MakeTpCall+0x39b)[0x51df8b]
[node030:278860] [15] /usr/bin/python3.9[0x53c575]
[node030:278860] [16] 
/usr/bin/python3.9(_PyEval_EvalFrameDefault+0x5418)[0x517508]
[node030:278860] [17] /usr/bin/python3.9[0x510d5d]
[node030:278860] [18] 
/usr/bin/python3.9(_PyEval_EvalCodeWithName+0x47)[0x510b07]
[node030:278860] [19] /usr/bin/python3.9(PyEval_EvalCode+0x23)[0x5f38b3]
[node030:278860] [20] /usr/bin/python3.9[0x5f8540]
[node030:278860] [21] /usr/bin/python3.9[0x529ee4]
[node030:278860] [22] 
/usr/bin/python3.9(_PyEval_EvalFrameDefault+0x52b)[0x51261b]
[node030:278860] [23] /usr/bin/python3.9[0x510d5d]
[node030:278860] [24] /usr/bin/python3.9(_PyFunction_Vectorcall+0x342)[0x529362]
[node030:278860] [25] 
/usr/bin/python3.9(_PyEval_EvalFrameDefault+0x52b)[0x51261b]
[node030:278860] [26] /usr/bin/python3.9[0x511657]
[node030:278860] [27] /usr/bin/python3.9(_PyFunction_Vectorcall+0x342)[0x529362]
[node030:278860] [28] 
/usr/bin/python3.9(_PyEval_EvalFrameDefault+0x52b)[0x51261b]
[node030:278860] [29] /usr/bin/python3.9[0x511657]
[node030:278860] *** End of error message ***


I wounder if it has to do with Numpy/Scipy not supporting such a large number 
of in the sparce matrix and if would have a work around. Or if it is something 
else.

Below is the script I modified to import the pack and agglomerates (.txt). I 
did not provide an external link to these txt files, but I can do that if 
necessary.


#!/usr/bin/python
# -*- encoding=utf-8 -*-

import os
from yade import mpy as mp
from yade import pack
from yade import bodiesHandling
from yade import export
from yade import utils
from yade import ymport
#import math


###   DEFINING VARIABLES AND 

[Yade-users] [Question #700561]: Convert script to Openmpi

2022-02-09 Thread Luis Barbosa
New question #700561 on Yade:
https://answers.launchpad.net/yade/+question/700561

Dear all,

I am new on running Yade on multiple nodes using openmpi.
Still checking how to convert the code below to run in mpi.

Runnning the code below I get the messsage: 
Friction:  1  porosity: 1.0 None
Master: single-core, fall back to O.run() 

Probably I am not using O.run and mpirun correctly.
If anyone with more experimence see what I am duing wrong, please let me know.

Cheers,


#!/usr/bin/python
# -*- encoding=utf-8 -*-
#*
#  Copyright (C) 2010 by Bruno Chareyre  *
#  bruno.chareyre_at_grenoble-inp.fr *
#*
#  This program is free software; it is licensed under the terms of the  *
#  GNU General Public License v2 or later. See file LICENSE for details. *
#*/
import os
from yade import mpy as mp
from yade import pack
from yade import bodiesHandling
from yade import export
from yade import utils
from yade import ymport
import math


###   DEFINING VARIABLES AND MATERIALS   ###


# The following 5 lines will be used later for batch execution
nRead=readParamsFromTable(
num_spheres=3000,# number of spheres
compFricDegree = 1, # contact friction during the confining phase
key='_triax_base_', # put you simulation's name here
unknownOk=True
)
from yade.params import table

num_spheres=table.num_spheres# number of spheres
key=table.key

targetPorosity = 0.35 #the porosity we want for the packing
compFricDegree = table.compFricDegree # initial contact friction during the 
confining phase (will be decreased during the REFD compaction process)
finalFricDegree = 30 # contact friction during the deviatoric loading
rate=0 # loading rate (strain rate)
damp=0.8 # damping coefficient
stabilityThreshold=0.01 # we test unbalancedForce against this value in 
different loops (see below)
#2e4+70e4medio 1e4+70e4bom 1e4+60e4bom 3e4+90e4+w3,1,-1-the best
young=20e5 # contact stiffness200e4
young2=20e5
youngcoat=20e5
bondstr=0.3e3#2e7
bondstr2=0.3e3
bondstrcoat=1e3


## create materials for spheres and plates
mat=O.materials.append(JCFpmMat(type=1,young=young,poisson=0.3,frictionAngle=radians(compFricDegree),density=2000,tensileStrength=bondstr,cohesion=bondstr,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=bondstr,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='spheres'))
O.materials.append(JCFpmMat(type=1,young=20e7,poisson=0.3,frictionAngle=radians(0),density=2600,tensileStrength=0,cohesion=0,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=0,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='walls'))
O.materials.append(JCFpmMat(type=1,young=youngcoat,poisson=0.3,frictionAngle=radians(1),density=1500,tensileStrength=bondstrcoat,cohesion=bondstrcoat,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=bondstrcoat,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='spherescoat'))

## create walls around the packing

mn,mx=Vector3(0,0,0),Vector3(0.0101,0.0101,0.0101)
mnbox,mxbox=Vector3(0,0,0),Vector3(0.0101,0.0115,0.0101)
walls=aabbWalls([mnbox,mxbox],thickness=0,material='walls')
wallIds=O.bodies.append(walls)

O.bodies.append(ymport.textExt("matrix_vtest.txt", format='x_y_z_r', 
shift=Vector3(0,0,0), scale=1.0,material='spherescoat',color=(0,1,1)))


Particle substitution by large 
aggregate##

bodid=[]
a=[]
for b in O.bodies:
if b and isinstance(b.shape,Sphere):
#   print (b.shape.radius)
if b.shape.radius==0.0005:
bodid.append(b.id)
a.append(b.state.pos)

i=0
for p in bodid:
t=a[i]
f1=O.bodies.append(ymport.textExt("agg5e4_5e5.txt", format='x_y_z_r', 
shift=t-Vector3(0,0,0), scale=1.0,material='spheres',color=(0,1,1)))
O.bodies.erase(bodid[i])
i=i+1


bodidd=[]
aa=[]
for bb in O.bodies:# in sp:
if bb and isinstance(bb.shape,Sphere):
#   print (bb.shape.radius)
if bb.shape.radius==0.0003:
bodidd.append(bb.id)
aa.append(bb.state.pos)

ii=0
for pp in bodidd:
tt=aa[ii]
f2=O.bodies.append(ymport.textExt("agg3e4_3e5.txt", format='x_y_z_r', 
shift=tt-Vector3(0,0,0), scale=1.0,material='spheres',color=(0,1,1)))
O.bodies.erase(bodidd[ii])
ii=ii+1



bodiddd=[]
aaa=[]
for bbb in O.bodies:# in sp:
if bbb and isinstance(bbb.shape,Sphere):
#   print (bbb.shape.radius)
if bbb.shape.radius==0.0002:
bodiddd.append(bbb.id)
  

Re: [Yade-users] [Question #700315]: Open MPI - spawn processes

2022-02-09 Thread Luis Barbosa
Question #700315 on Yade changed:
https://answers.launchpad.net/yade/+question/700315

Luis Barbosa posted a new comment:
Hi all, just to inform that we solved this:

Solution was to install OpenMpi 4.1.0 on my home directory on the
cluster.

Here are the steps I performed:

Download 
https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.0.tar.gz

open a console on the cluster in your home folder:
cd ~
mkdir openMPI
cd openMPI

> copy or download openmpi-4.1.0.tar.gz tar ball into the openMPI
folder, and unpack it

gtar zxf openmpi-4.1.0.tar.gz
cd openmpi-4.1.0

> create a output folder

mkdir /home/pires/bin/openmpi

> create a build folder, and compile openMPI

mkdir build
cd build
../configure --prefix=/home/pires/bin/openmpi --with-slurm --with-pmi
make all 
make install

--

at this point you have openMPI 4.1.0 with slurm support installed into your 
home. 
Next step is to make your own module.

mkdir /home/../privatemodules
cd /home/.../privatemodules

A module file is just a bunch of linux environment variables.

Hope it can help someone in this situation.
Luis

-- 
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 #700470]: verletDist - Box Factory

2022-02-01 Thread Luis Barbosa
New question #700470 on Yade:
https://answers.launchpad.net/yade/+question/700470

 Hi all, 

I am creating BoxFactory inside O.engines., but getting the following error:

+ singularity run /beegfs/common/singularity/yade/yade_debian_bookwarm_1.0.sif 
yade -j80 Densidade_boxfactory.py
/usr/lib/x86_64-linux-gnu/yade/py/yade/__init__.py:76: RuntimeWarning: 
to-Python converter for boost::shared_ptr already 
registered; second conversion method ignored.
  boot.initialize(plugins,config.confDir)
TCP python prompt on localhost:9000, auth cookie `akcdsy'
Welcome to Yade 2021.01a 
Using python version: 3.9.7 (default, Sep 24 2021, 09:43:00) 
[GCC 10.3.0]
Warning: no X rendering available (see 
https://bbs.archlinux.org/viewtopic.php?id=13189)
XMLRPC info provider on http://localhost:21000
Running script Densidade_boxfactory.py
python3.9: ./pkg/common/InsertionSortCollider.hpp:127: 
yade::InsertionSortCollider::Bounds& 
yade::InsertionSortCollider::VecBounds::operator[](long int): Assertion `idx < 
long(size()) && idx >= 0' failed.


Here is the script I am running in singularity:


#!/usr/bin/python
# -*- coding: utf-8 -*-
#unidades milimetros, s, Pa, milimetros3/kg, kg
#Forca normal lei de contato coesao e atrito
from yade import plot
from yade import ymport
from yade import bodiesHandling
from yade import export
from yade import utils
import pylab

# Spheres

ceasa=O.materials.append(JCFpmMat(type=1,young=5e6,poisson=0.3,frictionAngle=radians(0),density=300,tensileStrength=0,cohesion=0,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=0,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='spheres1'))
#O.materials.append(JCFpmMat(type=1,young=70e4,poisson=0.3,frictionAngle=radians(30),density=800,tensileStrength=20e2,cohesion=20e2,jointNormalStiffness=1e5,jointShearStiffness=1e5,jointCohesion=20e2,jointFrictionAngle=radians(30),jointDilationAngle=0.0,label='spheres2'))

O.materials.append(FrictMat(young=10e6,poisson=0.3,frictionAngle=radians(0),density=1000,label='walls'))

mn,mx=Vector3(0,0,0),Vector3(0.01,0.01,0.01)
mnbox,mxbox=Vector3(0,0,0),Vector3(0.01,0.015,0.01)
walls=aabbWalls([mnbox,mxbox],thickness=0,material='walls')
wallIds=O.bodies.append(walls)


#++

#
O.engines=[
  ForceResetter(),


InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()],verletDist=.05*.0025),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],

[Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=-1),Ip2_FrictMat_FrictMat_FrictPhys()],

[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=False, 
Key="Matrix", recordCracks=False),Law2_ScGeom_FrictPhys_CundallStrack()]
),
  NewtonIntegrator(damping=0.3,gravity=(0,-9.81,0)),
#  
BoxFactory(maxParticles=120,extents=(0.005,0.005,0.0005),center=(0.005,0.009,0.005),rMin=0.0002,rMax=0.0002,vMin=0.50,vMax=0.80,vAngle=0,massFlowRate=0.2,normal=(0,-1,0),label='factory1',materialId=ceasa),
#BoxFactory(maxParticles=110,extents=(0.005,0.005,0.001),center=(0.005,0.0105,0.005),rMin=0.0007,rMax=0.0007,vMin=0.50,vMax=0.80,vAngle=0,massFlowRate=0.00075,normal=(0,-1,0),label='factory2',materialId=ceasa),
#BoxFactory(maxParticles=44,extents=(0.005,0.005,0.0015),center=(0.005,0.013,0.005),rMin=0.0012,rMax=0.0012,vMin=0.50,vMax=0.80,vAngle=0,massFlowRate=0.00155,normal=(0,-1,0),label='factory3',materialId=ceasa),
  
BoxFactory(maxParticles=4000,extents=(0.005,0.005,0.0015),center=(0.005,0.0115,0.005),rMin=0.0002,rMax=0.0002,vMin=0.50,vMax=0.80,vAngle=0,massFlowRate=0.7,normal=(0,-1,0),label='factory1',materialId=ceasa),
BoxFactory(maxParticles=1000,extents=(0.005,0.005,0.0015),center=(0.005,0.0115,0.005),rMin=0.0003,rMax=0.0003,vMin=0.50,vMax=0.80,vAngle=0,massFlowRate=0.00016,normal=(0,-1,0),label='factory2',materialId=ceasa),
BoxFactory(maxParticles=100,extents=(0.005,0.005,0.0015),center=(0.005,0.0115,0.005),rMin=0.0005,rMax=0.0005,vMin=0.50,vMax=0.80,vAngle=0,massFlowRate=0.00025,normal=(0,-1,0),label='factory3',materialId=ceasa),

  PyRunner(iterPeriod=1,command='a()'),
  
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.5),

]

def a():
VPi=utils.voxelPorosity(200,(0,0,0),(0.01,0.01,0.01)) #Precisa definir 
o vertice inferior e superior que esta dentro do 
tambor(0.0025,0.0015,0.0025),(0.0075,0.0065,0.0075)
a=factory1.numParticles+factory2.numParticles+factory3.numParticles
unb=unbalancedForce()
#print(factory1.numParticles,factory1.numParticles*100/a, 
factory2.numParticles, factory2.numParticles*100/a, 
factory3.numParticles,factory3.numParticles*100/a, VPi,unb)
if factory1.numParticles>=factory1.maxParticles and 
factory2.numParticles>=factory2.maxParticles and 

Re: [Yade-users] [Question #700315]: Open MPI - spawn processes

2022-02-01 Thread Luis Barbosa
Question #700315 on Yade changed:
https://answers.launchpad.net/yade/+question/700315

Status: Answered => Solved

Luis Barbosa confirmed that the question is solved:
Hi Bruno,

We will try to compile yade with intel on the cluster directly.

Since I need IT for that it will take some time to make it.

I will close the issue for now, but when I finish this I will post the
solution to keep documented here.

cheers,
Luis

-- 
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 #700315]: Open MPI - spawn processes

2022-01-24 Thread Luis Barbosa
Question #700315 on Yade changed:
https://answers.launchpad.net/yade/+question/700315

Luis Barbosa gave more information on the question:
Hello all,

Since the OpenMPI and Intel MPI in my cluster may not be compatible and
I dont think it is possible to get these two different MPI systems
running.

Would you suggest some work arround?

I thought in creating a new docker image replacing OpenMPI with Intel MPI. 
However, I don't think this is supported by Yade or would run in dependency 
problems.

Maybe I could run multiple scripts on different nodes? not sure how it
would work acctually...

Any insight would be welcome.

Luis

-- 
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 #700315]: Open MPI - spawn processes

2022-01-21 Thread Luis Barbosa
Question #700315 on Yade changed:
https://answers.launchpad.net/yade/+question/700315

Status: Answered => Open

Luis Barbosa is still having a problem:
> "- also mind that the OpenMPI version on the host must be the same (or
sufficiently close to) the one in the singularity image, else it won't
connect communicate properly."

I run yade --test to check MPI:


| mpi   | 3.1   | ompi:4.1.0  |
+---+---+-+
| mpi4py| 3.0.3 |


My cluster has Intel(R) MPI Library, Version 2019 Update 8 installed. Do you 
know if this is compatible?

-- 
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 #700315]: Open MPI - spawn processes

2022-01-21 Thread Luis Barbosa
Question #700315 on Yade changed:
https://answers.launchpad.net/yade/+question/700315

Luis Barbosa posted a new comment:
Hi Bruno, thanks.

I just run a simple script[1] to try non-interactive execution (mpiexec
-np NUMSUBD+1 yade script.py)

Got this message:

+ singularity run /beegfs/common/singularity/yade/yade_debian_bookwarm_1.0.sif 
mpiexec -n 4 yade Parallel.py
--
The SLURM process starter for OpenMPI was unable to locate a
usable "srun" command in its path. Please check your path
and try again.
--
--
An internal error has occurred in ORTE:

[[58454,0],0] FORCE-TERMINATE AT (null):1 - error
../../../../../../orte/mca/plm/slurm/plm_slurm_module.c(475)

This is something that should be reported to the developers.
--


I will try this mpiexec -np N singularity run.

Kind regards and thanks for all insights.

[1]https://gitlab.com/yade-
dev/trunk/blob/master/examples/mpi/vtkRecorderExample.py

-- 
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 #700315]: Open MPI - spawn processes

2022-01-20 Thread Luis Barbosa
Question #700315 on Yade changed:
https://answers.launchpad.net/yade/+question/700315

Luis Barbosa posted a new comment:
Please consider Parallel.py=Case2_rotating_drum_mpi.py

-- 
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 #700315]: Open MPI - spawn processes

2022-01-20 Thread Luis Barbosa
New question #700315 on Yade:
https://answers.launchpad.net/yade/+question/700315

Hi guys, I am new in OpenMPI so I will try to be as clear as possible here.

I instaled Yade 2021.01a on my cluster 
singularity/yade/yade_debian_bookwarm_1.0.sif.

I can run simulations using all cores I want. My cluster has 160 nodes, each 
node 80 cpu's.
So far so good.

I am now trying to run multiple nodes. For this, I am checking out this example 
[1].
When I run it I am getting the following message:

+ singularity run /beegfs/common/singularity/yade/yade_debian_bookwarm_1.0.sif 
yade -j5 Parallel.py
/usr/lib/x86_64-linux-gnu/yade/py/yade/__init__.py:76: RuntimeWarning: 
to-Python converter for boost::shared_ptr already 
registered; second conversion method ignored.
  boot.initialize(plugins,config.confDir)
TCP python prompt on localhost:9000, auth cookie `ksaeuc'
Welcome to Yade 2021.01a 
Using python version: 3.9.7 (default, Sep 24 2021, 09:43:00) 
[GCC 10.3.0]
Warning: no X rendering available (see 
https://bbs.archlinux.org/viewtopic.php?id=13189)
XMLRPC info provider on http://localhost:21000
Running script Parallel.py
Traceback (most recent call last):
  File "/usr/bin/yade", line 343, in runScript
execfile(script,globals())
  File "/usr/lib/python3/dist-packages/past/builtins/misc.py", line 87, in 
execfile
exec_(code, myglobals, mylocals)
  File "Parallel.py", line 28, in 
mp.initialize(numMPIThreads)
  File "/usr/lib/x86_64-linux-gnu/yade/py/yade/mpy.py", line 288, in initialize
comm_slave = MPI.COMM_WORLD.Spawn(yadeArgv[0], 
args=yadeArgv[1:],maxprocs=numThreads-process_count)
  File "mpi4py/MPI/Comm.pyx", line 1534, in mpi4py.MPI.Intracomm.Spawn
mpi4py.MPI.Exception: MPI_ERR_SPAWN: could not spawn processes
Master: will spawn  9  workers running: /usr/bin/yade ['-j5', 
'Parallel.py'] 
[[ ^L clears screen, ^U kills line. F8 plot. ]]

In [1]: Do you really want to exit ([y]/n)? 

I am not sure from where it is comming. Any idea?


This is how I am running it in my Batch:

#!/bin/bash -x
#SBATCH --nodes=2
#SBATCH --ntasks=2
#SBATCH --cpus-per-task=80
#SBATCH --partition=compute
#SBATCH --job-name=DEM_PFV_Parallel
#SBATCH --time=10:00:00

singularity run /beegfs/common/singularity/yade/yade_debian_bookwarm_1.0.sif 
yade -j5 Case2_rotating_drum_mpi.py



PS. I am supposing that numMPIThreads = 10 in the python script is equal to 
nodes*-j (2*5 in this case).

[1]https://gitlab.com/yade-dev/trunk/-/blob/master/examples/DEM2020Benchmark/Case2_rotating_drum_mpi.py

-- 
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 #700119]: 2PFV Drainage

2022-01-12 Thread Luis Barbosa
Question #700119 on Yade changed:
https://answers.launchpad.net/yade/+question/700119

Luis Barbosa posted a new comment:
Hi guys,

Any idea on that?
I was thinking maybe it worth try changing on TPFE .cpp file saturation =1 to n.

And compile it again. Then, when I run the script it will start not
fully saturated drainage.

Any insight would be good.
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 #695911]: 2PFV - Hollow cylinder

2022-01-10 Thread Luis Barbosa
Question #695911 on Yade changed:
https://answers.launchpad.net/yade/+question/695911

Status: Answered => Solved

Luis Barbosa 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 #700119]: 2PFV Drainage

2022-01-08 Thread Luis Barbosa
Question #700119 on Yade changed:
https://answers.launchpad.net/yade/+question/700119

Luis Barbosa gave more information on the question:
Hi all. Just adding another option I found. But it raises other
questions.

Starting the simulation with imbibition till it reach the desired
saturation and then start drainage.

But, in this case I am facing issues.

1. From getCellInvVoidVolume it seems that the void volume increases over time, 
but I would expect it to decrease due to increment of water in the cells.
2. From getCellThresholdSaturation and getCellMergedID I getting zero value.
3. As a option to (2) I used getCellSaturation and calculated the saturation of 
the sample. It worked, but it increases linearly with pressure in the W-phase. 
I would expect something non-linear because in my simulations I have different 
pore sizes.

Here is a very simple script:

#!/usr/bin/python
# -*- encoding=utf-8 -*-
#*

from yade import pack
from yade import bodiesHandling
from yade import export
from yade import utils
from yade import ymport


###   DEFINING VARIABLES AND MATERIALS   ###


# The following 5 lines will be used later for batch execution
nRead=readParamsFromTable(
num_spheres=3000,# number of spheres
compFricDegree = 1, # contact friction during the confining phase
key='_triax_base_', # put you simulation's name here
unknownOk=True
)
from yade.params import table

num_spheres=table.num_spheres# number of spheres
key=table.key

targetPorosity = 0.39 #the porosity we want for the packing
compFricDegree = table.compFricDegree # initial contact friction during the 
confining phase (will be decreased during the REFD compaction process)
finalFricDegree = 1 # contact friction during the deviatoric loading
rate=0 # loading rate (strain rate)
damp=0.1 # damping coefficient
stabilityThreshold=0.01 # we test unbalancedForce against this value in 
different loops (see below)
#2e4+70e4medio 1e4+70e4bom 1e4+60e4bom 3e4+90e4+w3,1,-1-the best
young=10e5 # contact stiffness200e4
young2=10e5
youngcoat=90e4
bondstr=10e8#2e7
bondstr2=0.8e5
bondstrcoat=5e4
mn,mx=Vector3(0,0,0),Vector3(0.006,0.006,0.006) # corners of the matrix
mncoat,mxcoat=Vector3(0,0,0),Vector3(0.006,0.0005,0.006)# corners of the coating
mnbox,mxbox=Vector3(0,0,0),Vector3(0.006,0.006,0.006)

## create materials for spheres and plates
mat=O.materials.append(JCFpmMat(type=1,young=young,poisson=0.3,frictionAngle=radians(compFricDegree),density=2000,tensileStrength=bondstr,cohesion=bondstr,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=bondstr,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='spheres'))
O.materials.append(JCFpmMat(type=1,young=20e7,poisson=0.3,frictionAngle=radians(0),density=2600,tensileStrength=0,cohesion=0,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=0,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='walls'))
O.materials.append(JCFpmMat(type=1,young=youngcoat,poisson=0.3,frictionAngle=radians(compFricDegree),density=2000,tensileStrength=bondstrcoat,cohesion=bondstrcoat,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=bondstrcoat,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='spherescoat'))

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

## use a SpherePack object to generate a random loose particles packing
sp=pack.SpherePack()
sp1=pack.SpherePack()
#sp.makeCloud(minCorner=mn,maxCorner=mx,psdSizes=[0.0002,0.0012,0.001205], 
psdCumm=[0.4,0.6,1.],num=500,distributeMass=True,seed=1) #"seed" make the 
"random" generation always the same
sp.makeCloud(minCorner=mn,maxCorner=mx,rMean=0.0006,num=num_spheres,seed=1)

O.bodies.append([sphere(center,rad,material='spheres') for center,rad in
sp])



###   DEFINING ENGINES   ###


triax=TriaxialStressController(
maxMultiplier=1.+2e4/young, # spheres growing factor (fast growth)
finalMaxMultiplier=1.+2e3/young, # spheres growing factor (slow growth)
thickness = 0,
stressMask = 0,
internalCompaction=False, # If true the confining pressure is generated by 
growing particles
wall_front_activated=True,
wall_back_activated=True,
wall_top_activated=True,
wall_bottom_activated=True,
wall_left_activated=True,
wall_right_activated=True,
goal1=-20,
goal2=-20,
goal3=-20,
)

newton=NewtonIntegrator(damping=damp)

O.engines=[

ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],

[Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=-1,xSectionWeibullShapeParameter=1.5,
 xSectionWeibullScaleParameter=2,

[Yade-users] [Question #700119]: 2PFV Drainage

2022-01-07 Thread Luis Barbosa
New question #700119 on Yade:
https://answers.launchpad.net/yade/+question/700119

Dear all,

I am performing drainage using TwoPhaseFlowEngine using something like [1].

But the initial saturation is 1. I was checking how to set this initial value.
I am not sure if initialWetting(=true) can help here, or (a practical way) I 
just run the simulation from saturated=1 to saturated=n and restart the W-phase 
pressure.

Any suggestion?

[1] 
https://gitlab.com/yade-dev/trunk/-/blob/master/examples/FluidCouplingPFV/drainage-2PFV-Yuan_and_Chareyre_2017.py

Kind regards,
Luis

-- 
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 #700102]: getSaturation - 2PFV

2022-01-07 Thread Luis Barbosa
Question #700102 on Yade changed:
https://answers.launchpad.net/yade/+question/700102

Luis Barbosa confirmed that the question is solved:
Thanks Bruno Chareyre, 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 #700102]: getSaturation - 2PFV

2022-01-07 Thread Luis Barbosa
Question #700102 on Yade changed:
https://answers.launchpad.net/yade/+question/700102

Status: Answered => Solved

Luis Barbosa confirmed that the question is solved:
Ok, thanks.

I found out. I was using aggregates from dense pack, which created some 
particle overlap.
I created aggregates without particle overlap and now saturation is giving 
coherent values.

Kind regards,
Luis

-- 
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 #700102]: getSaturation - 2PFV

2022-01-06 Thread Luis Barbosa
New question #700102 on Yade:
https://answers.launchpad.net/yade/+question/700102

Hi all,

I am facing some difficulties to solve an issue regarding getSaturation - 2PFV. 
Obtaining negative values.


Where can I find the documentation to understand the calculations of this 
function?


Kind regards,
Luis

-- 
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 #699603]: getSaturation - 2PFV drainage

2021-11-23 Thread Luis Barbosa
New question #699603 on Yade:
https://answers.launchpad.net/yade/+question/699603

Hi all,

I am running this script [1], where I have replaced particles by aggregates.
The issue is that I am getting negative values of saturation (getSaturation) in 
the end of the drainage.

Does this have to do with pack boundaries?

[1]

#!/usr/bin/python
# -*- encoding=utf-8 -*-
#*
#  Copyright (C) 2010 by Bruno Chareyre  *
#  bruno.chareyre_at_grenoble-inp.fr *
#*
#  This program is free software; it is licensed under the terms of the  *
#  GNU General Public License v2 or later. See file LICENSE for details. *
#*/

from yade import pack
from yade import bodiesHandling
from yade import export
from yade import utils
from yade import ymport


###   DEFINING VARIABLES AND MATERIALS   ###


# The following 5 lines will be used later for batch execution
nRead=readParamsFromTable(
num_spheres=3000,# number of spheres
compFricDegree = 1, # contact friction during the confining phase
key='_triax_base_', # put you simulation's name here
unknownOk=True
)
from yade.params import table

num_spheres=table.num_spheres# number of spheres
key=table.key
targetPorosity = 0.37 #the porosity we want for the packing
compFricDegree = table.compFricDegree # initial contact friction during the 
confining phase (will be decreased during the REFD compaction process)
finalFricDegree = 30 # contact friction during the deviatoric loading
rate=0 # loading rate (strain rate)
damp=0.2 # damping coefficient
stabilityThreshold=0.01 # we test unbalancedForce against this value in 
different loops (see below)
young=110e4 # contact stiffness
bondstr=1.5e4
mn,mx=Vector3(0,0,0),Vector3(0.01,0.01,0.01) # corners of the initial packing


## create materials for spheres and plates
O.materials.append(JCFpmMat(type=1,young=young,poisson=0.3,frictionAngle=radians(compFricDegree),density=2000,tensileStrength=bondstr,cohesion=bondstr,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=bondstr,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='spheres'))
O.materials.append(JCFpmMat(type=1,young=young,poisson=0.3,frictionAngle=radians(0),density=2600,tensileStrength=0,cohesion=0,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=0,jointFrictionAngle=radians(0),jointDilationAngle=0.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 random loose particles packing
sp=pack.SpherePack()

sp.makeCloud(minCorner=mn,maxCorner=mx,rMean=0.0006,num=num_spheres,seed=1) 
#"seed" make the "random" generation always the same rRelFuzz=1,num=num_spheres,
#O.bodies.append([sphere(center,rad,material='spheres') for center,rad in sp])

for p in sp:
a=p[0]
#   print (a)
f1=O.bodies.append(ymport.textExt("aggcoating2.txt", format='x_y_z_r', 
shift=a-Vector3(0,0,0.0006), scale=1.0,material='spheres',color=(0,1,1)))


###   DEFINING ENGINES   ###


triax=TriaxialStressController(
## TriaxialStressController will be used to control stress and strain. It 
controls particles size and plates positions.
## this control of boundary conditions was used for instance in 
http://dx.doi.org/10.1016/j.ijengsci.2008.07.002
maxMultiplier=1.+2e4/young, # spheres growing factor (fast growth)
finalMaxMultiplier=1.+2e3/young, # spheres growing factor (slow growth)
thickness = 0,
## switch stress/strain control using a bitmask. What is a bitmask, huh?!
## Say x=1 if stess is controlled on x, else x=0. Same for for y and z, 
which are 1 or 0.
## Then an integer uniquely defining the combination of all these tests is: 
mask = x*1 + y*2 + z*4
## to put it differently, the mask is the integer whose binary 
representation is xyz, i.e.
## "100" (1) means "x", "110" (3) means "x and y", "111" (7) means "x and y 
and z", etc.
stressMask = 0,
internalCompaction=False, # If true the confining pressure is generated by 
growing particles
wall_front_activated=True,
wall_back_activated=True,
wall_top_activated=True,
wall_bottom_activated=True,
wall_left_activated=True,
wall_right_activated=True,
goal1=-20,
goal2=-20,
goal3=-20,
)

newton=NewtonIntegrator(damping=damp)

O.engines=[

ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],

[Yade-users] [Question #699276]: 2PFV Tessalation - CGAL

2021-10-29 Thread Luis Barbosa
New question #699276 on Yade:
https://answers.launchpad.net/yade/+question/699276

Hi all,

I was using this script for some tests and was everything working fine.

After actualization it started to appear this (the code seems to work though):

 :750 void 
yade::CGT::Network::lineSolidPore(yade::CGT::Network::CellHandle,
 int) [with Tesselation = 
yade::CGT::_Tesselation >; yade::CGT::Network::CellHandle = 
CGAL::internal::CC_iterator,
 CGAL::Triangulation_cell_base_with_info_3, CGAL::Regular_triangulation_cell_base_3, 
CGAL::Triangulation_cell_base_3, 
CGAL::Triangulation_ds_cell_base_3,
 CGAL::Triangulation_vertex_base_with_info_3, CGAL::Regular_triangulation_vertex_base_3 > 
>, CGAL::Boolean_tag, CGAL::Boolean_tag >, 
CGAL::Alpha_shape_cell_base_3, 
CGAL::Triangulation_cell_base_with_info_3, CGAL::Regular_triangulation_cell_base_3 > >, 
CGAL::Boolean_tag, CGAL::Boolean_tag >, CGAL::Sequential_tag> > 
>, CGAL::Hidden_points_memory_policy >, 
std::__cxx11::list >, 
std::allocator > > > > >, 
CGAL::Boolean_tag, CGAL::Boolean_tag >, CGAL::Default, 
CGAL::Default, CGAL::Default>, false>]: Unhandled switch case:3

did someone experience this know how to solve

Kind regards,
Luis

-- 
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 #699235]: Settings HPC Slurm

2021-10-27 Thread Luis Barbosa
Question #699235 on Yade changed:
https://answers.launchpad.net/yade/+question/699235

Status: Needs information => Open

Luis Barbosa gave more information on the question:
Thanks Robert,

Yes, I confirm that each node in my cluster has 80 cores.

I wonder if I should change something in the script to run MPI (like 1)
(1)https://gitlab.com/yade-dev/trunk/blob/master/examples/mpi/testMPI_2D.py

But still, keeping it simple, using one node with higher number of cores
(>7) would be good for this start.

My object of study is substitute each particle by an aggregate of particles in 
the 2PFV example.
This is running fine on my desktop I7 - 8 threads, but I want to increase the 
domain size, thus I am switching to the cluster.

Kind regards,
Luis

-- 
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 #699235]: Settings HPC Slurm

2021-10-26 Thread Luis Barbosa
New question #699235 on Yade:
https://answers.launchpad.net/yade/+question/699235

Dear all,

I am using Slurm to run Yade in a cluster. From this scrip (below) no more than 
7 cores are used in parallel:
#!/bin/bash -x
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=80
#SBATCH --partition=compute
#SBATCH --job-name=DEM_PFV
#SBATCH --time=10:00:00

singularity run /beegfs/common/singularity/yade/yade_debian_bookwarm_1.0.sif 
yade -j70 jobname.py


I am searching for instructions to see if I can change -nodes>1 or anything 
else to increase the number of parallel cores during simulation.


The simulation I am running is this example [1] but with a bigger domain.
[1] 
https://gitlab.com/yade-dev/trunk/-/blob/master/examples/FluidCouplingPFV/drainage-2PFV-Yuan_and_Chareyre_2017.py


I am completely new in this matter so any info would be helpful.
Kind regards,
Luis

-- 
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 #698313]: Segmentation Fault - PFV2

2021-08-10 Thread Luis Barbosa
New question #698313 on Yade:
https://answers.launchpad.net/yade/+question/698313

Dear all,

I am facing an error of segmentation fault with this script.
Not sure if it is hardware limitation or if it is related to tessellation 
issue, since this packing is very peculiar.

I have checked similar questions but couldn't find a way out.

Do you have an idea of size ration between particle diameter and aggregate 
diameter.

Cheers,


# encoding: utf-8
# This script demonstrates a simple case of drainage simulation using the 
"2PFV" two-phase model implemented in UnsaturatedEngine.
# The script was used to generate the result and supplementary material (video) 
of [1]. The only difference is the problem size (40k particles in the paper vs. 
1k (default) in this version)
# [1] Yuan, C., & Chareyre, B. (2017). A pore-scale method for hydromechanical 
coupling in deformable granular media. Computer Methods in Applied Mechanics 
and Engineering, 318, 1066-1079. 
(http://www.sciencedirect.com/science/article/pii/S0045782516307216)
from yade import plot
from yade import ymport
from yade import bodiesHandling
from yade import export
from yade import utils

import matplotlib; matplotlib.rc('axes',grid=True)
from yade import pack
import pylab
from numpy import *

utils.readParamsFromTable(seed=1,compFricDegree = 10.0)
from yade.params import table

seed=table.seed
#num_spheres=table.num_spheres# number of spheres
compFricDegree = table.compFricDegree # initial contact friction during the 
confining phase (will be decreased during the REFD compaction 
process),num_spheres=1000
confiningS=-1e6

## creat a packing with a specific particle side distribution (PSD)
#psdSizes,psdCumm=[.599,0.6,0.849,0.85,1.0,1.40],[0.,0.35,0.35,0.70,.70,1.] 
psdSizes=psdSizes,psdCumm=psdCumm,distributeMass=True,
sp=pack.SpherePack()
sp1=pack.SpherePack()
mn,mx=Vector3(0,0,0),Vector3(0.004,0.0005,0.004)
mnn,mxx=Vector3(0,0,0),Vector3(0.006,0.006,0.006)
mnc,mxc=Vector3(0,0,0),Vector3(0.006,0.006,0.006)
#Coating
sp.makeCloud(minCorner=mn,maxCorner=mx,rMean=0.5,seed=seed)
#Matrix
sp1.makeCloud(minCorner=mnn,maxCorner=mxx,rMean=0.0004,seed=seed)

O.materials.append(JCFpmMat(type=1,young=70e6,poisson=0.3,frictionAngle=radians(compFricDegree),density=2600,tensileStrength=100e6,cohesion=100e6,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=100e6,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='coating'))
O.materials.append(JCFpmMat(type=1,young=50e5,poisson=0.3,frictionAngle=radians(compFricDegree),density=2600,tensileStrength=100e5,cohesion=100e5,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=100e5,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='matrix'))
O.materials.append(JCFpmMat(type=1,young=50e5,poisson=0.3,frictionAngle=radians(0),density=2600,tensileStrength=0,cohesion=0,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=0,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='frictionless'))

## create walls around the packing
walls=aabbWalls((mnc,mxc),thickness=0,material='frictionless')
wallIds=O.bodies.append(walls)

#O.bodies.append([utils.sphere(center,rad,material='coating') for center,rad in 
sp])
#for center,rad in sp:
#   print (center,rad)
#O.bodies.append([utils.sphere(center,rad,material='matrix') for center,rad in 
sp1])
#O.bodies.append([utils.sphere(center,rad,material='spheres') for center,rad in 
sp2])

for p in sp1:
a=p[0]
#   print (a)
f1=O.bodies.append(ymport.textExt("aggcoating.txt", format='x_y_z_r', 
shift=a-Vector3(0,0,0.0004), scale=1.0,material='matrix',color=(0,1,1)))

triax=TriaxialStressController(
#   wall_back_activated=True,
#   wall_bottom_activated=True,
#   wall_front_activated=True,
#   wall_left_activated=True,
#   wall_right_activated=True,
#   wall_top_activated=True,
internalCompaction=True,
goal1=confiningS,
goal2=confiningS,
goal3=confiningS,
max_vel=5,
label="triax"
)

newton=NewtonIntegrator(damping=0.4)

O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
[Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=-1)],

[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=False)]
#   [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,
#   
VTKRecorder(iterPeriod=2000,recorders=['all','cracks'],fileName="/home/user/Área
 de Trabalho/Paper_Biopore/SandBox_Laser/Video/Videotest"),
newton
]

O.dt=0.08*PWaveTimeStep()
O.dynDt=False

while 1:
  O.run(1000,True)
  unb=unbalancedForce()
#  

Re: [Yade-users] [Question #698313]: Segmentation Fault - PFV2

2021-08-10 Thread Luis Barbosa
Question #698313 on Yade changed:
https://answers.launchpad.net/yade/+question/698313

Luis Barbosa gave more information on the question:
Here is the aggregate:

#!/usr/bin/python
# -*- coding: utf-8 -*-

#Forca normal lei de contato coesao e atrito
from yade import plot
from yade import pack
from yade import utils
from yade import bodiesHandling
from yade import export
#from add import addBodyToAggreg
import math
import random
# Spheres

#O.materials.append(JCFpmMat(type=1,young=20e7,poisson=0.3,frictionAngle=radians(30),density=1600,tensileStrength=100e7,cohesion=100e7,jointNormalStiffness=1e5,jointShearStiffness=1e5,jointCohesion=100e7,jointFrictionAngle=radians(30),jointDilationAngle=0.0,label='spheres'))
O.materials.append(JCFpmMat(type=1,young=70e6,poisson=0.3,frictionAngle=radians(30),density=2000,tensileStrength=100e6,cohesion=100e6,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=100e6,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='spheres'))

#particledensity=1600

O.materials.append(JCFpmMat(type=1,young=20e7,poisson=0.3,frictionAngle=radians(10),density=1000,tensileStrength=0,cohesion=0,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=0,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='plates'))
#O.materials.append(CohFrictMat(young=200e9,poisson=0.3,density=900,frictionAngle=radians(80),isCohesive=True,normalCohesion=1e30,shearCohesion=1e30,momentRotationLaw=True,etaRoll=0.1,label='spheres'))
##Radius by 
Class##
size=3
if size==1:
rag=0.05 #aumento de 12.61 x 0.00238


if size==2:
rag=0.075


if size==3:
rag=0.0004


#
rad,gap= 0.65,0#0.003783,0
r=rag
print ("diametro agregado", rag*2)
# Spheres
ag=O.bodies.append(
#   pack.regularHexa(
pack.randomDensePack(

(pack.inSphere((0,0,r),r)),radius=rad,color=(0,1,0),rRelFuzz=0,material='spheres')
 # head

#   pred1=pack.inAlignedBox((0,0,0),(0.010,0.010,0.010))
#   
pack.randomDensePack((pack.inAlignedBox((0,0,0),(0.010,0.010,0.010))),radius=0.0009,material='spheres')

)

alfa = random.uniform(0,pi/2)
x = random.randint(0,1)
y = random.randint(0,1)
z = random.randint(0,1)
#print x,y,z
ori = Quaternion(Vector3(x,y,z),(alfa))
#AGREGADO 
MANIPULADO++
agr=O.bodies.append(bodiesHandling.spheresModify(ag,mask=-1,shift=(0.0,0.0,0.0),scale=1.0,orientation=ori,copy=True))
a = len(agr)
print ("numero de particulas", a)

##Planes#
#p1=O.bodies.append(utils.geom.facetBox((0,0,0),(0.07,-0.07,0),wallMask=1,material='plates'))
#p2=O.bodies.append(utils.geom.facetBox((0,0,r),(0.07,-0.07,r),wallMask=32,material='plates'))#
 os r's se somam
Interactions#
#SIMULACAO 1

if size==1:
n = 0#60 #number of spheres to exclude randomically
if size==2:
n = 0 #number of spheres to exclude randomically
if size==3:
n = 0 #number of spheres to exclude randomically

#SELECIONA 
PARTICULAS++
rem=random.sample(agr,n)
#print rem
#REMOVE PARTICULAS 
SELECIONADAS
for i in rem:
O.bodies.erase(i)
#REMOVE AGREGADO 
BASE+
for b in ag:
O.bodies.erase(b)
#STATUS DO 
AGREGADO
nrp=a-n
#print "total de particulas", a
#print "numero de esferas removidas", n
#print "raio do agregado em m", r
##Planes#
O.engines=[
  ForceResetter(),

InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
[Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],

[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=False, 
Key="Wei", recordCracks=True)]
),

#  TranslationEngine(ids=p2,translationAxis=[0,0,-1],velocity=0.01),
  
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=500,timestepSafetyCoefficient=0.5),
  NewtonIntegrator(damping=0.1,gravity=[0,0,-9.81]),
#  VTKRecorder(iterPeriod=100,recorders=['all'],fileName='/tmp/weibull')
#  ForceRecorder(ids=p2,file='forca.txt',iterPeriod=500),
#  PyRunner(command='AutoData()',iterPeriod=100,initRun=True),
#  PyRunner(command='Data()',iterPeriod=100,initRun=True),
#   PyRunner(command='addBodyToAggreg()',iterPeriod=100,initRun=True),

[Yade-users] [Question #698233]: 2PFV - Surface area of solids

2021-08-04 Thread Luis Barbosa
New question #698233 on Yade:
https://answers.launchpad.net/yade/+question/698233

Dear all,

I am coupling YADE-2PFV to a continuum hydrological model.

As an input for the continuum model it requires the total surface area of 
solids.
So far, I am exporting the solid mesh from YADE using Paraview and getting the 
surface area from a CAD software.

But I wounder if there is some feature in YADE to get this number directly.

Important to say that I am working with a random dense pack. So, the surface 
area is not just the surface area of particles, since there is also some 
overlapping among them.

Cheers,
Luis

-- 
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 #697104]: Contact angle FlowEngine

2021-05-18 Thread Luis Barbosa
Question #697104 on Yade changed:
https://answers.launchpad.net/yade/+question/697104

Luis Barbosa posted a new comment:
Thanks Bruno,

I would like to implement it.
In my project I am using PFV2 to simulate water+air flow in earthworm burrows, 
which are coated with hydrophobic material.

Luis

-- 
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 #697104]: Contact angle FlowEngine

2021-05-18 Thread Luis Barbosa
Question #697104 on Yade changed:
https://answers.launchpad.net/yade/+question/697104

Status: Answered => Solved

Luis Barbosa confirmed that the question is solved:
Thanks Bruno Chareyre, 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 #697104]: Contact angle FlowEngine

2021-05-18 Thread Luis Barbosa
Question #697104 on Yade changed:
https://answers.launchpad.net/yade/+question/697104

Status: Answered => Open

Luis Barbosa is still having a problem:
Thanks Jerome,

it clarifies the contact angle input for
Law2_ScGeom_CapillaryPhys_Capillarity.

So, if I understood correctly, there is not such feature (or similar) 
implemented for TwoPhaseFlowEngine.
Is that correct?

Cheers,
Luis

-- 
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 #697104]: Contact angle FlowEngine

2021-05-17 Thread Luis Barbosa
New question #697104 on Yade:
https://answers.launchpad.net/yade/+question/697104

Dear all,

Water contact angle with particles can be defined artificially [1]. Is it 
alread implemented on FlowEngine or TwoPhaseFlowEngine?

Any example on [1]?

Cheers,
Luis


[1] J. Duriez, R. Wan (2017), Contact angle mechanical influence for wet 
granular soils. Acta Geotechnica. DOI 10.1007/s11440-016-0500-6 

-- 
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 #695911]: 2PFV - Hollow cylinder

2021-03-23 Thread Luis Barbosa
Question #695911 on Yade changed:
https://answers.launchpad.net/yade/+question/695911

Status: Answered => Open

Luis Barbosa is still having a problem:
Hi Robert,

Thansk for your reply.

What do you mean by "extend the alpha boundary condition to
TwoPhaseFlow?

>From documentation I only see this [1] not sure how to use tough.

[1]
alphaBound(=-1)

if 0, use an alphaBoundary condition where CGAL finds minimum alpha
necessary for a single solid object. Any positive value will be used for
the alpha. All negative values deactivate the functionality.

alphaBoundValue(=0)

value of alpha constant pressure condition

-- 
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 #659213]: Criterias for RandonDensePack

2021-03-16 Thread Luis Barbosa
Question #659213 on Yade changed:
https://answers.launchpad.net/yade/+question/659213

Status: Answered => Solved

Luis Barbosa 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 #670954]: GPU YADE

2021-03-16 Thread Luis Barbosa
Question #670954 on Yade changed:
https://answers.launchpad.net/yade/+question/670954

Status: Answered => Solved

Luis Barbosa confirmed that the question is solved:
Thanks Jérôme Duriez, 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 #694056]: Polar Histogram JCF Cracks

2021-03-16 Thread Luis Barbosa
Question #694056 on Yade changed:
https://answers.launchpad.net/yade/+question/694056

Status: Answered => Solved

Luis Barbosa confirmed that the question is solved:
Thanks Jérôme Duriez, 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 #695873]: wet phase distribution

2021-03-16 Thread Luis Barbosa
Question #695873 on Yade changed:
https://answers.launchpad.net/yade/+question/695873

Luis Barbosa 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 #695873]: wet phase distribution

2021-03-16 Thread Luis Barbosa
Question #695873 on Yade changed:
https://answers.launchpad.net/yade/+question/695873

Status: Answered => Solved

Luis Barbosa confirmed that the question is solved:
Thank!

-- 
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 #695911]: 2PFV - Hollow cylinder

2021-03-08 Thread Luis Barbosa
New question #695911 on Yade:
https://answers.launchpad.net/yade/+question/695911

Hi guys,

I came across a practical use of 2PFV, but not sure if it is implemented.

Instead of using a flat surface in the contour (were the pressures are applied) 
would it be possible to apply pressure radially (i.e. in the internal wall of a 
hollow cylindrical sample?)

-- 
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 #695873]: wet phase distribution

2021-03-08 Thread Luis Barbosa
Question #695873 on Yade changed:
https://answers.launchpad.net/yade/+question/695873

Status: Answered => Open

Luis Barbosa is still having a problem:
Thank you all.
When I run the code [1], getCellBarycenter giving some strange values 
(coordinates totally outside my sample):

For instance, these values 125107.48 or -125097.48:
True 0.01797170859509369 
Vector3(125107.4828372159245,1.62543863864436311,3.652322448466255977)
True 0.011656083836606964 
Vector3(9.624066355278376506,1.530915196593882976,4.766563274628489388)
True 0.020528870575860336 
Vector3(7.413446355544288657,-125097.4827497912484,7.885475000566313675)
True 0.01815466910920833 
Vector3(125106.2605586981226,-125096.2810642897675,6.157849618659231083)

is it some mistake in the usage?

[1]
import matplotlib; matplotlib.rc('axes',grid=True)
from yade import pack
import pylab
from numpy import *

utils.readParamsFromTable(seed=1,compFricDegree = 15.0)
from yade.params import table

seed=table.seed
#num_spheres=table.num_spheres# number of spheres
compFricDegree = table.compFricDegree # initial contact friction during the 
confining phase (will be decreased during the REFD compaction 
process),num_spheres=1000
confiningS=-1e5

## creat a packing with a specific particle side distribution (PSD)
#psdSizes,psdCumm=[.599,0.6,0.849,0.85,1.0,1.40],[0.,0.35,0.35,0.70,.70,1.] 
psdSizes=psdSizes,psdCumm=psdCumm,distributeMass=True,
sp=pack.SpherePack()
sp1=pack.SpherePack()
mn,mx=Vector3(0,0,0),Vector3(10,2,10)
mnn,mxx=Vector3(0,2,0),Vector3(10,10,10)
mnc,mxc=Vector3(0,0,0),Vector3(10,10,10)
sp.makeCloud(minCorner=mn,maxCorner=mx,rMean=0.15,seed=seed)
sp1.makeCloud(minCorner=mnn,maxCorner=mxx,rMean=0.4,seed=seed)

## create material #0, which will be used as default
O.materials.append(FrictMat(young=15e7,poisson=.4,frictionAngle=radians(compFricDegree),density=2600,label='spheres'))
O.materials.append(FrictMat(young=15e7,poisson=.4,frictionAngle=radians(compFricDegree),density=2600,label='spheres1'))
O.materials.append(FrictMat(young=15e7,poisson=.4,frictionAngle=0,density=0,label='frictionless'))

## create walls around the packing
walls=aabbWalls((mnc,mxc),thickness=0,material='frictionless')
wallIds=O.bodies.append(walls)

O.bodies.append([utils.sphere(center,rad,material='spheres') for center,rad in 
sp])
O.bodies.append([utils.sphere(center,rad,material='spheres1') for center,rad in 
sp1])

triax=TriaxialStressController(
internalCompaction=True,
goal1=confiningS,
goal2=confiningS,
goal3=confiningS,
max_vel=10,
label="triax"
)

newton=NewtonIntegrator(damping=0.4)

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,
#   VTKRecorder(iterPeriod=100,recorders=['all'],fileName="/home/user/Área 
de Trabalho/PVF/vtk/Spheres"),
newton
]

while 1:
  O.run(1000,True)
  unb=unbalancedForce()
  if unb<0.01 and abs(triax.goal1-triax.meanStress)/abs(triax.goal1)<0.001:
break

#
##   REACH NEW EQU. STATE ###
#
finalFricDegree = 30 # contact friction during the deviatoric loading

#We move to deviatoric loading, let us turn internal compaction off to keep 
particles sizes constant
triax.internalCompaction=False
# Change contact friction (remember that decreasing it would generate 
instantaneous instabilities)
setContactFriction(radians(finalFricDegree))

while 1:
  O.run(1000,True)
  unb=unbalancedForce()
  if unb<0.001 and abs(triax.goal1-triax.meanStress)/abs(triax.goal1)<0.001:
break  

triax.depth0=triax.depth
triax.height0=triax.height
triax.width0=triax.width
O.save('1kPacking.yade') #save the packing, which can be reloaded later.

O.run(1000,True)
ei0=-triax.strain[0];ei1=-triax.strain[1];ei2=-triax.strain[2]
si0=-triax.stress(0)[0];si1=-triax.stress(2)[1];si2=-triax.stress(4)[2]

from yade import plot
O.engines=O.engines+[PyRunner(iterPeriod=20,command='history()',dead=1,label='recorder')]

def history():
plot.addData(e11=-triax.strain[0]-ei0, e22=-triax.strain[1]-ei1, 
e33=-triax.strain[2]-ei2,
s11=-triax.stress(0)[0]-si0,
s22=-triax.stress(2)[1]-si1,
s33=-triax.stress(4)[2]-si2,
pc=-unsat.bndCondValue[2],
sw=unsat.getSaturation(False),
i=O.iter
)

plot.plots={'pc':('sw',None,'e22')}
plot.plot()

###
## Drainage Test under oedometer conditions ###
###
##oedometer conditions
triax.str

Re: [Yade-users] [Question #695873]: wet phase distribution

2021-03-05 Thread Luis Barbosa
Question #695873 on Yade changed:
https://answers.launchpad.net/yade/+question/695873

Status: Answered => Open

Luis Barbosa is still having a problem:
Thanks Robert.

I have just two more questions:

1. getCellIsWRes is giving if there is wet phase or not. Wehrever if it
is trapped or not. Is that right?

2. I want to spatially locate the wet cells, so what is the difference
between getCellCenter and getCell?

Kind regards,
Luis

-- 
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 #695873]: wet phase distribution

2021-03-05 Thread Luis Barbosa
New question #695873 on Yade:
https://answers.launchpad.net/yade/+question/695873

Hi all,

When using yade.wrapper.TwoPhaseFlowEngine is it possible to quantify the 
volume distribution of wet phase (not only the total volume) over the sample?

Cheers,
Luis

-- 
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 #695673]: Contact angle solid liquid phases - 2PFV

2021-02-21 Thread Luis Barbosa
New question #695673 on Yade:
https://answers.launchpad.net/yade/+question/695673

Dear all,

I couldn't find in the documentation of TwoPhaseFlowEngine (or in earlier works 
using such engine) if it is possible to set different properties to the solid 
partices in order to obtain heterogeneity of liquid - solid contact angle.

My point is to create certain heterogeneity of wetting properties (e.g. contact 
angle) of the solid phase in order to obtain preferential paths during drying 
or wetting processes using  2PFV (TwoPhaseFlowEngine).

In fact, I believe (but not sure) that the angles formed in the liquid bridges 
between solid particles are dependent on particle diameter only (Delaunay 
triangulation to weighted points). Not sure how to insert such wetting 
properties in this method though.

Does it make sense to you, or is it already being contemplated by the 2PFV 
engine?

Cheers,
Luis



-- 
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 #695592]: Issue gts randon dense paking

2021-02-17 Thread Luis Barbosa
Question #695592 on Yade changed:
https://answers.launchpad.net/yade/+question/695592

Status: Open => Solved

Luis Barbosa confirmed that the question is solved:
Hi guys,

Sorry, I discovery the issue. So silly.

When using the command stl2gts to convert an STL file to GTS format, I was 
activating "revert face normals".
So, when implementing the pack it considered the pred to be a void.
Maybe a useful approach for some cases.

Cheers,
Luis

-- 
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 #695592]: Issue gts randon dense paking

2021-02-17 Thread Luis Barbosa
New question #695592 on Yade:
https://answers.launchpad.net/yade/+question/695592

Hi all,

I am used to create pakings from gts surfaces. However, I am having problem 
with this right now.
I am trying to create a dense pack in gts predicates, but it seems it is 
operating in an inverse way. Instead of the pack be presented inside the 
predicate, it appears outside. The predicate is the void region inside the 
pack. It seems a boolean operation, but has nothing to do with my code. I 
already tried creating gts binary or ascii, or even changing the language ( -*- 
coding: utf-8 -*-).

Here is the script I am using

#!/usr/bin/python
# -*- coding: utf-8 -*-
# F.T. Silva grupodemfea...@gmail.com

from yade.pack import *
from yade import pack,export,qt
from math import *
from yade import plot
from yade import ymport
import gts

##Material#
O.materials.append(JCFpmMat(type=1,young=70e5,poisson=0.3,frictionAngle=radians(30),density=0.0025,tensileStrength=194,cohesion=194,jointNormalStiffness=10,jointShearStiffness=10,jointCohesion=194,jointFrictionAngle=radians(30),jointDilationAngle=0.0,label='spheres'))
##Selector
sel=22
##Surface#
surf=gts.read(open('agg'+str(sel)+'.gts'))

if surf.is_closed():
pred=pack.inGtsSurface(surf)
radius=0.03 #(cm)
O.bodies.append(pack.randomDensePack(pred,radius=radius))

O.bodies.append(pack.gtsSurface2Facets(surf,wire=True))


##Engine#
O.engines=[
  ForceResetter(),

InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
[Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],

[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=False, 
Key="Wei", recordCracks=True)]
),

  
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=500,timestepSafetyCoefficient=0.5),
  NewtonIntegrator(damping=0.1,gravity=[0,0,-981]),#cm/s2

]

from yade import qt
qt.View()
qt.Controller()



-- 
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 #695374]: 2 PFV Drainage with Cracking

2021-02-04 Thread Luis Barbosa
New question #695374 on Yade:
https://answers.launchpad.net/yade/+question/695374

Dear all,

I am working with Yade for a while, but I am starting a new topic: Coupling DEM 
+ Flow in unsaturated media.

>From my overview it seems that PFV may do the work. But just before I start 
>doing stuffs by my self, I wounder if someone have already worked with a 
>similar problem and could indicate some material:

I want to simulate wetting and drying processes. The drying process is very 
similar to (1).

i. For the wetting, would be possible to use the same idea, but 
set the pressure head for the wetting phase?
   ii. For drainage, as the non-wetting phase moves around the 
packing, would be possible to change particle size, cohesive strength, etc, in 
order to simulate shrinkage?

Cheers,
Luis

(1) 
https://gitlab.com/yade-dev/trunk/-/blob/master/examples/FluidCouplingPFV/drainage-2PFV-Yuan_and_Chareyre_2017.py

-- 
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 #694056]: Polar Histogram JCF Cracks

2020-11-17 Thread Luis Barbosa
New question #694056 on Yade:
https://answers.launchpad.net/yade/+question/694056

Dear all,

I am plotting the polar histogram of cracks obtained using JCF in an dense 
aggregate.

However the polar histogram I am obtaining is not distributed over 360º, but 
only from 90 to 270º.

Here is the MWS:

import pylab # the matlab-like interface of matplotlib
pylab.ioff()
import numpy
import os.path
with open("cracks_shp.txt") as f:
   lines = f.readlines()
lines = [l.split()[7:10] for l in lines]
lines = [[float(v) for v in l] for l in lines]

angles = []
for a in lines:
norm1=a[0]
norm2=a[1]
norm3=a[2]
angles.append(atan(a[1]/a[0]))

pylab.hist(angles,bins=20)
# polar histogram
pylab.figure()
## prepare data
values,bins=numpy.histogram(angles,bins=20)
## prepare polar plot
pylab.subplot(111,polar=True);
## plot bar chart, with the histogram data
### bins has one edge extra, remove it: [:-1]
pylab.bar(left=bins[:-1],height=values,width=.7*pi/20);

pylab.show()


-- 
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 #693834]: Dense pack Irregular Shape

2020-11-10 Thread Luis Barbosa
Question #693834 on Yade changed:
https://answers.launchpad.net/yade/+question/693834

Luis Barbosa gave more information on the question:
Hi guys,

Just by curiosity I uninstalled yade daily and instaled yade 2018.02b.
And now the compaction promoted by the Aperiodic RandonDensePack is evidente.

There is something wrong or in Yadedaily 20201104-4350 5ef06bf or Yade
version (2018.02b) when using this function.

Cheers,
Luis

-- 
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 #693834]: Dense pack Irregular Shape

2020-11-05 Thread Luis Barbosa
Question #693834 on Yade changed:
https://answers.launchpad.net/yade/+question/693834

Status: Needs information => Open

Luis Barbosa gave more information on the question:
- python 2 -> 3 of your scripts?
I did not change my script. It seems to work fine in python2 and 3.

- python 2 -> 3 Yade compilation?
Yes. After atualization of Yade compilation.

- same or different Yade versions?
Before I was using Yade version (2018.02b).
Then I actualized to Yadedaily 20201104-4350 5ef06bf

-- 
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 #693834]: Dense pack Irregular Shape

2020-11-05 Thread Luis Barbosa
Question #693834 on Yade changed:
https://answers.launchpad.net/yade/+question/693834

Status: Answered => Open

Luis Barbosa is still having a problem:
Thank you Jan,

I was able to create the pack using:

sp = pack.randomDensePack(, returnSpherePack=True)
sp.toSimulation()

However, the particles inside the pack are not even touching each other.

Before an actualiyzation of YADE (Change from Python2 to 3), I was using
the same script to creat dense pack with overlaping particles. Much
different from what I am getting now using the same parameters though.


Here E you have the link to the GTS surface:
https://drive.google.com/file/d/1w_r_q438jZAqzgL5DaQEprZr9Mroazq6/view?usp=sharing


Here you have the MWE:

from yade import plot
import gts,yade.pack
##Material#
O.materials.append(JCFpmMat(type=1,young=70e4,poisson=0.3,frictionAngle=radians(30),density=0.0025,tensileStrength=194,cohesion=194,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=194,jointFrictionAngle=radians(30),jointDilationAngle=0.0,label='spheres'))
##Selector#

surf=gts.read(open('agg18.gts'))
pred=pack.inGtsSurface(surf)
sp=pack.randomDensePack(pred,radius=0.025,returnSpherePack=True)#memoizeDb='/tmp/gts-triax-packings.sqlite'spheresInCell=200,
#O.bodies.append(sp)
sp.toSimulation()

O.bodies.append(pack.gtsSurface2Facets(surf,wire=True))

##Engine#
O.engines=[
  ForceResetter(),

InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
[Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],

[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=False, 
Key="Wei", recordCracks=True)]
),

#  TranslationEngine(ids=p2,translationAxis=[0,0,-1],velocity=0.03),
  
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=500,timestepSafetyCoefficient=0.5),
  NewtonIntegrator(damping=0.1,gravity=[0,0,-981]),#cm/s2
]

##Exporting#

from yade import qt
qt.View()
qt.Controller()
#export.text("agg18.txt")

#exit()

-- 
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 #693834]: Dense pack Irregular Shape

2020-11-05 Thread Luis Barbosa
Question #693834 on Yade changed:
https://answers.launchpad.net/yade/+question/693834

Luis Barbosa gave more information on the question:
Just more information:

when using the code:

ag=O.bodies.append(pack.randomDensePack(pred, radius=0.003,
returnSpherePack=True))

I got the message:

no registered converter was able to produce a c++ rvalue of type
boost::shared_ptrfrom this Python object of type tuple

It seems a boost problem, despite creating a pack, RandomDensePack does
not apply the triax compression. (I guess).

Versions I am running:
Yadedaily 20201104-4350 bionic1
Python 3.6.9

-- 
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 #693834]: Dense pack Irregular Shape

2020-11-05 Thread Luis Barbosa
New question #693834 on Yade:
https://answers.launchpad.net/yade/+question/693834

Hi all,

I am creating real soil aggregate shapes filled with spherical particles and 
using a cohesive law to form this aggregate.

For this I am using:

import gts
from yade import pack
surf=gts.read(open('agg.gts'))
pred=pack.inGtsSurface(surf)
spheres=pack.randomDensePack(pred,radius=0.003)
O.bodies.append(spheres)

The point is: in order to get a random particle orientation and a dense pack 
(with particles overlaping) I am using RandomDensePack.
However, the aggregate I get as a result has no overlatping particles at all.

Do you know what could be the problem?

Kind regards,
Luis

-- 
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 #688867]: Applying force on Stl imported file

2020-11-02 Thread Luis Barbosa
Question #688867 on Yade changed:
https://answers.launchpad.net/yade/+question/688867

Status: Answered => Solved

Luis Barbosa 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 #693474]: JCFpm Weibull heterogeneity

2020-10-21 Thread Luis Barbosa
Question #693474 on Yade changed:
https://answers.launchpad.net/yade/+question/693474

Status: Answered => Solved

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


[Yade-users] [Question #693567]: Randam Dense Pack

2020-10-21 Thread Luis Barbosa
New question #693567 on Yade:
https://answers.launchpad.net/yade/+question/693567

Hi all,

For some reason I could not identify yet, my random Dense Pack, is not being 
compacted by TriaxialTest (aperiodic).
I got only a cloud of spheres.

surf=gts.read(open('sphere.gts'))
if surf.is_closed():
 pred=pack.inGtsSurface(surf)
 sp=pack.randomDensePack(pred,radius=0.025,returnSpherePack=True)
 sp.tosimulation()

Similar problem was observed when using:
ag=O.bodies.append(
 pack.randomDensePack(
  
(pack.inSphere((0,0,r),r)),radius=rad,color=(0,1,0),rRelFuzz=0,material='spheres')
)

As reported here (1)
(1)https://answers.launchpad.net/yade/+question/693459

My guess is that something has changed in the last update.

Kind regards,
Luis

-- 
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 #693474]: JCFpm Weibull heterogeneity

2020-10-15 Thread Luis Barbosa
New question #693474 on Yade:
https://answers.launchpad.net/yade/+question/693474

Dear all,

I am using the function:

Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(
xSectionWeibullScaleParameter=xSectionScale,
xSectionWeibullShapeParameter=xSectionShape,

To insert a certain Fn,max heterogeneity in my aggregate pack. However, when I 
check the Fn,max distribution (pos pack creation) with the imputed values of 
Weibull shape and scale, it does not match.

For instance, using xSectionScale of 1 and shape of 5 as imput, I obtained a 
Fn,max distribution with a shape factor of 2,46 and a scale factor of 1,82.

For this I have used the linear distribution of Weibull and regression to 
calculate the parameters.

Does it make sense to you or it is not the expected result?


Thanks
Luis

-- 
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 #693459]: Python 3 - randomDensePack

2020-10-14 Thread Luis Barbosa
New question #693459 on Yade:
https://answers.launchpad.net/yade/+question/693459

Hi all,

This is a really silly question but I am banging my head in the wall :(

After an update in Yade, I am now migrating my codes to Python 3. So far so 
good.

When I use the function randomDensePack with pack.gtsSurface, it works fine. It 
is possible to see that the pack is dense due to Triaxial test.

However, when I use randomDensePack with pack.inSphere the pack I get is not 
dense

It seems to be a simple solution, perhaps due to changes in Python 3 (my guess).

=

#Forca normal lei de contato coesao e atrito
from yade import plot
from yade import pack
from yade import utils
from yade import bodiesHandling
import math
import random


O.materials.append(JCFpmMat(type=1,young=70e9,poisson=0.3,frictionAngle=radians(30),density=2500,tensileStrength=10.7e5,cohesion=10.7e5,jointNormalStiffness=1e5,jointShearStiffness=1e5,jointCohesion=10.7e5,jointFrictionAngle=radians(30),jointDilationAngle=0.0,label='spheres'))

O.materials.append(JCFpmMat(type=1,young=70e8,poisson=0.3,frictionAngle=radians(10),density=2000,tensileStrength=0,cohesion=0,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=0,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='plates'))

##Radius by 
Class##
size=1
if size==1:
rag=0.00238
#
rad=0.0003
r=rag
# Spheres
ag=O.bodies.append(
pack.randomDensePack(

(pack.inSphere((0,0,r),r)),radius=rad,color=(0,1,0),rRelFuzz=0,material='spheres')
)

if size==1:
n = 0 #number of spheres to exclude randomically
if size==2:
n = 96 #number of spheres to exclude randomically
if size==3:
n = 620 #number of spheres to exclude randomically
if size==4:
n = 1905 #number of spheres to exclude randomically
##Planes#
O.engines=[
  ForceResetter(),

InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],

[Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],#xSectionWeibullShapeParameter=4

[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=False, 
Key="Wei", recordCracks=True)]
),

  
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=500,timestepSafetyCoefficient=0.5),
  NewtonIntegrator(damping=0.1,gravity=[0,0,-9.81]),

]

from yade import qt
qt.View()
qt.Controller()


-- 
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 #693420]: JCFpm Heterogeneous FnMax

2020-10-12 Thread Luis Barbosa
Question #693420 on Yade changed:
https://answers.launchpad.net/yade/+question/693420

Status: Answered => Solved

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


[Yade-users] [Question #693420]: JCFpm Heterogeneous FnMax

2020-10-12 Thread Luis Barbosa
New question #693420 on Yade:
https://answers.launchpad.net/yade/+question/693420

Hi all,

I'm trying to get a cohesive aggregate with a distribution of different FnMax, 
as presented in [1].
However I am getting AttributeError: No Such attribute: 
xSectionWeibullShapeParameter

Is it due to my Yade version (2018.02b) or it has to do with:

identifier='shape-'+str(xSectionShape)+'-'+timeStr
outputDir='out_'+identifier

as presented in [2]?


[1] 
https://yade-dem.org/doc/acousticemissions.html?highlight=xsectionweibullshapeparameter#fig-strengthdist
[2] 
https://gitlab.com/yade-dev/trunk/-/blob/master/examples/AcousticEmissions/bendingTest.py

-- 
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 #688867]: Applying force on Stl imported file

2020-02-19 Thread Luis Barbosa
Question #688867 on Yade changed:
https://answers.launchpad.net/yade/+question/688867

Status: Answered => Open

Luis Barbosa is still having a problem:
Thank you Robert,

I have tried it but I got the error:

Traceback (most recent call last):
  File "/usr/bin/yade", line 182, in runScript
execfile(script,globals())
  File "atrito.py", line 46, in 
b.state.inertia=(1,1,1)
AttributeError: 'int' object has no attribute 'state'

-- 
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 #688867]: Applying force on Stl imported file

2020-02-19 Thread Luis Barbosa
New question #688867 on Yade:
https://answers.launchpad.net/yade/+question/688867

Dear all,

I would like to have the inertial behaviour of an imported stl surface as a 
solid body.

For this I am using:

roddd = O.bodies.append(ymport.stl(mesh+'.stl',wire=True,material='wall'))

roddd = O.bodies[a]
O.forces.setPermF(roddd.id,(0,-300,0))
roddd.dynamic = True
roddd.state.mass = 200
roddd.state.inertia =(1,1,1)
roddd.state.blockedDOFs = 'Z' 

But the problem is in "roddd = O.bodies[a]" because it does not accept a list 
of id's. In this way I have to set only one value to "a". Which makes such body 
to be independent from the stl body.

Do you have any suggestions?



-- 
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 #688528]: Multiple Geogrids

2020-02-05 Thread Luis Barbosa
Question #688528 on Yade changed:
https://answers.launchpad.net/yade/+question/688528

Status: Open => Solved

Luis Barbosa confirmed that the question is solved:
Deal all, I solved the problem by doing:


#Create all nodes first :
for i in range(0,nbL):
for j in range(0,nbl):
nodesIds.append( 
O.bodies.append(gridNode([i*L/nbL,j*l/nbl,0],r,wire=False,fixed=False,material='spheremat',color=color))
 )
nodesIds2.append( 
O.bodies.append(gridNode([i*L/nbL,j*l/nbl,0.05],r,wire=False,fixed=False,material='spheremat',color=color))
 )
nodesIds3.append( 
O.bodies.append(gridNode([i*L/nbL,j*l/nbl,-0.05],r,wire=False,fixed=False,material='spheremat',color=color))
 )

#Create connection between the nodes
a=len(nodesIds)
b=len(nodesIds2)
c=len(nodesIds3)
d=a+b+c

for i in range(0,d):
for j in range(i+1,d):
dist=(O.bodies[i].state.pos - O.bodies[j].state.pos).norm()
if(dist<=L/nbL*1.01):   
O.bodies.append( gridConnection(i,j,r,color=color) )

-- 
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 #688528]: Multiple Geogrids

2020-02-05 Thread Luis Barbosa
New question #688528 on Yade:
https://answers.launchpad.net/yade/+question/688528

Dear all,

I'm modelling the interaction of different particle layers separeted by 
geogrids. However, I came to this practical implementation of multiple 
geogrids, I couldn't find in the examples and I am facing troubles to create 
the grid layers in the conventional way:

from yade import pack,geom,qt
from yade.gridpfacet import *
from pylab import *

O.engines=[
ForceResetter(),
InsertionSortCollider([
Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_GridConnection_Aabb(),
]),
InteractionLoop(

[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_GridNode_GridNode_GridNodeGeom6D(),Ig2_Sphere_GridConnection_ScGridCoGeom(),Ig2_GridConnection_GridConnection_GridCoGridCoGeom()],

[Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False)],

[Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),Law2_ScGridCoGeom_FrictPhys_CundallStrack()]
 ),
NewtonIntegrator(gravity=(0,0,-5),damping=0.3,label='newton')
]

O.materials.append(FrictMat(young=10e7,poisson=.25,frictionAngle=0.5,density=1e2,label='sphere'))
O.materials.append(FrictMat(young=10e7,poisson=.25,frictionAngle=0.5,density=1e2,label='walls'))
O.materials.append(CohFrictMat(young=3e5,poisson=0.3,density=1e1,frictionAngle=10,normalCohesion=1e7,shearCohesion=1e7,momentRotationLaw=True,label='spheremat'))


### Parameters of a rectangular grid 1 ###
L=0.1 #length [m]
l=0.05  #width  [m]
nbL=10  #number of nodes for the length [#]
nbl=5   #number of nodes for the width  [#]
r=L/100.#radius
color=[255./255.,102./255.,0./255.]
nodesIds=[]
#Create all nodes first :
for i in range(0,nbL):
for j in range(0,nbl):
nodesIds.append( 
O.bodies.append(gridNode([i*L/nbL,j*l/nbl,0],r,wire=False,fixed=False,material='spheremat',color=color))
 )

#Create connection between the nodes
for i in range(0,len(nodesIds)):
for j in range(i+1,len(nodesIds)):
dist=(O.bodies[i].state.pos - O.bodies[j].state.pos).norm()
if(dist<=L/nbL*1.01):
#O.bodies.append( gridConnection(i,j,r,color=color) )

### Parameters of a rectangular grid 2 ###
L2=0.1 #length [m]
l2=0.05 #width  [m]
nbL2=10 #number of nodes for the length [#]
nbl2=5  #number of nodes for the width  [#]
r2=L2/100.  #radius
color2=[255./255.,102./255.,0./255.]
nodesIds2=[]
#Create all nodes first :
for q in range(0,nbL):
for u in range(0,nbl):
nodesIds2.append( 
O.bodies.append(gridNode([q*L2/nbL2,u*l2/nbl2,0.05],r2,wire=False,fixed=False,material='spheremat',color=color))
 )

#Create connection between the nodes
for q in range(0,len(nodesIds2)):
for u in range(q+1,len(nodesIds2)):
dist2=(O.bodies[q].state.pos - O.bodies[u].state.pos).norm()
if(dist2<=L2/nbL2*1.01):
O.bodies.append( gridConnection(q,u,r2,color=color) )

#O.bodies.append([sphere((0.05,0.025,0.05),.01, material='sphere')])
mn,mx=Vector3(0.01,0,0.015),Vector3(0.09,0.04,0.1) #m
sp=pack.SpherePack()
sp.makeCloud(mn,mx,rMean=0.005)
sp.toSimulation(material='sphere')

mn1,mx1=Vector3(0.01,0,-0.02),Vector3(0.09,0.04,-0.1) #m
spp=pack.SpherePack()
spp.makeCloud(mn1,mx1,rMean=0.005)
spp.toSimulation(material='sphere')

O.bodies.append(geom.facetBox((0.05,0.02,0),(0.045,0.0245,0.11),wallMask=1+2+4+8+16+32,material='walls'))

O.dt=1e-05
O.saveTmp()
qt.View()


Do you have any idea of how to implement it? The issue is on creating the 
connection:
if(dist2<=L2/nbL2*1.01):
O.bodies.append( gridConnection(q,u,r2,color=color) )

Thank you in advance,
Luis

-- 
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 #678447]: Install Yadedaily ubuntu18.04

2019-02-11 Thread Luis Barbosa
Question #678447 on Yade changed:
https://answers.launchpad.net/yade/+question/678447

Status: Answered => Solved

Luis Barbosa confirmed that the question is solved:
Nice, tks!

-- 
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 #678447]: Install Yadedaily ubuntu18.04

2019-02-09 Thread Luis Barbosa
New question #678447 on Yade:
https://answers.launchpad.net/yade/+question/678447

Hi,

I've just updated to ubuntu 18.04.
Then I went to install yadedaily using:

sudo bash -c 'echo "deb http://www.yade-dem.org/packages/ bionic/" >> 
/etc/apt/sources.list'
wget -O - http://www.yade-dem.org/packages/yadedev_pub.gpg | sudo apt-key add -
sudo apt-get update

But when I type "sudo apt-get install yadedaily" I get the message "Unable to 
find package".

By curiosity I've tried "sudo apt-get install yade" and it was installed, 
apparently ok Yade 2018.02b.

Perhaps this post, if it is correct, could be a warning for users?! Or it is 
obvious and I'm being redundant?!

Thank you all,
Luis



-- 
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 #677784]: CombinedKinematicEngine, using Dead=True/False

2019-01-16 Thread Luis Barbosa
Question #677784 on Yade changed:
https://answers.launchpad.net/yade/+question/677784

Status: Answered => Open

Luis Barbosa is still having a problem:
Hi Jan,
Perhaps I was stupid in my question sorry.

The thing is, when I don't use the ''Dead'' feature, consequently the
model starts to move as soon the simulation starts, then it works
perfectly.

But, when I complement the script with ''Dead'' feature in def
checkUnbalanced(): , once the movement starts, then I see that it uses a
different zeroPoint.

I don't know if the problem is in the way I call the function in def
checkUnbalanced(), or if I have to change zeroPoint. In this last case,
I wouldn't know to which value.

Tks,
Luis

-- 
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 #677658]: check breakOccurred in JCF contact law

2019-01-14 Thread Luis Barbosa
Question #677658 on Yade changed:
https://answers.launchpad.net/yade/+question/677658

Status: Open => Solved

Luis Barbosa confirmed that the question is solved:
Hi folks,

I just realized how to solve it.
I used now i.phys.isBroken.

-- 
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 #677784]: CombinedKinematicEngine, using Dead=True/False

2019-01-14 Thread Luis Barbosa
New question #677784 on Yade:
https://answers.launchpad.net/yade/+question/677784

Hi all,

I am using a script where the .st have to wait particle stabilization before 
starts its TranslationEngine+ RotationEngine.
For this I am using in O. engines:
...
CombinedKinematicEngine(ids=rod,label='combEngine', Dead=True) + 
TranslationEngine(translationAxis=(0,0,1),velocity=vel) + 
RotationEngine(rotationAxis=(1,0,0), angularVelocity=angVel, 
rotateAroundZero=True, zeroPoint=(0,0,0)),
PyRunner(command='checkUnbalanced()',iterPeriod=500),

...

def checkUnbalanced():
print "Unbalanced: ",utils.unbalancedForce()
if utils.unbalancedForce()<0.22:
O.engines=O.engines+[PyRunner(iterPeriod=1, 
command="updateKinematicEngines()" ), 
CombinedKinematicEngine(ids=rod,label='combEngine', Dead=False ) + 
TranslationEngine(translationAxis=(0,0,1),velocity=vel) + 
RotationEngine(rotationAxis=(1,0,0), angularVelocity=angVel, 
rotateAroundZero=True, zeroPoint=(0,0,0))]
transEngine, rotEngine = combEngine.comb[0], combEngine.comb[1]

The problem is that the stl loses its center and the rotation is around another 
zeroPoint (perhaps the global zero point, not the stl zero point).

Any idea of what is wrong?

Thank you
Luis


-- 
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 #677658]: check breakOccurred in JCF contact law

2019-01-14 Thread Luis Barbosa
New question #677658 on Yade:
https://answers.launchpad.net/yade/+question/677658

Hi all,

I am using the code [1] to check if a particle lose its cohesive contact and 
consequently belongs or not to a relative aggregate.
But I am not quite sure if i.phys.breakOccurred is really checking if the 
cohesive break occurred.

My question is:
Inside O.engines should I activate the flag used to trigger retriangulation as 
soon as a cohesive bond breaks or not?
Example (yes):
O.engines=[
  ForceResetter(),
...

[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=False, 
Key="Wei", recordCracks=True, breakOccurred(=0))]
),
]
Example (no):

O.engines=[
  ForceResetter(),
...

[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=False, 
Key="Wei", recordCracks=True)]
),
]

Thank you,
Luis

[1]

def addBodyToAggreg(body,aggreg): # auxiliary function, add body [yade.Body 
instance] and all its neighbors into aggreg (python set instance)
   if body.id in aggreg: # do nothing if b is already in aggreg ...
  return
   aggreg.add(body.id) # ... otherwise add it to aggreg
   intrs = body.intrs()
   for i in intrs: # and add also all its neighbors ...
  if not isinstance(i.phys,JCFpmPhys): # ... but only that connected with 
JCFpmPhys interactions
 continue
  if i.phys.breakOccurred: # ... but only not yet broken
 continue
  i2 = i.id1 if i.id2==body.id else i.id2 # choose the other body of 
interaction
  b2 = O.bodies[i2]
  addBodyToAggreg(b2,aggreg) # and add it and all its neighbors to aggreg

-- 
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 #677402]: Count number of fragments

2019-01-09 Thread Luis Barbosa
Question #677402 on Yade changed:
https://answers.launchpad.net/yade/+question/677402

Status: Answered => Solved

Luis Barbosa confirmed that the question is solved:
Thank you 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 #677402]: Count number of fragments

2019-01-09 Thread Luis Barbosa
Question #677402 on Yade changed:
https://answers.launchpad.net/yade/+question/677402

Status: Answered => Open

Luis Barbosa is still having a problem:
Hi Jerome, I've tried this, but it still not working.
Perhaps - def addBodyToAggreg(body,aggreg) - has to be used as an external 
function?
I tried this, but my python complains that this is not a module to be called.

Follow my script:

#!/usr/bin/python
# -*- coding: utf-8 -*-

#Forca normal lei de contato coesao e atrito
from yade import plot
from yade import pack
from yade import utils
from yade import bodiesHandling
from yade import export
#from add import addBodyToAggreg
import math
import random
##Material##

O.materials.append(JCFpmMat(type=1,young=70e5,poisson=0.3,frictionAngle=radians(30),density=1500,tensileStrength=1e5,cohesion=1e5,jointNormalStiffness=1e5,jointShearStiffness=1e5,jointCohesion=1e5,jointFrictionAngle=radians(30),jointDilationAngle=0.0,label='spheres'))

O.materials.append(JCFpmMat(type=1,young=70e5,poisson=0.3,frictionAngle=radians(10),density=2000,tensileStrength=0,cohesion=0,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=0,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='plates'))


##Aggregate##
size=1
if size==1:
rag=0.055 #aumento de 12.61 x 0.00238
print "class 1"
rad,gap= 0.01,0#0.003783,0
r=rag
print "diametro agregado", rag*2
# Spheres
ag=O.bodies.append(
#   pack.regularHexa(
pack.randomDensePack(

(pack.inSphere((0,0,r),r)),radius=rad,color=(0,1,0),rRelFuzz=0,material='spheres')
 # head
)

##Planes#
p1=O.bodies.append(utils.geom.facetBox((0,0,0),(0.05,-0.05,0),wallMask=1,material='plates'))
p2=O.bodies.append(utils.geom.facetBox((0,0,r),(0.05,-0.05,r),wallMask=32,material='plates'))#
 os r's se somam

##Engines#
O.engines=[
  ForceResetter(),

InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
[Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],

[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=False, 
Key="Wei", recordCracks=True)]
),

  TranslationEngine(ids=p2,translationAxis=[0,0,-1],velocity=0.05),
  
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=500,timestepSafetyCoefficient=0.5),
  NewtonIntegrator(damping=0.1,gravity=[0,0,-9.81]),

   PyRunner(command='addBodyToAggreg()',iterPeriod=100,initRun=True),
   PyRunner(command='aggregs()',iterPeriod=100,initRun=True),

]

##Using functions provided by 
Jan#
def addBodyToAggreg(body,aggreg): # auxiliary function, add body [yade.Body 
instance] and all its neighbors into aggreg (python set instance)
if body.id in aggreg: # do nothing if b is already in aggreg ...
return
aggreg.add(body.id) # ... otherwise add it to aggreg
intrs = body.intrs()
for i in intrs: # and add also all its neighbors ...
if not isinstance(i.phys,JCFpmPhys): # ... but only that 
connected with CohFrictPhys interactions
continue
if i.phys.breakOccurred: # ... but only not yet broken
continue
i2 = i.id1 if i.id2==body.id else i.id2 # choose the other body 
of interaction
b2 = O.bodies[i2]
addBodyToAggreg(b2,aggreg) # and add it and all its neighbors 
to aggreg


def aggregs(): # actual function to detect standalone aggregates
ids = set(b.id for b in O.bodies if isinstance(b.shape,Sphere)) # first 
make a set of all spheres ids
ret = []
while len(ids)>0: # while there are still some particles not assigned 
to any aggregate ...
i = ids.pop() # ... choose one random ...
b = O.bodies[i]
a = set() # ... create new aggregate (set of sphere ids)
addBodyToAggreg(b,a) # ... and add the sphere together with all 
its neigbors to aggregate   
for bid in a: # delete all used ids from ids
ids.discard(bid)
ret.append(a)
return ret

aggs = aggregs()
for a in aggs:
print a

from yade import qt
qt.View()
qt.Controller()

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

[Yade-users] [Question #677402]: Count number of fragments

2019-01-08 Thread Luis Barbosa
New question #677402 on Yade:
https://answers.launchpad.net/yade/+question/677402

Hi,
I am trying to implement these functions [1], to count the number of aggregates 
formed after compression of one single (and larger) aggregate.

But it is not working, the error is:

TypeError Traceback (most recent call last)
/usr/bin/yadedaily in ()

TypeError: addBodyToAggreg() takes exactly 2 arguments (0 given)

The problem seems to be in body,aggreg.

Somebody who worked with this code could help me understand?
Thanks,
Luis

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


-- 
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 #676284]: avg Num Interactions

2018-12-15 Thread Luis Barbosa
Question #676284 on Yade changed:
https://answers.launchpad.net/yade/+question/676284

Status: Answered => Solved

Luis Barbosa confirmed that the question is solved:
Tks

-- 
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 #676781]: Yadedaily version

2018-12-13 Thread Luis Barbosa
New question #676781 on Yade:
https://answers.launchpad.net/yade/+question/676781

Hi all, I am trying to update yadedaily from 2018.02b-1786828270~xenial-1 to 
yadedaily_2018.02b-28948d72e6~xenial-1.dsc (13/12/18).

However it is showed that yadedaily is already the newest version 
(2018.02b-1786828270~xenial-1), and I am facing troubles to use the function 
"avgNumInteractions" in this version.

I am struggling for some time at this question and cannot understand what I'm 
doing wrong.

Any help is welcome.

Luis

-- 
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 #676284]: avg Num Interactions

2018-12-13 Thread Luis Barbosa
Question #676284 on Yade changed:
https://answers.launchpad.net/yade/+question/676284

Status: Answered => Open

Luis Barbosa is still having a problem:
Hi Bruno,
Just to confirm, the last version you mean is:

yadedaily_2018.02b-28948d72e6~xenial-1

Right?

Luis

-- 
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 #676284]: avg Num Interactions

2018-12-11 Thread Luis Barbosa
Question #676284 on Yade changed:
https://answers.launchpad.net/yade/+question/676284

Status: Answered => Open

Luis Barbosa is still having a problem:
Followed above

-- 
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 #676284]: avg Num Interactions

2018-12-07 Thread Luis Barbosa
Question #676284 on Yade changed:
https://answers.launchpad.net/yade/+question/676284

Luis Barbosa posted a new comment:
Hi Bruno I am using yadedaily  Yade 2018.02b-1786828270~xenial

Here follows the script:

#!/usr/bin/python
# -*- coding: utf-8 -*-

from yade import plot
from yade import pack
from yade import utils
from yade import bodiesHandling
import math
import random

# Spheres

O.materials.append(JCFpmMat(type=1,young=70e9,poisson=0.3,frictionAngle=radians(30),density=1600,tensileStrength=15e5,cohesion=15e5,jointNormalStiffness=1e5,jointShearStiffness=1e5,jointCohesion=15e5,jointFrictionAngle=radians(30),jointDilationAngle=0.0,label='spheres'))

ag=O.bodies.append(
#   pack.regularHexa(
pack.randomDensePack(

(pack.inSphere((0,0,0.055),0.055)),radius=rad,color=(0,1,0),rRelFuzz=0,material='spheres')
 # head
)

###

O.engines=[
  ForceResetter(),

InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
[Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],

[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=False, 
Key="Wei", recordCracks=True)]
),

  
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=500,timestepSafetyCoefficient=0.5),
  NewtonIntegrator(damping=0.1,gravity=[0,0,0]),
  PyRunner(command='AutoData()',iterPeriod=500,initRun=True),

]


##Coordination 
Number
def AutoData():

plot.addData(CN=avgNumInteractions(cutoff=0.,skipFree=True,considerClumps=False),
 i=O.iter)
O.run(2000,True)#80
plot.plots={'i':('CN')}
plot.plot()
plot.saveDataTxt('CN.txt')


from yade import qt
qt.View()
qt.Controller()


Thank you,
Luis

-- 
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 #676284]: avg Num Interactions

2018-12-07 Thread Luis Barbosa
Question #676284 on Yade changed:
https://answers.launchpad.net/yade/+question/676284

Status: Solved => Open

Luis Barbosa is still having a problem:
Hello everyone,

After the last yadedaily update in 12-05,  the same initial problem
reported here still persists.

Am I doing something wrong or is avgNumInteractions() not working yet?

Cheers,
Luis

-- 
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 #676452]: yadedaily update

2018-11-29 Thread Luis Barbosa
Question #676452 on Yade changed:
https://answers.launchpad.net/yade/+question/676452

Status: Answered => Solved

Luis Barbosa confirmed that the question is solved:
Ok.

-- 
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 #676284]: avg Num Interactions

2018-11-23 Thread Luis Barbosa
Question #676284 on Yade changed:
https://answers.launchpad.net/yade/+question/676284

Status: Answered => Solved

Luis Barbosa confirmed that the question is solved:
Ok, tanks.

-- 
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 #676284]: avg Num Interactions

2018-11-23 Thread Luis Barbosa
Question #676284 on Yade changed:
https://answers.launchpad.net/yade/+question/676284

Status: Answered => Open

Luis Barbosa is still having a problem:
Nice job Jérôme.

but what do you mean by "When and how these changes will land in your computer 
depend on your use of YADE" ?
It will be automatically updated or do I need to change something?

Cheers,
Luis

-- 
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 #676284]: avg Num Interactions

2018-11-21 Thread Luis Barbosa
Question #676284 on Yade changed:
https://answers.launchpad.net/yade/+question/676284

Luis Barbosa posted a new comment:
Ok, let me know when you fix it.

Thanks,
Luis

-- 
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 #676284]: avg Num Interactions

2018-11-20 Thread Luis Barbosa
New question #676284 on Yade:
https://answers.launchpad.net/yade/+question/676284

Hi,

My code [1] to store the coordination number was working pretty well some 
months ago, but today I tried again and I got an error [2]

Any idea of what does this error mean?

[1]
def AutoData():

plot.addData(CN=avgNumInteractions(cutoff=0.0,skipFree=True,considerClumps=False),
 i=O.iter) #this is line 150
O.run(1000,True)#170
plot.plots={'i':('CN')}
plot.plot()
plot.saveDataTxt('CN.txt')

[2]
Traceback (most recent call last):
  File "", line 1, in 
  File "size1densoF4.py", line 150, in AutoData

plot.addData(CN=avgNumInteractions(cutoff=0.0,skipFree=True,considerClumps=False),
 i=O.iter)
  File "/usr/lib/x86_64-linux-gnu/yadedaily/py/yade/utils.py", line 438, in 
avgNumInteractions
nums,counts=bodyNumInteractionsHistogram(aabbExtrema(cutoff))
Boost.Python.ArgumentError: Python argument types in
yade._utils.bodyNumInteractionsHistogram(list)
did not match C++ signature:
bodyNumInteractionsHistogram(boost::python::tuple aabb)
Traceback (most recent call last):
  File "", line 1, in 
  File "size1densoF4.py", line 150, in AutoData

plot.addData(CN=avgNumInteractions(cutoff=0.0,skipFree=True,considerClumps=False),
 i=O.iter)
  File "/usr/lib/x86_64-linux-gnu/yadedaily/py/yade/utils.py", line 438, in 
avgNumInteractions
nums,counts=bodyNumInteractionsHistogram(aabbExtrema(cutoff))
Boost.Python.ArgumentError: Python argument types in
yade._utils.bodyNumInteractionsHistogram(list)
did not match C++ signature:
bodyNumInteractionsHistogram(boost::python::tuple aabb)




-- 
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 #675401]: Export random dense pack

2018-10-20 Thread Luis Barbosa
New question #675401 on Yade:
https://answers.launchpad.net/yade/+question/675401

Hi,

I am creating compacted aggregates composed by spheres using random dense pack. 
After that I export (.txt) such pack and reload it in another simulation.

However, when the second simulation starts, the imported pack seems to "relax" 
and lose its initial compaction.

Anyone knows how to solve it?

Thks,
Luis

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


  1   2   3   >