AutoPas  3.0.0
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | List of all members
ParticlePropertiesLibrary< floatType, intType > Class Template Reference

This class stores the (physical) properties of molecule types, and, in the case of multi-site molecules, the location of the sites relative to the the center-of-mass. More...

#include <ParticlePropertiesLibrary.h>

Inheritance diagram for ParticlePropertiesLibrary< floatType, intType >:
Inheritance graph
[legend]

Public Member Functions

 ParticlePropertiesLibrary (const double cutoff)
 Constructor.
 
 ParticlePropertiesLibrary (const ParticlePropertiesLibrary &particlePropertiesLibrary)=default
 Copy Constructor.
 
ParticlePropertiesLibraryoperator= (const ParticlePropertiesLibrary &particlePropertiesLibrary)=default
 Copy assignment operator.
 
void addSiteType (const intType siteId, const floatType mass)
 Registers a new single site type to the library with a given mass.
 
void addLJParametersToSite (const intType siteId, const floatType epsilon, const floatType sigma)
 Adds the LJ properties of a single site type to the library.
 
void addATParametersToSite (const intType siteId, const floatType nu)
 Adds the AT properties of a single site type to the library.
 
void addMolType (const intType molId, const std::vector< intType > siteIds, const std::vector< std::array< floatType, 3 > > relPos, const std::array< floatType, 3 > momentOfInertia)
 Adds the properties of a molecule type to the library including: position and type of all sites, as well as the diagonalized moment of inertia.
 
void calculateMixingCoefficients ()
 Calculates the actual mixing coefficients.
 
int getNumberRegisteredSiteTypes () const
 Returns the number of registered site / single-site molecule types.
 
int getNumberRegisteredMolTypes () const
 Returns the number of registered multi-site molecule types.
 
floatType getEpsilon (intType i) const
 Getter for the site's epsilon.
 
floatType getSigma (intType i) const
 Getter for the site's sigma.
 
floatType getNu (intType i) const
 Getter for the site's nu.
 
floatType getSiteMass (intType i) const
 Getter for the site's mass.
 
floatType getMolMass (intType i) const
 Getter for a molecules' mass.
 
std::array< floatType, 3 > getMomentOfInertia (intType i) const
 Getter for the multi-site molecule's diagonalized Moment of Inertia.
 
std::vector< std::array< floatType, 3 > > getSitePositions (intType i) const
 Get relative site positions to a multi-site molecule's center-of-mass.
 
std::vector< intType > getSiteTypes (intType i) const
 Get site types of a multi-site molecule.
 
intType getNumSites (intType i) const
 Get number of sites of a multi-site molecule.
 
floatType getMoleculesLargestSigma (intType i) const
 Get the largest sigma of any site of a multi-site molecule.
 
floatType getMixing24Epsilon (intType i, intType j) const
 Returns the precomputed mixed epsilon * 24.
 
auto getLJMixingData (intType i, intType j) const
 Get complete mixing data for one pair of LJ site types.
 
const double * getLJMixingDataPtr (intType i, intType j)
 Get a pointer to Mixing Data for one pair of LJ site types.
 
floatType getMixingSigmaSquared (intType i, intType j) const
 Returns precomputed mixed squared sigma for one pair of site types.
 
floatType getMixingShift6 (intType i, intType j) const
 Returns precomputed mixed shift * 6 for one pair of site types.
 
floatType getMixingNu (intType i, intType j, intType k) const
 Returns the precomputed mixed epsilon * 24.
 
auto getATMixingData (intType i, intType j, intType k) const
 Get complete mixing data for one triplet of AT site types.
 

Static Public Member Functions

static double calcShift6 (double epsilon24, double sigmaSquared, double cutoffSquared)
 Calculate the shift multiplied 6 of the lennard jones potential from given cutoff, epsilon, sigma.
 

Detailed Description

template<typename floatType = double, typename intType = unsigned long>
class ParticlePropertiesLibrary< floatType, intType >

This class stores the (physical) properties of molecule types, and, in the case of multi-site molecules, the location of the sites relative to the the center-of-mass.

It also provides mixed values for (force) calculations between known types.

ToDo: Add a function that computes the diagonalized Moment of Inertia and adjusts the rotation of the positions of the sites such that they correctly match the new axes.

Constructor & Destructor Documentation

◆ ParticlePropertiesLibrary() [1/2]

template<typename floatType = double, typename intType = unsigned long>
ParticlePropertiesLibrary< floatType, intType >::ParticlePropertiesLibrary ( const double  cutoff)
inlineexplicit

Constructor.

Parameters
cutoffCutoff for the Potential

◆ ParticlePropertiesLibrary() [2/2]

template<typename floatType = double, typename intType = unsigned long>
ParticlePropertiesLibrary< floatType, intType >::ParticlePropertiesLibrary ( const ParticlePropertiesLibrary< floatType, intType > &  particlePropertiesLibrary)
default

