[Yade-users] [Question #700476]: Output micro-stress vtk

2022-02-01 Thread Leonard
New question #700476 on Yade:
https://answers.launchpad.net/yade/+question/700476

Hi,

I'd like to ask that how to output vtk file for micro-stress[1].

Referring to previous answer at #6 in [2], a working MWE provided by Jan is 
copied as below:
###  Working MWE
from yade import export
O.bodies.append((
   sphere((0,0,0),1),
   sphere((1,0,0),1),
))
O.step()
s = bodyStressTensors()
vtk = export.VTKExporter("stress-test")

TW=TesselationWrapper()
TW.setState()
TW.computeVolumes()
s=bodyStressTensors()

for b in O.bodies:
b.mystress = s[b.id]*4.*pi/3.*b.shape.radius**3/TW.volume(b.id)
vtk.exportSpheres(what=[("stress","b.mystress")])
##

However, when I tried to adapt this code to a packing of particles like what 
example code [3] has done. I got an error saying: "AttributeError: 'Body' 
object has no attribute 'mystress'"

## Below is the not-working MWE
from yade import export
tt=TriaxialTest()
tt.generate("test.yade")
O.load("test.yade")
O.run(100,True)

particleIds=[]
for i in O.bodies:
if isinstance(i.shape,Sphere):
particleIds.append(i.id)

vtk = export.VTKExporter("microStress")

TW=TesselationWrapper()
TW.setState()
TW.computeVolumes()
s=bodyStressTensors()

for b in O.bodies:
if isinstance(b.shape, Sphere):
b.mystress = s[b.id]*4.*pi/3.*b.shape.radius**3/TW.volume(b.id)
vtk.exportSpheres(ids=[i for i in particleIds],what=[("stress","b.mystress")])
##
Do you know why this error occurs for the second MWE?

Thanks
Leonard


[1]https://yade-dev.gitlab.io/trunk/user.html?highlight=paraview#micro-stress
[2]https://answers.launchpad.net/yade/+question/685223
[3]https://gitlab.com/yade-dev/trunk/-/blob/master/examples/tesselationwrapper/tesselationWrapper.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 #700475]: interface friction angle

2022-02-01 Thread ytang
New question #700475 on Yade:
https://answers.launchpad.net/yade/+question/700475

Hi All,

I hope you are doing well.

Recently, I am doing a cone penetration simulation. the following is part of 
the code.
##
from yade import ymport
import itertools
from numpy import *
import numpy as np
from yade import pack, plot, export, utils,geom
import math
target=0.12
young=4e8
finalcompFricDegree=19.5
frictDegree = 39.5
# sphere particles material 
properties 
sphereMat=O.materials.append(CohFrictMat(young=young,poisson=0.3,frictionAngle=radians(finalcompFricDegree),isCohesive=False,alphaKr=0.2,alphaKtw=0,etaRoll=0.5,momentRotationLaw=True,density=2648))
O.bodies.append(ymport.text("rotation-loose-sample-Dr-03.txt",material = 
sphereMat))
 create the penetrator and 
shaft and the cylinder ##
facetMat=O.materials.append(FrictMat(young=young,poisson=0.3,frictionAngle=radians(frictDegree),density=0))
O.materials.append(FrictMat(young=young,poisson=0.3,frictionAngle=0,density=0,label='walls'))
facets =  
O.bodies.append(geom.facetCylinder((200e-3,200e-3,300e-3),200e-3,600e-3,wallMask=6,material='walls',segmentsNumber=100))
###  coloring 
#
 cone and shaft geometry parameter 
###
x0=0.2;y0=0.2;z0=0.39665

cylinderIDS= O.bodies.append(geom.facetCylinder((x0,y0,0.416651),
radius=0.0125,height=0.15,orientation=Quaternion((1, 0, 0), 
0),wallMask=5,segmentsNumber=10, angleRange=None,material=facetMat))

coneIDS= O.bodies.append(geom.facetCone((x0,y0,0.3308255),

radiusTop=0.0125,radiusBottom=0.0,height=0.021651,orientation=Quaternion((1, 0, 
0), 0),wallMask=6,segmentsNumber=10, angleRange=None,material=facetMat))
conecheck=O.bodies[-1].id
 cone and shaft geometry parameter 

###
## set the global engine for the 
simulation
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(

[Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Facet_Sphere_ScGeom()],

[Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_CohFrictMat_CohFrictMat_CohFrictPhys()],

[Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True,label='cohesiveLaw')]
),

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=10,timestepSafetyCoefficient=0.8),
NewtonIntegrator(gravity=(0,0,-9.81),damping=0.0)]
#
#

Generally speaking, the friction angle for particles is 19.5 degrees, while the 
friction angle for the penetrator (cylindyer+cone) is 39.5 degrees.
I also set the friction angle for the penetrator as 29.5 degrees. (I just 
changed the friction angle for the penetrator, the friction angle for the 
particle remains the same. )

when I compare the penetration resistance on the cone for the 29.5-degree case 
and the 39.5-degree case. the penetration resistance on the cone is exactly the 
same. 
###
my question is:
how does Yade choose the interface friction angle between the interactions when 
the friction angles were not the same for the particles and the penetrator?


best,

Yong



-- 
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-02-01 Thread Bruno Chareyre
Question #700315 on Yade changed:
https://answers.launchpad.net/yade/+question/700315

Bruno Chareyre posted a new comment:
A walkthrough of Intel compilation would be valuable, especially if it's
less trivial than just changing the compiler (it needs linkage to more
dynamic libraries iirc).

But in fact installing gcc on the cluster would make a lot of sense too.
I don't know that a clusters can have only one compiler (not the case in
Grenoble at least).

Bruno

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #700434]: InsertionSortCollider SortAxis : does axis choice make a difference to speed?

2022-02-01 Thread Bruno Chareyre
Question #700434 on Yade changed:
https://answers.launchpad.net/yade/+question/700434

Status: Open => Answered

Bruno Chareyre proposed the following answer:
Hi, in a scene which is very elongated along Y-axis it could increase 
performance a little to choose Y as the first sorting axis, indeed.
I don't expect large differences though.
You should check how much cpu time is spent in collider [*], if it's more than 
25% come back here and report the timings, there are ways to make it small 
enough usually.

Bruno

[*]
O.timingEnabled=True
O.run(..., True)
from yade import timing
timing.stats()

-- 
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 #700439]: How to use TW.triangulate() for only part of particles

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

Status: Answered => Solved

Leonard confirmed that the question is solved:
Thanks Karol Brzezinski, 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