Re: [Yade-users] [Question #701637]: Why are some particles white

2022-05-03 Thread Zhicheng Gao
Question #701637 on Yade changed:
https://answers.launchpad.net/yade/+question/701637

Status: Answered => Solved

Zhicheng Gao confirmed that the question is solved:
Dear Jan,
Thank you for your quick reply. According to the answers  and the links you 
provided, I found my mistake, Yade uses normalized RGB.
Thank you again for your enthusiasm and patience in answering such a simple 
question.
Best wishes
Zhicheng

-- 
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 #701637]: Why are some particles white

2022-05-03 Thread Zhicheng Gao
Question #701637 on Yade changed:
https://answers.launchpad.net/yade/+question/701637

Status: Needs information => Open

Zhicheng Gao gave more information on the question:
I generated a sample and carried out the loading experiment, and then used some 
methods to identify the force chain particles to get array force_chain. Then I 
call the above function to delete the particles other than the force chain 
particles, and set different colors for each force chain, excluding white, but 
finally many particles are displayed in white. 
Because the force chain has branches, but the branches are not considered, the 
same particles may belong to different force chains. In this way, the color of 
the particles will be assigned twice. Is this the reason why the particles are 
white?

-- 
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 #701637]: Why are some particles white

2022-05-02 Thread Zhicheng Gao
New question #701637 on Yade:
https://answers.launchpad.net/yade/+question/701637

I wrote a program to identify the force chain particles. In order to display 
each force chain, I deleted the non force chain particles and set the color for 
each force chain, but there is no white. However, as a result, many particles 
appear white.
This is my display program:

def force_chain_display(force_chain,neighbors):
""" Remove particles other than force chains, so the force chain is 
displayed
use the index in array force_chain to find the id of force chain 
particles in neighbors,
then delete the irrelevant particles
"""

## Only force chain particles are displayed
fc_particle_index_list = force_chain.flatten().tolist()
fc_particle_index_list = list(set(fc_particle_index_list))
fc_particle_index_list.remove(-1)
fc_particle_id_list = []
for index in fc_particle_index_list:
fc_particle_id_list.append(neighbors[index,0])
for b in O.bodies:
if isinstance(b.shape,Sphere):
if b.id not in fc_particle_id_list:
O.bodies.erase(b.id)

## Make the particles of the same force chain the same color
fcn = force_chain.shape[0]
valueToBeRemoved = -1
## Create RGB color array
RGB_array = 
np.array([[47,79,79],[105,105,105],[112,128,144],[0,0,128],[100,149,237],[72,61,139],[0,191,255],[0,100,0],[85,107,47],[255,255,0],[205,92,92],[139,69,19],[255,0,0],[255,20,147],[160,32,240],[255,165,0],
[205,133,63],[244,164,96],[192,255,62]])
for i in range(fcn):
single_force_chain_index_list = list(force_chain[i,:])
single_force_chain_index_list = [value for value in 
single_force_chain_index_list if value != valueToBeRemoved]
ran = random.randint(0,18)
print(ran)
for particle_index in single_force_chain_index_list:
pid = neighbors[particle_index,0]
O.bodies[pid].shape.color = 
(RGB_array[ran,0],RGB_array[ran,1],RGB_array[ran,2])

-- 
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 #701313]: multithreading problem

2022-04-12 Thread Zhicheng Gao
Question #701313 on Yade changed:
https://answers.launchpad.net/yade/+question/701313

Status: Answered => Open

Zhicheng Gao is still having a problem:
Hi Robert,
Thank you for your reply. 
When I reload the file, I remove the FolwEngine from the O.engine list before 
running the simulation, and the simulation can run but with the above warning, 
does this affect the correctness of the simulation?

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

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


[Yade-users] [Question #701313]: multithreading problem

2022-04-12 Thread Zhicheng Gao
New question #701313 on Yade:
https://answers.launchpad.net/yade/+question/701313

Hello everyone,
I use Yade's DEM-PFV method to simulate the erosion process, using 
multi-threaded calculation, and constantly delete some eroded particles in this 
process. Save the state file when the erosion lasts for a certain time, and 
then I study these States by reloading these state files and conducting a 
triaxial compression experiment.  However, the  following warning appears:

WARN  /build/yade-fDuCoe/yade-2018.02b/pkg/common/InsertionSortCollider.cpp:76 
insertionSortParallel: Parallel insertion: only 6 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.

However, this warning appears even when using less than 6 threads or just one 
thread as suggested by this warning. How to solve this problem, will this 
affect the correctness of the simulation results?

-- 
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 #700030]: When using the Hertz contact model, the consolidation can not be achieved

2021-12-28 Thread Zhicheng Gao
New question #700030 on Yade:
https://answers.launchpad.net/yade/+question/700030

When using the Hertz contact model, the consolidation can not be achieved, and 
the length of each side of the area is quite different, becoming a cuboid.

The  main code is as follows:

num_spheres=3000
confiningPressure=-5
 ## material parameters
 compFricDegree=30#contact friction during the confining phase
 finalFricDegree=30#contact friction during the deviatoric loading
 young=7e10
 poisson=.3
 density=2650
 en=0.2,
 eta=0,
 krot=0,
## control parameters
damp=0.3,
stabilityThreshold=.001,
 ## output specifications
 filename='suffusion',
 unknowOk=True
mn,mx=Vector3(0,0,0),Vector3(0.01,0.01,0.01)
psdSizes=[0.00042,0.0005,0.00208,0.0024]
psdCumm=[0.0,0.25,0.25,1.0]

# create materials for spheres
#shear strength is the sum of friction and adhesion, so the 
momentRotationLaw=True
O.materials.append(FrictMat(young=young,poisson=poisson,frictionAngle=radians(compFricDegree),density=density,label='spheres'))
O.materials.append(FrictMat(young=young,poisson=poisson,frictionAngle=0,density=0,label='walls'))
walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)
# generate particles packing
sp=pack.SpherePack()
sp.makeCloud(mn,mx,psdSizes=psdSizes,psdCumm=psdCumm,distributeMass=True,num=num_spheres,seed=1)
sp.toSimulation(material='spheres')

## the krot is determined by kr=ks*ar*R1*R2,ar=1.25
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_MindlinPhys(en=en,es=en,eta=eta,krot=krot)],
[Law2_ScGeom_MindlinPhys_Mindlin(includeMoment=True)],
),

#GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
TriaxialStressController(label='triax',
# specify target values and whether they are strains or stresses

goal1=confiningPressure,goal2=confiningPressure,goal3=confiningPressure, 
stressMask=7,
# type of servo-control, external walls compaction
internalCompaction=False,
thickness=0,
),
NewtonIntegrator(damping=0.3)
]

After trying the above code but not working, in order to speed up the 
consolidation, I increased the damping to 0.7, and reduced the particle 
velocity to zero every two thousand steps, as shown below:

def reset_sphere_velocity():
for b in O.bodies:
if (isinstance(b.shape,Sphere)):
b.state.vel=(0,0,0)
O.engines=O.engines+[PyRunner(command='reset_sphere_velocity()',iterPeriod=2000)]

After the above attempts, it still cannot be consolidated as quickly as a 
linear model and the overall shape cannot be approximately maintained as a cube.
Is there any way to solve it, thank you very much!

-- 
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 #699705]: Empirical value of rolling stiffness (Krot)

2021-12-12 Thread Zhicheng Gao
Question #699705 on Yade changed:
https://answers.launchpad.net/yade/+question/699705

Status: Open => Solved

Zhicheng Gao confirmed that the question is solved:
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 #699705]: Empirical value of rolling stiffness (Krot)

2021-12-12 Thread Zhicheng Gao
Question #699705 on Yade changed:
https://answers.launchpad.net/yade/+question/699705

Status: Answered => Open

Zhicheng Gao is still having a problem:
Dear Duriez and Brzezinski, I assign CohFrictMat and FrictMat to walls and 
balls, separately, and 
 use Ig2_Sphere_Sphere_ScGeom(), Ig2_Box_Sphere_ScGeom6D(), 
Law2_ScGeom6D_CohFrictPhys_CohesionMoment(), Law2_ScGeom_MindlinPhys_Mindlin() 
to distinguish ball-to-ball contact and ball-to-wall contact. Is this 
appropriate?

-- 
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 #699705]: Empirical value of rolling stiffness (Krot)

2021-12-06 Thread Zhicheng Gao
Question #699705 on Yade changed:
https://answers.launchpad.net/yade/+question/699705

Zhicheng Gao posted a new comment:
Thanks Duriez and Brzezinski!

-- 
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 #699705]: Empirical value of rolling stiffness (Krot)

2021-12-06 Thread Zhicheng Gao
Question #699705 on Yade changed:
https://answers.launchpad.net/yade/+question/699705

Zhicheng Gao posted a new comment:
Thanks Duriez and Brzezinski!

-- 
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 #699705]: Empirical value of rolling stiffness (Krot)

2021-12-03 Thread Zhicheng Gao
Question #699705 on Yade changed:
https://answers.launchpad.net/yade/+question/699705

Status: Answered => Open

Zhicheng Gao is still having a problem:
Dear Duriez
I want to use Hertz-Mindlin contact law, the sphere is rough with rolling 
resistance, and the wall is smooth without friction. 

In Yade,  the Ip2_FrictMat_FrictMat_MindlinPhys[1] use the Hertz-Mindlin
contact law, and the LawFunctor is Law2_ScGeom_MindlinPhys_Mindlin[2].
How should I assign different FrictMat instances to spheres or walls?

In the FrictMat[3], there are no rolling resistance and rolling
stiffness parameters. Only in the Ip2_FrictMat_FrictMat_MindlinPhys the
parameters 'eta' and 'krot' are used to set the rolling resistance and
rolling stiffness.

https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Ip2_FrictMat_FrictMat_MindlinPhys
https://yade-dem.org/doc/yade.wrapper.html?highlight=includemoment#yade.wrapper.Law2_ScGeom_MindlinPhys_Mindlin
https://yade-dem.org/doc/yade.wrapper.html?highlight=frictmat#yade.wrapper.FrictMat

-- 
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 #699705]: Empirical value of rolling stiffness (Krot)

2021-12-02 Thread Zhicheng Gao
Question #699705 on Yade changed:
https://answers.launchpad.net/yade/+question/699705

Status: Answered => Open

Zhicheng Gao is still having a problem:
Then how to distinguish between ball-to-ball contact and ball-to-wall
contact

-- 
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 #699705]: Empirical value of rolling stiffness (Krot)

2021-12-02 Thread Zhicheng Gao
Question #699705 on Yade changed:
https://answers.launchpad.net/yade/+question/699705

Zhicheng Gao posted a new comment:
Another problem is how to distinguish between ball-to-ball contact and
ball-to-wall contact, the material of balls and walls are all both
FrictMat. And, for the Hertz-Mindlin contact law, only the
Ip2_FrictMat_FrictMat_MindlinPhys of IPhysFunctor and
Law2_ScGeom_MindlinPhys_Mindlin of LawFunctor can be used, ie

InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom6D()],

[Ip2_FrictMat_FrictMat_MindlinPhys(en=en,eta=eta,krot=krot),Ip2_FrictMat_FrictMat_MindlinPhys(en=en)],
[Law2_ScGeom_MindlinPhys_Mindlin()],

So how to distinguish between ball-ball contact and ball-wall contact,
so that the contact between the wall and the ball is set to be
frictionless and anti-rotational.

-- 
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 #699705]: Empirical value of rolling stiffness (Krot)

2021-12-01 Thread Zhicheng Gao
Question #699705 on Yade changed:
https://answers.launchpad.net/yade/+question/699705

Status: Answered => Open

Zhicheng Gao is still having a problem:
Dear Karol,

I have read the papers you recommended. In my opinion, the second paper
analyzes the parameters of the  Ip2_CohFrictMat_CohFrictMat_CohFrictPhys
where the rolling stiffness is determined by ks*αr *R1*R2, so we specify
the rolling stiffness by setting the dimensionless rolling stiffness
'alphaKr' which refers to αr.

My question is whether Ip2_FrictMat_FrictMat_MindlinPhys and
Ip2_CohFrictMat_CohFrictMat_CohFrictPhys use the same rolling resistance
model. In Ip2_FrictMat_FrictMat_MindlinPhys, there is no dimensionless
rolling stiffness parameter 'alphaKr' but only rotational stiffness for
moment contact law 'krot'. Is 'krot' equal to ks*αr *R1*R2 ?

Cheers,
Zhicheng

-- 
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 #699705]: Empirical value of rolling stiffness (Krot)

2021-12-01 Thread Zhicheng Gao
New question #699705 on Yade:
https://answers.launchpad.net/yade/+question/699705

Since Ip2_CohFrictMat_CohFrictMat_CohFrictPhys is a linear model, and 
Hertz-Mindlin contact law is a non-linear model that is often used, so I choose 
to use Ip2_FrictMat_FrictMat_MindlinPhys. 
However, in many documents, only the value of the rolling friction coefficient 
is given, and the value of the rolling stiffness is not given. In the  
Ip2_FrictMat_FrictMat_MindlinPhys, the rolling friction coefficient is given by 
eta, and the rolling stiffness is given by Krot, so what is the appropriate 
setting for the rolling stiffness? Is there any related literature?

-- 
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 #699589]: i.geom.normal is not normalized (unit) vector from the branch vector (for the case of sphere-sphere contact)

2021-11-22 Thread Zhicheng Gao
Question #699589 on Yade changed:
https://answers.launchpad.net/yade/+question/699589

Status: Answered => Solved

Zhicheng Gao confirmed that the question is solved:
Jan, thank you very much for your help and quick reply!

-- 
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 #699589]: i.geom.normal is not normalized (unit) vector from the branch vector (for the case of sphere-sphere contact)

2021-11-22 Thread Zhicheng Gao
Question #699589 on Yade changed:
https://answers.launchpad.net/yade/+question/699589

Zhicheng Gao posted a new comment:
For i = O.interactions[A,B],is i.phys.normalForce  the force exerted on
grain A by grain B or grain B by grain A?

-- 
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 #699589]: i.geom.normal is not normalized (unit) vector from the branch vector (for the case of sphere-sphere contact)

2021-11-22 Thread Zhicheng Gao
Question #699589 on Yade changed:
https://answers.launchpad.net/yade/+question/699589

Status: Answered => Open

Zhicheng Gao is still having a problem:
Thanks, Jan
 
>you are printing TOTAL force, not normal force. If i.geom.shearForce is 
>non-zero, then you naturally get non-parallel vector
I have modified it to print("force",i.phys.normalForce)and I found out that it 
was my mistake, body 3 is a wall, not a particle. I checked the other contacts 
and they all met the parallel conditions. The question now is why this 
phenomenon occurs on the wall.
 
Best wishes
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


