|
#include <SuperQuadricParticle.h>
Public Member Functions | |
SuperQuadricParticle () | |
Basic Particle constructor, creates a superquadric with axes (1,1,1) and exponents (2,2), so it creates a sphere with radius 1. More... | |
SuperQuadricParticle (const SuperQuadricParticle &p) | |
Copy constructor, which accepts as input a reference to a Superquadric. It creates a copy of this Particle and all it's information. Usually it is better to use the copy() function for polymorphism. More... | |
SuperQuadricParticle (const BaseParticle &p) | |
Base class copy constructor. Creates a Superquadric particle from a NonSphericalParticle. More... | |
~SuperQuadricParticle () override | |
Destructor, needs to be implemented and checked to see if it is the largest or smallest particle currently in its particleHandler. More... | |
SuperQuadricParticle * | copy () const override |
Copy method. It calls to copy constructor of this superquadric, useful for polymorphism. More... | |
void | write (std::ostream &os) const override |
Write function: write this SuperQuadric to the given output-stream, for example a restart-file. More... | |
void | read (std::istream &is) override |
Read function: read in the information for this superquadric from the given input-stream, for example a restart file. More... | |
std::string | getName () const override |
Returns the name of the class, here "SuperQuadric". More... | |
void | setAxesAndExponents (const Mdouble &a1, const Mdouble &a2, const Mdouble &a3, const Mdouble &eps1, const Mdouble &eps2) |
Set the geometrical properties of the superquadrics, namely the axes-lengths a1, a2 and a3, and the exponents epsilon1 and epsilon2. We use the super-ellipsoid definition stated in Chapter 2 of the book "Segmentation and recovery of
superquadrics" by Jaklic et al. More... | |
void | setAxesAndExponents (const Vec3D &axes, const Mdouble &eps1, const Mdouble &eps2) |
Set the geometrical properties of the superquadrics, namely the axes-lengths axes, and the exponents epsilon1 and epsilon2. We use the super-ellipsoid definition stated in Chapter 2 of the book "Segmentation and recovery of
superquadrics" by Jaklic et al. More... | |
void | setAxes (const Mdouble &a1, const Mdouble &a2, const Mdouble &a3) |
Set the axes-lengths to a1, a2 and a3 for this superquadric. We use the super-ellipsoid definition stated in Chapter 2 of the book "Segmentation and recovery of
superquadrics" by Jaklic et al. More... | |
void | setAxes (const Vec3D &axes) override |
Set the axes-lengths to axes for this superquadric. We use the super-ellipsoid definition stated in Chapter 2 of the book "Segmentation and recovery of
superquadrics" by Jaklic et al. More... | |
void | setExponents (const Mdouble &eps1, const Mdouble &eps2) override |
Set the exponents to eps1 and eps2 for this superquadric. We use the super-ellipsoid definition stated in Chapter 2 of the book "Segmentation and recovery of
superquadrics" by Jaklic et al. More... | |
Vec3D | getAxes () const override |
Get the axes-lengths of this superquadric. We use the super-ellipsoid definition stated in Chapter 2 of the book "Segmentation and recovery of
superquadrics" by Jaklic et al. More... | |
Mdouble | getExponentEps1 () const override |
Get the first exponent of this superquadric. We use the super-ellipsoid definition stated in Chapter 2 of the book "Segmentation and recovery of
superquadrics" by Jaklic et al. More... | |
Mdouble | getExponentEps2 () const override |
Get the second exponent of this superquadric. We use the super-ellipsoid definition stated in Chapter 2 of the book "Segmentation and recovery of
superquadrics" by Jaklic et al. More... | |
Mdouble | getVolume () const override |
void | setInertia () override |
Compute and set the inertia-tensor for this superquadric. For internal use only. More... | |
void | setRadius (const Mdouble radius) override |
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) More... | |
BaseInteraction * | getInteractionWith (BaseParticle *P, unsigned timeStamp, InteractionHandler *interactionHandler) override |
Checks if this superquadric is in interaction with the given particle, and if so, returns vector of pointer to the associated BaseInteraction object (else returns empty vector). More... | |
Mdouble | getCurvature (const LabFixedCoordinates &labFixedCoordinates) const override |
Get the mean curvature of this superquadric at the given (lab-fixed) position, see Podlozhyuk et al. (2017) eq (39) More... | |
bool | isInContactWith (const BaseParticle *p) const override |
Get whether or not this superquadric is in contact with the given particle. More... | |
SmallVector< 3 > | computeShapeGradientLabFixed (const LabFixedCoordinates &labFixedCoordinates) const |
Compute and get the gradient of the shape-function at the given (lab-fixed) position. More... | |
BaseInteraction * | getInteractionWithSuperQuad (SuperQuadricParticle *p, unsigned timeStamp, InteractionHandler *interactionHandler) |
Checks if this superquadric is in interaction with the given superquadric, and if so, returns vector of pointer to the associated BaseInteraction object (else returns empty vector). More... | |
SmallMatrix< 3, 3 > | computeHessianLabFixed (const LabFixedCoordinates &labFixedCoordinates) const |
Compute and get the hessian ("second derivative") of the shape-function at the given (lab-fixed) position. More... | |
Mdouble | computeShape (const LabFixedCoordinates &labFixedCoordinates) const |
Compute and get the shape-functiion at the given (lab-fixed) position. More... | |
SmallVector< 4 > | computeResidualContactDetection (const SmallVector< 4 > &position, const SuperQuadricParticle *p1, const SuperQuadricParticle *p2) const |
Objective function for contact detection between the two given superquadrics. See Podlozhyuk et al. (2017) eq (22). More... | |
SmallMatrix< 4, 4 > | getJacobianOfContactDetectionObjective (const SmallVector< 4 > &contactPoint, const SuperQuadricParticle *p1, const SuperQuadricParticle *p2) const |
Compute and return the derivative of functionThatShouldBecomeZeroForContactDetection, both to the position and the Lagrange multiplier, and evaluated at the contact point. More... | |
SmallVector< 4 > | getInitialGuessForContact (const SuperQuadricParticle *pQuad, BaseInteraction *C) const |
Get an initial guess for the contact-point between this particle and the given particle. More... | |
Mdouble | overlapFromContactPoint (const LabFixedCoordinates &contactPoint, const LabFixedCoordinates &normal) const |
Compute the distance between the contact-point and surface of this superquadric particle. More... | |
SmallVector< 4 > | getContactPoint (const SuperQuadricParticle *p, BaseInteraction *C) const |
Compute the contact point between this and the given superquadric particle. More... | |
SmallVector< 4 > | getContactPointPlanB (const SuperQuadricParticle *pOther, unsigned numberOfSteps) const |
If the "normal" procedure fails to find a contact point, use an alternative approach that involves starting with two spheres to compute the interaction, and becoming less and less spherical. More... | |
bool | computeContactPoint (SmallVector< 4 > &contactPoint, const SuperQuadricParticle *p1, const SuperQuadricParticle *p2) const |
Perform the actual Newton-iterations to find the contact point. Note, that it is given back as a parameter. More... | |
void | writeDebugMessageStep1 (const SuperQuadricParticle *pQuad, const SmallVector< 4 > &contactPointPlanB) const |
void | writeDebugMessageStep2 (const SuperQuadricParticle *pQuad, const Vec3D &dAxesThis, const Mdouble &dn11, const Mdouble &dn12, const Vec3D &dAxesOther, const Mdouble &dn21, const Mdouble &dn22) const |
void | writeDebugMessageStep3 (const Vec3D &axesThis, const Mdouble &n11, const Mdouble &n12, const Vec3D &axesOther, const Mdouble &n21, const Mdouble &n22) const |
void | writeDebugMessageMiddleOfLoop (const SuperQuadricParticle &p1, const SuperQuadricParticle &p2, SmallVector< 4 > &contactPointPlanB, const unsigned int &counter) const |
Mdouble | getInteractionRadius (const BaseParticle *particle) const |
returns the radius plus half the interactionDistance of the mixed species More... | |
void | computeMass (const ParticleSpecies &s) override |
Computes the particle's (inverse) mass and inertia. More... | |
Public Member Functions inherited from NonSphericalParticle | |
NonSphericalParticle ()=default | |
NonSphericalParticle (const NonSphericalParticle &p)=default | |
NonSphericalParticle (const BaseParticle &p) | |
Base class copy constructor. Creates a NonSphericalParticle particle from a BaseParticle. More... | |
~NonSphericalParticle () override=default | |
bool | isSphericalParticle () const override |
virtual Mdouble | getKineticEnergy () const override |
virtual Mdouble | getRotationalEnergy () const override |
Calculates the particle's rotational kinetic energy. More... | |
Public Member Functions inherited from BaseParticle | |
BaseParticle () | |
Basic Particle constructor, creates an Particle at (0,0,0) with radius, mass and inertia equal to 1. More... | |
BaseParticle (const BaseParticle &p) | |
Particle copy constructor, which accepts as input a reference to a Particle. It creates a copy of this Particle and all it's information. Usually it is better to use the copy() function for polymorphism. More... | |
BaseParticle (const ParticleSpecies *s) | |
~BaseParticle () override | |
Particle destructor, needs to be implemented and checked if it removes tangential spring information. More... | |
void | fixParticle () |
Fix Particle function. It fixes a Particle by setting its inverse mass and inertia and velocities to zero. More... | |
bool | isFixed () const override |
Is fixed Particle function. It returns whether a Particle is fixed or not, by checking its inverse Mass. More... | |
bool | isMPIParticle () const |
Indicates if this particle is a ghost in the MPI domain. More... | |
void | setMPIParticle (bool flag) |
Flags the mpi particle status. More... | |
bool | isInMPIDomain () |
Indicates if the particle is in the communication zone of the mpi domain. More... | |
void | setInMPIDomain (bool flag) |
Flags the status of the particle if wether it is in the communication zone or not. More... | |
bool | isInPeriodicDomain () const |
Indicates if the particle is in the periodic boundary communication zone. More... | |
void | setInPeriodicDomain (bool flag) |
Flags the status of the particle whether it is in the periodic communication zone or not. More... | |
bool | isPeriodicGhostParticle () const |
Indicates if this particle is a ghost in the periodic boundary. More... | |
void | setPeriodicGhostParticle (bool flag) |
Flags the status of the particle to be a ghost in periodic boundary or not. More... | |
bool | isMaserParticle () const |
Indicates if this particle belongs to the maser boundary. More... | |
void | setMaserParticle (bool flag) |
Flags the status of the particle if it belongs to the maser boundary or not. More... | |
void | setCommunicationComplexity (unsigned complexity) |
Set the communication complexity of the particle. More... | |
unsigned | getCommunicationComplexity () |
Obtains the communication complexity of the particle. More... | |
void | setPeriodicComplexity (std::vector< int > complexity) |
Set the periodic communication complexity of the particle. More... | |
void | setPeriodicComplexity (int index, int value) |
Set the periodic communication complexity of the particle. More... | |
const std::vector< int > & | getPeriodicComplexity () |
Obtains the periodic communication complexity of the particle. More... | |
void | setPreviousPeriodicComplexity (std::vector< int > complexity) |
Set the previous periodic communication complexity of the paritcle. More... | |
const std::vector< int > & | getPreviousPeriodicComplexity () const |
Sets the previous periodic communication complexity of the particle. More... | |
int | getPeriodicComplexity (int index) |
Gets the periodic communication complexity of a certain boundary. More... | |
void | unfix () |
Unfix Particle function, which required a reference to the Species vector. It unfixes a Particle by computing the Particles mass and inertia. More... | |
virtual void | oldRead (std::istream &is) |
virtual void | setInfo (Mdouble info) |
Sets some user-defined information about this object (by default, species ID). More... | |
virtual Mdouble | getInfo () const |
Returns some user-defined information about this object (by default, species ID). More... | |
void | printHGrid (std::ostream &os) const |
Adds particle's HGrid level and cell coordinates to an ostream. More... | |
unsigned int | getHGridLevel () const |
Returns particle's HGrid level. More... | |
BaseParticle * | getHGridNextObject () const |
Returns pointer to next object in particle's HGrid level & cell. More... | |
BaseParticle * | getHGridPrevObject () const |
Returns pointer to previous object in particle's HGrid level & cell. More... | |
int | getHGridX () const |
Returns particle's HGrid cell X-coordinate. More... | |
int | getHGridY () const |
Returns particle's HGrid cell Y-coordinate. More... | |
int | getHGridZ () const |
Returns particle's HGrid cell Z-coordinate. More... | |
MatrixSymmetric3D | getInvInertia () const |
Returns the inverse of the particle's inertia tensor. More... | |
Mdouble | getInvMass () const override |
Returns the inverse of the particle's mass. More... | |
Mdouble | getGravitationalEnergy () const |
Calculates the particle's gravitational energy. More... | |
Mdouble | getMass () const |
Returns the particle's mass. More... | |
Mdouble | getSurfaceArea () const |
Vec3D | getMomentum () const |
MatrixSymmetric3D | getInertia () const |
Vec3D | getAngularMomentum () const |
BaseParticle * | getPeriodicFromParticle () const |
Returns the 'original' particle this one's a periodic copy of. More... | |
Mdouble | getRadius () const |
Returns the particle's radius. More... | |
Mdouble | getMaxInteractionRadius () const |
Returns the particle's interaction radius, which might be different from radius_ (e.g., when dealing with wet particles) More... | |
Mdouble | getInteractionDistance (const BaseInteractable *i) const |
Returns the interactionDistance_ of the mixed species of this particle and the particle or wall i. More... | |
Mdouble | getSumOfInteractionRadii (const BaseParticle *particle) const |
returns the sum of the radii plus the interactionDistance More... | |
Mdouble | getWallInteractionRadius (const BaseWall *wall) const |
returns the radius plus the interactionDistance More... | |
const Vec3D & | getDisplacement () const |
Returns the particle's displacement relative to the previous time step. More... | |
const Vec3D & | getPreviousPosition () const |
Returns the particle's position in the previous time step. More... | |
const Vec3D | getDisplacement2 (Mdouble xmin, Mdouble xmax, Mdouble ymin, Mdouble ymax, Mdouble zmin, Mdouble zmax, Mdouble t) const |
void | setInertia (MatrixSymmetric3D inertia) |
Sets the particle's inertia_ (and adjusts invInertia_ accordingly) More... | |
void | setInverseInertia (MatrixSymmetric3D inverseInertia) |
Sets the particle's inertia_ (and adjusts invInertia_ accordingly) More... | |
void | setInfiniteInertia () |
Sets the particle's inertia_ to 'infinite' (1e20) and its invInertia_ to 0. More... | |
void | setPeriodicFromParticle (BaseParticle *p) |
Assigns the pointer to the 'original' particle this one's a periodic copy of (used in periodic boundary condition implementations). More... | |
void | setHGridX (const int x) |
Sets the particle's HGrid cell X-coordinate. More... | |
void | setHGridY (const int y) |
Sets the particle's HGrid cell Y-coordinate. More... | |
void | setHGridZ (const int z) |
Sets the particle's HGrid cell Z-coordinate. More... | |
void | setHGridLevel (const unsigned int level) |
Sets the particle's HGrid level. More... | |
void | setHGridNextObject (BaseParticle *p) |
Sets the pointer to the next object in the particle's HGrid cell & level. More... | |
void | setHGridPrevObject (BaseParticle *p) |
Sets the pointer to the previous object in the particle's HGrid cell & level. More... | |
MERCURYDPM_DEPRECATED void | setMass (Mdouble mass) |
Sets the particle's mass. More... | |
void | setMassForP3Statistics (Mdouble mass) |
Sets the particle's mass This function should not be used, but is necessary to extend the CG toolbox to non-spherical particles. More... | |
void | setDisplacement (const Vec3D &disp) |
Sets the particle's displacement (= difference between current position and that of the previous time step) More... | |
void | setPreviousPosition (const Vec3D &pos) |
Sets the particle's position in the previous time step. More... | |
void | movePrevious (const Vec3D &posMove) |
Adds a vector to the particle's previousPosition_. More... | |
void | accelerate (const Vec3D &vel) |
Increases the particle's velocity_ by the given vector. More... | |
void | angularAccelerate (const Vec3D &angVel) |
Increases the particle's angularVelocity_ by the given vector. More... | |
void | addDisplacement (const Vec3D &addDisp) |
Adds a vector to the particle's displacement_. More... | |
void | setHandler (ParticleHandler *handler) |
Sets the pointer to the particle's ParticleHandler. More... | |
ParticleHandler * | getHandler () const |
Returns pointer to the particle's ParticleHandler. More... | |
virtual void | integrateBeforeForceComputation (double time, double timeStep) |
First step of Velocity Verlet integration. More... | |
virtual void | integrateAfterForceComputation (double time, double timeStep) |
Second step of Velocity Verlet integration. More... | |
unsigned int | getParticleDimensions () const |
Returns the particle's dimensions (either 2 or 3). More... | |
MERCURYDPM_DEPRECATED void | setIndSpecies (unsigned int indSpecies) override |
void | setSpecies (const ParticleSpecies *species) |
virtual unsigned | getNumberOfFieldsVTK () const |
virtual std::string | getTypeVTK (unsigned i) const |
virtual std::string | getNameVTK (unsigned i) const |
virtual std::vector< Mdouble > | getFieldVTK (unsigned i) const |
virtual void | actionsAfterTimeStep () |
const HGridCell & | getHGridCell () const |
BaseParticle * | getClump () const |
bool | isClump () const |
Checks if particle is a clump (container) More... | |
bool | isPebble () const |
Checks if particle is a pebble (belongs to a clump) More... | |
virtual Vec3D | getCenterOfMass () |
virtual void | actionsAfterAddObject () |
Public Member Functions inherited from BaseInteractable | |
BaseInteractable () | |
Default BaseInteractable constructor. More... | |
BaseInteractable (const BaseInteractable &p) | |
Copy constructor. More... | |
~BaseInteractable () override | |
Destructor, it simply destructs the BaseInteractable and all the objects it contains. More... | |
unsigned int | getIndSpecies () const |
Returns the index of the species associated with the interactable object. More... | |
const ParticleSpecies * | getSpecies () const |
Returns a pointer to the species of this BaseInteractable. More... | |
void | setSpecies (const ParticleSpecies *species) |
Sets the species of this BaseInteractable. More... | |
const Vec3D & | getForce () const |
Returns the force on this BaseInteractable. More... | |
const Vec3D & | getTorque () const |
Returns the torque on this BaseInteractable. More... | |
void | setForce (const Vec3D &force) |
Sets the force on this BaseInteractable. More... | |
void | setTorque (const Vec3D &torque) |
Sets the torque on this BaseInteractable. More... | |
void | addForce (const Vec3D &addForce) |
Adds an amount to the force on this BaseInteractable. More... | |
void | addTorque (const Vec3D &addTorque) |
Adds an amount to the torque on this BaseInteractable. More... | |
virtual void | resetForceTorque (int numberOfOMPthreads) |
void | sumForceTorqueOMP () |
const Vec3D & | getPosition () const |
Returns the position of this BaseInteractable. More... | |
const Quaternion & | getOrientation () const |
Returns the orientation of this BaseInteractable. More... | |
virtual void | setPosition (const Vec3D &position) |
Sets the position of this BaseInteractable. More... | |
void | setOrientationViaNormal (Vec3D normal) |
Sets the orientation of this BaseInteractable by defining the vector that results from the rotation of the (1,0,0) vector. More... | |
void | setOrientationViaEuler (Vec3D eulerAngle) |
Sets the orientation of this BaseInteractable by defining the euler angles. More... | |
virtual void | setOrientation (const Quaternion &orientation) |
Sets the orientation of this BaseInteractable. More... | |
virtual void | move (const Vec3D &move) |
Moves this BaseInteractable by adding an amount to the position. More... | |
virtual void | rotate (const Vec3D &angularVelocityDt) |
Rotates this BaseInteractable. More... | |
const std::vector< BaseInteraction * > & | getInteractions () const |
Returns a list of interactions which belong to this interactable. More... | |
void | addInteraction (BaseInteraction *I) |
Adds an interaction to this BaseInteractable. More... | |
bool | removeInteraction (BaseInteraction *I) |
Removes an interaction from this BaseInteractable. More... | |
void | copyInteractionsForPeriodicParticles (const BaseInteractable &p) |
Copies interactions to this BaseInteractable whenever a periodic copy made. More... | |
void | setVelocity (const Vec3D &velocity) |
set the velocity of the BaseInteractable. More... | |
void | setAngularVelocity (const Vec3D &angularVelocity) |
set the angular velocity of the BaseInteractble. More... | |
void | addVelocity (const Vec3D &velocity) |
adds an increment to the velocity. More... | |
void | addAngularVelocity (const Vec3D &angularVelocity) |
add an increment to the angular velocity. More... | |
virtual const Vec3D & | getVelocity () const |
Returns the velocity of this interactable. More... | |
virtual const Vec3D & | getAngularVelocity () const |
Returns the angular velocity of this interactable. More... | |
void | setPrescribedPosition (const std::function< Vec3D(double)> &prescribedPosition) |
Allows the position of an infinite mass interactable to be prescribed. More... | |
void | applyPrescribedPosition (double time) |
Computes the position from the user defined prescribed position function. More... | |
void | setPrescribedVelocity (const std::function< Vec3D(double)> &prescribedVelocity) |
Allows the velocity of an infinite mass interactable to be prescribed. More... | |
void | applyPrescribedVelocity (double time) |
Computes the velocity from the user defined prescribed velocity function. More... | |
void | setPrescribedOrientation (const std::function< Quaternion(double)> &prescribedOrientation) |
Allows the orientation of the infinite mass interactbale to be prescribed. More... | |
void | applyPrescribedOrientation (double time) |
Computes the orientation from the user defined prescribed orientation function. More... | |
void | setPrescribedAngularVelocity (const std::function< Vec3D(double)> &prescribedAngularVelocity) |
Allows the angular velocity of the infinite mass interactable to be prescribed. More... | |
void | applyPrescribedAngularVelocity (double time) |
Computes the angular velocity from the user defined prescribed angular velocity. More... | |
virtual const Vec3D | getVelocityAtContact (const Vec3D &contact) const |
Returns the velocity at the contact point, use by many force laws. More... | |
void | integrateBeforeForceComputation (double time, double timeStep) |
This is part of integrate routine for objects with infinite mass. More... | |
void | integrateAfterForceComputation (double time, double timeStep) |
This is part of the integration routine for objects with infinite mass. More... | |
virtual bool | isFaceContact (const Vec3D &normal) const |
Public Member Functions inherited from BaseObject | |
BaseObject ()=default | |
Default constructor. More... | |
BaseObject (const BaseObject &p)=default | |
Copy constructor, copies all the objects BaseObject contains. More... | |
virtual | ~BaseObject ()=default |
virtual destructor More... | |
virtual void | moveInHandler (unsigned int index) |
Except that it is virtual, it does the same thing as setIndex() does. More... | |
void | setIndex (unsigned int index) |
Allows one to assign an index to an object in the handler/container. More... | |
void | setId (unsigned long id) |
Assigns a unique identifier to each object in the handler (container) which remains constant even after the object is deleted from the container/handler. More... | |
unsigned int | getIndex () const |
Returns the index of the object in the handler. More... | |
unsigned int | getId () const |
Returns the unique identifier of any particular object. More... | |
void | setGroupId (unsigned groupId) |
unsigned | getGroupId () const |
Private Member Functions | |
void | setBoundingRadius () |
Get the radius of the sphere that fits precisely around the particle. More... | |
Private Attributes | |
Mdouble | eps1_ |
Blockiness parameters. More... | |
Mdouble | eps2_ |
Vec3D | axes_ |
Lengths of principal axes (a1, a2, a3). More... | |
Additional Inherited Members | |
Public Attributes inherited from BaseParticle | |
Mdouble | radius_ |
Mdouble | invMass_ |
Particle radius_. More... | |
MatrixSymmetric3D | invInertia_ |
Inverse Particle mass (for computation optimization) More... | |
BaseParticle * | clumpParticle |
Function that updates necessary quantities of a clump particle after adding a pebble. More... | |
bool | isPebble_ |
pointer to a clump particle (for a pebble) More... | |
bool | isClump_ |
The particle is pebble. More... | |
SuperQuadricParticle::SuperQuadricParticle | ( | ) |
Basic Particle constructor, creates a superquadric with axes (1,1,1) and exponents (2,2), so it creates a sphere with radius 1.
calls the default constructor of BaseParticle, and creates an SuperEllipsoid with axes (1,1,1) and exponents (2,2), so it creates a sphere with radius 1.
References axes_, DEBUG, eps1_, eps2_, and logger.
Referenced by copy(), getInteractionWith(), and isInContactWith().
SuperQuadricParticle::SuperQuadricParticle | ( | const SuperQuadricParticle & | p | ) |
Copy constructor, which accepts as input a reference to a Superquadric. It creates a copy of this Particle and all it's information. Usually it is better to use the copy() function for polymorphism.
Constructor that copies most of the properties of the given particle. Please note that not everything is copied, for example the position in the HGrid is not determined yet by the end of this constructor. It also does not copy the interactions and the pointer to the handler that handles this particle. Use with care.
[in,out] | p | Reference to the SuperQuad this one should become a copy of. |
SuperQuadricParticle::SuperQuadricParticle | ( | const BaseParticle & | p | ) |
Base class copy constructor. Creates a Superquadric particle from a NonSphericalParticle.
References axes_, eps1_, eps2_, and BaseParticle::getRadius().
|
override |
Destructor, needs to be implemented and checked to see if it is the largest or smallest particle currently in its particleHandler.
Destructor. It asks the ParticleHandler to check if this was the smallest or largest particle and adjust itself accordingly.
References ParticleHandler::checkExtremaOnDelete(), DEBUG, BaseParticle::getHandler(), BaseObject::getId(), and logger.
bool SuperQuadricParticle::computeContactPoint | ( | SmallVector< 4 > & | contactPoint, |
const SuperQuadricParticle * | p1, | ||
const SuperQuadricParticle * | p2 | ||
) | const |
Perform the actual Newton-iterations to find the contact point. Note, that it is given back as a parameter.
Function that actually performs the Newton iterations for contact-detection. We use a Newton-method with adaptive damping, i.e. we start with an undamped Newton iteration, and if we "overshoot" we use a damping-factor that gets halved until there is no overshoot anymore. If the damping-factor gets too small, either plan B is initiated, or if this is already plan B, we give an error. After each iteration, the damping factor is set to 1 again.
[in|out] | contactPoint The contact point we are looking for. The input is an approximate contact point that is obtained by another method, and we update this point until we reach the defined tolerance. | |
[in] | p1 | The first particle of the contact we are looking for |
[in] | p2 | The second particle of the contact we are looking for |
References computeResidualContactDetection(), getJacobianOfContactDetectionObjective(), logger, SmallMatrix< numberOfRows, numberOfColumns >::solve(), and VERBOSE.
Referenced by getContactPoint(), and getContactPointPlanB().
SmallMatrix< 3, 3 > SuperQuadricParticle::computeHessianLabFixed | ( | const LabFixedCoordinates & | labFixedCoordinates | ) | const |
Compute and get the hessian ("second derivative") of the shape-function at the given (lab-fixed) position.
This function computes the Hessian ("second derivative") of the shape function in the body-fixed coordinate system. The expressions are provided in Eq. 15 of the article in Comp. Part. Mech. (2017) 4 : 101-118.
References A, axes_, eps1_, eps2_, BaseInteractable::getOrientation(), BaseInteractable::getPosition(), Quaternion::getRotationMatrix(), Quaternion::rotateBack(), mathsFunc::sign(), Vec3D::X, Vec3D::Y, and Vec3D::Z.
Referenced by getCurvature(), getJacobianOfContactDetectionObjective(), ShapeGradientHessianTester::testCushion(), ShapeGradientHessianTester::testEllipsoid(), ShapeGradientHessianTester::testRoundedBeam(), and ShapeGradientHessianTester::testSphere().
|
overridevirtual |
Computes the particle's (inverse) mass and inertia.
Reimplemented from BaseParticle.
References axes_, mathsFunc::beta(), eps1_, eps2_, ERROR, ParticleSpecies::getDensity(), BaseParticle::getParticleDimensions(), getVolume(), BaseParticle::invInertia_, BaseParticle::invMass_, BaseParticle::isFixed(), logger, Vec3D::X, MatrixSymmetric3D::XX, MatrixSymmetric3D::XY, MatrixSymmetric3D::XZ, Vec3D::Y, MatrixSymmetric3D::YY, MatrixSymmetric3D::YZ, Vec3D::Z, and MatrixSymmetric3D::ZZ.
SmallVector< 4 > SuperQuadricParticle::computeResidualContactDetection | ( | const SmallVector< 4 > & | position, |
const SuperQuadricParticle * | p1, | ||
const SuperQuadricParticle * | p2 | ||
) | const |
Objective function for contact detection between the two given superquadrics. See Podlozhyuk et al. (2017) eq (22).
For the contact detection, we formulate the optimisation problem "minimise F1 + F2, s.t. F1 = F2", where F1 and F2 are the shape functions of particles 1 and 2. Define a Lagrange multiplier mu^2, then this is equivalent to solving "Gradient1 + mu^2 Gradient2 = 0, F1 - F2 = 0". The left-hand side of that function is computed in this function. See also Comp. Part. Mech. (2017) 4 : 101-118, equation 22.
[in] | position | Current guess for the contact-point, where the expression above should be evaluated |
[in] | p1 | First particle for which we are looking for a contact with. |
[in] | p2 | Second particle for which we are looking for a contact with. |
References computeShape(), computeShapeGradientLabFixed(), constants::i, Vec3D::X, Vec3D::Y, and Vec3D::Z.
Referenced by computeContactPoint().
Mdouble SuperQuadricParticle::computeShape | ( | const LabFixedCoordinates & | labFixedCoordinates | ) | const |
Compute and get the shape-functiion at the given (lab-fixed) position.
This function computes the value of the shape function in the lab-fixed coordinate system. The expression is provided in Section 2.3 of the article in Comp. Part. Mech. (2017) 4 : 101-118.
References axes_, eps1_, eps2_, BaseInteractable::getOrientation(), BaseInteractable::getPosition(), Quaternion::rotateBack(), Vec3D::X, Vec3D::Y, and Vec3D::Z.
Referenced by computeResidualContactDetection(), getInteractionWithSuperQuad(), isInContactWith(), overlapFromContactPoint(), ShapeGradientHessianTester::testCushion(), ShapeGradientHessianTester::testEllipsoid(), ShapeGradientHessianTester::testRoundedBeam(), and ShapeGradientHessianTester::testSphere().
SmallVector< 3 > SuperQuadricParticle::computeShapeGradientLabFixed | ( | const LabFixedCoordinates & | labFixedCoordinates | ) | const |
Compute and get the gradient of the shape-function at the given (lab-fixed) position.
This function computes the gradient ("first derivative") of the shape function in the lab-fixed coordinate system. The expressions are provided in Eq. 14 of the article in Comp. Part. Mech. (2017) 4 : 101-118.
References axes_, eps1_, eps2_, BaseInteractable::getOrientation(), BaseInteractable::getPosition(), Quaternion::rotate(), Quaternion::rotateBack(), mathsFunc::sign(), Vec3D::X, Vec3D::Y, and Vec3D::Z.
Referenced by computeResidualContactDetection(), getCurvature(), getInteractionWithSuperQuad(), getJacobianOfContactDetectionObjective(), overlapFromContactPoint(), ShapeGradientHessianTester::testCushion(), ShapeGradientHessianTester::testEllipsoid(), ShapeGradientHessianTester::testRoundedBeam(), and ShapeGradientHessianTester::testSphere().
|
overridevirtual |
Copy method. It calls to copy constructor of this superquadric, useful for polymorphism.
Copy method. Uses copy constructor to create a copy on the heap. Useful for polymorphism.
Implements NonSphericalParticle.
References SuperQuadricParticle().
Referenced by EllipsoidsBouncingOnWallDemo::setupInitialConditions(), EllipticalSuperQuadricCollision::setupInitialConditions(), SlidingSpheresUnitTest::setupInitialConditions(), SphericalSuperQuadricCollision::setupInitialConditions(), ContactDetectionNormalSpheresTest::setupInitialConditions(), ContactDetectionRotatedSpheresTest::setupInitialConditions(), and ContactDetectionTester::setupParticles().
|
overridevirtual |
Get the axes-lengths of this superquadric. We use the super-ellipsoid definition stated in Chapter 2 of the book "Segmentation and recovery of superquadrics" by Jaklic et al.
TW we could remove this function from the BaseParticle and use a dynamic_cast instead
ID Middle-term plan is to template the BaseParticle on shape-type, so that we won't have to cast etc.
Reimplemented from BaseParticle.
References axes_.
Referenced by getContactPointPlanB(), InfiniteWall::getDistanceNormalOverlapSuperquadric(), writeDebugMessageStep1(), and writeDebugMessageStep2().
SmallVector< 4 > SuperQuadricParticle::getContactPoint | ( | const SuperQuadricParticle * | p, |
BaseInteraction * | C | ||
) | const |
Compute the contact point between this and the given superquadric particle.
Computes the contact point between this and the given superquadric particle. It first gets a first guess for the contact point, and then uses that to compute the real contact-point with Newton-iterations.
[in] | p | the particle with which we want to know the contact point with. |
[in] | C | The contact between this and the give superquadric. Does not contain information of this time-step yet. This contact is used to see if there was an interaction between p and this superquadric in the time-step before, and if so, that contact point can serve as an initial point for contact-detection between the particles. |
References computeContactPoint(), getContactPointPlanB(), and getInitialGuessForContact().
Referenced by getInteractionWithSuperQuad(), and isInContactWith().
SmallVector< 4 > SuperQuadricParticle::getContactPointPlanB | ( | const SuperQuadricParticle * | pOther, |
unsigned | numberOfSteps | ||
) | const |
If the "normal" procedure fails to find a contact point, use an alternative approach that involves starting with two spheres to compute the interaction, and becoming less and less spherical.
If the "normal" method of finding a contact point diverges, then we start plan B. For this, we approximate the current and given particle by spheres, and move more and more towards the actual shape for the particles in small increments. This way, we have a relatively good starting point for each new optimisation problem, and therefore the chance that our contact-detection algorithm diverges is much smaller. This is based on equations (24) - (27) of Comp. Part. Mech. (2017) 4 : 101-118.
[in] | pOther | Particle we want to know if the contact-point with |
References computeContactPoint(), ERROR, getAxes(), getExponentEps1(), getExponentEps2(), getInteractionRadius(), BaseInteractable::getOrientation(), BaseInteractable::getPosition(), logger, setAxesAndExponents(), BaseInteractable::setOrientation(), BaseInteractable::setPosition(), VERBOSE, write(), writeDebugMessageMiddleOfLoop(), writeDebugMessageStep1(), writeDebugMessageStep2(), writeDebugMessageStep3(), Vec3D::X, X, Vec3D::Y, and Vec3D::Z.
Referenced by getContactPoint().
|
overridevirtual |
Get the mean curvature of this superquadric at the given (lab-fixed) position, see Podlozhyuk et al. (2017) eq (39)
Compute the mean curvature, see Comp. Part. Mech. (2017) 4 : 101-118, eq (39)
[in] | labFixedCoordinates | position in lab fixed coordinate system |
Reimplemented from BaseParticle.
References computeHessianLabFixed(), computeShapeGradientLabFixed(), SmallVector< numberOfRows >::length(), and SmallMatrix< numberOfRows, numberOfColumns >::transpose().
|
overridevirtual |
Get the first exponent of this superquadric. We use the super-ellipsoid definition stated in Chapter 2 of the book "Segmentation and recovery of superquadrics" by Jaklic et al.
Reimplemented from BaseParticle.
References eps1_.
Referenced by getContactPointPlanB(), InfiniteWall::getDistanceNormalOverlapSuperquadric(), and writeDebugMessageStep2().
|
overridevirtual |
Get the second exponent of this superquadric. We use the super-ellipsoid definition stated in Chapter 2 of the book "Segmentation and recovery of superquadrics" by Jaklic et al.
Reimplemented from BaseParticle.
References eps2_.
Referenced by getContactPointPlanB(), InfiniteWall::getDistanceNormalOverlapSuperquadric(), and writeDebugMessageStep2().
SmallVector< 4 > SuperQuadricParticle::getInitialGuessForContact | ( | const SuperQuadricParticle * | pQuad, |
BaseInteraction * | C | ||
) | const |
Get an initial guess for the contact-point between this particle and the given particle.
For the contact-detection, we need an initial guess where the contact will be (Newton's method only converges if you start sufficiently close). If there was already a contact during the last time-step, the values of the contact-point of last time-step is taken, otherwise it is taken as the middle between both particle-positions.
pQuad | other superquadric for which we want to know if there is a contact |
C | contact between this particle and the given particle |
References BaseInteraction::getContactPoint(), getInteractionRadius(), BaseInteraction::getLagrangeMultiplier(), Vec3D::getLengthSquared(), BaseInteraction::getOverlap(), BaseInteractable::getPosition(), BaseParticle::getSumOfInteractionRadii(), Vec3D::X, Vec3D::Y, and Vec3D::Z.
Referenced by getContactPoint().
Mdouble SuperQuadricParticle::getInteractionRadius | ( | const BaseParticle * | particle | ) | const |
returns the radius plus half the interactionDistance of the mixed species
References BaseSpecies::getHandler(), SpeciesHandler::getMixedObject(), BaseParticle::getRadius(), and BaseInteractable::getSpecies().
Referenced by getContactPointPlanB(), getInitialGuessForContact(), and writeDebugMessageStep1().
|
overridevirtual |
Checks if this superquadric is in interaction with the given particle, and if so, returns vector of pointer to the associated BaseInteraction object (else returns empty vector).
Overwrites BaseInteractable::getInteractionWith. First checks if the bounding radii overlap, and if so, changes the given particle into a superquadric and calls getInteractionWithSuperQuadric to obtain the relevant contact data.
p | Pointer to the particle we want to get the interaction with, can be any type of particle |
timeStamp | Time stamp to be assigned to the interaction object (i.e., the current time) |
interactionHandler | BaseInteraction container from where the interaction is retrieved, and to which it is assigned (if it is a new interaction). |
Reimplemented from BaseParticle.
References getInteractionWithSuperQuad(), Vec3D::getLengthSquared(), BaseParticle::getMaxInteractionRadius(), BaseInteractable::getPosition(), BaseParticle::getRadius(), BaseParticle::isSphericalParticle(), setAxes(), and SuperQuadricParticle().
Referenced by ContactDetectionTester::testEllipsoidsContact(), and ContactDetectionTester::testSpheresContact().
BaseInteraction * SuperQuadricParticle::getInteractionWithSuperQuad | ( | SuperQuadricParticle * | p, |
unsigned | timeStamp, | ||
InteractionHandler * | interactionHandler | ||
) |
Checks if this superquadric is in interaction with the given superquadric, and if so, returns vector of pointer to the associated BaseInteraction object (else returns empty vector).
Computes all relevant information for the contact between this and a superquadric particle. Returns nullptr if there is no (positive) overlap.
[in] | p | Superquadric particle we want to have the contact-information for |
[in] | timeStamp | Time stamp to be assigned to the interaction object (i.e., the current time) |
[in] | interactionHandler | BaseInteraction container from where the interaction is retrieved, and to which it is assigned (if it is a new interaction). |
References computeShape(), computeShapeGradientLabFixed(), getContactPoint(), BaseObject::getIndex(), InteractionHandler::getInteraction(), BaseInteraction::getOverlap(), BaseInteractable::getPosition(), overlapFromContactPoint(), BaseHandler< T >::removeObject(), BaseInteraction::setContactPoint(), BaseInteraction::setDistance(), BaseInteraction::setLagrangeMultiplier(), BaseInteraction::setNormal(), BaseInteraction::setOverlap(), Vec3D::X, Vec3D::Y, and Vec3D::Z.
Referenced by getInteractionWith().
SmallMatrix< 4, 4 > SuperQuadricParticle::getJacobianOfContactDetectionObjective | ( | const SmallVector< 4 > & | contactPoint, |
const SuperQuadricParticle * | p1, | ||
const SuperQuadricParticle * | p2 | ||
) | const |
Compute and return the derivative of functionThatShouldBecomeZeroForContactDetection, both to the position and the Lagrange multiplier, and evaluated at the contact point.
Compute and return the derivative of computeResidualContactDetection, both to the position and the Lagrange multiplier, and evaluated at the contact point. This is done in order to use Newton's method on computeResidualContactDetection, which comes from Comp. Part. Mech. (2017) 4 : 101-118.
The result is a 4x4 matrix, with 4 parts: [0,2]x[0,2] (upper-left corner): Hessian1 + mu^2 Hessian2, where Hessian is the "second derivative" of the shape function and mu^2 the Lagrange multiplier. This is the derivative of (22a) to x in Comp. Part. Mech. (2017) 4 : 101-118. [0,2]x[3] (upper-right corner): 2 * mu * Gradient2, where Gradient is the gradient of the shape function and mu is the Lagrange multiplier. This is the derivative of (22a) to mu in Comp. Part. Mech. (2017) 4 : 101-118. [3]x[0,2] (lower-left corner): Gradient1 - Gradient2, where Gradient is the gradient of the shape function. This is the derivative of (22b) to x in Comp. Part. Mech. (2017) 4 : 101-118. [3]x[3] (lower-right corner): 0. This is the derivative of (22b) to mu in Comp. Part. Mech. (2017) 4 : 101-118.
In order to compute these parts, first compute the first and second derivative of the shape function (the gradient and hessian) in the lab-fixed coordinate system for both particles. To do so, we apply the rotation matrix A on the body-fixed first and second derivative of the shape function, which are computed in the functions computeShapeGradientBodyFixed() and computeHessian(). The expressions for the purpose of mapping are provided in Eq. 18 of the article in Comp. Part. Mech. (2017) 4 : 101-118. Then fill in the respective contributions.
[in] |
References computeHessianLabFixed(), computeShapeGradientLabFixed(), constants::i, Vec3D::X, Vec3D::Y, and Vec3D::Z.
Referenced by computeContactPoint().
|
overridevirtual |
Returns the name of the class, here "SuperQuadric".
Returns the name of the object; in this case "SuperQuadricParticle".
Implements NonSphericalParticle.
|
overridevirtual |
Get the volume of this superquadric.
Returns the volume of the SuperEllipsoid, which is calculated using its principal axis and the exponents. The analytical expressions are taken from Chapter 2 of the book "Segmentation and Recovery of Superquadrics" by Jaklic et al . However, the beta functions that are part of these expressions are approximations, see ExtendedMath.cc
Reimplemented from BaseParticle.
References axes_, mathsFunc::beta(), eps1_, eps2_, BaseParticle::getHandler(), logger, Vec3D::X, Vec3D::Y, and Vec3D::Z.
Referenced by computeMass(), and VolumeTest::test().
|
overridevirtual |
Get whether or not this superquadric is in contact with the given particle.
Get whether or not this superquadric is in contact with the given particle: first transform the particle to a superquadric if necessary, then compute the contact-point using the function getContactPoint. If the shape-function at the contact point is negative, then there is a contact with the given particle, and otherwise not
[in] | p | The particle for which we want to know if there is a contact |
Reimplemented from BaseParticle.
References computeShape(), getContactPoint(), BaseParticle::getRadius(), BaseParticle::isSphericalParticle(), setAxes(), SuperQuadricParticle(), Vec3D::X, Vec3D::Y, and Vec3D::Z.
Referenced by ContactDetectionTester::testEllipsoidsContact().
Mdouble SuperQuadricParticle::overlapFromContactPoint | ( | const LabFixedCoordinates & | contactPoint, |
const LabFixedCoordinates & | normal | ||
) | const |
Compute the distance between the contact-point and surface of this superquadric particle.
Compute the distance between the contact-point and surface of this superquadric particle with Newton-iterations. This is the procedure as described by Comp. Part. Mech. (2017) 4 : 101-118, eq 37.
[in] | contactPoint | The contact point between this particle with another BaseInteractable |
[in] | normal | The normal direction of the contact. |
References computeShape(), computeShapeGradientLabFixed(), Vec3D::dot(), ERROR, logger, Vec3D::X, Vec3D::Y, and Vec3D::Z.
Referenced by getInteractionWithSuperQuad().
|
overridevirtual |
Read function: read in the information for this superquadric from the given input-stream, for example a restart file.
Particle read function, which reads the axes_ and both epsilons from the given input-stream.
[in,out] | is | input stream with particle properties, e.g. a restart-file. |
Reimplemented from BaseParticle.
References axes_, eps1_, eps2_, logger, and BaseParticle::read().
Set the axes-lengths to a1, a2 and a3 for this superquadric. We use the super-ellipsoid definition stated in Chapter 2 of the book "Segmentation and recovery of superquadrics" by Jaklic et al.
Referenced by getInteractionWith(), isInContactWith(), main(), setAxesAndExponents(), ShapesDemo::setupInitialConditions(), ContactDetectionTester::testEllipsoidsContact(), and ContactDetectionWithWallTester::testEllipsoidsContact().
|
overridevirtual |
Set the axes-lengths to axes for this superquadric. We use the super-ellipsoid definition stated in Chapter 2 of the book "Segmentation and recovery of superquadrics" by Jaklic et al.
Reimplemented from BaseParticle.
References axes_, ParticleSpecies::computeMass(), BaseInteractable::getSpecies(), and setBoundingRadius().
void SuperQuadricParticle::setAxesAndExponents | ( | const Mdouble & | a1, |
const Mdouble & | a2, | ||
const Mdouble & | a3, | ||
const Mdouble & | eps1, | ||
const Mdouble & | eps2 | ||
) |
Set the geometrical properties of the superquadrics, namely the axes-lengths a1, a2 and a3, and the exponents epsilon1 and epsilon2. We use the super-ellipsoid definition stated in Chapter 2 of the book "Segmentation and recovery of superquadrics" by Jaklic et al.
References eps1_, eps2_, logger, and setAxes().
Referenced by getContactPointPlanB(), BouncingSuperQuadric::setupInitialConditions(), EllipsoidsBouncingOnWallDemo::setupInitialConditions(), EllipticalSuperQuadricCollision::setupInitialConditions(), GranularCollapse::setupInitialConditions(), SlidingSpheresUnitTest::setupInitialConditions(), SphericalSuperQuadricCollision::setupInitialConditions(), ContactDetectionNormalSpheresTest::setupInitialConditions(), ContactDetectionRotatedSpheresTest::setupInitialConditions(), VisualisationTest::setupInitialConditions(), ContactDetectionWithWallTester::setupParticleAndWall(), ContactDetectionTester::setupParticles(), BoundingRadiusTester::test(), InertiaTensorTester::test(), VolumeTest::test(), ShapeGradientHessianTester::testCushion(), ShapeGradientHessianTester::testEllipsoid(), ShapeGradientHessianTester::testRoundedBeam(), and ShapeGradientHessianTester::testSphere().
void SuperQuadricParticle::setAxesAndExponents | ( | const Vec3D & | axes, |
const Mdouble & | eps1, | ||
const Mdouble & | eps2 | ||
) |
Set the geometrical properties of the superquadrics, namely the axes-lengths axes, and the exponents epsilon1 and epsilon2. We use the super-ellipsoid definition stated in Chapter 2 of the book "Segmentation and recovery of superquadrics" by Jaklic et al.
|
private |
Get the radius of the sphere that fits precisely around the particle.
References axes_, mathsFunc::beta(), eps1_, eps2_, mathsFunc::gamma(), mathsFunc::isEqual(), BaseParticle::setRadius(), mathsFunc::square(), Vec3D::X, Vec3D::Y, and Vec3D::Z.
Referenced by setAxes(), and setExponents().
|
overridevirtual |
Set the exponents to eps1 and eps2 for this superquadric. We use the super-ellipsoid definition stated in Chapter 2 of the book "Segmentation and recovery of superquadrics" by Jaklic et al.
Reimplemented from BaseParticle.
References ParticleSpecies::computeMass(), eps1_, eps2_, BaseInteractable::getSpecies(), logger, and setBoundingRadius().
Referenced by main(), and ShapesDemo::setupInitialConditions().
|
overridevirtual |
Compute and set the inertia-tensor for this superquadric. For internal use only.
This function computes the principal moments of inertia for the superellipsoids. Again, the analytical expressions are taken from Chapter 2 (pg. 36) of the book "Segmentation and Recovery of Superquadrics" by by Jaklic et al .
Reimplemented from BaseParticle.
References axes_, mathsFunc::beta(), eps1_, eps2_, ParticleSpecies::getDensity(), BaseInteractable::getSpecies(), BaseParticle::setInertia(), Vec3D::X, MatrixSymmetric3D::XX, Vec3D::Y, MatrixSymmetric3D::YY, Vec3D::Z, and MatrixSymmetric3D::ZZ.
Referenced by BouncingSuperQuadric::setupInitialConditions(), EllipsoidsBouncingOnWallDemo::setupInitialConditions(), EllipticalSuperQuadricCollision::setupInitialConditions(), GranularCollapse::setupInitialConditions(), SlidingSpheresUnitTest::setupInitialConditions(), SphericalSuperQuadricCollision::setupInitialConditions(), ContactDetectionNormalSpheresTest::setupInitialConditions(), ContactDetectionRotatedSpheresTest::setupInitialConditions(), VisualisationTest::setupInitialConditions(), ContactDetectionWithWallTester::setupParticleAndWall(), and ContactDetectionTester::setupParticles().
|
overridevirtual |
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species)
Sets the radius of the particle, and from that computes the new mass (using its species) and checks whether it now is either the smallest or biggest particle in its ParticleHandler.
[in] | radius | the new radius |
Reimplemented from BaseParticle.
|
overridevirtual |
Write function: write this SuperQuadric to the given output-stream, for example a restart-file.
SuperQuadricParticle print method, which accepts an std::ostream as input. It prints human readable SuperQuadricParticle information to the given output-stream.
[in,out] | os | stream to which the info is written, e.g. a restart-file or std::cout. |
Reimplemented from BaseParticle.
References axes_, eps1_, eps2_, and BaseParticle::write().
Referenced by getContactPointPlanB().
void SuperQuadricParticle::writeDebugMessageMiddleOfLoop | ( | const SuperQuadricParticle & | p1, |
const SuperQuadricParticle & | p2, | ||
SmallVector< 4 > & | contactPointPlanB, | ||
const unsigned int & | counter | ||
) | const |
References BaseInteractable::getOrientation(), BaseInteractable::getPosition(), logger, and VERBOSE.
Referenced by getContactPointPlanB().
void SuperQuadricParticle::writeDebugMessageStep1 | ( | const SuperQuadricParticle * | pQuad, |
const SmallVector< 4 > & | contactPointPlanB | ||
) | const |
References getAxes(), getInteractionRadius(), BaseInteractable::getOrientation(), BaseInteractable::getPosition(), logger, and VERBOSE.
Referenced by getContactPointPlanB().
void SuperQuadricParticle::writeDebugMessageStep2 | ( | const SuperQuadricParticle * | pQuad, |
const Vec3D & | dAxesThis, | ||
const Mdouble & | dn11, | ||
const Mdouble & | dn12, | ||
const Vec3D & | dAxesOther, | ||
const Mdouble & | dn21, | ||
const Mdouble & | dn22 | ||
) | const |
References getAxes(), getExponentEps1(), getExponentEps2(), logger, VERBOSE, Vec3D::X, X, Vec3D::Y, Y, Vec3D::Z, and Z.
Referenced by getContactPointPlanB().
void SuperQuadricParticle::writeDebugMessageStep3 | ( | const Vec3D & | axesThis, |
const Mdouble & | n11, | ||
const Mdouble & | n12, | ||
const Vec3D & | axesOther, | ||
const Mdouble & | n21, | ||
const Mdouble & | n22 | ||
) | const |
|
private |
Lengths of principal axes (a1, a2, a3).
Referenced by computeHessianLabFixed(), computeMass(), computeShape(), computeShapeGradientLabFixed(), getAxes(), getVolume(), read(), setAxes(), setBoundingRadius(), setInertia(), SuperQuadricParticle(), and write().
|
private |
Blockiness parameters.
Blockiness parameters should be in the range (0,1], where a sphere or ellipsoid is represented by eps1_ = eps2_ = 1.
Referenced by computeHessianLabFixed(), computeMass(), computeShape(), computeShapeGradientLabFixed(), getExponentEps1(), getVolume(), read(), setAxesAndExponents(), setBoundingRadius(), setExponents(), setInertia(), SuperQuadricParticle(), and write().
|
private |