AutoPas  3.0.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
mdLib::MultisiteMoleculeLJ Class Reference

Standard multi-site LJ molecules. More...

#include <MultisiteMoleculeLJ.h>

Inheritance diagram for mdLib::MultisiteMoleculeLJ:
Inheritance graph
[legend]
Collaboration diagram for mdLib::MultisiteMoleculeLJ:
Collaboration graph
[legend]

Public Types

enum  AttributeNames : int {
  ptr , id , posX , posY ,
  posZ , velocityX , velocityY , velocityZ ,
  forceX , forceY , forceZ , oldForceX ,
  oldForceY , oldForceZ , quaternion0 , quaternion1 ,
  quaternion2 , quaternion3 , angularVelX , angularVelY ,
  angularVelZ , torqueX , torqueY , torqueZ ,
  typeId , ownershipState
}
 Enums used as ids for accessing and creating a dynamically sized SoA.
 
using SoAArraysType = typename autopas::utils::SoAType< MultisiteMoleculeLJ *, size_t, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, size_t, autopas::OwnershipState >::Type
 The type for the SoA storage.
 
- Public Types inherited from mdLib::MoleculeLJ
enum  AttributeNames : int {
  ptr , id , posX , posY ,
  posZ , velocityX , velocityY , velocityZ ,
  forceX , forceY , forceZ , oldForceX ,
  oldForceY , oldForceZ , typeId , ownershipState
}
 Enums used as ids for accessing and creating a dynamically sized SoA.
 
using SoAArraysType = typename autopas::utils::SoAType< MoleculeLJ *, size_t, double, double, double, double, double, double, double, double, double, double, double, double, size_t, autopas::OwnershipState >::Type
 The type for the SoA storage.
 
- Public Types inherited from autopas::ParticleBase< floatType, idType >
enum  AttributeNames : int {
  ptr , id , posX , posY ,
  posZ , forceX , forceY , forceZ ,
  ownershipState
}
 Enums used as ids for accessing and creating a dynamically sized SoA.
 
using ParticleSoAFloatPrecision = floatType
 Floating Point Type used for this particle.
 
using ParticleIdType = idType
 Id Type used for this particle.
 
using SoAArraysType = typename autopas::utils::SoAType< ParticleBase< floatType, idType > *, idType, floatType, floatType, floatType, floatType, floatType, floatType, OwnershipState >::Type
 The type for the soa storage.
 

Public Member Functions

 MultisiteMoleculeLJ (std::array< double, 3 > r, std::array< double, 3 > v, std::array< double, 4 > q, std::array< double, 3 > angularVel, unsigned long moleculeId, unsigned long typeId=0)
 Constructor of the MultisiteMoleculeLJ Class.
 
 ~MultisiteMoleculeLJ () override=default
 Destructor of the MultisiteMoleculeLJ class.
 
template<AttributeNames attribute, std::enable_if_t< attribute==AttributeNames::ptr, bool > = true>
constexpr std::tuple_element< attribute, SoAArraysType >::type::value_type get ()
 Non-const getter for the pointer of this object.
 
template<AttributeNames attribute, std::enable_if_t< attribute !=AttributeNames::ptr, bool > = true>
constexpr std::tuple_element< attribute, SoAArraysType >::type::value_type get () const
 Getter, which allows access to an attribute using the corresponding attribute name (defined in AttributeNames).
 
template<AttributeNames attribute>
constexpr void set (typename std::tuple_element< attribute, SoAArraysType >::type::value_type value)
 Setter, which allows set an attribute using the corresponding attribute name (defined in AttributeNames).
 
const std::array< double, 4 > & getQuaternion () const
 Get the quaternion defining rotation.
 
void setQuaternion (const std::array< double, 4 > &q)
 Set the quaternion defining rotation.
 
const std::array< double, 3 > & getAngularVel () const
 Get the angular velocity.
 
void setAngularVel (const std::array< double, 3 > &angularVel)
 Set the angular velocity.
 
void addAngularVel (const std::array< double, 3 > &angularVel)
 Adds given angular velocity to the particle's angular velocity.
 
const std::array< double, 3 > & getTorque () const
 Get the torque.
 
void setTorque (const std::array< double, 3 > &torque)
 Set the torque.
 
void addTorque (const std::array< double, 3 > &torque)
 Adds given torque to the particle's torque.
 
void subTorque (const std::array< double, 3 > &torque)
 Subracts given torque to the particle's torque.
 
std::string toString () const override
 Creates a string containing all data of the particle.
 
- Public Member Functions inherited from mdLib::MoleculeLJ
 MoleculeLJ (const std::array< double, 3 > &pos, const std::array< double, 3 > &v, unsigned long moleculeId, unsigned long typeId=0)
 Constructor of lennard jones molecule with initialization of typeID.
 
template<AttributeNames attribute, std::enable_if_t< attribute==AttributeNames::ptr, bool > = true>
constexpr std::tuple_element< attribute, SoAArraysType >::type::value_type get ()
 Non-const getter for the pointer of this object.
 
