Gromacs
2024.3
|
Classes | |
struct | t_eigvec |
Essential dynamics vector. TODO: split into working data and input data NOTE: called eigvec, because traditionally eigenvectors from PCA analysis were used as essential dynamics vectors, however, vectors used for ED need not have any special properties. More... | |
struct | t_edvecs |
Essential dynamics vectors per method implementation. More... | |
struct | t_edflood |
Essential dynamics flooding parameters and work data. TODO: split into working data and input parameters NOTE: The implementation here follows: O.E. Lange, L.V. Schafer, and H. Grubmuller, “Flooding in GROMACS: Accelerated barrier crossings in molecular dynamics,” J. Comp. Chem., 27 1693–1702 (2006) More... | |
Enumerations | |
enum | EssentialDynamicsType { EssentialDynamicsType::None, EssentialDynamicsType::EDSampling, EssentialDynamicsType::Flooding } |
Identifies the type of ED: none, normal ED, flooding. More... | |
enum | EssentialDynamicsStructure { EssentialDynamicsStructure::Reference, EssentialDynamicsStructure::Average, EssentialDynamicsStructure::Origin, EssentialDynamicsStructure::Target } |
Identify on which structure to operate. More... | |
Functions | |
std::vector< t_edpar > | read_edi_file (const char *fn, int nr_mdatoms) |
Read in the essential dynamics input file and return its contents. More... | |
bool | bNeedDoEdsam (const t_edpar &edi) |
Determines whether to perform essential dynamics constraints other than flooding. More... | |
real | projectx (const t_edpar &edi, rvec *xcoll, rvec *vec) |
The mass-weighted inner product of two coordinate vectors. Does not subtract average positions, projection on single eigenvector is returned used by: do_linfix, do_linacc, do_radfix, do_radacc, do_radcon Average position is subtracted in ed_apply_constraints prior to calling projectx. More... | |
void | rad_project (const t_edpar &edi, rvec *x, t_eigvec *vec) |
Project coordinates onto vector after substracting average position. projection is stored in vec->refproj which is used for radacc, radfix, radcon and center of flooding potential. Average positions are first substracted from x, then added back again. More... | |
void | project_to_eigvectors (rvec *x, t_eigvec *vec, const t_edpar &edi) |
Projects coordinates onto eigenvectors and stores result in vec->xproj. Mass-weighting is applied. Subtracts average positions prior to projection and add them afterwards to retain the unchanged vector. More... | |
real | calc_radius (const t_eigvec &vec) |
Evaluates the distance from reference to current eigenvector projection. More... | |
void | write_edo_flood (const t_edpar &edi, FILE *fp, real rmsd) |
Output flooding simulation settings and results to file. More... | |
void | flood_blowup (const t_edpar &edi, rvec *forces_cart) |
Raise forces from subspace into cartesian space. This function lifts the forces from the subspace to the cartesian space all the values not contained in the subspace are assumed to be zero and then a coordinate transformation from eigenvector to cartesian vectors is performed The nonexistent values don't have to be set to zero explicitly, they would occur as zero valued summands, hence we just stop to compute this part of the sum. For every atom we add all the contributions to this atom from all the different eigenvectors. NOTE: one could add directly to the forcefield forces, would mean we wouldn't have to clear the field forces_cart prior the computation, but we compute the forces separately to have them accessible for diagnostics. More... | |
void | scan_edvec (FILE *in, int numAtoms, rvec ***vec, int nEig) |
Read eigenvector coordinates for multiple eigenvectors from a file. More... | |
void | read_edvec (FILE *in, int nrAtoms, t_eigvec *tvec) |
Read an essential dynamics eigenvector and corresponding step size. More... | |
bool | readEdVecWithReferenceProjection (FILE *in, int nrAtoms, t_eigvec *tvec, real **initialReferenceProjection, real **referenceProjectionSlope) |
Read an essential dynamics eigenvector and initial reference projections and slopes if available. More... | |
void | setup_edvec (t_eigvec *tvec) |
Allocate working memory for the eigenvectors. More... | |
void | setup_edi (t_edpar *edi) |
Set up essential dynamics work parameters. More... | |
bool | ediFileHasConstForceFlooding (int magicNumber) |
Check if edi file version supports CONST_FORCE_FLOODING. More... | |
bool | ediFileHasValidDataSet (FILE *in, int *magicNumber) |
Reports reading success of the essential dynamics input file magic number. More... | |
void | exitWhenMagicNumberIsInvalid (int magicNumber, const char *fn) |
Trigger fatal error if magic number is unsupported. More... | |
t_edpar | read_edi (FILE *in, int nr_mdatoms, bool hasConstForceFlooding, const char *fn) |
reads an essential dynamics input file into a essential dynamics data structure. More... | |
void | do_linfix (rvec *xcoll, const t_edpar &edi, int64_t step) |
Apply fixed linear constraints to essential dynamics variable. More... | |
void | do_linacc (rvec *xcoll, t_edpar *edi) |
Apply acceptance linear constraints to essential dynamics variable. More... | |
void | write_edo (const t_edpar &edi, FILE *fp, real rmsd) |
Write out the projections onto the eigenvectors. The order of output corresponds to ed_output_legend(). More... | |
Variables | |
constexpr int | c_oldestUnsupportedMagicNumber = 666 |
Oldest (lowest) magic number indicating unsupported essential dynamics input. | |
constexpr int | c_oldestSupportedMagicNumber = 669 |
Oldest (lowest) magic number indicating supported essential dynamics input. | |
constexpr int | c_latestSupportedMagicNumber = 670 |
Latest (highest) magic number indicating supported essential dynamics input. | |
|
strong |
|
strong |
bool anonymous_namespace{edsam.cpp}::bNeedDoEdsam | ( | const t_edpar & | edi | ) |
Determines whether to perform essential dynamics constraints other than flooding.
[in] | edi | the essential dynamics parameters |
real anonymous_namespace{edsam.cpp}::calc_radius | ( | const t_eigvec & | vec | ) |
Evaluates the distance from reference to current eigenvector projection.
[in] | vec | eigenvector |
void anonymous_namespace{edsam.cpp}::do_linacc | ( | rvec * | xcoll, |
t_edpar * | edi | ||
) |
Apply acceptance linear constraints to essential dynamics variable.
[in,out] | xcoll | The collected coordinates. |
[in] | edi | the essential dynamics parameters |
void anonymous_namespace{edsam.cpp}::do_linfix | ( | rvec * | xcoll, |
const t_edpar & | edi, | ||
int64_t | step | ||
) |
Apply fixed linear constraints to essential dynamics variable.
[in,out] | xcoll | The collected coordinates. |
[in] | edi | the essential dynamics parameters |
[in] | step | the current simulation step |
bool anonymous_namespace{edsam.cpp}::ediFileHasConstForceFlooding | ( | int | magicNumber | ) |
Check if edi file version supports CONST_FORCE_FLOODING.
[in] | magicNumber | indicates the essential dynamics input file version |
bool anonymous_namespace{edsam.cpp}::ediFileHasValidDataSet | ( | FILE * | in, |
int * | magicNumber | ||
) |
Reports reading success of the essential dynamics input file magic number.
[in] | in | pointer to input file |
[out] | magicNumber | determines the edi file version |
void anonymous_namespace{edsam.cpp}::exitWhenMagicNumberIsInvalid | ( | int | magicNumber, |
const char * | fn | ||
) |
Trigger fatal error if magic number is unsupported.
[in] | magicNumber | A magic number read from the edi file |
[in] | fn | name of input file for error reporting |
void anonymous_namespace{edsam.cpp}::flood_blowup | ( | const t_edpar & | edi, |
rvec * | forces_cart | ||
) |
Raise forces from subspace into cartesian space. This function lifts the forces from the subspace to the cartesian space all the values not contained in the subspace are assumed to be zero and then a coordinate transformation from eigenvector to cartesian vectors is performed The nonexistent values don't have to be set to zero explicitly, they would occur as zero valued summands, hence we just stop to compute this part of the sum. For every atom we add all the contributions to this atom from all the different eigenvectors. NOTE: one could add directly to the forcefield forces, would mean we wouldn't have to clear the field forces_cart prior the computation, but we compute the forces separately to have them accessible for diagnostics.
[in] | edi | Essential dynamics input parameters |
[out] | forces_cart | The cartesian forces |
void anonymous_namespace{edsam.cpp}::project_to_eigvectors | ( | rvec * | x, |
t_eigvec * | vec, | ||
const t_edpar & | edi | ||
) |
Projects coordinates onto eigenvectors and stores result in vec->xproj. Mass-weighting is applied. Subtracts average positions prior to projection and add them afterwards to retain the unchanged vector.
[in] | x | The coordinates to project to an eigenvector |
[in,out] | vec | The eigenvectors |
[in] | edi | essential dynamics parameters holding average structure and masses |
The mass-weighted inner product of two coordinate vectors. Does not subtract average positions, projection on single eigenvector is returned used by: do_linfix, do_linacc, do_radfix, do_radacc, do_radcon Average position is subtracted in ed_apply_constraints prior to calling projectx.
[in] | edi | Essential dynamics parameters |
[in] | xcoll | vector of atom coordinates |
[in] | vec | vector of coordinates to project onto |
void anonymous_namespace{edsam.cpp}::rad_project | ( | const t_edpar & | edi, |
rvec * | x, | ||
t_eigvec * | vec | ||
) |
Project coordinates onto vector after substracting average position. projection is stored in vec->refproj which is used for radacc, radfix, radcon and center of flooding potential. Average positions are first substracted from x, then added back again.
[in] | edi | essential dynamics parameters with average position |
[in] | x | Coordinates to be projected |
[out] | vec | eigenvector, radius and refproj are overwritten here |
t_edpar anonymous_namespace{edsam.cpp}::read_edi | ( | FILE * | in, |
int | nr_mdatoms, | ||
bool | hasConstForceFlooding, | ||
const char * | fn | ||
) |
reads an essential dynamics input file into a essential dynamics data structure.
[in] | in | input file |
[in] | nr_mdatoms | the number of md atoms, used for consistency checking |
[in] | hasConstForceFlooding | determines if field "CONST_FORCE_FLOODING" is available in input file |
[in] | fn | the file name of the input file for error reporting |
std::vector< t_edpar > anonymous_namespace{edsam.cpp}::read_edi_file | ( | const char * | fn, |
int | nr_mdatoms | ||
) |
Read in the essential dynamics input file and return its contents.
[in] | fn | the file name of the edi file to be read |
[in] | nr_mdatoms | the number of atoms in the simulation |
void anonymous_namespace{edsam.cpp}::read_edvec | ( | FILE * | in, |
int | nrAtoms, | ||
t_eigvec * | tvec | ||
) |
Read an essential dynamics eigenvector and corresponding step size.
[in] | in | input file |
[in] | nrAtoms | number of atoms/coordinates |
[out] | tvec | the eigenvector |
bool anonymous_namespace{edsam.cpp}::readEdVecWithReferenceProjection | ( | FILE * | in, |
int | nrAtoms, | ||
t_eigvec * | tvec, | ||
real ** | initialReferenceProjection, | ||
real ** | referenceProjectionSlope | ||
) |
Read an essential dynamics eigenvector and initial reference projections and slopes if available.
Eigenvector and its initial reference and slope are stored on the same line in the .edi format. To avoid re-winding the .edi file, the reference eigen-vector and reference data are read in one go.
[in] | in | input file |
[in] | nrAtoms | number of atoms/coordinates |
[out] | tvec | the eigenvector |
[out] | initialReferenceProjection | The projection onto eigenvectors as read from file. |
[out] | referenceProjectionSlope | The slope of the reference projections. |
void anonymous_namespace{edsam.cpp}::scan_edvec | ( | FILE * | in, |
int | numAtoms, | ||
rvec *** | vec, | ||
int | nEig | ||
) |
Read eigenvector coordinates for multiple eigenvectors from a file.
[in] | in | the file to read from |
[in] | numAtoms | the number of atoms/coordinates for the eigenvector |
[out] | vec | the eigen-vectors |
[in] | nEig | the number of eigenvectors |
void anonymous_namespace{edsam.cpp}::setup_edi | ( | t_edpar * | edi | ) |
Set up essential dynamics work parameters.
[in] | edi | Essential dynamics working structure. |
void anonymous_namespace{edsam.cpp}::setup_edvec | ( | t_eigvec * | tvec | ) |
Allocate working memory for the eigenvectors.
[in,out] | tvec | eigenvector for which memory will be allocated |
void anonymous_namespace{edsam.cpp}::write_edo | ( | const t_edpar & | edi, |
FILE * | fp, | ||
real | rmsd | ||
) |
Write out the projections onto the eigenvectors. The order of output corresponds to ed_output_legend().
[in] | edi | The essential dyanmics parameters |
[in] | fp | The output file |
[in] | rmsd | the rmsd to the reference structure |
void anonymous_namespace{edsam.cpp}::write_edo_flood | ( | const t_edpar & | edi, |
FILE * | fp, | ||
real | rmsd | ||
) |
Output flooding simulation settings and results to file.
[in] | edi | Essential dynamics input parameters |
[in] | fp | output file |
[in] | rmsd | rmsd to reference structure |