indigoX
|
#include <indigox/classes/forcefield.hpp>
Public Types | |
enum | Family |
Enum for the different families of forcefields. More... | |
Public Member Functions | |
Forcefield ()=default | |
Forcefield (const Forcefield &)=default | |
Forcefield (Forcefield &&)=default | |
Forcefield (Family family, std::string name) | |
Normal constructor. More... | |
~ Forcefield ()=default | |
FFAngle | GetAngleType (AngleType type, int32_t id) const |
Get the type of angle with the given id. More... | |
FFAngle | GetAngleType (int32_t id) const |
Get the first angle type with the given id. More... | |
FFAtom | GetAtomType (std::string name) const |
Get the AtomType with the given name. More... | |
FFAtom | GetAtomType (int32_t id) const |
Get the AtomType with the given id. More... | |
FFBond | GetBondType (BondType type, int32_t id) const |
Get the type of bond with the given id. More... | |
FFBond | GetBondType (int32_t id) const |
Get the first bond type with the given id. More... | |
FFDihedral | GetDihedralType (DihedralType type, int32_t id) const |
Get the type of dihedral with the given id. More... | |
FFDihedral | GetDihedralType (int32_t id) const |
Get the first dihedral type with the given id. More... | |
Family | GetFamily () const |
Get the family of the forcefield. More... | |
std::string | GetName () const |
Get the name of the forcefield. More... | |
void | LinkAngleTypes (const FFAngle &a, const FFAngle &b) |
Link together two equivalent angle types. More... | |
void | LinkBondTypes (const FFBond &a, const FFBond &b) |
Link together two equivalent bond types. More... | |
FFAngle | NewAngleType (AngleType type, int32_t id, double a, double b) |
Adds a new angle type to the forcefield with two parameters. More... | |
FFAtom | NewAtomType (int32_t id, std::string name, const Element &element) |
Add a new atom type to the forcefield. More... | |
FFBond | NewBondType (BondType type, int32_t id, double a, double b) |
Adds a new bond type to the forcefield with two parameters. More... | |
FFDihedral | NewDihedralType (DihedralType type, int32_t id, double a, double b, double c) |
Adds a new dihedral type to the forcefield with three parameters. More... | |
FFDihedral | NewDihedralType (DihedralType type, int32_t id, double a, double b) |
Adds a new dihedral type to the forcefield with two parameters. More... | |
size_t | NumAngleTypes () const |
Get the number of angle types in the forcefield. More... | |
size_t | NumAngleTypes (AngleType type) const |
Get the number of angle types of the given functional form. More... | |
size_t | NumAtomTypes () const |
Get the number of atom types in the forcefield. More... | |
size_t | NumBondTypes () const |
Get the total number of bond types in the forcefield. More... | |
size_t | NumBondTypes (BondType type) const |
Get the number of bond types of the given functional form. More... | |
size_t | NumDihedralTypes () const |
Get the number of dihedral types in the forcefield. More... | |
size_t | NumDihedralTypes (DihedralType type) const |
Get the number of dihedral types of the given functional form. More... | |
operator bool () const | |
bool | operator!= (const Forcefield &ff) const |
bool | operator< (const Forcefield &ff) const |
bool | operator<= (const Forcefield &ff) const |
Forcefield & | operator= (const Forcefield &)=default |
Forcefield & | operator= (Forcefield &&)=default |
bool | operator== (const Forcefield &ff) const |
bool | operator> (const Forcefield &ff) const |
bool | operator>= (const Forcefield &ff) const |
void | ReserveAngleTypes (AngleType type, size_t size) |
Reserve space for angle types. More... | |
void | ReserveAtomTypes (size_t size) |
Reserve space for atom types. More... | |
void | ReserveBondTypes (BondType type, size_t size) |
Reserve space for bond types. More... | |
void | ReserveDihedralTypes (DihedralType type, size_t size) |
Reserve space for dihedral types. More... | |
Friends | |
class | cereal::access |
Friendship allows serialisation. More... | |
std::ostream & | operator<< (std::ostream &os, const Forcefield &ff) |
|
strong |
|
default |
|
default |
|
default |
|
default |
Forcefield | ( | Family | family, |
std::string | name | ||
) |
Normal constructor.
Create a new forcefield from the given family. The family dictates which types of functional forms are allowed. Currently implemented is the GROMOS family of forcefields, which allows harmonic and quartic bond types, harmonic and caosine-harmonic angle types, and proper and improper dihedral types.
family | the family of forcefields to use. |
name | the name of the forcefield. |
Get the type of angle with the given id.
type | the type of angle to get. |
the | id of the angle type. |
FFAngle GetAngleType | ( | int32_t | id | ) | const |
Get the first angle type with the given id.
Searches through all allowed angle types in order and returns the first type with the given id.
id | the id of the angle type. |
FFAtom GetAtomType | ( | std::string | name | ) | const |
Get the AtomType with the given name.
name | the name of the atom type. |
FFAtom GetAtomType | ( | int32_t | id | ) | const |
Get the AtomType with the given id.
id | the id of the atom type. |
Get the type of bond with the given id.
type | the type of bond to get. |
the | id of the bond type. |
FFBond GetBondType | ( | int32_t | id | ) | const |
Get the first bond type with the given id.
Searches through all allowed bond types in order and returns the first type with the id.
id | the id of the bond type. |
FFDihedral GetDihedralType | ( | DihedralType | type, |
int32_t | id | ||
) | const |
Get the type of dihedral with the given id.
type | the type of dihedral to get. |
the | id of the dihedral type. |
FFDihedral GetDihedralType | ( | int32_t | id | ) | const |
Get the first dihedral type with the given id.
Searches through all allowed dihedral types in order and returns the first type with the given id.
id | the id of the dihedral type. |
Family GetFamily | ( | ) | const |
Get the family of the forcefield.
std::string GetName | ( | ) | const |
Get the name of the forcefield.
Link together two equivalent angle types.
Two angle types can be linked together when they are regarded as the same type with different functional forms. For example, the GROMOS forcefield provides both harmonic and cosine-harmonic force constants for all angle types. This method will remove any existing links.
a,b | the two types to link. |
Link together two equivalent bond types.
Two bond types can be linked together when they are regarded as the same type with different functional forms. For example, the GROMOS forcefield provides both harmonic and quartic force constants for all bond types. This method will remove any existing links.
a,b | the two types to link. |
Adds a new angle type to the forcefield with two parameters.
This constructor should be used for AngleType::Harmonic and AngleType::CosineHarmonic bond types. In both cases, a
is the force constant and b
is the ideal angle.
type | the type of the angle. |
id | the id of the angle. |
a,b | the two parameter values. |
Add a new atom type to the forcefield.
id | the id of the atom type. |
name | the name of the atom type. |
std::runtime_error | if an atomtype with the given name or id already exists within the forcefield. |
Adds a new bond type to the forcefield with two parameters.
This constructor should be used for BondType::Harmonic and BondType::Quartic bond types. In both cases, a
is the force constant and b
is the ideal length.
type | the type of the bond. |
id | the id of the bond. |
a,b | the two parameter values. |
FFDihedral NewDihedralType | ( | DihedralType | type, |
int32_t | id, | ||
double | a, | ||
double | b, | ||
double | c | ||
) |
Adds a new dihedral type to the forcefield with three parameters.
This constructor should be used for DihedralType::Proper dihedral types. In that case, a is the force constant, b is the phase and c is the multiplicity.
type | the type of dihedral. |
id | the id of the dihedral. |
a,b,c | the three parameter values. |
FFDihedral NewDihedralType | ( | DihedralType | type, |
int32_t | id, | ||
double | a, | ||
double | b | ||
) |
Adds a new dihedral type to the forcefield with two parameters.
This constructor should be used for DihedralType::Improper dihedral types. In that case, a is the force constant and b is the ideal dihedral angle
type | the type of dihedral. |
id | the id of the dihedral. |
a,b | the three parameter values. |
size_t NumAngleTypes | ( | ) | const |
Get the number of angle types in the forcefield.
For forcefields with multiple allowed types, the count of each type are summed.
size_t NumAngleTypes | ( | AngleType | type | ) | const |
Get the number of angle types of the given functional form.
Determines how may of the given angle types are present in the forcefield. In the case that the provided type is not supposrted by the forcefield, 0 is returned.
type | the type of angle to count. |
size_t NumAtomTypes | ( | ) | const |
Get the number of atom types in the forcefield.
size_t NumBondTypes | ( | ) | const |
Get the total number of bond types in the forcefield.
For forcefields with multiple allowed types, the count of each type are summed.
size_t NumBondTypes | ( | BondType | type | ) | const |
Get the number of bond types of the given functional form.
Determines how many of the given bond type funcitonal form are present in the forcefield. In the case that the provided type is not supported by the forcefield, 0 is returned.
type | the type of bond to count. |
size_t NumDihedralTypes | ( | ) | const |
Get the number of dihedral types in the forcefield.
For forcefields with multiple allowed types, the count of each type are summed.
size_t NumDihedralTypes | ( | DihedralType | type | ) | const |
Get the number of dihedral types of the given functional form.
Determines how many of the given dihedral types are present in the forcefield. In the case that the provided type is not supported by the forcefield, 0 is returned.
type | the type of dihedral to count. |
|
inline |
|
inline |
bool operator< | ( | const Forcefield & | ff | ) | const |
|
inline |
|
default |
|
default |
bool operator== | ( | const Forcefield & | ff | ) | const |
bool operator> | ( | const Forcefield & | ff | ) | const |
|
inline |
void ReserveAngleTypes | ( | AngleType | type, |
size_t | size | ||
) |
Reserve space for angle types.
type | the type of angle to reserve space for. |
size | the amount of space to reserve. |
void ReserveAtomTypes | ( | size_t | size | ) |
Reserve space for atom types.
size | the amount of space to reserve. |
void ReserveBondTypes | ( | BondType | type, |
size_t | size | ||
) |
Reserve space for bond types.
type | the type of bond to reserve space for. |
size | the amount of space to reserve. |
void ReserveDihedralTypes | ( | DihedralType | type, |
size_t | size | ||
) |
Reserve space for dihedral types.
type | the type of dihedral to reserve space for. |
size | the amount of space to reserve. |
|
friend |
Friendship allows serialisation.
|
friend |