#include <GenericMolInfo.h>
Public Types | |
typedef std::vector< Action * > | Dependencies |
Public Member Functions | |
GenericMolInfo (const ActionOptions &ao) | |
~GenericMolInfo () | |
virtual void | activate () |
Set action to active. More... | |
void | addDependency (Action *) |
Specify that this Action depends on another one. More... | |
void | allowToAccessGlobalForces () |
Allow calls to modifyGlobalForce() More... | |
void | apply () override |
Do nothing. More... | |
void | applyForces () |
virtual void | beforeUpdate () |
Before Update. More... | |
void | calculate () override |
Do nothing. More... | |
void | calculateAtomicNumericalDerivatives (ActionWithValue *a, const unsigned &startnum) |
Numerical derivative routine to use when using Actions that inherit from BOTH ActionWithArguments and ActionAtomistic. More... | |
void | calculateFromPDB (const PDB &) |
Calculate the action given a pdb file as input. More... | |
virtual void | calculateNumericalDerivatives (ActionWithValue *a=NULL) |
Perform calculation using numerical derivatives N.B. More... | |
void | calculateNumericalDerivatives (ActionWithValue *a=NULL) override |
N.B. More... | |
void | changeBox (const Tensor &newbox) |
Change the box shape. More... | |
bool | checkForAtom (AtomNumber a) const |
virtual bool | checkNeedsGradients () const |
Check if the action needs gradient. More... | |
virtual bool | checkNumericalDerivatives () const |
Check if numerical derivatives should be performed. More... | |
void | checkRead () |
Check if Action was properly read. More... | |
bool | checkUpdate () const |
Check if action should be updated. More... | |
std::string | cite (const std::string &s) |
Cite a paper see PlumedMain::cite. More... | |
void | clearDependencies () |
Clear the dependence list for this Action. More... | |
virtual void | clearOptions () |
void | clearOutputForces () |
virtual void | deactivate () |
Set action to inactive. More... | |
void | doNotForce () |
Skip atom forces - use with care. More... | |
void | doNotRetrieve () |
Skip atom retrieval - use with care. More... | |
void | error (const std::string &msg) const |
Crash calculation and print documentation. More... | |
void | exit (int c=0) |
Exit with error code c. More... | |
int | fclose (FILE *fp) |
Closes a file opened with Action::fclose(). More... | |
void | fflush () |
Tell to the Action to flush open files. More... | |
FILE * | fopen (const char *path, const char *mode) |
Opens a file. More... | |
AtomNumber | getAbsoluteIndex (int i) const |
Get the absolute index of an atom. More... | |
virtual const std::vector< AtomNumber > & | getAbsoluteIndexes () const |
Get the vector of absolute indexes. More... | |
std::string | getAtomName (AtomNumber a) const |
void | getBackbone (std::vector< std::string > &resstrings, const std::string &fortype, std::vector< std::vector< AtomNumber > > &backbone) |
const Tensor & | getBox () const |
Get box shape. More... | |
std::string | getChainID (AtomNumber a) const |
double | getCharge (int i) const |
Get charge of i-th atom. More... | |
bool | getCPT () const |
Return true if we are doing at a checkpoint step. More... | |
const Dependencies & | getDependencies () const |
Return dependencies. More... | |
virtual std::string | getDocumentation () const |
const double & | getEnergy () const |
Get energy. More... | |
bool | getExchangeStep () const |
Check if we are on an exchange step. More... | |
const Vector & | getGlobalPosition (AtomNumber) const |
Get position of i-th atom (access by absolute AtomNumber). More... | |
std::string | getKeyword (const std::string &key) |
Just read one of the keywords and return the whole thing as a string. More... | |
const std::string & | getLabel () const |
Returns the label. More... | |
double | getMass (int i) const |
Get mass of i-th atom. More... | |
const std::string & | getName () const |
Returns the name. More... | |
unsigned | getNumberOfAtoms () const |
Get number of available atoms. More... | |
const Pbc & | getPbc () const |
Get reference to Pbc. More... | |
unsigned | getPDBsize () const |
Vector | getPosition (AtomNumber a) const |
const Vector & | getPosition (int) const |
Get position of i-th atom (access by relative index) More... | |
const std::vector< Vector > & | getPositions () const |
Get the array of all positions. More... | |
std::string | getResidueName (AtomNumber a) const |
unsigned | getResidueNumber (AtomNumber a) const |
bool | getRestart () const |
Return true if we are doing a restart. More... | |
long int | getStep () const |
Return the present timestep. More... | |
int | getStride () const |
Get the stride. More... | |
double | getTime () const |
Return the present time. More... | |
double | getTimeStep () const |
Return the timestep. More... | |
unsigned | getTotAtoms () const |
Get total number of atoms, including virtual ones. More... | |
const std::set< AtomNumber > & | getUnique () const |
const std::set< AtomNumber > & | getUniqueLocal () const |
void | interpretAtomList (std::vector< std::string > &strings, std::vector< AtomNumber > &t) |
Convert a set of read in strings into an atom list (this is used in parseAtomList) More... | |
void | interpretSymbol (const std::string &symbol, std::vector< AtomNumber > &atoms) |
bool | isActive () const |
Check if action is active. More... | |
bool | isOptionOn (const std::string &s) const |
Check if an option is on. More... | |
bool | isWhole () const |
virtual void | lockRequests () |
void | lockRequests () override |
void | makeWhole () |
Make atoms whole, assuming they are in the proper order. More... | |
double & | modifyForceOnEnergy () |
Get a reference to force on energy. More... | |
double & | modifyForceOnExtraCV () |
Get a reference to force on extraCV. More... | |
std::vector< Vector > & | modifyForces () |
Get a reference to forces array. More... | |
Vector & | modifyGlobalForce (AtomNumber) |
Get modifiable force of i-th atom (access by absolute AtomNumber). More... | |
Pbc & | modifyGlobalPbc () |
Get modifiable PBC Should be used by action that need to modify the stored box. More... | |
Vector & | modifyGlobalPosition (AtomNumber) |
Get modifiable position of i-th atom (access by absolute AtomNumber). More... | |
Tensor & | modifyGlobalVirial () |
Get modifiable virial Should be used by action that need to modify the stored virial. More... | |
Tensor & | modifyVirial () |
Get a reference to virial array. More... | |
virtual bool | onStep () const |
Check if the action is active on this step. More... | |
template<class T > | |
void | parse (const std::string &key, T &t) |
Parse one keyword as generic type. More... | |
void | parseAtomList (const std::string &key, const int num, std::vector< AtomNumber > &t) |
Parse an list of atom with a numbred keyword. More... | |
void | parseAtomList (const std::string &key, std::vector< AtomNumber > &t) |
Parse a list of atoms without a numbered keyword. More... | |
void | parseFlag (const std::string &key, bool &t) |
Parse one keyword as boolean flag. More... | |
template<class T > | |
bool | parseNumbered (const std::string &key, const int no, T &t) |
Parse one numbered keyword as generic type. More... | |
template<class T > | |
bool | parseNumberedVector (const std::string &key, const int no, std::vector< T > &t) |
Parse a vector with a number. More... | |
template<class T > | |
void | parseVector (const std::string &key, std::vector< T > &t) |
Parse one keyword as std::vector. More... | |
void | pbcApply (std::vector< Vector > &dlist, unsigned max_index=0) const |
Applies PBCs to a seriens of positions or distances. More... | |
Vector | pbcDistance (const Vector &, const Vector &) const |
Compute the pbc distance between two positions. More... | |
void | prepare () override |
Calculate is used to kill the python interpreter. More... | |
virtual void | readAtomsFromPDB (const PDB &) |
This is overwritten in ActionAtomistic so that we can read the atoms from the pdb input file rather than taking them from the MD code. More... | |
void | readAtomsFromPDB (const PDB &pdb) override |
Read in an input file containing atom positions and calculate the action for the atomic configuration therin. More... | |
void | requestAtoms (const std::vector< AtomNumber > &a, const bool clearDep=true) |
Request an array of atoms. More... | |
virtual void | retrieveAtoms () |
virtual void | runFinalJobs () |
RunFinalJobs This method is called once at the very end of the calculation. More... | |
void | setForcesOnAtoms (const std::vector< double > &forcesToApply, unsigned ind=0) |
Add the forces to the atoms. More... | |
virtual void | setOption (const std::string &s) |
void | setStride (const int &n) |
Set the value of the stride. More... | |
virtual void | unlockRequests () |
void | unlockRequests () override |
virtual void | update () |
Update. More... | |
void | updateUniqueLocal () |
updates local unique atoms More... | |
void | warning (const std::string &msg) |
Issue a warning. More... | |
Static Public Member Functions | |
static void | registerKeywords (Keywords &keys) |
Public Attributes | |
Communicator & | comm |
std::set< FILE * > | files |
const Keywords & | keywords |
Log & | log |
Reference to the log stream. More... | |
Communicator & | multi_sim_comm |
PlumedMain & | plumed |
Reference to main plumed object. More... | |
Protected Member Functions | |
void | setExtraCV (const std::string &name) |
Protected Attributes | |
Atoms & | atoms |
Private Attributes | |
bool | active |
Switch to activate Action on this step. More... | |
Dependencies | after |
Actions on which this Action depends. More... | |
std::vector< double > | charges |
bool | chargesWereSet |
bool | doCheckPoint |
bool | donotforce |
bool | donotretrieve |
bool | enablePythonInterpreter =false |
Python interpreter is enabled. More... | |
double | energy |
std::string | extraCV |
double | forceOnEnergy |
double | forceOnExtraCV |
std::vector< Vector > | forces |
std::vector< AtomNumber > | indexes |
bool | iswhole_ |
Structure in pdb file is whole. More... | |
std::string | label |
Label of the Action, as set with LABEL= in the plumed.dat file. More... | |
std::vector< std::string > | line |
Directive line. More... | |
bool | lockRequestAtoms |
std::vector< double > | masses |
std::string | mytype |
The type of molecule in the pdb. More... | |
const std::string | name |
Name of the directive in the plumed.dat file. More... | |
std::set< std::string > | options |
Option that you might have enabled. More... | |
Pbc & | pbc =*pbc_fwd |
ForwardDecl< Pbc > | pbc_fwd |
PDB & | pdb =*pdb_fwd |
A pdb file containing the topology. More... | |
ForwardDecl< PDB > | pdb_fwd |
std::vector< Vector > | positions |
std::string | pythonCmd |
Python command. More... | |
std::vector< std::vector< AtomNumber > > | read_backbone |
The backbone that was read in from the pdb file. More... | |
std::string | reference |
The name of the reference pdb file. More... | |
int | replica_index |
bool | restart |
std::unique_ptr< Subprocess > | selector |
Selector subprocess. More... | |
bool | selector_running =false |
Track is selector is running Needed on Get_rank()>0. More... | |
int | stride |
std::set< AtomNumber > | unique |
unique should be an ordered set since we later create a vector containing the corresponding indexes More... | |
std::set< AtomNumber > | unique_local |
unique_local should be an ordered set since we later create a vector containing the corresponding indexes More... | |
double | update_from |
Update only after this time. More... | |
double | update_until |
Update only until this time. More... | |
Tensor | virial |
|
inherited |
PLMD::GenericMolInfo::~GenericMolInfo | ( | ) |
|
explicit |
|
virtualinherited |
Set action to active.
|
inherited |
Specify that this Action depends on another one.
|
inlineinherited |
Allow calls to modifyGlobalForce()
|
inlineoverridevirtual |
Do nothing.
Reimplemented from PLMD::ActionAnyorder.
|
inherited |
|
inlinevirtualinherited |
Before Update.
This is a special method that is called just before the update() method. It can be used by actions that want to do something irrespectively of the fact that update() is active or not. In other words, this is always called, even when action is not active.
Reimplemented in PLMD::generic::UpdateIf.
|
inlineoverridevirtual |
Do nothing.
Reimplemented from PLMD::ActionAnyorder.
|
inherited |
Numerical derivative routine to use when using Actions that inherit from BOTH ActionWithArguments and ActionAtomistic.
|
inherited |
Calculate the action given a pdb file as input.
This is used to initialize things like distance from a point in CV map space given a pdb as an input file
|
virtualinherited |
Perform calculation using numerical derivatives N.B.
only pass an ActionWithValue to this routine if you know exactly what you are doing.
Reimplemented in PLMD::vesselbase::ActionWithAveraging, PLMD::multicolvar::DumpMultiColvar, PLMD::ActionAtomistic, PLMD::multicolvar::MultiColvarBase, PLMD::analysis::AnalysisBase, PLMD::ActionWithArguments, PLMD::mapping::Mapping, PLMD::multicolvar::BridgedMultiColvarFunction, PLMD::vesselbase::ActionWithInputVessel, PLMD::isdb::EMMI, PLMD::isdb::MetainferenceBase, and PLMD::mapping::PCAVars.
|
overridevirtualinherited |
N.B.
only pass an ActionWithValue to this routine if you know exactly what you are doing. The default will be correct for the vast majority of cases
Reimplemented from PLMD::Action.
Reimplemented in PLMD::vesselbase::ActionWithAveraging, PLMD::multicolvar::DumpMultiColvar, PLMD::multicolvar::MultiColvarBase, PLMD::mapping::Mapping, PLMD::multicolvar::BridgedMultiColvarFunction, PLMD::isdb::EMMI, PLMD::isdb::MetainferenceBase, and PLMD::mapping::PCAVars.
|
inherited |
Change the box shape.
bool PLMD::GenericMolInfo::checkForAtom | ( | AtomNumber | a | ) | const |
|
inlinevirtualinherited |
Check if the action needs gradient.
Reimplemented in PLMD::bias::MetaD, PLMD::bias::PBMetaD, and PLMD::generic::DumpProjections.
|
inlinevirtualinherited |
Check if numerical derivatives should be performed.
Reimplemented in PLMD::ActionWithValue.
|
inherited |
Check if Action was properly read.
This checks if Action::line is empty. It must be called after a final Action has been initialized
|
inherited |
Check if action should be updated.
|
inherited |
Cite a paper see PlumedMain::cite.
|
inherited |
Clear the dependence list for this Action.
|
virtualinherited |
|
inherited |
|
inlinevirtualinherited |
Set action to inactive.
|
inlineinherited |
Skip atom forces - use with care.
If this function is called during initialization, then forces are not going to be propagated. Can be used for optimization.
|
inlineinherited |
Skip atom retrieval - use with care.
If this function is called during initialization, then atoms are not going to be retrieved. Can be used for optimization. Notice that calling getPosition(int) in an Action where DoNotRetrieve() was called might lead to undefined behavior.
|
inherited |
Crash calculation and print documentation.
|
inherited |
Exit with error code c.
|
inherited |
Closes a file opened with Action::fclose().
|
inherited |
Tell to the Action to flush open files.
|
inherited |
Opens a file.
This is similar to plain fopen, but with some extra functionality.
|
inlineinherited |
Get the absolute index of an atom.
|
inlinevirtualinherited |
Get the vector of absolute indexes.
Reimplemented in PLMD::multicolvar::BridgedMultiColvarFunction.
std::string PLMD::GenericMolInfo::getAtomName | ( | AtomNumber | a | ) | const |
void PLMD::GenericMolInfo::getBackbone | ( | std::vector< std::string > & | resstrings, |
const std::string & | fortype, | ||
std::vector< std::vector< AtomNumber > > & | backbone | ||
) |
|
inlineinherited |
Get box shape.
std::string PLMD::GenericMolInfo::getChainID | ( | AtomNumber | a | ) | const |
|
inlineinherited |
Get charge of i-th atom.
|
inherited |
Return true if we are doing at a checkpoint step.
|
inlineinherited |
Return dependencies.
|
virtualinherited |
|
inlineinherited |
Get energy.
|
inherited |
Check if we are on an exchange step.
|
inlineinherited |
Get position of i-th atom (access by absolute AtomNumber).
With direct access to the global atom array.
|
inherited |
Just read one of the keywords and return the whole thing as a string.
|
inlineinherited |
Returns the label.
|
inlineinherited |
Get mass of i-th atom.
|
inlineinherited |
Returns the name.
|
inlineinherited |
Get number of available atoms.
unsigned PLMD::GenericMolInfo::getPDBsize | ( | ) | const |
Vector PLMD::GenericMolInfo::getPosition | ( | AtomNumber | a | ) | const |
|
inlineinherited |
Get position of i-th atom (access by relative index)
|
inlineinherited |
Get the array of all positions.
std::string PLMD::GenericMolInfo::getResidueName | ( | AtomNumber | a | ) | const |
unsigned PLMD::GenericMolInfo::getResidueNumber | ( | AtomNumber | a | ) | const |
|
inlineinherited |
Return true if we are doing a restart.
|
inherited |
Return the present timestep.
|
inherited |
Get the stride.
|
inherited |
Return the present time.
|
inherited |
Return the timestep.
|
inlineinherited |
Get total number of atoms, including virtual ones.
Can be used to make a loop on modifyGlobalPosition or getGlobalPosition.
|
inlineinherited |
|
inlineinherited |
|
inherited |
Convert a set of read in strings into an atom list (this is used in parseAtomList)
void PLMD::GenericMolInfo::interpretSymbol | ( | const std::string & | symbol, |
std::vector< AtomNumber > & | atoms | ||
) |
|
inlineinherited |
Check if action is active.
|
inlineinherited |
Check if an option is on.
bool PLMD::GenericMolInfo::isWhole | ( | ) | const |
|
inlinevirtualinherited |
|
inlineoverridevirtualinherited |
Reimplemented from PLMD::Action.
Reimplemented in PLMD::isdb::EMMI, PLMD::isdb::MetainferenceBase, PLMD::mapping::PCAVars, PLMD::mapping::Mapping, and PLMD::vesselbase::ActionWithAveraging.
|
inherited |
Make atoms whole, assuming they are in the proper order.
|
inlineinherited |
Get a reference to force on energy.
|
inlineinherited |
Get a reference to force on extraCV.
|
inlineinherited |
Get a reference to forces array.
|
inlineinherited |
Get modifiable force of i-th atom (access by absolute AtomNumber).
|
inlineinherited |
Get modifiable PBC Should be used by action that need to modify the stored box.
|
inlineinherited |
Get modifiable position of i-th atom (access by absolute AtomNumber).
|
inlineinherited |
Get modifiable virial Should be used by action that need to modify the stored virial.
|
inlineinherited |
Get a reference to virial array.
|
virtualinherited |
Check if the action is active on this step.
Reimplemented in PLMD::gridtools::ConvertToFES.
|
inherited |
Parse one keyword as generic type.
|
inherited |
Parse an list of atom with a numbred keyword.
|
inherited |
Parse a list of atoms without a numbered keyword.
|
inherited |
Parse one keyword as boolean flag.
|
inherited |
Parse one numbered keyword as generic type.
|
inherited |
Parse a vector with a number.
|
inherited |
Parse one keyword as std::vector.
|
inherited |
Applies PBCs to a seriens of positions or distances.
Compute the pbc distance between two positions.
|
overridevirtual |
Calculate is used to kill the python interpreter.
We do this in order to avoid possible interference or slowing down of the simulation due to the extra subprocess.
Reimplemented from PLMD::Action.
|
inlinevirtualinherited |
This is overwritten in ActionAtomistic so that we can read the atoms from the pdb input file rather than taking them from the MD code.
Reimplemented in PLMD::ActionAtomistic.
|
overridevirtualinherited |
Read in an input file containing atom positions and calculate the action for the atomic configuration therin.
Reimplemented from PLMD::Action.
|
static |
|
inherited |
Request an array of atoms.
This method is used to ask for a list of atoms. Atoms should be asked for by number. If this routine is called during the simulation, atoms will be available at the next step MAYBE WE HAVE TO FIND SOMETHING MORE CLEAR FOR DYNAMIC LISTS OF ATOMS
|
virtualinherited |
Reimplemented in PLMD::multicolvar::MultiColvarBase.
|
inlinevirtualinherited |
RunFinalJobs This method is called once at the very end of the calculation.
The set of all Actions in run for the final time in forward order.
Reimplemented in PLMD::vesselbase::ActionWithAveraging, PLMD::analysis::AnalysisBase, PLMD::gridtools::ConvertToFES, PLMD::analysis::ReadDissimilarityMatrix, and PLMD::gridtools::GridPrintingBase.
|
inlineprotectedinherited |
|
inherited |
Add the forces to the atoms.
|
virtualinherited |
|
inherited |
Set the value of the stride.
|
inlinevirtualinherited |
|
inlineoverridevirtualinherited |
Reimplemented from PLMD::Action.
Reimplemented in PLMD::isdb::EMMI, PLMD::isdb::MetainferenceBase, PLMD::mapping::PCAVars, PLMD::mapping::Mapping, and PLMD::vesselbase::ActionWithAveraging.
|
inlinevirtualinherited |
Update.
This method is called one time per step. The set of all Actions is updated in forward order.
Reimplemented in PLMD::bias::MetaD, PLMD::isdb::CS2Backbone, PLMD::bias::PBMetaD, PLMD::ves::VesLinearExpansion, PLMD::isdb::Metainference, PLMD::opes::OPESmetad< mode >, PLMD::isdb::RDC, PLMD::ves::Optimizer, PLMD::ves::TargetDistribution, PLMD::ves::VesDeltaF, PLMD::opes::OPESexpanded, PLMD::generic::Plumed, PLMD::bias::MaxEnt, PLMD::generic::DumpAtoms, PLMD::isdb::SAXS, PLMD::multicolvar::VolumeTetrapore, PLMD::bias::ExtendedLagrangian, PLMD::multicolvar::VolumeCavity, PLMD::generic::EffectiveEnergyDrift, PLMD::mapping::AdaptivePath, PLMD::ves::OutputFesBias, PLMD::isdb::JCoupling, PLMD::generic::Read, PLMD::analysis::AnalysisBase, PLMD::generic::DumpMassCharge, PLMD::generic::Print, PLMD::vesselbase::ActionWithAveraging, PLMD::adjmat::OutputCluster, PLMD::isdb::PRE, PLMD::multicolvar::DumpMultiColvar, PLMD::isdb::NOE, PLMD::generic::Flush, PLMD::analysis::ReadDissimilarityMatrix, PLMD::generic::DumpDerivatives, PLMD::generic::DumpForces, PLMD::generic::DumpProjections, PLMD::adjmat::DumpGraph, PLMD::analysis::ReadAnalysisFrames, PLMD::gridtools::GridPrintingBase, PLMD::logmfd::LogMFD, PLMD::eds::EDS, and PLMD::fisst::FISST.
|
inherited |
updates local unique atoms
|
inherited |
Issue a warning.
|
privateinherited |
Switch to activate Action on this step.
|
privateinherited |
Actions on which this Action depends.
|
protectedinherited |
|
privateinherited |
|
privateinherited |
|
inherited |
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
private |
Python interpreter is enabled.
|
privateinherited |
|
privateinherited |
|
inherited |
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
private |
Structure in pdb file is whole.
|
inherited |
|
privateinherited |
Label of the Action, as set with LABEL= in the plumed.dat file.
|
privateinherited |
Directive line.
This line is progressively erased during Action construction so as to check if all the present keywords are correct.
|
privateinherited |
|
inherited |
Reference to the log stream.
|
privateinherited |
|
inherited |
|
private |
The type of molecule in the pdb.
|
privateinherited |
Name of the directive in the plumed.dat file.
|
privateinherited |
Option that you might have enabled.
|
privateinherited |
|
private |
|
inherited |
Reference to main plumed object.
|
privateinherited |
|
private |
Python command.
|
private |
The backbone that was read in from the pdb file.
|
private |
The name of the reference pdb file.
|
privateinherited |
|
privateinherited |
|
private |
Selector subprocess.
|
private |
Track is selector is running Needed on Get_rank()>0.
|
privateinherited |
|
privateinherited |
unique should be an ordered set since we later create a vector containing the corresponding indexes
|
privateinherited |
unique_local should be an ordered set since we later create a vector containing the corresponding indexes
|
privateinherited |
Update only after this time.
|
privateinherited |
Update only until this time.
|
privateinherited |
Hosted by GitHub | 1.8.17 |