Re: [Yade-users] [Question #699362]: The uniaxial compression experiment fails to reach the critical state

2021-11-22 Thread Zhicheng Gao
Question #699362 on Yade changed:
https://answers.launchpad.net/yade/+question/699362

Zhicheng Gao posted a new comment:
Dear Jerome,
I used Yade on the recommendation of my tutor, and compared with PFC, Yade can 
perform parallel calculation and the calculation speed should be faster, so I 
asked if there was something wrong with my code.
Thank you1

-- 
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 #699589]: i.geom.normal is not normalized (unit) vector from the branch vector (for the case of sphere-sphere contact)

2021-11-22 Thread Zhicheng Gao
New question #699589 on Yade:
https://answers.launchpad.net/yade/+question/699589

I want to calculate the mechanical anisotropy, the branch vector is needed. 
However, I find the contact normal obtained by i.geom.normal is not normalized 
(unit) vector from the branch vector (for the case of sphere-sphere contact), 
The specific process is as follows:
(1) load saved file by "O.load('compactedStatesuffusion25.yade.gz')" ;
(2) find all the interactions of particle 12 by "for i in O.bodies[12].intrs(): 
print (i.isReal,i.id1,i.id2)" and the result is as follows:
(True, 3, 12)
(True, 12, 97)
(True, 12, 211)
(True, 427, 12)
(True, 12, 1033)
(True, 1171, 12)
(True, 1196, 12)
(True, 12, 2736)
(True, 2777, 12)
(True, 12, 3222)
(True, 3453, 12)
(True, 4202, 12)
(True, 12, 7845)
(True, 12, 8119)
(True, 8496, 12)
(True, 10817, 12)
(True, 11570, 12)
(True, 12, 13485)
(True, 12, 15013)
(True, 12, 19529)
(True, 12, 21199)
(True, 12, 22291)
(True, 12, 22449)
(True, 12, 22803)
(True, 12, 23442)
(True, 12, 24412)
(True, 25196, 12)
(True, 12, 29244)
(True, 12, 30387)
(True, 12, 34784)
(True, 12, 35280)
(True, 36427, 12)
(True, 37206, 12)
(True, 12, 40297)
(True, 41898, 12)
(True, 12, 42413)
(True, 12, 44052)
(True, 12, 45495)
(True, 45948, 12)
(True, 12, 47578)
(True, 12, 48322)
(True, 12, 49112)
(True, 12, 49738)
(True, 49923, 12);
(3) then print the branch vector, contact normal vector and contact normal 
force vector  of O.interactions[3,12] by the follow code:
i = O.interactions[3,12]
b1,b2 = [O.bodies[j] for j in (i.id1,i.id2)]
print("branch12",b2.state.pos - b1.state.pos)
print("branch21",b1.state.pos - b2.state.pos)
print("normal",i.geom.normal)
print("force",i.phys.normalForce + i.phys.shearForce)
print("force1",O.forces.f(i.id1))
print("force2",O.forces.f(i.id2))

the result is as follows:

('branch12', 
Vector3(0.005264805042519041,-0.0011961713201094834,-0.0024246928681093648))
('branch21', 
Vector3(-0.005264805042519041,0.0011961713201094834,0.0024246928681093648))
('normal', Vector3(-0,-1,-0))
('force', Vector3(0,-0.6724835758663493,-0))
('force1', Vector3(0,28.188489135826057,0))
('force2', 
Vector3(-0.0003050240398732389,0.5915155744011741,0.9299475981276988))

It can be seen that the branch vector, contact normal vector and contact normal 
force vector are not in the same direction. Why is this?
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 #699362]: The uniaxial compression experiment fails to reach the critical state

2021-11-22 Thread Zhicheng Gao
Question #699362 on Yade changed:
https://answers.launchpad.net/yade/+question/699362

Status: Answered => Open

Zhicheng Gao is still having a problem:
Dear Jan,
 the code of isotropic compression is  as follows:
##__ First section, generate sample_

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

nRead=readParamsFromTable(
## model parameters
num_spheres=5,
targetPorosity= .32,
confiningPressure=-5,
## material parameters
compFricDegree=30,#contact friction during the confining phase
finalFricDegree=30,#contact friction during the deviatoric loading
young=2e8,
poisson=.2,
density=2650,
alphaKr=7.5,
alphaKtw=0,
competaRoll=.1,
finaletaRoll=.1,
etaTwist=0,
normalCohesion=0,
shearCohesion=0,
## fluid parameters
fluidDensity=1000,
dynamicViscosity=.001,
## control parameters
damp=0,
stabilityThreshold=.001,
## output specifications
filename='suffusion',
unknowOk=True
)

from yade.params.table import *

mn,mx=Vector3(0,0,0),Vector3(0.04,0.04,0.04)
psdSizes=[0.00042,0.0005,0.00208,0.0024]
psdCumm=[0.0,0.25,0.25,1.0]
# create materials for spheres
#shear strength is the sum of friction and adhesion, so the 
momentRotationLaw=True
O.materials.append(CohFrictMat(alphaKr=alphaKr,alphaKtw=alphaKtw,density=density,etaRoll=competaRoll,etaTwist=etaTwist,frictionAngle=radians(compFricDegree),momentRotationLaw=True,normalCohesion=normalCohesion,poisson=poisson,shearCohesion=shearCohesion,young=young,label='spheres'))
O.materials.append(FrictMat(young=young,poisson=poisson,frictionAngle=0,density=0,label='walls'))
walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)
# generate particles packing
sp=pack.SpherePack()
sp.makeCloud(mn,mx,psdSizes=psdSizes,psdCumm=psdCumm,distributeMass=True,num=num_spheres,seed=1)
sp.toSimulation(material='spheres')

totalnumber=0
for b in O.bodies:
if (isinstance(b.shape,Sphere)):
totalnumber=totalnumber+1
print(totalnumber)

O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Box_Sphere_ScGeom()],

[Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='contact',setCohesionNow=False,setCohesionOnNewContacts=False)],

[Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True)],
),

#GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
TriaxialStressController(label='triax',
# specify target values and whether they are strains or stresses

goal1=confiningPressure,goal2=confiningPressure,goal3=confiningPressure, 
stressMask=7,
# type of servo-control, external walls compaction
internalCompaction=False,
thickness=0,
),
NewtonIntegrator(damping=0.3)
]

qt.View()

O.dt=0.5*PWaveTimeStep()
import sys

def history():
plot.addData(unbalanced=unbalancedForce(),i=O.iter,exx=-triax.strain[0],
eyy=-triax.strain[1], ezz=-triax.strain[2],

sxx=-triax.stress(triax.wall_right_id)[0],syy=-triax.stress(triax.wall_top_id)[1],szz=-triax.stress(triax.wall_front_id)[2],
ev=-triax.strain[0]-triax.strain[1]-triax.strain[2],
porosity=porosity(),Etot=O.energy.total(),**O.energy# save all 
available energy data
)
O.engines=O.engines+[PyRunner(command='history()',iterPeriod=200)]

while True:
O.run(1000,True)
unb=unbalancedForce()
sxx=triax.stress(triax.wall_left_id)[0]
syy=triax.stress(triax.wall_bottom_id)[1]
szz=triax.stress(triax.wall_back_id)[2]
print('unbalanced force:',unb,sxx,syy,szz)
if unbtargetPorosity:
compFricDegree=0.95*compFricDegree
setContactFriction(radians(compFricDegree))
print('Friction:',compFricDegree,'porosity:',triax.porosity)
sys.stdout.flush()
while True:
O.run(500,True)
unb=unbalancedForce()
if unbmaxX or b.state.pos[0]maxY or b.state.pos[1]maxZ or b.state.pos[2]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 #699362]: The uniaxial compression experiment fails to reach the critical state

2021-11-06 Thread Zhicheng Gao
Question #699362 on Yade changed:
https://answers.launchpad.net/yade/+question/699362

Zhicheng Gao gave more information on the question:
Is it because my loading speed is too fast, but at present, it takes two
days to calculate 40% axial strain, and the CPU is R7-5800H. Is there a
problem with my code? PFC calculation is even faster than this

-- 
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 #699362]: The uniaxial compression experiment fails to reach the critical state

2021-11-06 Thread Zhicheng Gao
Question #699362 on Yade changed:
https://answers.launchpad.net/yade/+question/699362

Zhicheng Gao gave more information on the question:
Hi, Robert

>What is "usually?" Does that mean you are comparing to a common
"triaxial" lab test with flexible membrane? Keep in mind that the walls
are stiff and frictional in your simulation here so you should expect
different behavior.

"Usually" means that many experiments and simulations have reached this
conclusion, and they also use rigid walls. In my simulation the wall is
frictionless.

-- 
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 #699362]: The uniaxial compression experiment fails to reach the critical state

2021-11-06 Thread Zhicheng Gao
Question #699362 on Yade changed:
https://answers.launchpad.net/yade/+question/699362

Status: Answered => Open

Zhicheng Gao is still having a problem:
Hi, Jan
> Usually, the critical state can be reached at 25% of the axial strain.

This conclusion was obtained in many experiments and simulations。

> Because of the combination of packing, material model and loading :-)

Is this result normal?

-- 
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 #699362]: The uniaxial compression experiment fails to reach the critical state

2021-11-05 Thread Zhicheng Gao
New question #699362 on Yade:
https://answers.launchpad.net/yade/+question/699362

After isotropic consolidation, the confining pressure remains unchanged in the 
X and Y directions, and the axial compression in the Z-axis direction is 40%, 
which has not yet reached the critical state. Usually, the critical state can 
be reached at 25% of the axial strain.  Why is this? The procedure is as 
follows:

from __future__ import print_function
from yade import pack, qt, plot
from math import *

nRead=readParamsFromTable(
## model parameters
num_spheres=3,
targetPorosity= .32,
confiningPressure=-5,
## material parameters
compFricDegree=25,#contact friction during the confining phase
finalFricDegree=30,#contact friction during the deviatoric loading
young=2e8,
poisson=.2,
density=2650,
alphaKr=7.5,
alphaKtw=0,
competaRoll=.1,
finaletaRoll=.1,
etaTwist=0,
normalCohesion=0,
shearCohesion=0,
## fluid parameters
fluidDensity=1000,
dynamicViscosity=.001,
## control parameters
damp=0,
stabilityThreshold=.001,
## output specifications
filename='suffusion',
unknowOk=True
)

from yade.params.table import *

O.load('compactedStatesuffusion25.yade.gz')
##__third section, deviatoric 
loading__

triax.width0=aabbDim()[0]
triax.height0=aabbDim()[1]
triax.depth0=aabbDim()[2]

# change control type: keep constant confinement in x,y, 40% compression in z
triax.stressMask=3
triax.goal3=-.1
triax.goal1=confiningPressure
triax.goal2=confiningPressure

# enable energy tracking in the code
O.trackEnergy=True
# define function to record history
def history():
sig_xx=-triax.stress(triax.wall_right_id)[0]
sig_yy=-triax.stress(triax.wall_top_id)[1]
sig_zz=-triax.stress(triax.wall_front_id)[2]
plot.addData(unbalanced=unbalancedForce(),i=O.iter,exx=-triax.strain[0],
eyy=-triax.strain[1], ezz=-triax.strain[2],
sxx=sig_xx,syy=sig_yy,szz=sig_zz,
ev=-triax.strain[0]-triax.strain[1]-triax.strain[2],
dsratio=(-sig_zz+sig_xx)/((-sig_xx-sig_yy-sig_zz)/3.0),
porosity=porosity(),Etot=O.energy.total(),**O.energy# save all 
available energy data
)
O.engines=O.engines+[PyRunner(command='history()',iterPeriod=500)]
t0=O.time
while True:
O.run(1000,True)
print('running',-triax.strain[2])
unb=unbalancedForce()
if unbhttps://ibb.co/Yc7jbbQ

Obviously the volumetric strain is still changing and has not reached the 
critical 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


Re: [Yade-users] [Question #699347]: How to use periodic boundaries for triaxial test simulation after erosion

2021-11-05 Thread Zhicheng Gao
Question #699347 on Yade changed:
https://answers.launchpad.net/yade/+question/699347

Status: Needs information => Solved

Zhicheng Gao confirmed that the question is solved:
> This feature is also what I am researching. In other words, is it best to 
> delete the wall directly and impose periodic boundary conditions?
I am studying the effect of erosion on granular materials.

-- 
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 #699347]: How to use periodic boundaries for triaxial test simulation after erosion

2021-11-04 Thread Zhicheng Gao
Question #699347 on Yade changed:
https://answers.launchpad.net/yade/+question/699347

Status: Answered => Open

Zhicheng Gao is still having a problem:
>The problem is that at the "faces" the particles would not match on opposite 
>faces. It would behave like there would be a crack every cell distance.
(The periodicity would work ok, however)

I know what you mean, that is, the particles up and down in the same
direction will not be embedded in the grooves formed by the particles. I
want to know if this will have a big impact on the results of the three-
axis experiment? After the erosion, the particle distribution is not
uniform and it is anisotropic. Can period boundary be used for the
anisotropic sample?

>I meant to create a new periodic packing from scratch. But instead of creating 
>a random packing, you would need to impose the eroded characteristics.
The challenge is how to identify the "characteristics" and then how to impose 
them on the packing.

This feature is also what I am researching. In other words, is it best
to delete the wall directly and impose periodic boundary conditions?

-- 
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 #699347]: How to use periodic boundaries for triaxial test simulation after erosion

2021-11-04 Thread Zhicheng Gao
Question #699347 on Yade changed:
https://answers.launchpad.net/yade/+question/699347

Status: Answered => Open

Zhicheng Gao is still having a problem:
Dear Jan,
Can you provide more information? Thank you.

-- 
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 #699347]: How to use periodic boundaries for triaxial test simulation after erosion

2021-11-04 Thread Zhicheng Gao
Question #699347 on Yade changed:
https://answers.launchpad.net/yade/+question/699347

Zhicheng Gao posted a new comment:
Dear Jan,
Thank you for your response,  this is my reply and new questions,

> In order to reduce the volume of the representative unit and want to
use periodic boundaries

Yes, I first prepare the sample by isostatic compression in all
directions and then apply a water pressure difference between the upper
and lower interfaces in a certain direction, use PFV to solve it to
simulate the erosion process, and then perform a triaxial test. In order
to be able to perform quantitative analysis, it is necessary to use a
representative unit, but the representative unit with a non-periodic
boundary requires too many particles, so after the erosion, I want to
use the periodic boundary to reduce the number of particles in the
representative unit.

>One option is to create a new periodic sample, preserving characteristics of 
>the original sample. Not straightforward either..
The specific process is to save the position and size information of the 
particles, then read the information of the particles, and generate these 
particles one by one? Is it possible to directly generate the periodic boundary 
and then delete the wall?

-- 
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 #699347]: How to use periodic boundaries for triaxial test simulation after erosion

2021-11-04 Thread Zhicheng Gao
New question #699347 on Yade:
https://answers.launchpad.net/yade/+question/699347

Since the erosion problem is a boundary value problem, a non-periodic boundary 
is used to simulate erosion, and the confining pressure is applied through six 
walls. After erosion, perform a triaxial experiment. In order to reduce the 
volume of the representative unit and want to use periodic boundaries, how to 
realize the conversion from non-periodic boundary to the periodic boundary 
without disturbing the 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


[Yade-users] [Question #698944]: Can Yade be installed on red Hat?

2021-10-03 Thread Zhicheng Gao
New question #698944 on Yade:
https://answers.launchpad.net/yade/+question/698944

I use a high-performance computer cluster with a Red Hat Enterprise Linux 
Server operating system installed.  Can yade be installed on this system? Thank 
you! 

-- 
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 #698592]: When using a FlowEngine, is the confining pressure of the triaxial test an effective stress?

2021-10-03 Thread Zhicheng Gao
Question #698592 on Yade changed:
https://answers.launchpad.net/yade/+question/698592

Status: Answered => Solved

Zhicheng Gao 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 #698605]: The distribution of contact normal direction and contact normal force are not uniform after isotropic consolidation

2021-09-12 Thread Zhicheng Gao
Question #698605 on Yade changed:
https://answers.launchpad.net/yade/+question/698605

Status: Open => Solved

Zhicheng Gao confirmed that the question is solved:
Dear Jan,
I am very grateful for your patient answers, and I am very sorry for not 
responding to you in time. I have taken some exams these days. I will try your 
suggestion.

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


Re: [Yade-users] [Question #698605]: The distribution of contact normal direction and contact normal force are not uniform after isotropic consolidation

2021-09-05 Thread Zhicheng Gao
Question #698605 on Yade changed:
https://answers.launchpad.net/yade/+question/698605

Status: Answered => Open

Zhicheng Gao is still having a problem:
>how do you define "almost the same"?
The difference is not more than 0.5 times the average value, but it can be seen 
from the figure that the maximum value is three times the average value

>since the other semicircle is symmetric, is it worth to change a
"standard" function? what are the results of the original
utils.plotDirections? same? better? worse?

The result of the original  utils.plotDirections of course is the same

>I do not have access, can you provide the formula / method description?
Despite the apparent randomness in variation of contact forces, regular trends 
emerge when normal and tangential components of interparticle forces are 
averaged over groups of contacts with similar orientations.

-- 
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 #698605]: The distribution of contact normal direction and contact normal force are not uniform after isotropic consolidation

2021-09-03 Thread Zhicheng Gao
Question #698605 on Yade changed:
https://answers.launchpad.net/yade/+question/698605

Status: Needs information => Open

Zhicheng Gao gave more information on the question:
Dear Jan,
Thank you for your reply.

>What is your definition of "even distribution" and "uniform"? 
By uniform, I mean that the height of the polar histogram is almost the same.

>any difference from utils.plotDirections? what difference? why?
Since the function utils.plotDirections  can only display the contact 
distribution in a semicircle, I made the contact distribution to be displayed 
in the entire circle by symmetrical processing.

>Why do you count the numbers and use an average force for each bin?
Isn't total force of the bin more meaningful?

I did that to calculate the contact normal force distribution defined by
Rothenburg[1]

[1]https://www.icevirtuallibrary.com/doi/abs/10.1680/geot.1989.39.4.601

Usually, in the literature, the contact direction distribution and contact 
normal force distribution after isostatic consolidation are almost a circle.  
For example, like this picture: 
https://i.loli.net/2021/09/03/pwxedUM7cLyrGPK.jpg. This picture is from the 
article [2]
[2]https://www.sciencedirect.com/science/article/pii/S0266352X2030255X

I want to know if there is a problem in my isostatic consolidation
process, which leads to uneven contact and contact normal force
distribution. Thank you!

Best wishes

-- 
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 #698605]: The distribution of contact normal direction and contact normal force are not uniform after isotropic consolidation

2021-09-02 Thread Zhicheng Gao
New question #698605 on Yade:
https://answers.launchpad.net/yade/+question/698605

After isotropic consolidation, I check the contact normal direction and contact 
normal force distribution which should be evenly distributed in all directions, 
and I found they are not uniform. I don't know what's wrong, can you help me, 
thank you!
1. The  code of isotropic consolidation is as follows:
 ##__ First section, generate sample_

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

nRead=readParamsFromTable(
## model parameters
num_spheres=4,
targetPorosity= .33,
confiningPressure=-5,
## material parameters
compFricDegree=25,#contact friction during the confining phase
finalFricDegree=30,#contact friction during the deviatoric loading
young=2e8,
poisson=.2,
density=2600,
alphaKr=7.5,
alphaKtw=0,
competaRoll=.1,
finaletaRoll=.1,
etaTwist=0,
normalCohesion=0,
shearCohesion=0,
## fluid parameters
fluidDensity=1000,
dynamicViscosity=.001,
## control parameters
damp=0,
stabilityThreshold=.001,
## output specifications
filename='suffusion',
unknowOk=True
)

from yade.params.table import *

mn,mx=Vector3(0,0,0),Vector3(0.03,0.03,0.03)
psdSizes=[0.00042,0.0005,0.00208,0.0024]
psdCumm=[0.0,0.35,0.35,1.0]
# create materials for spheres
#shear strength is the sum of friction and adhesion, so the 
momentRotationLaw=True
O.materials.append(CohFrictMat(alphaKr=alphaKr,alphaKtw=alphaKtw,density=density,etaRoll=competaRoll,etaTwist=etaTwist,frictionAngle=radians(compFricDegree),momentRotationLaw=True,normalCohesion=normalCohesion,poisson=poisson,shearCohesion=shearCohesion,young=young,label='spheres'))
O.materials.append(FrictMat(young=young,poisson=poisson,frictionAngle=0,density=0,label='walls'))
walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)
# generate particles packing
sp=pack.SpherePack()
sp.makeCloud(mn,mx,psdSizes=psdSizes,psdCumm=psdCumm,distributeMass=True,num=num_spheres,seed=1)
sp.toSimulation(material='spheres')

O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Box_Sphere_ScGeom()],

[Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='contact',setCohesionNow=False,setCohesionOnNewContacts=False)],

[Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True)],
),

#GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
TriaxialStressController(label='triax',
# specify target values and whether they are strains or stresses

goal1=confiningPressure,goal2=confiningPressure,goal3=confiningPressure, 
stressMask=7,
# type of servo-control, external walls compaction
internalCompaction=False,
thickness=0,
),
NewtonIntegrator(damping=0)
]

qt.View()

O.dt=0.5*PWaveTimeStep()
import sys

while True:
O.run(1000,True)
unb=unbalancedForce()
print('unbalanced force:',unb,' mean stress: ',triax.meanStress)
if unbtargetPorosity:
compFricDegree=0.95*compFricDegree
setContactFriction(radians(compFricDegree))
print('Friction:',compFricDegree,'porosity:',triax.porosity)
sys.stdout.flush()
while True:
O.run(500,True)
unb=unbalancedForce()
if unbmaxX or b.state.pos[0]maxY or b.state.pos[1]maxZ or b.state.pos[2]0 else 
utils.aabbExtrema())
avg=sum([nums[i]*counts[i] for i in range(len(nums))])/(1.*sum(counts))
pylab.bar(nums,counts,fc=[1,1,0],alpha=.7,align='center')
pylab.xlabel('Interactions per body (avg. %g)'%avg)
pylab.axvline(x=avg,linewidth=3,color='r')
pylab.ylabel('Body count')
if noShow: return pylab.gcf()
else:
pylab.savefig('fig1.jpg')
pylab.ion()
pylab.show()

plotdirections(sphSph=True)

3. The code of contact normal force distribution is as follows:
import pylab,math

O.load('compactedStatesuffusion3.yade.gz')

nBins=20

def contact_normal_force_distribution(nBins=20): 
'''calculate the contact normal force distribution

param nBins: the number of histograms
return:
   * 
''' 
contact_normal_force_XY=[0 for i in range(nBins)]
contact_normal_force_XZ=[0 for i in range(nBins)]
contact_normal_force_YZ=[0 for i in range(nBins)]
contact_nXY=[0 for i in range(nBins)]
contact_nXZ=[0 for i in range(nBins)] 
contact_nYZ=[0 for i in range(nBins)]
# use only sphere-sphere contacts

[Yade-users] [Question #698592]: When using a FlowEngine, is the confining pressure of the triaxial test an effective stress?

2021-09-01 Thread Zhicheng Gao
New question #698592 on Yade:
https://answers.launchpad.net/yade/+question/698592

In the oedometer.py[1], the confining pressure is set by 
triax.goal1=triax.goal2=triax.goal3=-1 and FlowEngine is active. In this 
case, is confining pressure effective stress?
Thank you!


[1]https://gitlab.com/yade-dev/trunk/blob/master/examples/FluidCouplingPFV/oedometer.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 #698377]: How to correct the strain

2021-08-24 Thread Zhicheng Gao
Question #698377 on Yade changed:
https://answers.launchpad.net/yade/+question/698377

Status: Answered => Solved

Zhicheng Gao 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 #698377]: How to correct the strain

2021-08-23 Thread Zhicheng Gao
Question #698377 on Yade changed:
https://answers.launchpad.net/yade/+question/698377

Status: Solved => Open

Zhicheng Gao is still having a problem:
I have tried setting the depth0, width0, and height0 equal to the current size, 
but it takes ten steps for it to take effect. And after reloading the 
previously saved state file, you must run a step to view the strain and stress.
The code is as follows:
O.load('compactedStatesuffusion.yade.gz')
#run 2 steps to check strain, Otherwise, you cannot display strain and stress 
O.run(2,1)
print(triax.strain)
triax.width0=aabbDim()[0]
triax.height0=aabbDim()[1]
triax.depth0=aabbDim()[2]

#Check whether the strain is reset
print(triax.strain)
O.run(2,1)
print(triax.strain)

After reloading the state file or resetting, it needs to run for a
certain time step to see the effect, am I right?

O.run(2,1)
print(triax.strain)

O.run(2,1)
print(triax.strain)

O.run(2,1)
print(triax.strain)

#Reset the strain finally took effect
O.run(2,1)
print(triax.strain)

-- 
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 #698417]: negative volume for an ordinary pore

2021-08-18 Thread Zhicheng Gao
New question #698417 on Yade:
https://answers.launchpad.net/yade/+question/698417

I am doing an erosion simulation similar to Antoine Wautier[1]. The particle 
gradation curve is wide. At the beginning of the simulation, a large number of 
fine particles are deleted. At some time steps, the prompt 'negative volume for 
an ordinary pore' will appear. 
In order to avoid the prompt, I tried to reduce the size of the time step and 
increase the hydraulic gradient step by step. The effect of reducing the time 
step is not as obvious as increasing the hydraulic gradient in stages, and this 
prompt will still appear occasionally. I want to know whether this prompt has a 
big impact on the simulation results and how to avoid the prompt.



https://onlinelibrary.wiley.com/doi/full/10.1002/nag.2866


-- 
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 #698377]: How to correct the strain

2021-08-15 Thread Zhicheng Gao
Question #698377 on Yade changed:
https://answers.launchpad.net/yade/+question/698377

Status: Answered => Solved

Zhicheng Gao confirmed that the question is solved:
Thanks, Robert.  I use the triax.strain,  I will try setting the depth0,
width0, and height0 equal to the current size.

-- 
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 #698377]: How to correct the strain

2021-08-14 Thread Zhicheng Gao
New question #698377 on Yade:
https://answers.launchpad.net/yade/+question/698377

I  use the TriaxialStressController to simulate the triaxial test. The spheres 
are initially compressed isotropic by move walls, and then the deviatoric 
loading begins. I want to calculate the strain starting with deviatoric 
loading, but since the wall moved during the initial isotropic compression 
stage, the strain isn't equal to zero at the beginning of the deviatoric stress 
loading. How do I set the function TriaxialStressController so that the strain 
will be zero at the beginning of the deviatoric loading?
Thank you!

-- 
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 #698247]: The size of the function aabbDim() is not calculated correctly

2021-08-10 Thread Zhicheng Gao
Question #698247 on Yade changed:
https://answers.launchpad.net/yade/+question/698247

Status: Needs information => Open

Zhicheng Gao gave more information on the question:
I think I find the reason why they have a big difference, the time step
is too long and  there are spheres spilling over walls

-- 
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 #698247]: The size of the function aabbDim() is not calculated correctly

2021-08-05 Thread Zhicheng Gao
New question #698247 on Yade:
https://answers.launchpad.net/yade/+question/698247

I use the aabbWalls to generate 6 walls enclosing the packing, the ids of walls 
are 0-5. After isotropic compression, I use aabbDim() to calculate the 
dimensions of the axis-aligned. I find out that they doesn't equal to 
O.bodies[1].state.pos[0]-O.bodies[0].state.pos[0], 
O.bodies[3].state.pos[1]-O.bodies[2].state.pos[1] and 
O.bodies[5].state.pos[2]-O.bodies[4].state.pos[2]. Thus, the result of  
function porosity() isn't right.  Am I right?  Thank you!

-- 
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 #698207]: Which IPhysFunctor should I choose

2021-08-01 Thread Zhicheng Gao
Question #698207 on Yade changed:
https://answers.launchpad.net/yade/+question/698207

Status: Answered => Solved

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

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

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


[Yade-users] [Question #698207]: Which IPhysFunctor should I choose

2021-07-31 Thread Zhicheng Gao
New question #698207 on Yade:
https://answers.launchpad.net/yade/+question/698207

The materials of walls and spheres are FrictMat and CohFricMat respectively, 
for the interactions of sphere and walls, I didn't find a suitable IPhysFunctor 
like Ip2_FrictMat_CohFrictMat_. Which IPhysFunctor should I choose?
Many thanks!

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

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


Re: [Yade-users] [Question #697952]: Once the flow engine is used, the particles run out of the wall

2021-07-12 Thread Zhicheng Gao
Question #697952 on Yade changed:
https://answers.launchpad.net/yade/+question/697952

Status: Answered => Solved

Zhicheng Gao 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 #697952]: Once the flow engine is used, the particles run out of the wall

2021-07-12 Thread Zhicheng Gao
Question #697952 on Yade changed:
https://answers.launchpad.net/yade/+question/697952

Zhicheng Gao gave more information on the question:
@Robert Caulk

Dear Robert Caulk,

Thank you for your kind answer!  
Can I use the engine "GlobalStiffnessTimeStepper" to automatically calculate 
time steps?  What adjustments should be made after modifying the particle size 
distribution?

Best regards,
Zhicheng 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


Re: [Yade-users] [Question #697952]: Once the flow engine is used, the particles run out of the wall

2021-07-12 Thread Zhicheng Gao
Question #697952 on Yade changed:
https://answers.launchpad.net/yade/+question/697952

Zhicheng Gao gave more information on the question:
I use the engine
"GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8)"
to calculate the time step automatically. Generally speaking, this time
step should be very small.

-- 
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 #697952]: Once the flow engine is used, the particles run out of the wall

2021-07-12 Thread Zhicheng Gao
Question #697952 on Yade changed:
https://answers.launchpad.net/yade/+question/697952

Status: Needs information => Open

Zhicheng Gao gave more information on the question:
Dear Robert Caulk,
I just changed the particle size distribution and the size of the box

-- 
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 #697952]: Once the flow engine is used, the particles run out of the wall

2021-07-12 Thread Zhicheng Gao
New question #697952 on Yade:
https://answers.launchpad.net/yade/+question/697952

There was no problem when I just simulated the triaxial test, but when I 
activated the FlowEngine, the particles moved out of the wall and the error 
Failed to triangulate body with id=104 
Can someone help with this problem? Thank you for your attention to this matter!
This is my code:

#-*- coding: utf-8 -*-
##__ First section, generate sample_

from __future__ import print_function
from yade import pack, qt, plot
from math import *
from builtins import range

nRead=readParamsFromTable(
## model parameters
num_spheres=100,
targetPorosity= .425,
confiningPressure=-10,
## material parameters
compFricDegree=15,#contact friction during the confining phase
finalFricDegree=30,#contact friction during the deviatoric loading
young=2e8,
poisson=.2,
density=2600,
alphaKr=7.5,
alphaKtw=0,
competaRoll=.22,
finaletaRoll=.22,
etaTwist=0,
normalCohesion=0,
shearCohesion=0,
## fluid parameters
fluidDensity=1000,
dynamicViscosity=.001,
## control parameters
damp=0,
stabilityThreshold=.001,
## output specifications
filename='suffusion',
unknowOk=True
)

from yade.params.table import *

mn,mx=Vector3(0,0,0),Vector3(0.008,0.008,0.008)

# create materials for spheres
#shear strength is the sum of friction and adhesion, so the 
momentRotationLaw=True
O.materials.append(CohFrictMat(alphaKr=alphaKr,alphaKtw=alphaKtw,density=density,etaRoll=competaRoll,etaTwist=etaTwist,frictionAngle=radians(compFricDegree),momentRotationLaw=True,normalCohesion=normalCohesion,poisson=poisson,shearCohesion=shearCohesion,young=young,label='spheres'))
O.materials.append(FrictMat(young=10*young,poisson=poisson,frictionAngle=0,density=0,label='walls'))
walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)

# generate particles packing
sp=pack.SpherePack()
sp.makeCloud(mn,mx,psdSizes=[0.8,0.000125,0.0001592,0.0002003,0.0003153,0.000399,0.000502,0.0005743],psdCumm=[0.0,0.00628,0.0565,0.198,0.721,0.915,0.991,1.0],num=num_spheres,seed=1)
sp.toSimulation(material='spheres')

#check the number of bodies
number_generate_body=len(O.bodies)
for i in range(number_generate_body):
if not O.bodies[i]:
number_generate_body=number_generate_body-1

O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Box_Sphere_ScGeom()],

[Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='contact',setCohesionNow=False,setCohesionOnNewContacts=False)],

[Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True)],
),
FlowEngine(dead=1,label="flow"),#introduced as a dead engine for the 
moment, see 2nd section

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
TriaxialStressController(label='triax',
# specify target values and whether they are strains or stresses

goal1=confiningPressure,goal2=confiningPressure,goal3=confiningPressure, 
stressMask=7,
# type of servo-control, external walls compaction
internalCompaction=False,
thickness=0,
),
NewtonIntegrator(damping=0)
]
qt.View()
import sys
while True:
O.run(1000,True)
unb=unbalancedForce()
print('unbalanced force:',unb,' mean stress: ',triax.meanStress)
if unbhttps://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 #697642]: Many errors with PeriodicFlowEngine

