yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #02292
[Branch ~yade-dev/yade/trunk] Rev 1808: 1. Initialize dnesity to 4800 in CpmMat
------------------------------------------------------------
revno: 1808
committer: Václav Šmilauer <eudoxos@xxxxxxxx>
branch nick: trunk
timestamp: Sun 2009-11-22 00:50:06 +0100
message:
1. Initialize dnesity to 4800 in CpmMat
2. Add warning if passing obsolete physParamsClass to utils.{sphere,facet,box,wall}
3. Add Material.cpp to ensure virtual functions work properly (not sure if they didn't, but now they do)
4. Fix uniax.py
added:
core/Material.cpp
modified:
core/Material.hpp
core/SConscript
examples/concrete/uniax.py
pkg/common/Engine/MetaEngine/InteractionDispatchers.cpp
pkg/dem/meta/ConcretePM.hpp
py/utils.py
--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk
Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription.
=== added file 'core/Material.cpp'
--- core/Material.cpp 1970-01-01 00:00:00 +0000
+++ core/Material.cpp 2009-11-21 23:50:06 +0000
@@ -0,0 +1,2 @@
+#include<yade/core/Material.hpp>
+Material::~Material(){}
=== modified file 'core/Material.hpp'
--- core/Material.hpp 2009-11-21 11:21:54 +0000
+++ core/Material.hpp 2009-11-21 23:50:06 +0000
@@ -10,7 +10,8 @@
*/
class Material: public Serializable, public Indexable{
public:
- Material(){createIndex();}
+ Material(){ createIndex(); }
+ ~Material();
//! global id of the material; if >= 0, the material is shared and can be found under this index in MetaBody::materials
//! (necessary since yade::serialization doesn't track shared pointers)
int id;
=== modified file 'core/SConscript'
--- core/SConscript 2009-11-21 10:21:57 +0000
+++ core/SConscript 2009-11-21 23:50:06 +0000
@@ -13,6 +13,7 @@
'Interaction.cpp',
'InteractionContainer.cpp',
'GroupRelationData.cpp',
+ 'Material.cpp',
'MetaBody.cpp',
'MetaEngine.cpp',
'NullGUI.cpp',
=== modified file 'examples/concrete/uniax.py'
--- examples/concrete/uniax.py 2009-11-13 11:27:22 +0000
+++ examples/concrete/uniax.py 2009-11-21 23:50:06 +0000
@@ -48,8 +48,6 @@
strainRateTension=.1,
strainRateCompression=1,
setSpeeds=True,
- # the packing has about 50% porosity, 2Ã2400==4800
- density=4800,
# 1=tension, 2=compression (ANDed; 3=both)
doModes=3,
@@ -66,7 +64,7 @@
# make geom; the dimensions are hard-coded here; could be in param table if desired
# z-oriented hyperboloid, length 20cm, diameter 10cm, skirt 8cm
# using spheres 7mm of diameter
-spheres=pack.randomDensePack(pack.inHyperboloid((0,0,-.5*specimenLength),(0,0,.5*specimenLength),.25*specimenLength,.2*specimenLength),spheresInCell=2000,radius=sphereRadius,memoizeDb='/tmp/triaxPackCache.sqlite',young=young,poisson=poisson,frictionAngle=frictionAngle,physParamsClass='CpmMat',density=density)
+spheres=pack.randomDensePack(pack.inHyperboloid((0,0,-.5*specimenLength),(0,0,.5*specimenLength),.25*specimenLength,.2*specimenLength),spheresInCell=2000,radius=sphereRadius,memoizeDb='/tmp/triaxPackCache.sqlite',young=young,poisson=poisson,frictionAngle=frictionAngle,materialClass='CpmMat')
O.bodies.append(spheres)
bb=utils.uniaxialTestFeatures()
negIds,posIds,axis,crossSectionArea=bb['negIds'],bb['posIds'],bb['axis'],bb['area']
=== modified file 'pkg/common/Engine/MetaEngine/InteractionDispatchers.cpp'
--- pkg/common/Engine/MetaEngine/InteractionDispatchers.cpp 2009-11-21 16:46:58 +0000
+++ pkg/common/Engine/MetaEngine/InteractionDispatchers.cpp 2009-11-21 23:50:06 +0000
@@ -94,7 +94,6 @@
continue; // in any case don't care about this one anymore
}
-
// InteractionPhysicsMetaEngine
if(!I->functorCache.phys){
I->functorCache.phys=physDispatcher->getFunctor2D(b1->material,b2->material,swap);
=== modified file 'pkg/dem/meta/ConcretePM.hpp'
--- pkg/dem/meta/ConcretePM.hpp 2009-11-21 16:46:58 +0000
+++ pkg/dem/meta/ConcretePM.hpp 2009-11-21 23:50:06 +0000
@@ -70,7 +70,7 @@
Real normEpsPl;
//! stresses on the particle
Vector3r sigma,tau;
- CpmMat(): epsVolumetric(0.), numBrokenCohesive(0), numContacts(0), normDmg(0.), epsPlBroken(0.), normEpsPl(0.), sigma(Vector3r::ZERO), tau(Vector3r::ZERO) { createIndex();};
+ CpmMat(): epsVolumetric(0.), numBrokenCohesive(0), numContacts(0), normDmg(0.), epsPlBroken(0.), normEpsPl(0.), sigma(Vector3r::ZERO), tau(Vector3r::ZERO) { createIndex(); density=4800; };
REGISTER_ATTRIBUTES(GranularMat, (epsVolumetric) (numBrokenCohesive) (numContacts) (normDmg) (epsPlBroken) (normEpsPl) (sigma) (tau));
REGISTER_CLASS_AND_BASE(CpmMat,GranularMat);
REGISTER_CLASS_INDEX(CpmMat,GranularMat);
=== modified file 'py/utils.py'
--- py/utils.py 2009-11-21 16:52:19 +0000
+++ py/utils.py 2009-11-21 23:50:06 +0000
@@ -74,6 +74,7 @@
def _commonBodySetup(b,volume,geomInertia,materialClass='GranularMat',noBound=False,**matKw):
"""Assign common body parameters."""
+ if 'physParamsClass' in matKw.keys(): raise RuntimeError("You as passing physParamsClass as argument, but it is no longer used. Use materialClass instead.")
matKw2=bodiesMatDefaults.copy(); matKw2.update(matKw)
b.mat=Material(materialClass)
b.mat.updateExistingAttrs(matKw2)
@@ -92,7 +93,7 @@
b['isDynamic']=dynamic
return b
-def box(center,extents,orientation=[1,0,0,0],dynamic=True,wire=False,color=None,density=1,highlight=False,**matKw):
+def box(center,extents,orientation=[1,0,0,0],dynamic=True,wire=False,color=None,highlight=False,**matKw):
"""Create default box (cuboid), with given parameters. Physical properties such as mass and inertia are calculated automatically."""
b=Body()
b.mold=InteractingGeometry('InteractingBox',extents=extents,diffuseColor=color if color else randomColor(),wire=wire,highlight=highlight)
@@ -123,7 +124,7 @@
b.dynamic=False
return b
-def facet(vertices,dynamic=False,wire=True,color=None,density=1,highlight=False,noBoundingVolume=False,**matKw):
+def facet(vertices,dynamic=False,wire=True,color=None,highlight=False,noBoundingVolume=False,**matKw):
"""Create default facet with given parameters. Vertices are given as sequence of 3 3-tuple and they, all in global coordinates."""
b=Body()
if not color: color=randomColor()