Re: [Yade-users] [Question #706848]: Constant pressure or Constant volume?

2023-06-01 Thread 内山康太郎
Question #706848 on Yade changed:
https://answers.launchpad.net/yade/+question/706848

Status: Needs information => Solved

内山康太郎 confirmed that the question is solved:
Resolved.
Thank you Mr Jan.

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

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


Re: [Yade-users] [Question #706854]: Code availability of Yuan2016, Sweijen2016

2023-06-01 Thread Karol Brzezinski
Question #706854 on Yade changed:
https://answers.launchpad.net/yade/+question/706854

Status: Open => Answered

Karol Brzezinski proposed the following answer:
Hi Sebastian,

For a single particle, you can change its radius. You can write a Python
function and run it in PyRunner (an additional engine for executing
Python code periodically). A similar problem is discussed in those
topics:

https://answers.launchpad.net/yade/+question/679196
https://answers.launchpad.net/yade/+question/697479

Cheers,
Karol

-- 
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 #706865]: Erasing entire clump in simulation

2023-06-01 Thread Jan Stránský
Question #706865 on Yade changed:
https://answers.launchpad.net/yade/+question/706865

Status: Open => Needs information

Jan Stránský requested more information:
Hi,

> I wonder if I am doing correct about deleting clumps in my simulation.

obviously not, if "but nothing work"

> I tried several ways

What are the other ways other than in the provided code?

> Please give me some piece of advice

Read [1] and follow the instructions.
Mainly, provide MWE, M = minimal
For clump deletion, minimal is one clump consisting of two spheres.
No need to run script with 260k particles to see if deleting a clump works or 
not.

Cheers
Jan

[1] https://www.yade-dem.org/wiki/Howtoask

-- 
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 #706851]: FreeGlut versus FREEGLUT package

2023-06-01 Thread Luc OGER
Question #706851 on Yade changed:
https://answers.launchpad.net/yade/+question/706851

Luc OGER gave more information on the question:
complementary investigation :

by using the debug mode I end on this error :
(gdb) run /usr/local/yade/bin/yade-2023-05-15.git-a46ea55  Bouncing_spheres.py
Starting program: /usr/bin/python3 
/usr/local/yade/bin/yade-2023-05-15.git-a46ea55  Bouncing_spheres.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Welcome to Yade 2023-05-15.git-a46ea55
Using python version: 3.6.15 (default, Sep 23 2021, 15:41:43) [GCC]
[Detaching after fork from child process 7216]
TCP python prompt on localhost:9000, auth cookie `aseyku'
[New Thread 0x7fffc0ef0700 (LWP 7219)]
[New Thread 0x7fffbbfff700 (LWP 7220)]
XMLRPC info provider on http://localhost:21000
[New Thread 0x7fff9a3c4700 (LWP 7221)]
[New Thread 0x7fff99bc3700 (LWP 7222)]
[New Thread 0x7fff991b7700 (LWP 7228)]
[New Thread 0x7fff989b6700 (LWP 7229)]
[New Thread 0x7fff8bfff700 (LWP 7230)]
[New Thread 0x7fff8b7fe700 (LWP 7231)]
[New Thread 0x7fff8affd700 (LWP 7232)]
[New Thread 0x7fff8a7fc700 (LWP 7233)]
[New Thread 0x7fff89ffb700 (LWP 7234)]
[New Thread 0x7fff897fa700 (LWP 7235)]
[New Thread 0x7fff88ff9700 (LWP 7236)]
[New Thread 0x7fff6bfff700 (LWP 7237)]
[New Thread 0x7fff6b7fe700 (LWP 7238)]
[New Thread 0x7fff6affd700 (LWP 7239)]
[New Thread 0x7fff6a7fc700 (LWP 7240)]
[New Thread 0x7fff69ffb700 (LWP 7241)]
[New Thread 0x7fff697fa700 (LWP 7242)]
[New Thread 0x7fff68ff9700 (LWP 7243)]
[New Thread 0x7fff47fff700 (LWP 7244)]
[New Thread 0x7fff477fe700 (LWP 7245)]
[New Thread 0x7fff46ffd700 (LWP 7246)]
[New Thread 0x7fff467fc700 (LWP 7247)]
[New Thread 0x7fff45ffb700 (LWP 7248)]
[New Thread 0x7fff457fa700 (LWP 7249)]
[New Thread 0x7fff44ff9700 (LWP 7250)]
[New Thread 0x7fff27fff700 (LWP 7251)]
[New Thread 0x7fff1f7fe700 (LWP 7252)]
[New Thread 0x7fff277fe700 (LWP 7253)]
[New Thread 0x7fff26ffd700 (LWP 7254)]
[New Thread 0x7fff267fc700 (LWP 7255)]
[New Thread 0x7fff25ffb700 (LWP 7256)]
[New Thread 0x7fff257fa700 (LWP 7257)]
[New Thread 0x7fff24ff9700 (LWP 7258)]
[New Thread 0x7fff1700 (LWP 7259)]
[New Thread 0x7fff1effd700 (LWP 7260)]


Thread 1 "python3" received signal SIGSEGV, Segmentation fault.
0x77d5539b in PyModule_GetState () from /usr/lib64/libpython3.6m.so.1.0

I have no idea how to go to solve this SIGSEV 

-- 
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 #706854]: Code availability of Yuan2016, Sweijen2016

2023-06-01 Thread Sebastian Falcioni
Question #706854 on Yade changed:
https://answers.launchpad.net/yade/+question/706854

Sebastian Falcioni posted a new comment:
Hi Karol.

In particular I'm trying to model the swelling of a single particle of
hydrogel in a fluid (water). So I have one single particle with a
changing volume. Is there a Yade-DEM code for that?

Cheers.
Sebastian.

-- 
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 #706865]: Erasing entire clump in simulation

2023-06-01 Thread Lassakorn Eawsakul
New question #706865 on Yade:
https://answers.launchpad.net/yade/+question/706865

Hi,
I wonder if I am doing correct about deleting clumps in my simulation. My 
intention is to let the clump fall onto the sphere particles inside the 
cylinder container but I cut off the code about particles first (it's more than 
260K particles) to make sure that the clump would be erase after 
unbalancedForce is smaller than 0.5. I tried several ways to write it but 
nothing work, Please give me some piece of advice
Cheers.

### My code ###
import random
import math
from yade import geom, pack, utils, plot, ymport, export
import numpy as np

# Define cylinder with funnel parameters
center = (0, 0, 0.1)
diameter = 0.102
height = 0.18

# create cylindrical body with radius 0.102 m and height 0.064 m
cylinder = geom.facetCylinder(center=center, radius=diameter/2, height=height, 
segmentsNumber=80, wallMask=6)

# add cylinder to simulation
O.bodies.append(cylinder)

# plate properties
clump_plate = CohFrictMat(density=7500, label='clump_plate')

# add properties
O.materials.append(clump_plate)

# clumping parameters
bodyList = []
zi = 0.115
radius_clump = 0.00221
clumpLimit = (diameter/2) - 0.005
# layer and offset condition
num_layers = 8
z_offset_increment = 0.00128

# adjust the z-coordinate based on the layer
for layer in range(num_layers):
z_offset = layer * z_offset_increment
# if layer is divisible by 2, move x and y axis by 2mm
if layer % 2 == 0:
x_offset = 0.002
y_offset = 0.002
else:
x_offset = 0
y_offset = 0

for xi in range(-60, 60, 4):
x = xi / 1000 + x_offset
for yi in range(-60, 60, 4):
y = yi / 1000 + y_offset

# Check if the sphere is within the clump limit
if (math.sqrt(x**2 + y**2) + radius_clump) <= clumpLimit:
sphere_obj = sphere([x, y, zi + z_offset], radius_clump)
# Assign material properties to the sphere
sphere_obj.material = clump_plate
bodyList.append(O.bodies.append(sphere_obj))

# set color
for index, layer in enumerate(O.bodies):
if not isinstance(layer.shape, Sphere):
continue
if index % 2 == 0:
layer.shape.color = (1, 1, 1)  # white color
else:
layer.shape.color = (0.5, 0, 0)  # navy-blue color

# add clump to bodyList
idClump = O.bodies.clump(bodyList)


O.engines = [
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(), Bo1_Facet_Aabb()]),
InteractionLoop(
# handle sphere+sphere and facet+sphere collisions
[Ig2_Sphere_Sphere_ScGeom(), Ig2_Facet_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),
NewtonIntegrator(gravity=(0, 0, -9.81), damping=0.4),
# call the checkUnbalanced function (defined below) every 600 seconds
PyRunner(command='checkUnbalanced()', realPeriod=2)
]
O.dt = .5 * PWaveTimeStep()


def checkUnbalanced():

if unbalancedForce() < .3 :
# Remove clumps from the simulation
O.bodies.erase(idClump)
# Stop the simulation
O.pause()



-- 
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 #706843]: VTKRecorder throws Segmentation fault error

2023-06-01 Thread Yuri Bezmenov
Question #706843 on Yade changed:
https://answers.launchpad.net/yade/+question/706843

Status: Open => Solved

Yuri Bezmenov confirmed that the question is solved:
Thanks Jan, 
My problem is solved.

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

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


Re: [Yade-users] [Question #706864]: unable to export text

2023-06-01 Thread Jan Stránský
Question #706864 on Yade changed:
https://answers.launchpad.net/yade/+question/706864

Status: Open => Answered

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

> if it is correct to put the code under def checkunbalancedForce()

please use actual names to prevent confusion.
by checkunbalancedForce, do you mean already defined checkUnbalanced function?
Or a new function?
Or ... ?

What is "under"? in?

If already existing checkUnbalanced function like in the code, why not,
if it suits your purposes.

BUT! do not put export function inside "for body in O.bodies:" loop, it
does not make sense.

> export.txt(...)

export.txt does not exist

> I want to export the text of sphere position excluding the clump
sphere

for selective export, use mask parameter (and properly mask your
particles)

> and why do I get the error that said
> if body not in idClump:
> (argument of type 'int' is not iterable)

idClump is integer, one number.
You cannot do "in number" in Python
###
3 in [1,2,3] # True
4 in [1,2,3] # False
5 in 6 # TypeError: argument of type 'int' is not iterable
###

Cheers
Jan

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

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


Re: [Yade-users] [Question #706848]: Constant pressure or Constant volume?

2023-06-01 Thread Jan Stránský
Question #706848 on Yade changed:
https://answers.launchpad.net/yade/+question/706848

Jan Stránský requested more information:
Please define (or rather adjust) "constant pressure simple shear"
Simple shear is simple = just plain shear, no pressure applied.
By applying additional pressure, the shear becomes no more simple..

Cheers
Jan

[1] https://en.wikipedia.org/wiki/Simple_shear

-- 
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 #706843]: VTKRecorder throws Segmentation fault error

2023-06-01 Thread Jan Stránský
Question #706843 on Yade changed:
https://answers.launchpad.net/yade/+question/706843

Jan Stránský posted a new comment:
Segmentation fault in C++ context is if you try to access attributes or methods 
on a null pointer. Usually it consequence of a clear bug or some sircumstances, 
that have not been considered during implementation.
From the catchsegv output, it **seems** (not 100% sure without more detailed 
analysis) that the problem is in system vtk library, not directly Yade. 
Possibly a bug.
By updating your system, the possible vtk library bug might have been fixed.
But this is just guessing..
Cheers
Jan

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

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


[Yade-users] [Question #706864]: unable to export text

2023-06-01 Thread Huan
New question #706864 on Yade:
https://answers.launchpad.net/yade/+question/706864

Hello,
I'm try to to use the clump as wall to press on the sphere packing. After the 
clump press the packing I want to export the text of sphere position excluding 
the clump sphere, but it doesn't work. My question is that whether if it is 
correct to put the code under def checkunbalancedForce() and why do I get the 
error that said 
>>if body not in idClump:
(argument of type 'int' is not iterable)
-My 
code
import random
import math
from yade import geom, pack, utils, plot, ymport, export
import numpy as np

# Define cylinder with funnel parameters
center = (0, 0, 0)
diameter = 0.102
height = 0.18

# create cylindrical body with radius 0.102 m and height 0.064 m
cylinder = geom.facetCylinder(center=center, radius=diameter/2, height=height, 
segmentsNumber=80, wallMask=6)

# add cylinder to simulation
O.bodies.append(cylinder)

# plate properties
clump_plate = CohFrictMat(density = 7500, label = 'clump_plate')

# add properties
O.materials.append(clump_plate)

# clumping parameters
bodyList = []
zi = 0.025 
radius_clump = 0.00221
clumpLimit = (diameter/2)  - 0.005
# layer and offset condition
num_layers = 8
z_offset_increment = 0.00128

# adjust the z-coordinate based on the layer
for layer in range(num_layers):
z_offset = layer * z_offset_increment  
# if layer is divisible by to move x and y axis by 2mm 
if layer % 2 == 0:
x_offset = 0.002
y_offset = 0.002
color = (1, 1, 1) # white
else:
x_offset = 0
y_offset = 0
color = (0.647, 0.165, 0.165) #brown
for xi in range(-60, 60, 4):
x = xi / 1000 + x_offset
for yi in range(-60, 60, 4):
y = yi / 1000 + y_offset

# Check if the sphere is within the clump limit
if (math.sqrt(x**2 + y**2) + radius_clump) <= clumpLimit:
sphere_obj = sphere([x, y, zi + z_offset], radius_clump)
# Assign material properties to the sphere
sphere_obj.material = clump_plate
sphere_obj.shape.color = color
bodyList.append(O.bodies.append(sphere_obj))

# add clump to bodyList
idClump = O.bodies.clump(bodyList)

# add sphere packing
O.bodies.append(ymport.textExt('initialization.txt',format='x_y_z_r'))

# materials Properties
gravel = CohFrictMat(young = 1e7, poisson = 0.25, density = 27000, label = 
'gravel')
asphalt_binder = CohFrictMat(young = 1e7, poisson = 0.25, density = 10600, 
label = 'asphalt_binder')

# add properties
O.materials.append(gravel)
O.materials.append(asphalt_binder)

# give color and properties to shpere
for body in O.bodies:
   if not isinstance(body.shape, Sphere): 
   continue
   if body.shape.radius == 0.01575/2 :
   body.shape.color = (0,0,1) #blue
   body.material = gravel
   if body.shape.radius == 0.011/2:
   body.shape.color = (1,0,0) #red
   body.material = gravel
   if body.shape.radius == 0.007125/2:
   body.shape.color = (0,1,0) #green
   body.material = gravel
   if body.shape.radius == 0.003555/2:
   body.shape.color = (1,1,0) #yellow
   body.material = gravel
   if body.shape.radius == 0.00160/2 :
   body.shape.color = (1,0,1) #magenta
   body.material = gravel
   if body.shape.radius == 0.0008/2 :
   body.shape.color = (0,0,0) #black
   body.material = asphalt_binder
   
O.engines = [
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(), Bo1_Facet_Aabb()]),
InteractionLoop(
# handle sphere+sphere and facet+sphere collisions
[Ig2_Sphere_Sphere_ScGeom(), Ig2_Facet_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),
NewtonIntegrator(gravity=(0, 0, -9.81), damping=0.4),
# call the checkUnbalanced function (defined below) every 2 seconds
PyRunner(command='checkUnbalanced()', realPeriod=2),
]
O.dt = PWaveTimeStep()

# if the unbalanced forces goes below .05, the packing
# is considered stabilized, therefore we stop collected
# data history and stop
def checkUnbalanced():
if unbalancedForce() < 0.05:
for body in O.bodies:
# Exclude the clumped spheres
if body not in idClump:
if isinstance(body.shape, Sphere):
export.txt("1st_flat.txt",format='x_y_z_r')
O.pause()

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

Re: [Yade-users] [Question #706854]: Code availability of Yuan2016, Sweijen2016

2023-06-01 Thread Karol Brzezinski
Question #706854 on Yade changed:
https://answers.launchpad.net/yade/+question/706854

Karol Brzezinski posted a new comment:
Hello Sebastian,

I don't have a video and I don't think that there is one. But you could
try to run the example and see what it looks like.

Cheers,
Karol

-- 
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 #706850]: Clumping can't give color to each layer

2023-06-01 Thread Huan
Question #706850 on Yade changed:
https://answers.launchpad.net/yade/+question/706850

Status: Answered => Solved

Huan confirmed that the question is solved:
Thanks but I solve it via using this:
# set color
for index, layer in enumerate(O.bodies):
if not isinstance(layer.shape, Sphere):
continue
if index % 2 == 0:
layer.shape.color = (1, 1, 1)  # white color
else:
layer.shape.color = (0.5, 0, 0)  # navy-blue color

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

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