yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #08325
[Branch ~yade-dev/yade/trunk] Rev 3027: - tell more explicitely that Young/Poisson is interpreted differently in different functors in th...
------------------------------------------------------------
revno: 3027
committer: Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>
branch nick: trunk
timestamp: Tue 2012-02-14 17:51:38 +0100
message:
- tell more explicitely that Young/Poisson is interpreted differently in different functors in their respective doc
- make the LWStress function return pyList instead of tuple
- documentation in makeCloud
- default stiffness are zero, not NaN
modified:
pkg/common/ElastMat.hpp
pkg/common/NormShearPhys.hpp
pkg/dem/Shop.cpp
pkg/dem/Shop.hpp
py/_utils.cpp
py/pack/_packSpheres.cpp
--
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
=== modified file 'pkg/common/ElastMat.hpp'
--- pkg/common/ElastMat.hpp 2010-12-31 14:35:21 +0000
+++ pkg/common/ElastMat.hpp 2012-02-14 16:51:38 +0000
@@ -7,8 +7,8 @@
public:
virtual ~ElastMat();
YADE_CLASS_BASE_DOC_ATTRS_CTOR(ElastMat,Material,"Purely elastic material. The material parameters may have different meanings depending on the :yref:`IPhysFunctor` used : true Young and Poisson in :yref:`Ip2_FrictMat_FrictMat_MindlinPhys`, or contact stiffnesses in :yref:`Ip2_FrictMat_FrictMat_FrictPhys`.",
- ((Real,young,1e9,,"Young's modulus [Pa]"))
- ((Real,poisson,.25,,"Poisson's ratio [-]")),
+ ((Real,young,1e9,,"elastic modulus [Pa]. It has different meanings depending on the Ip functor."))
+ ((Real,poisson,.25,,"Poisson's ratio or the ratio between shear and normal stiffness [-]. It has different meanings depending on the Ip functor. ")),
/*ctor*/ createIndex();
);
REGISTER_CLASS_INDEX(ElastMat,Material);
=== modified file 'pkg/common/NormShearPhys.hpp'
--- pkg/common/NormShearPhys.hpp 2011-04-18 08:00:23 +0000
+++ pkg/common/NormShearPhys.hpp 2012-02-14 16:51:38 +0000
@@ -8,7 +8,7 @@
public:
virtual ~NormPhys();
YADE_CLASS_BASE_DOC_ATTRS_CTOR(NormPhys,IPhys,"Abstract class for interactions that have normal stiffness.",
- ((Real,kn,NaN,,"Normal stiffness"))
+ ((Real,kn,0,,"Normal stiffness"))
((Vector3r,normalForce,Vector3r::Zero(),,"Normal force after previous step (in global coordinates).")),
createIndex();
);
@@ -21,7 +21,7 @@
virtual ~NormShearPhys();
YADE_CLASS_BASE_DOC_ATTRS_CTOR(NormShearPhys,NormPhys,
"Abstract class for interactions that have shear stiffnesses, in addition to normal stiffness. This class is used in the PFC3d-style stiffness timestepper.",
- ((Real,ks,NaN,,"Shear stiffness"))
+ ((Real,ks,0,,"Shear stiffness"))
((Vector3r,shearForce,Vector3r::Zero(),,"Shear force after previous step (in global coordinates).")),
createIndex();
);
=== modified file 'pkg/dem/Shop.cpp'
--- pkg/dem/Shop.cpp 2011-12-07 12:49:19 +0000
+++ pkg/dem/Shop.cpp 2012-02-14 16:51:38 +0000
@@ -820,8 +820,11 @@
}
}
-py::tuple Shop::getStressLWForEachBody(bool revertSign){
+py::list Shop::getStressLWForEachBody(bool revertSign){
+ py::list ret;
vector<Matrix3r> bStresses;
getStressLWForEachBody(bStresses,revertSign);
- return py::make_tuple(bStresses);
+ FOREACH(const Matrix3r& m, bStresses) ret.append(m);
+ return ret;
+// return py::make_tuple(bStresses);
}
=== modified file 'pkg/dem/Shop.hpp'
--- pkg/dem/Shop.hpp 2011-07-20 07:49:38 +0000
+++ pkg/dem/Shop.hpp 2012-02-14 16:51:38 +0000
@@ -116,7 +116,7 @@
//! Define the exact average stress in each particle from contour integral ("LW" stands for Love-Weber, since this is what the contour integral gives).
static void getStressLWForEachBody(vector<Matrix3r>& bStresses, bool revertSign=false);
- static py::tuple getStressLWForEachBody(bool revertSign);
+ static py::list getStressLWForEachBody(bool revertSign);
//! Function to compute overall ("macroscopic") stress of periodic cell
static Matrix3r stressTensorOfPeriodicCell(bool smallStrains=true);
=== modified file 'py/_utils.cpp'
--- py/_utils.cpp 2011-07-20 07:49:38 +0000
+++ py/_utils.cpp 2012-02-14 16:51:38 +0000
@@ -435,7 +435,7 @@
py::tuple Shop__fabricTensor(bool splitTensor=false, bool revertSign=false, Real thresholdForce=NaN){return Shop::fabricTensor(splitTensor,revertSign,thresholdForce);}
py::tuple Shop__normalShearStressTensors(bool compressionPositive=false, bool splitNormalTensor=false, Real thresholdForce=NaN){return Shop::normalShearStressTensors(compressionPositive,splitNormalTensor,thresholdForce);}
-py::tuple Shop__getStressLWForEachBody(bool revertSign=false){return Shop::getStressLWForEachBody(revertSign);}
+py::list Shop__getStressLWForEachBody(bool revertSign=false){return Shop::getStressLWForEachBody(revertSign);}
Real shiftBodies(py::list ids, const Vector3r& shift){
shared_ptr<Scene> rb=Omega::instance().getScene();
=== modified file 'py/pack/_packSpheres.cpp'
--- py/pack/_packSpheres.cpp 2011-11-02 15:09:47 +0000
+++ py/pack/_packSpheres.cpp 2012-02-14 16:51:38 +0000
@@ -15,7 +15,7 @@
.def("load",&SpherePack::fromFile,(python::arg("fileName")),"Load packing from external text file (current data will be discarded).")
.def("save",&SpherePack::toFile,(python::arg("fileName")),"Save packing to external text file (will be overwritten).")
.def("fromSimulation",&SpherePack::fromSimulation,"Make packing corresponding to the current simulation. Discards current data.")
- .def("makeCloud",&SpherePack::makeCloud,(python::arg("minCorner")=Vector3r(Vector3r::Zero()),python::arg("maxCorner")=Vector3r(Vector3r::Zero()),python::arg("rMean")=-1,python::arg("rRelFuzz")=0,python::arg("num")=-1,python::arg("periodic")=false,python::arg("porosity")=0.5,python::arg("psdSizes")=vector<Real>(),python::arg("psdCumm")=vector<Real>(),python::arg("distributeMass")=false,python::arg("seed")=0,python::arg("hSize")=Matrix3r(Matrix3r::Zero())),"Create random loose packing enclosed in a parallelepiped (also works in 2D if minCorner[k]=maxCorner[k] for one coordinate)."
+ .def("makeCloud",&SpherePack::makeCloud,(python::arg("minCorner")=Vector3r(Vector3r::Zero()),python::arg("maxCorner")=Vector3r(Vector3r::Zero()),python::arg("rMean")=-1,python::arg("rRelFuzz")=0,python::arg("num")=-1,python::arg("periodic")=false,python::arg("porosity")=0.65,python::arg("psdSizes")=vector<Real>(),python::arg("psdCumm")=vector<Real>(),python::arg("distributeMass")=false,python::arg("seed")=0,python::arg("hSize")=Matrix3r(Matrix3r::Zero())),"Create random loose packing enclosed in a parallelepiped (also works in 2D if minCorner[k]=maxCorner[k] for one coordinate)."
"\nSphere radius distribution can be specified using one of the following ways:\n\n#. *rMean*, *rRelFuzz* and *num* gives uniform radius distribution in *rMean* (1 ± *rRelFuzz* ). Less than *num* spheres can be generated if it is too high.\n#. *rRelFuzz*, *num* and (optional) *porosity*, which estimates mean radius so that *porosity* is attained at the end. *rMean* must be less than 0 (default). *porosity* is only an initial guess for the generation algorithm, which will retry with higher porosity until the prescibed *num* is obtained.\n#. *psdSizes* and *psdCumm*, two arrays specifying points of the `particle size distribution <http://en.wikipedia.org/wiki/Particle_size_distribution>`__ function. As many spheres as possible are generated.\n#. *psdSizes*, *psdCumm*, *num*, and (optional) *porosity*, like above but if *num* is not obtained, *psdSizes* will be scaled down uniformly, until *num* is obtained (see :yref:`appliedPsdScaling<yade._packSpheres.SpherePack.appliedPsdScaling>`).\n\nBy default (with ``distributeMass==False``), the distribution is applied to particle radii. The usual sense of \"particle size distribution\" is the distribution of *mass fraction* (rather than particle count); this can be achieved with ``distributeMass=True``."
"\n\nIf *num* is defined, then sizes generation is deterministic, giving the best fit of target distribution. It enables spheres placement in descending size order, thus giving lower porosity than the random generation."
"\n\n:param Vector3 minCorner: lower corner of an axis-aligned box\n:param Vector3 maxCorner: upper corner of an axis-aligned box\n:param Matrix3 hSize: base vectors of a generalized box (arbitrary parallelepiped, typically :yref:`Cell::hSize`), superseeds minCorner and maxCorner if defined. For periodic boundaries only.\n:param float rMean: mean radius or spheres\n:param float rRelFuzz: dispersion of radius relative to rMean\n:param int num: number of spheres to be generated. If negavite (default), generate as many as possible with stochastic sizes, ending after a fixed number of tries to place the sphere in space, else generate exactly *num* spheres with deterministic size distribution.\n:param bool periodic: whether the packing to be generated should be periodic\n:param float porosity: initial guess for the iterative generation procedure (if *num*>1). The algorithm will be retrying until the number of generated spheres is *num*. The first iteration tries with the provided porosity, but next iterations increase it if necessary (hence an initialy high porosity can speed-up the algorithm). If *psdSizes* is not defined, *rRelFuzz* ($z$) and *num* ($N$) are used so that the porosity given ($\\rho$) is approximately achieved at the end of generation, $r_m=\\sqrt[3]{\\frac{V(1-\\rho)}{\\frac{4}{3}\\pi(1+z^2)N}}$. The default is $\\rho$=0.5. The optimal value depends on *rRelFuzz* or *psdSizes*.\n:param psdSizes: sieve sizes (particle diameters) when particle size distribution (PSD) is specified\n:param psdCumm: cummulative fractions of particle sizes given by *psdSizes*; must be the same length as *psdSizes* and should be non-decreasing\n:param bool distributeMass: if ``True``, given distribution will be used to distribute sphere's mass rather than radius of them.\n:param seed: number used to initialize the random number generator.\n:returns: number of created spheres, which can be lower than *num* depending on the method used.\n")