Re: [Yade-users] [Question #699273]: Clump angular momentum not conserved

2021-10-29 Thread Rohit John
Question #699273 on Yade changed:
https://answers.launchpad.net/yade/+question/699273

Description changed to:
Hello all,

I have a simulation consisting of two spheres (S1, S2) and a clump made
of two spheres (C1, C2). The two spheres, S1 and S2, are given the same
initial speed but in the opposite directions along the horizontal. The
clump is aligned along the vertical and the two spheres, S1 and S2, are
made to hit the spheres in the clump at the same time. Could this be a
bug in my code or the NewtonIntegrator?

I expect the angular momentum to be conserved in the interactions, but
it is not. I have a similar problem with clumps of pfacet [1]. It was
reported in a bug report related to pfacet [2].  I am posting again
because this appears to be an error related to clumps in general. I have
put the code below.

I am using Yadedaily.

Kind regards,
Rohit K. John

[1] https://answers.launchpad.net/yade/+question/697465
[2] https://gitlab.com/yade-dev/trunk/-/issues/210

# script
# 
from yade.gridpfacet import *
from yade import *
from yade import geom, utils
from yade import plot
import sys, os


#  
input parameter
# - clump
sphere_young= 50e9
sphere_poisson  = 0.3
sphere_friction = radians(30)

sphere_offset   = 0.3
sphere_radius   = 5e-2
sphere_init_vel = 1

sphere_mass = 0.5
sphere_density  = sphere_mass / (4/3*pi*sphere_radius**3)
#  
Materials
sphere_mat = 'sphere_mat'

O.materials.append(
FrictMat(
young   = sphere_young,
poisson = sphere_poisson,
density = sphere_density,
label   = sphere_mat,
frictionAngle = sphere_friction,
)
)

#  
Engines
O.engines = [
ForceResetter(),

InsertionSortCollider([
Bo1_Sphere_Aabb(),
]),

InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()],
)
]
#  
objects
# - clump
clump_sph_1 = sphere([0, sphere_offset, 0],  sphere_radius, material = 
sphere_mat)
clump_sph_2 = sphere([0,-sphere_offset, 0],  sphere_radius, material = 
sphere_mat)

clump_sph_1_ID = O.bodies.append(clump_sph_1)
clump_sph_2_ID = O.bodies.append(clump_sph_2) 


clump_clump_ID = O.bodies.clump([clump_sph_1_ID, clump_sph_2_ID])
clump_mmoi = O.bodies[clump_clump_ID].state.inertia
# - spheres
sp1 = sphere([ 4*sphere_radius, sphere_offset, 0], sphere_radius, material = 
sphere_mat)
sp2 = sphere([-4*sphere_radius,-sphere_offset, 0], sphere_radius, material = 
sphere_mat)

sp1_ID = O.bodies.append(sp1)
sp2_ID = O.bodies.append(sp2)

O.bodies[sp1_ID].state.vel = [-sphere_init_vel,0,0]
O.bodies[sp2_ID].state.vel = [ sphere_init_vel,0,0]

#  
Additional engines
O.engines += [
NewtonIntegrator(
gravity = [0,0,0], 
damping = 0
),
PyRunner(
command = 'graph()', 
iterPeriod = 1000
),
]

# - Calculating state after 
collision
m  = sphere_mass
v0 = sphere_init_vel
l  = sphere_offset
iz = clump_mmoi[2]


calculated_final_sphere_lin_vel = 0.5*(-4.0*iz*l*m*v0/(iz + 2.0*l**2*m) + 
2.0*l*m*v0)/(l*m)
calculated_final_clump_ang_vel = 4.0*l*m*v0/(iz + 2.0*l**2*m)


calculated_final_clump_ang_mom = clump_mmoi[2]*calculated_final_clump_ang_vel
calculated_final_sphere_ang_mom = 
2*sphere_offset*sphere_mass*calculated_final_sphere_lin_vel

print("clump: ", calculated_final_clump_ang_mom)
print("sphere: ", calculated_final_sphere_ang_mom)
print("total: ",  calculated_final_clump_ang_mom + 
calculated_final_sphere_ang_mom)


# - plotting
plot.plots = {'t':('clump_Lz', 'calculated_clump_final_Lz'), 't1':('Lz', 
'calculated_Lz')}

def graph():
L_sp1 = get_AngMom(sp1_ID)
L_sp2 = get_AngMom(sp2_ID)

angMom_clump = O.bodies[clump_clump_ID].state.angMom
L_tot = angMom_clump + L_sp1 + L_sp2

plot.addData(
t  = O.time,   t1 = O.time,
Lx = L_tot[0], Ly = L_tot[1], Lz = L_tot[2],
clump_Lz = angMom_clump[2],
calculated= calculated_final_clump_ang_mom + 
calculated_final_sphere_ang_mom,
calculated_clump_final_Lz = calculated_final_clump_ang_mom
)


def get_AngMom(id):
pos_sp1 = O.bodies[id].state.pos
vel_sp1 = O.bodies[id

Re: [Yade-users] [Question #699273]: Clump angular momentum not conserved

2021-10-29 Thread Rohit John
Question #699273 on Yade changed:
https://answers.launchpad.net/yade/+question/699273

Status: Answered => Open

Rohit John is still having a problem:
Hello,

I apologise for not mentioning the version of Yade I use. I am using
Yadedaily. I will amend the initial description.

Kind regards,
Rohit K. John

-- 
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 #699273]: Clump angular momentum not conserved

2021-10-29 Thread Rohit John
New question #699273 on Yade:
https://answers.launchpad.net/yade/+question/699273

Hello all,

I have a simulation consisting of two spheres (S1, S2) and a clump made of two 
spheres (C1, C2). The two spheres, S1 and S2, are given the same initial speed 
but in the opposite directions along the horizontal. The clump is aligned along 
the vertical and the two spheres, S1 and S2, are made to hit the spheres in the 
clump at the same time. Could this be a bug in my code or the NewtonIntegrator?

I expect the angular momentum to be conserved in the interactions, but it is 
not. I have a similar problem with clumps of pfacet [1]. It was reported in a 
bug report related to pfacet [2].  I am posting again because this appears to 
be an error related to clumps in general. I have put the code below.

Kind regards,
Rohit K. John

[1] https://answers.launchpad.net/yade/+question/697465
[2] https://gitlab.com/yade-dev/trunk/-/issues/210

# script
# 
from yade.gridpfacet import *
from yade import *
from yade import geom, utils
from yade import plot
import sys, os


#  
input parameter
# - clump
sphere_young= 50e9
sphere_poisson  = 0.3
sphere_friction = radians(30)

sphere_offset   = 0.3
sphere_radius   = 5e-2
sphere_init_vel = 1

sphere_mass = 0.5
sphere_density  = sphere_mass / (4/3*pi*sphere_radius**3)
#  
Materials
sphere_mat = 'sphere_mat'

O.materials.append(
FrictMat(
young   = sphere_young,
poisson = sphere_poisson,
density = sphere_density,
label   = sphere_mat,
frictionAngle = sphere_friction,
)
)

#  
Engines
O.engines = [
ForceResetter(),

InsertionSortCollider([
Bo1_Sphere_Aabb(),
]),

InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()],
)
]
#  
objects
# - clump
clump_sph_1 = sphere([0, sphere_offset, 0],  sphere_radius, material = 
sphere_mat)
clump_sph_2 = sphere([0,-sphere_offset, 0],  sphere_radius, material = 
sphere_mat)

clump_sph_1_ID = O.bodies.append(clump_sph_1)
clump_sph_2_ID = O.bodies.append(clump_sph_2) 


clump_clump_ID = O.bodies.clump([clump_sph_1_ID, clump_sph_2_ID])
clump_mmoi = O.bodies[clump_clump_ID].state.inertia
# - spheres
sp1 = sphere([ 4*sphere_radius, sphere_offset, 0], sphere_radius, material = 
sphere_mat)
sp2 = sphere([-4*sphere_radius,-sphere_offset, 0], sphere_radius, material = 
sphere_mat)

sp1_ID = O.bodies.append(sp1)
sp2_ID = O.bodies.append(sp2)

O.bodies[sp1_ID].state.vel = [-sphere_init_vel,0,0]
O.bodies[sp2_ID].state.vel = [ sphere_init_vel,0,0]

#  
Additional engines
O.engines += [
NewtonIntegrator(
gravity = [0,0,0], 
damping = 0
),
PyRunner(
command = 'graph()', 
iterPeriod = 1000
),
]

# - Calculating state after 
collision
m  = sphere_mass
v0 = sphere_init_vel
l  = sphere_offset
iz = clump_mmoi[2]


calculated_final_sphere_lin_vel = 0.5*(-4.0*iz*l*m*v0/(iz + 2.0*l**2*m) + 
2.0*l*m*v0)/(l*m)
calculated_final_clump_ang_vel = 4.0*l*m*v0/(iz + 2.0*l**2*m)


calculated_final_clump_ang_mom = clump_mmoi[2]*calculated_final_clump_ang_vel
calculated_final_sphere_ang_mom = 
2*sphere_offset*sphere_mass*calculated_final_sphere_lin_vel

print("clump: ", calculated_final_clump_ang_mom)
print("sphere: ", calculated_final_sphere_ang_mom)
print("total: ",  calculated_final_clump_ang_mom + 
calculated_final_sphere_ang_mom)


# - plotting
plot.plots = {'t':('clump_Lz', 'calculated_clump_final_Lz'), 't1':('Lz', 
'calculated_Lz')}

def graph():
L_sp1 = get_AngMom(sp1_ID)
L_sp2 = get_AngMom(sp2_ID)

angMom_clump = O.bodies[clump_clump_ID].state.angMom
L_tot = angMom_clump + L_sp1 + L_sp2

plot.addData(
t  = O.time,   t1 = O.time,
Lx = L_tot[0], Ly = L_tot[1], Lz = L_tot[2],
clump_Lz = angMom_clump[2],
calculated= calculated_final_clump_ang_mom + 
calculated_final_sphere_ang_mom,
calculated_clump_final_Lz = calculated_final_clump_ang_mom
)


def get_AngMom(id):
pos_sp1 = O.bodies[id].state.pos
vel_sp1 = O.bodies[id].state.vel
angMom_sp1 = O.bodies[id].st

