Re: [Yade-users] [Question #688690]: pack.SpherePack.save() function saved particles data format

2020-02-17 Thread gaoxuesong
Question #688690 on Yade changed:
https://answers.launchpad.net/yade/+question/688690

Status: Answered => Solved

gaoxuesong confirmed that the question is solved:
I have tried and removed the '\r' following your method.

Thanks Jan. Your instructions are really helpful.

-- 
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 #688789]: How to restart a simulation from a saved point with restoring geometry movement?

2020-02-17 Thread gaoxuesong
Question #688789 on Yade changed:
https://answers.launchpad.net/yade/+question/688789

Status: Answered => Solved

gaoxuesong confirmed that the question is solved:
Hi Jan,

Thank you very much. Yes, you are right. The simulation will proceed if
i use the original O.engines.

I've got some tips:
1. There's no need to save the ids of the facets binded to a movement engine. 
Even though i can not get the ids in the restart simulation, the engine knows 
those facets. 
2. The functions invoked by PyRunner should be included in the restart python 
script and they can be modified. 
3.  The arguments in Rotation and Translation engine should be assigned 
explicitly when updated. 

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 #688690]: pack.SpherePack.save() function saved particles data format

2020-02-17 Thread gaoxuesong
Question #688690 on Yade changed:
https://answers.launchpad.net/yade/+question/688690

gaoxuesong posted a new comment:
Which editor can show the carriage return symbols, such as '^M'? 
I have opened the translated file using the Ubuntu default editor but there is 
no format error.

-- 
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 #688690]: pack.SpherePack.save() function saved particles data format

2020-02-17 Thread gaoxuesong
Question #688690 on Yade changed:
https://answers.launchpad.net/yade/+question/688690

gaoxuesong posted a new comment:
Hi Jan,

I use a Spyder editor integrated in Anaconda on Windows 10 to
conduct the translation code. By the way, what does the '/\r//' mean in
your command?

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 #688690]: pack.SpherePack.save() function saved particles data format

2020-02-14 Thread gaoxuesong
Question #688690 on Yade changed:
https://answers.launchpad.net/yade/+question/688690

Status: Needs information => Open

gaoxuesong gave more information on the question:
Sorry for that. Below is my MWE. 
1. the initial particles set saved by 
sp = pack.SpherePack()
sp.save('initial_spheres-before_translation-x.txt') 

Find file here, 
https://drive.google.com/file/d/1VIYd7qzb5b4iIAyldT49I1Fjko8XxjhI/view?usp=sharing
 

2. the python script to translate those particles in x direction, 
import numpy as np 

data = np.loadtxt('initial_spheres-before-translation-x.txt',
delimiter=' ', skiprows=0)

with open('initial_spheres_translate_x.txt','w') as fd:
for i in range(len(data)):
 fd.write('%.9f %.9f %.9f %.5e %d\n' % (data[i,0]+0.5e-3, 
data[i,1], data[i,2], data[i,3], -1))

Find file here, 
https://drive.google.com/file/d/1P2kVPWFX0VoTzyqVD9uwruodb16Zof5s/view?usp=sharing
 

3. The yade code to load the translated particles, 
from yade import pack,geom,utils  

sp = pack.SpherePack()
sp.load('initial_spheres_translate_x.txt') 
### the initial particles before translation can be loaded ### 
#sp.load('initial_spheres-before-translation-x.txt') 
print('load initial_spheres')
sp.toSimulation()


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


[Yade-users] [Question #688789]: How to restart a simulation from a saved point with restoring geometry movement?

2020-02-14 Thread gaoxuesong
New question #688789 on Yade:
https://answers.launchpad.net/yade/+question/688789

Hi. I want to try some parameters that come into play at a late time point, 
like 1.0s. So i save the simulation at 0.9s and then restart it by O.load() 
method, followed by trying new parameters. 

I have a roller constructed by facets doing translation and rotation controlled 
by RotationEngine and TranslationEngine, respectively. The parameter of "ids" 
in those engines is used to bond the engine to the roller (facets).  

I use the pickle module to save the roller factets ids into a file during the 
first run and load these ids again in the restart run. So in the new run, the 
engines enable to find those roller facets to control. I have checked those ids 
of facets and they are right. 

The problem is that the roller can not rotate or translate in the restart run.  

My MWE is as the following, ( the scenario) 
https://drive.google.com/file/d/1kQN9ZHgJzktLZQ57nWBMbXDa2joxDzUz/view?usp=sharing
 )
the first run saves every 0.05s and the restart run loads data at time 0f 0.3s. 
Because the rotation is active till 0.4s, the roller in the restart run should 
rotate at the beginning. It's stationary yet. 

## the first run  to save at a time point  ##

#!/usr/bin/python
#-*- coding: utf-8 -*-
from yade import pack,geom,utils  
import numpy as np
from yade import qt 

## material 
matSph = CohFrictMat(density=8e11, young=193e9, poisson=0.3)
Mat = O.materials.append(matSph)

## roller 
radiusSweeper = 0.3e-3 
lengthSweeper = 1.0e-3 
numSweeperParts = 20   
Sweeper=[]
for i in np.linspace(0, 2*pi, num=numSweeperParts, endpoint=True):
Sweeper.append(Vector3(radiusSweeper*cos(-i), 0.0, 
radiusSweeper*sin(-i)+1.3e-3))
SweeperP=[Sweeper, [p+Vector3(0.0,lengthSweeper,0.0) for p in Sweeper]]
SweeperPoly = pack.sweptPolylines2gtsSurface(SweeperP, threshold=1e-7)
SweeperIDs = O.bodies.append(pack.gtsSurface2Facets(SweeperPoly, wire=False, 
material=Mat))
## save roller facets' id for restart ### 
import pickle 
fd = open('rollerids.txt', 'wb')
pickle.dump(SweeperIDs, fd)
fd.close() 

## platform 
O.bodies.append(geom.facetBox((2.0e-3,0.5e-3,0.8e-3),(2.0e-3,0.5e-3,0.2e-3), 
wallMask=63, wire=False, material=Mat))
 
### process parameters 
velsw = 2.5e-3 ## translation vel 
angvelsw = -50.0  ## rotation vel  
t1 = 0.4 ## 0~0.2s, rotation + translation 
t2 = 0.8 ## 0.2~0.4, translation   
def change_motion():
if O.time < t1:
rotaEngineSw.dead = False 
transEngineSw.dead = False
rotaEngineSw.zeroPoint = (O.time*velsw, 0, 1.30e-3)
elif O.time < t2:
rotaEngineSw.angularVelocity = 0.0   
transEngineSw.velocity = velsw 
else:
transEngineSw.velocity = 0.0 

## save per 0.05s 
svdt = 0.05
saveTime = 0 
def svfun():
global svdt, saveTime  
if O.time> saveTime:
O.save('time-'+str(O.time)[:4])
saveTime += svdt  
if O.time>1.2:
O.pause() 

O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
   [Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Facet_Sphere_ScGeom6D()],
   [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys()],
   [Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
),
PyRunner(iterPeriod=100,command='change_motion()'),
RotationEngine(dead=True, label='rotaEngineSw', rotateAroundZero=True, 
zeroPoint=(0,0,1.30e-3), angularVelocity=angvelsw, rotationAxis=[0,1,0], 
ids=SweeperIDs)+ \
TranslationEngine(dead=True, label='transEngineSw', 
translationAxis=[1,0,0], velocity=velsw, ids=SweeperIDs),
NewtonIntegrator(damping=0.75, exactAsphericalRot=True, 
gravity=(0,0,-9.81)),
PyRunner(iterPeriod=100,command='svfun()'),
]