Copy Constructor.

Parameters
particlePropertiesLibrary

Member Function Documentation

◆ addATParametersToSite()

template<typename floatType , typename intType >
void ParticlePropertiesLibrary< floatType, intType >::addATParametersToSite ( const intType  siteId,
const floatType  nu 
)

Adds the AT properties of a single site type to the library.

Checks if a site with given siteId was already registered. Old values will be overwritten.

Parameters
siteId
nu

◆ addLJParametersToSite()

template<typename floatType , typename intType >
void ParticlePropertiesLibrary< floatType, intType >::addLJParametersToSite ( const intType  siteId,
const floatType  epsilon,
const floatType  sigma 
)

Adds the LJ properties of a single site type to the library.

Checks if a site with given siteId was already registered. Old values will be overwritten.

Parameters
siteId
epsilon
sigma

◆ addMolType()

template<typename floatType , typename intType >
void ParticlePropertiesLibrary< floatType, intType >::addMolType ( const intType  molId,
const std::vector< intType >  siteIds,
const std::vector< std::array< floatType, 3 > >  relPos,
const std::array< floatType, 3 >  momentOfInertia 
)

Adds the properties of a molecule type to the library including: position and type of all sites, as well as the diagonalized moment of inertia.

If md-flexible has been compiled for single-site molecules, calls to this function result in an error. If the type id already exists the values will be overwritten.

Parameters
molId
siteIdsvector of IDs of sites
relPosvector of relative positions
momentOfInertiadiagonalized moment of inertia as a array of 3 floats

◆ addSiteType()

template<typename floatType , typename intType >
void ParticlePropertiesLibrary< floatType, intType >::addSiteType ( const intType  siteId,
const floatType  mass 
)

Registers a new single site type to the library with a given mass.

Note
New sites must be registered with consecutive siteIds.
This only registers the site. Potential specific parameters must be added afterwards by calling e.g. addLJParametersToSite() for a Lennard-Jones Site.
Parameters
siteId
mass

◆ calcShift6()

template<typename floatType , typename intType >
double ParticlePropertiesLibrary< floatType, intType >::calcShift6 ( double  epsilon24,
double  sigmaSquared,
double  cutoffSquared 
)
static

Calculate the shift multiplied 6 of the lennard jones potential from given cutoff, epsilon, sigma.

The shift * 6 is then added to the total potential energy for every pairwise interaction within the cutoff.

Parameters
epsilon24epsilon * 24
sigmaSquaredsigma squared
cutoffSquaredsquared cutoff of the lennard-jones potential
Returns
shift multiplied by 6

◆ getATMixingData()

template<typename floatType = double, typename intType = unsigned long>
auto ParticlePropertiesLibrary< floatType, intType >::getATMixingData ( intType  i,
intType  j,
intType  k 
) const
inline

Get complete mixing data for one triplet of AT site types.

Parameters
iId of site one.
jId of site two.
kId of site three.
Returns

◆ getEpsilon()

template<typename floatType , typename intType >
floatType ParticlePropertiesLibrary< floatType, intType >::getEpsilon ( intType  i) const

Getter for the site's epsilon.

Parameters
iType Id of the site or single-site molecule.
Returns
epsilon_i

◆ getLJMixingData()

template<typename floatType = double, typename intType = unsigned long>
auto ParticlePropertiesLibrary< floatType, intType >::getLJMixingData ( intType  i,
intType  j 
) const
inline

Get complete mixing data for one pair of LJ site types.

Parameters
iId of site one.
jId of site two.
Returns

◆ getLJMixingDataPtr()

template<typename floatType = double, typename intType = unsigned long>
const double * ParticlePropertiesLibrary< floatType, intType >::getLJMixingDataPtr ( intType  i,
intType  j 
)
inline

Get a pointer to Mixing Data for one pair of LJ site types.

Parameters
iId of site one.
jId of site two.
Returns

◆ getMixing24Epsilon()

template<typename floatType = double, typename intType = unsigned long>
floatType ParticlePropertiesLibrary< floatType, intType >::getMixing24Epsilon ( intType  i,
intType  j 
) const
inline

Returns the precomputed mixed epsilon * 24.

Parameters
iId of site one.
jId of site two.
Returns
24*epsilon_ij

◆ getMixingNu()

template<typename floatType = double, typename intType = unsigned long>
floatType ParticlePropertiesLibrary< floatType, intType >::getMixingNu ( intType  i,
intType  j,
intType  k 
) const
inline

Returns the precomputed mixed epsilon * 24.

Parameters
iId of site one.
jId of site two.
kId of site three.
Returns
nu_ijk

◆ getMixingShift6()

template<typename floatType = double, typename intType = unsigned long>
floatType ParticlePropertiesLibrary< floatType, intType >::getMixingShift6 ( intType  i,
intType  j 
) const
inline