template<AttributeNames attribute, std::enable_if_t< attribute !=AttributeNames::ptr, bool > = true>
constexpr std::tuple_element< attribute, SoAArraysType >::type::value_type get () const
 Getter, which allows access to an attribute using the corresponding attribute name (defined in AttributeNames).
 
template<AttributeNames attribute>
constexpr void set (typename std::tuple_element< attribute, SoAArraysType >::type::value_type value)
 Setter, which allows set an attribute using the corresponding attribute name (defined in AttributeNames).
 
const std::array< double, 3 > & getOldF () const
 Get the old force.
 
void setOldF (const std::array< double, 3 > &oldForce)
 Set old force.
 
size_t getTypeId () const
 Get TypeId.
 
void setTypeId (size_t typeId)
 Set the type id of the Molecule.
 
std::string toString () const override
 Creates a string containing all data of the particle.
 
- Public Member Functions inherited from autopas::ParticleBase< floatType, idType >
 ParticleBase (const std::array< double, 3 > &r, const std::array< double, 3 > &v, idType id, OwnershipState ownershipState=OwnershipState::owned)
 Constructor of the Particle class.
 
virtual ~ParticleBase ()=default
 Destructor of ParticleBase class.
 
bool operator== (const ParticleBase &rhs) const
 Equality operator for ParticleBase class.
 
bool operator!= (const ParticleBase &rhs) const
 Not-Equals operator for ParticleBase class.
 
const std::array< double, 3 > & getF () const
 get the force acting on the particle
 
void setF (const std::array< double, 3 > &f)
 Set the force acting on the particle.
 
void addF (const std::array< double, 3 > &f)
 Add a partial force to the force acting on the particle.
 
void subF (const std::array< double, 3 > &f)
 Substract a partial force from the force acting on the particle.
 
idType getID () const
 Get the id of the particle.
 
void setID (idType id)
 Set the id of the particle.
 
const std::array< double, 3 > & getR () const
 Get the position of the particle.
 
void setR (const std::array< double, 3 > &r)
 Set the position of the particle.
 
bool setRDistanceCheck (const std::array< double, 3 > &r, double maxDistSquared)
 Add a distance vector to the position of the particle and check if the distance between the old and new position is less than a given max distance.
 
void addR (const std::array< double, 3 > &r)
 Add a distance vector to the position of the particle.
 
bool addRDistanceCheck (const std::array< double, 3 > &r, double maxDistSquared)
 Add a distance vector to the position of the particle and check if the distance between the old and new position is less than a given max distance.
 
const std::array< double, 3 > & getV () const
 Get the velocity of the particle.
 
void setV (const std::array< double, 3 > &v)
 Set the velocity of the particle.
 
void addV (const std::array< double, 3 > &v)
 Add a vector to the current velocity of the particle.
 
virtual std::string toString () const
 Creates a string containing all data of the particle.
 
bool isOwned () const
 Defines whether the particle is owned by the current AutoPas object (aka (MPI-)process)
 
bool isHalo () const
 Defines whether the particle is a halo particle, i.e., not owned by the current AutoPas object (aka (MPI-)process)
 
bool isDummy () const
 Returns whether the particle is a dummy particle.
 
OwnershipState getOwnershipState () const
 Returns the particle's ownership state.
 
void setOwnershipState (OwnershipState ownershipState)
 Set the OwnershipState to the given value.
 
template<AttributeNames attribute, std::enable_if_t< attribute==AttributeNames::ptr, bool > = true>
constexpr std::tuple_element< attribute, SoAArraysType >::type::value_type get ()
 Non-const getter for the pointer of this object.
 
template<AttributeNames attribute, std::enable_if_t< attribute !=AttributeNames::ptr, bool > = true>
constexpr std::tuple_element< attribute, SoAArraysType >::type::value_type get () const
 Getter, which allows access to an attribute using the corresponding attribute name (defined in AttributeNames).
 
template<AttributeNames attribute>
constexpr void set (typename std::tuple_element< attribute, SoAArraysType >::type::value_type value)
 Setter, which allows set an attribute using the corresponding attribute name (defined in AttributeNames).
 

Protected Attributes

std::array< double, 4 > _q {}
 Rotational direction of particle as quaternion.
 
std::array< double, 3 > _angularVel {}
 Angular velocity of the particle.
 
std::array< double, 3 > _torque {}
 Torque applied to particle.
 
- Protected Attributes inherited from mdLib::MoleculeLJ
size_t _typeId = 0
 Molecule type id.
 
std::array< double, 3 > _oldF = {0., 0., 0.}
 Old Force of the particle experiences as 3D vector.
 
- Protected Attributes inherited from autopas::ParticleBase< floatType, idType >
std::array< floatType, 3 > _r
 Particle position as 3D coordinates.
 
std::array< floatType, 3 > _v
 Particle velocity as 3D vector.
 
std::array< floatType, 3 > _f
 Force the particle experiences as 3D vector.
 
idType _id
 Particle id.
 
OwnershipState _ownershipState
 Defines the state of the ownership of the particle.
 

Detailed Description