## particles 
sp=pack.SpherePack()
sp.makeCloud((0.5e-3,0,1.0e-3),(2.0e-3,1e-3,1.4e-3),rMean=40e-6,rRelFuzz=0.5)
sp.toSimulation(material=Mat)

O.dt = 0.85*utils.PWaveTimeStep()

#O.run()


 the restart run  
##

#!/usr/bin/python
#-*- coding: utf-8 -*-
from yade import pack,geom,utils  
import numpy as np
from yade import qt 

## load a saved data 
O.load('time-0.30')

import pickle 
fd = open('rollerids.txt', 'rb')
SweeperIDs = pickle.load(fd) 
fd.close()

### process parameters 
velsw = 2.5e-3 ## translation vel 
angvelsw = -50.0  ## rotation vel  
t1 = 0.4 ## 0~0.2s, rotation + translation 
t2 = 0.8 ## 0.2~0.4, translation   
def change_motion():
if O.time < t1:
rotaEngineSw.dead = False 
transEngineSw.dead = False
rotaEngineSw.zeroPoint = (O.time*velsw, 0, 1.30e-3)
elif O.time < t2:
rotaEngineSw.angularVelocity = 0.0   
transEngineSw.velocity = velsw 
else:
transEngineSw.velocity = 0.0 

## save per 0.05s 
svdt = 0.05
saveTime = 0 
def svfun():
global svdt, saveTime  
if O.time>saveTime:
O.save('time-r-'+str(O.time)[:4])
saveTime += svdt  
if 