2021-07-07 Thread Zhicheng Gao
Question #697642 on Yade changed:
https://answers.launchpad.net/yade/+question/697642

Status: Answered => Open

Zhicheng Gao is still having a problem:
@Bruno Chareyre
Dear Chareyre,
Thank you for your quick reply! I tried to modify my code, but it failed. I 
don't know what's wrong with it.  I was wondering if you can help me. And I 
modified the particle size distribution in the FluidCouplingPFV[1] example, 
then I got the error 'Failed to triangulate body with id=47 Point=-1976.72 
1535.93 -26.6935 rad=0.03'. How to eliminate this problem?
Again, I would like to express my most sincere gratitude for the great support!
https://gitlab.com/yade-dev/trunk/blob/master/examples/FluidCouplingPFV/oedometer.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 #697642]: Many errors with PeriodicFlowEngine

2021-07-02 Thread Zhicheng Gao
Question #697642 on Yade changed:
https://answers.launchpad.net/yade/+question/697642

Status: Needs information => Open

Zhicheng Gao gave more information on the question:
Dear Chareyre,
The index of the older engine is 3, so I confirm the older engine is replaced 
by 
O.engines=O.engines[0:3]+[PeriodicFlowEngine(dead=1,label='flow2')]+O.engines[4:]
I delete partilces in the code:
for i in range(10,90):
O.bodies.erase(i)
According to your prompt, I run my code without deleting particles and the 
following error appears:
CHOLMOD warning: matrix not positive definite. file: 
../Supernodal/t_cholmod_super_numeric.c line: 911
something went wrong in Cholesky factorization, use LDLt as fallback this time1
The code is :
##__ First section, generate sample_

from __future__ import print_function
from yade import pack, qt, plot
from math import *

nRead=readParamsFromTable(
## model parameters
num_spheres=100,
targetPorosity= .4,
confiningPressure=-10,
## material parameters
compFricDegree=15,#contact friction during the confining phase
finalFricDegree=30,#contact friction during the deviatoric loading
young=2e8,
poisson=.2,
density=2600,
alphaKr=7.5,
alphaKtw=0,
 competaRoll=.22,
finaletaRoll=.22,
etaTwist=0,
normalCohesion=0,
shearCohesion=0,
## fluid parameters
fluidDensity=1000,
dynamicViscosity=.001,
## control parameters
damp=0,
stabilityThreshold=.001,
## output specifications
filename='suffusion',
unknowOk=True
)

from yade.params.table import *

O.periodic=True
O.cell.hSize=Matrix3(1,0,0, 0,1,0, 0,0,1)
# create materials for spheres
#shear strength is the sum of friction and adhesion, so the 
momentRotationLaw=True
O.materials.append(CohFrictMat(alphaKr=alphaKr,alphaKtw=alphaKtw,density=density,etaRoll=competaRoll,etaTwist=etaTwist,frictionAngle=radians(compFricDegree),momentRotationLaw=True,normalCohesion=normalCohesion,poisson=poisson,shearCohesion=shearCohesion,young=young,label='spheres'))

# generate particles packing
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(1,1,1),-1,0.,num_spheres,False, 0.95,seed=1)
sp.toSimulation(material='spheres')

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

[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='contact',setCohesionNow=False,setCohesionOnNewContacts=False)],

[Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True)],
 ),
PeriodicFlowEngine(dead=1,label="flow"),#introduced as a dead engine 
for the moment, see 2nd section

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
PeriTriaxController(label='triax',
# specify target values and whether they are strains or stresses
goal=(confiningPressure,confiningPressure,confiningPressure), 
stressMask=7,
# type of servo-control, the strain rate isn't determined, it 
shloud check the unbalanced force
dynCell=True,maxStrainRate=(10,10,10),
# wait until the unbalanced force goes below this value
maxUnbalanced=stabilityThreshold,relStressTol=1e-3,
doneHook='compactionFinished()'
),
NewtonIntegrator(damping=0)
]

import sys
def compactionFinished():
# after sample preparation, save the state
O.save('compactedState'+filename+'.yade.gz')
print('Compacted state saved', 'porosity', porosity())
# next time, called python command
triax.doneHook=''
O.pause()
O.run()
O.wait()

#B. Activate flow engine
flow.dead=0
flow.defTolerance=-1
flow.meshUpdateInterval=1
flow.useSolver=0
flow.permeabilityFactor=1
flow.viscosity=10
flow.gradP=Vector3(0,1,0)
flow.duplicateThreshold=0.3
flow.updateTriangulation=True
O.run(1000,1)
csdList=flow.getConstrictionsFull()
print(len(O.bodies),len(csdList),'finished')

-- 
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 #697642]: Many errors with PeriodicFlowEngine

2021-07-02 Thread Zhicheng Gao
Question #697642 on Yade changed:
https://answers.launchpad.net/yade/+question/697642

Status: Solved => Open

Zhicheng Gao is still having a problem:
Dear Chareyre,
I modified the code in Section B in the way you suggested, but the same error 
still occurred. Thank you for your attention to this matter, I am honored and 
grateful for your support and eagerly look forward to your thoughts
This is the revised code in section B:
#B. Activate flow engine
flow.dead=0
flow.defTolerance=-1
flow.meshUpdateInterval=-1
flow.useSolver=0
flow.permeabilityFactor=1
flow.viscosity=10
flow.gradP=Vector3(0,1,0)
flow.duplicateThreshold=0.3
flow.updateTriangulation=True
O.run(2,1)
csdList=flow.getConstrictionsFull()
print(len(O.bodies),len(csdList),'finished')
flow.dead=1
print(O.bodies[10].shape.radius)
for i in range(10,90):
O.bodies.erase(i)
print(len(O.bodies))
O.engines=O.engines[0:3]+[PeriodicFlowEngine(dead=1,label='flow2')]+O.engines[4:]
O.run(1000,True)
flow2.dead=0
flow2.defTolerance=-1
flow2.meshUpdateInterval=-1
flow2.useSolver=0
flow2.permeabilityFactor=1
flow2.viscosity=10
flow2.gradP=Vector3(0,1,0)
flow2.duplicateThreshold=0.3
flow2.updateTriangulation=True

O.run(2,1)
csdList1=flow2.getConstrictionsFull()
print(len(csdList1))

-- 
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 #697642]: Many errors with PeriodicFlowEngine

2021-07-01 Thread Zhicheng Gao
Question #697642 on Yade changed:
https://answers.launchpad.net/yade/+question/697642

Status: Answered => Solved

Zhicheng Gao 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 #697779]: CHOLMOD warning and Segmentation fault

2021-06-30 Thread Zhicheng Gao
Question #697779 on Yade changed:
https://answers.launchpad.net/yade/+question/697779

Status: Needs information => Open

Zhicheng Gao gave more information on the question:
I'm very sorry, because no one responded, so I raised this question
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


[Yade-users] [Question #697779]: CHOLMOD warning and Segmentation fault

2021-06-29 Thread Zhicheng Gao
New question #697779 on Yade:
https://answers.launchpad.net/yade/+question/697779

Hi,
I use the PeriodicFlowEngine to simulate the erosion, I get such warning:
CHOLMOD warning: matrix not positive definite. file: 
../Supernodal/t_cholmod_super_numeric.c line: 911
something went wrong in Cholesky factorization, use LDLt as fallback this time1
Segmentation fault (core dumped)

I am looking forward to your help ? Thanks a lot !
My code is shown as follow:
##__ First section, generate sample_

from __future__ import print_function
from yade import pack, qt, plot
from math import *

nRead=readParamsFromTable(
## model parameters
num_spheres=100,
targetPorosity= .4,
confiningPressure=-10,
## material parameters
compFricDegree=15,#contact friction during the confining phase
finalFricDegree=30,#contact friction during the deviatoric loading
young=2e8,
poisson=.2,
density=2600,
alphaKr=7.5,
alphaKtw=0,
competaRoll=.22,
finaletaRoll=.22,
etaTwist=0,
normalCohesion=0,
shearCohesion=0,
## fluid parameters
fluidDensity=1000,
dynamicViscosity=.001,
## control parameters
damp=0,
stabilityThreshold=.001,
## output specifications
filename='suffusion',
unknowOk=True
)

from yade.params.table import *

O.periodic=True
O.cell.hSize=Matrix3(1,0,0, 0,1,0, 0,0,1)
# create materials for spheres
#shear strength is the sum of friction and adhesion, so the 
momentRotationLaw=True
O.materials.append(CohFrictMat(alphaKr=alphaKr,alphaKtw=alphaKtw,density=density,etaRoll=competaRoll,etaTwist=etaTwist,frictionAngle=radians(compFricDegree),momentRotationLaw=True,normalCohesion=normalCohesion,poisson=poisson,shearCohesion=shearCohesion,young=young,label='spheres'))

# generate particles packing
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(1,1,1),-1,0.,num_spheres,False, 0.95,seed=1)
sp.toSimulation(material='spheres')

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

[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='contact',setCohesionNow=False,setCohesionOnNewContacts=False)],

[Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True)],
),
PeriodicFlowEngine(dead=1,label="flow"),#introduced as a dead engine 
for the moment, see 2nd section

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
PeriTriaxController(label='triax',
# specify target values and whether they are strains or stresses
goal=(confiningPressure,confiningPressure,confiningPressure), 
stressMask=7,
# type of servo-control, the strain rate isn't determined, it 
shloud check the unbalanced force
dynCell=True,maxStrainRate=(10,10,10),
# wait until the unbalanced force goes below this value
maxUnbalanced=stabilityThreshold,relStressTol=1e-3,
doneHook='compactionFinished()'
),
NewtonIntegrator(damping=0)
]


import sys
def compactionFinished():
# after sample preparation, save the state
O.save('compactedState'+filename+'.yade.gz')
print('Compacted state saved', 'porosity', porosity())
# next time, called python command
triax.doneHook=''
O.pause()
O.run()
O.wait()


#B. Activate flow engine 
flow.dead=0
flow.defTolerance=-1
flow.meshUpdateInterval=-1
flow.useSolver=3
flow.permeabilityFactor=1
flow.viscosity=10
flow.gradP=Vector3(0,1,0)
flow.duplicateThreshold=0.3 
flow.updateTriangulation=True
O.run(2,1)
csdList=flow.getConstrictionsFull()
print(len(O.bodies),len(csdList),'finished')
flow.dead=1
print(O.bodies[10].shape.radius)
for i in range(10,80):
O.bodies.erase(i)
print(len(O.bodies))
O.run(1000,True)
O.engines=O.engines[0:3]+O.engines[4:]
O.step()
O.step()
O.engines=O.engines[0:3]+[PeriodicFlowEngine(dead=0,label="flow")]+O.engines[3:]
flow.defTolerance=-1
flow.meshUpdateInterval=-1
flow.useSolver=3
flow.permeabilityFactor=1
flow.viscosity=10
flow.gradP=Vector3(0,1,0)
flow.duplicateThreshold=0.3
flow.updateTriangulation=True

O.run(2,1)
csdList1=flow.getConstrictionsFull()
print(len(csdList1))


 

-- 
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 #697778]: Failed to triangulate body

2021-06-29 Thread Zhicheng Gao
New question #697778 on Yade:
https://answers.launchpad.net/yade/+question/697778

Hi,
I use the FlowEngine and get some problems. I use the pack module to generate 
particles, when I set the seed=2 or 3, I get such warning:
Failed to triangulate body with id=47 Point=-1976.72 1535.93 -26.6935 rad=0.03
Failed to triangulate body with id=57 Point=1343.75 -3820.83 -831.97 rad=0.03
.
NEGATIVE DETERMINANT
NEGATIVE DETERMINANT
Thank you for your attention to this matter !
May code is shown as follow:
#=

from yade import pack,qt,plot

num_spheres=1000# number of spheres
young=1e6
compFricDegree = 3 # initial contact friction during the confining phase
finalFricDegree = 30 # contact friction during the deviatoric loading
mn,mx=Vector3(0,0,0),Vector3(2,2,6) # corners of the initial packing
flag=1
flag2=0

O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=2600,label='spheres'))
O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls'))
walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)

sp=pack.SpherePack()
sp.makeCloud(mn,mx,rMean=0.3,rRelFuzz=0,num=20,periodic=False,seed=3)
sp.makeCloud(mn,mx,rMean=0.03,rRelFuzz=0,num=1000,periodic=False,seed=3)
sp.toSimulation(material='spheres')

triax=TriaxialStressController(
 thickness = 0,
 stressMask = 7,
 max_vel = 0.005,
 internalCompaction=0, # If true the confining pressure is generated by growing 
particles
# wall_bottom_activated=False
)

newton=NewtonIntegrator(damping=0.2)

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()],label="iloop"
 ),
 FlowEngine(dead=1,label="flow"),#introduced as a dead engine for the moment, 
see 2nd section
 
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
 triax,
 newton,
]

triax.goal1=triax.goal2=triax.goal3=-1

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

setContactFriction(radians(finalFricDegree))

## __ Oedometer section _

triax.stressMask=7
triax.goal1=triax.goal2=triax.goal3=-1

#B. Activate flow engine and set boundary conditions in order to get 
permeability

flow.dead=0
flow.defTolerance=-1
flow.meshUpdateInterval=-1
flow.useSolver=3
flow.permeabilityFactor=1
flow.viscosity=10
flow.bndCondIsPressure=[0,0,0,0,1,1]
flow.bndCondValue=[0,0,0,0,100,0]
flow.boundaryUseMaxMin=[0,0,0,0,0,0]
flow.updateTriangulation=True
#O.dt=0.1e-4
#O.dynDt=False

newton.damping=0
#triax.wall_back_activated=0
O.run(2,1)
csdList=flow.getConstrictionsFull()
print(len(O.bodies),len(csdList),'finished')

flow.dead=1
for i in range(10,900):
O.bodies.erase(i)
O.run(1000,1)

O.engines=O.engines[0:3]+O.engines[4:]

O.step()
O.step()
O.engines=O.engines[0:3]+[FlowEngine(dead=0,label="flow2"),]+O.engines[3:]
flow2.defTolerance = -1
flow2.meshUpdateInterval = -1
flow2.useSolver = 3
flow2.permeabilityFactor = 1
flow2.viscosity = 10
flow2.bndCondIsPressure = [0, 0, 0, 0, 1, 1]
flow2.bndCondValue = [0, 0, 0, 0, 100, 0]
flow2.boundaryUseMaxMin = [0, 0, 0, 0, 0, 0]
flow2.updateTriangulation=True
O.run(2,1)
csdList=flow.getConstrictionsFull()
print(len(O.bodies),len(csdList),'finished')