Standard multi-site LJ molecules.

The molecule is treated as a single particle for the purposes of cutoffs and containers, with a quaternion for angular direction, a 3D vector-array for angular velocity, and a vectors of site positions relative to the center of mass and angular direction.

Member Typedef Documentation

◆ SoAArraysType

using mdLib::MultisiteMoleculeLJ::SoAArraysType = typename autopas::utils::SoAType< MultisiteMoleculeLJ *, size_t, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, size_t, autopas::OwnershipState >::Type

The type for the SoA storage.

Note
The attribute owned is of type float but treated as a bool. This means it shall always only take values 0.0 (=false) or 1.0 (=true). The reason for this is the easier use of the value in calculations (See LJFunctor "energyFactor")

Constructor & Destructor Documentation

◆ MultisiteMoleculeLJ()

mdLib::MultisiteMoleculeLJ::MultisiteMoleculeLJ ( std::array< double, 3 >  r,
std::array< double, 3 >  v,
std::array< double, 4 >  q,
std::array< double, 3 >  angularVel,
unsigned long  moleculeId,
unsigned long  typeId = 0 
)

Constructor of the MultisiteMoleculeLJ Class.

Parameters
rPosition of the particle.
vVelocity of the particle.
qQuaternion defining rotation of particle.
angularVelRotational velocity of the particle.
moleculeIdId of the particle.
typeIdId of the type of the particle. Used in conjunction with ParticlePropertiesLibrary to access molecular information such as site types and relative site positions.

Member Function Documentation

◆ addAngularVel()

void mdLib::MultisiteMoleculeLJ::addAngularVel ( const std::array< double, 3 > &  angularVel)

Adds given angular velocity to the particle's angular velocity.

Parameters
angularVelangular velocity to be added

◆ addTorque()

void mdLib::MultisiteMoleculeLJ::addTorque ( const std::array< double, 3 > &  torque)

Adds given torque to the particle's torque.

Parameters
torquetorque to be added

◆ get() [1/2]

template<AttributeNames attribute, std::enable_if_t< attribute==AttributeNames::ptr, bool > = true>
constexpr std::tuple_element< attribute, SoAArraysType >::type::value_type mdLib::MultisiteMoleculeLJ::get ( )
inlineconstexpr

Non-const getter for the pointer of this object.

Template Parameters
attributeAttribute name.
Returns
this.

◆ get() [2/2]

template<AttributeNames attribute, std::enable_if_t< attribute !=AttributeNames::ptr, bool > = true>
constexpr std::tuple_element< attribute, SoAArraysType >::type::value_type mdLib::MultisiteMoleculeLJ::get ( ) const
inlineconstexpr

Getter, which allows access to an attribute using the corresponding attribute name (defined in AttributeNames).

Template Parameters
attributeAttribute name.
Returns
Value of the requested attribute.
Note
The value of owned is return as floating point number (true = 1.0, false = 0.0).
Moving this function to the .cpp leads to undefined references

◆ getAngularVel()

const std::array< double, 3 > & mdLib::MultisiteMoleculeLJ::getAngularVel ( ) const

Get the angular velocity.

Returns
angular velocity

◆ getQuaternion()

const std::array< double, 4 > & mdLib::MultisiteMoleculeLJ::getQuaternion ( ) const

Get the quaternion defining rotation.

Returns
quaternion defining rotation

◆ getTorque()

const std::array< double, 3 > & mdLib::MultisiteMoleculeLJ::getTorque ( ) const

Get the torque.

Returns
torque

◆ set()

template<AttributeNames attribute>
constexpr void mdLib::MultisiteMoleculeLJ::set ( typename std::tuple_element< attribute, SoAArraysType >::type::value_type  value)
inlineconstexpr

Setter, which allows set an attribute using the corresponding attribute name (defined in AttributeNames).

Template Parameters
attributeAttribute name.
Parameters
valueNew value of the requested attribute.
Note
The value of owned is extracted from a floating point number (true = 1.0, false = 0.0).
Moving this function to the .cpp leads to undefined references

◆ setAngularVel()

void mdLib::MultisiteMoleculeLJ::setAngularVel ( const std::array< double, 3 > &  angularVel)

Set the angular velocity.

Parameters
angularVel

◆ setQuaternion()

void mdLib::MultisiteMoleculeLJ::setQuaternion ( const std::array< double, 4 > &  q)

Set the quaternion defining rotation.

Parameters
qquaternion defining rotation

◆ setTorque()

void mdLib::MultisiteMoleculeLJ::setTorque ( const std::array< double, 3 > &  torque)

Set the torque.

Parameters
torque

◆ subTorque()

void mdLib::MultisiteMoleculeLJ::subTorque ( const std::array< double, 3 > &  torque)

Subracts given torque to the particle's torque.

Parameters
torquetorque to be subtracted

◆ toString()

std::string mdLib::MultisiteMoleculeLJ::toString ( ) const
overridevirtual

Creates a string containing all data of the particle.

Returns
String representation.

Reimplemented from mdLib::MoleculeLJ.


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