Re: [Yade-users] [Question #688690]: pack.SpherePack.save() function saved particles data format

2020-02-12 Thread gaoxuesong
Question #688690 on Yade changed:
https://answers.launchpad.net/yade/+question/688690

Status: Needs information => Open

gaoxuesong gave more information on the question:
The error is shown as,

RuntimeError: bad lexical cast: source type value could not be
interpreted as target

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


[Yade-users] [Question #688690]: pack.SpherePack.save() function saved particles data format

2020-02-11 Thread gaoxuesong
New question #688690 on Yade:
https://answers.launchpad.net/yade/+question/688690

Hi. I have a file of spherical particles saved by function of 
pack.SpherePack().save(). It has the format as follows, 

0.000919246 0.000859971 0.000602774 1.20067e-05 -1
0.000959836 0.00055149 0.000975021 2.11065e-05 -1
. 

I want to translate all the particles in x direction and conduct it by the 
following python code,  
===
===
import numpy as np 

data = np.loadtxt('initial_spheres.txt', delimiter=' ', skiprows=0)

with open('initial_spheres_translate_x.txt','w') as fd:
for i in range(len(data)):
fd.write('%.9f %.9f %.9f %.5e %d\n' % (data[i,0]+0.5e-3, data[i,1], 
data[i,2], data[i,3], -1))
===
===
 and i got the data as this, 

0.001919246 0.000859971 0.000602774 1.20067e-05 -1
0.001959836 0.000551490 0.000975021 2.11065e-05 -1

The format seems the same, however, there is an format error when reading the 
file by pack.SpherePack().load() function.  
By the way, i have tried the delimiter as space and tab and both don't work. 

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 #688343]: Slow calculation speed with a large number of facets imported from stl mesh

2020-01-30 Thread gaoxuesong
Question #688343 on Yade changed:
https://answers.launchpad.net/yade/+question/688343

Status: Answered => Solved

gaoxuesong confirmed that the question is solved:
Thanks, Jan. I cut off some parts of the mesh and get a total number of
93,011. The calculation speed is 60 iter/s. i think this can be
acceptable.

-- 
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 #688343]: Slow calculation speed with a large number of facets imported from stl mesh

2020-01-29 Thread gaoxuesong
New question #688343 on Yade:
https://answers.launchpad.net/yade/+question/688343

Hi. Now i am simulating a case where spherical particles are spreading on a 
substrate imported from a stl mesh. The number of the spherical particles is 
6,000 and the number of the facets from stl mesh is 447,262.  The calculation 
speed is low as 2~4 iter/s. 

I had tried to use more threads by the command of "yade -j4 myscript.py", 
however, i got the warning that there are fewer particles nad only some threads 
are used.  

Since the thread option doesn't work, i am wondering how to deal with a large 
number of facets to increase calculation speed?  

P.S. My system is ubuntu 18.04, yade version is 2018.02 and my cpu is intel 
i7-8or9 (quite new one, 12 threads in total). 

  


 

-- 
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 #684115]: Some basic concepts in FrictPhys.cpp

2019-10-01 Thread gaoxuesong
Question #684115 on Yade changed:
https://answers.launchpad.net/yade/+question/684115

Status: Answered => Solved

gaoxuesong confirmed that the question is solved:
Thanks very much for your answers. Helps me a lot.

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

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


Re: [Yade-users] [Question #684115]: Some basic concepts in FrictPhys.cpp

2019-09-22 Thread gaoxuesong
Question #684115 on Yade changed:
https://answers.launchpad.net/yade/+question/684115

Status: Solved => Open

gaoxuesong is still having a problem:
Can i change the status of this question? I make a mistake to set it as
solved. :(

-- 
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 #684115]: Some basic concepts in FrictPhys.cpp

2019-09-22 Thread gaoxuesong
Question #684115 on Yade changed:
https://answers.launchpad.net/yade/+question/684115

Status: Open => Solved

gaoxuesong confirmed that the question is solved:
The source code website is:
https://gitlab.com/yade-dev/trunk/blob/master/pkg/dem/FrictPhys.cpp

-- 
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 #684115]: Some basic concepts in FrictPhys.cpp

2019-09-22 Thread gaoxuesong
New question #684115 on Yade:
https://answers.launchpad.net/yade/+question/684115

Hi. Now i am studying the source code of FrictPhys.cpp. I am confused about 
some concepts even after i check the programmer manual.  My questions are 
mainly about these codes, 

1. const shared_ptr& mat1 = YADE_PTR_CAST(b1); 

 1.1  Is the shared_ptr a template class and will instantiate a 
pointer to FricMat? I have checked the definition of shared_ptr but it is too 
complicated for a c++ newer to understand. 

 1.2  The YADE_PTR_CAST will do change the b1 type to FrictMat? But if b1 
is not a pointer to FrictMat, like a CohFrictMat, will it cause a material type 
mismatch between the particle material and the IPhysFunctor?   
  
2. Ra=sphCont->refR1>0?sphCont->refR1:sphCont->refR2; 
Rb=sphCont->refR2>0?sphCont->refR2:sphCont->refR1;

2.1  The Ra, Rb here are the stiffness related particle size?  Why these 
two values could be negative? 
 
3. interaction->phys = shared_ptr(new FrictPhys());  
const shared_ptr& contactPhysics = 
YADE_PTR_CAST(interaction->phys);
contactPhysics->kn = Kn;   contactPhysics->ks = Ks;

3.1 Also the conversion of interaction->phys to FrictPhy type. Another is 
that since the reference  contactPhysics has decoration of const, why it is 
able to change the value of its pointing memory?  

4. Real Kn = (!kn) ? 2*kna*knb/(kna+knb) : (*kn)(mat1->id,mat2->id,kna,knb);

4.1 I understand the true part of this expression. What does the false part 
means? (*kn) is a function?  

Thanks for your patience to look through all my questions. 

Xuesong  

-- 
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 #683109]: Why my iteration speed is so low?

2019-08-22 Thread gaoxuesong
Question #683109 on Yade changed:
https://answers.launchpad.net/yade/+question/683109

gaoxuesong posted a new comment:
Hi Robert, thanks for your test.  When i try to use -j8, i have warn, like 
### 
WARN  /build/yade-fDuCoe/yade-2018.02b/pkg/common/InsertionSortCollider.cpp:76 
insertionSortParallel: Parallel insertion: only 3 thread(s) used. The number of 
bodies is probably too small for allowing more threads, or the geometry is 
flat. The contact detection should succeed but not all available threads are 
used.
### 
So only three threads are used. When get 35, the iteration speed is  274 
iter/s . 
##
1. Don't you have that kind of warn? 
##
2. So you don't use a virtual machine but install a linux system directly? 

Thank you again.

-- 
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 #683109]: Why my iteration speed is so low?

2019-08-21 Thread gaoxuesong
Question #683109 on Yade changed:
https://answers.launchpad.net/yade/+question/683109

gaoxuesong posted a new comment:
Hi Robert, i have sphere and facet particles in my model. The total sphere is 
6691, facet is 2020. So with this number of bodies, is it necessary to use 
multiple cores, like -j 2 or more? 
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 #683109]: Why my iteration speed is so low?

2019-08-21 Thread gaoxuesong
Question #683109 on Yade changed:
https://answers.launchpad.net/yade/+question/683109

gaoxuesong posted a new comment:
Hi, Duriez. You are right. I know the capability is limited. However, i post 
the performance test of Yade on my computer and want to make sure the problem 
of slow speed is not my hardware or the run mode of Yade. So could someone try 
my case on your own computer to see what it is going on. 
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


[Yade-users] [Question #683109]: Why my iteration speed is so low?

2019-08-20 Thread gaoxuesong
New question #683109 on Yade:
https://answers.launchpad.net/yade/+question/683109

Hi, i try to do some simulation about particle packing behavior in a rotating 
drum. However the iteration speed is so low as about 30 iterations per second. 
Nevertheless, at the beginning when the particles are far from each, the 
iteration speed is 500 iter/s, no matter with -j2 or without prescribed -j 
parameter. 

## Below is my code, 

from yade import pack,geom,utils  
import numpy as np
from yade import qt 
### the unit in the simulation is UI, like  kg m s Pa 
### the particle has diameter below 100 microns 

muS = 0.57
muF = 0.9   
FricAngleS = math.atan(muS)
FricAngleF = math.atan(muF)

density = 8150   
yongmodu = 195e5 ## scaled by 1e-4, normal value is 195Gpa  
poisn = 0.3 
Dsph = 80e-6 ## particle max diameter 
angvelsw = -25  ## rotation speed rad/s 
nrot = 6  ## rotation times 

matSph = CohFrictMat(density=density, young=yongmodu, poisson=poisn, 
frictionAngle=FricAngleS, momentRotationLaw=True)
SMat = O.materials.append(matSph)
matFacet = CohFrictMat(density=density, young=yongmodu, poisson=poisn, 
frictionAngle=FricAngleF, momentRotationLaw=True)
FMat = O.materials.append(matFacet)

### geometry ### 
radiusSweeper = 10*Dsph   
radiusSweeper0 = 9*Dsph   
lengthSweeper = 12*Dsph 
numSweeperParts = int(round(2*np.pi*radiusSweeper/5.0e-6))  

## spheres ##  
O.bodies.clear() 
sp = pack.SpherePack() 
x1, y1, z1 = -radiusSweeper, 0, 0
x2, y2, z2 = radiusSweeper, lengthSweeper, 2*radiusSweeper
sp.makeCloud((x1, y1, z1), (x2, y2, z2), 
psdSizes=[0.010e-3,0.024e-3,0.035e-3,0.051e-3,0.085e-3], 
psdCumm=[0,0.1,0.5,0.9,1.0])
sp.toSimulation(material=SMat)

## drum ## 
Sweeper=[]
for i in np.linspace(0, 2*pi, num=numSweeperParts, endpoint=True):
Sweeper.append(Vector3(radiusSweeper*cos(-i), 0.0, 
radiusSweeper*sin(-i)+radiusSweeper))

SweeperP=[Sweeper, [p+Vector3(0.0,lengthSweeper,0.0) for p in Sweeper]]
SweeperPoly = pack.sweptPolylines2gtsSurface(SweeperP, threshold=1e-7)
sweeperid = O.bodies.append(pack.gtsSurface2Facets(SweeperPoly, wire=False, 
material=FMat))
boxid = 
O.bodies.append(geom.facetBox((0,0.5*lengthSweeper,radiusSweeper),(radiusSweeper,0.5*lengthSweeper,radiusSweeper),
 \
  wallMask=63, material=FMat, wire=True))

## remove the spheres out of the drum ## 
for eb in O.bodies:
if isinstance(eb.shape, Sphere):
xi,yi,zi = eb.state.pos
lengi = np.sqrt(xi**2 + (zi-radiusSweeper)**2) 
if lengi > 0.96*radiusSweeper:
O.bodies.erase(eb.id)
## total sphere is 6691, facet is 2020 

### define engines functions ### 
t1 = 0.1
t2 = t1+nrot*(2*np.pi/abs(angvelsw)) 
t3 = t2+0.1   
def change_motion():
if O.time > t1:
rotaEngineSw.dead = False
rotaEngineSw.angularVelocity =  angvelsw 
if O.time > t2: 
rotaEngineSw.angularVelocity = 0.0

O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
   [Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Facet_Sphere_ScGeom6D()],
   [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys()],
   [Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
),
PyRunner(iterPeriod=int(1.0e6),command='change_motion()'), 
RotationEngine(dead=True, label='rotaEngineSw', rotateAroundZero=True, 
zeroPoint=(0,0,radiusSweeper), angularVelocity=angvelsw, rotationAxis=[0,1,0], 
ids=sweeperid),
NewtonIntegrator(damping=0.75, exactAsphericalRot=True, 
gravity=(0,0,-9.81)),
]

O.dt = 0.85*utils.PWaveTimeStep()
O.run()

## the hardware ## 
Ubuntu 18.04 on VMware 14.0 with 8 processors 32 GB memory 
Main system: Win10-64 
Processor: AMD Ryzen Threadripper 1950X 16-Core Porcessor, 3.40 GHz 
## Yade version 
2018.02b 

## some yade --performance test  
## 4k 20k 40k spherical particles with yade -j 1 *.py 
https://drive.google.com/open?id=1nqXm75HpqhG-n0XPU7MF1G0AiBfuTcSj 
https://drive.google.com/open?id=1_2TWGVauOQvFznHqdiV5R35yhqzitHvo
https://drive.google.com/open?id=1rPvseozgYY9qEW41dQXKm3iz4sORTGtY
## 4k 20k 40k spherical particles with yade -j 2 *.py 
https://drive.google.com/open?id=1_z7C7jkjYy_wzXy9iNaq_N4SaI_wghSV
https://drive.google.com/open?id=1hrOEshAC4YQAEmSpCrk_IHmIwvcvjz7z
https://drive.google.com/open?id=1pcR6WAmLWeCWo0-yiRGR-2g0BzJ7rMCl

Very appreciated.  
Xuesong 











-- 
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 #682916]: The number of threads or cores to used running yade?

2019-08-19 Thread gaoxuesong
Question #682916 on Yade changed:
https://answers.launchpad.net/yade/+question/682916

Status: Answered => Solved

gaoxuesong confirmed that the question is solved:
So i think i will ask a new question about why my simulation speed is so
low. I will supply a MSW example.

-- 
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 #682898]: Which model is used to calculate the cohesive force?

2019-08-19 Thread gaoxuesong
Question #682898 on Yade changed:
https://answers.launchpad.net/yade/+question/682898

gaoxuesong posted a new comment:
Thanks. Now i understand the adhesion attribute in the CohFricPhys material and 
it is a adhesion strength. Sorry i don't understand the c++ code. Is there any 
papers to help understand the involved theory about the bond breaking when 
normal force below the defined adhesion strength. 
Thanks again.

-- 
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 #682916]: The number of threads or cores to used running yade?

2019-08-19 Thread gaoxuesong
Question #682916 on Yade changed:
https://answers.launchpad.net/yade/+question/682916

gaoxuesong posted a new comment:
Thank. The last question is that i want to know the meaning of some item on the 
graphical controller. As shown in the picture below, 
https://drive.google.com/open?id=1fN9jBwQ1syuLJGPa7lqsk_mffidz6x6y
The iter #11514535, 45.0/s means the calculation speed is 45 iteration per 
second?  What is the usual value?

-- 
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 #682916]: The number of threads or cores to used running yade?

2019-08-15 Thread gaoxuesong
New question #682916 on Yade:
https://answers.launchpad.net/yade/+question/682916

Hi, I have some questions about the cores and threads in parallel mode. 

1.  What's the difference between the --cores and -j ? In the documentation, 
they almost have the same defination. 
--cores  Set number of OpenMP threads (as –threads) and in addition set 
affinity of threads to the cores given. 
-j  Number of OpenMP threads to run 

2. What can we get from the parameter of --performance? 
 I have tried this parameter, it shows the time consuming of different 
engine parts for different number of particles. So it will help to improve the 
program?  

3. In the section of Controlling parallel computation, there are to two ways to 
 set the cores or threads for the job. One is the environmental variable 
OMP_NUMBER_THREADS, and the other is the -j  X option. Also it says the cores 
number can be found in the /proc/cpuinfo. i have looked up this file, it has 8 
processors and each has 1 cores. In fact, i set 8 cores to the ubuntu system in 
the VM. Does it mean my processors are single core processors? 

4.  How to set the right cores for a job? 
In the graphical controller created when yades stars, there is a item named 
iter. It shows the current iter and a velocity. Does this velocity is the 
calculation speed, iter per second? If so, is it feasible to try the number of 
cores used by this velocity? 

Thanks, 
Xuesong 

-- 
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 #682883]: calculate mass content of a group of particles through something like label

2019-08-15 Thread gaoxuesong
Question #682883 on Yade changed:
https://answers.launchpad.net/yade/+question/682883

gaoxuesong posted a new comment:
You are welcome. However, in the way as you said, 
###
-->>s1=O.bodies.append(sphere((x1,y1,z1),radius=radius1))
-->>list1=[]
-->>list1.append(s1)
### 
list1 also stores the id of a body. In this way, it stores the body. 
-->>s1=O.bodies.append(sphere((x1,y1,z1),radius=radius1))
-->>list1=[]
-->>list1.append(O.bodies[s1]) 
### 
one thing to be addressed is that the return value of the O.bodies.append() is 
the body's id not the body itself. 
 best,
Xuesong

-- 
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 #682883]: calculate mass content of a group of particles through something like label

2019-08-14 Thread gaoxuesong
Question #682883 on Yade changed:
https://answers.launchpad.net/yade/+question/682883

Status: Open => Answered

gaoxuesong proposed the following answer:
Hi,

The possible way i think is that using different lists to save the sphere's 
id of different groups and do loop in each list. 
## group 1 ##  
list1 = [] 
list1.append(O.append(sphere((x1,y1,z1),radius=radius1)))
... 
## group 2 ## 
list2 = [] 
list2.append(O.append(sphere((x2,y2,z2),radius=radius2)))
... 
## calculate the mass of different groups ## 
masstotal1 = 0 
for each in list1:
masstotal1 + = O.bodies[each].state.mass 
masstotal2 = 0 
for each in list2:
masstotal2 + = O.bodies[each].state.mass 

## ends ##

Cheers, 
Xuesong

-- 
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 #682898]: Which model is used to calculate the cohesive force?

2019-08-14 Thread gaoxuesong
Question #682898 on Yade changed:
https://answers.launchpad.net/yade/+question/682898

gaoxuesong posted a new comment:
I have checked the definition of CohFrictMat. So the normalCohesion
and shearCohesion is the an and as appeared in the documentation of
Law2_ScGeom6D_CohFrictPhys_CohesionMoment?

-- 
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 #682898]: Which model is used to calculate the cohesive force?

2019-08-14 Thread gaoxuesong
New question #682898 on Yade:
https://answers.launchpad.net/yade/+question/682898

Hi. 

I have looked through the document for 
Law2_ScGeom6D_CohFrictPhys_CohesionMoment. It gives the formula to calculate 
the contact force. Fn=min(kn∗(un−upn),an). an is the cohesive force. But is 
there any material to refer to get the detailed description about cohesive 
force, an? 

Thanks, 
Xuesong 

-- 
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 #682159]: output picture from saved results using saveSnapshot

2019-07-20 Thread gaoxuesong
Question #682159 on Yade changed:
https://answers.launchpad.net/yade/+question/682159

Status: Needs information => Open

gaoxuesong gave more information on the question:
I find that there is a delay for the window to render the image. So maybe the 
codes are not executed by the original order. The codes to snapshot the window 
may be executed before the window renders the image.   
I find the debug sentence can be used to make them synchronization. The 
modified codes is as followings, 

import os
from yade import qt
import pdb 

path = os.getcwd()
os.mkdir(path+'/plot')
qtr = qt.Renderer()
qtr.bgColor = [1,1,1]
v = qt.View()
outpath = path+'/plot/'

for file in os.listdir(path):
if os.path.isdir(file):
continue
O.load(file)
pdb.set_trace() 
v.saveSnapshot(str(O.time)[:4]+'.jpg')
 
When it pauses at the break point, just enter 'c' to make it continue.

-- 
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 #682159]: output picture from saved results using saveSnapshot

2019-07-19 Thread gaoxuesong
Question #682159 on Yade changed:
https://answers.launchpad.net/yade/+question/682159

gaoxuesong posted a new comment:
Yes. The errors are, 
"Secondary views not supported. " 

This is the screenshot, 
https://drive.google.com/file/d/1O4bQeGykuW9xMnZiEX_0RG-XyqcfHGZP/view?usp=sharing

-- 
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 #681232]: Sphere goes through the facet wall in Harmonic vibration

2019-06-17 Thread gaoxuesong
Question #681232 on Yade changed:
https://answers.launchpad.net/yade/+question/681232

Status: Answered => Solved

gaoxuesong confirmed that the question is solved:
Thanks, my question has been solved.

-- 
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 #681343]: import stl format file into yade

2019-06-17 Thread gaoxuesong
Question #681343 on Yade changed:
https://answers.launchpad.net/yade/+question/681343

Status: Answered => Solved

gaoxuesong confirmed that the question is solved:
Thanks, 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 #681341]: Move or scale a facet

2019-06-12 Thread gaoxuesong
Question #681341 on Yade changed:
https://answers.launchpad.net/yade/+question/681341

gaoxuesong posted a new comment:
Yes, you are right. Much 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 #681343]: import stl format file into yade

2019-06-12 Thread gaoxuesong
Question #681343 on Yade changed:
https://answers.launchpad.net/yade/+question/681343

gaoxuesong posted a new comment:
Thanks. I will try it and reply later.

-- 
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 #681341]: Move or scale a facet

2019-06-12 Thread gaoxuesong
Question #681341 on Yade changed:
https://answers.launchpad.net/yade/+question/681341

Status: Answered => Solved

gaoxuesong confirmed that the question is solved:
Thanks. I have tried to move and scale a facet. For moving a facet, just 
changing the position is feasible. But for scaling a facet, just multiplying a 
scaling factor is not feasible. The vertice coordinates can not be changed 
directly, like the tuple and string in python, i think.  
Following is the code i used, 

from yade import qt 
c = qt.Controller() 
O.bodies.clear() 
### 2 initial facet ### 
v1 =(0,0,0)
v2 = (1,0,0)
v3 =(1,1,0)
f1 = facet((v1,v2,v3),wire=False)
O.bodies.append(f1)
v1 =(2,0,0)
v2 = (3,0,0)
v3 =(3,1,0)
f1 = facet((v1,v2,v3),wire=False)
O.bodies.append(f1)

## move facet 1 
fcet1 = O.bodies[0]
mv = (1,0,0)
fcet1.state.pos += mv
## succeed ### 
## scale vertices 
for ev in fcet1.shape.vertices:
for i in range(3):
ev[i] *= 0.5 
## failed, the vertices can not be changed  
## then try to construct a new facet using the scaled and translated vertices 
vg = [] 
for ev in fcet1.shape.vertices:
vgi = fcet1.state.pos+fcet1.state.ori*ev ## global coordinates 
vg.append(vgi)
print(vg)
for each in vg:
for i in range(3):
each[i] *= 0.5
if i == 1: ## translate in y direction by 2.0 
each[i] += 2.0 
print(vg)
## construct the new facet and remove the old one 
f1 = facet((vg[0],vg[1],vg[2]),wire=False) 
O.bodies.append(f1)
O.bodies.erase(fcet1.id)

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

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


[Yade-users] [Question #681343]: import stl format file into yade

2019-06-11 Thread gaoxuesong
New question #681343 on Yade:
https://answers.launchpad.net/yade/+question/681343

We can use the ymport.stl function to import facet from stl format file. 
I want to ask if the coding of the file must be binary or not? 
In my case, i need to do some modifications to the geometry, such as move and 
scale.  
So first i save my geometry to stl file using ASCii coding and open it with 
python, like 'fd=open(stlfile, 'r')', then i can do some modifications. After 
that, i save the file in the ascii coding too. In order to import it into Yade, 
i use the paraview to change the coding of the stl file from ascii to binary. 
It is so fussy. Could anyone give me some advice? 

Thanks, 
Xuesong 


-- 
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 #681341]: Move or scale a facet

2019-06-11 Thread gaoxuesong
New question #681341 on Yade:
https://answers.launchpad.net/yade/+question/681341

How to move or scale a facet? In my opinion, 1. get the 3 vertices of the 
facet. 2. give a increment to x coordinate of the 3 vertices (e.g., move in x 
direction). 3. the facet move automatically, if not, use the new vertices to 
generate a new facet and remove the old one. 
But i find the vertices obtained by the method of 'body.shape.vertices'  are 
not the  vertices i use to define the facet. 
Here is the codes, 
### define a facet using 3 points 
v1 =(0,0,0)
v2 = (1,0,0)
v3 =(1,1,0)
f1 = facet((v1,v2,v3),wire=False)
O.bodies.append(f1)

### get the vertices of the facet 
for eb in O.bodies:
print(eb.state.pos)
print(eb.shape.vertices)

The result is, 
Vector3(0.7071067811865475,0.2928932188134525,0)
[Vector3(-0.7071067811865475,-0.2928932188134525,0), 
Vector3(0.29289321881345254,-0.2928932188134525,0), 
Vector3(0.29289321881345254,0.7071067811865475,0)]

So what is the meaning of the 3 vertices? How to move or scale a facet? 

Thanks, 
Xuesong 

-- 
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 #681232]: Sphere goes through the facet wall in Harmonic vibration

2019-06-07 Thread gaoxuesong
Question #681232 on Yade changed:
https://answers.launchpad.net/yade/+question/681232

gaoxuesong posted a new comment:
> the time step 
The PWaveTimeStep is 1.02e-08. 
By the way, the default option of Yade is in parallel and uses all of the 
available cores? In the tutorial, it says, "By default, each job uses all 
available cores for itself, which causes jobs to be effectively run in 
parallel. Number of cores per job can be globally changed via the --job-threads 
option" 
   If i just start a job by "yade pyname.py", is it executed in parallel and 
uses the available cores? If so, how many cores does it use when i start a new 
job without designating the cores to use? To  grab some cores from the first 
job? 

> the meaning of the mass reduction  
For my case, the packing density is an important factor to affect the 
following process. Larger mass makes denser packing. So this is the meaning of 
the step.  Yes. I agree with you the mass modification changes the physical 
process. But if we actually care about the random feature of particle packing 
not the exact the particle distribution.  

Thanks,
Xuesong

-- 
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 #681232]: Sphere goes through the facet wall in Harmonic vibration

2019-06-06 Thread gaoxuesong
Question #681232 on Yade changed:
https://answers.launchpad.net/yade/+question/681232

gaoxuesong posted a new comment:
>the problem is that with rMean=rRelFuzz, the radius may be arbitrarily
small (you can print the minimal value), making the PWaveTimeStep very
small, too.

Actually i run an example case where all the particles have the same
diameter of 100 um and the time step is set as 1e7. As soon as the
simulation starts, the particles explode and flow out.

>  the last step is mass shrinking, where the mass of all the particles
is gradually decreased to the 1/1000 of the used value. Does it make
sense or do you have good advice?

Sorry for confusing words used. The following is an example,

### a function to reduce the mass gradually 
redt = 0.5  ### how long for one mass reduction 
retime = 1.0 ### the time when mass reduction happens 
mrecof = 0.1 ## the mass reduction cofficient 
def mass_relaxation():
global redt 
global retime 
if O.time > retime:
retime = retime + redt 
for eb in O.bodies:
if isinstance(eb.shape, Sphere):
eb.state.mass = eb.state.mass*mrecof 
print('change mass', O.time) 

Then the function of mass_relaxation() is invoked by pyRunner Engine
periodically.

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 #681232]: Sphere goes through the facet wall in Harmonic vibration

2019-06-05 Thread gaoxuesong
Question #681232 on Yade changed:
https://answers.launchpad.net/yade/+question/681232

gaoxuesong posted a new comment:
Hi Jan,

Thanks for your answers. For the density magnification,  in my case, the
diameter of the sphere is around 80 um. If i use the normal density, it
costs about 4 hours to simulate virtual time of 55 ms. The total time i
need is 3s, so it is very time-consuming. In my method, the last step is
mass shrinking, where the mass of all the particles is gradually
decreased to the 1/1000 of the used value. Does it make sense or do you
have good advice?

-- 
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 #681014]: How to calculate the surface roughness of sphere particle packing?

2019-06-04 Thread gaoxuesong
Question #681014 on Yade changed:
https://answers.launchpad.net/yade/+question/681014

Status: Answered => Solved

gaoxuesong confirmed that the question is solved:
Hi. Sorry for late test. 
Based on my experiments about this method, i find the parameter 'factor' is 
very import. Larger potential factor, more accurate the result. Here i put an 
image about how the 'factor' parameter affects the results. The 'factor' set as 
8 is already enough for my case. Below is the link. 
https://drive.google.com/file/d/1Kl_uAiYYobjhhyx9_wKClCLnPxbDTtot/view?usp=sharing

Also for the potential function, the parameter of 'r' can be removed. But the 
'factor' should be increased to a larger value. In my case, the radius is in 
the order of microns and the accuracy becomes poor when i leave out the 'r'. 
Because the 'factor' is magnified by 1e6 equivalently. So if one wants to 
neglect the 'r', a larger 'factor' should be used. Taking the 'r' as 
denominator makes it easy to pick a 'factor' without consideration of the order 
of the particle size. The following result corresponds to the case where the 
'r' is left out and the 'factor' is set as 1e7 instead. 
https://drive.google.com/file/d/10bkLM-_SYdskcw5FL64D1pbb0PVDtTVu/view?usp=sharing
Much 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


[Yade-users] [Question #681232]: Sphere goes through the facet wall in Harmonic vibration

2019-06-04 Thread gaoxuesong
New question #681232 on Yade:
https://answers.launchpad.net/yade/+question/681232

Hi, in my case there are lots of spheres in one box and a piston in the bottom 
of the box. Then the piston does harmonic vibration. I find when the vibration 
amplitude goes to high, the spheres go through the piston, which is constructed 
by facet. I want to know the reason and fix it. In addition, the density is 
amplified by a factor of 1e9 to increase the calculation speed. And also I want 
to know how to define the word of "rigid" in yade. In my case, the box is rigid 
and the spheres are relatively soft. Does it make sense if i set the young's 
modulus of the box material as 100 times of that of the sphere material?  

Following is my code,

# PhysicalParameters
muS = 0.57735 
muF = 0.17632   
FricAngleS = math.atan(muS)
FricAngleF = math.atan(muF)
densitys_ac = 8150*1e9 
densityw_ac = 2700*1e9 
yongmodu = 195e9 
poisn = 0.3 

# material model 
matSph = CohFrictMat(density=densitys_ac, young=yongmodu, poisson=poisn, 
frictionAngle=FricAngleS, momentRotationLaw=True)
SMat = O.materials.append(matSph)
matFacet = CohFrictMat(density=densityw_ac, young=yongmodu, poisson=poisn, 
frictionAngle=FricAngleF, momentRotationLaw=True)
FMat = O.materials.append(matFacet)

## box and piston 
O.bodies.append(geom.facetBox((0.5e-3,0.5e-3,0.5e-3),(0.5e-3,0.5e-3,0.5e-3), 
wallMask=31, material=FMat))
Cylinder1IDs=O.bodies.append(geom.facetBox((0.5e-3,0.5e-3,0.15e-3),(0.5e-3,0.5e-3,0.2e-3),
 wallMask=63, color=(0,1,0), wire=False, material=FMat))

# spreading process motions first harmonic vibratiion then stop 
def change_motion():
if O.time > 0.4:
harmEngineP1.dead = False 
harmEngineP1.A = (0.0,0.0,0.35e-3*0.25)
elif O.time > 0.5:
harmEngineP1.A = (0, 0, 0) 
harmEngineP1.f = (0, 0, 0) 

#define engines:
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
# handle sphere+sphere and facet+sphere collisions
   [Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Facet_Sphere_ScGeom6D()],
   [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys()],
   [Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
),
PyRunner(iterPeriod=100,command='change_motion()'),
HarmonicMotionEngine(dead=True,label='harmEngineP1', A=(0.0,0.0,1.5e-5), 
f=(0.0,0.0,60.0), ids=Cylinder1IDs), 
NewtonIntegrator(damping=0.75, exactAsphericalRot=True, 
gravity=(0,0,-9.81)),
#   VTKRecorder(iterPeriod=2000, recorders=['spheres','colors'], 
fileName='./vtu/t3-SS316L_60um.vtu'),
]
## generation particles 
sp = pack.SpherePack()
sp.makeCloud((0,0,0.35e-3), (1.0e-3,1.0e-3,1.2e-3), rMean=40e-6, 
rRelFuzz=40e-6) 
sp.toSimulation(material=SMat)
## time step 
O.dt = 0.85*utils.PWaveTimeStep()
O.usesTimeStepper = False

O.run()

Thanks, 
Xuesong 

-- 
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 #681014]: How to calculate the surface roughness of sphere particle packing?

2019-05-23 Thread gaoxuesong
Question #681014 on Yade changed:
https://answers.launchpad.net/yade/+question/681014

gaoxuesong posted a new comment:
Hi, Jan,

Much thanks. Your method as well as code reallys works. I am very impressed 
by this method. Could you tell me more about it? Like the math behind it.
 
I am a bit confused by the potential of one body.  For the potential 
function outside a body, what does the factor/r really mean? Why the radius is 
set as denominator? 

Thanks, 
Xuesong

-- 
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 #681014]: How to calculate the surface roughness of sphere particle packing?

2019-05-22 Thread gaoxuesong
New question #681014 on Yade:
https://answers.launchpad.net/yade/+question/681014

I have got the sphere particle packing using Yade. I want to get the top 
surface roughness which is the height deviation to an mean value of the 
particle on the surface. The definition is shown in the picture as linked. 
https://drive.google.com/open?id=1HCGiqh0geVdBeBajY0HVi4kW-CUVU7e3

A possible way i can think of is convert the particle packing into a stl 
format file and then obtain the surface (particle packing surface) geometrical 
information by some method. But i don't know how to conduct it. 
   I hope someone can give me some advice. 

Thanks, 
Xuesong  



-- 
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 #680907]: Yade Class not find in a user defined python class

2019-05-20 Thread gaoxuesong
Question #680907 on Yade changed:
https://answers.launchpad.net/yade/+question/680907

Status: Answered => Solved

gaoxuesong confirmed that the question is solved:
It works. 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 #680907]: Yade Class not find in a user defined python class

2019-05-20 Thread gaoxuesong
Question #680907 on Yade changed:
https://answers.launchpad.net/yade/+question/680907

gaoxuesong posted a new comment:
Sorry, Jan. I make it confucius.  I want to write a class for data post-
process. In my defined class, the Sphere class from yade is used. When i
invoke my class from yade terminal, the error comes.

The code in my defined class yadeDatapost is the following, 
import numpy as np 
import os 
class yadeDataPost:
def __init__(self):
pass 

def erase_outbox_sphere(self, box):
for eb in O.bodies:
if isinstance(eb.shape, Sphere):
xi = eb.state.pos[0]
yi = eb.state.pos[1]
zi = eb.state.pos[2]
if (xibox[1] or yibox[3] or 
zibox[5]):
O.bodies.erase(eb.id)
def __str__(self):
return 'this class is execute successfully' 

The code inputting in the yade terminal, 
yade
O.load('./svdir/time-3.5')
import sys 
sys.path.append('/mnt/hgfs/virpc/backup')
from yadedatapost import yadeDataPost 
dp1 = yadeDataPost()
box = [2.5e-3, 3.0e-3, 0e-3, 1.0e-3, 0.9e-3, 1.5e-3] 
dp1.erase_outbox_sphere(box)


The following is the errors, 

In [8]: dp1 = yadeDataPost()
   ...: 
   ...: box = [2.5e-3, 3.0e-3, 0e-3, 1.0e-3, 0.9e-3, 1.5e-3] 
   ...: 
   ...: dp1.erase_outbox_sphere(box)
   ...: 
---
NameError Traceback (most recent call last)
/usr/bin/yade in ()
  3 box = [2.5e-3, 3.0e-3, 0e-3, 1.0e-3, 0.9e-3, 1.5e-3]
  4 
> 5 dp1.erase_outbox_sphere(box)

/mnt/hgfs/virpc/backup/yadedatapost.py in erase_outbox_sphere(self, box)
 21 def erase_outbox_sphere(self, box):
 22 for eb in O.bodies:
---> 23 if isinstance(eb.shape, Sphere):
 24 xi = eb.state.pos[0]
 25 yi = eb.state.pos[1]

NameError: global name 'Sphere' is not defined

Much 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 #680907]: Yade Class not find in a user defined python class

2019-05-17 Thread gaoxuesong
Question #680907 on Yade changed:
https://answers.launchpad.net/yade/+question/680907

gaoxuesong gave more information on the question:
The line i used to create symbolic link is,  
ln -s /usr/bin/yade yadeimport.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 #680907]: Yade Class not find in a user defined python class

2019-05-17 Thread gaoxuesong
New question #680907 on Yade:
https://answers.launchpad.net/yade/+question/680907

I want to write a data-post class for the result from yade. In my class i used 
the Sphere class. But when i invoke my class in yade console, the Sphere class 
is not recognised.  I have looked up the information about Importing Yade in 
other Python applications. It says as following,  
$ cd /path/where/you/want/yadeimport
$ ln -s /path/to/yade/executable/yade-trunk yadeimport.py 
But when i do the second step, the error comes as "operation is not supported". 
Here is my code, 

for my class file named “yadedatapost.py”  
import numpy as np 
import os 
from yadeimport import *

class yadeDataPost:
def __init__(self):
pass 
def erase_outbox_sphere(self):
for eb in O.bodies:
if isinstance(eb.shape, Sphere):
O.bodies.erase(eb.id)


Then i start yade from terminal, input the following code, 
import sys 
sys.path.append('/mnt/hgfs/virpc/backup')
from yadedatapost import yadeDataPost 

dp1 = yadeDataPost()
dp1.erase_outbox_sphere() 

The error comes, No Sphere defined.  I know the critical step of creating a 
symbolic link is missing. 
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 #680662]: Small density sphere in micron size makes segment fault (core dumped)

2019-05-08 Thread gaoxuesong
Question #680662 on Yade changed:
https://answers.launchpad.net/yade/+question/680662

gaoxuesong confirmed that the question is solved:
Thanks Jan Stránský, that solved my question.

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

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


Re: [Yade-users] [Question #680662]: Small density sphere in micron size makes segment fault (core dumped)

2019-05-08 Thread gaoxuesong
Question #680662 on Yade changed:
https://answers.launchpad.net/yade/+question/680662

Status: Answered => Solved

gaoxuesong confirmed that the question is solved:
Thanks. Jan. The adapted code runs well. I think the problem is the
increasing length of O.engines.

-- 
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 #680662]: Small density sphere in micron size makes segment fault (core dumped)

2019-05-06 Thread gaoxuesong
Question #680662 on Yade changed:
https://answers.launchpad.net/yade/+question/680662

gaoxuesong posted a new comment:
Sorry to add the ubuntu and yade version used. 
The ubuntu is Ubuntu 18.04.1 LTS, and the yade is 2018.02b. 
Much 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 #680662]: Small density sphere in micron size makes segment fault (core dumped)

2019-05-06 Thread gaoxuesong
Question #680662 on Yade changed:
https://answers.launchpad.net/yade/+question/680662

gaoxuesong posted a new comment:
Hi, Jan. Yes, you are right. I have tried the above code and no segment fault 
occurred. Then I add some lines which i thought were unimportant in the past 
and the problems happened at about 341300 iteration. As you suggested, i leave 
the snap and VTK code out. Also, to make the crash easy to happen, i amplify 
the density by a small factor as 1e3. 
The following is the code, 

from yade import geom,pack
import math
from yade import qt
import os 

#os.system('rm -rf plt;mkdir ./plt/')
#os.system('rm -rf out;mkdir ./out/')

# PhysicalParameters
muS = 0.57735   # Friction coefficient (30 degree)
muLB = 0.0001   # Friction coefficient
muF = 0.17632   # Friction coefficient (10 degree)
FricAngleS = math.atan(muS)
FricAngleLB = math.atan(muLB)
FricAngleF = math.atan(muF)

### mass amplification factor ### 
masscof = 1e3   


# PhysicalParameters
matSph = CohFrictMat(
 density = 7990*masscof,
 young = 193e9,
 poisson = 0.3,
 frictionAngle = FricAngleS,
 momentRotationLaw = True)
SMat = O.materials.append(matSph)


# create empty sphere packing
sp = pack.SpherePack()
# generate spheres1 with a certain diameter distribution
sp.makeCloud((0,0,0.35e-3), (1.0e-3,1.0e-3,1.4e-3), 
psdSizes=[0.012e-3,0.0186e-3,0.0312e-3,0.0484e-3,0.053e-3], 
psdCumm=[0,0.1,0.5,0.9,1.0])
# add the sphere pack to the simulation
sp.toSimulation(material=SMat)

# create rectangular box1(Left) from facets
O.bodies.append(geom.facetBox((0.5e-3,0.5e-3,0.5e-3),(0.5e-3,0.5e-3,0.5e-3), 
wallMask=31, material=SMat))
Cylinder1IDs=O.bodies.append(geom.facetBox((0.5e-3,0.5e-3,0.15e-3),(0.5e-3,0.5e-3,0.2e-3),
 wallMask=63, color=(0,1,0), wire=False, material=SMat))

## add these lines, problem happens #
## add these lines, problem happens #

def changeValues():

#  Standstill for stabilization
   if O.time < 0.2:
   O.engines = O.engines + [
   TranslationEngine(dead=False, translationAxis= [0,0,1], 
velocity=0.0, ids=Cylinder1IDs)
   ]
   #  Vibrate Piston1
   elif 0.2 <= O.time < 0.4:
   O.engines = O.engines + [
   HarmonicMotionEngine(A=(0.0,0.0,1.5e-5), f=(0.0,0.0,3600/60.0), 
ids=Cylinder1IDs)
   ]
#  Vibrate Stop
   elif 0.4 <= O.time < 0.5129:
   O.engines = O.engines + [
   HarmonicMotionEngine(A=(0.0,0.0,0.0), f=(0.0,0.0,0.0), 
ids=Cylinder1IDs)
   ]
 
   O.dt = 0.85*utils.PWaveTimeStep()

## add these lines, problem happens #
## add these lines, problem happens #


def print_ite():
print("ite is %d" % O.iter)
 
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
# handle sphere+sphere and facet+sphere collisions
   [Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Facet_Sphere_ScGeom6D()],
   [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys()],
   [Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
),
NewtonIntegrator(damping=0.75, exactAsphericalRot=True, 
gravity=(0,0,-9.81)),
 PyRunner(iterPeriod=100,command='changeValues()'),
PyRunner(iterPeriod=100,command='print_ite()'),
#qt.SnapshotEngine(fileBase="./plt/",iterPeriod=200,label='snapshot'),
#   VTKRecorder(iterPeriod=200, recorders=['spheres','colors'], 
fileName='./out/'),
]

#show geometry:
qtr = qt.Renderer()
qtr.bgColor = [1,1,1]
qt.Controller()
v = qt.View() 
#v.center() 
v.axes=False
v.viewDir=Vector3(0,1,0)
v.eyePosition=Vector3(1.8e-3,-5.2e-3,1.0e-3)

O.run()

-- 
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 #677084]: manipulate the spheres during running

2018-12-27 Thread gaoxuesong
Question #677084 on Yade changed:
https://answers.launchpad.net/yade/+question/677084

Status: Answered => Open

gaoxuesong is still having a problem:
Hi. The thing i want is with the yade-batch mode, when i finish 5000 iters, i 
want to reload some previous state which has been saved before. So the 
procedure should be like this, 
create a new thread, invoke a new function, and execute the O.load() demand.

def newThread():
if O.time > 3.6:
import thread
thread.start_new_thread(newRun,())

def newRun():
O.pause();O.wait()
O.load('./svdir/t3-3.5')

I find this method is ok in usual mode of yade, but failed in batch
mode.

-- 
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 #677084]: manipulate the spheres during running

2018-12-27 Thread gaoxuesong
Question #677084 on Yade changed:
https://answers.launchpad.net/yade/+question/677084

gaoxuesong gave more information on the question:
I have just found that just put the functional code into a function
runned by pyRunner, it works well in yade-batch mode. So my question
becomes that if it is not allowed to create  a new thread to load yade
saved state in batch mode?

-- 
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 #677084]: manipulate the spheres during running

2018-12-27 Thread gaoxuesong
New question #677084 on Yade:
https://answers.launchpad.net/yade/+question/677084

I want to get the information of some specific spheres during the calculation 
when it meets some condition, like the time larger than some point. i have used 
two run mode of yade, one is just normal mode, the other is batch mode. 

The flowchart of my code is that, 

### to invode getDemandbody to get what i want 
def getDandBody():

# input a box 
vboxMin = (2.1,0.1,0.72)
vboxMax = (2.9,0.9,0.98)
vPorosity = utils.voxelPorosity(resolution=400, start=vboxMin, 
end=vboxMax)

# use the box the select the spheres and erase outside spheres 
for eb in O.bodies:
if not isinstance(eb.shape, Sphere):
continue 
if not (vboxMin[0]<= eb.state.pos[0]<= vboxMax[0] and vboxMin[1]<= 
eb.state.pos[1] <= vboxMax[1] and vboxMin[2] <= 
eb.state.pos[2] <= vboxMax[2]):
O.bodies.erase(eb.id)

# output the information 
   with open('rel.txt', 'w') as fd:
fd.write('%e %e\n' % (sthrd, lthrd))
fd.write('%.4f, %d, %d, %.2f\n' % (1-vPorosity, snum, inum, 
inum*1.0/snum))   
   O.pause()

#define the new thread to load saved file 
def newThread():
if O.time > 3.6:   
import thread 
thread.start_new_thread(newRun,())

def newRun(): 
O.pause();O.wait()

### import saved state 
O.load('./svdir/t3-3.5')

### new engines and new run
   ### the function of getDemandBody is what i need to run to get sphere 
information 
O.engines = [
PyRunner(iterPeriod=1,command='getDemandBody()'),
]
O.run(1)

### the save file function 
def svfun():
some expressions 
 

#define engines:
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
# handle sphere+sphere and facet+sphere collisions
   [Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Facet_Sphere_ScGeom6D()],
   [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys()],
   [Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
),
   PyRunner(iterPeriod=100,command='svfun()'),
   PyRunner(iterPeriod=100,command='newThread()'),
   NewtonIntegrator(damping=0.75, exactAsphericalRot=True, 
gravity=(0,0,-9810*gcof)),

]

O.run() 

### script finished #

I have two problems,
1. when i use the normal mode, like the command, yade  myscript.py, it works. I 
can get the information of the selected spheres. But i want to ask, using a new 
thread is a must? In fact, i don't want to load saved file, just the current 
state is also ok.
2. when i use the yade-batch mode, it doesn't work. There is no output file. So 
i doubt there is a problem when create a new thread in batch mode.  

So any suggestions? 

Thanks, 
Xuesong 


-- 
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 #675797]: gridnode interaction with sphere cannot display the grid

2018-10-30 Thread gaoxuesong
New question #675797 on Yade:
https://answers.launchpad.net/yade/+question/675797

I have learned examples in the folder of trunk/examples/grids/ on github. The 
example of "CohesiveGridConnectionSphere" deal with a line of girds interacting 
with a sphere. The example of Simple_Grid_Falling deals with a free falling 
grid plane. I want to simulate a 
scene where a moving mesh plane hits a sphere then the mesh plane deforms at 
the interaction spot and the the sphere gets momentum to move.   
So i combine the codes from the examples above. But when i run it, i can not 
see the mesh in the views, only the sphere(qt. View). Here is the code, 


from yade import qt, plot, geom  
from yade.gridpfacet import *
import numpy as np 
from pprint import pprint 

### materials definition###
O.materials.append(CohFrictMat(young=8e5,poisson=0.3,density=4e3,frictionAngle=radians(30),normalCohesion=4e4,shearCohesion=1e5,momentRotationLaw=False,label='spheremat'))

### engines 
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_GridConnection_Aabb(),]),
InteractionLoop(
[Ig2_GridNode_GridNode_GridNodeGeom6D(), 
Ig2_Sphere_GridConnection_ScGridCoGeom()],#, Ig2_Facet_Sphere_ScGeom6D()],

[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False)],
[Law2_ScGeom6D_CohFrictPhys_CohesionMoment(), 
Law2_ScGridCoGeom_CohFrictPhys_CundallStrack()]
),
NewtonIntegrator(gravity=(0,0,0),damping=0.3,label='newton'),
PyRunner(command='main()',iterPeriod=100),
#PyRunner(iterPeriod=500, command='history()')
#PyRunner(iterPeriod=1,command='changeValues()'),
]

