← Back to team overview

yade-users team mailing list archive

Re: How to use constitutive laws in Python scripts

 

Oops, I did tit again (...). There it is, and sorry for that.

Thank you for your answers, but I am still a bit hungry, probably because I
cannot find where python functions are defined. In the py directory?

If I look into the uniax.py example, I can see that you define "material
properties" when you create bodies with

O.bodies.append(material=O.materials.append(XXX)).

I imagine that this is where kn, ks and frictionAngle have to be assigned? I
am gonna try, but, I still do not understand why the simulation cannot work
with ConcretePM, RockPM or ViscoelasticPM?


Luc


2009/12/10 Václav Šmilauer <eudoxos@xxxxxxxx>

>
> >
> > Think u've forgotten to include the script in the email.  I think
> > Spheres Contact Geometry(SCG) doesn't yet support sphere-facet?
> > Dem3DofGeom does support sphere-facet.
> SCG does support sphere-facet, although by replacing the facet by a
> fictious sphere. The functor is in
> InteractingFacet2InteractingSphere4SpheresContactGeometry (soon, it will
> be called Ig2_Facet_Sphere_ScGeom)
> >  So there is a choice between using ef2_Spheres_Elastic_Elastic (using
> > SCG) and Law2_Dem3Dof_Elastic_Elastic (using Dem3Dof), both of which
> > are in ElasticContactLaw.cpp.
> Yes, exactly, for the basic elastic law. There are other laws (like for
> ConcretePM or for RockPM) as well.
>
> (Again, the ef2_Spheres_Elastic_Elastic will soon become
> Law_ScGeom_Elasic_Elastic or such; but it will not break your scripts,
> no worry, these changes are backwards-compatible at python level).
>
> Cheers, Vaclav
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
> Post to     : yade-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
> More help   : https://help.launchpad.net/ListHelp
>
# -*- coding: utf-8 -*-
# encoding: utf-8


O=Omega()

O.initializers=[BoundDispatcher([InteractingSphere2AABB(),InteractingFacet2AABB(),MetaInteractingGeometry2AABB()])]

O.engines=[

	BexResetter(),
	BoundDispatcher([InteractingSphere2AABB(),InteractingFacet2AABB(),MetaInteractingGeometry2AABB()]),
	InsertionSortCollider(),

	#################### Law2_Dem3Dof_Elastic_Elastic -> OK
	InteractionGeometryDispatcher([Ig2_Sphere_Sphere_Dem3DofGeom(),ef2_Facet_Sphere_Dem3DofGeom()]),
	InteractionPhysicsDispatcher([SimpleElasticRelationships()]),
	LawDispatcher([Law2_Dem3Dof_Elastic_Elastic()]),
	## Rk: can be written as 
	#InteractionDispatchers([ef2_Sphere_Sphere_Dem3DofGeom(),ef2_Facet_Sphere_Dem3DofGeom()],[SimpleElasticRelationships()],[Law2_Dem3Dof_Elastic_Elastic()],),

	#################### CundallStrack Law -> OK
	#InteractionGeometryDispatcher([Ig2_Sphere_Sphere_Dem3DofGeom(),ef2_Facet_Sphere_Dem3DofGeom()]),
	#InteractionPhysicsDispatcher([Ip2_BMP_BMP_CSPhys(frictionAngle=30)]),
	#LawDispatcher([Law2_Dem3Dof_CSPhys_CundallStrack()]),
	
	#################### ViscoelasticPM -> ERROR "terminate called without an active exception / terminate called recursively"
	#InteractionGeometryDispatcher([Ig2_Sphere_Sphere_Dem3DofGeom(),ef2_Facet_Sphere_Dem3DofGeom()]),
	#InteractionPhysicsDispatcher([Ip2_SimleViscoelasticMat_SimpleViscoelasticMat_SimpleViscoelasticPhys()]),
	#LawDispatcher([Law2_Spheres_Viscoelastic_SimpleViscoelastic()]),
	
	################### ConcretePM -> ERROR "terminate called without an active exception"
	#InteractionGeometryDispatcher([Ig2_Sphere_Sphere_Dem3DofGeom(),ef2_Facet_Sphere_Dem3DofGeom()]),
	#InteractionPhysicsDispatcher([Ip2_CpmMat_CpmMat_CpmPhys()]),
	#LawDispatcher([Law2_Dem3DofGeom_CpmPhys_Cpm()]),

	################### RockPM -> ERROR "segmentation fault"
	#InteractionGeometryDispatcher([Ig2_Sphere_Sphere_Dem3DofGeom(),ef2_Facet_Sphere_Dem3DofGeom()]),
	#InteractionPhysicsDispatcher([Ip2_RpmMat_RpmMat_RpmPhys()]),
	#LawDispatcher([Law2_Dem3DofGeom_RockPMPhys_Rpm()]),
	

	GravityEngine(gravity=[0,0,-10]),

	#RotationEngine(rotateAroundZero=True,zeroPoint=(0,0,0),rotationAxis=(1,0,0),angularVelocity=-120,subscribedBodies=millIds),
	#TranslationEngine(translationAxis=[1,0,0],velocity=5,subscribedBodies=KnifeIDs), # Buldozer motion

	NewtonsDampedLaw(damping=0.1)

]

from yade import pack,utils

############################ Definition of the ground (Facet)

O.bodies.append(utils.facetBox((0,0,-0.2),(10,10,0.2),wallMask=32,color=(0,0,1),wire=False)) #wallMask->defines which part of the box is activated (-x (1), +x (2), -y (4), +y (8), -z (16), +z (32) and box becomes a plane)

#O.bodies.append(utils.facet([[-10,-10,0],[0,10,0],[10,0,0]],wire=False,color=(1,1,1)))

############################ Definition of the sphere assembly

pred=pack.inAlignedBox((-1,-1,0),(1,1,3))
O.bodies.append(pack.randomDensePack(pred,radius=0.1,rRelFuzz=.3,memoizeDb='/tmp/triaxPackCache.sqlite'))
#O.bodies.append(pack.regularHexa(pred,radius=0.1,gap=0.1/4.))
#O.bodies.append(pack.regularOrtho(pred,radius=0.1,gap=0.1/4.))

#pred=pack.inCylinder((0,0,0),(0,0,3),1.5)
#O.bodies.append(pack.randomDensePack(pred,radius=0.1,rRelFuzz=1,memoizeDb='/tmp/triaxPackCache.sqlite'))

############################  

O.dt=0.3*utils.PWaveTimeStep()
print 'Timestep',O.dt

O.save('/home/sch50p/Desktop/YADE/bin/testViscoElastic.xml');

from yade import qt
v=qt.Controller()
v=qt.View()

O.run(20000); O.wait()

Follow ups

References