RASPA3 3.0.12
A molecular simulation code for computing adsorption and diffusion in nanoporous materials
Loading...
Searching...
No Matches
BondPotential Struct Referenceexport

Represents a bond potential between two particles. More...

Collaboration diagram for BondPotential:

Public Member Functions

 BondPotential ()
 Default constructor for BondPotential.
 
 BondPotential (std::array< std::size_t, 2 > identifiers, BondType type, std::vector< double > vector_parameters)
 
 BondPotential (std::array< std::size_t, 2 > identifiers, const BondType type)
 Constructs a BondPotential with specified type and bond IDs.
 
bool operator== (BondPotential const &) const =default
 
std::string print () const
 Generates a string representation of the bond potential.
 
double generateBondLength (RandomNumber &random, double beta) const
 
double calculateEnergy (const double3 &posA, const double3 &posB) const
 
std::tuple< double, std::array< double3, 2 >, double3x3 > potentialEnergyGradientStrain (const double3 &posA, const double3 &posB) const
 

Public Attributes

std::uint64_t versionNumber {1}
 Version number for serialization.
 
std::array< std::size_t, 2 > identifiers
 Identifiers of the two particles forming the bond.
 
BondType type { BondType::None }
 The type of bond potential.
 
std::array< double, maximumNumberOfBondParameters > parameters
 Parameters associated with the bond potential.
 

Static Public Attributes

static std::array< std::size_t, 12 > numberOfBondParameters {0, 1, 2, 1, 3, 2, 2, 3, 3, 4, 4, 2}
 Number of parameters required for each bond type.
 
static std::map< std::string, BondType > definitionForString
 Mapping of bond type strings to BondType enums.
 

Friends

Archive< std::ofstream > & operator<< (Archive< std::ofstream > &archive, const BondPotential &b)
 
Archive< std::ifstream > & operator>> (Archive< std::ifstream > &archive, BondPotential &b)
 

Detailed Description

Represents a bond potential between two particles.

The BondPotential struct encapsulates the type of bond and associated parameters between two particles. It includes versioning for serialization, bond type, identifiers of bonded particles, and bond parameters.

Constructor & Destructor Documentation

◆ BondPotential() [1/2]

BondPotential::BondPotential ( )
inline

Default constructor for BondPotential.

Initializes a BondPotential object with Undefined bond type and zeroed bond IDs.

◆ BondPotential() [2/2]

BondPotential::BondPotential ( std::array< std::size_t, 2 >  identifiers,
const BondType  type 
)
inline

Constructs a BondPotential with specified type and bond IDs.

Parameters
typeThe type of bond potential.
identifiersA pair of particle identifiers forming the bond.

Member Function Documentation

◆ print()

std::string BondPotential::print ( ) const

Generates a string representation of the bond potential.

Provides a formatted string containing bond type, particle IDs, and parameters.

Returns
A string describing the bond potential.

Member Data Documentation

◆ definitionForString

std::map<std::string, BondType> BondPotential::definitionForString
inlinestatic
Initial value:
{
{"NONE", BondType::None},
{"FIXED", BondType::Fixed},
{"HARMONIC", BondType::Harmonic},
{"CORE_SHELL_SPRING", BondType::CoreShellSpring},
{"MORSE", BondType::Morse},
{"LJ_12_6", BondType::LJ_12_6},
{"LENNARD_JONES", BondType::LennardJones},
{"BUCKINGHAM", BondType::Buckingham},
{"RESTRAINED_HARMONIC", BondType::RestrainedHarmonic},
{"QUARTIC", BondType::Quartic},
{"CFF_QUARTIC", BondType::CFF_Quartic},
{"MM3", BondType::MM3}}

Mapping of bond type strings to BondType enums.

A static map that associates bond type names with their corresponding BondType enumeration values.

◆ numberOfBondParameters

std::array<std::size_t, 12> BondPotential::numberOfBondParameters {0, 1, 2, 1, 3, 2, 2, 3, 3, 4, 4, 2}
inlinestatic

Number of parameters required for each bond type.

A static vector indicating the number of parameters needed for each bond type.


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