### Parameters of a square grid ###
zl = 0.1 #z [m]
yl = 0.1#y  [m]
nzl = 10#number of nodes for the length [#]
nyl = 10#number of nodes for the width  [#]
rssp = 2e-3
rscl = 2e-3   
color=[255./255.,102./255.,0./255.]
bblen = yl/(nyl-1)

nodesIds=[]
#Create all nodes first :
for i in np.linspace(0, yl, nyl):
for j in np.linspace(0, zl, nzl):
nodesIds.append(O.bodies.append(gridNode([0,i,j], rssp, 
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<=bblen*1.01):
O.bodies.append(gridConnection(i, j, rscl, color=color, 
material='spheremat'))


### the sphere ### 
spx, spy, spz = 20e-3, 50e-3, 10e-3
rsp = 10e-3 
idsp=O.bodies.append(sphere([spx,spy,spz], rsp, wire=False, fixed=False, 
material='spheremat'))

### the top edge of the grid node, set a veloicty, make the mesh move ### 
mknodeids = [] 
for each in nodesIds:
ez = O.bodies[each].state.pos[2]
if ez > zl-0.5*bblen:
mknodeids.append(each)
   
def main():
for each in mknodeids:
O.bodies[each].dynamic = False  
O.bodies[each].state.vel[0] = 1.0   


qt.Controller() 
qt.View()

O.dt=1e-05
O.run()


I find that if i remove the Ig2_Sphere_GridConnection_ScGridCoGeom(),  i can 
see the mesh in the view but it will go through the sphere if it is set a 
velocity,  that means there is no interaction between sphere and the mesh. I 
know the  Ig2_Sphere_GridConnection_ScGridCoGeom() is used to deal with 
interaction between the sphere and the cylinder. But why the example of 
"CohesiveGridConnectionSphere" succeed, the only difference is that my mesh is 
a 2d mesh. 

Then my question is that:
1. How can i adapt my code to realise my intention. 

2.  In fact, i want to simulate a deformable wiper sweeping particles. If the 
particle is too large, the wiper will deform to go over it. Does the gird 
module in yade works? 

Thanks a lot.
 
Xuesong Gao 

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