STORMM Source Documentation
|
An object to collect the components of a valence work unit (which will also track frozen atoms to implement coordinate updates, velocity updates, and constraints). While the work unit is encoded in the AtomGraphSynthesis object, the assembly is best done by a dedicated object with plenty of its own methods operating on a single topology (AtomGraph). All systems in the AtomGraphSynthesis are designed to function independently of one another–the only difference is that they have consensus tables of most parameters and differen atom indexing. Translating a valence work unit into a list of instructions within an AtomGraphSynthesis is therefore a critical member function of this class. More...
#include <valence_workunit.h>
Public Member Functions | |
ValenceWorkUnit (ValenceDelegator *vdel_in, std::vector< int > *tvwu_coverage, int list_index_in, int seed_atom_in, int max_atoms_in=maximum_valence_work_unit_atoms) | |
The constructor takes a specific input topology (multiple systems using the same topology in an AtomGraphSynthesis can thereby take the same valence work unit and translate the atom indices as appropriate rather than regenerating the work unit for many equivalent systems). Mapping starts from a specific atom and proceeds until a maximum number of atoms has been accumulated in order to process as many related valence terms as possible. | |
int | getImportedAtomCount () const |
Get the number of atoms currently imported into this work unit. | |
int | getMovedAtomCount () const |
Get the number of atoms currently set to be moved by this work unit. | |
int | getUpdatedAtomCount () const |
Get the number of atoms currently set to be updated by this work unit. | |
int | getListIndex () const |
Get the list index of this work unit. | |
int | getMinAtomIndex () const |
Get the minimum topological atom index of any used by this work unit. | |
int | getMaxAtomIndex () const |
Get the maximum topological atom index of any used by this work unit. | |
int | getMaxAtoms () const |
Get the maximum atom count that this work unit can hold. | |
std::vector< int > | getAtomImportList (int atom_offset=0) const |
Get the list of imported atoms. | |
int | getImportedAtomIndex (int slot, int atom_offset=0) const |
Get a specific imported atom. | |
std::vector< uint2 > | getAtomManipulationMasks () const |
Get bitmasks of moving atoms and atoms that this work unit is assigned to update. Bits signify 1 for an atom being moving or an update assignment. The masks are encoded in a tuple with the x members making a mask for each segment of moving atoms and the y members making a mask for each segment of assigned update atoms. | |
int | getPaddedConstraintInstructionCount () const |
Get the padded size of the largest constraint group. The padding extends the size of each constraint group in the work unit to the minimum factor of two, with a maximum allowed size of 16. | |
std::vector< int > | getTaskCounts () const |
Get a vector describing the number of each type of item this work unit can be tasked to perform. | |
void | storeCompositeBondInstructions (const std::vector< int > &bond_param_map={}, const std::vector< int > &ubrd_param_map={}) |
Compute and store a vector of the bond instructions. This function accepts parameter interpretation tables in order to produce instructions for a collated topology handling many systems (AtomGraphSynthesis). | |
void | storeAngleInstructions (const std::vector< int > ¶meter_map={}) |
Store a vector of the harmonic angle instructions. This function accepts a parameter interpretation table in order to produce instructions for a collated topology handling many systems (AtomGraphSynthesis). | |
void | storeCompositeDihedralInstructions (const std::vector< int > &dihe_param_map={}, const std::vector< int > &dihe14_param_map={}, const std::vector< int > &cimp_param_map={}) |
Store a vector of the composite (cosine-based) dihedral, associated 1:4 interactions, as well as CHARMM improper dihedral instructions. This function accepts parameter interpretation tables in order to produce instructions for a collated topology handling many systems (AtomGraphSynthesis). | |
void | storeCmapInstructions (const std::vector< int > ¶meter_map={}) |
Store a vector of the CMAP instructions. This function accepts a parameter interpretation table in order to produce instructions for a collated topology handling many systems (AtomGraphSynthesis). | |
void | storeInferred14Instructions (const std::vector< int > ¶meter_map={}) |
Store a vector of the inferred 1:4 attenuated pair interaction instructions. This function accepts a parameter interpretation table in order to produce instructions for a collated topology handling many systems (AtomGraphSynthesis). | |
void | storePositionalRestraintInstructions (const std::vector< int > &kr_param_map={}, const std::vector< int > &xyz_param_map={}) |
Store a vector of the positional restraint instructions for this work unit. This function accepts parameter interpretation tables showing how the raw list of restraint settings (k(2,3), r(1,2,3,4), and x / y / z targets) can be condensed by an AtomGraphSynthesis. | |
void | storeDistanceRestraintInstructions (const std::vector< int > &kr_param_map={}) |
Store a vector of the distance restraint instructions for this work unit. This function accepts a parameter interpretation table showing how the raw list of restraint settings (k(2,3) and r(1,2,3,4)) can be condensed by an AtomGraphSynthesis. | |
void | storeAngleRestraintInstructions (const std::vector< int > &kr_param_map={}) |
Store a vector of the three-point angle restraint instructions for this work unit. This function accepts a parameter interpretation table showing how the raw list of restraint settings (k(2,3) and r(1,2,3,4)) can be condensed by an AtomGraphSynthesis. | |
void | storeDihedralRestraintInstructions (const std::vector< int > &kr_param_map={}) |
Store a vector of the four-point dihedral restraint instructions for this work unit. This function accepts a parameter interpretation table showing how the raw list of restraint settings (k(2,3) and r(1,2,3,4)) can be condensed by an AtomGraphSynthesis. | |
void | storeVirtualSiteInstructions (const std::vector< int > ¶meter_map={}) |
Store a vector of the virtual site instructions for this work unit. This function accepts a parameter interpretation table showing how the raw list of unique virtual site frames from one topology maps into a larger selection kept by an AtomGraphSynthesis. | |
void | storeSettleGroupInstructions (const std::vector< int > ¶meter_map={}) |
Store a vector of the SETTLE constraint group instructions for this work unit. This function accepts a parameter interpretation table showing how the raw list of unique SETTLE geometries in one topology maps into a possibly more diverse list curated by an AtomGraphSynthesis. | |
void | storeConstraintGroupInstructions (const std::vector< int > ¶meter_map={}, const std::vector< int > &group_param_bounds={}) |
Store a vector of the hub-and-spoke constraint group instructions for this work unit. This function accepts a parameter interpretation table showing how the raw list of unique constraint groups in one topology maps into a possibly more diverse list curated by an AtomGraphSynthesis. | |
const std::vector< uint2 > & | getCompositeBondInstructions () const |
Get the stored vector of composite bond instructions. | |
const std::vector< uint2 > & | getAngleInstructions () const |
Get the stored vector of angle instructions. | |
const std::vector< uint3 > & | getCompositeDihedralInstructions () const |
Get the stored vector of composite dihedral instructions. | |
const std::vector< uint2 > & | getCmapInstructions () const |
Get the stored vector of CMAP instructions. | |
const std::vector< uint > & | getInferred14Instructions () const |
Get the stored vector of CMAP instructions. | |
const std::vector< uint2 > & | getPositionalRestraintInstructions () const |
Get the stored vector of positional restraint instructions. | |
const std::vector< uint2 > & | getDistanceRestraintInstructions () const |
Get the stored vector of distance restraint instructions. | |
const std::vector< uint2 > & | getAngleRestraintInstructions () const |
Get the stored vector of three-point angle restraint instructions. | |
const std::vector< uint2 > & | getDihedralRestraintInstructions () const |
Get the stored vector of four-point dihedral restraint instructions. | |
const std::vector< uint2 > & | getVirtualSiteInstructions () const |
Get the stored vector of virtual site placement instructions. | |
const std::vector< uint2 > & | getSettleGroupInstructions () const |
Get the stored vector of SETTLE constraint group instructions. | |
const std::vector< uint2 > & | getConstraintGroupInstructions () const |
Get the stored vector of hub-and-spoke constraint group instructions. | |
uint2 | getCompositeBondInstruction (int index) const |
Get a specific composite bond instruction. | |
uint2 | getAngleInstruction (int index) const |
Get a specific angle instruction. | |
uint3 | getCompositeDihedralInstruction (int index) const |
Get a specific composite dihedral instruction. | |
uint2 | getCmapInstruction (int index) const |
Get a specific CMAP instruction. | |
uint | getInferred14Instruction (int index) const |
Get a specific CMAP instruction. | |
uint2 | getPositionalRestraintInstruction (int index) const |
Get a specific positional restraint instruction. | |
uint2 | getDistanceRestraintInstruction (int index) const |
Get a specific distance restraint instruction. | |
uint2 | getAngleRestraintInstruction (int index) const |
Get a specific three-point angle restraint instruction. | |
uint2 | getDihedralRestraintInstruction (int index) const |
Get a specific four-point dihedral restraint instruction. | |
uint2 | getVirtualSiteInstruction (int index) const |
Get a specific virtual site placement instruction. | |
uint2 | getSettleGroupInstruction (int index) const |
Get a specific SETTLE constraint group instruction. | |
uint2 | getConstraintGroupInstruction (int index) const |
Get a specific hub-and-spoke constraint group instruction. | |
const std::vector< uint > & | getAccumulationFlags (VwuTask vtask) const |
Get the bitstrings indicating which energetic interactions each work unit is responsible for accumulating into the official energy outputs. | |
const std::vector< uint > & | getAtomUpdateFlags () const |
Get the bitstrings indicating which of the imported (cached) atoms this work unit is responsible for updating in the global postion and velocity arrays. | |
const std::vector< int > & | getSimpleTaskList (VwuTask vtask) const |
Get the topological indices of each task assigned to this work unit. Assignment of an energy / force-producing term or constraint group does not imply that a work unit is responsible for updating the final positions of all atoms involved. Composite task lists must be accessed with the special-purpose functions below. | |
const std::vector< int > & | getCompositeBondTaskList () const |
Get the composite bond tasks assigned to this work unit. This will return a vector of concatenated bond and Urey-Bradley term indices into the original topology. Interpreting which is which requires the corresponding vector of composite bond term instructions. | |
const std::vector< int2 > & | getCompositeDihedralTaskList () const |
Get the composite dihedral tasks assigned to this work unit. This will return a vector of tuples containing the topological indices of dihedrals or CHARMM impropers that the work unit evaluates. Interpretation of the tuples will depend on knowing whether each term index pertains to a standard cosine-based dihedral or a CHARMM improper dihedral, for which the corresponding instructions list must be accessed. | |
ValenceDelegator * | getDelegatorPointer () |
Get the pointer to the ValenceDelegator managing the creation of this object. | |
const AtomGraph * | getTopologyPointer () const |
Get a pointer to the topology for which this work unit applies. | |
const RestraintApparatus * | getRestraintApparatusPointer () const |
Get a pointer to the restraint collection for which this work unit applies. | |
void | setListIndex (int list_index_in) |
Set the list index of this work unit, in the event that the list of work units for a particular topology needs to be re-ordered. | |
void | setAtomLimit (int new_limit) |
Set the atom limit for a valence work unit. This can be useful in situations where it is desirable to form several work units out of a single molecule, despite there being enough room in just one to hold all atoms of the molecule. | |
void | addNewAtomImport (int atom_index) |
Add a new atom to a work unit. This will update the associated ValenceDelegator and all assignments therein. | |
void | addNewAtomUpdate (const int atom_index) |
Add a new atom to the list of updates that a work unit shall perform. The atom must already be part of the atom import list. | |
void | makeAtomMoveList () |
Create the move list for atoms in the work unit. Any atom that the work unit is responsible for updating must be moved by the work unit, but also any atom sharing a constraint group with one of the atoms which is on the official update list. | |
void | sortAtomSets () |
Sort the atom lists (import, movement, and update) of this work unit into ascending order. This will optimize memory access when reading the atoms and set the stage for mapping valence terms / atom groups to the local list. | |
void | makeAtomUpdateMask () |
Create a bit mask spanning the atom imports, marking all of those that the work unit is responsible for updating in the global position and velocity arrays. | |
void | logActivities () |
Log all activities of this work unit: valence terms, restraints, virtual sites, and constraints. This will translate the topological indices of atoms into indices of the local import list. | |
An object to collect the components of a valence work unit (which will also track frozen atoms to implement coordinate updates, velocity updates, and constraints). While the work unit is encoded in the AtomGraphSynthesis object, the assembly is best done by a dedicated object with plenty of its own methods operating on a single topology (AtomGraph). All systems in the AtomGraphSynthesis are designed to function independently of one another–the only difference is that they have consensus tables of most parameters and differen atom indexing. Translating a valence work unit into a list of instructions within an AtomGraphSynthesis is therefore a critical member function of this class.
stormm::synthesis::ValenceWorkUnit::ValenceWorkUnit | ( | ValenceDelegator * | vdel_in, |
std::vector< int > * | tvwu_coverage, | ||
int | list_index_in, | ||
int | seed_atom_in, | ||
int | max_atoms_in = maximum_valence_work_unit_atoms ) |
The constructor takes a specific input topology (multiple systems using the same topology in an AtomGraphSynthesis can thereby take the same valence work unit and translate the atom indices as appropriate rather than regenerating the work unit for many equivalent systems). Mapping starts from a specific atom and proceeds until a maximum number of atoms has been accumulated in order to process as many related valence terms as possible.
vdel_in | Valence delegator managing the creation of this valence work unit |
tvwu_coverage | Array spanning all atoms in the system to mark whether any one of them has been included in the valence work unit currently under construction. This is distinct from arrays with similar functionality held by the ValenceDelegator object, which track whether an atom has been included as an update priority in any valence work unit. Having this work-unit specific resource ensures that atoms are not included multiple times in the import array. It is cleared after each work unit's construction so as to not require re-allocation. |
list_index_in | Index of this unit in a larger list (the unit should remember its own index number, for the purposes of coordinating with other work units) |
seed_atom_in | The first atom to incorporate into the work unit. Subsequent atoms will be either bonded in some chain to the seed, retracing previous topological indices whereby previous work units left some atoms behind, or jumping forward to the next new molecule. |
max_atoms_in | The maximum number of atoms to accumulate in the work unit |
void stormm::synthesis::ValenceWorkUnit::addNewAtomImport | ( | int | atom_index | ) |
Add a new atom to a work unit. This will update the associated ValenceDelegator and all assignments therein.
atom_index | Index of the atom of interest |
const std::vector< uint > & stormm::synthesis::ValenceWorkUnit::getAccumulationFlags | ( | VwuTask | vtask | ) | const |
Get the bitstrings indicating which energetic interactions each work unit is responsible for accumulating into the official energy outputs.
vtask | The type of task accumulator |
uint2 stormm::synthesis::ValenceWorkUnit::getAngleInstruction | ( | int | index | ) | const |
Get a specific angle instruction.
index | Index of the instruction to retrieve |
uint2 stormm::synthesis::ValenceWorkUnit::getAngleRestraintInstruction | ( | int | index | ) | const |
Get a specific three-point angle restraint instruction.
index | Index of the instruction to retrieve |
std::vector< int > stormm::synthesis::ValenceWorkUnit::getAtomImportList | ( | int | atom_offset = 0 | ) | const |
Get the list of imported atoms.
atom_offset | Offset of the atoms to add to the topological indices, if importing from a synthesis of many systems |
uint2 stormm::synthesis::ValenceWorkUnit::getCmapInstruction | ( | int | index | ) | const |
Get a specific CMAP instruction.
index | Index of the instruction to retrieve |
uint2 stormm::synthesis::ValenceWorkUnit::getCompositeBondInstruction | ( | int | index | ) | const |
Get a specific composite bond instruction.
index | Index of the instruction to retrieve |
uint3 stormm::synthesis::ValenceWorkUnit::getCompositeDihedralInstruction | ( | int | index | ) | const |
Get a specific composite dihedral instruction.
index | Index of the instruction to retrieve |
uint2 stormm::synthesis::ValenceWorkUnit::getConstraintGroupInstruction | ( | int | index | ) | const |
Get a specific hub-and-spoke constraint group instruction.
index | Index of the instruction to retrieve |
uint2 stormm::synthesis::ValenceWorkUnit::getDihedralRestraintInstruction | ( | int | index | ) | const |
Get a specific four-point dihedral restraint instruction.
index | Index of the instruction to retrieve |
uint2 stormm::synthesis::ValenceWorkUnit::getDistanceRestraintInstruction | ( | int | index | ) | const |
Get a specific distance restraint instruction.
index | Index of the instruction to retrieve |
int stormm::synthesis::ValenceWorkUnit::getImportedAtomIndex | ( | int | slot, |
int | atom_offset = 0 ) const |
Get a specific imported atom.
slot | Index of the atom of interest from within the work unit's array (this will return a topological index found in position atom_idx of the local import list) |
atom_offset | Offset of the atoms to add to the topological indices, if importing from a larger synthesis of topologies / systems |
uint stormm::synthesis::ValenceWorkUnit::getInferred14Instruction | ( | int | index | ) | const |
Get a specific CMAP instruction.
index | Index of the instruction to retrieve |
uint2 stormm::synthesis::ValenceWorkUnit::getPositionalRestraintInstruction | ( | int | index | ) | const |
Get a specific positional restraint instruction.
index | Index of the instruction to retrieve |
uint2 stormm::synthesis::ValenceWorkUnit::getSettleGroupInstruction | ( | int | index | ) | const |
Get a specific SETTLE constraint group instruction.
index | Index of the instruction to retrieve |
const std::vector< int > & stormm::synthesis::ValenceWorkUnit::getSimpleTaskList | ( | VwuTask | vtask | ) | const |
Get the topological indices of each task assigned to this work unit. Assignment of an energy / force-producing term or constraint group does not imply that a work unit is responsible for updating the final positions of all atoms involved. Composite task lists must be accessed with the special-purpose functions below.
vtask | The type of task, i.e. bonded interactions, or SETTLE constraint groups |
uint2 stormm::synthesis::ValenceWorkUnit::getVirtualSiteInstruction | ( | int | index | ) | const |
Get a specific virtual site placement instruction.
index | Index of the instruction to retrieve |
void stormm::synthesis::ValenceWorkUnit::setAtomLimit | ( | int | new_limit | ) |
Set the atom limit for a valence work unit. This can be useful in situations where it is desirable to form several work units out of a single molecule, despite there being enough room in just one to hold all atoms of the molecule.
new_limit | The new limit on the number of atoms. This cannot be lower than the number of atoms already in the work unit. |
void stormm::synthesis::ValenceWorkUnit::setListIndex | ( | int | list_index_in | ) |
Set the list index of this work unit, in the event that the list of work units for a particular topology needs to be re-ordered.
list_index_in | The new list index for the work unit |
void stormm::synthesis::ValenceWorkUnit::storeAngleInstructions | ( | const std::vector< int > & | parameter_map = {} | ) |
Store a vector of the harmonic angle instructions. This function accepts a parameter interpretation table in order to produce instructions for a collated topology handling many systems (AtomGraphSynthesis).
parameter_map | Map of the angle parameter sets (optional) |
void stormm::synthesis::ValenceWorkUnit::storeAngleRestraintInstructions | ( | const std::vector< int > & | kr_param_map = {} | ) |
Store a vector of the three-point angle restraint instructions for this work unit. This function accepts a parameter interpretation table showing how the raw list of restraint settings (k(2,3) and r(1,2,3,4)) can be condensed by an AtomGraphSynthesis.
kr_param_map | Mapping for k(2,3) and r(1,2,3,4) settings (optional) |
void stormm::synthesis::ValenceWorkUnit::storeCmapInstructions | ( | const std::vector< int > & | parameter_map = {} | ) |
Store a vector of the CMAP instructions. This function accepts a parameter interpretation table in order to produce instructions for a collated topology handling many systems (AtomGraphSynthesis).
parameter_map | Map of the one topology's CMAP surface indices onto the synthesis (optional) |
void stormm::synthesis::ValenceWorkUnit::storeCompositeBondInstructions | ( | const std::vector< int > & | bond_param_map = {}, |
const std::vector< int > & | ubrd_param_map = {} ) |
Compute and store a vector of the bond instructions. This function accepts parameter interpretation tables in order to produce instructions for a collated topology handling many systems (AtomGraphSynthesis).
bond_param_map | Map of the bond parameter sets (optional) |
ubrd_param_map | Map of the Urey-Bradley parameter sets (optional) |
void stormm::synthesis::ValenceWorkUnit::storeCompositeDihedralInstructions | ( | const std::vector< int > & | dihe_param_map = {}, |
const std::vector< int > & | dihe14_param_map = {}, | ||
const std::vector< int > & | cimp_param_map = {} ) |
Store a vector of the composite (cosine-based) dihedral, associated 1:4 interactions, as well as CHARMM improper dihedral instructions. This function accepts parameter interpretation tables in order to produce instructions for a collated topology handling many systems (AtomGraphSynthesis).
dihe_param_map | Map of the dihedral parameter sets (optional) |
dihe_param_map | Map of the 1:4 scaling factor parameter pairs (optional) |
dihe_param_map | Map of the CHARMM harmonic improper parameter sets (optional) |
void stormm::synthesis::ValenceWorkUnit::storeConstraintGroupInstructions | ( | const std::vector< int > & | parameter_map = {}, |
const std::vector< int > & | group_param_bounds = {} ) |
Store a vector of the hub-and-spoke constraint group instructions for this work unit. This function accepts a parameter interpretation table showing how the raw list of unique constraint groups in one topology maps into a possibly more diverse list curated by an AtomGraphSynthesis.
parameter_map | Mapping for SETTLE group mass and geometry specifications (optional) |
group_param_bounds | Bounds for constraint group parameter sets in an AtomGraphSynthesis (required if parameter_map is supplied, to properly align the parameter indices of each instruction |
void stormm::synthesis::ValenceWorkUnit::storeDihedralRestraintInstructions | ( | const std::vector< int > & | kr_param_map = {} | ) |
Store a vector of the four-point dihedral restraint instructions for this work unit. This function accepts a parameter interpretation table showing how the raw list of restraint settings (k(2,3) and r(1,2,3,4)) can be condensed by an AtomGraphSynthesis.
kr_param_map | Mapping for k(2,3) and r(1,2,3,4) settings (optional) |
void stormm::synthesis::ValenceWorkUnit::storeDistanceRestraintInstructions | ( | const std::vector< int > & | kr_param_map = {} | ) |
Store a vector of the distance restraint instructions for this work unit. This function accepts a parameter interpretation table showing how the raw list of restraint settings (k(2,3) and r(1,2,3,4)) can be condensed by an AtomGraphSynthesis.
kr_param_map | Mapping for k(2,3) and r(1,2,3,4) settings (optional) |
void stormm::synthesis::ValenceWorkUnit::storeInferred14Instructions | ( | const std::vector< int > & | parameter_map = {} | ) |
Store a vector of the inferred 1:4 attenuated pair interaction instructions. This function accepts a parameter interpretation table in order to produce instructions for a collated topology handling many systems (AtomGraphSynthesis).
parameter_map | Map of the one topology's attenuated interaction scaling factors onto the synthesis (optional) |
void stormm::synthesis::ValenceWorkUnit::storePositionalRestraintInstructions | ( | const std::vector< int > & | kr_param_map = {}, |
const std::vector< int > & | xyz_param_map = {} ) |
Store a vector of the positional restraint instructions for this work unit. This function accepts parameter interpretation tables showing how the raw list of restraint settings (k(2,3), r(1,2,3,4), and x / y / z targets) can be condensed by an AtomGraphSynthesis.
kr_param_map | Mapping for k(2,3) and r(1,2,3,4) settings (optional) |
xyz_param_map | Mapping for Cartesian coordinate targets (optional) |
void stormm::synthesis::ValenceWorkUnit::storeSettleGroupInstructions | ( | const std::vector< int > & | parameter_map = {} | ) |
Store a vector of the SETTLE constraint group instructions for this work unit. This function accepts a parameter interpretation table showing how the raw list of unique SETTLE geometries in one topology maps into a possibly more diverse list curated by an AtomGraphSynthesis.
parameter_map | Mapping for SETTLE group mass and geometry specifications (optional) |
void stormm::synthesis::ValenceWorkUnit::storeVirtualSiteInstructions | ( | const std::vector< int > & | parameter_map = {} | ) |
Store a vector of the virtual site instructions for this work unit. This function accepts a parameter interpretation table showing how the raw list of unique virtual site frames from one topology maps into a larger selection kept by an AtomGraphSynthesis.
parameter_map | Mapping for virtual site frame specifications (optional) |