Returns precomputed mixed shift * 6 for one pair of site types.

Parameters
isiteId of site one.
jsiteId of site two.
Returns
shift * 6

◆ getMixingSigmaSquared()

template<typename floatType = double, typename intType = unsigned long>
floatType ParticlePropertiesLibrary< floatType, intType >::getMixingSigmaSquared ( intType  i,
intType  j 
) const
inline

Returns precomputed mixed squared sigma for one pair of site types.

Parameters
iId of site one.
jId of site two.
Returns
sigma_ij²

◆ getMoleculesLargestSigma()

template<typename floatType , typename intType >
floatType ParticlePropertiesLibrary< floatType, intType >::getMoleculesLargestSigma ( intType  i) const

Get the largest sigma of any site of a multi-site molecule.

Throws an error if support for multi-site molecules has not been compiled.

Parameters
iType Id of a multi-site molecule.
Returns
largest sigma of that molecule's sites

◆ getMolMass()

template<typename floatType , typename intType >
floatType ParticlePropertiesLibrary< floatType, intType >::getMolMass ( intType  i) const

Getter for a molecules' mass.

For single site molecules, this automatically gets the mass of the site with the given ID. For multi site molecules, this gets the total mass of the molecule.

Parameters
iType Id of a multi-site molecule.
Returns
mass_i

◆ getMomentOfInertia()

template<typename floatType , typename intType >
std::array< floatType, 3 > ParticlePropertiesLibrary< floatType, intType >::getMomentOfInertia ( intType  i) const

Getter for the multi-site molecule's diagonalized Moment of Inertia.

Throws an error if support for multi-site molecules has not been compiled.

Parameters
iType Id of a multi-site molecule.
Returns
diagonalized moment of inertia, with each element of the returned array corresponding to a diagonal element of the MoI matrix/tensor.

◆ getNu()

template<typename floatType , typename intType >
floatType ParticlePropertiesLibrary< floatType, intType >::getNu ( intType  i) const

Getter for the site's nu.

Parameters
iType Id of the site or single-site molecule.
Returns
nu_i

◆ getNumberRegisteredMolTypes()

template<typename floatType = double, typename intType = unsigned long>
int ParticlePropertiesLibrary< floatType, intType >::getNumberRegisteredMolTypes ( ) const
inline

Returns the number of registered multi-site molecule types.

Throws an error if support for multi-site molecules has not been compiled.

Returns
Number of registered multi-site molecule types.

◆ getNumberRegisteredSiteTypes()

template<typename floatType = double, typename intType = unsigned long>
int ParticlePropertiesLibrary< floatType, intType >::getNumberRegisteredSiteTypes ( ) const
inline

Returns the number of registered site / single-site molecule types.

Returns
Number of registered site types.

◆ getNumSites()

template<typename floatType , typename intType >
intType ParticlePropertiesLibrary< floatType, intType >::getNumSites ( intType  i) const

Get number of sites of a multi-site molecule.

Throws an error if support for multi-site molecules has not been compiled.

Parameters
iType Id of a multi-site molecule.
Returns
number of sites in molecule's of type Id

◆ getSigma()

template<typename floatType , typename intType >
floatType ParticlePropertiesLibrary< floatType, intType >::getSigma ( intType  i) const

Getter for the site's sigma.

Parameters
iType Id of the site or single-site molecule.
Returns
sigma_i

◆ getSiteMass()

template<typename floatType , typename intType >
floatType ParticlePropertiesLibrary< floatType, intType >::getSiteMass ( intType  i) const

Getter for the site's mass.

Parameters
iType Id of the site or single-site molecule.
Returns
mass_i

◆ getSitePositions()

template<typename floatType , typename intType >
std::vector< std::array< floatType, 3 > > ParticlePropertiesLibrary< floatType, intType >::getSitePositions ( intType  i) const

Get relative site positions to a multi-site molecule's center-of-mass.

These site positions must be appropriately translated and rotated to be used.

Throws an error if support for multi-site molecules has not been compiled.

Parameters
iType Id of a multi-site molecule.
Returns
untranslated, non-rotated site positions

◆ getSiteTypes()

template<typename floatType , typename intType >
std::vector< intType > ParticlePropertiesLibrary< floatType, intType >::getSiteTypes ( intType  i) const

Get site types of a multi-site molecule.

Throws an error if support for multi-site molecules has not been compiled.

Parameters
iType Id of a multi-site molecule.
Returns
site type Ids.

◆ operator=()

template<typename floatType = double, typename intType = unsigned long>
ParticlePropertiesLibrary & ParticlePropertiesLibrary< floatType, intType >::operator= ( const ParticlePropertiesLibrary< floatType, intType > &  particlePropertiesLibrary)
default

Copy assignment operator.

Parameters
particlePropertiesLibrary
Returns

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