-- 
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 #697642]: Many errors with PeriodicFlowEngine

2021-06-23 Thread Zhicheng Gao
Question #697642 on Yade changed:
https://answers.launchpad.net/yade/+question/697642

Status: Solved => Open

Zhicheng Gao is still having a problem:
So how to delete the previous FlowEngine?

-- 
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 #697642]: Many errors with PeriodicFlowEngine

2021-06-23 Thread Zhicheng Gao
Question #697642 on Yade changed:
https://answers.launchpad.net/yade/+question/697642

Status: Answered => Solved

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


[Yade-users] [Question #697642]: Many errors with PeriodicFlowEngine

2021-06-21 Thread Zhicheng Gao
New question #697642 on Yade:
https://answers.launchpad.net/yade/+question/697642

After deleting some particles, I encountered a lot of problems in the 
PeriodicFlowEngine. Such as:
(1) GS did not converge in 20k iterations (maybe because the reference pressure 
is 0?);
(2) segmentation fault (core dumped);
(3) Periodicity is broken;
(4) CHOLMOD warning: matrix not positive definite. file: 
../Supernodal/t_cholmod_super_numeric.c line: 911
something went wrong in Cholesky factorization, use LDLt as fallback this time1

For errors (3) and (4),  I have solved it by changing the value of 
PeriodicFlowEngine.duplicateThreshold and the PeriodicFlowEngine.useSolver.

For errors (1) and (2), I spent a lot of time and tried a lot, but I still 
can't solve them. Please help me!

 I have searched for the answers about the PeriodicFlowEngine. I concluded that 
since there is no boundary condition for periodic boundary conditions, the 
PeriodicFlowEngine does not need to set boundary conditions,that is, it does 
not need to set the bndCondIsPressure, bndCondValue, boundaryUseMaxMin. As I 
want to achieve a similar simulation like the paper " A discrete numerical 
model involving partial fluid-solid coupling to describe suffusion effects in 
soils "[1], In short, it is to achieve the fluid flow from top to bottom under 
a certain pressure gradient, and no fluid flows out from the side, and some 
particles are removed during the calculation. So I just need to apply a 
macroscopic pressure gradient by flow.gradP=Vector3(0, i,0), where i is the 
macroscopic pressure gradient. Is that right?
The errors (1) and (2) still exist, this is my simplified code:
##__ First section, generate sample_

from __future__ import print_function
from yade import pack, qt, plot
from math import *

nRead=readParamsFromTable(
## model parameters
num_spheres=100,
targetPorosity= .4,
confiningPressure=-10,
## material parameters
compFricDegree=15,#contact friction during the confining phase
finalFricDegree=30,#contact friction during the deviatoric loading
young=2e8,
poisson=.2,
density=2600,
alphaKr=7.5,
alphaKtw=0,
competaRoll=.22,
finaletaRoll=.22,
etaTwist=0,
normalCohesion=0,
shearCohesion=0,
## fluid parameters
fluidDensity=1000,
dynamicViscosity=.001,
## control parameters
damp=0,
stabilityThreshold=.001,
## output specifications
filename='suffusion',
unknowOk=True
)

from yade.params.table import *

O.periodic=True
O.cell.hSize=Matrix3(1,0,0, 0,1,0, 0,0,1)
# create materials for spheres
#shear strength is the sum of friction and adhesion, so the 
momentRotationLaw=True
O.materials.append(CohFrictMat(alphaKr=alphaKr,alphaKtw=alphaKtw,density=density,etaRoll=competaRoll,etaTwist=etaTwist,frictionAngle=radians(compFricDegree),momentRotationLaw=True,normalCohesion=normalCohesion,poisson=poisson,shearCohesion=shearCohesion,young=young,label='spheres'))

# generate particles packing
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(1,1,1),-1,0.,num_spheres,False, 0.95,seed=1)
sp.toSimulation(material='spheres')

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

[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='contact',setCohesionNow=False,setCohesionOnNewContacts=False)],

[Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True)],
),
PeriodicFlowEngine(dead=1,label="flow"),#introduced as a dead engine 
for the moment, see 2nd section

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
PeriTriaxController(label='triax',
# specify target values and whether they are strains or stresses
goal=(confiningPressure,confiningPressure,confiningPressure), 
stressMask=7,
# type of servo-control, the strain rate isn't determined, it 
shloud check the unbalanced force
dynCell=True,maxStrainRate=(10,10,10),
# wait until the unbalanced force goes below this value
maxUnbalanced=stabilityThreshold,relStressTol=1e-3,
doneHook='compactionFinished()'
),
NewtonIntegrator(damping=0)
]


import sys
def compactionFinished():
# after sample preparation, save the state
O.save('compactedState'+filename+'.yade.gz')
print('Compacted state saved', 'porosity', porosity())
# next time, called python command
triax.doneHook=''
O.pause()
O.run()
O.wait()


#B. Activate flow engine 
flow.dead=0
flow.defTolerance=-1
flow.meshUpdateInterval=-1
flow.useSolver=0
flow.permeabilityFactor=1
flow.viscosity=10
flow.gradP=Vector3(0,1,0)
flow.duplicateThreshold=0.3 
flow.updateTriangulation=True

Re: [Yade-users] [Question #697524]: When I run my code, MatplotlibDeprecationWarning appears

2021-06-21 Thread Zhicheng Gao
Question #697524 on Yade changed:
https://answers.launchpad.net/yade/+question/697524

Status: Answered => Solved

Zhicheng Gao confirmed that the question is solved:
Thank you, Jérôme Duriez ,  the  version used is yade-2021-06-08.git-
4852d56

-- 
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 #697433]: Instantiating a new FlowEngine after removing does not work

2021-06-20 Thread Zhicheng Gao
Question #697433 on Yade changed:
https://answers.launchpad.net/yade/+question/697433

Status: Open => Solved

Zhicheng Gao 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 #697526]: CHOLMOD warning: matrix not positive definite

2021-06-20 Thread Zhicheng Gao
Question #697526 on Yade changed:
https://answers.launchpad.net/yade/+question/697526

Zhicheng Gao posted a new comment:
Hi,
I have searched for the answers about the PeriodicFlowEngine. I concluded that 
since there is no boundary condition for periodic boundary conditions, the 
PeriodicFlowEngine does not need to set boundary conditions,that is,  it does 
not need to set the bndCondIsPressure, bndCondValue, boundaryUseMaxMin.   As I 
want to achieve a similar simulation like the paper  " A discrete numerical 
model involving partial fluid-solid coupling to describe suffusion effects in 
soils "[1], In short, it is to achieve the fluid flow from top to bottom under 
a certain pressure gradient, and no fluid flows out from the side. So I just 
need to apply a macroscopic pressure gradient by flow.gradP=Vector3(0, i,0), 
where i is the macroscopic pressure gradient. Is that right?
Thank you for any help!
[1]https://www.sciencedirect.com/science/article/pii/S0266352X17303087

-- 
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 #697260]: are the vertices of the cell the center of the sphere

2021-06-20 Thread Zhicheng Gao
Question #697260 on Yade changed:
https://answers.launchpad.net/yade/+question/697260

Zhicheng Gao 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 #697526]: CHOLMOD warning: matrix not positive definite

2021-06-17 Thread Zhicheng Gao
Question #697526 on Yade changed:
https://answers.launchpad.net/yade/+question/697526

Zhicheng Gao gave more information on the question:
The paper[1] link is
https://www.sciencedirect.com/science/article/pii/S0266352X17303087

-- 
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 #697526]: CHOLMOD warning: matrix not positive definite

2021-06-17 Thread Zhicheng Gao
Question #697526 on Yade changed:
https://answers.launchpad.net/yade/+question/697526

Status: Answered => Open

Zhicheng Gao is still having a problem:
Hello, Bruno. Thank you very much for your reply.  I'm doing research similar 
to the paper " A discrete numerical model involving partial fluid-solid 
coupling to describe suffusion effects in soils "[1].  In this paper, the 
periodic boundary condition is chosen and it says "In order to avoid any 
boundary effect we use periodic boundary conditions as if the same grain 
arrangement and the same flow field were replicated periodically in space", so 
I constructed scene in periodic boundary conditions and used the 
PeriodicFlowEngine to simulate flow. Is that right?
I want to make the fluid flow from top to bottom under a certain pressure 
gradient, and no fluid flows out from the side. So I set 
flow.bndCondIsPressure=[0,0,1,1,0,0], flow.bndCondValue=[0,0,1,0,0,0]. If my 
approach is wrong, then how should I set up to achieve what I want?
And how to switch solver to LDlt?

-- 
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 #697526]: CHOLMOD warning: matrix not positive definite

2021-06-15 Thread Zhicheng Gao
Question #697526 on Yade changed:
https://answers.launchpad.net/yade/+question/697526

Zhicheng Gao posted a new comment:
Can anyone provide some help, thank you very much!

-- 
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 #697526]: CHOLMOD warning: matrix not positive definite

2021-06-14 Thread Zhicheng Gao
New question #697526 on Yade:
https://answers.launchpad.net/yade/+question/697526

Hello,
I reinstalled Yade from the source code,the version is 
yade-2021-06-08.git-4852d56, and the version of Ubuntu is 18.04. I tried to 
delete the particles. There is no problem with the FlowEngine, but the 
PeriodicFlowEngine will give the following warning.
CHOLMOD warning: matrix not positive definite. file: 
../Supernodal/t_cholmod_super_numeric.c line: 911
something went wrong in Cholesky factorization, use LDLt as fallback this time1
Does it matter to the simulation? Here is my code:
##__ First section, generate sample_

from __future__ import print_function
from yade import pack, qt, plot
from math import *

nRead=readParamsFromTable(
## model parameters
num_spheres=1000,
targetPorosity= .4,
confiningPressure=-10,
## material parameters
compFricDegree=15,#contact friction during the confining phase
finalFricDegree=30,#contact friction during the deviatoric loading
young=2e8,
poisson=.2,
density=2600,
alphaKr=7.5,
alphaKtw=0,
competaRoll=.22,
finaletaRoll=.22,
etaTwist=0,
normalCohesion=0,
shearCohesion=0,
## fluid parameters
fluidDensity=1000,
dynamicViscosity=.001,
## control parameters
damp=0,
stabilityThreshold=.001,
## output specifications
filename='suffusion',
unknowOk=True
)

from yade.params.table import *

O.periodic=True
O.cell.hSize=Matrix3(1,0,0, 0,1,0, 0,0,1)
# create materials for spheres
#shear strength is the sum of friction and adhesion, so the 
momentRotationLaw=True
O.materials.append(CohFrictMat(alphaKr=alphaKr,alphaKtw=alphaKtw,density=density,etaRoll=competaRoll,etaTwist=etaTwist,frictionAngle=radians(compFricDegree),momentRotationLaw=True,normalCohesion=normalCohesion,poisson=poisson,shearCohesion=shearCohesion,young=young,label='spheres'))

# generate particles packing
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(1,1,1),-1,0.,num_spheres,False, 0.95,seed=1)
sp.toSimulation(material='spheres')

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

[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='contact',setCohesionNow=False,setCohesionOnNewContacts=False)],

[Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True)],
 ),
PeriodicFlowEngine(dead=1,label="flow"),#introduced as a dead engine 
for the moment, see 2nd section

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
PeriTriaxController(label='triax',
# specify target values and whether they are strains or stresses
goal=(confiningPressure,confiningPressure,confiningPressure), 
stressMask=7,
# type of servo-control, the strain rate isn't determined, it 
shloud check the unbalanced force
dynCell=True,maxStrainRate=(10,10,10),
# wait until the unbalanced force goes below this value
maxUnbalanced=stabilityThreshold,relStressTol=1e-3,
doneHook='compactionFinished()'
),
NewtonIntegrator(damping=0)
]

import sys
def compactionFinished():
 # after sample preparation, save the state
O.save('compactedState'+filename+'.yade.gz')
print('Compacted state saved', 'porosity', porosity())
# next time, called python command
triax.doneHook=''
O.pause()
O.run()
O.wait()

#B. Activate flow engine and set boundary conditions in order to get 
permeability
flow.dead=0
flow.defTolerance=-1
flow.meshUpdateInterval=-1
flow.useSolver=3
flow.permeabilityFactor=1
flow.viscosity=10
flow.bndCondIsPressure=[0,0,1,1,0,0]
flow.bndCondValue=[0,0,1,0,0,0]
flow.boundaryUseMaxMin=[0,0,0,0,0,0]

O.run(1,1)
csdList=flow.getConstrictionsFull()
print(len(O.bodies),len(csdList),'finished')
flow.dead=1
print(O.bodies[10].shape.radius)

for i in range(10,50):
O.bodies.erase(i)
print(len(O.bodies))
O.run(1000,True)

flow.dead=0
flow.updateTriangulation=True

O.run(1,1)
csdList1=flow.getConstrictionsFull()
print(len(csdList1))

-- 
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 #697524]: When I run my code, MatplotlibDeprecationWarning appears

2021-06-14 Thread Zhicheng Gao
New question #697524 on Yade:
https://answers.launchpad.net/yade/+question/697524

 When I run my code, the following warning appears:
/usr/lib/python3/dist-packages/matplotlib/__init__.py:831: 
MatplotlibDeprecationWarning: axes.color_cycle is deprecated and replaced with 
axes.prop_cycle; please use the latter.
  mplDeprecation)
/usr/lib/python3/dist-packages/matplotlib/__init__.py:801: 
MatplotlibDeprecationWarning: axes.color_cycle is deprecated and replaced with 
axes.prop_cycle; please use the latter.
  mplDeprecation)
Why does this happen?
Here is my code:
##__ First section, generate sample_

from __future__ import print_function
from yade import pack, qt, plot
from math import *

nRead=readParamsFromTable(
## model parameters
num_spheres=100,
targetPorosity= .387,
confiningPressure=-10,
## material parameters
compFricDegree=15,#contact friction during the confining phase
finalFricDegree=30,#contact friction during the deviatoric loading
young=2e8,
poisson=.2,
density=2600,
alphaKr=7.5,
alphaKtw=0,
competaRoll=.22,
finaletaRoll=.22,
etaTwist=0,
normalCohesion=0,
shearCohesion=0,
## fluid parameters
fluidDensity=1000,
dynamicViscosity=.001,
## control parameters
damp=0,
stabilityThreshold=.001,
## output specifications
filename='suffusion',
unknowOk=True
)

from yade.params.table import *

O.periodic=True
O.cell.hSize=Matrix3(.001,0,0, 0,.001,0, 0,0,.001)
# create materials for spheres
#shear strength is the sum of friction and adhesion, so the 
momentRotationLaw=True
O.materials.append(CohFrictMat(alphaKr=alphaKr,alphaKtw=alphaKtw,density=density,etaRoll=competaRoll,etaTwist=etaTwist,frictionAngle=radians(compFricDegree),momentRotationLaw=True,normalCohesion=normalCohesion,poisson=poisson,shearCohesion=shearCohesion,young=young,label='spheres'))

# generate particles packing
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(.001,.001,.001),psdSizes=[0.8,0.000125,0.0001592,0.0002003,0.0003153,0.000399,0.000502,0.0005743],psdCumm=[0.0,0.00628,0.0565,0.198,0.721,0.915,0.991,1.0],num=num_spheres,seed=1)
sp.toSimulation(material='spheres')

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

[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='contact',setCohesionNow=False,setCohesionOnNewContacts=False)],

[Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True)],
 ),
PeriodicFlowEngine(dead=1,label="flow"),#introduced as a dead engine 
for the moment, see 2nd section

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
PeriTriaxController(label='triax',
# specify target values and whether they are strains or stresses
goal=(confiningPressure,confiningPressure,confiningPressure), 
stressMask=7,
# type of servo-control, the strain rate isn't determined, it 
shloud check the unbalanced force
dynCell=True,maxStrainRate=(10,10,10),
# wait until the unbalanced force goes below this value
maxUnbalanced=stabilityThreshold,relStressTol=1e-3,
doneHook='compactionFinished()'
),
NewtonIntegrator(damping=0)
]
qt.View()
# enable energy tracking in the code
O.trackEnergy=True

# define function to record history
def history():
plot.addData(unbalanced=unbalancedForce(),i=O.iter,exx=-triax.strain[0],
eyy=-triax.strain[1], ezz=-triax.strain[2],
sxx=-triax.stress[0],syy=-triax.stress[1],szz=-triax.stress[2],
ev=-triax.strain[0]-triax.strain[1]-triax.strain[2],
porosity=porosity(),Etot=O.energy.total(),**O.energy# save all 
available energy data
)
O.engines=O.engines+[PyRunner(command='history()', iterPeriod=20)]
# define what to plot
plot.plots={'i':('unbalanced','porosity'),'i ':('sxx','syy','szz'),' 
i':('exx','eyy','ezz'),' i ':('Etot')}
plot.live=True
plot.setLiveForceAlwaysUpdate(True)
# show the plot
plot.plot()

import sys
def compactionFinished():
#check the current porosity
# if the current porosity is lager than target Porosity and comFricDegree 
is lager than 10,
# then we decrease friction value and apply it to all the bodies and 
contacts,
# else we decrease rolling friction value.
global compFricDegree, competaRoll
if porosity()>targetPorosity and compFricDegree>5:
# we decrease friction value and apply it to all the bodies and contacts
compFricDegree=0.95*compFricDegree
setContactFriction(radians(compFricDegree))
print('Friction:', compFricDegree,'porosity:', porosity())
# python syntax, make each step printout

Re: [Yade-users] [Question #697523]: When adding O.wait(), the graphical interface is black

2021-06-14 Thread Zhicheng Gao
Question #697523 on Yade changed:
https://answers.launchpad.net/yade/+question/697523

Status: Answered => Solved

Zhicheng Gao confirmed that the question is solved:
Thanks, Jan. I just want to make a video about the process by capturing
screen output. According to your answer, I will change my way and use
the VTKRecorder for visualization.

-- 
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 #697523]: When adding O.wait(), the graphical interface is black

2021-06-14 Thread Zhicheng Gao
New question #697523 on Yade:
https://answers.launchpad.net/yade/+question/697523

I set a target porosity as a stop criterion and used O.run() to run simulation. 
In order to avoid the influence of the later Python code, I added O.wait(). 
However, after adding this command, the graphical interface will be black until 
it reaches the stop criterion. Is there any way to make the graphical interface 
display graphics.
Another question, when I run my code, the following warning appears:
/usr/lib/python3/dist-packages/matplotlib/__init__.py:831: 
MatplotlibDeprecationWarning: axes.color_cycle is deprecated and replaced with 
axes.prop_cycle; please use the latter.
  mplDeprecation)
/usr/lib/python3/dist-packages/matplotlib/__init__.py:801: 
MatplotlibDeprecationWarning: axes.color_cycle is deprecated and replaced with 
axes.prop_cycle; please use the latter.
  mplDeprecation)
Why does this happen?
Here is my code:
##__ First section, generate sample_

from __future__ import print_function
from yade import pack, qt, plot
from math import *

nRead=readParamsFromTable(
## model parameters
num_spheres=100,
targetPorosity= .387,
confiningPressure=-10,
## material parameters
compFricDegree=15,#contact friction during the confining phase
finalFricDegree=30,#contact friction during the deviatoric loading
young=2e8,
poisson=.2,
density=2600,
alphaKr=7.5,
alphaKtw=0,
competaRoll=.22,
finaletaRoll=.22,
etaTwist=0,
normalCohesion=0,
shearCohesion=0,
## fluid parameters
fluidDensity=1000,
dynamicViscosity=.001,
## control parameters
damp=0,
stabilityThreshold=.001,
## output specifications
filename='suffusion',
unknowOk=True
)

from yade.params.table import *

O.periodic=True
O.cell.hSize=Matrix3(.001,0,0, 0,.001,0, 0,0,.001)
# create materials for spheres
#shear strength is the sum of friction and adhesion, so the 
momentRotationLaw=True
O.materials.append(CohFrictMat(alphaKr=alphaKr,alphaKtw=alphaKtw,density=density,etaRoll=competaRoll,etaTwist=etaTwist,frictionAngle=radians(compFricDegree),momentRotationLaw=True,normalCohesion=normalCohesion,poisson=poisson,shearCohesion=shearCohesion,young=young,label='spheres'))

# generate particles packing
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(.001,.001,.001),psdSizes=[0.8,0.000125,0.0001592,0.0002003,0.0003153,0.000399,0.000502,0.0005743],psdCumm=[0.0,0.00628,0.0565,0.198,0.721,0.915,0.991,1.0],num=num_spheres,seed=1)
sp.toSimulation(material='spheres')

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

[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='contact',setCohesionNow=False,setCohesionOnNewContacts=False)],

[Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True)],
),
PeriodicFlowEngine(dead=1,label="flow"),#introduced as a dead engine 
for the moment, see 2nd section

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
PeriTriaxController(label='triax',
# specify target values and whether they are strains or stresses
goal=(confiningPressure,confiningPressure,confiningPressure), 
stressMask=7,
# type of servo-control, the strain rate isn't determined, it 
shloud check the unbalanced force
dynCell=True,maxStrainRate=(10,10,10),
# wait until the unbalanced force goes below this value
maxUnbalanced=stabilityThreshold,relStressTol=1e-3,
doneHook='compactionFinished()'
),
NewtonIntegrator(damping=0)
]
qt.View()
# enable energy tracking in the code
O.trackEnergy=True

# define function to record history
def history():
plot.addData(unbalanced=unbalancedForce(),i=O.iter,exx=-triax.strain[0],
eyy=-triax.strain[1], ezz=-triax.strain[2],
sxx=-triax.stress[0],syy=-triax.stress[1],szz=-triax.stress[2],
ev=-triax.strain[0]-triax.strain[1]-triax.strain[2],
porosity=porosity(),Etot=O.energy.total(),**O.energy# save all 
available energy data
)
O.engines=O.engines+[PyRunner(command='history()', iterPeriod=20)]
# define what to plot
plot.plots={'i':('unbalanced','porosity'),'i ':('sxx','syy','szz'),' 
i':('exx','eyy','ezz'),' i ':('Etot')}
plot.live=True
plot.setLiveForceAlwaysUpdate(True)
# show the plot
plot.plot()

import sys
def compactionFinished():
#check the current porosity
# if the current porosity is lager than target Porosity and comFricDegree 
is lager than 10,
# then we decrease friction value and apply it to all the bodies and 
contacts,
# else we decrease rolling friction value.
global compFricDegree, 

Re: [Yade-users] [Question #697433]: Instantiating a new FlowEngine after removing does not work

2021-06-14 Thread Zhicheng Gao
Question #697433 on Yade changed:
https://answers.launchpad.net/yade/+question/697433

Status: Solved => Open

Zhicheng Gao is still having a problem:
Dear Robert,
I reinstalled Yade from the source code,the  version is 
yade-2021-06-08.git-4852d56, and the version of Ubuntu is 18.04.I tried to 
delete the particles. There is no problem for the FlowEngine, but the 
PeriodicFlowEngine will give the following warning. 
CHOLMOD warning: matrix not positive definite. file: 
../Supernodal/t_cholmod_super_numeric.c line: 911
something went wrong in Cholesky factorization, use LDLt as fallback this time1
Does it matter to the simulation? Here is my code:
##__ First section, generate sample_

from __future__ import print_function
from yade import pack, qt, plot
from math import *

nRead=readParamsFromTable(
## model parameters
num_spheres=1000,
targetPorosity= .4,
confiningPressure=-10,
## material parameters
compFricDegree=15,#contact friction during the confining phase
finalFricDegree=30,#contact friction during the deviatoric loading
young=2e8,
poisson=.2,
density=2600,
alphaKr=7.5,
alphaKtw=0,
competaRoll=.22,
finaletaRoll=.22,
etaTwist=0,
normalCohesion=0,
shearCohesion=0,
## fluid parameters
fluidDensity=1000,
dynamicViscosity=.001,
## control parameters
damp=0,
stabilityThreshold=.001,
## output specifications
filename='suffusion',
unknowOk=True
)

from yade.params.table import *

O.periodic=True
O.cell.hSize=Matrix3(1,0,0, 0,1,0, 0,0,1)
# create materials for spheres
#shear strength is the sum of friction and adhesion, so the 
momentRotationLaw=True
O.materials.append(CohFrictMat(alphaKr=alphaKr,alphaKtw=alphaKtw,density=density,etaRoll=competaRoll,etaTwist=etaTwist,frictionAngle=radians(compFricDegree),momentRotationLaw=True,normalCohesion=normalCohesion,poisson=poisson,shearCohesion=shearCohesion,young=young,label='spheres'))

# generate particles packing
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(1,1,1),-1,0.,num_spheres,False, 0.95,seed=1)
sp.toSimulation(material='spheres')

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

[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='contact',setCohesionNow=False,setCohesionOnNewContacts=False)],

[Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True)],
),
PeriodicFlowEngine(dead=1,label="flow"),#introduced as a dead engine 
for the moment, see 2nd section

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
PeriTriaxController(label='triax',
# specify target values and whether they are strains or stresses
goal=(confiningPressure,confiningPressure,confiningPressure), 
stressMask=7,
# type of servo-control, the strain rate isn't determined, it 
shloud check the unbalanced force
dynCell=True,maxStrainRate=(10,10,10),
# wait until the unbalanced force goes below this value
maxUnbalanced=stabilityThreshold,relStressTol=1e-3,
doneHook='compactionFinished()'
),
NewtonIntegrator(damping=0)
]


import sys
def compactionFinished():
# after sample preparation, save the state
O.save('compactedState'+filename+'.yade.gz')
print('Compacted state saved', 'porosity', porosity())
# next time, called python command
triax.doneHook=''
O.pause()
O.run()
O.wait()


#B. Activate flow engine and set boundary conditions in order to get 
permeability
flow.dead=0
flow.defTolerance=-1
flow.meshUpdateInterval=-1
flow.useSolver=3
flow.permeabilityFactor=1
flow.viscosity=10
flow.bndCondIsPressure=[0,0,1,1,0,0]
flow.bndCondValue=[0,0,1,0,0,0]
flow.boundaryUseMaxMin=[0,0,0,0,0,0]

O.run(1,1)
csdList=flow.getConstrictionsFull()
print(len(O.bodies),len(csdList),'finished')
flow.dead=1
print(O.bodies[10].shape.radius)

for i in range(10,50):
O.bodies.erase(i)
print(len(O.bodies))
O.run(1000,True)

flow.dead=0
flow.updateTriangulation=True

O.run(1,1)
csdList1=flow.getConstrictionsFull()
print(len(csdList1))

-- 
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 #697433]: Instantiating a new FlowEngine after removing does not work

2021-06-12 Thread Zhicheng Gao
Question #697433 on Yade changed:
https://answers.launchpad.net/yade/+question/697433

Status: Answered => Solved

Zhicheng Gao confirmed that the question is solved:
Thank you. I'll try your advice. It helps me a lot. Thank you very much

-- 
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 #697433]: Instantiating a new FlowEngine after removing does not work

2021-06-10 Thread Zhicheng Gao
Question #697433 on Yade changed:
https://answers.launchpad.net/yade/+question/697433

Status: Answered => Open

Zhicheng Gao is still having a problem:
Dear Robert,

I'm doing erosion experiments, so I need to delete particles many times,
maybe 1 times, maybe more. According to your method, I need to add
1 FlowEngines. Will this cause the problem of insufficient 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 #697433]: Instantiating a new FlowEngine after removing does not work

2021-06-08 Thread Zhicheng Gao
Question #697433 on Yade changed:
https://answers.launchpad.net/yade/+question/697433

Zhicheng Gao gave more information on the question:
Can anyone help? Thank you very much!

-- 
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 #697433]: Instantiating a new FlowEngine after removing does not work

2021-06-07 Thread Zhicheng Gao
Question #697433 on Yade changed:
https://answers.launchpad.net/yade/+question/697433

Status: Answered => Open

Zhicheng Gao is still having a problem:
The links are as follows:
https://answers.launchpad.net/yade/+question/452277
https://answers.launchpad.net/yade/+question/670889

-- 
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 #697432]: Why doesn't the strain equal to zero

2021-06-07 Thread Zhicheng Gao
Question #697432 on Yade changed:
https://answers.launchpad.net/yade/+question/697432

Status: Answered => Solved

Zhicheng Gao 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 #697432]: Why doesn't the strain equal to zero

2021-06-07 Thread Zhicheng Gao
Question #697432 on Yade changed:
https://answers.launchpad.net/yade/+question/697432

Status: Needs information => Open

Zhicheng Gao gave more information on the question:
I'm sorry to provide a lot of useless code, the key code is :
O.cell.trsf=Matrix3.Identity
print(O.cell.trsf, triax.strain)
Then, I found that the deformation matrix is the identity matrix, but the 
triaxial strain is not zero.

-- 
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 #697433]: Instantiating a new FlowEngine after removing does not work

2021-06-06 Thread Zhicheng Gao
New question #697433 on Yade:
https://answers.launchpad.net/yade/+question/697433

Hi,

I'm also trying to remove some particles from the simulation while using 
FlowEngine engine to simulate a fluid flow.  According to Questions #452277 and 
#670889, I used the simple method of instantiating a brand new FlowEngine after 
removing particles, however, segmentation faults still occurred. 

For complex methods, reset functions need to be executed in C + + code. Can you 
give the relevant C + + source code link?  Thanks a lot!


My code is shown as follow:
## __   First section, similar to triax-tutorial/script-session1.py 
 _
from __future__ import print_function

from yade import pack

num_spheres=1000# number of spheres
young=1e6
compFricDegree = 3 # initial contact friction during the confining phase
finalFricDegree = 30 # contact friction during the deviatoric loading
mn,mx=Vector3(0,0,0),Vector3(1,1,1) # corners of the initial packing

O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=2600,label='spheres'))
O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls'))
walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)

sp=pack.SpherePack()
sp.makeCloud(mn,mx,-1,0.,num_spheres,False, 0.95,seed=1) #"seed" make the 
"random" generation always the same
sp.toSimulation(material='spheres')

triax=TriaxialStressController(
maxMultiplier=1.+2e4/young, # spheres growing factor (fast growth)
finalMaxMultiplier=1.+2e3/young, # spheres growing factor (slow growth)
thickness = 0,
stressMask = 7,
max_vel = 0.005,
internalCompaction=True, # If true the confining pressure is generated 
by growing particles
)

newton=NewtonIntegrator(damping=0.2)

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()],label="iloop"
),
FlowEngine(dead=1,label="flow"),#introduced as a dead engine for the 
moment, see 2nd section

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
triax,
newton
]

triax.goal1=triax.goal2=triax.goal3=-1

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

setContactFriction(radians(finalFricDegree))

## __   Oedometer section   _

