← Back to team overview

yade-users team mailing list archive

Re: [Question #658909]: Question about FEM and DEM coupling

 

Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909

Description changed to:
I change the code of the example1-yade.py file in [1] to the following
code:

from libyade import yade
from yade import polyhedra_utils
from yade import ymport
from yade import *

widthl = .3
widthr = .3
widthc = .3
height = .3
thick = .5
deep = -.2
sizeMin = 40e-3
sizeMax = 60e-3

frictionAngle = .5
young = 1e8 # stiffness

dt = 1e-3 # time step

nGravityDeposition = 250 # how long to run initial gravity deposition
nCycles = 3 # how many jumps to run afterwards
nStepsBetweenCycles = 200 # number of time steps between jumps
dspl = 20e-3

width = widthl+widthc+widthr

matS = O.materials.append(FrictMat(young=1e5,density=5000))

mat = PolyhedraMat(young=young,poisson=10,frictionAngle=frictionAngle)
O.materials.append(mat)
O.engines = [
	ForceResetter(),
	InsertionSortCollider([Bo1_Polyhedra_Aabb(),Bo1_Facet_Aabb()]),
	InteractionLoop(
		[Ig2_Polyhedra_Polyhedra_PolyhedraGeom(), Ig2_Facet_Polyhedra_PolyhedraGeom()],
		[Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_PolyhedraMat_PolyhedraMat_PolyhedraPhys()],
		[Law2_PolyhedraGeom_PolyhedraPhys_Volumetric(), Law2_ScGeom_FrictPhys_CundallStrack()]),
	NewtonIntegrator(gravity=(0,0,-9.8)),
]

# box
p000 = Vector3(0,0,0)
p100 = Vector3(widthl,0,0)
p200 = Vector3(widthl+widthc,0,0)
p300 = Vector3(widthl+widthc+widthr,0,0)
pxs = (p000,p100,p200,p300)
p001,p101,p201,p301 = [p+Vector3(0,0,height) for p in pxs]
p010,p110,p210,p310 = [p+Vector3(0,thick,0) for p in pxs]
p011,p111,p211,p311 = [p+Vector3(0,thick,height) for p in pxs]
p00b,p10b,p20b,p30b = [p+Vector3(0,0,deep) for p in pxs]
p01b,p11b,p21b,p31b = [p+Vector3(0,thick,deep) for p in pxs]
def rect(vs,**kw):
 v1,v2,v3,v4 = vs
 return [
  facet((v1,v2,v3),**kw),
  facet((v1,v3,v4),**kw),
 ]
movables = rect((p100,p200,p210,p110)) # bottom center
rects = (
 (p000,p100,p110,p010), # bottom left
 (p200,p300,p310,p210), # bottom left
 (p000,p010,p011,p001), # left
 (p300,p310,p311,p301), # right
 (p000,p100,p101,p001), # front left
 (p100,p200,p201,p101), # front center
 (p200,p300,p301,p201), # front right
 (p010,p110,p111,p011), # back left
 (p110,p210,p211,p111), # back center
 (p210,p310,p311,p211), # back right
 (p100,p200,p20b,p10b), # front center below
 (p110,p210,p21b,p11b), # back center below
 (p100,p110,p11b,p10b), # left below
 (p200,p210,p21b,p20b), # right below
)
rects = movables + sum((rect(r) for r in rects),[])
O.bodies.append(rects)

O.bodies.append(yade.ymport.textPolyhedra('try2.txt', mat,scale=1.0))

And I run the example1.sh it shows:

Traceback (most recent call last):
  File "example1.py", line 90, in <module>
    dem = YADE_API(demName)
  File "/home/kun/femdem/include/mupif/api/yade/yade_interface.py", line 153, in __init__
    execfile(inputfile)
  File "example1-yade.py", line 56, in <module>
    p000 = vector(0,0,0)
NameError: name 'vector' is not defined

and also :

Traceback (most recent call last):
  File "example1.py", line 90, in <module>
    dem = YADE_API(demName)
  File "/home/kun/femdem/include/mupif/api/yade/yade_interface.py", line 153, in __init__
    execfile(inputfile)
  File "example1-yade.py", line 56, in <module>
    p000 = vector(0,0,0)
NameError: name 'vector' is not defined

What errors here?

[1] https://github.com/stranskyjan/dem-fem-coupling

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