Re: [Yade-users] [Question #699273]: Clump angular momentum not conserved

2021-10-29 Thread Rohit John
Question #699273 on Yade changed:
https://answers.launchpad.net/yade/+question/699273

Rohit John gave more information on the question:
Hello all,

I derived the equations for getting the state after the collision using
the following code

Kind regards,
Rohit K. John

#  
Script
from sympy import *
m, v0, l, iz, w1, v1 = symbols('m, v0, l, iz, w1, v1') 

eq1 = Eq(2*m*v1*l + iz*w1 - 2*m*v0*l, 0) # Angular momentum conservation 
eq2 = Eq(m*v1**2  + 1/2*iz*w1**2 - m*v0**2, 0) # Energy consevation

sol = solve((eq1, eq2),(v1, w1))

sol[1]

-- 
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 #698825]: Yade-batch is being indeterministic (gtsPfacet)

2021-09-27 Thread Rohit John
Question #698825 on Yade changed:
https://answers.launchpad.net/yade/+question/698825

Summary changed to:
Yade-batch is being indeterministic (gtsPfacet)

-- 
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 #698825]: Yade-batch is being indeterministic

2021-09-27 Thread Rohit John
Question #698825 on Yade changed:
https://answers.launchpad.net/yade/+question/698825

Status: Open => Solved

Rohit John confirmed that the question is solved:
Dear Karol,

You are correct. The problem lies with the gtsPfacet() function. It is
introducing randomness somehow.

I tried writing my own function to read a GTS file and create a pfacet
object. When I use this function (create_GTSPfacet()) instead of
gtsPfacet(), all simulations in batch-mode produce the same result. I
will paste the code below for future reference. If I find any other
issues regarding this I shall post them here.

Kind regards,
Rohit K. John

# 

 Python
# 
-
 split_bySpaces
def split_bySpaces(input_string):
"""
Uses spaces (' ') to split a string into a list of substrings

Args:
input_string (str): input string

Returns:
list: list of substrings
"""
string = ['']
for i in input_string:
if i == ' ':
string = string + ['']

else:
string[-1] = string[-1] + i

if string[-1] == '':
string = string[:-1]

return string

# 
-
 GTSParser
class GTSParser:
"""
Parses the GTS file and extracts the data pertaining to vertices, edges and 
faces
"""
# --
def __init__(self, input_str):
"""
Initialises and parses the dataset

Args:
input_str (str): The string data from GTS file
"""
self.raw_data = input_str

self._split_rawByLines()
self._get_3DMetadata()
self._get_vertices()
self._get_edges()
self._get_faces()

# --
def _split_rawByLines(self):
"""
Splits the GTS string into lines based on '\n' character. This is stored
in list 
"""
self._data_line_splitted = ['']
for i in self.raw_data:
if i == '\n':
self._data_line_splitted = self._data_line_splitted + ['']
else:
self._data_line_splitted[-1] = self._data_line_splitted[-1] + i

# --
def _get_3DMetadata(self):
"""
Extracts the metadata (number of vertices, edges and faces) from the 
first line
"""
self._metadata_string = self._data_line_splitted[0]
metadata_string_splitted = split_bySpaces(self._metadata_string)
self._metadata = {}
for i in range(3):
self._metadata[metadata_string_splitted[-i-1]] = 
int(metadata_string_splitted[i])

# --
def _get_vertices(self):
"""
Extracts the vertices (Their location) and stores them in a variable
"""
no_vertices = self._metadata['GtsVertex']
start_idx   = 1
vertex_data = self._data_line_splitted[start_idx:start_idx + 
no_vertices]
vertices= []
for i in vertex_data:
vertices = vertices + [[float(j) for j in split_bySpaces(i)]]

self._vertices = vertices

# --
def _get_edges(self):
"""
Extracts the edges (the vertices which form them) and stores them in a 
variable
"""
no_vertices = self._metadata['GtsVertex']
no_edges= self._metadata['GtsEdge']
start_idx   = 1 + no_vertices
edge_data   = self._data_line_splitted[start_idx:start_idx + no_edges]
edges   = []

for i in edge_data:
edges = edges + [[int(j) for j in split_bySpaces(i)]]

self._edges = edges

# --
def _get_faces(self):
"""
Extracts the faces (the edges which form them) and stores them in a 
variable
"""
no_vertices = self._metadata['GtsVertex']
no_edges= self._metadata['GtsEdge']
np_faces= self._metadata['GtsFace']
start_idx   = 1 + no_vertices + no_edges
face_data   = self._data_line_splitted[start_idx:start_idx + np_faces]
faces   = 

Re: [Yade-users] [Question #698825]: Yade-batch is being indeterministic

2021-09-27 Thread Rohit John
Question #698825 on Yade changed:
https://answers.launchpad.net/yade/+question/698825

Rohit John posted a new comment:
Dear Karol,

Thanks for spending your time to find the probable cause and proposing a
viable solution. I shall look into this and get back as soon as
possible.

Kind regards,
Rohit K. John

-- 
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 #698754]: Making video of pfacet clump: clump falling apart

2021-09-24 Thread Rohit John
Question #698754 on Yade changed:
https://answers.launchpad.net/yade/+question/698754

Rohit John 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 #698754]: Making video of pfacet clump: clump falling apart

2021-09-24 Thread Rohit John
Question #698754 on Yade changed:
https://answers.launchpad.net/yade/+question/698754

Status: Answered => Solved

Rohit John confirmed that the question is solved:
Dear Bruno,

Thanks for your help. I really like your creative solution. It solved my
problem

Kind regards,
Rohit K. John

-- 
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 #698825]: Yade-batch is being indeterministic

2021-09-22 Thread Rohit John
Question #698825 on Yade changed:
https://answers.launchpad.net/yade/+question/698825

Status: Needs information => Open

Rohit John gave more information on the question:
Hello,

I have put the content of the .log file at the end of this comment. In a
previous, albeit more complicated script, I had found that even running
the same script multiple times, even with a single core (I used -j=1),
yielded different results.

The simulation monitors the angular velocity of pfacet clump. I tried
running the script, the one I have posted above, three times and the
results diverge.

I apologise if the title appeared to be misleading.

Kind regards,
Rohit K. John

# 
---
 YADE LOG file for batch
Welcome to Yade 2021-08-24.git-d2e8416 
Using python version: 3.8.10 (default, Jun  2 2021, 10:49:15) 
[GCC 9.4.0]
Warning: no X rendering available (see 
https://bbs.archlinux.org/viewtopic.php?id=13189)
XMLRPC info provider on http://localhost:21000
TCP python prompt on localhost:9000, auth cookie `ksdsyu'
Running script to_LP_main.py

=== JOB SUMMARY 
id  : ID=1,OMP_NUM_THREADS=1
status  : 0 (OK)
duration: 00:03:28
command : YADE_BATCH=parametric.table:2 DISPLAY=  
/usr/local/bin/yade-2021-08-24.git-d2e8416 --threads=1 --nice=10 -x 
to_LP_main.py> ./logs/to_LP_main.py.2.log 2>&1
started : Wed Sep 22 15:24:21 2021
finished: Wed Sep 22 15:27:49 2021

-- 
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 #698825]: Yade-batch is being indeterministic

2021-09-22 Thread Rohit John
Question #698825 on Yade changed:
https://answers.launchpad.net/yade/+question/698825

Status: Needs information => Open

Rohit John gave more information on the question:
Dear Robert,

I tried adding the column "!OMP_NUM_THREADS" and I set all the values to
one (given below). I am still seeing indeterminism. Please let me know
if there is anything that I may have missed.

Kind regards,
Rohit K. John

PC information
Yade version: 2021-08-24.git-d2e8416
Ubuntu 20.04.3 LTS


# 

 parameters.table
ID !OMP_NUM_THREADS
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 1
10 1

-- 
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 #698825]: Yade-batch is being indeterministic

2021-09-22 Thread Rohit John
Question #698825 on Yade changed:
https://answers.launchpad.net/yade/+question/698825

Rohit John posted a new comment:
Hello all,

Please use the following code for post-processing

Kind regards,
Rohit 

# 
--
 python script
import json
import numpy as np
from matplotlib import pyplot as plt
import plotly.graph_objects as go

import sys, os
sys.path.append(".")
current_path = os.getcwd()
# --- 
setting the directory
os.chdir(current_path)


# --- 
selecting the data files
files = os.listdir()
files_sel = [] 
for i in files:
if i.find('json') > 0:
files_sel.append(i)

# --- 
importing data 
simulation_results = {}

for i in files_sel:
with open(i, 'r', encoding="utf-8") as jsonfile:
data = json.load(jsonfile)
simulation_results[data['ID']] = data

for i in list(simulation_results.keys()):
wx= simulation_results[i]['data']['wx'] 
plt.plot(wx)

-- 
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 #698825]: Yade-batch is being indeterministic

2021-09-22 Thread Rohit John
New question #698825 on Yade:
https://answers.launchpad.net/yade/+question/698825

Hello,

I am simulating the interaction between a brush (modelled using 
gridConnections) and a rotating box (pfacet clump). I noticed some 
inconsistencies in the batch simulations and I tried a batch simulation in 
which the only parameter that was changed was the ID. The outputs of each 
simulation in the batch were different. From what I understand according to 
[1], there YADE will be indeterministic when it a single simulation is run in 
parallel multiple times. However, I understood that YADE-batch has each 
simulation running using one thread/code by default. So why are all the results 
different? Please find my code below. Please note I am using the json module in 
python to write and read the data. You may have to install it using pip install 
json

Kind regards,
Rohit K. John

[1] https://yade-dem.org/doc/formulation.html#result-indeterminism

# 

 parameters.table
ID 
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 

# 

 cube_LP.gts
14 36 24 GtsSurface GtsFace GtsEdge GtsVertex
0.03 0.03 0.03
0.03 0.03 -0.03
0.03 -0.03 0.03
0.03 -0.03 -0.03
-0.03 0.03 0.03
-0.03 0.03 -0.03
-0.03 -0.03 0.03
-0.03 -0.03 -0.03
0.03 0.0 0.0
0.0 0.03 0.0
-0.03 0.0 0.0
0.0 0.0 0.03
0.0 -0.03 0.0
0.0 0.0 -0.03
6 8
2 6
1 2
8 7
3 4
5 6
3 7
1 3
8 4
7 5
5 1
4 2
9 3
2 9
4 9
1 9
10 1
6 10
5 10
2 10
11 5
8 11
7 11
6 11
12 3
5 12
7 12
1 12
13 7
4 13
8 13
3 13
14 4
6 14
8 14
2 14
7 25 27 
7 29 32 
10 21 23 
12 33 36 
8 13 16 
11 17 19 
12 14 15 
5 15 13 
3 16 14 
2 18 20 
6 19 18 
3 20 17 
1 22 24 
4 23 22 
6 24 21 
11 26 28 
10 27 26 
8 28 25 
9 30 31 
4 31 29 
5 32 30 
1 34 35 
9 35 33 
2 36 34 
# 
python
 script

from yade.gridpfacet import *
from yade import plot
import sys
import json
from json import JSONEncoder

sys.path.append(".")
# 
--
 input parameter
simulation_mode = "batch"

if simulation_mode == 'single':
ID = 14
# randomness = 0e-7

elif simulation_mode == 'batch':
readParamsFromTable(
ID = 14,
# randomness = 0e-7
)
from yade.params.table import *

# 
--
 input parameter
# - target
target_young= 3.2e6
target_density  = 1250
target_poisson  = 0.48
target_friction = radians(44)

p_radius= 1e-3

# 

 Materials
target_int_mat = 'pfacet_int_mat'
target_ext_mat = 'pfacet_ext_mat'

O.materials.append(
FrictMat(
young   = target_young,
poisson = target_poisson,
density = target_density,
label   = target_ext_mat,
frictionAngle = target_friction,
)
)

O.materials.append(
CohFrictMat(
young   = target_young,
poisson = target_poisson,
density = target_density,
label   = target_int_mat,

frictionAngle = target_friction,
normalCohesion= 3e100,
shearCohesion = 3e100,
momentRotationLaw = True,
)
)
# 

 Engines
O.engines = [
ForceResetter(),

InsertionSortCollider([
Bo1_GridConnection_Aabb(),
Bo1_PFacet_Aabb(),
Bo1_Sphere_Aabb(),
]),

InteractionLoop(
[
Ig2_PFacet_PFacet_ScGeom(),
Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),
Ig2_GridNode_GridNode_GridNodeGeom6D(),
Ig2_GridConnection_PFacet_ScGeom(),
Ig2_Sphere_PFacet_ScGridCoGeom(),
],
[
Ip2_FrictMat_FrictMat_FrictPhys(),
Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(
setCohesionNow = True, 
setCohesionOnNewContacts = False
),
],
[
Law2_GridCoGridCoGeom_FrictPhys_CundallStrack(),
Law2_ScGeom_FrictPhys_CundallStrack(),
Law2_ScGridCoGeom_FrictPhys_CundallStrack(),
Law2_ScGeom6D_CohFrictP

Re: [Yade-users] [Question #698572]: Is it possible to constrain the motion of a body along a circle

2021-09-21 Thread Rohit John
Question #698572 on Yade changed:
https://answers.launchpad.net/yade/+question/698572

Rohit John posted a new comment:
Hello all,

I  managed to make the code I had posted earlier faster (#6) by getting
an analytical solution for the non linear equations. The code is given
below. It affects the linear motion. I believe the angular motion will
require more complicated equations

Kind regards,
Rohit K. John

from math import *
from yade import *
from yade import plot


# 
--
 bodies
sph1 = sphere((2, 0, 2), .5)
sph2 = sphere(center=(0, 0, 0), radius=.5, fixed=True)

sph1_id = O.bodies.append(sph1)
sph2_id = O.bodies.append(sph2)

g  =  Vector3([0,0,-10])
mass_1 =  O.bodies[sph1_id].state.mass
length =  O.bodies[sph1_id].state.pos.norm()
# 
--
 engines
O.engines = [
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom()],  # collision geometry
[Ip2_FrictMat_FrictMat_FrictPhys()],  # collision "physics"
[Law2_ScGeom_FrictPhys_CundallStrack()]  # contact law -- apply 
forces
),
PyRunner(command = "constrainingForceEngine2()", iterPeriod = 1),
NewtonIntegrator(gravity=g, damping=0.0)
]

# 
--
 additional engines
plot.plots = {"t": ("fx", "fy", "fz")}

def constrainingForceEngine2():
m  = O.bodies[sph1_id].state.mass
dt = O.dt
l  = length
x0,  y0,  z0   = O.bodies[sph1_id].state.pos
vx0, vy0, vz0  = O.bodies[sph1_id].state.vel
F0x, F0y, F0z  = O.forces.f(sph1_id) +  m*g  

a = dt**2*F0x + dt*m*vx0 + m*x0
b = dt**2*F0z + dt*m*vz0 + m*z0

z = b*l/(sqrt(b**2+a**2))
x = a*l/(sqrt(b**2+a**2))

vx = (x  - x0)/dt
vz = (z  - z0)/dt

if x !=0:
lamda = (m*(vx - vx0)/dt - F0x)/x 
else:
lamda = (m*(vz - vz0)/dt - F0z)/z 

# Assiging the force
Fx = lamda * x
Fz = lamda * z
force = Vector3([Fx, 0, Fz])
O.forces.addF(id = sph1_id, f = force)

if O.iter % 1000 == 0:
plot.addData(t = O.time, fx = force[0], fy = force[1], fz = force[2])

plot.plot()
# 
--
 sim setup
O.dt = 1e-5
O.saveTmp()

-- 
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 #698572]: Is it possible to constrain the motion of a body along a circle

2021-09-18 Thread Rohit John
Question #698572 on Yade changed:
https://answers.launchpad.net/yade/+question/698572

Status: Answered => Open

Rohit John is still having a problem:
Dear Jan,

I tried the same test, explain in the previous comment, on a clump which
is force to rotate about the origin using a penalty force model. The
change in angular momentum is still present, however, the magnitude is
much less. I suppose this could be because of an error in the
integration of the angular momentum.

Kind regards,
Rohit K. John

# 

 Python
from math import *
from yade import *
from yade import utils, geom, plot


# 
--
 bodies
sph1 = sphere((0, -2, 2), .5)
sph2 = sphere(center=(0, 0, 0), radius=.5, fixed=True)
sph3 = sphere((0, 0, 2), .5)

sph1_id = O.bodies.append(sph1)
sph2_id = O.bodies.append(sph2)

sph3_id = O.bodies.append(sph3)
O.bodies[sph3_id].state.vel = [0,-1,0]

g=  Vector3([0,0,0])
stiffnes = 1e7
#  clump
clump_id = O.bodies.clump([sph1_id, sph2_id])


# 
--
 engines
O.engines = [
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom()],  # collision geometry
[Ip2_FrictMat_FrictMat_FrictPhys()],  # collision "physics"
[Law2_ScGeom_FrictPhys_CundallStrack()]  # contact law -- apply 
forces
),
PyRunner(command = "eccentricAxisEngine()", iterPeriod = 1),
NewtonIntegrator(gravity=g, damping=0.0),
PyRunner(command = "plotter()", iterPeriod = 100)
]

#
--
additional engines

def eccentricAxisEngine():
pos_0 = O.bodies[sph2_id].state.pos
force = -stiffnes*pos_0
O.forces.addF(id = sph2_id, f = force)

plot.plots = {'t':('ax', 'ay', 'az')}

def plotter():
body_ids= [clump_id, sph3_id] 
totalangVel = Vector3([0,0,0]) 
for i in body_ids:
totalangVel = totalangVel + getAngVelAboutOrigin(i)

plot.addData(t = O.time, ax = totalangVel[0],
ay = totalangVel[1], az = totalangVel[2]
)
plot.plot()

def getAngVelAboutOrigin(id):
state  = O.bodies[id].state
pos= state.pos
vel= state.vel
angMom = state.angMom
mass   = state.mass

total_ang_mom = angMom + mass*pos.cross(vel)
return total_ang_mom
# 
--
 sim setup
O.dt = .5e-2 * PWaveTimeStep()
O.saveTmp()

-- 
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 #698572]: Is it possible to constrain the motion of a body along a circle

2021-09-18 Thread Rohit John
Question #698572 on Yade changed:
https://answers.launchpad.net/yade/+question/698572

Rohit John posted a new comment:
Dear Jan,

I performed a simple test on your code. I tried simulating what would
happen a sphere hits the clump "pendulum". Then the angular velocity
about the origin was plotted against time. The system consists of the
clump and the sphere hitting the clump. Since, the external forces are
supposed to act on the hinge, the angular velocity about the hinge
should be conserved. But I see it is not conserved during the collision.
But it is conserved when the clump pendulum is rotating, suggesting your
idea works in that time. It could also be that, there is an error during
the integration of angular momentum. I have pasted the code below.

Kind regards,
Rohit K. John

# 

 Python
from yade import  plot

# 
--
 bodies
sph1 = sphere((0, -2, 2), .5)
sph2 = sphere((0, 0, 0), .5)
sph3 = sphere((0, 0, 2), .5)

sph3_id = O.bodies.append(sph3)
O.bodies[sph3_id].state.vel = [0,-1,0]

#  clump
clump_id,(sph1_id,sph2_id) = O.bodies.appendClumped((sph1,sph2))
clump = O.bodies[clump_id]
center,radius = Vector3(0,0,0), sqrt(2)

clump.state.refOri = clump.state.ori # not done automatically
clump.state.blockedDOFs = "XYZ" # to force "simple" angular integration

# 
--
 engines
O.engines = [
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),
PyRunner(command = "eccentricAxisEngine()", iterPeriod = 1),
NewtonIntegrator(gravity=(0,0,0), damping=0, label="newton"),
PyRunner(command = "plotter()", iterPeriod = 100)
]
O.dt = .5e-2 * PWaveTimeStep()


# 
--
 additional engines
#  
constraintClosesPoint
def constraintClosesPoint(pos):
delta = pos - center
direction = delta.normalized()
pos = center + direction * radius
angle = atan2(direction[2],direction[1])
ori = Quaternion()
ori.setFromTwoVectors(Vector3.UnitX,direction)
return pos,ori

#  
eccentricAxisEngine
def eccentricAxisEngine():
dt = O.dt
s = clump.state
f = O.forces.f(clump_id)
a = f / s.mass + newton.gravity
pos1 = s.pos + (s.vel+a*dt)*dt
pos0,ori0 = constraintClosesPoint(pos1)
s.vel = (pos0 - s.pos) / dt - a*dt
#
v1 = s.ori * Vector3.UnitX
v2 = ori0 * Vector3.UnitX
ang = v1.cross(v2)
ang = ang / O.dt
s.angVel = ang

#  plotter
plot.plots = {'t':('ax', 'ay', 'az')}

def plotter():
body_ids= [clump_id, sph3_id] 
totalangVel = Vector3([0,0,0]) 
for i in body_ids:
totalangVel = totalangVel + getAngVelAboutOrigin(i)

plot.addData(t = O.time, ax = totalangVel[0],
ay = totalangVel[1], az = totalangVel[2]
)
plot.plot()

#  
getAngVelAboutOrigin
def getAngVelAboutOrigin(id):
state  = O.bodies[id].state
pos= state.pos
vel= state.vel
angMom = state.angMom
mass   = state.mass

total_ang_mom = angMom + mass*pos.cross(vel)
return total_ang_mom

-- 
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 #698754]: Making video of pfacet clump: clump falling apart

2021-09-16 Thread Rohit John
New question #698754 on Yade:
https://answers.launchpad.net/yade/+question/698754

Hello all,

I am trying to make a video of a rotating pfacet clump. However, when the 
pfacet clump starts rotating it seems to be falling apart in the 3D view. 
According to Bruno Chareyre [1] #17 :

"Note: there is a display problem which makes it look as if the clumped objects 
were splitting appart. It goes back to normal when you pause the simulation. 
Nothing to worry about. (reason is: the cylinders are not dynamic objects and 
there orientation is not used anywhere in the code, so it is not updated at 
runtime - only when 3D view is refreshed orientation is recomputed for 
display)." 

So all I have to do is pause the simulation. But I want to use the snapshot 
engine to make a video. If I pause it then the simulation no longer executes. 
So is there a way I can make a video in which the pfacet does not fall apart.

Kind regards,
Rohit K. John
[1] https://answers.launchpad.net/yade/+question/695558

# 
-
 cube.gts
14 36 24 GtsSurface GtsFace GtsEdge GtsVertex
0.5 0.5 0.5
0.5 0.5 -0.5
0.5 -0.5 0.5
0.5 -0.5 -0.5
-0.5 0.5 0.5
-0.5 0.5 -0.5
-0.5 -0.5 0.5
-0.5 -0.5 -0.5
0.5 0.0 0.0
0.0 -0.5 0.0
0.0 0.0 0.5
-0.5 0.0 0.0
0.0 0.5 0.0
0.0 0.0 -0.5
6 8
2 6
1 2
8 7
3 4
5 6
3 7
1 3
8 4
7 5
5 1
4 2
9 3
2 9
4 9
1 9
10 7
4 10
8 10
3 10
11 3
5 11
7 11
1 11
12 6
7 12
8 12
5 12
13 2
5 13
6 13
1 13
14 8
2 14
6 14
4 14
7 21 23
7 17 20
6 25 28
9 33 36
8 13 16
3 29 32
12 14 15
5 15 13
3 16 14
9 18 19
4 19 17
5 20 18
11 22 24
10 23 22
8 24 21
4 26 27
1 27 25
10 28 26
6 30 31
2 31 29
11 32 30
2 34 35
1 35 33
12 36 34

# 
-
 main.py
#---
 YADE Script
from yade.gridpfacet import *
from yade import geom, utils, qt
from yade import plot
import sys, os
sys.path.append(".")

#  
input parameter
# - target
target_young = 50e9
target_density = 1000
target_poisson = 0.3
target_friction = radians(30)

p_radius = 5e-2

# 
--
 Materials
target_int_mat = 'pfacet_int_mat'
target_ext_mat = 'pfacet_ext_mat'

O.materials.append(
FrictMat(
young = target_young,
poisson = target_poisson,
density = target_density,
label = target_ext_mat,
frictionAngle = target_friction,
)
)

O.materials.append(
CohFrictMat(
young = target_young,
poisson = target_poisson,
density = target_density,
label = target_int_mat,

frictionAngle = target_friction,
normalCohesion = 3e100,
shearCohesion = 3e100,
momentRotationLaw = True,
)
)
# 
--
 Engines
O.engines = [
ForceResetter(),

InsertionSortCollider([
Bo1_GridConnection_Aabb(),
Bo1_PFacet_Aabb(),
Bo1_Sphere_Aabb(),
]),

InteractionLoop(
[
Ig2_PFacet_PFacet_ScGeom(),
Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),
Ig2_GridNode_GridNode_GridNodeGeom6D(),
Ig2_GridConnection_PFacet_ScGeom(),
Ig2_Sphere_PFacet_ScGridCoGeom(),
],
[
Ip2_FrictMat_FrictMat_FrictPhys(),
Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(
setCohesionNow = True,
setCohesionOnNewContacts = False
),
],
[
Law2_GridCoGridCoGeom_FrictPhys_CundallStrack(),
Law2_ScGeom_FrictPhys_CundallStrack(),
Law2_ScGridCoGeom_FrictPhys_CundallStrack(),
Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
],
)
]
# 
--
 objects
# -- target
(
pnode,
pcyl,
pfacet
) = gtsPFacet(
'cube.gts',
radius = p_radius,
shift = (0,0,0),
scale = 1,
wire = False,
fixed = False,
color = [0.1,0.5,0.1],
materialNodes = 'pfacet_int_mat',
material = 'pfacet_ext_mat',
)

target_ids = p

Re: [Yade-users] [Question #698572]: Is it possible to constrain the motion of a body along a circle

2021-09-06 Thread Rohit John
Question #698572 on Yade changed:
https://answers.launchpad.net/yade/+question/698572

Rohit John posted a new comment:
Dear Karol and Jan,

Thanks for taking time from your work to come up with really creative
solutions to my problem. I will test the solutions and let you know what
I find.

Kind regards,
Rohit K. John

-- 
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 #698572]: Is it possible to constrain the motion of a body along a circle

2021-09-03 Thread Rohit John
Question #698572 on Yade changed:
https://answers.launchpad.net/yade/+question/698572

Status: Answered => Open

Rohit John is still having a problem:
Dear Jan,

Thanks for clearing my doubt and your idea. I figured out a method using
Lagrangian Dynamics and Lagrangian multipliers. The Idea is to write the
Lagrangian in the Cartesian coordinates and constrain the motion using a
Lagrangian Multiplier [1] . This will result in the Newtons equation
with and additional variable and one extra equation which defines the
constrain. Solving these equations will yield a force, that constrains
the body to a circle. But solving this is expensive as one of the
equation is non linear. I have posted a derivation here [2]. The
constraining force is given by [2*x*labmda, 2*y*labmda, 2*z*labmda]

This method seems to be very slow. I think its because it involves
solving a system of equations containing one non linear equation. Please
let me know if there is a way to speed this up.

Kind regards,
Rohit K. John

[1] https://www.youtube.com/watch?v=4vwGuL07Pyo
[2] https://imgur.com/a/1l1KjOs

# 
--
 Python
from math import *
from yade import *
from yade import utils, geom
from scipy.optimize import fsolve
import math

# 
--
 bodies
sph1 = sphere((0, 0, 2),  .5)
sph2 = sphere(center=(0, 0, 0), radius=.5, fixed=True)
sph3 = sphere((0, -2, 2), .5)

sph1_id = O.bodies.append(sph1)
sph2_id = O.bodies.append(sph2)
sph3_id = O.bodies.append(sph3)

# #  
Initialising
O.bodies[sph3_id].state.vel = [0,1,0]
g= Vector3([0, 0, 0])
stiffnes = 1e7
length   = 2
lamda= 0

# 
--
 engines
O.engines = [
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom()],  # collision geometry
[Ip2_FrictMat_FrictMat_FrictPhys()],  # collision "physics"
[Law2_ScGeom_FrictPhys_CundallStrack()]  # contact law -- apply 
forces
),
PyRunner(command = "constrainingForceEngine()", iterPeriod = 1),
NewtonIntegrator(gravity=g, damping=0.0),
]

# 
--
 additional engines
def constrainingForceEngine():
"""
Calculates the constraining force required keep the particle in a circle
"""
# initializing
global lamda
m  = O.bodies[sph1_id].state.mass
dt = O.dt

x0,  y0,  z0   = O.bodies[sph1_id].state.pos
vx0, vy0, vz0  = O.bodies[sph1_id].state.vel
Fx0, Fy0, Fz0  = O.forces.f(sph1_id) +  m*g

eq = EOM_maker(x0, y0, z0, vx0 ,vy0, vz0, dt, m, Fx0, Fy0, Fz0, length)

# Solving the equation
x, y, z, vx, vy, vz, lamda =  fsolve(
eq, 
(x0,  y0,  z0, vx0, vy0, vz0, lamda)
)

# Assiging the force
Fx = 2 * lamda * x
Fy = 2 * lamda * y
Fz = 2 * lamda * z
force = Vector3([Fx, Fy, Fz])
O.forces.addF(id = sph1_id, f = force)


def EOM_maker(x0, y0, z0, vx0 ,vy0, vz0, dt, m, F0x, F0y, F0z, l):
"""
This function returns a function which is the equation of motion with an 
additional lagrangian
multiplier term (2*lamda*x) and the equation of constrain
"""
def EOM(p):
x, y, z, vx, vy, vz, lamda = p
return (
vx - vx0 - dt * (F0x + 2*lamda*x)/m,
x  - x0  - vx*dt,
vy - vy0 - dt * (F0y + 2*lamda*y)/m,
y  - y0  - vy*dt,
vz - vz0 - dt * (F0z + 2*lamda*z)/m,
z  - z0  - vz*dt,
x**2 + y**2 + z**2 - l**2
)

return EOM
# 
--
 sim setup
O.dt = .5e-2 * PWaveTimeStep()
O.saveTmp()

-- 
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 #698572]: Is it possible to constrain the motion of a body along a circle

2021-09-02 Thread Rohit John
Question #698572 on Yade changed:
https://answers.launchpad.net/yade/+question/698572

Status: Needs information => Open

Rohit John gave more information on the question:
Dear Karol,

> aren't those two statements opposite:
- You are correct, I made a mistake. It is supposed to be 
"I am trying to simulate a rigid box that is constrained to rotate about an 
axis that DOES NOT PASS through its centre of mass. "
If I wanted the axis to pass through the center of mass, then using the 
blockedDOF variable of the body is sufficient. 

 > I think that is a good time to ask about MWE
- From what I understand a MWE is required when there is an error in the code. 
I am not facing an error but require guidance on how to constrain motion. Below 
I have given an example of what I require. I am simplified the problem. Instead 
of a box, I have used a clump made of two spheres. This clump is free to rotate 
about an axis passing through one of the spheres (NOT THE CENTRE OF MASS of the 
clump). I used a penalty force method discussed in [1] to constrain the motion 
of the clump. I want to know if there are other ways to achieve this.

Kind regards,
Rohit K. John


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


# 
---
 YADE SCRIPT
from math import *
from yade import *
from yade import utils, geom

# 
--
 bodies
sph1 = sphere((0, -2, 2), .5)
sph2 = sphere(center=(0, 0, 0), radius=.5, fixed=True)

sph1_id = O.bodies.append(sph1)
sph2_id = O.bodies.append(sph2)

g=  Vector3([0,0,-10])
stiffnes = 1e7

#  clump
clump_id = O.bodies.clump([sph1_id, sph2_id])

# 
--
 engines
O.engines = [
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom()],  # collision geometry
[Ip2_FrictMat_FrictMat_FrictPhys()],  # collision "physics"
[Law2_ScGeom_FrictPhys_CundallStrack()]  # contact law -- apply 
forces
),
PyRunner(command = "eccentricAxisEngine()", iterPeriod = 1),
NewtonIntegrator(gravity=g, damping=0.0),
]

# 
--
 additional engines
def eccentricAxisEngine():
pos_0 = O.bodies[sph2_id].state.pos
force = -stiffnes*pos_0
O.forces.addF(id = sph2_id, f = force)


# 
--
 sim setup
O.dt = .5e-2 * PWaveTimeStep()
O.saveTmp()

-- 
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 #698572]: Is it possible to constrain the motion of a body along a circle

2021-09-01 Thread Rohit John
Question #698572 on Yade changed:
https://answers.launchpad.net/yade/+question/698572

Status: Needs information => Open

Rohit John gave more information on the question:
Hello Jan,

I am trying to simulate a rigid box that is constrained to rotate about
an axis that does pass through its centre of mass. The box is modelled
used pFacets and all the pFacets are clumped together. This box is
supposed to rotate freely and collide with another object, which is a
brush modelled using gridConnections.

I tried blocking the DOF of the clump. This constrains the box to rotate
about an axis passing through its centre of mass. I require it to rotate
about an axis that is eccentric, one that does not pass through the
centre of mass. From what I understand, the rotationEngine forces the
body to rotate about a given axis at a given angular velocity. I want
the body to rotate freely and react to collisions. Is that possible with
the rotationEngine?

Thanks and Kind regards,
Rohit K. John

-- 
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 #698572]: Is it possible to constrain the motion of a body along a circle

2021-08-30 Thread Rohit John
New question #698572 on Yade:
https://answers.launchpad.net/yade/+question/698572

Hello,

I want to constrain the motion of a body to a circle. The answer given in [1], 
recommends using a penalty force to constrain the motion of the body. If large 
forces act on the body, I suppose this method will not work unless the 
stiffness of the penalty force is increased. But I suppose this increase would 
require smaller dt to be stable. So is there any other way to constrain the 
motion of a body along a circle, one which does not lower the dt?

Kind regards,
Rohit K. John


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

-- 
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 #697791]: yade installation: AttributeError: module 'mpmath.ctx_mp_python' has no attribute 'mpf'

2021-07-02 Thread Rohit John
Question #697791 on Yade changed:
https://answers.launchpad.net/yade/+question/697791

Status: Answered => Solved

Rohit John confirmed that the question is solved:
Dear Janek Kozicki,

Thanks for your advice. The problem is solved. I did the following

- uninstalling mpmath using pip
$ pip3 uninstall mpmath. 
This did not work

- Uninstalling mpmath using apt-get
$ sudo apt-get remove python3-mpmath
This uninstalled mpmath

- Reinstall mpmath using command given in [1]
$ sudo apt install cmake git freeglut3-dev libloki-dev libboost-all-dev 
fakeroot \
dpkg-dev build-essential g++ python3-dev python3-ipython python3-matplotlib \
libsqlite3-dev python3-numpy python3-tk gnuplot libgts-dev python3-pygraphviz \
libvtk6-dev libeigen3-dev python3-xlib python3-pyqt5 pyqt5-dev-tools 
python3-mpi4py \
python3-pyqt5.qtwebkit gtk2-engines-pixbuf python3-pyqt5.qtsvg 
libqglviewer-dev-qt5 \
python3-pil libjs-jquery python3-sphinx python3-git libxmu-dev libxi-dev 
libcgal-dev \
help2man libbz2-dev zlib1g-dev libopenblas-dev libsuitesparse-dev \
libmetis-dev python3-bibtexparser python3-future coinor-clp coinor-libclp-dev \
python3-mpmath libmpfr-dev libmpfrc++-dev

This installed mpmath

When I ran yade it worked.

Kind regards,
Rohit K. John
[1] https://yade-dem.org/doc/installation.html#source-code

-- 
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 #697791]: yade installation: AttributeError: module 'mpmath.ctx_mp_python' has no attribute 'mpf'

2021-07-01 Thread Rohit John
Question #697791 on Yade changed:
https://answers.launchpad.net/yade/+question/697791

Status: Answered => Open

Rohit John is still having a problem:
Dear Janek Kozicki,

I thought pip was the standard method to install python modules.

I am able to import mpmath to python, however, it says it does not have
the attribute 'mpf' in it. Moreover, I had this problem way before I
tried installing mpmath using pip.

Kind regards,
Rohit K. John

-- 
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 #697791]: yade installation: AttributeError: module 'mpmath.ctx_mp_python' has no attribute 'mpf'

2021-06-30 Thread Rohit John
New question #697791 on Yade:
https://answers.launchpad.net/yade/+question/697791

Hello,

I tried compiling yade in my Ubuntu 20.04 machine. I followed the instructions 
in [1]. The compilation completed without any errors. However, when I try to 
run yade, I get the following:

rohit@rkj-hp:~/personal/yade_source/yade_2020/install/bin$ 
./yade-2020-11-05.git-7d0ae90
Welcome to Yade 2020-11-05.git-7d0ae90 
Using python version: 3.8.5 (default, May 27 2021, 13:30:53) 
[GCC 9.3.0]
TCP python prompt on localhost:9000, auth cookie `ycaekd'
XMLRPC info provider on http://localhost:21000
Traceback (most recent call last):
  File "./yade-2020-11-05.git-7d0ae90", line 416, in 
import yade.qt
  File 
"/home/rohit/personal/yade_source/yade_2020/install/lib/x86_64-linux-gnu/yade-2020-11-05.git-7d0ae90/py/yade/qt/__init__.py",
 line 22, in 
from yade.qt.Inspector import *
  File 
"/home/rohit/personal/yade_source/yade_2020/install/lib/x86_64-linux-gnu/yade-2020-11-05.git-7d0ae90/py/yade/qt/Inspector.py",
 line 8, in 
from yade.qt.SerializableEditor import *
  File 
"/home/rohit/personal/yade_source/yade_2020/install/lib/x86_64-linux-gnu/yade-2020-11-05.git-7d0ae90/py/yade/qt/SerializableEditor.py",
 line 399, in 
_fundamentalEditorMap[mpmath.ctx_mp_python.mpf]=AttrEditor_Mpmath
AttributeError: module 'mpmath.ctx_mp_python' has no attribute 'mpf'

I tried installing mpmath using pip3 install mpmath and I got the following:
Requirement already satisfied: mpmath in /usr/lib/python3/dist-packages (1.1.0)

How do I fix this? Please let me know if I have missed any information.


Kind regards,
Rohit K. John

[1] https://yade-dem.org/doc/installation.html#source-code

-- 
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 #697465]: Angular momentum of pfacet clump not conserved after collision

2021-06-09 Thread Rohit John
Question #697465 on Yade changed:
https://answers.launchpad.net/yade/+question/697465

Summary changed to:
Angular momentum of pfacet clump not conserved after collision

-- 
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 #697465]: angular momentum of pfacet clump not conserved after collision

2021-06-09 Thread Rohit John
New question #697465 on Yade:
https://answers.launchpad.net/yade/+question/697465

Hello,

In the following simulation, two sphere are fired in opposite direction at a 
pfacet box clump. Ideally after collision, the box starts rotating and the 
spheres move in the opposite direction (opposite to their corresponding initial 
velocity) such that the angular momentum of the whole system is conserved. I 
want to change the inertia and the mass of the pfacet box clump, so I did that 
using the lines 

O.bodies[target_clump_ID].state.inertia = Vector3([10,10,10])  
O.bodies[target_clump_ID].state.mass = 1

When I do this, the angular momentum of the system is not conserved. Am I not 
seeing something here, have I made a mistake?

Moreover, in the comment #20 of [1], it was found that for pfacet clump to have 
correct dynamics, we should set the mass of the cylinder connections to 0 (as 
the mass is supposed to be concentrated at the nodes). But when I do that I am 
no longer able to access the angular momentum of the clump using 
O.bodies[target_clump_ID].state.angMom as it returns Vector3(0,0,0). How do I 
fix this? The only work around I found was to set the mass close to zero 
(1e-10) instead of 0. But is there a proper fix for this?

Kind regards,
Rohit K. John

https://answers.launchpad.net/yade/+question/695558

# GTS file
# 

14 36 24 GtsSurface GtsFace GtsEdge GtsVertex
0.5 0.5 0.5
0.5 0.5 -0.5
0.5 -0.5 0.5
0.5 -0.5 -0.5
-0.5 0.5 0.5
-0.5 0.5 -0.5
-0.5 -0.5 0.5
-0.5 -0.5 -0.5
0.5 0.0 0.0
0.0 -0.5 0.0
0.0 0.0 0.5
-0.5 0.0 0.0
0.0 0.5 0.0
0.0 0.0 -0.5
6 8
2 6
1 2
8 7
3 4
5 6
3 7
1 3
8 4
7 5
5 1
4 2
9 3
2 9
4 9
1 9
10 7
4 10
8 10
3 10
11 3
5 11
7 11
1 11
12 6
7 12
8 12
5 12
13 2
5 13
6 13
1 13
14 8
2 14
6 14
4 14
7 21 23 
7 17 20 
6 25 28 
9 33 36 
8 13 16 
3 29 32 
12 14 15 
5 15 13 
3 16 14 
9 18 19 
4 19 17 
5 20 18 
11 22 24 
10 23 22 
8 24 21 
4 26 27 
1 27 25 
10 28 26 
6 30 31 
2 31 29 
11 32 30 
2 34 35 
1 35 33 
12 36 34 


# script
# 

from yade.gridpfacet import *
from yade import *
from yade import geom, utils
from yade import plot
import sys, os
sys.path.append(".")

#  
input parameter
# - target
target_young= 50e9
target_density  = 1000
target_poisson  = 0.3
target_friction = radians(30)

p_radius = 5e-2

#  
Materials
target_int_mat = 'pfacet_int_mat'
target_ext_mat = 'pfacet_ext_mat'

O.materials.append(
FrictMat(
young   = target_young,
poisson = target_poisson,
density = target_density,
label   = target_ext_mat,
frictionAngle = target_friction,
)
)

O.materials.append(
CohFrictMat(
young   = target_young,
poisson = target_poisson,
density = target_density,
label   = target_int_mat,

frictionAngle = target_friction,
normalCohesion= 3e100,
shearCohesion = 3e100,
momentRotationLaw = True,
))
#  
Engines
O.engines = [
ForceResetter(),

InsertionSortCollider([
Bo1_GridConnection_Aabb(),
Bo1_PFacet_Aabb(),
Bo1_Sphere_Aabb(),
]),

InteractionLoop(
[
Ig2_PFacet_PFacet_ScGeom(),
Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),
Ig2_GridNode_GridNode_GridNodeGeom6D(),
Ig2_GridConnection_PFacet_ScGeom(),
Ig2_Sphere_PFacet_ScGridCoGeom(),
],
[
Ip2_FrictMat_FrictMat_FrictPhys(),
Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(
setCohesionNow = True, 
setCohesionOnNewContacts = False
),
],
[
Law2_GridCoGridCoGeom_FrictPhys_CundallStrack(),
Law2_ScGeom_FrictPhys_CundallStrack(),
Law2_ScGridCoGeom_FrictPhys_CundallStrack(),
Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
],
)
] 
#  
objects 
# - target
(
pnode,
pcyl,
pfacet 
) = gtsPFacet(
'cube.gts',
radius = p_

Re: [Yade-users] [Question #697249]: extMaterial in cylinderConnection gridpfacet.py not used

2021-05-26 Thread Rohit John
Question #697249 on Yade changed:
https://answers.launchpad.net/yade/+question/697249

Status: Answered => Solved

Rohit John 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 #697249]: extMaterial in cylinderConnection gridpfacet.py not used

2021-05-26 Thread Rohit John
Question #697249 on Yade changed:
https://answers.launchpad.net/yade/+question/697249

Status: Answered => Open

Rohit John is still having a problem:
Hi Bruno,

I thought the intMaterial is CohFrictMat whereas the external material
would be FrictMat. In that case wouldn't we need two materials? Just to
be clear, the function cylinderConnection() takes in two materials,
intMaterial and extMaterial, as arguments. (They are just the names of
the arguments in the code). I was under the impression that you pass  a
CohFrictMat material into intMaterial and a FrictMat material into
extMaterial. The way the code is written now [1], the nodes and the
connections use the name material. My questions is shouldn't they use
two materials as the interactions are different (internal interaction
and external interaction as you put it).

Kind regards,
Rohit K. John

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

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

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


[Yade-users] [Question #697249]: extMaterial in cylinderConnection gridpfacet.py not used

2021-05-26 Thread Rohit John
New question #697249 on Yade:
https://answers.launchpad.net/yade/+question/697249

Hello all,

I was going through the code in  gridpfacet.py [1] and I found that in the 
definition of the cylinderConnection() function, I found that the argument 
extMaterial is not used. Is it by design or is that a mistake? I though the 
nodes were supposed to be assigned intMaterial while the gridConnections were 
supposed to have extMaterial.

Kind regards,
Rohit K. John

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

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

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


[Yade-users] [Question #697145]: Is it possible to simulate a conical grid connection?

2021-05-19 Thread Rohit John
New question #697145 on Yade:
https://answers.launchpad.net/yade/+question/697145

Hello,

I have been working with grid connections to simulate bristles of a brush. I 
wanted to know if it possible to simulation a bristle whose diameter changes 
linearly along its lenght (like a cone). Is it possible to have a grid 
connection such that the two nodes on its ends have different radii?

Kind regards,
Rohit K. John

-- 
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 #696376]: Contact between sphere-gridconnection not detected in a pfacet edge

2021-04-08 Thread Rohit John
Question #696376 on Yade changed:
https://answers.launchpad.net/yade/+question/696376

Rohit John posted a new comment:
Dear Klaus,

Thanks for working on fixing this bug. Shall I post on launchpad if I
find any additional bugs?

Kind regards,
Rohit K. John

-- 
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 #695558]: Dynamics of pfacet object does not appear to be correct

2021-04-06 Thread Rohit John
Question #695558 on Yade changed:
https://answers.launchpad.net/yade/+question/695558

Status: Answered => Open

Rohit John is still having a problem:
Dear Bruno,

I have found one more bug. The angular momentum value of the clump
returns (0,0,0) even though inertia is not 0 and angular velocity is not
0. This happens when I set the mass of the gridConnections to 0.
However, if I do not do this, I get a non zero value for the angular
momentum.

In the simulation, two sphere moving the opposite direction. They are
not collinear, they are offset. One is offset in the +y while the other
in the -y direction. The are set to contact a pfacet cube at the same
moment of time on opposite faces. I wanted to check if the angular
momentum was conserved. It turns out that it is not conserved.

I am using ubuntu 18.04. I found this error in  yade-2021-03-22.git-096f9a3, 
yade-2020-11-05.git-7d0ae90
 and Yade 2018.02b. All of them showed this bug


Kind regards,
Rohit K. John

# GTS FILE. File name = 
'cube.gts'
14 36 24 GtsSurface GtsFace GtsEdge GtsVertex
0.5 0.5 0.5
0.5 0.5 -0.5
0.5 -0.5 0.5
0.5 -0.5 -0.5
-0.5 0.5 0.5
-0.5 0.5 -0.5
-0.5 -0.5 0.5
-0.5 -0.5 -0.5
0.5 0.0 0.0
0.0 -0.5 0.0
0.0 0.0 0.5
-0.5 0.0 0.0
0.0 0.5 0.0
0.0 0.0 -0.5
6 8
2 6
1 2
8 7
3 4
5 6
3 7
1 3
8 4
7 5
5 1
4 2
9 3
2 9
4 9
1 9
10 7
4 10
8 10
3 10
11 3
5 11
7 11
1 11
12 6
7 12
8 12
5 12
13 2
5 13
6 13
1 13
14 8
2 14
6 14
4 14
7 21 23 
7 17 20 
6 25 28 
9 33 36 
8 13 16 
3 29 32 
12 14 15 
5 15 13 
3 16 14 
9 18 19 
4 19 17 
5 20 18 
11 22 24 
10 23 22 
8 24 21 
4 26 27 
1 27 25 
10 28 26 
6 30 31 
2 31 29 
11 32 30 
2 34 35 
1 35 33 
12 36 34 

#---
 YADE Script
from yade.gridpfacet import *
from yade import geom, utils
from yade import plot
import sys, os
sys.path.append(".")

#  
input parameter
# - target
target_young= 50e9
target_density  = 1000
target_poisson  = 0.3
target_friction = radians(30)

p_radius = 5e-2

# 
--
 Materials
target_int_mat = 'pfacet_int_mat'
target_ext_mat = 'pfacet_ext_mat'

O.materials.append(
FrictMat(
young   = target_young,
poisson = target_poisson,
density = target_density,
label   = target_ext_mat,
frictionAngle = target_friction,
)
)

O.materials.append(
CohFrictMat(
young   = target_young,
poisson = target_poisson,
density = target_density,
label   = target_int_mat,

frictionAngle = target_friction,
normalCohesion= 3e100,
shearCohesion = 3e100,
momentRotationLaw = True,
)
)
# 
--
 Engines
O.engines = [
ForceResetter(),

InsertionSortCollider([
Bo1_GridConnection_Aabb(),
Bo1_PFacet_Aabb(),
Bo1_Sphere_Aabb(),
]),

InteractionLoop(
[
Ig2_PFacet_PFacet_ScGeom(),
Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),
Ig2_GridNode_GridNode_GridNodeGeom6D(),
Ig2_GridConnection_PFacet_ScGeom(),
Ig2_Sphere_PFacet_ScGridCoGeom(),
],
[
Ip2_FrictMat_FrictMat_FrictPhys(),
Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(
setCohesionNow = True, 
setCohesionOnNewContacts = False
),
],
[
Law2_GridCoGridCoGeom_FrictPhys_CundallStrack(),
Law2_ScGeom_FrictPhys_CundallStrack(),
Law2_ScGridCoGeom_FrictPhys_CundallStrack(),
Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
],
)
] 
# 
--
 objects 
# -- target
(
pnode,
pcyl,
pfacet 
) = gtsPFacet(
'cube.gts',
radius = p_radius,
shift  = (0,0,0),
scale  = 1,
wire   = False,
fixed  = False,
color  = [0.1,0.5,0.1],
materialNodes = 'pfacet_int_mat',
material  = 'pfacet_ext_mat',
)


target_ids  = pnode + pcyl + pfacet
for i in pcyl:
O.bodies[i].state.mass = 0

target_clump_ID = O.bodies.clump(targ

[Yade-users] [Question #696376]: Contact between sphere-gridconnection not detected in a pfacet edge

2021-04-03 Thread Rohit John
New question #696376 on Yade:
https://answers.launchpad.net/yade/+question/696376

Hello,

The simulation consists of two sphere moving towards two edges of pfacet 
triangle. They just pass through the edges without any interaction. I think 
there could be something wrong with the engines I'm using, but I could not find 
it. Kindly help me. The code is given below.

Kind regards,
Rohit K John

#  
Code
from yade import geom, utils
from yade.gridpfacet import *

#  
input parameter
# - target
target_young= 50e9
target_density  = 1000
target_poisson  = 0.3
target_friction = radians(30)

p_radius = 5e-2
pfacet_side   = 0.5
pfacet_circum_rad = pfacet_side/sqrt(3) 
node_angle= [radians(0), radians(120), radians(240)]
pfacet_nodes  = [
Vector3([2*pfacet_circum_rad * cos(node_angle[0]),   pfacet_circum_rad * 
sin(node_angle[0]),   0]),
Vector3([pfacet_circum_rad * cos(node_angle[1]),   pfacet_circum_rad * 
sin(node_angle[1]),   0]),
Vector3([pfacet_circum_rad * cos(node_angle[2]),   pfacet_circum_rad * 
sin(node_angle[2]),   0]),
]
#  
Materials
target_int_mat = 'pfacet_int_mat'
target_ext_mat = 'pfacet_ext_mat'

O.materials.append(
FrictMat(
young   = target_young,
poisson = target_poisson,
density = target_density,
label   = target_ext_mat,
frictionAngle = target_friction,
)
)

O.materials.append(
CohFrictMat(
young   = target_young,
poisson = target_poisson,
density = target_density,
label   = target_int_mat,

frictionAngle = target_friction,
normalCohesion= 3e100,
shearCohesion = 3e100,
momentRotationLaw = True,
)
)
#  
Engines
O.engines = [
ForceResetter(),

InsertionSortCollider([
Bo1_GridConnection_Aabb(),
Bo1_PFacet_Aabb(),
Bo1_Sphere_Aabb(),
]),

InteractionLoop(
[
Ig2_PFacet_PFacet_ScGeom(),
Ig2_GridNode_GridNode_GridNodeGeom6D(),
Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),
Ig2_GridConnection_PFacet_ScGeom(),
Ig2_Sphere_PFacet_ScGridCoGeom(),
Ig2_Sphere_GridConnection_ScGridCoGeom(),
Ig2_Sphere_Sphere_ScGeom()
],
[
Ip2_FrictMat_FrictMat_FrictPhys(),
Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(
setCohesionNow = True, 
setCohesionOnNewContacts = False
),
],
[
Law2_GridCoGridCoGeom_FrictPhys_CundallStrack(),
Law2_ScGeom_FrictPhys_CundallStrack(),
Law2_ScGridCoGeom_FrictPhys_CundallStrack(),
Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
],
),
NewtonIntegrator(gravity = [0,0,0], damping = 0.0),
] 
#  
objects 
# - target



pnode  = []
pcyl   = []
pfacet = []
pfacetCreator1(
pfacet_nodes,
p_radius,
nodesIds = pnode,
cylIds   = pcyl,
pfIds= pfacet,
wire = False,
fixed = False,
color = [0.5,0.5,0.5],
materialNodes = target_int_mat,
material  = target_ext_mat,
)

target_ids  = pnode + pcyl + pfacet
# - spheres
sp1 = sphere([0,  0.25, .2], 5e-2, material = target_ext_mat)
sp2 = sphere([0, -0.25,-.2], 5e-2, material = target_ext_mat)

sp1_ID = O.bodies.append(sp1)
sp2_ID = O.bodies.append(sp2)

O.bodies[sp1_ID].state.vel = [0,0,-5]
O.bodies[sp2_ID].state.vel = [0,0, 5]

# - Simulation params
O.dt = utils.PWaveTimeStep()
O.saveTmp()

-- 
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 #695558]: Dynamics of pfacet object does not appear to be correct

2021-03-24 Thread Rohit John
Question #695558 on Yade changed:
https://answers.launchpad.net/yade/+question/695558

Rohit John posted a new comment:
Dear Bruno,

Thanks for your explanation. I will look into it. How do I open a bug
and what information should I put into it?

Kind regards,
Rohit

-- 
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 #695558]: Dynamics of pfacet object does not appear to be correct

2021-03-23 Thread Rohit John
Question #695558 on Yade changed:
https://answers.launchpad.net/yade/+question/695558

Rohit John gave more information on the question:
Dear Bruno,

I think I found a solution. I found that setting the mass of the
grdiConnections to 0 seemed to fix the problem of the triangular object
rotation. It also seem to fix the example I had given above. Please let
me know if I should add the whole code. I just added the lines given
below after creating the pfacet.

# add this before clumping
for i in pcyl:
O.bodies[i].state.mass = 0

Moreover, setting the mass of all the nodes to be equal also fixed the
other issue (observation 1 in the above comment). Please let me know
what you think.

Kind regards,
Rohit K. John

-- 
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 #695558]: Dynamics of pfacet object does not appear to be correct

2021-03-23 Thread Rohit John
Question #695558 on Yade changed:
https://answers.launchpad.net/yade/+question/695558

Status: Answered => Open

Rohit John is still having a problem:
Dear Bruno,

Thanks for you swift reply.
> Best method is to download the sources with git [1], then you update with "cd 
> trunk; git pull".
- I shall try this and get back to you. In [2] it is mentioned that Ubuntu18.04 
has YADE 2018. Will there be any errors when I use the latest version compiled 
in my computer?

> It looks a bit like a ball-on-a-tip problem. This triangular object has to 
> fall one way or the other since it is in very unstable equilibrium, so I'm 
> not surprised that it rotates (which doesn't mean there is no problem, maybe 
> you have more insight?).
- If you do not clump the pfacets, triangular object remains on the bristles. I 
expected the simulation with the clump and one without the clump to have 
similar dynamics. 

> Note: there is a display problem which makes it look as if the clumped 
> objects were splitting appart. 
- Thanks for your advice. It is not just this. 

In the following I have put a code simulating two collisions (sphere-
sphere and sphere-pfacet). I have made it so that the sphere contacts
the pfacet at its centroid (centre of mass) and the pfacet body and
spheres have the same mass. I expect the pfacet to move without any
rotation, but it does. I have two observations.

1) The mass of the pfacet is not equally distributed to the node - this
is causing an unexpected rotation. This can be solved if the pfacet is
an equilateral triangle (remove the '2*' in the line
Vector3([2*pfacet_circum_rad * cos(node_angle[0]),   pfacet_circum_rad *
sin(node_angle[0]),   0]),).

2) If you clump the pfacet together, then the collision dynamics appears
to be different. But if they are not clumped together, the motion of the
pfacet and sphere after collision are the same (as expected)

Kind regards,
Rohit K. John

[2] https://yade-dem.org/doc/installation.html

from yade import utils
from yade.gridpfacet import *

# --- Data
sphere_young= 1e9
sphere_poisson  = 0.3
sphere_friction = 30

sphere_radius   = 0.1
sphere_1_position = [0, 0, 3 * sphere_radius]
sphere_2_position = [0, 5 * sphere_radius, 0]
sphere_3_position = [0, 5 * sphere_radius, 3 * sphere_radius]


pfacet_side   = 0.5
pfacet_circum_rad = pfacet_side/sqrt(3) 
pfacet_grid_rad   = sphere_radius
node_angle= [radians(0), radians(120), radians(240)]
pfacet_nodes  = [
Vector3([2*pfacet_circum_rad * cos(node_angle[0]),   pfacet_circum_rad * 
sin(node_angle[0]),   0]),
Vector3([pfacet_circum_rad * cos(node_angle[1]),   pfacet_circum_rad * 
sin(node_angle[1]),   0]),
Vector3([pfacet_circum_rad * cos(node_angle[2]),   pfacet_circum_rad * 
sin(node_angle[2]),   0]),
]

pfacet_centroid = (pfacet_nodes[0] + pfacet_nodes[1] + pfacet_nodes[2])/3
pfacet_nodes= [
pfacet_nodes[0] - pfacet_centroid,
pfacet_nodes[1] - pfacet_centroid, 
pfacet_nodes[2] - pfacet_centroid
]


pfacet_young= sphere_young
pfacet_poisson  = sphere_poisson
pfacet_density  = 1000
pfacet_friction = sphere_friction
# --- Material
pfacet_int_mat  = "pfacet_int_mat"
pfacet_ext_mat  = "pfacet_ext_mat"

O.materials.append(
FrictMat(
young = pfacet_young,
poisson = pfacet_poisson,
density = pfacet_density,
label = 'pfacet_ext_mat',
frictionAngle = radians(pfacet_friction),
)
)

O.materials.append(
CohFrictMat(
young = pfacet_young,
poisson = pfacet_poisson,
density = pfacet_density,
label = 'pfacet_int_mat',

frictionAngle = radians(pfacet_friction),
momentRotationLaw = True,
normalCohesion = 1e40,
shearCohesion = 1e40,
)
)
# --- Engines
O.engines = [
ForceResetter(),
InsertionSortCollider([
Bo1_Sphere_Aabb(),
Bo1_GridConnection_Aabb(),
Bo1_PFacet_Aabb(), 
]),
InteractionLoop([
Ig2_GridNode_GridNode_GridNodeGeom6D(),
Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),   # 
cylinder-cylinder interaction
Ig2_Sphere_PFacet_ScGridCoGeom(),   # needed for 
GridNode-pFacet interaction (why is this not included in 
Ig2_GridConnection_PFacet_ScGeom???)
Ig2_GridConnection_PFacet_ScGeom(), # Cylinder-pFcet 
interaction
Ig2_Sphere_Sphere_ScGeom(),
],
[

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

Re: [Yade-users] [Question #695558]: Dynamics of pfacet object does not appear to be correct

2021-03-23 Thread Rohit John
Question #695558 on Yade changed:
https://answers.launchpad.net/yade/+question/695558

Status: Expired => Open

Rohit John is still having a problem:
Dear Klaus Thoeni,

I used the fix mentioned in [1] to fix the problem I was facing. And it
does fix the dynamics my simulation (see code in the first description
of this problem). However, I ran into a problem when I clumped the
pfacet together (I added the nodes, gridconnection and pfacets into one
clump). The clump is having an unexpected rotation. I have put the code
below.

I did not download a new version of yade. But I pasted the fix given in
[1] into the YADE source code I am using and recompiled it. Is this a
correct way to use this fix? I am using Ubuntu 18.04.5 LTS.


Kind regards,
Rohit K. John

[1] https://gitlab.com/yade-
dev/trunk/-/merge_requests/628/diffs?commit_id=fc8e01415108ffd30503bbc37234d51d8d0b0499

# 

 code
from yade import plot, utils
from yade.gridpfacet import *

# -- 
defining material
bristle_radius = 1e-3
bristle_length = 0.1
bristle_seg_no = 5

bristle_young = 3e9
bristle_poisson = 0.3
bristle_density = 1000
bristle_friction = radians(30)

grid_radius = 1e-3
target_young = 30e9
target_poisson = 0.3
target_density = 1
target_friction = radians(30)

# -- 
material
O.materials.append(
FrictMat(
young = bristle_young,
poisson = bristle_poisson,
density = bristle_density,
label = 'cyl_ext_mat',
frictionAngle = bristle_friction,
)
)

O.materials.append(
CohFrictMat(
young = bristle_young,
poisson = bristle_poisson,
density = bristle_density,
label = 'cyl_int_mat',

frictionAngle = bristle_friction,
momentRotationLaw = True,
normalCohesion = 1e40,
shearCohesion = 1e40,
)
)

O.materials.append(
FrictMat(
young = target_young,
poisson = target_poisson,
density = target_density,
label = 'pfacet_ext_mat',
frictionAngle = target_friction,
)
)

O.materials.append(
CohFrictMat(
young = 100*target_young,
poisson = target_poisson,
density = target_density,
label = 'pfacet_int_mat',

frictionAngle = target_friction,
momentRotationLaw = True,
normalCohesion = 1e40,
shearCohesion = 1e40,
)
)

# -- Engines
O.engines = [
ForceResetter(),
InsertionSortCollider([
Bo1_GridConnection_Aabb(),
Bo1_PFacet_Aabb(),
]),
InteractionLoop(
[
Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),
Ig2_GridNode_GridNode_GridNodeGeom6D(),
Ig2_PFacet_PFacet_ScGeom(),
Ig2_GridConnection_PFacet_ScGeom(),
Ig2_Sphere_PFacet_ScGridCoGeom(),
],
[
Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow = True, 
setCohesionOnNewContacts = False),
Ip2_FrictMat_FrictMat_FrictPhys()
],
[
Law2_GridCoGridCoGeom_FrictPhys_CundallStrack(),
Law2_ScGeom_FrictPhys_CundallStrack(),
Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
Law2_ScGridCoGeom_FrictPhys_CundallStrack(),
]
),
NewtonIntegrator(gravity = (0,0,-10),damping = 0.0)
]
# -- bodies
# - custome brush
nodesIds=[]
cylIds=[]

# bristle root location
base_pos = [
[0.003, 0.003, 0],
[0.003, -0.003, 0],
[-0.003, 0.003, 0],
[-0.003, -0.003, 0],
]
dz = bristle_length / bristle_seg_no # grid connection length

for i in base_pos:
bristle = []
for j in range(bristle_seg_no + 1):
bristle.append([
i[0],
i[1],
bristle_length - (i[2] + dz * j)
])
cylinderConnection(
bristle,
bristle_radius,
nodesIds,
cylIds,
color=[1,0,0],
intMaterial='cyl_int_mat',
extMaterial='cyl_ext_mat'
)
O.bodies[nodesIds[-1]].state.blockedDOFs='xyzXYZ'

# - manaul target
origin = [
0,
0,
bristle_length + bristle_radius + grid_radius
]

x_len = 0.03
y_len = 0.05
z_len = 0.05
nodes = [
[x_len, 0, 0 + origin[2]],
[-x_len, 0, 0 + origin[2]],
[0.0, y_len, z_len + origin[2]],
[0.0,-y_len, z_len + origin[2]],
]

pfacet_nodes = [
[nodes[0], nodes[1], nodes[2]],
[nodes[0], nodes[3], nodes[1]],
]

pnode = []
pcyl = []
pfacet = []
for i in pfacet_nodes:
print(i)
pfacetCreator1(
i,
grid_radius

Re: [Yade-users] [Question #695545]: There is an error fixing DOFs of pfacet?

2021-03-12 Thread Rohit John
Question #695545 on Yade changed:
https://answers.launchpad.net/yade/+question/695545

Status: Answered => Solved

Rohit John confirmed that the question is solved:
Thanks Klaus Thoeni, 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 #695558]: Dynamics of pfacet object does not appear to be correct

2021-03-02 Thread Rohit John
Question #695558 on Yade changed:
https://answers.launchpad.net/yade/+question/695558

Rohit John gave more information on the question:
Dear Klaus Thoeni,

I was playing around with the pfacet and I found a discrepancy in mass
of the nodes in a pfacet. I calculated the mass of the nodes using the
pfacet radius, the density of the material. The mass observed
(O.bodies[id].state.mass) and mass I calculated is not equal. Moreover,
changing the size of the pfacet changed the mass and the mass is not
equally distributed to the nodes. [1] says that "The mass of the PFacet
is equally lumped into the 3 nodes." so I thought the mass should be
equal for all nodes.

[1]  Effeindzourou, A., Thoeni, K., Chareyre, B., & Giacomini, A.
(2015). A general method for modelling deformable structures in DEM.
Proceedings of the 4th International Conference on Particle-Based
Methods - Fundamentals and Applications, PARTICLES 2015, October 2018,
744–754.

Kind regards,
Rohit John

Please find the code for this 
# 
---
# encoding: utf-8
from yade import qt
from yade.gridpfacet import *


###
#   ENGINES   #
###

O.engines=[
ForceResetter(),
InsertionSortCollider([
Bo1_Sphere_Aabb(),
Bo1_Wall_Aabb(),
Bo1_PFacet_Aabb(),
],sortThenCollide=True),
InteractionLoop(
[
Ig2_GridNode_GridNode_GridNodeGeom6D(),
Ig2_Sphere_PFacet_ScGridCoGeom(),
Ig2_Wall_PFacet_ScGeom(),
Ig2_Wall_Sphere_ScGeom()
],
[

Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False),
Ip2_FrictMat_FrictMat_FrictPhys()],
[
Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
Law2_ScGeom_FrictPhys_CundallStrack(),
Law2_ScGridCoGeom_FrictPhys_CundallStrack(),
Law2_GridCoGridCoGeom_FrictPhys_CundallStrack()
]),
GlobalStiffnessTimeStepper(timestepSafetyCoefficient=0.8,label='ts'), 
NewtonIntegrator(gravity=(0,-9.81,0),damping=0.1,label='newton')
]

young   = 1e9
density = 1e3
poisson = 0.3
friction= 30

O.materials.append(
CohFrictMat(
young=young,
poisson=poisson,
density=density,
frictionAngle=radians(friction),
normalCohesion=3e7,
shearCohesion=3e7,
momentRotationLaw=True,
label='gridNodeMat'
))
O.materials.append(
FrictMat(
young=young,
poisson=poisson,
density=density,
frictionAngle=radians(friction),
label='gridConnectionMat'
))


###
#   PFacet creators   #
###

fixed = False
color=[255./255.,102./255.,0./255.]

nodesIds = []
cylIds   = []
pfIds= []

#position of the node in the middle
r = 0.05

## Option 2: pfacetCreator1(vertices) -> based on 3 vertices
scale = 2

v1=Vector3(2,   0, 0) * scale
v2=Vector3(3,   0, 0) * scale
v3=Vector3(2.5, 2, 0) * scale
vertices=[v1,v2,v3]

pfacetCreator1(
vertices,
r,
nodesIds=nodesIds,
cylIds=cylIds,
pfIds=pfIds,
wire=False,
color=color,
fixed=fixed,
materialNodes='gridNodeMat',
material='gridConnectionMat')

print('Mass of node 0: ', O.bodies[nodesIds[0]].state.mass)
print('Mass of node 1: ', O.bodies[nodesIds[1]].state.mass)
print('Mass of node 2: ', O.bodies[nodesIds[2]].state.mass)
print('Calculated Mass: ', 4.0/3.0 * pi * r**3 * density)
#
#   Wall  ###
#

O.bodies.append(utils.wall(position=-1,sense=0,
axis=1,color=Vector3(1,0,0),material='gridConnectionMat'))


qt.View()
O.saveTmp()

-- 
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 #689485]: ERROR:root:Unable to guess python type from cxx type 'vector >'

2021-02-25 Thread Rohit John
Question #689485 on Yade changed:
https://answers.launchpad.net/yade/+question/689485

Rohit John posted a new comment:
Hello all,

I was facing a similar issue in Yade 2018.02b in Ubuntu 18.04.5 LTS. I
tried it on Yade 2020-11-05.git-7d0ae90  and I did not get an error. So
this problem is fixed in a new version of YADE.

Kind regards,
Rohit K. John

-- 
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 #695558]: Dynamics of pfacet object does not appear to be correct

2021-02-24 Thread Rohit John
Question #695558 on Yade changed:
https://answers.launchpad.net/yade/+question/695558

Rohit John posted a new comment:
In the comment above, I have given the code which highlights the bug.
I've modified the mikado example [1]. The newton damping is set to 0,
but you can still see this bug when it is not 0. I removed the random
lenghts and raised the position of the cylinders

[1] https://gitlab.com/yade-
dev/trunk/-/blob/master/examples/cylinders/mikado.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 #695558]: Dynamics of pfacet object does not appear to be correct

2021-02-24 Thread Rohit John
Question #695558 on Yade changed:
https://answers.launchpad.net/yade/+question/695558

Rohit John gave more information on the question:
Dear Klaus,

I was testing the mikado example [1], and I found an bug. This example
has many vertical cylinders on a pfacet square. In [1], the lengths are
random and the cylinders start in contact with the pfacet. I modified
this slightly so that the cylinders have the same length and start from
a height above the pfacet. The cylinders contacting the diagonal of the
square bounce differently compared to the rest. Since all cylinders have
the same height and dimension, I expect all of them to bounce uniformly.

Kind regards,
Rohit K. John

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

#  code
# encoding: utf-8
"An example showing how two create cylinders with random length."

# from builtins import range
from yade.gridpfacet import *

 Parameters 
Lmin=3. # minimum length
Lmax=6. # maximum length 
n=10# number of cylinders in one direction
r=0.5   # radius of the cylinder element
phi=30. # friction angle
E=1e6   # Young's modulus

 Engines 
O.engines=[
ForceResetter(),
InsertionSortCollider([
Bo1_GridConnection_Aabb(),
Bo1_PFacet_Aabb(), 
]),
InteractionLoop([
Ig2_GridNode_GridNode_GridNodeGeom6D(),
Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),   # 
cylinder-cylinder interaction
Ig2_Sphere_PFacet_ScGridCoGeom(),   # needed for 
GridNode-pFacet interaction (why is this not included in 
Ig2_GridConnection_PFacet_ScGeom???)
Ig2_GridConnection_PFacet_ScGeom(), # Cylinder-pFcet 
interaction
],
[

Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False),
Ip2_FrictMat_FrictMat_FrictPhys()
],
[
Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),# contact law 
for "internal" cylider forces
Law2_ScGridCoGeom_FrictPhys_CundallStrack(),# contact law 
for Cylinder-pFacet interaction
Law2_GridCoGridCoGeom_FrictPhys_CundallStrack() # contact law 
for cylinder-cylinder interaction
]
),
GlobalStiffnessTimeStepper(timestepSafetyCoefficient=0.1,label='ts'), 
NewtonIntegrator(gravity=(0.,0,-10),damping=0.,label='newton'),
#NewtonIntegrator(gravity=(-1.,0,-10),damping=0.5,label='newton'),
]

 Creat materials 
O.materials.append( CohFrictMat( 
young=E,poisson=0.3,density=1000,frictionAngle=radians(phi),normalCohesion=1e10,shearCohesion=1e10,momentRotationLaw=True,label='cMat'
 ) )  # material to create the gridConnections
O.materials.append( FrictMat( 
young=E,poisson=0.3,density=1000,frictionAngle=radians(phi),label='fMat' ) )  # 
material for general interactions

 Create cylinders 
nodesIds=[]
cylIds=[]
ext=12.
dxy=ext/(n-1)
dL=Lmax-Lmin
random.seed( 10 )
for i in range(0,n):
y=-ext/2+i*dxy
for i in range(0,n):
x=-ext/2+i*dxy
L=Lmin+dL
color=[random.random(),random.random(),random.random()]

cylinder((x,y,3*r),(x,y,L+3*r),radius=r,nodesIds=nodesIds,cylIds=cylIds,

fixed=False,color=color,intMaterial='cMat',extMaterial='fMat')

 Creat ground with pFacets 
color=[255./255.,102./255.,0./255.]
n0=O.bodies.append( 
gridNode([-10,-10,0],r,wire=False,fixed=True,material='cMat',color=color) )
n1=O.bodies.append( 
gridNode([10,-10,0],r,wire=False,fixed=True,material='cMat',color=color) )
n2=O.bodies.append( 
gridNode([10,10,0],r,wire=False,fixed=True,material='cMat',color=color) )
n3=O.bodies.append( 
gridNode([-10,10,0],r,wire=False,fixed=True,material='cMat',color=color) )
O.bodies.append( gridConnection(n0,n1,r,color=color,material='fMat') )
O.bodies.append( gridConnection(n1,n2,r,color=color,material='fMat') )
O.bodies.append( gridConnection(n2,n0,r,color=color,material='fMat') )
O.bodies.append( gridConnection(n2,n3,r,color=color,material='fMat') )
O.bodies.append( gridConnection(n3,n0,r,color=color,material='fMat') )
O.bodies.append( pfacet(n0,n1,n2,wire=False,material='fMat',color=color) )
O.bodies.append( pfacet(n0,n2,n3,wire=False,material='fMat',color=color) )

 For viewing 
from yade import qt
qt.View()
Gl1_Sphere.stripes=True

 Allows to reload the simulation 
O.saveTmp()

-- 
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 #695558]: Dynamics of pfacet object does not appear to be correct

2021-02-24 Thread Rohit John
Question #695558 on Yade changed:
https://answers.launchpad.net/yade/+question/695558

Rohit John posted a new comment:
Dear Klaus,

> Apparently there seems to be a bug in the distribution of the forces onto the 
> gridNodes [1].
- Thanks for this information. Please let me know if I can help you fix this 
issue in any way.

> ViscElMat is more general or you could also use 
> Ip2_FrictMat_FrictMat_MindlinPhys.
- I shall look into this. Thanks for this information.

Kind regards,
Rohit John

-- 
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 #695558]: Dynamics of pfacet object does not appear to be correct

2021-02-23 Thread Rohit John
Question #695558 on Yade changed:
https://answers.launchpad.net/yade/+question/695558

Rohit John gave more information on the question:
Dear Klaus Thoeni,

Thank you for your input on my suspicions regarding the rounding error.

Is it possible for you to give a value (or a range of values) for the
newton damping which worked for you? I tried different values but, I do
not have a way to verify which one is close to an actual response.

> Alternatively, you could use viscous or hysteresis damping (or coefficients 
> of restitution). We have the relevant contact models but not sure if they 
> will work with grids and pFacets.
- Do you mean FrictViscoMat? or do you have a different model in mind?

Kind regards,
Rohit John

-- 
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 #695558]: Dynamics of pfacet object does not appear to be correct

2021-02-18 Thread Rohit John
Question #695558 on Yade changed:
https://answers.launchpad.net/yade/+question/695558

Status: Answered => Open

Rohit John is still having a problem:
Dear Klaus Thoeni,

Thanks for your insight into the matter. I tried your solution and it
worked. However, project involves studying the dynamics of this
interaction, specifically the change in velocity and angular velocity of
an object during an impact with an array of flexible rods (brush). Since
the damping artificial [1], I believe it will affect the dynamics. Is
there any other way to reduce the instability.

Do you know if this is caused by some round off error in the solver? If
yes is there a way to verify if this is caused by round off?

Kind regards,
Rohit K. John


[1] https://yade-dem.org/doc/formulation.html#numericaldamping

-- 
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 #695558]: Dynamics of pfacet object does not appear to be correct

2021-02-17 Thread Rohit John
Question #695558 on Yade changed:
https://answers.launchpad.net/yade/+question/695558

Description changed to:
Hello,

I am simulating the interaction between a brush (bristles made of grid
nodes and grid connections) and an object (made of pfacet). The bristles
are arranged to form a square at its  base. The objects takes the form
of a wedge placed symmetrically between the bristles. The object is made
to move into the brush

I expect the object to bounce back up, but it is starting to rotate when
it contacts the brush. Since the system is symmetric, I do not expect
this rotation to happen. I could not find the bug in my code. I suppose
there could be something in the dynamics I am missing.

Kind regards,
Rohit John

# 

 code
from yade import plot, utils
from yade.gridpfacet import *

# -- 
defining material
bristle_radius = 1e-3
bristle_length = 0.1
bristle_seg_no = 5

bristle_young = 3e9
bristle_poisson = 0.3
bristle_density = 1000
bristle_friction = radians(30)

grid_radius = 1e-3
target_young = 30e9
target_poisson = 0.3
target_density = 1000
target_friction = radians(30)

# -- 
material
O.materials.append(
FrictMat(
young = bristle_young,
poisson = bristle_poisson,
density = bristle_density,
label = 'cyl_ext_mat',
frictionAngle = bristle_friction,
)
)

O.materials.append(
CohFrictMat(
young = bristle_young,
poisson = bristle_poisson,
density = bristle_density,
label = 'cyl_int_mat',

frictionAngle = bristle_friction,
momentRotationLaw = True,
normalCohesion = 1e40,
shearCohesion = 1e40,
)
)

O.materials.append(
FrictMat(
young = target_young,
poisson = target_poisson,
density = target_density,
label = 'pfacet_ext_mat',
frictionAngle = target_friction,
)
)

O.materials.append(
CohFrictMat(
young = 100*target_young,
poisson = target_poisson,
density = target_density,
label = 'pfacet_int_mat',

frictionAngle = target_friction,
momentRotationLaw = True,
normalCohesion = 1e40,
shearCohesion = 1e40,
)
)

# -- Engines
O.engines = [
ForceResetter(),
InsertionSortCollider([
Bo1_GridConnection_Aabb(),
Bo1_PFacet_Aabb(),
]),
InteractionLoop(
[
Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),
Ig2_GridNode_GridNode_GridNodeGeom6D(),
Ig2_PFacet_PFacet_ScGeom(),
Ig2_GridConnection_PFacet_ScGeom(),
Ig2_Sphere_PFacet_ScGridCoGeom(),
],
[
Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow = True, 
setCohesionOnNewContacts = False),
Ip2_FrictMat_FrictMat_FrictPhys()
],
[
Law2_GridCoGridCoGeom_FrictPhys_CundallStrack(),
Law2_ScGeom_FrictPhys_CundallStrack(),
Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
Law2_ScGridCoGeom_FrictPhys_CundallStrack(),
]
),
NewtonIntegrator(gravity = (0,0,-10),damping = 0.0)
]
# -- bodies
# - custome brush
nodesIds=[]
cylIds=[]

# bristle root location
base_pos = [
[0.003, 0.003, 0],
[0.003, -0.003, 0],
[-0.003, 0.003, 0],
[-0.003, -0.003, 0],
]
dz = bristle_length / bristle_seg_no # grid connection length

for i in base_pos:
bristle = []
for j in range(bristle_seg_no + 1):
bristle.append([
i[0],
i[1],
bristle_length - (i[2] + dz * j)
])
cylinderConnection(
bristle,
bristle_radius,
nodesIds,
cylIds,
color=[1,0,0],
intMaterial='cyl_int_mat',
extMaterial='cyl_ext_mat'
)
O.bodies[nodesIds[-1]].state.blockedDOFs='xyzXYZ'

# - manaul target
origin = [
0,
0,
bristle_length + bristle_radius + grid_radius
]

x_len = 0.03
y_len = 0.05
z_len = 0.05
nodes = [
[x_len,   0, 0 + origin[2]],
[-x_len,  0, 0 + origin[2]],
[0.0, y_len, z_len + origin[2]],
[0.0,-y_len, z_len + origin[2]],
]

pfacet_nodes = [
[nodes[0], nodes[1], nodes[2]],
[nodes[0], nodes[3], nodes[1]],
]


pnode = []
pcyl = []
pfacet = []
for i in pfacet_nodes:
print(i)
pfacetCreator1(
i,
grid_radius,
nodesIds = pnode,
cylIds = pcyl,
pfIds = pfacet,
wire = False,
fixed = False,
color = [0.

Re: [Yade-users] [Question #695558]: Dynamics of pfacet object does not appear to be correct

2021-02-16 Thread Rohit John
Question #695558 on Yade changed:
https://answers.launchpad.net/yade/+question/695558

Rohit John gave more information on the question:
Hello,

Please disregards, the comment I made above (#2), now I realize that I
need Law2_ScGridCoGeom_FrictPhys_CundallStrack() to handle the
interaction between the end of the gridConnection, gridnode flexible rod
and the pfacet. Please help.

Kind regards,
Rohit John

-- 
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 #695558]: Dynamics of pfacet object does not appear to be correct

2021-02-16 Thread Rohit John
Question #695558 on Yade changed:
https://answers.launchpad.net/yade/+question/695558

Rohit John gave more information on the question:
Hello,

I found that the engine Law2_ScGridCoGeom_FrictPhys_CundallStrack(), was
part of the problem. This got rid of the rotation that was caused at the
start of the contact. But after some large deformation, there  are
still some problems. The dynamics depending on the order of defining the
pfacet. I think the error may lay with the engines that I am using. Has
anywork worked with pfacet interacting with gridnode/ grid connection? I
did not find an example in the documentation.

Kind regards,
Rohit John

-- 
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 #695558]: Dynamics of pfacet object does not appear to be correct

2021-02-15 Thread Rohit John
Question #695558 on Yade changed:
https://answers.launchpad.net/yade/+question/695558

Description changed to:
Hello,

I am simulating the interaction between a brush (bristles made of grid
nodes and grid connections) and an object (made of pfacet). The bristles
are arranged to form a square at its  base. The objects takes the form
of a wedge placed symmetrically between the bristles. The object is made
to move into the brush

I expect the object to bounce back up, but it is starting to rotate when
it contacts the brush. Since the system is symmetric, I do not expect
this rotation to happen. I could not find the bug in my code. I suppose
there could be something in the dynamics I am missing.

Kind regards,
Rohit John


from yade import plot, utils
from yade.gridpfacet import *

# user define function
# 
--
 add motion engines
def add_motion_engines(ids, linear_velocity, angular_velocity, 
center_of_rotation):
'''
Adds the engines which sets the initial velocities of a target. This is 
done because for some reason we cannot graph the velocities for non spherical 
objects by manually setting the velocities
'''
linear_velocity_magnitude = L2_norm(linear_velocity)
linear_velocity_vector= normalise(linear_velocity)

angular_velocity_magnitude = L2_norm(angular_velocity)
angular_velocity_vector= normalise(angular_velocity)

O.engines += [
CombinedKinematicEngine(
ids   = ids,
label ='combined_motion_engine') + 

TranslationEngine(
translationAxis = linear_velocity_vector,
velocity= linear_velocity_magnitude,
label   = 'translation_engine') + 

RotationEngine(
rotationAxis = angular_velocity_vector, 
angularVelocity  = angular_velocity_magnitude, 
rotateAroundZero = True, 
zeroPoint= center_of_rotation,
label= 'rotation_engine'
),

PyRunner(command = "motion_engine_stopper()", iterPeriod = 1, label = 
"stopper")

]

# 
--
 motion_engine_stopper
def motion_engine_stopper():
combined_motion_engine.dead = True
translation_engine.dead = True
rotation_engine.dead= True
stopper.iterPeriod  = int(1e14)
print("Engines stopped")

# 
--
 L2_norm
def L2_norm(vector):
mag = 0
for i in vector:
mag += i**2

return mag**0.5

# 
--
 normalise
def normalise(vector):
mag = L2_norm(vector)
if mag == 0:
return [0,0,0]
res = [i/mag for i in vector]
return res

# -- 
defining material
bristle_radius = 1e-3
bristle_length = 0.1
brush_x_dim= 0.1
brush_y_dim= 0.02
brush_position = [0,0,0]
brush_ori  = Quaternion((1,0,0), 0)

bristle_x_no   = 10
bristle_y_no   = 2
bristle_seg_no = 5
bristle_x_density = bristle_x_no / brush_x_dim
bristle_y_density = bristle_y_no / brush_y_dim

bristle_young= 3e9
bristle_poisson  = 0.3
bristle_density  = 1000
bristle_friction = radians(30)

covar = 0
bristle_tip_spread_covariance = [[covar, 0], [0, covar]]

target_dimension = [0.1,0.1,0.1]
target_position  = [0,0,0]
grid_radius = 1e-3
target_ori   = Quaternion((1,0,0), pi/4)
target_young= 30e9
target_poisson  = 0.3
target_density  = 1000
target_friction = radians(30)

# -- 
material
O.materials.append(
FrictMat(
young   = bristle_young,
poisson = bristle_poisson,
density = bristle_density,
label   = 'cyl_ext_mat',
frictionAngle = bristle_friction,
)
)

O.materials.append(
CohFrictMat(
young   = bristle_young,
poisson = bristle_poisson,
density = bristle_density,
label   = 'cyl_int_mat',

frictionAngle = bristle_friction,
momentRotationLaw = True,
normalCohesion= 1e40,
shearCohesion = 1e40,
)
)

O.materials.append(
FrictMat(
young   = target_young,
poisson = target_poisson,
density = target_density,
label   = 'pfacet_ext_mat',
frictionAngle = target_friction,
)
)

O.materials.append(
CohFrictMat(
young   = 100*target_young,
poisson = target_poisson,
density = target_density,
label   = 'pfacet_int_mat',

frictio

Re: [Yade-users] [Question #695558]: Dynamics of pfacet object does not appear to be correct

2021-02-15 Thread Rohit John
Question #695558 on Yade changed:
https://answers.launchpad.net/yade/+question/695558

Rohit John gave more information on the question:
I found that the order of defining the pfacet faces is affecting the rotation.  
For 
pfacet_nodes = [
[nodes[0], nodes[2], nodes[1]],
[nodes[0], nodes[1], nodes[3]]
]

The object is rotating about the z-axis.  For 
pfacet_nodes = [
[nodes[0], nodes[1], nodes[2]],
[nodes[0], nodes[1], nodes[3]]
]

The object is rotating about the y-axis. This behaviour seems very
unnatural.

-- 
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 #695558]: Dynamics of pfacet object does not appear to be correct

2021-02-15 Thread Rohit John
Question #695558 on Yade changed:
https://answers.launchpad.net/yade/+question/695558

Description changed to:
Hello,

I am simulating the interaction between a brush (bristles made of grid
nodes and grid connections) and an object (made of pfacet). The bristles
are arranged to form a square at its  base. The objects takes the form
of a wedge placed symmetrically between the bristles. The object is made
to move into the brush

I expect the object to bounce back up, but it is starting to rotate when
it contacts the brush. Since the system is symmetric, I do not expect
this rotation to happen. I could not find the bug in my code. I suppose
there could be something in the dynamics I am missing.

Kind regards,
Rohit John


from yade import plot, utils
from yade.gridpfacet import *

# user define function
# 
--
 add motion engines
def add_motion_engines(ids, linear_velocity, angular_velocity, 
center_of_rotation):
'''
Adds the engines which sets the initial velocities of a target. This is 
done because for some reason we cannot graph the velocities for non spherical 
objects by manually setting the velocities
'''
linear_velocity_magnitude = L2_norm(linear_velocity)
linear_velocity_vector= normalise(linear_velocity)

angular_velocity_magnitude = L2_norm(angular_velocity)
angular_velocity_vector= normalise(angular_velocity)

O.engines += [
CombinedKinematicEngine(
ids   = ids,
label ='combined_motion_engine') + 

TranslationEngine(
translationAxis = linear_velocity_vector,
velocity= linear_velocity_magnitude,
label   = 'translation_engine') + 

RotationEngine(
rotationAxis = angular_velocity_vector, 
angularVelocity  = angular_velocity_magnitude, 
rotateAroundZero = True, 
zeroPoint= center_of_rotation,
label= 'rotation_engine'
),

PyRunner(command = "motion_engine_stopper()", iterPeriod = 1, label = 
"stopper")

]

# 
--
 motion_engine_stopper
def motion_engine_stopper():
combined_motion_engine.dead = True
translation_engine.dead = True
rotation_engine.dead= True
stopper.iterPeriod  = int(1e14)
print("Engines stopped")

# 
--
 L2_norm
def L2_norm(vector):
mag = 0
for i in vector:
mag += i**2

return mag**0.5

# 
--
 normalise
def normalise(vector):
mag = L2_norm(vector)
if mag == 0:
return [0,0,0]
res = [i/mag for i in vector]
return res

# -- 
defining material
bristle_radius = 1e-3
bristle_length = 0.1
brush_x_dim= 0.1
brush_y_dim= 0.02
brush_position = [0,0.0025,0]
brush_ori  = Quaternion((1,0,0), 0)

bristle_x_no   = 10
bristle_y_no   = 2
bristle_seg_no = 5
bristle_x_density = bristle_x_no / brush_x_dim
bristle_y_density = bristle_y_no / brush_y_dim

bristle_young= 3e9
bristle_poisson  = 0.3
bristle_density  = 1000
bristle_friction = radians(30)

covar = 0
bristle_tip_spread_covariance = [[covar, 0], [0, covar]]

target_dimension = [0.1,0.1,0.1]
target_position  = [0,0,0]
grid_radius = 1e-3
target_ori   = Quaternion((1,0,0), pi/4)
target_young= 30e9
target_poisson  = 0.3
target_density  = 1000
target_friction = radians(30)

# -- 
material
O.materials.append(
FrictMat(
young   = bristle_young,
poisson = bristle_poisson,
density = bristle_density,
label   = 'cyl_ext_mat',
frictionAngle = bristle_friction,
)
)

O.materials.append(
CohFrictMat(
young   = bristle_young,
poisson = bristle_poisson,
density = bristle_density,
label   = 'cyl_int_mat',

frictionAngle = bristle_friction,
momentRotationLaw = True,
normalCohesion= 1e40,
shearCohesion = 1e40,
)
)

O.materials.append(
FrictMat(
young   = target_young,
poisson = target_poisson,
density = target_density,
label   = 'pfacet_ext_mat',
frictionAngle = target_friction,
)
)

O.materials.append(
CohFrictMat(
young   = 100*target_young,
poisson = target_poisson,
density = target_density,
label   = 'pfacet_int_mat',

frictio

[Yade-users] [Question #695558]: Dynamics of pfacet object does not appear to be correct

2021-02-15 Thread Rohit John
New question #695558 on Yade:
https://answers.launchpad.net/yade/+question/695558

Hello,

I am simulating the interaction between a brush (bristles made of grid nodes 
and grid connections) and an object (made of pfacet). The bristles are arranged 
to form a square at its  base. The objects takes the form of a wedge placed 
symmetrically between the bristles. The object is made to move into the brush

I expect the object to bounce back up, but it is starting to rotate when it 
contacts the brush. Since the system is symmetric, I do not expect this 
rotation to happen. I could not find the bug in my code. I suppose there could 
be something in the dynamics I am missing.

Kind regards,
Rohit John
The minimum working code
# 
---
from yade import plot, utils
from yade.gridpfacet import *

# user define function
# 
--
 add motion engines
def add_motion_engines(ids, linear_velocity, angular_velocity, 
center_of_rotation):
'''
Adds the engines which sets the initial velocities of a target. This is 
done because for some reason we cannot graph the velocities for non spherical 
objects by manually setting the velocities
'''
linear_velocity_magnitude = L2_norm(linear_velocity)
linear_velocity_vector= normalise(linear_velocity)

angular_velocity_magnitude = L2_norm(angular_velocity)
angular_velocity_vector= normalise(angular_velocity)

O.engines += [
CombinedKinematicEngine(
ids   = ids,
label ='combined_motion_engine') + 

TranslationEngine(
translationAxis = linear_velocity_vector,
velocity= linear_velocity_magnitude,
label   = 'translation_engine') + 

RotationEngine(
rotationAxis = angular_velocity_vector, 
angularVelocity  = angular_velocity_magnitude, 
rotateAroundZero = True, 
zeroPoint= center_of_rotation,
label= 'rotation_engine'
),

PyRunner(command = "motion_engine_stopper()", iterPeriod = 1, label = 
"stopper")

]

# 
--
 motion_engine_stopper
def motion_engine_stopper():
combined_motion_engine.dead = True
translation_engine.dead = True
rotation_engine.dead= True
stopper.iterPeriod  = int(1e14)
print("Engines stopped")

# 
--
 L2_norm
def L2_norm(vector):
mag = 0
for i in vector:
mag += i**2

return mag**0.5

# 
--
 normalise
def normalise(vector):
mag = L2_norm(vector)
if mag == 0:
return [0,0,0]
res = [i/mag for i in vector]
return res

# -- 
defining material
bristle_radius = 1e-3
bristle_length = 0.1
brush_x_dim= 0.1
brush_y_dim= 0.02
brush_position = [0,0.0025,0]
brush_ori  = Quaternion((1,0,0), 0)

bristle_x_no   = 10
bristle_y_no   = 2
bristle_seg_no = 5
bristle_x_density = bristle_x_no / brush_x_dim
bristle_y_density = bristle_y_no / brush_y_dim

bristle_young= 3e9
bristle_poisson  = 0.3
bristle_density  = 1000
bristle_friction = radians(30)

covar = 0
bristle_tip_spread_covariance = [[covar, 0], [0, covar]]

target_dimension = [0.1,0.1,0.1]
target_position  = [0,0,0]
grid_radius = 1e-3
target_ori   = Quaternion((1,0,0), pi/4)
target_young= 30e9
target_poisson  = 0.3
target_density  = 1000
target_friction = radians(30)

# -- 
material
O.materials.append(
FrictMat(
young   = bristle_young,
poisson = bristle_poisson,
density = bristle_density,
label   = 'cyl_ext_mat',
frictionAngle = bristle_friction,
)
)

O.materials.append(
CohFrictMat(
young   = bristle_young,
poisson = bristle_poisson,
density = bristle_density,
label   = 'cyl_int_mat',

frictionAngle = bristle_friction,
momentRotationLaw = True,
normalCohesion= 1e40,
shearCohesion = 1e40,
)
)

O.materials.append(
FrictMat(
young   = target_young,
poisson = target_poisson,
density = target_density,
label   = 'pfacet_ext_mat',
frictionAngle = target_friction,
)
)

O.materials.append(
CohFrictMat(
young   = 100*target_young,
  

[Yade-users] [Question #695545]: There is an error fixing DOFs of pfacet?

2021-02-15 Thread Rohit John
New question #695545 on Yade:
https://answers.launchpad.net/yade/+question/695545

Hello,

I want to fix the rotation DOF of a pfacet. But when I tried that, the face 
disappeared in the  GUI. I used inspect to check the state of the facet. It 
said nan for some values (pos, vel). Can you help me find a way to contrain the 
motion of a pfacet. The minimum working code is given below,

Regards,
Rohit 


from yade.gridpfacet import *

O.engines = [
ForceResetter(),

InsertionSortCollider([
Bo1_GridConnection_Aabb(),
Bo1_PFacet_Aabb(),
]),

InteractionLoop(
[
Ig2_PFacet_PFacet_ScGeom(),
Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),
Ig2_GridNode_GridNode_GridNodeGeom6D(),
Ig2_GridConnection_PFacet_ScGeom(),

],
[
Ip2_FrictMat_FrictMat_FrictPhys(),
Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(
setCohesionNow = True, 
setCohesionOnNewContacts = False
),
],
[
Law2_GridCoGridCoGeom_FrictPhys_CundallStrack(),
Law2_ScGeom_FrictPhys_CundallStrack(),
Law2_ScGridCoGeom_FrictPhys_CundallStrack(),
Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
],
),
NewtonIntegrator(gravity = [0,0,9.81], damping = 0),
]   
O.materials.append(CohFrictMat(young=1e7,poisson=1,density=1e2,frictionAngle=radians(30),normalCohesion=3e7,shearCohesion=3e7,momentRotationLaw=True,label='gridNodeMat'))
O.materials.append(FrictMat(young=1e7,poisson=1,density=1e2,frictionAngle=radians(30),label='gridConnectionMat'))

node_id_list = []
cyl_id_list = []
pfacet_id_list = []
pfacetCreator1(
[
[1,0,0], 
[0,1,0], 
[0,0,1]
], 
radius = 0.05,  
wire = False, 
fixed= False, 
color= [0.5,0.5,0.5],
materialNodes = 'gridNodeMat',
material = 'gridConnectionMat'
)

for i in O.bodies:
i.state.blockedDOFs = 'XYZ'

O.dt = 1e-6
O.saveTmp()


-- 
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 #695461]: How to create a solid polyhedron capable of interacting with gridConnections?

2021-02-11 Thread Rohit John
Question #695461 on Yade changed:
https://answers.launchpad.net/yade/+question/695461

Rohit John posted a new comment:
Dear Bruno,

I pointed out the fact that pfacet bodies are hollow because I wanted to
simulate the dynamics of a solid body as opposed to a hollow one. I
could achieve this another way by changing the mass moment of inertia.
The only way I know how to do that will change the mass of the pfacet
body. The bottom line is I want to control the mass and the moment of
inertia independently. I thought having hollow and solid bodies could be
away to control the moment of inertia. I think it is a good idea to have
interactions in the interior part of the pfacet body, but this is not
what I want.

Kind regards,
Rohit K. John

-- 
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 #695461]: How to create a solid polyhedron capable of interacting with gridConnections?

2021-02-11 Thread Rohit John
Question #695461 on Yade changed:
https://answers.launchpad.net/yade/+question/695461

Status: Open => Solved

Rohit John confirmed that the question is solved:
Dear Jan,

Thanks for your answer, I tried that and it worked.

Kind regards,
Rohit K. John

-- 
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 #695461]: How to create a solid polyhedron capable of interacting with gridConnections?

2021-02-11 Thread Rohit John
Question #695461 on Yade changed:
https://answers.launchpad.net/yade/+question/695461

Rohit John posted a new comment:
Hello,

Is it possible to add the pFacet body to a clump and then assign the
clump mass and MMOI? I tried using

O.bodies.appendClumped(
[O.bodies[i] for i in node_id_list]
)

Node_id_list contains the  IDs of the grid nodes. But I got the error 
IndexError: Body already has id 3969 set; appending such body (for the second 
time) is not allowed.

-- 
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 #695461]: How to create a solid polyhedron capable of interacting with gridConnections?

2021-02-11 Thread Rohit John
Question #695461 on Yade changed:
https://answers.launchpad.net/yade/+question/695461

Status: Answered => Open

Rohit John is still having a problem:
Dear Jan,

>> I found that this pfacet body is hollow
> is it a problem? why?
If it is possible to set an arbitrary mass to the pfacet, is it possible to 
assign an arbitrary mass moment of inertia (MMOI)? From what I understand I can 
set the mass and MMOI of each individual grid nodes. But is there a way to 
assign this value to the whole pfacet? 

Correct me if I am wrong, I found that gridConnections are assigned
mass. But the force acting on a gridConnection is linearly distributed
to the grid nodes. This implies the gridConnections  do not take part in
dynamics. Then why do they have mass?

Kind regards,
Rohit K. John

-- 
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 #695461]: How to create a solid polyhedron capable of interacting with gridConnections?

2021-02-10 Thread Rohit John
New question #695461 on Yade:
https://answers.launchpad.net/yade/+question/695461

Hello all,

I would like to model the interaction between an arbitrary shape(defined by a 
gts file) and a flexible rod. I am using gridNodes and gridConnections to model 
the flexible rod. I thought I could use pFacets to model the arbitrary shape. 
However, I found that this pfacet body is hollow. Moreover, when I scale the 
size of this shape (lets say its a cube and I scale the side length by 2), its 
mass is not scaling as expected (I expect the cube mass to increase 8 times, 
but I got 2). I thought I could use polyhedron [1], but I did not find an Ig2 
functor for polyhedra and gridConnection. Do you know how to model a shape that 
is capable of interacting with a gridConnection?

kind regards,
Rohit John

[1] 
https://yade-dem.org/doc/yade.utils.html?highlight=polyhedron#yade.utils.polyhedron

-- 
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 #695226]: RungeKuttaCashKarp54Integrator with gridConnections is causing errors

2021-02-10 Thread Rohit John
Question #695226 on Yade changed:
https://answers.launchpad.net/yade/+question/695226

Rohit John posted a new comment:
Thanks for your advice Bruno, I shall put an update in this thread when
I find something useful.

Kind regards,
Rohit K. John

-- 
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 #695226]: RungeKuttaCashKarp54Integrator with gridConnections is causing errors

2021-01-29 Thread Rohit John
Question #695226 on Yade changed:
https://answers.launchpad.net/yade/+question/695226

Rohit John posted a new comment:
Dear Bruno,

>Last one maybe: in a working case (small damping), did you find
consistency _at the structural scale_ in terms of damping the
oscillations? It could be that there is a mismatch between what you
input at the interactions scale and what you expect in terms of damping
at the structural scale?

- I cannot say this with certainity because I did not find any literature with 
data that I can use to verify me results. But in the structural case I did find 
that the motion is damped. For example, in one simulation I had attached at 
weight to the tip of a cantilever (a forceEngine at the particle at the end) 
and let it reach equilibrium after deformation. Then the weight was released 
(forceEngine dead = True), the oscillations were similar to what we find in a 
damped oscillator.
The mismatch that you mentions is a bit unclear. Could you please elaborate or 
maybe give an example?

> I would say the bending viscosity of the interactions should be a
multiple of ~N/L, do we agree on that?

- Could you please define N and L.  Am I wrong to assume N is the number
of gridNodes and L is the length of the cantilever? My first thought is
that damping should be a material property so it should be constant.
However, it could also depend on the shape of the cantilever, like the
area moment of inertia perhaps. It is difficult to find good literature
on damping in beams. Or I might looking in the wrong place or the wrong
thing.

Kind regards,
Rohit K. John

-- 
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 #695226]: RungeKuttaCashKarp54Integrator with gridConnections is causing errors

2021-01-29 Thread Rohit John
Question #695226 on Yade changed:
https://answers.launchpad.net/yade/+question/695226

Rohit John posted a new comment:
Dear Bruno,

> Problem here is we can't see you changes.
- I see. I tried pushing the code into the YADE gitlab and I got this error
remote: You are not allowed to push code to this project.

So I pushed the source into my account. You can view the changes here.
https://github.com/rohitkjohnedu/my_yade/commit/908aef935ee1236cd5188dd3e20544cfeba00117

Kind regards,
Rohit K. John

-- 
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 #695226]: RungeKuttaCashKarp54Integrator with gridConnections is causing errors

2021-01-28 Thread Rohit John
Question #695226 on Yade changed:
https://answers.launchpad.net/yade/+question/695226

Rohit John posted a new comment:
Dear Bruno,

> what happens with super-small O.dt? (defining what is "super-small" needs to 
> think about mass-viscosity-stiffness parameters)
- It depends on the damping fraction and the material stiffness. I wrote the 
code such that the damping coefficient is a fraction of the stiffness. (Same 
fraction for normal, shear, twist and bending stiffness in 
Law2_ScGeom6D_CohFrictPhys_CohesionMoment). At small time steps it works, but 
if I want higher damping I must reduce the time step. For one simulation it had 
to be 1e-10.  Even days were not enough to get some useful result.

> are the directions of forces, moment, velocities and spin consistent, with 
> just 2-3 nodes after 2 iterations?
I checked the values and when the damping and dt were badly set, the forces and 
velocities grow exponentially, but when I reduce the dt or damping they "calm 
down". 

>From my understanding the integrator in YADE is similar to forward Euler
which is unstable when there is damping. So I though changing the
integrator might help. Janek Kozicki solution works but the
RungeKuttaCashKarp54Integrator is extremely slow.

If possible could you check could the code found here:
https://github.com/rohitkjohnedu/yade_laws .

Kind regards,
Rohit K. John

-- 
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 #695226]: RungeKuttaCashKarp54Integrator with gridConnections is causing errors

2021-01-28 Thread Rohit John
Question #695226 on Yade changed:
https://answers.launchpad.net/yade/+question/695226

Status: Answered => Solved

Rohit John 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 #695226]: RungeKuttaCashKarp54Integrator with gridConnections is causing errors

2021-01-28 Thread Rohit John
Question #695226 on Yade changed:
https://answers.launchpad.net/yade/+question/695226

Description changed to:
Hello,

I want to use the RungeKuttaCashKarp54Integrator engine in a simulation
with cylinderConnections. I added viscous damping to the source code of
Law2_ScGeom6D_CohFrictPhys_CohesionMoment, this caused the
NewtonIntegrator to be unstable (The objects are exploding). I concluded
this may be because of the integration scheme and opted to use
RungeKuttaCashKarp54Integrator. However when I try to run the simulation
with RungeKuttaCashKarp54Integrator, I get "RuntimeError: No
IGeomDispatcher in engines or inside InteractionLoop".

The minimum working code is given below. Please help me to fix the issue

Kind regards,
Rohit John

##
# encoding: utf-8
"An example showing bending beams."

from yade.gridpfacet import *

 Parameter 
L=10.   # length of the beam
n=12# number of nodes used to generate the beam
r=L/50. # radius of the beam element

 Engines 
integrator=RungeKuttaCashKarp54Integrator([
ForceResetter(),
GeneralIntegratorInsertionSortCollider([Bo1_GridConnection_Aabb()]),
InteractionLoop(
[Ig2_GridNode_GridNode_GridNodeGeom6D()],

[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False)],
[Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
),
GravityEngine(gravity=Vector3(0,0,-9.81)),
])

#Tolerances can be set for the optimum accuracy
integrator.rel_err=1e-6;
integrator.abs_err=1e-6;

O.engines=[integrator,
]

 Create materials and set different properties 
O.materials.append(CohFrictMat(young=1e6,poisson=0.3,density=1e1,frictionAngle=radians(10),normalCohesion=1e40,shearCohesion=1e40,momentRotationLaw=True,label='mat1'))

 Vertices 
vertices1=[]

for i in range(0,n):
  vertices1.append( [i*L/n,0,0] )


 Create cylinder connections 
nodesIds=[]
cylIds=[]
cylinderConnection(vertices1,r,nodesIds,cylIds,color=[1,0,0],highlight=False,intMaterial='mat1')


 Set boundary conditions 
for i in range(0,1):
   O.bodies[nodesIds[i*n]].dynamic=False


 Set a time step 
O.dt=1e-05

 Allows to reload the simulation 
O.saveTmp()

-- 
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 #695226]: RungeKuttaCashKarp54Integrator with gridConnections is causing errors

2021-01-28 Thread Rohit John
New question #695226 on Yade:
https://answers.launchpad.net/yade/+question/695226

Hello,

I want to use the RungeKuttaCashKarp54Integrator engine in a simulation with 
cylinderConnections. I added damping to the source code of 
Law2_ScGeom6D_CohFrictPhys_CohesionMoment, this caused the NewtonIntegrator to 
be unstable (The objects are exploding). I concluded this may be because of the 
integration scheme and opted to use RungeKuttaCashKarp54Integrator. However 
when I try to run the simulation with RungeKuttaCashKarp54Integrator, I get 
"RuntimeError: No IGeomDispatcher in engines or inside InteractionLoop". 

The minimum working code is given below. Please help me to fix the issue

Kind regards,
Rohit John

##
# encoding: utf-8
"An example showing bending beams."

from yade.gridpfacet import *

 Parameter 
L=10.   # length of the beam
n=12# number of nodes used to generate the beam
r=L/50. # radius of the beam element

 Engines 
integrator=RungeKuttaCashKarp54Integrator([
ForceResetter(),
GeneralIntegratorInsertionSortCollider([Bo1_GridConnection_Aabb()]),
InteractionLoop(
[Ig2_GridNode_GridNode_GridNodeGeom6D()],

[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False)],
[Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
),
GravityEngine(gravity=Vector3(0,0,-9.81)),
])

#Tolerances can be set for the optimum accuracy
integrator.rel_err=1e-6;
integrator.abs_err=1e-6;

O.engines=[integrator,
]

 Create materials and set different properties 
O.materials.append(CohFrictMat(young=1e6,poisson=0.3,density=1e1,frictionAngle=radians(10),normalCohesion=1e40,shearCohesion=1e40,momentRotationLaw=True,label='mat1'))

 Vertices 
vertices1=[]

for i in range(0,n):
  vertices1.append( [i*L/n,0,0] )


 Create cylinder connections 
nodesIds=[]
cylIds=[]
cylinderConnection(vertices1,r,nodesIds,cylIds,color=[1,0,0],highlight=False,intMaterial='mat1')


 Set boundary conditions 
for i in range(0,1):
   O.bodies[nodesIds[i*n]].dynamic=False


 Set a time step 
O.dt=1e-05

 Allows to reload the simulation 
O.saveTmp()

-- 
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 #694531]: non linear shear: How to implement it?

2020-12-16 Thread Rohit John
Question #694531 on Yade changed:
https://answers.launchpad.net/yade/+question/694531

Status: Answered => Open

Rohit John is still having a problem:
Thank you Jan and Bruno for your comments.

>From Jan's comments
Please correct me if I am wrong, does geom->rotate(espT) rotate the vector from 
previous frame of reference (from previous time step) to the current time step?


>From Bruno's comments
I like your idea Bruno, but when I though about it I had a doubt. What would 
happen if  dFt/dut = 0. In that case Ft would be stuck at a value, will it not? 
To illustrate consider 

Let Ft(ut) = ut^3
dFt/dut = 3*ut^2
dFt/dut = 3*Ft^(2/3)

at Ft = 0, dFt/dut = 0

Discretizing
Ft(tn+1) = Ft(tn) + dFt/dut*ut(tn), here tn denotes nth time step,
if  dFt/dut = 0, then  Ft(tn+1) = Ft(tn). So this will continue with the 
subsequent steps.

I really appreciate your help and advice, I hope you would give me some
tips to solve this problem.

Kind regards,
Rohit K. John

-- 
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 #694531]: non linear shear: How to implement it?

2020-12-16 Thread Rohit John
Question #694531 on Yade changed:
https://answers.launchpad.net/yade/+question/694531

Status: Solved => Open

Rohit John is still having a problem:
Dear Jan,

Thanks for helping me with this problem. I went through the source code
for CPM and I found that it is storing the shear increments each
iteration  like you said.

> Concerning "large" shear displacement, there are some tricky
situations you should take into account:

I was wondering, does the CPM model solve any of the problems you cited
earlier, the one about defining large shear? Or does it assume it never
encounters such large shear.

Kind regards,
RKJ

-- 
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 #694531]: non linear shear: How to implement it?

2020-12-16 Thread Rohit John
Question #694531 on Yade changed:
https://answers.launchpad.net/yade/+question/694531

Status: Answered => Solved

Rohit John 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 #694531]: non linear shear: How to implement it?

2020-12-15 Thread Rohit John
Question #694531 on Yade changed:
https://answers.launchpad.net/yade/+question/694531

Status: Needs information => Open

Rohit John gave more information on the question:
Hello,

> why?
> why the other "can be handled"?

Shear force uses an incremental formulation whereas normal force and
moment uses an absolute formulation.  (At least in the code for
Law2_ScGeom6D_CohFrictPhys_CohesionMoment)

Fn = phys->kn * (un - phys->unp)
phys->moment_bending = geom->getBending() * phys->kr
Here un is the absolute normal displacement and getBending() give the absolute 
bending (I think). So they can be handled as follows

Fn = (phys->kn * (un - phys->unp))^3
phys->moment_bending = (geom->getBending() * phys->kr)^3

Here I have used a cubic function as an example for a non linear function. 
However, the shear force is calculated as follows
Vector3r& dus= geom->shearIncrement();
shearForce -= phys->ks * dus;

Here instead of an absolute value for shear, the code uses the
shearIncrement, dus, to increase (decrease in this case) value of shear
calculated in the previous step.

in essence
dFs = constant*dus => dFs/dus = constant => linear function.

If I have to implement a non linear function, I need the absolute value
of shear

> What actually do you ask?
I am looking for a Law2 which uses non linear shear. How do I access the value 
of shearDisaplacement, how do I find it?

Kind regards,
RKJ

-- 
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 #694531]: non linear shear: How to implement it?

2020-12-15 Thread Rohit John
New question #694531 on Yade:
https://answers.launchpad.net/yade/+question/694531

Hello all,

Reading through the manual and source code, I found that the shear force is 
modelled as a linear function of shear displacement. In each iteration, the 
displacement in the shear direction, dus, is calculated. From this the change 
in the shear force is calculated and added to shear force. This means change is 
shear force is independent of the magnitude of shear displacement or force. 

I wanted to use a non linear material so I believe this model will not work. 
Normal force and moment can be handled but the shear force remains a problem. 
Does anyone know how to implement non linear shear force?

Context: I am simulating the deformation of a cantilever using 
cylinderConnections and I want to use hyper elastic materials for this 
cantilever. These materials behave as a non linear function of deformations.

Kind regards,
Rohit K. John

-- 
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 #693479]: How to initialize the angular velocity of a box made of pfacets

2020-12-08 Thread Rohit John
Question #693479 on Yade changed:
https://answers.launchpad.net/yade/+question/693479

Rohit John posted a new comment:
Hello,

I found a work around to this problem. I used the rotationEngine to
initialise the angular velocity. It is active for the first few
iterations and then it will be turned off using a pyrunner command.

Kind regards,
RKJ

# 
--
 script
O.engines += [
RotationEngine(
rotateAroundZero = True,
zeroPoint= (0,0,0),
rotationAxis = axis,
angularVelocity  = -15,
ids  = target.ids,
label= 'rotEngine'
),
PyRunner(command = "switch_of_rot()", iterPeriod = 10, label = 
"rot_switch"),
]

def switch_of_rot():
rotEngine.dead = True
print("engine off")
rot_switch.iterPeriod = 1
# 
--

-- 
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 #692613]: Order of defining object and engine is causing problems

2020-11-12 Thread Rohit John
Question #692613 on Yade changed:
https://answers.launchpad.net/yade/+question/692613

Rohit John gave more information on the question:
Dear Jérôme Duriez,

Thanks for your advice.

However, I do not understand your comment. I have included
Law2_ScGeom_FrictPhys_CundallStrack() which, as I understand, handles
ScGeom and FrictPhys. I may be mistaken, so I would grealy appreciate it
if you could elaborate.

Moreover, I get the same problem (CylinderConnection falling apart when
I define it before the engine) when I tried the tutorial simulating
spheres interacting with root [1]. To get this problem, cut and paste
the list of engines after defining the objects.

The fact that I cannot define the objects before the engines is
frustrating because I would like to use a partial engine to affect some
objects based on their IDs. I can only get the IDs once I define the
objects. One work around would be to first define the list of engine
without the partial engine, then define the object and finally append
the partial engine to O.engines.

I would still like to bring to the developers attention.

Kind regards,
Rohit John

[1] https://gitlab.com/yade-dev/trunk/blob/master/examples/cylinders
/cylinderconnection-roots.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 #693479]: How to initialize the angular velocity of a box made of pfacets

2020-11-11 Thread Rohit John
Question #693479 on Yade changed:
https://answers.launchpad.net/yade/+question/693479

Rohit John posted a new comment:
Hello,

Sorry for the late reply. I'll see what I can do

-- 
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 #692613]: Order of defining object and engine is causing problems

2020-10-30 Thread Rohit John
Question #692613 on Yade changed:
https://answers.launchpad.net/yade/+question/692613

Status: Expired => Open

Rohit John is still having a problem:
Hello ,

Can anyone please help me with this issue

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

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


[Yade-users] [Question #693479]: How to initialize the angular velocity of a box made of pfacets

2020-10-15 Thread Rohit John
New question #693479 on Yade:
https://answers.launchpad.net/yade/+question/693479

Hello,

I created a box using pFacets. Now I want to initialise its angular velocity. I 
did so by assigning the same angular velocity to all bodies in the pfacet 
box(nodes, cylinders and pfacet) using O.bodies[i].state.angVel, and I also 
assigned the appropriate linear velocities using v = r x w, where v is the 
velocity, r is the radius vector and w is the angular velocity. Gravity is 0 
and there is no other interaction in the simulation. I ran the code and saw the 
box rotating in the viewport without any erratic motion. However, it is 
behaving differently when I plot angVel for a body in the pfacet box. It was 
not constant. I even tried averaging this value for all bodies in the pfacet 
box. It did not work. The code for this case is given below as Code A.

To check if the angVel property has an issue I tried the following. I set two 
spheres, positioned close to two opposite edges and moving towards the box in 
opposite direction, to collide with the box. This did the trick and made the 
box rotate. When I plotted angVel it shows a constant (almost) value.  The code 
for this case is given below as Code B.

My question is there a way to set the angular velocity. I do not want to use 
angMom as the moment of inertia for all bodies in the pfacet box are different 
and I guess some objects are planar so they have 0 moments of inertia.

##
 Code A

from yade import *
from yade import plot
from yade.gridpfacet import *

pfacet_rad   = 0.005

young= 1e6
density  = 1e3
frictAng = radians(30)
poisson  = 0.3

# function 
--
## box creator function 
---
def symmetric_cuboid_pfacet(CM, length, breadth, height, radius, int_mat, 
ext_mat, color = [0.5, 0.5, 0.5]):
'''
makes a symmetric cuboid using pfacet. 
'''
l = length
b = breadth
h = height
cm1, cm2, cm3 = CM # the centre of mass of the cube
# coordinates of the vertices
vertices = [
[cm1 + l/2, cm2 + b/2, cm3 + h/2],
[cm1 + l/2, cm2 - b/2, cm3 + h/2],
[cm1 - l/2, cm2 - b/2, cm3 + h/2],
[cm1 - l/2, cm2 + b/2, cm3 + h/2],
[cm1 + l/2, cm2 + b/2, cm3 - h/2],
[cm1 + l/2, cm2 - b/2, cm3 - h/2],
[cm1 - l/2, cm2 - b/2, cm3 - h/2],
[cm1 - l/2, cm2 + b/2, cm3 - h/2],
[cm1 + l/2, cm2  , cm3  ],
[cm1 - l/2, cm2  , cm3  ],
[cm1  , cm2 + b/2, cm3  ],
[cm1  , cm2 - b/2, cm3  ],
[cm1  , cm2  , cm3 + h/2],
[cm1  , cm2  , cm3 - h/2],
]

# connecting the vertices to form faces
face = [
[13, 2, 1], [13, 3, 2], [13, 4, 3], [13, 1, 4],
[14, 5, 6], [14, 6, 7], [14, 7, 8], [14, 8, 5],
[11, 1, 5], [11, 5, 8], [11, 8, 4], [11, 4, 1],
[12, 2, 3], [12, 3, 7], [12, 7, 6], [12, 6, 2],
[9,  1, 2], [9,  2, 6], [9,  6, 5], [9,  5, 1],
[10, 3, 4], [10, 4, 8], [10, 8, 7], [10, 7, 3],
]

# generating the grid stuff
nodesIds = []
cylIds   = []
pFacet   = []

for i in face:
pfacetCreator1(
[
vertices[i[0] - 1], 
vertices[i[1] - 1], 
vertices[i[2] - 1]
], 
radius, 
nodesIds = nodesIds, 
cylIds   = cylIds, 
pfIds= pFacet, 
wire = False, 
fixed= False, 
color= color,
materialNodes = int_mat, 
material  = ext_mat, 
)
return nodesIds ,cylIds, pFacet

## cross product function 
-
def cross_prd(a,b):
'''
Returns the cross product of the vectors a and b
'''
a1,a2,a3 = a
b1,b2,b3 = b

c1 = a2*b3 - a3*b2
c2 = a3*b1 - a1*b3
c3 = a1*b2 - a2*b1

c = [c1 ,c2, c3]
return c

## vector difference function 
-
def subtract(a,b):
'''
returns the difference of the vectors a and b
'''
a1,a2,a3 = a
b1,b2,b3 = b

c = [a1-b1, a2-b2, a3-b3]
return c

## add an angular velocity to a list of bodies function 
---
def body_angular_velocity_add(ang_vel, body_list, CM):
'''
Adds a value to the the initial angular velocity (ang_vel) of the pfacet 
body (body_list) about
the centre point CM
'''
for i in body_list:
pos = O.bodies[i].state.pos
r   = subtract(pos, CM)
vel = cross_prd(r, ang_vel)
O.bodies[i].state.vel= O.bodies[i].state.vel+ vel
O.bodies[i].state.angVel = O.bodies[i].state.angVel + ang_vel

# material 

Re: [Yade-users] [Question #693446]: How to have viscous damping for chainedCylinder

2020-10-15 Thread Rohit John
Question #693446 on Yade changed:
https://answers.launchpad.net/yade/+question/693446

Rohit John posted a new comment:
Dear Bruno,

I shall update you when I have made a working code.

I have a doubt. I did not find ViscoelasticPM in the documentation. Are
you talking about Law2_ScGeom_ViscElPhys_Basic()?

Kind regards,
Rohit K. John

-- 
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 #693446]: How to have viscous damping for chainedCylinder

2020-10-15 Thread Rohit John
Question #693446 on Yade changed:
https://answers.launchpad.net/yade/+question/693446

Status: Answered => Solved

Rohit John confirmed that the question is solved:
Thanks 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 #693446]: How to have viscous damping for chainedCylinder

2020-10-14 Thread Rohit John
Question #693446 on Yade changed:
https://answers.launchpad.net/yade/+question/693446

Rohit John posted a new comment:
Thanks for you answer Bruno.

I have read that most of the constitutive laws do no have a velocity
base damping [1]. Is there a reason why velocity base damping  was not
implemented?

I apologise, I did use gridConnectio/gridNodes to make the brush. I used
CylinderConnections to do it. I always get it confused with
chainedCylinders.

 Could you please check if my proposal to implement damping is correct. 
  - Define a material class which includes a damping parameter. Since I am 
using CylinderConnections I can inherit the class CohFrictMat and name it, say, 
ViscCohFrictMat
  - Define a Iphys defining the interaction between two instances of this 
material class. I can inherit Ip2_CohFrictMat_CohFrictMat_CohFrictPhys() and 
lets call it Ip2_ViscCohFrictMat_ViscCohFrictMat_ViscCohFrictPhys()
  - Define a law to define the forces based on the ScGeom6D Igeom and 
ViscCohFrictPhys() Iphys, and inherit the 
Law2_ScGeom6D_CohFrictPhys_CohesionMoment()



[1] 
https://yade-dem.org/doc/formulation.html?highlight=damping#numerical-damping

-- 
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 #693446]: How to have viscous damping for chainedCylinder

2020-10-13 Thread Rohit John
New question #693446 on Yade:
https://answers.launchpad.net/yade/+question/693446

Hello,

I want to simulate the interaction between a brush and a cube in microgravity. 
I have made the brush using an array of chainedCylinders and the box using 
pfacets. The main deformation is the bending of chainedCylinders. I have 
noticed that during the simulation, some chainedCylinders tend to vibrate 
violently and sometimes they break apart. I believe I can solve this by having 
some sort of damping in the chainedCylinders. I do not want to use the damping 
newtonIntegrator engine as it is non physical and , I believe, it does not 
conserve the momentum of the system.

Is there a way to introduce damping into this system? I read the thread [1] 'Do 
we have viscous damping in CohFrictMat now?' and I tried using shear_creep. 
However, the chainedCylinders was deformed permanently (I think this phenomena 
is plastic deformation). I would like method so that damping occurs in the 
elastic regime. 

Kind regards,
Rohit John

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

-- 
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 #692956]: Implementing orbital motion

2020-09-17 Thread Rohit John
Question #692956 on Yade changed:
https://answers.launchpad.net/yade/+question/692956

Status: Open => Solved

Rohit John confirmed that the question is solved:
Hello,

Thank you Janek for your advice. I shall try 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 #692956]: Implementing orbital motion

2020-09-16 Thread Rohit John
Question #692956 on Yade changed:
https://answers.launchpad.net/yade/+question/692956

Status: Needs information => Open

Rohit John gave more information on the question:
Hello,

Thanks for your answers

reply to  Robert's comments.
> Even if what you say is true (which seems odd to me), why should that prevent 
> you from using CentralGravityEngine? There are plenty of ways to "see" motion 
> without physically observing it in a window.

I want to observe the interaction between the debris and the cylinders.
Viewing the motion, compared to tracking states of the bodies, will
offer additional insights into the dynamics. I will read the document
Janek suggested [1].


>You can change/turn off the applied force at any time step you like.

>From what I understood, the forceEngine applies the same force to all
bodies in the simulation.  I would like to have a force which depends on
the position of the bodies. The equations are given here [2].


> I don't think FieldApplier should be used directly. But I really don't know 
> why you believe it looks promising. Please provide links to everything you 
> reference. What are you reading? Where are you reading it? 

I read the YADE documentation about fieldApplier [3]. I understood that the 
gravity fields use FieldApplier. Since there are engines for creating forces 
directed to an axis(AxialGravityEngine) or a body (CentralGravityEngine), I 
assumed that the forces are dependent on the position of the body they act on. 
I do not know how exactly the engine works. I then assumed it would be possible 
to create a function capable of exerting a position dependent force on a body


reply to Janek's comments
> CentralGravityEngine does not depend on distance
That's too bad. I thought it used Newton's gravitational law. If this is the 
case, I cannot use it. 



I do not know how to code a new engine or use c++. Please correct me if I am 
wrong. Can I add a new function for defining a the forces using the equations 
from [2] in the GravityEngines.cpp [4], based on the other functions in the 
file? Are there other files I must modify in addition to this?

Kind regards,
Rohit John

[1] https://yade-dem.org/doc/yade.qt.html#yade.qt._GLViewer.center
[2] https://en.wikipedia.org/wiki/Clohessy%E2%80%93Wiltshire_equations
[3] https://yade-dem.org/doc/yade.wrapper.html#fieldapplier
[4] 
https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/common/GravityEngines.cpp#L51

-- 
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 #692956]: Implementing orbital motion

2020-09-16 Thread Rohit John
New question #692956 on Yade:
https://answers.launchpad.net/yade/+question/692956

Hello,

I want to simulate the motion of debris (a cube made of pfacet) and a group of 
cylinders orbiting around the Earth. To do this, I want to use the 
Clohessy–Wiltshire equations [1]. I thought I could use the forceEngine, but it 
appears it can only apply a constant force. The CentralGravityEngine will not 
work because the length scale involved would be of the order of 6000km, so I 
may not be able to use the viewer to check the motion. Is there a way to define 
a force field using a fuction for position. The FieldApplier looks promising, 
but how do I use it?

Kind regards,
Rohit John



[1] https://en.wikipedia.org/wiki/Clohessy%E2%80%93Wiltshire_equations

-- 
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 #692613]: Order of defining object and engine is causing problems

2020-09-01 Thread Rohit John
Question #692613 on Yade changed:
https://answers.launchpad.net/yade/+question/692613

Status: Needs information => Open

Rohit John gave more information on the question:
Dear Robert,

Thanks for your reply.

I am using two materials: one for the internal nodes and one for the
external surface. I tried your recommendation but it did not help. The
cylinder is still falling apart.

I think we need all the Laws. I followed the code given here
(https://gitlab.com/yade-dev/trunk/blob/master/examples/cylinders
/cylinderconnection-roots.py). It says the following

Law2_ScGeom_FrictPhys_CundallStrack(),  # contact law for 
sphere-sphere
Law2_ScGridCoGeom_FrictPhys_CundallStrack(),# contact law 
for cylinder-sphere
Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),# contact law 
for "internal" cylinder forces
Law2_GridCoGridCoGeom_FrictPhys_CundallStrack() # contact law 
for cylinder-cylinder interaction

I tried removing Law2_ScGeom_FrictPhys_CundallStrack() and I got the
following error

None of given Law2 functors can handle interaction #0+1, types geom:ScGeom=1 
and phys:FrictPhys=3 (LawDispatcher::getFunctor2D returned empty functor)
QObject::~QObject: Timers cannot be stopped from another thread
Segmentation fault (core dumped)

I tried removing Law2_ScGridCoGeom_FrictPhys_CundallStrack() that did
not do anything. Still the only fix is to define the cylinder after the
engines. I don't understand why it works though.

-- 
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 #692613]: Order of defining object and engine is causing problems

2020-08-26 Thread Rohit John
New question #692613 on Yade:
https://answers.launchpad.net/yade/+question/692613

Hello all,

I am new to yade. I have tried the basic tutorial scripts and in them the 
objects are defined first followed by the engines. In an advanced script 
(cylinderconnection-roots.py) I saw that the objects were defined after the 
engines. 

Now I tried writing a script for a ball interacting with a beam made of 
cylinders. I defined the objects (cylinders and sphere) first and then the 
engines. When I ran the code, the beam sort of fell apart. I modified the code 
by defining the cylinder after the engines. It fixed the problem. I want to 
know what is causing this or if we are required to define the bodies after the 
engines. 

I am using Ubuntu 20.04 

Please find the bare minimum script that showed this issue.

###
from yade.gridpfacet import *


 params
young = 1e6
poiss = 3
dens  = 1e3
sp_r  = 0.05 
fr_a  = radians(10)



## cylinder
no_cyl = 5
dl_cyl = 0.1

 materials

O.materials.append(
FrictMat(
young = young,
poisson   = poiss,
density   = dens,
frictionAngle = fr_a,
label= 'cyl_ext_mat'
)
)

O.materials.append(
CohFrictMat(
young= young,
poisson  = poiss,
density  = dens,
frictionAngle= fr_a,
normalCohesion = 1e40,
shearCohesion  = 1e40,
momentRotationLaw = True, 
label= 'cyl_int_mat'
)
 )


 cylinder
nodesIds=[]
cylIds=[]
verts = []
for i in range(no_cyl):
verts.append([0.1 + dl_cyl*i,   0.5,0.8])


cylinderConnection( # Defining the beam here is causing the issue
verts,
nodesIds = nodesIds,
cylIds   = cylIds,
radius   = 0.03,
color= [1,0,0],
extMaterial = 'cyl_ext_mat',
intMaterial = 'cyl_int_mat'
)
O.bodies[nodesIds[-1]].state.blockedDOFs='xyzXYZ'



O.engines = [
ForceResetter(),
InsertionSortCollider([
Bo1_GridConnection_Aabb(),
]),
InteractionLoop(
[
Ig2_GridNode_GridNode_GridNodeGeom6D(),
Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),
],
[
Ip2_FrictMat_FrictMat_FrictPhys(),

Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False)
],
[
Law2_ScGeom_FrictPhys_CundallStrack(),
Law2_ScGridCoGeom_FrictPhys_CundallStrack(),
Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
Law2_GridCoGridCoGeom_FrictPhys_CundallStrack(),
]
),
GlobalStiffnessTimeStepper(timestepSafetyCoefficient=0.1,label='ts'), 
NewtonIntegrator(gravity = (0,0,9.1))
]

# if I define the beam here, it fixes everything


-- 
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 #690088]: Simulating a brush

2020-04-21 Thread Rohit John
New question #690088 on Yade:
https://answers.launchpad.net/yade/+question/690088

Hello,

I would like to simulate a sphere making contact with a brush. The sphere and 
the brush are not fixed space and both can move freely. The brush is made of 
individual bristles whose response to a force can be modeled using the beam 
bending theory. I want model the bristle as cantilever which is loaded at its 
free end when the sphere touches it. 

I want to simulate this large number of bristles and the dynamics of the sphere 
and brush in YADE. Is it possible? Or is it better to write my own code?

Kind regards,
Rohit 

-- 
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 #686382]: Flow around particles. CFD DEM coupling

2019-11-29 Thread Rohit John
New question #686382 on Yade:
https://answers.launchpad.net/yade/+question/686382

Hello,

I am studying an impact damper. It consists of a single ball in a cavity filled 
with fluid. I  checked the YADE openFOAM coupling and found that it uses a drag 
model to calculate the drag on a particle. I would like to calculate the fluid 
flow around the particle and then calculate the surface forces acting on it. Is 
it possible to do so. 

I found that openFOAM pimpleDynFOAM can do rigid body dynamics to simulate the 
motion of a body in a fluid. However I did not find anything with contact 
dynamics.  I want to know if it is possible to couple YADE and openFOAM to 
solve the flow around a particle and also include contact dynamics.

Thanks

RKJ

-- 
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 #685903]: 'ValueError: shape mismatch' when plotting

2019-11-15 Thread Rohit John
Question #685903 on Yade changed:
https://answers.launchpad.net/yade/+question/685903

Rohit John posted a new comment:
Thanks for the quick reply.

Are there any other ways to plot or visualise what is going on when the
simulation is running? I am testing some simulations so I need to see
what is going on and check if things are proceeding the way I want it
to.

-- 
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 #685903]: 'ValueError: shape mismatch' when plotting

2019-11-15 Thread Rohit John
New question #685903 on Yade:
https://answers.launchpad.net/yade/+question/685903

Hello,

I am using Yade 2018.02b on a Virtual Box machine running Ubuntu 18.04.3 LTS. 
The host machine runs Windows 10.  

I was trying to learn how to plot using the first tutorial given in the YADE 
tutorial page. (The one with a ball bouncing on another ball). I followed the 
commands given about plotting in the section Data mining. It works for a 
sometime then gives an error. 

There was a post with a similar error. It recommended increasing iterPeriod in 
PyRunner by a few orders of magnitude. All it did was delay when the error 
occured
The code is given below


# basic simulation showing sphere falling ball gravity,
# bouncing against another sphere representing the support

# DATA COMPONENTS

# add 2 particles to the simulation
# they the default material (utils.defaultMat)
O.bodies.append([
# fixed: particle's position in space will not change (support)
sphere(center=(0,0,0),radius=.5,fixed=True),
# this particles is free, subject to dynamics
sphere((0,0,2),.5)
])

# FUNCTIONAL COMPONENTS

# simulation loop -- see presentation for the explanation
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom()],# collision geometry
[Ip2_FrictMat_FrictMat_FrictPhys()], # collision "physics"
[Law2_ScGeom_FrictPhys_CundallStrack()]   # contact law -- 
apply forces
),
# Apply gravity force to particles. damping: numerical dissipation of 
energy.
NewtonIntegrator(gravity=(0,0,-9.81),damping=0.1)
]

# set timestep to a fraction of the critical timestep
# the fraction is very small, so that the simulation is not too fast
# and the motion can be observed
O.dt=.5e-4*PWaveTimeStep()

# save the simulation, so that it can be reloaded later, for experimentation
O.saveTmp()

from yade import plot
plot.plots={'t':('coordNum','unForce',None,'Ek')}# kinetic 
energy will have legend on the right as indicated by None separator.

O.trackEnergy=True
def addPlotData():
# this function adds current values to the history of data, under the 
names specified

plot.addData(t=O.time,Ek=utils.kineticEnergy(),coordNum=utils.avgNumInteractions(),unForce=utils.unbalancedForce())

O.engines+=[PyRunner(command='addPlotData()',iterPeriod=2000)]

plot.plots={'t':('coordNum','unForce',None,'Ek')}
plot.plot()

---
***

The error that I get is  given below

Unhandled exception in thread started by 
---
ValueErrorTraceback (most recent call last)
/usr/lib/x86_64-linux-gnu/yade/py/yade/plot.py in liveUpdate(timestamp)
506 for ax in axes:
507 try:
--> 508 ax.relim() # recompute axes 
limits
509 ax.autoscale_view()
510 except RuntimeError: pass # happens if 
data are being updated and have not the same dimension at the very moment

/usr/lib/python2.7/dist-packages/matplotlib/axes/_base.pyc in relim(self, 
visible_only)
   1936 for line in self.lines:
   1937 if not visible_only or line.get_visible():
-> 1938 self._update_line_limits(line)
   1939 
   1940 for p in self.patches:

/usr/lib/python2.7/dist-packages/matplotlib/axes/_base.pyc in 
_update_line_limits(self, line)
   1799 Figures out the data limit of the given line, updating 
self.dataLim.
   1800 """
-> 1801 path = line.get_path()
   1802 if path.vertices.size == 0:
   1803 return

/usr/lib/python2.7/dist-packages/matplotlib/lines.pyc in get_path(self)
955 """
956 if self._invalidy or self._invalidx:
--> 957 self.recache()
958 return self._path
959 

/usr/lib/python2.7/dist-packages/matplotlib/lines.pyc in recache(self, always)
665 y = self._y
666 
--> 667 self._xy = np.column_stack(np.broadcast_arrays(x, 
y)).astype(float)
668 self._x, self._y = self._xy.T  # views
669 

/home/intern/.local/lib/python2.7/site-packages/numpy/lib/stride_tricks.pyc in 
broadcast_arrays(*args, **kwargs)
257 args = [np.array(_m, copy=False, subok=subok) for _m in args]
258 
--> 259 shape = _broadcast_shape(*args)
260 
261 if all(array.shape == shape for array in args):

/home/intern/.local/lib/python2.7/site-pa