STORMM Source Documentation
Loading...
Searching...
No Matches
mm_evaluation.h
1// -*-c++-*-
2#ifndef STORMM_MM_EVALUATION_H
3#define STORMM_MM_EVALUATION_H
4
5#include "copyright.h"
6#include "Constants/generalized_born.h"
7#include "Math/vector_ops.h"
8#include "Potential/energy_enumerators.h"
9#include "Potential/nonbonded_potential.h"
10#include "Potential/scorecard.h"
11#include "Potential/static_exclusionmask.h"
12#include "Potential/valence_potential.h"
13#include "Numerics/split_fixed_precision.h"
14#include "Numerics/numeric_enumerators.h"
15#include "Restraints/restraint_apparatus.h"
16#include "Synthesis/atomgraph_synthesis.h"
17#include "Synthesis/phasespace_synthesis.h"
18#include "Topology/atomgraph.h"
19#include "Topology/atomgraph_abstracts.h"
20#include "Topology/atomgraph_enumerators.h"
21#include "Trajectory/coordinateframe.h"
22#include "Trajectory/phasespace.h"
23
24namespace stormm {
25namespace mm {
26
27using chemistry::PsSynthesisReader;
28using energy::DihedralStyle;
29using energy::evalAttenuated14Pair;
30using energy::evalHarmonicBend;
31using energy::evalHarmonicStretch;
32using energy::evalDihedralTwist;
33using energy::evalPosnRestraint;
34using energy::evalBondRestraint;
35using energy::evalAnglRestraint;
36using energy::evalDiheRestraint;
37using energy::evalCmap;
38using energy::evalAttenuated14Pair;
39using energy::EvaluateForce;
40using energy::evaluateAngleTerms;
41using energy::evaluateAttenuated14Terms;
42using energy::evaluateBondTerms;
43using energy::evaluateCharmmImproperTerms;
44using energy::evaluateCmapTerms;
45using energy::evaluateDihedralTerms;
46using energy::evaluateGeneralizedBornEnergy;
47using energy::evaluateNonbondedEnergy;
48using energy::evaluateRestraints;
49using energy::evaluateUreyBradleyTerms;
50using energy::ScoreCard;
51using energy::StateVariable;
52using energy::StaticExclusionMask;
53using energy::StaticExclusionMaskReader;
54using energy::TorsionKind;
55using energy::ValenceKernelSize;
56using numerics::globalpos_scale_nonoverflow_bits;
57using numerics::force_scale_nonoverflow_bits;
58using restraints::RestraintApparatus;
59using restraints::RestraintKit;
60using stmath::readBitFromMask;
61using structure::PhaseSpaceWriter;
62using synthesis::AtomGraphSynthesis;
63using synthesis::PhaseSpaceSynthesis;
64using synthesis::SyAtomUpdateKit;
65using synthesis::SyValenceKit;
66using topology::AtomGraph;
67using topology::ImplicitSolventKit;
68using topology::NonbondedKit;
69using topology::UnitCellType;
70using topology::ValenceKit;
71using topology::VirtualSiteKit;
72using trajectory::CoordinateFrame;
73using trajectory::CoordinateFrameReader;
74using trajectory::PhaseSpace;
75using trajectory::PhaseSpaceReader;
76using trajectory::PhaseSpaceWriter;
77using namespace generalized_born_defaults;
78using namespace structure;
79using namespace synthesis;
80
120template <typename Tcoord, typename Tforce, typename Tcalc>
121void evalValeMM(const Tcoord* xcrd, const Tcoord* ycrd, const Tcoord* zcrd, const double* umat,
122 const double* invu, UnitCellType unit_cell, Tforce* xfrc, Tforce* yfrc,
123 Tforce* zfrc, ScoreCard *sc, const ValenceKit<Tcalc> &vk,
124 const NonbondedKit<Tcalc> &nbk, EvaluateForce eval_force, int system_index = 0,
125 Tcalc inv_gpos_factor = 1.0, Tcalc force_factor = 1.0, Tcalc clash_distance = 0.0,
126 Tcalc clash_ratio = 0.0);
127
128void evalValeMM(PhaseSpaceWriter psw, ScoreCard *sc, const ValenceKit<double> &vk,
129 const NonbondedKit<double> &nbk, EvaluateForce eval_force, int system_index = 0,
130 double clash_distance = 0.0, double clash_ratio = 0.0);
131
132void evalValeMM(PhaseSpace *ps, ScoreCard *sc, const AtomGraph &ag, EvaluateForce eval_force,
133 int system_index = 0, double clash_distance = 0.0, double clash_ratio = 0.0);
134
135void evalValeMM(PhaseSpace *ps, ScoreCard *sc, const AtomGraph *ag, EvaluateForce eval_force,
136 int system_index = 0, double clash_distance = 0.0, double clash_ratio = 0.0);
137
138template <typename Tc, typename Tc2, typename Tc4>
139void evalValeMM(PsSynthesisWriter *poly_psw, ScoreCard* sc, const SyValenceKit<Tc> &poly_vk,
140 const SyAtomUpdateKit<Tc, Tc2, Tc4> &poly_auk, EvaluateForce eval_force,
141 VwuTask activity = VwuTask::ALL_TASKS, double clash_distance = 0.0,
142 double clash_ratio = 0.0, int step = 0,
144
145void evalValeMM(PhaseSpaceSynthesis *poly_ps, ScoreCard *sc, const AtomGraphSynthesis *poly_ag,
146 EvaluateForce eval_force, PrecisionModel prec,
147 VwuTask activity = VwuTask::ALL_TASKS, int step = 0,
148 bool include_restraints = false);
149
150void evalValeMM(PhaseSpaceSynthesis *poly_ps, ScoreCard *sc, const AtomGraphSynthesis &poly_ag,
151 EvaluateForce eval_force, PrecisionModel prec, int step = 0,
152 VwuTask activity = VwuTask::ALL_TASKS, bool include_restraints = false);
153
154void evalValeMM(PhaseSpaceSynthesis* poly_ps, ScoreCard* sc, const AtomGraphSynthesis* poly_ag,
155 EvaluateForce eval_force, PrecisionModel prec);
157
175template <typename Tcoord, typename Tforce, typename Tcalc, typename Tcalc2, typename Tcalc4>
176void evalValeRestMM(const Tcoord* xcrd, const Tcoord* ycrd, const Tcoord* zcrd, const double* umat,
177 const double* invu, UnitCellType unit_cell, Tforce* xfrc, Tforce* yfrc,
178 Tforce* zfrc, ScoreCard *sc, const ValenceKit<Tcalc> &vk,
180 EvaluateForce eval_force, int system_index = 0, int step = 0,
181 Tcalc inv_gpos_factor = 1.0, Tcalc force_factor = 1.0,
182 Tcalc clash_distance = 0.0, Tcalc clash_ratio = 0.0);
183
184void evalValeRestMM(PhaseSpaceWriter psw, ScoreCard *sc, const ValenceKit<double> &vk,
185 const NonbondedKit<double> &nbk,
186 const RestraintKit<double, double2, double4> &rar, EvaluateForce eval_force,
187 int system_index = 0, int step = 0, double clash_distance = 0.0,
188 double clash_ratio = 0.0);
189
190void evalValeRestMM(PhaseSpace *ps, ScoreCard *sc, const AtomGraph &ag,
191 const RestraintApparatus &ra, EvaluateForce eval_force, int system_index = 0,
192 int step = 0, double clash_distance = 0.0, double clash_ratio = 0.0);
193
194void evalValeRestMM(PhaseSpace *ps, ScoreCard *sc, const AtomGraph *ag,
195 const RestraintApparatus &ra, EvaluateForce eval_force, int system_index = 0,
196 int step = 0, double clash_distance = 0.0, double clash_ratio = 0.0);
197
198template <typename Tc, typename Tc2, typename Tc4>
199void evalValeRestMM(PsSynthesisWriter *poly_psw, ScoreCard* sc, const SyValenceKit<Tc> &poly_vk,
200 const SyRestraintKit<Tc, Tc2, Tc4> &poly_rk,
201 const SyAtomUpdateKit<Tc, Tc2, Tc4> &poly_auk, EvaluateForce eval_force,
202 VwuTask activity = VwuTask::ALL_TASKS, int step = 0, Tc clash_distance = 0.0,
203 Tc clash_ratio = 0.0);
204
205void evalValeRestMM(PhaseSpaceSynthesis* poly_ps, ScoreCard* sc, const AtomGraphSynthesis* poly_ag,
206 int step_number, EvaluateForce eval_force, PrecisionModel prec);
208
221template <typename Tcoord, typename Tforce, typename Tcalc>
222void evalNonbValeMM(const Tcoord* xcrd, const Tcoord* ycrd, const Tcoord* zcrd, const double* umat,
223 const double* invu, UnitCellType unit_cell, Tforce* xfrc, Tforce* yfrc,
224 Tforce* zfrc, ScoreCard *sc, const ValenceKit<Tcalc> &vk,
225 const NonbondedKit<Tcalc> &nbk, const StaticExclusionMaskReader &ser,
226 EvaluateForce eval_force, int system_index = 0, Tcalc inv_gpos_factor = 1.0,
227 Tcalc force_factor = 1.0, Tcalc clash_distance = 0.0, Tcalc clash_ratio = 0.0);
228
229void evalNonbValeMM(PhaseSpaceWriter psw, ScoreCard *sc, const ValenceKit<double> &vk,
230 const NonbondedKit<double> &nbk, const StaticExclusionMaskReader &ser,
231 EvaluateForce eval_force, int system_index = 0,
232 double clash_distance = 0.0, double clash_ratio = 0.0);
233
234void evalNonbValeMM(PhaseSpace *ps, ScoreCard *sc, const AtomGraph &ag,
235 const StaticExclusionMask &se, EvaluateForce eval_force, int system_index = 0,
236 double clash_distance = 0.0, double clash_ratio = 0.0);
237
238void evalNonbValeMM(PhaseSpace *ps, ScoreCard *sc, const AtomGraph *ag,
239 const StaticExclusionMask &se, EvaluateForce eval_force, int system_index = 0,
240 double clash_distance = 0.0, double clash_ratio = 0.0);
242
259template <typename Tcoord, typename Tforce, typename Tcalc, typename Tcalc2, typename Tcalc4>
260void evalNonbValeRestMM(const Tcoord* xcrd, const Tcoord* ycrd, const Tcoord* zcrd,
261 const double* umat, const double* invu, UnitCellType unit_cell,
262 Tforce* xfrc, Tforce* yfrc, Tforce* zfrc, ScoreCard *sc,
263 const ValenceKit<Tcalc> &vk, const NonbondedKit<Tcalc> &nbk,
264 const StaticExclusionMaskReader &ser,
265 const RestraintKit<Tcalc, Tcalc2, Tcalc4> &rar, EvaluateForce eval_force,
266 int system_index = 0, int step = 0, Tcalc inv_gpos_factor = 1.0,
267 Tcalc force_factor = 1.0, Tcalc clash_distance = 0.0,
268 Tcalc clash_ratio = 0.0);
269
270void evalNonbValeRestMM(PhaseSpaceWriter psw, ScoreCard *sc, const ValenceKit<double> &vk,
271 const NonbondedKit<double> &nbk, const StaticExclusionMaskReader &ser,
273 EvaluateForce eval_force, int system_index = 0, int step = 0,
274 double clash_distance = 0.0, double clash_ratio = 0.0);
275
276void evalNonbValeRestMM(PhaseSpace *ps, ScoreCard *sc, const AtomGraph &ag,
277 const StaticExclusionMask &se, const RestraintApparatus &ra,
278 EvaluateForce eval_force, int system_index = 0, int step = 0,
279 double clash_distance = 0.0, double clash_ratio = 0.0);
280
281void evalNonbValeRestMM(PhaseSpace *ps, ScoreCard *sc, const AtomGraph *ag,
282 const StaticExclusionMask &se, const RestraintApparatus *ra,
283 EvaluateForce eval_force, int system_index = 0, int step = 0,
284 double clash_distance = 0.0, double clash_ratio = 0.0);
286
306template <typename Tcoord, typename Tforce, typename Tcalc, typename Tcalc2, typename Tcalc4>
307void evalRestrainedMMGB(const Tcoord* xcrd, const Tcoord* ycrd, const Tcoord* zcrd,
308 const double* umat, const double* invu, UnitCellType unit_cell,
309 Tforce* xfrc, Tforce* yfrc, Tforce* zfrc, ScoreCard *sc,
310 const ValenceKit<Tcalc> &vk, const NonbondedKit<Tcalc> &nbk,
312 const NeckGeneralizedBornKit<Tcalc> &neck_gbk,
313 Tforce* effective_gb_radii, Tforce* psi, Tforce* sumdeijda,
314 const RestraintKit<Tcalc, Tcalc2, Tcalc4> &rar, EvaluateForce eval_force,
315 int system_index = 0, int step = 0, Tcalc inv_gpos_factor = 1.0,
316 Tcalc force_factor = 1.0, Tcalc clash_distance = 0.0,
317 Tcalc clash_ratio = 0.0);
318
319void evalRestrainedMMGB(PhaseSpaceWriter psw, ScoreCard *sc, const ValenceKit<double> &vk,
320 const NonbondedKit<double> &nbk, const StaticExclusionMaskReader &ser,
322 const NeckGeneralizedBornKit<double> &neck_gbk,
324 EvaluateForce eval_force, int system_index = 0, int step = 0,
325 double clash_distance = 0.0, double clash_ratio = 0.0);
326
327void evalRestrainedMMGB(PhaseSpace *ps, ScoreCard *sc, const AtomGraph &ag,
328 const NeckGeneralizedBornTable &neck_gbtab,
329 const StaticExclusionMask &se, const RestraintApparatus &ra,
330 EvaluateForce eval_force, int system_index = 0, int step = 0,
331 double clash_distance = 0.0, double clash_ratio = 0.0);
332
333void evalRestrainedMMGB(PhaseSpace *ps, ScoreCard *sc, const AtomGraph *ag,
334 const NeckGeneralizedBornTable &neck_gbtab,
335 const StaticExclusionMask &se, const RestraintApparatus *ra,
336 EvaluateForce eval_force, int system_index = 0, int step = 0,
337 double clash_distance = 0.0, double clash_ratio = 0.0);
339
346void evalVwuInitEnergy(ScoreCard *ecard, const VwuTask activity, const int sysid);
347
365void commitVwuEnergies(llint bond_acc, llint angl_acc, llint dihe_acc, llint impr_acc,
366 llint ubrd_acc, llint cimp_acc, llint cmap_acc, llint qq14_acc,
367 llint lj14_acc, llint rest_acc, int sysid, VwuTask activity,
368 ScoreCard *ecard);
369
370} // namespace mm
371} // namespace stormm
372
373#include "mm_evaluation.tpp"
374
375#endif
Track the energy components of a collection of systems in an HPC-capable array. This object uses the ...
Definition scorecard.h:101
A simple pair list for an all-to-all calculation with exclusion masks. The list stores masks for 16 x...
Definition static_exclusionmask.h:81
Object to hold a complex array of constants referenced by various GB calculations using the "neck" fo...
Definition generalized_born.h:151
A collection of all restraints pertaining to a specific topology for the purposes of one simulation,...
Definition restraint_apparatus.h:109
A collection of one or more AtomGraph objects, with similar components arranged in contiguous arrays ...
Definition atomgraph_synthesis.h:55
A fixed-precision representation of coordinates, velocities, and forces to manage a set of simulation...
Definition phasespace_synthesis.h:325
A struct to hold information relating to an Amber topology. This struct's member functions are limite...
Definition atomgraph.h:50
An object to complement a topology and hold positions, velocities, and forces of all particles in a s...
Definition phasespace.h:141
The abstract for a StaticExclusionMask object, read-only due to the const-ness of the data() member f...
Definition static_exclusionmask.h:45
Abstract for the NeckGeneralizedBornTable object, in single- or double-precision.
Definition generalized_born.h:130
Double-precision reader abstract for the RestraintApparatus class. Restraints are very detailed thing...
Definition restraint_apparatus.h:28
The writer for a PhaseSpaceSynthesis object, containing all of the data relevant for propagating dyna...
Definition phasespace_synthesis.h:87
Collect the virtual site details and constraint parameters of the topology synthesis into a single ab...
Definition synthesis_abstracts.h:257
Collect the critical restraint parameters and masking information for work unit-based evaluation of t...
Definition synthesis_abstracts.h:100
Collect the critical valence parameters and indexing information for work unit-based evaluation of th...
Definition synthesis_abstracts.h:19
Information needed for Generalized Born (and perhaps other) implicit solvent methods....
Definition atomgraph_abstracts.h:352
Information needed for non-bonded real-space calculations. Templating is used as above,...
Definition atomgraph_abstracts.h:287
Information need for bonded calculations. Templating is used to serve either of two levels of precisi...
Definition atomgraph_abstracts.h:88
Collect constants and pointers to the components of a modifiable PhaseSpace object.
Definition phasespace.h:31