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

ResetRandomPosition Class Reference

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

#include <ResetRandomPosition.hpp>

Inheritance diagram for ResetRandomPosition:
Inheritance graph
[legend]
Collaboration diagram for ResetRandomPosition:
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

tuple p = utils.getViscoelasticFromSpheresInteraction(s.state['mass'],tc,en,es)
list s = O.bodies[id]
Scenescene
shared_ptr< TimingDeltastimingDeltas
 precise profiling information (timing of fragments of the engine)
TimingInfo timingInfo
 high-level profiling information; not serializable

Private Types

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

Private Member Functions

Vector3r generatePositionInVolume ()
Vector3r generatePositionOnSurface ()
 YADE_CLASS_BASE_DOC_ATTRS_CTOR (ResetRandomPosition, GlobalEngine,"Creates spheres during simulation, placing them at random positions. Every time called, one new sphere will be created and inserted in the simulation.",((vector< Body::id_t >, factoryFacets,,,"The geometry of the section where spheres will be placed; they will be placed on facets or in volume between them depending on *volumeSection* flag."))((std::vector< int >, subscribedBodies,,,"Affected bodies."))((Vector3r, point, Vector3r::Zero(),,"??"))((Vector3r, normal, Vector3r(0, 1, 0),,"??"))((bool, volumeSection,((void)"define factory by facets.", false),,"Create new spheres inside factory volume rather than on its surface."))((int, maxAttempts, 20,,"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."))((Vector3r, velocity, Vector3r::Zero(),,"Mean velocity of spheres."))((Vector3r, velocityRange, Vector3r::Zero(),,"Half size of a velocities distribution interval. New sphere will have random velocity within the range velocity┬▒velocityRange."))((Vector3r, angularVelocity, Vector3r::Zero(),,"Mean angularVelocity of spheres."))((Vector3r, angularVelocityRange, Vector3r::Zero(),,"Half size of a angularVelocity distribution interval. New sphere will have random angularVelocity within the range angularVelocity┬▒angularVelocityRange.")), first_run=true;)

Private Attributes

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

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 ResetRandomPosition.hpp.


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

Generated by  Doxygen 1.6.0   Back to index