#B. Activate flow engine and set boundary conditions in order to get 
permeability
flow.dead=0
flow.defTolerance=-1
flow.meshUpdateInterval=-1
flow.useSolver=3
flow.permeabilityFactor=1
flow.viscosity=10
flow.bndCondIsPressure=[0,0,1,1,0,0]
flow.bndCondValue=[0,0,1,0,0,0]
flow.boundaryUseMaxMin=[0,0,0,0,0,0]
O.dt=0.1e-3
O.dynDt=False

O.run(1,1)
csdList=flow.getConstrictionsFull()
print(len(O.bodies),len(csdList),'finished')
flow.dead=1
print(O.bodies[10].shape.radius)
for i in range(10,100):
O.bodies.erase(i)
print(len(O.bodies))
del O.engines[3]
O.engines=O.engines[0:3]+[FlowEngine(dead=0,label="flow"),]+O.engines[4:]
O.run(1000,True)

flow.dead=0
flow.defTolerance=-1
flow.meshUpdateInterval=-1
flow.useSolver=3
flow.permeabilityFactor=1
flow.viscosity=10
flow.bndCondIsPressure=[0,0,1,1,0,0]
flow.bndCondValue=[0,0,1,0,0,0]
flow.boundaryUseMaxMin=[0,0,0,0,0,0]
O.run(1,1)
#flow.updateTriangulation=True #force remeshing to reflect new BC immediately
csdList1=flow.getConstrictionsFull()
print(len(csdList1))

-- 
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 #697432]: Why doesn't the strain equal to zero

2021-06-06 Thread Zhicheng Gao
New question #697432 on Yade:
https://answers.launchpad.net/yade/+question/697432

 I use the O.cell.trsf=Matrix3.Identity to set the current cell configuration 
to be the reference one, but when I use print(O.cell.trsf, triax.strain) to 
print the current strain, the strain matrix is not equal to zero, this is my 
code:

this is my code:
##__ First section, generate sample_

from __future__ import print_function
from yade import pack, qt, plot
from math import *

nRead=readParamsFromTable(
## model parameters
num_spheres=100,
targetPorosity= .387,
confiningPressure=-10,
## material parameters
compFricDegree=15,#contact friction during the confining phase
finalFricDegree=30,#contact friction during the deviatoric loading
young=2e8,
poisson=.2,
density=2600,
alphaKr=7.5,
alphaKtw=0,
 competaRoll=.22,
finaletaRoll=.22,
etaTwist=0,
normalCohesion=0,
shearCohesion=0,
## fluid parameters
fluidDensity=1000,
dynamicViscosity=.001,
## control parameters
damp=0,
stabilityThreshold=.001,
## output specifications
filename='suffusion',
unknowOk=True
)

from yade.params.table import *

O.periodic=True
O.cell.hSize=Matrix3(.001,0,0, 0,.001,0, 0,0,.001)
# create materials for spheres
#shear strength is the sum of friction and adhesion, so the 
momentRotationLaw=True
O.materials.append(CohFrictMat(alphaKr=alphaKr,alphaKtw=alphaKtw,density=density,etaRoll=competaRoll,etaTwist=etaTwist,frictionAngle=radians(compFricDegree),momentRotationLaw=True,normalCohesion=normalCohesion,poisson=poisson,shearCohesion=shearCohesion,young=young,label='spheres'))

# generate particles packing
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(.001,.001,.001),psdSizes=[0.8,0.000125,0.0001592,0.0002003,0.0003153,0.000399,0.000502,0.0005743],psdCumm=[0.0,0.00628,0.0565,0.198,0.721,0.915,0.991,1.0],num=num_spheres,seed=1)
sp.toSimulation(material='spheres')

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

[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='contact',setCohesionNow=False,setCohesionOnNewContacts=False)],

[Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True)],
 ),
PeriodicFlowEngine(dead=1,label="flow"),#introduced as a dead engine 
for the moment, see 2nd section

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
PeriTriaxController(label='triax',
# specify target values and whether they are strains or stresses
goal=(confiningPressure,confiningPressure,confiningPressure), 
stressMask=7,
# type of servo-control, the strain rate isn't determined, it 
shloud check the unbalanced force
dynCell=True,maxStrainRate=(10,10,10),
# wait until the unbalanced force goes below this value
maxUnbalanced=stabilityThreshold,relStressTol=1e-3,
doneHook='compactionFinished()'
),
NewtonIntegrator(damping=0)
]
qt.View()

import sys
def compactionFinished():
#check the current porosity
# if the current porosity is lager than target Porosity and 
comFricDegree is lager than 10,
# then we decrease friction value and apply it to all the bodies and 
contacts,
# else we decrease rolling friction value.
 global compFricDegree, competaRoll
if porosity()>targetPorosity and compFricDegree>5:
# we decrease friction value and apply it to all the bodies and 
contacts
compFricDegree = 0.95*compFricDegree
setContactFriction(radians(compFricDegree))
print('Friction:', compFricDegree,'porosity:', porosity())
# python syntax, make each step printout
sys.stdout.flush()
elif porosity()>targetPorosity:
# we decrease rolling fiction value and apply it to all the bodies 
and contacts
 competaRoll=0.95*competaRoll
for b in O.bodies:
b.mat.etaRoll=competaRoll
for i in O.interactions:
i.phys.etaRoll=competaRoll
print('Rollingfriction:', b.mat.etaRoll, 'porosity:', porosity())
sys.stdout.flush()
else:
 # after sample preparation, save the state
O.save('compactedState'+filename+'.yade.gz')
print('Compacted state saved', 'porosity', porosity())
# next time, called python command
triax.doneHook=''
O.pause()

# enable energy tracking in the code
O.trackEnergy=True

# define function to record history
def history():
plot.addData(unbalanced=unbalancedForce(),i=O.iter,exx=-triax.strain[0],
eyy=-triax.strain[1], 

Re: [Yade-users] [Question #697421]: The problem of plot

2021-06-06 Thread Zhicheng Gao
Question #697421 on Yade changed:
https://answers.launchpad.net/yade/+question/697421

Status: Answered => Solved

Zhicheng Gao confirmed that the question is solved:
Thanks Janek Kozicki, 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 #697421]: The problem of plot

2021-06-06 Thread Zhicheng Gao
Question #697421 on Yade changed:
https://answers.launchpad.net/yade/+question/697421

Zhicheng Gao gave more information on the question:
Dear Janek,
  According to your suggestion, I add plot.setLiveForceAlwaysUpdate(True) to my 
code,  but the following error occurred:
Traceback (most recent call last):
  File "/usr/bin/yade", line 182, in runScript
execfile(script,globals())
  File "plottest.py", line 136, in 
plot.setLiveForceAlwaysUpdate(True)
AttributeError: 'module' object has no attribute 'setLiveForceAlwaysUpdate'

-- 
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 #697421]: The problem of plot

2021-06-06 Thread Zhicheng Gao
Question #697421 on Yade changed:
https://answers.launchpad.net/yade/+question/697421

Status: Answered => Open

Zhicheng Gao is still having a problem:
Thanks, Janek. I still have a problem, I use the
O.cell.trsf=Matrix3.Identity to set the current cell configuration to be
the reference one, but when I use print(O.cell.trsf, triax.strain) to
print the current strain, the strain is not equal to zero.

-- 
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 #697421]: The problem of plot

2021-06-06 Thread Zhicheng Gao
Question #697421 on Yade changed:
https://answers.launchpad.net/yade/+question/697421

Zhicheng Gao gave more information on the question:
this is my code:
##__ First section, generate sample_

from __future__ import print_function
from yade import pack, qt, plot
from math import *

nRead=readParamsFromTable(
## model parameters
num_spheres=100,
targetPorosity= .387,
confiningPressure=-10,
## material parameters
compFricDegree=15,#contact friction during the confining phase
finalFricDegree=30,#contact friction during the deviatoric loading
young=2e8,
poisson=.2,
density=2600,
alphaKr=7.5,
alphaKtw=0,
competaRoll=.22,
finaletaRoll=.22,
etaTwist=0,
normalCohesion=0,
shearCohesion=0,
## fluid parameters
fluidDensity=1000,
dynamicViscosity=.001,
## control parameters
damp=0,
stabilityThreshold=.001,
## output specifications
filename='suffusion',
unknowOk=True
)

from yade.params.table import *

O.periodic=True
O.cell.hSize=Matrix3(.001,0,0, 0,.001,0, 0,0,.001)
# create materials for spheres
#shear strength is the sum of friction and adhesion, so the 
momentRotationLaw=True
O.materials.append(CohFrictMat(alphaKr=alphaKr,alphaKtw=alphaKtw,density=density,etaRoll=competaRoll,etaTwist=etaTwist,frictionAngle=radians(compFricDegree),momentRotationLaw=True,normalCohesion=normalCohesion,poisson=poisson,shearCohesion=shearCohesion,young=young,label='spheres'))

# generate particles packing
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(.001,.001,.001),psdSizes=[0.8,0.000125,0.0001592,0.0002003,0.0003153,0.000399,0.000502,0.0005743],psdCumm=[0.0,0.00628,0.0565,0.198,0.721,0.915,0.991,1.0],num=num_spheres,seed=1)
sp.toSimulation(material='spheres')

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

[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='contact',setCohesionNow=False,setCohesionOnNewContacts=False)],

[Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True)],
),
PeriodicFlowEngine(dead=1,label="flow"),#introduced as a dead engine 
for the moment, see 2nd section

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
PeriTriaxController(label='triax',
# specify target values and whether they are strains or stresses
goal=(confiningPressure,confiningPressure,confiningPressure), 
stressMask=7,
# type of servo-control, the strain rate isn't determined, it 
shloud check the unbalanced force
dynCell=True,maxStrainRate=(10,10,10),
# wait until the unbalanced force goes below this value
maxUnbalanced=stabilityThreshold,relStressTol=1e-3,
doneHook='compactionFinished()'
),
NewtonIntegrator(damping=0)
]
qt.View()

import sys
def compactionFinished():
#check the current porosity
# if the current porosity is lager than target Porosity and 
comFricDegree is lager than 10,
# then we decrease friction value and apply it to all the bodies and 
contacts,
# else we decrease rolling friction value.
global compFricDegree, competaRoll
if  porosity()>targetPorosity and compFricDegree>5:
# we decrease friction value and apply it to all the bodies and 
contacts
compFricDegree = 0.95*compFricDegree
setContactFriction(radians(compFricDegree))
print('Friction:', compFricDegree,'porosity:', porosity())
# python syntax, make each step printout
sys.stdout.flush()
elif porosity()>targetPorosity:
# we decrease rolling fiction value and apply it to all the bodies 
and contacts
competaRoll=0.95*competaRoll
for b in O.bodies:
b.mat.etaRoll=competaRoll
for i in O.interactions:
i.phys.etaRoll=competaRoll
print('Rollingfriction:', b.mat.etaRoll, 'porosity:', porosity())
sys.stdout.flush()
else:
# after sample preparation, save the state
O.save('compactedState'+filename+'.yade.gz')
print('Compacted state saved', 'porosity', porosity())
# next time, called python command
triax.doneHook=''
O.pause()

# enable energy tracking in the code
O.trackEnergy=True

# define function to record history
def history():
plot.addData(unbalanced=unbalancedForce(),i=O.iter,exx=-triax.strain[0],
eyy=-triax.strain[1], ezz=-triax.strain[2],
sxx=-triax.stress[0],syy=-triax.stress[1],szz=-triax.stress[2],
ev=-triax.strai

[Yade-users] [Question #697421]: The problem of plot

2021-06-05 Thread Zhicheng Gao
New question #697421 on Yade:
https://answers.launchpad.net/yade/+question/697421

The first problem is that when I run my code, the following exceptions and 
errors occur:
Unhandled exception in thread started by 
Traceback (most recent call last):
  File "/usr/lib/x86_64-linux-gnu/yade/py/yade/plot.py", line 508, in liveUpdate
ax.relim() # recompute axes limits
  File "/usr/lib/python2.7/dist-packages/matplotlib/axes/_base.py", line 1938, 
in relim
self._update_line_limits(line)
  File "/usr/lib/python2.7/dist-packages/matplotlib/axes/_base.py", line 1801, 
in _update_line_limits
path = line.get_path()
  File "/usr/lib/python2.7/dist-packages/matplotlib/lines.py", line 957, in 
get_path
self.recache()
  File "/usr/lib/python2.7/dist-packages/matplotlib/lines.py", line 667, in 
recache
self._xy = np.column_stack(np.broadcast_arrays(x, y)).astype(float)
  File "/usr/lib/python2.7/dist-packages/numpy/lib/stride_tricks.py", line 249, 
in broadcast_arrays
shape = _broadcast_shape(*args)
  File "/usr/lib/python2.7/dist-packages/numpy/lib/stride_tricks.py", line 184, 
in _broadcast_shape
b = np.broadcast(*args[:32])
ValueError: shape mismatch: objects cannot be broadcast to a single shape

The second problem: I use the plot.resetData() and plot.live= True to clear the 
previous data and update the plot, but it doesn't work, the plot isn't updated.

The last problem is that I use the O.cell.trsf=Matrix3.Identity to set the 
current cell configuration to be the reference one, but when I use 
print(O.cell.trsf, triax.strain) to print the current strain, the strain matrix 
is not the identity matrix.

-- 
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 #697336]: How to close the function doneHook in PeriTriaxController

2021-06-01 Thread Zhicheng Gao
Question #697336 on Yade changed:
https://answers.launchpad.net/yade/+question/697336

Zhicheng Gao gave more information on the question:
Because, in the next step, I want to erode the sample under the
condition of isotropic pressure

-- 
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 #697260]: are the vertices of the cell the center of the sphere

2021-06-01 Thread Zhicheng Gao
Question #697260 on Yade changed:
https://answers.launchpad.net/yade/+question/697260

Status: Answered => Open

Zhicheng Gao is still having a problem:
Dear Robert,
If I want to get the constriction size distribution, whether these same cells 
make an effect?

-- 
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 #697336]: How to close the function doneHook in PeriTriaxController

2021-06-01 Thread Zhicheng Gao
Question #697336 on Yade changed:
https://answers.launchpad.net/yade/+question/697336

Zhicheng Gao posted a new comment:
Dear Robert,
According to your suggestion, I have modified the code, but there is an error
 
 ArgumentError: Python argument types in
None.None(PeriTriaxController, NoneType)
did not match C++ signature:
None(PeriTriaxController {lvalue}, std::__cxx11::basic_string, std::allocator >)
Compacted state saved porosity 0.366658082769

the code is followed:
from __future__ import print_function
from yade import pack, qt, plot
from math import *

nRead=readParamsFromTable(
## model parameters
num_spheres=100,
targetPorosity= .387,
confiningPressure=-10,
## material parameters
compFricDegree=15,#contact friction during the confining phase
finalFricDegree=30,#contact friction during the deviatoric loading
young=2e8,
poisson=.2,
density=2600,
alphaKr=7.5,
alphaKtw=0,
competaRoll=.22,
finaletaRoll=.22,
etaTwist=0,
normalCohesion=0,
shearCohesion=0,
## fluid parameters
fluidDensity=1000,
dynamicViscosity=.001,
## control parameters
damp=0,
stabilityThreshold=.001,
## output specifications
filename='suffusion',
unknowOk=True
)

from yade.params.table import *

O.periodic=True
O.cell.hSize=Matrix3(.001,0,0, 0,.001,0, 0,0,.001)
# create materials for spheres
#shear strength is the sum of friction and adhesion, so the 
momentRotationLaw=True
O.materials.append(CohFrictMat(alphaKr=alphaKr,alphaKtw=alphaKtw,density=density,etaRoll=competaRoll,etaTwist=etaTwist,frictionAngle=radians(compFricDegree),momentRotationLaw=True,normalCohesion=normalCohesion,poisson=poisson,shearCohesion=shearCohesion,young=young,label='spheres'))

# generate particles packing
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(.001,.001,.001),psdSizes=[0.8,0.000125,0.0001592,0.0002003,0.0003153,0.000399,0.000502,0.0005743],psdCumm=[0.0,0.00628,0.0565,0.198,0.721,0.915,0.991,1.0],num=num_spheres)
sp.toSimulation(material='spheres')

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

[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='contact',setCohesionNow=False,setCohesionOnNewContacts=False)],

[Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True)],
),
PeriodicFlowEngine(dead=1,label="flow"),#introduced as a dead engine 
for the moment, see 2nd section

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
PeriTriaxController(label='triax',
# specify target values and whether they are strains or stresses
goal=(confiningPressure,confiningPressure,confiningPressure), 
stressMask=7,
# type of servo-control, the strain rate isn't determined, it 
shloud check the unbalanced force
dynCell=True,maxStrainRate=(10,10,10),
# wait until the unbalanced force goes below this value
maxUnbalanced=stabilityThreshold,relStressTol=1e-3,
doneHook='compactionFinished()'
),
NewtonIntegrator(damping=0)
]
qt.View()
import sys
def compactionFinished():
#check the current porosity
# if the current porosity is lager than target Porosity and 
comFricDegree is lager than 10,
# then we decrease friction value and apply it to all the bodies and 
contacts,
# else we decrease rolling friction value.
global compFricDegree, competaRoll
if  porosity()>targetPorosity and compFricDegree>5:
# we decrease friction value and apply it to all the bodies and 
contacts
compFricDegree = 0.95*compFricDegree
setContactFriction(radians(compFricDegree))
print('Friction:', compFricDegree,'porosity:', porosity())
# python syntax, make each step printout
sys.stdout.flush()
elif porosity()>targetPorosity:
# we decrease rolling fiction value and apply it to all the bodies 
and contacts
competaRoll=0.95*competaRoll
for b in O.bodies:
b.mat.etaRoll=competaRoll
for i in O.interactions:
i.phys.etaRoll=competaRoll
print('Rollingfriction:', b.mat.etaRoll, 'porosity:', porosity())
sys.stdout.flush()
else:
# after sample preparation, save the state
O.save('compactedState'+filename+'.yade.gz')
print('Compacted state saved', 'porosity', porosity())
# next time, called python command
triax.doneHook=None
O.pause()
O.run()

-- 
You received this question notification because your team yade-users is
an a

Re: [Yade-users] [Question #697336]: How to close the function doneHook in PeriTriaxController

2021-06-01 Thread Zhicheng Gao
Question #697336 on Yade changed:
https://answers.launchpad.net/yade/+question/697336

Status: Answered => Open

Zhicheng Gao is still having a problem:
Dear Robert,
According to your suggestion, I have modified the code, but there is an error

 ArgumentError: Python argument types in
None.None(PeriTriaxController, NoneType)
did not match C++ signature:
None(PeriTriaxController {lvalue}, std::__cxx11::basic_string, std::allocator >)
Compacted state saved porosity 0.366658082769

the code is followed:
from __future__ import print_function
from yade import pack, qt, plot
from math import *

nRead=readParamsFromTable(
## model parameters
num_spheres=100,
targetPorosity= .387,
confiningPressure=-10,
## material parameters
compFricDegree=15,#contact friction during the confining phase
finalFricDegree=30,#contact friction during the deviatoric loading
young=2e8,
poisson=.2,
density=2600,
alphaKr=7.5,
alphaKtw=0,
 competaRoll=.22,
finaletaRoll=.22,
etaTwist=0,
normalCohesion=0,
shearCohesion=0,
## fluid parameters
fluidDensity=1000,
dynamicViscosity=.001,
## control parameters
damp=0,
stabilityThreshold=.001,
## output specifications
filename='suffusion',
unknowOk=True
)

from yade.params.table import *

O.periodic=True
O.cell.hSize=Matrix3(.001,0,0, 0,.001,0, 0,0,.001)
# create materials for spheres
#shear strength is the sum of friction and adhesion, so the 
momentRotationLaw=True
O.materials.append(CohFrictMat(alphaKr=alphaKr,alphaKtw=alphaKtw,density=density,etaRoll=competaRoll,etaTwist=etaTwist,frictionAngle=radians(compFricDegree),momentRotationLaw=True,normalCohesion=normalCohesion,poisson=poisson,shearCohesion=shearCohesion,young=young,label='spheres'))

# generate particles packing
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(.001,.001,.001),psdSizes=[0.8,0.000125,0.0001592,0.0002003,0.0003153,0.000399,0.000502,0.0005743],psdCumm=[0.0,0.00628,0.0565,0.198,0.721,0.915,0.991,1.0],num=num_spheres)
sp.toSimulation(material='spheres')

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

[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='contact',setCohesionNow=False,setCohesionOnNewContacts=False)],

[Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True)],
 ),
PeriodicFlowEngine(dead=1,label="flow"),#introduced as a dead engine 
for the moment, see 2nd section

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
PeriTriaxController(label='triax',
# specify target values and whether they are strains or stresses
goal=(confiningPressure,confiningPressure,confiningPressure), 
stressMask=7,
# type of servo-control, the strain rate isn't determined, it 
shloud check the unbalanced force
dynCell=True,maxStrainRate=(10,10,10),
# wait until the unbalanced force goes below this value
maxUnbalanced=stabilityThreshold,relStressTol=1e-3,
doneHook='compactionFinished()'
),
NewtonIntegrator(damping=0)
]
qt.View()
import sys
def compactionFinished():
#check the current porosity
# if the current porosity is lager than target Porosity and 
comFricDegree is lager than 10,
# then we decrease friction value and apply it to all the bodies and 
contacts,
# else we decrease rolling friction value.
 global compFricDegree, competaRoll
if porosity()>targetPorosity and compFricDegree>5:
# we decrease friction value and apply it to all the bodies and 
contacts
compFricDegree = 0.95*compFricDegree
setContactFriction(radians(compFricDegree))
print('Friction:', compFricDegree,'porosity:', porosity())
# python syntax, make each step printout
sys.stdout.flush()
elif porosity()>targetPorosity:
# we decrease rolling fiction value and apply it to all the bodies 
and contacts
 competaRoll=0.95*competaRoll
for b in O.bodies:
b.mat.etaRoll=competaRoll
for i in O.interactions:
i.phys.etaRoll=competaRoll
print('Rollingfriction:', b.mat.etaRoll, 'porosity:', porosity())
sys.stdout.flush()
else:
 # after sample preparation, save the state
O.save('compactedState'+filename+'.yade.gz')
print('Compacted state saved', 'porosity', porosity())
# next time, called python command
triax.doneHook=None
O.pause()
O.run()

-- 
You received this question notification because your team yade-users is
a

Re: [Yade-users] [Question #697260]: are the vertices of the cell the center of the sphere

2021-06-01 Thread Zhicheng Gao
Question #697260 on Yade changed:
https://answers.launchpad.net/yade/+question/697260

Status: Answered => Open

Zhicheng Gao is still having a problem:
On the basis of Chareyre's answer, I would like to know how to determine
which three bodies are on the shared facet for such two cells.

-- 
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 #697336]: How to close the function doneHook in PeriTriaxController

2021-06-01 Thread Zhicheng Gao
New question #697336 on Yade:
https://answers.launchpad.net/yade/+question/697336

I don't want to call any  Python command again when the sample is isotropic 
compacted, so I set doneHook=uninitalized. Is that right?
The code of mine is shown below:
##__ First section, generate sample_

from __future__ import print_function
from yade import pack, qt, plot
from math import *

nRead=readParamsFromTable(
## model parameters
num_spheres=1,
targetPorosity=0.387,
confiningPressure=-10,
## material parameters
compFricDegree=15,#contact friction during the confining phase
finalFricDegree=30,#contact friction during the deviatoric loading
young=2e8,
poisson=.2,
density=2600,
alphaKr=7.5,
alphaKtw=0,
etaRoll=.22,
etaTwist=0,
normalCohesion=0,
shearCohesion=0,
## fluid parameters
fluidDensity=1000,
dynamicViscosity=.001,
## control parameters
damp=0,
stabilityThreshold=.001,
## output specifications
filename='suffusion',
unknowOk=True
)

from yade.params.table import *

O.periodic=True
O.cell.hSize=Matrix3(.05,0,0, 0,.05,0, 0,0,.05)
# create materials for spheres
#shear strength is the sum of friction and adhesion, so the 
momentRotationLaw=True
O.materials.append(CohFrictMat(alphaKr=alphaKr,alphaKtw=alphaKtw,density=density,etaRoll=etaRoll,etaTwist=etaTwist,frictionAngle=radians(compFricDegree),momentRotationLaw=True,normalCohesion=normalCohesion,poisson=poisson,shearCohesion=shearCohesion,young=young,label='spheres'))

# generate particles packing
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(.05,.05,.05),psdSizes=[0.8,0.000125,0.0001592,0.0002003,0.0003153,0.000399,0.000502,0.0005743],psdCumm=[0.0,0.00628,0.0565,0.198,0.721,0.915,0.991,1.0],num=num_spheres)
sp.toSimulation(material='spheres')

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

[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='contact',setCohesionNow=False,setCohesionOnNewContacts=False)],

[Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True)]),
PeriodicFlowEngine(dead=1,label='flow'),#introduced as a dead engine 
for the moment, see 2nd section

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
PeriTriaxController(label='triax',
# specify target values and whether they are strains or stresses
goal=(confiningPressure,confiningPressure,confiningPressure), 
stressMask=7,
# type of servo-control, the strain rate isn't determined, it 
shloud check the unbalanced force
dynCell=True,maxStrainRate=(1,1,1),
# wait until the unbalanced force goes below this value
maxUnbalanced=stabilityThreshold,relStressTol=1e-3,
doneHook='compactionFinished()'
),
NewtonIntegrator(damping=0)
]
import sys
def compactionFinished():
#check the current porosity
porosity=porosity()
# if the current porosity is lager than target Porosity and 
comFricDegree is lager than 10,
# then we decrease friction value and apply it to all the bodies and 
contacts,
# else we decrease rolling friction value.
if  porosity>targetPorosity and compFricDegree>10:
O.pause()
# we decrease friction value and apply it to all the bodies and 
contacts
compFricDegree = 0.95*compFricDegree
setContactFriction(radians(compFricDegree))
print('Friction:', compFricDegree,'porosity:', porosity)
# python syntax, make each step printout
sys.stdout.flush()
# Run again to the target confining pressure
O.run()
elif porosity>targetPorosity:
O.pause()
# we decrease rolling fiction value and apply it to all the bodies 
and contacts
for b in O.bodies:
b.mat.etaRoll=0.95*etaRoll
for i in O.interactions:
i.phys.etaRoll=0.95*etaRoll
print('Rollingfriction:', b.mat.etaRoll, 'porosity:', porosity)
sys.stdout.flush()
O.run()
else:
# after sample preparation, save the state
O.save('compactedState'+filename+'.yade.gz')
print('Compacted state saved', 'porosity', porosity)
# next time, don't call any python command
triax.doneHook=uninitalized
O.pause()
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

Re: [Yade-users] [Question #697260]: are the vertices of the cell the center of the sphere

2021-05-28 Thread Zhicheng Gao
Question #697260 on Yade changed:
https://answers.launchpad.net/yade/+question/697260

Zhicheng Gao posted a new comment:
Dear Chareyre, thank you for your reply. I would like to know how to
determine which three bodies are on the shared facet for such two cells.

-- 
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 #697260]: are the vertices of the cell the center of the sphere

2021-05-28 Thread Zhicheng Gao
Question #697260 on Yade changed:
https://answers.launchpad.net/yade/+question/697260

Status: Solved => Open

Zhicheng Gao is still having a problem:
Hello,
I have a new problem, The code is shown below:
.periodic=True
O.cell.hSize=Matrix3(2,0,0, 0,2,0, 0,0,2)
s0=utils.sphere((0.3,0.3,0.3),radius=0.2)
s1=utils.sphere((1,0.3,0.3),radius=0.21)
s2=utils.sphere((0.3,1,0.3),radius=0.28)
s3=utils.sphere((1,1,0.3),radius=0.21)
s4=utils.sphere((0.3,0.3,1),radius=0.21)
s5=utils.sphere((1,0.3,1),radius=0.31)
s6=utils.sphere((0.3,1,1),radius=0.18)
s7=utils.sphere((1,1,1),radius=0.31)
s8=utils.sphere((0.5,0.5,0.5),radius=0.3)

O.bodies.append(s0)
O.bodies.append(s1)
O.bodies.append(s2)
O.bodies.append(s3)
O.bodies.append(s4)
O.bodies.append(s5)
O.bodies.append(s6)
O.bodies.append(s7)
O.bodies.append(s8)
flow=PeriodicFlowEngine()
flow.emulateAction()

csdList=flow.getConstrictionsFull()
a=csdList[1]
b=flow.getVertices(a[0])
c=flow.getVertices(a[1])

I found that the body ids in b and c are the same, but the order is different, 
they are [7, 2, 5, 2] and [5, 2, 7, 2].
Why is this happening?

-- 
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 #697260]: are the vertices of the cell the center of the sphere

2021-05-27 Thread Zhicheng Gao
Question #697260 on Yade changed:
https://answers.launchpad.net/yade/+question/697260

Status: Answered => Solved

Zhicheng Gao confirmed that the question is solved:
Thank you Robert, this solved problem.

-- 
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 #697260]: are the vertices of the cell the center of the sphere

2021-05-27 Thread Zhicheng Gao
Question #697260 on Yade changed:
https://answers.launchpad.net/yade/+question/697260

Zhicheng Gao posted a new comment:
Dear Robert,
Thank you for your answer. Whether function flow.getVertices(cellid) returns 
the coordinates of four vertices, so how can I get the id of the sphere from 
the central coordinates? Is there a function that can do this?

-- 
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 #697259]: What are the forces on the particle from function O.forces.f()

2021-05-27 Thread Zhicheng Gao
Question #697259 on Yade changed:
https://answers.launchpad.net/yade/+question/697259

Status: Answered => Solved

Zhicheng Gao confirmed that the question is solved:
Thank you for your answer, which also brings me some ideas to solve the
problem

-- 
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 #697259]: What are the forces on the particle from function O.forces.f()

2021-05-27 Thread Zhicheng Gao
Question #697259 on Yade changed:
https://answers.launchpad.net/yade/+question/697259

Zhicheng Gao posted a new comment:
Thank you for your response.  The problem is that I apply a force on a body via 
function O.forces.setPermF(),   and then I use function O.forces.f() to get the 
resultant force on the body. Whether the resultant force includes the applied 
force and the contact force.  In the documentation,  the function O.forces.f()  
is described as: 
Resultant force on body, excluding gravity.

-- 
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 #697260]: are the vertices of the cell the center of the sphere

2021-05-26 Thread Zhicheng Gao
New question #697260 on Yade:
https://answers.launchpad.net/yade/+question/697260

I use the PeriodicFlowEngine to simulate flow in assembly and it is labeled as 
flow. Is the cell of the engine formed with the center of four spheres as the 
vertex?  If so, can I  get the four spheres that formed the cell by getting the 
four vertices of the cell through the function flow.getVertices(cellid)  ?

-- 
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 #697259]: What are the forces on the particle from function O.forces.f()

2021-05-26 Thread Zhicheng Gao
Question #697259 on Yade changed:
https://answers.launchpad.net/yade/+question/697259

Zhicheng Gao posted a new comment:
I also want to know how to get the magnitude of each contact force of a 
particle.
Thank you

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