Logo Search packages:      
Sourcecode: yade version File versions  Download package

Public Member Functions | Static Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | Static Private Attributes

SpheresFactory Class Reference

Produces spheres over the course of a simulation. More...

#include <SpheresFactory.hpp>

Inheritance diagram for SpheresFactory:
Inheritance graph
[legend]
Collaboration diagram for SpheresFactory:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void action ()
 Create one sphere per call.
virtual void callPostLoad (void)
virtual void checkPyClassRegistersItself (const std::string &thisClassName) const
virtual string getBaseClassName (unsigned int i=0) const
virtual int getBaseClassNumber ()
virtual bool isActivated ()
bool operator!= (const Serializable &other)
bool operator== (const Serializable &other)
virtual boost::python::dict pyDict () const
virtual void pyHandleCustomCtorArgs (boost::python::tuple &args, boost::python::dict &kw)
virtual void pyRegisterClass (boost::python::object _scope)
virtual void pySetAttr (const std::string &key, const boost::python::object &value)
std::string pyStr ()
 string representation of this object
void pyUpdateAttrs (const boost::python::dict &d)
 REGISTER_BASE_CLASS_NAME (Factorable)
 REGISTER_CLASS_NAME (Serializable)
 REGISTER_CLASS_NAME (Factorable)
template<class ArchiveT >
void serialize (ArchiveT &ar, unsigned int version)
 YADE_CLASS_BASE_DOC (GlobalEngine, Engine,"Engine that will generally affect the whole simulation (contrary to PartialEngine).")
 YADE_CLASS_BASE_DOC_ATTRS_CTOR (PeriodicEngine, GlobalEngine,"Run Engine::action with given fixed periodicity real time (=wall clock time, computation time), \ virtual time (simulation time), iteration number), by setting any of those criteria \ (virtPeriod, realPeriod, iterPeriod) to a positive value. They are all negative (inactive)\ by default.\n\n\ \ The number of times this engine is activated can be limited by setting nDo>0. If the number of activations \ will have been already reached, no action will be called even if an active period has elapsed. \n\n\ \ If initRun is set (false by default), the engine will run when called for the first time; otherwise it will only \ start counting period (realLast etc interal variables) from that point, but without actually running, and will run \ only once a period has elapsed since the initial run. \n\n\ \ This class should be used directly; rather, derive your own engine which you want to be run periodically. \n\n\ \ Derived engines should override Engine::action(), which will be called periodically. If the derived Engine \ overrides also Engine::isActivated, it should also take in account return value from PeriodicEngine::isActivated, \ since otherwise the periodicity will not be functional. \n\n\ \ Example with PyRunner, which derives from PeriodicEngine; likely to be encountered in python scripts):: \n\n\ \ PyRunner(realPeriod=5,iterPeriod=10000,command='print O.iter') \n\n\ \ will print iteration number every 10000 iterations or every 5 seconds of wall clock time, whiever comes first since it was \ last run.",((Real, virtPeriod,((void)"deactivated", 0),,"Periodicity criterion using virtual (simulation) time (deactivated if <= 0)"))((Real, realPeriod,((void)"deactivated", 0),,"Periodicity criterion using real (wall clock, computation, human) time (deactivated if <=0)"))((long, iterPeriod,((void)"deactivated", 0),,"Periodicity criterion using step number (deactivated if <= 0)"))((long, nDo,((void)"deactivated",-1),,"Limit number of executions by this number (deactivated if negative)"))((bool, initRun, false,,"Run the first time we are called as well."))((Real, virtLast, 0,,"Tracks virtual time of last run |yupdate|."))((Real, realLast, 0,,"Tracks real time of last run |yupdate|."))((long, iterLast, 0,,"Tracks step number of last run |yupdate|."))((long, nDone, 0,,"Track number of executions (cummulative) |yupdate|.")), realLast=getClock();)

Static Public Member Functions

static Real getClock ()

Public Attributes

Vector3r angularVelocity
 Mean angularVelocity of spheres.
Vector3r angularVelocityRange
 Half size of a angularVelocity distribution interval. New sphere will have random angularVelocity within the range angularVelocity┬▒angularVelocityRange.
Vector3r color
 Color.
Real density
 Density of material.
vector< Body::id_t > factoryFacets
 The geometry of the section on which spheres will be placed.
Real frictionAngle
 Friction angle (radians).
int maxAttempts
 Max attempts to place sphere. If placing the sphere in certain random position would cause an overlap with any other physical body in the model, SpheresFactory will try to find another position. Default 20 attempts allow.
Real poisson
 Poisson ratio.
string pySpheresCreator
 python's function for a spheres creation
Real radius
 Mean radius of spheres.
Real radiusRange
 Half size of a radii distribution interval. New sphere will have random radius within the range radius┬▒radiusRange.
Scenescene
shared_ptr< TimingDeltastimingDeltas
 precise profiling information (timing of fragments of the engine)
TimingInfo timingInfo
 high-level profiling information; not serializable
Vector3r velocity
 Mean velocity of spheres.
Vector3r velocityRange
 Half size of a velocities distribution interval. New sphere will have random velocity within the range velocity┬▒velocityRange.
bool volumeSection
 Factory section may be a surface or volume (convex). By default it is a surface. To make its a volume set volumeSection=true.
Real young
 Young modulus.

Private Types

typedef
boost::variate_generator
< boost::minstd_rand,
boost::uniform_int<> > 
RandomInt

Private Member Functions

void createSphere (shared_ptr< Body > &body, const Vector3r &position, Real r)
Vector3r generatePositionInVolume ()
Vector3r generatePositionOnSurface ()
 REGISTER_ATTRIBUTES (PeriodicEngine,(factoryFacets)(volumeSection)(maxAttempts)(radius)(radiusRange)(velocity)(velocityRange)(angularVelocity)(angularVelocityRange)(young)(poisson)(density)(frictionAngle)(pySpheresCreator)(color)) REGISTER_CLASS_AND_BASE(SpheresFactory

Private Attributes

ColliderbI
 Pointer to Collider. It is necessary in order to probe the bounding volume for new sphere.
 DECLARE_LOGGER
bool first_run
 GlobalEngine
IGeomDispatcheriGME
 Pointer to IGeomDispatcher. It is necessary in order to detect a real overlap with other bodies.
shared_ptr< RandomInt > randomFacet

Static Private Attributes

static
boost::variate_generator
< boost::mt19937,
boost::uniform_real<> > 
randomSymmetricUnit
static
boost::variate_generator
< boost::mt19937,
boost::uniform_real<> > 
randomUnit

Detailed Description

Produces spheres over the course of a simulation.

Definition at line 20 of file SpheresFactory.hpp.


The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index