STORMM Source Documentation
Loading...
Searching...
No Matches
valence_potential.h
1// -*-c++-*-
2#ifndef STORMM_VALENCE_POTENTIAL_H
3#define STORMM_VALENCE_POTENTIAL_H
4
5#include <cmath>
6#include "copyright.h"
7#include "Constants/hpc_bounds.h"
8#include "Constants/symbol_values.h"
9#include "DataTypes/common_types.h"
10#include "Math/matrix_ops.h"
11#include "Math/rounding.h"
12#include "Math/vector_ops.h"
13#include "Numerics/split_fixed_precision.h"
14#include "Restraints/restraint_apparatus.h"
15#include "Restraints/restraint_util.h"
16#include "Structure/local_arrangement.h"
17#include "Topology/atomgraph.h"
18#include "Topology/atomgraph_abstracts.h"
19#include "Topology/atomgraph_enumerators.h"
20#include "Trajectory/coordinateframe.h"
21#include "Trajectory/coordinate_series.h"
22#include "Trajectory/phasespace.h"
23#include "energy_enumerators.h"
24#include "scorecard.h"
25#include "soft_core_potentials.h"
26
27namespace stormm {
28namespace energy {
29
30using data_types::isSignedIntegralScalarType;
31using numerics::operator+=;
32using numerics::operator-=;
33using numerics::operator+;
34using numerics::operator-;
35using stmath::angleVerification;
36using stmath::crossProduct;
37using stmath::matrixMultiply;
38using stmath::matrixVectorMultiply;
39using stmath::roundUp;
40using restraints::computeRestraintMixture;
41using restraints::RestraintApparatus;
42using restraints::RestraintKit;
43using restraints::restraintDelta;
44using structure::displacement;
45using structure::imageCoordinates;
46using structure::ImagingMethod;
47using symbols::asymptotic_to_one_f;
48using symbols::asymptotic_to_one_lf;
49using symbols::inverse_twopi;
50using symbols::inverse_twopi_f;
51using symbols::inverse_one_minus_asymptote_f;
52using symbols::inverse_one_minus_asymptote_lf;
53using symbols::pi;
54using symbols::pi_f;
55using symbols::twopi;
56using symbols::twopi_f;
57using topology::AtomGraph;
58using topology::ValenceKit;
59using topology::NonbondedKit;
60using topology::TorsionKind;
61using topology::UnitCellType;
62using trajectory::CoordinateFrame;
63using trajectory::CoordinateFrameReader;
64using trajectory::CoordinateFrameWriter;
65using trajectory::CoordinateSeriesReader;
66using trajectory::CoordinateSeriesWriter;
67using trajectory::PhaseSpace;
68using trajectory::PhaseSpaceWriter;
69using namespace stormm::numerics;
70
97template <typename Tcoord, typename Tforce, typename Tcalc>
98Tcalc evalHarmonicStretch(int i_atom, int j_atom, Tcalc stiffness, Tcalc equilibrium,
99 const Tcoord* xcrd, const Tcoord* ycrd, const Tcoord* zcrd,
100 const double* umat, const double* invu, UnitCellType unit_cell,
101 Tforce* xfrc, Tforce* yfrc, Tforce* zfrc, EvaluateForce eval_force,
102 Tcalc inv_gpos_factor = 1.0, Tcalc force_factor = 1.0,
103 const int* xcrd_ovrf = nullptr, const int* ycrd_ovrf = nullptr,
104 const int* zcrd_ovrf = nullptr, int* xfrc_ovrf = nullptr,
105 int* yfrc_ovrf = nullptr, int* zfrc_ovrf = nullptr);
106
141template <typename Tcoord, typename Tforce, typename Tcalc>
142double evaluateBondTerms(const ValenceKit<Tcalc> vk, const Tcoord* xcrd, const Tcoord* ycrd,
143 const Tcoord* zcrd, const double* umat, const double* invu,
144 UnitCellType unit_cell, Tforce* xfrc, Tforce* yfrc, Tforce* zfrc,
145 ScoreCard *ecard, EvaluateForce eval_force = EvaluateForce::NO,
146 int system_index = 0, Tcalc inv_gpos_factor = 1.0,
147 Tcalc force_factor = 1.0);
148
149double evaluateBondTerms(const ValenceKit<double> vk, PhaseSpaceWriter psw, ScoreCard *ecard,
150 EvaluateForce eval_force = EvaluateForce::NO, int system_index = 0);
151
152double evaluateBondTerms(const AtomGraph &ag, PhaseSpace *ps, ScoreCard *ecard,
153 EvaluateForce eval_force = EvaluateForce::NO, int system_index = 0);
154
155double evaluateBondTerms(const AtomGraph *ag, PhaseSpace *ps, ScoreCard *ecard,
156 EvaluateForce eval_force = EvaluateForce::NO, int system_index = 0);
157
158double evaluateBondTerms(const ValenceKit<double> vk, const CoordinateFrameReader cfr,
159 ScoreCard *ecard, int system_index = 0);
160
161double evaluateBondTerms(const ValenceKit<double> vk, const CoordinateFrameWriter &cfw,
162 ScoreCard *ecard, int system_index = 0);
163
164double evaluateBondTerms(const AtomGraph &ag, const CoordinateFrame &cf, ScoreCard *ecard,
165 int system_index = 0);
166
167double evaluateBondTerms(const AtomGraph *ag, const CoordinateFrame &cf, ScoreCard *ecard,
168 int system_index = 0);
169
170template <typename Tcoord, typename Tcalc>
171double evaluateBondTerms(const ValenceKit<Tcalc> vk, const CoordinateSeriesReader<Tcoord> csr,
172 ScoreCard *ecard, int system_index = 0, int force_scale_bits = 23);
173
174template <typename Tcoord, typename Tcalc>
175double evaluateBondTerms(const ValenceKit<Tcalc> vk, const CoordinateSeriesWriter<Tcoord> csr,
176 ScoreCard *ecard, int system_index = 0, int force_scale_bits = 23);
178
185template <typename Tcoord, typename Tforce, typename Tcalc>
186Tcalc evalHarmonicBend(int i_atom, int j_atom, int k_atom, Tcalc stiffness, Tcalc equilibrium,
187 const Tcoord* xcrd, const Tcoord* ycrd, const Tcoord* zcrd,
188 const double* umat, const double* invu, UnitCellType unit_cell,
189 Tforce* xfrc, Tforce* yfrc, Tforce* zfrc, EvaluateForce eval_force,
190 Tcalc inv_gpos_factor = 1.0, Tcalc force_factor = 1.0,
191 const int* xcrd_ovrf = nullptr, const int* ycrd_ovrf = nullptr,
192 const int* zcrd_ovrf = nullptr, int* xfrc_ovrf = nullptr,
193 int* yfrc_ovrf = nullptr, int* zfrc_ovrf = nullptr);
194
229template <typename Tcoord, typename Tforce, typename Tcalc>
230double evaluateAngleTerms(const ValenceKit<Tcalc> vk, const Tcoord* xcrd, const Tcoord* ycrd,
231 const Tcoord* zcrd, const double* umat, const double* invu,
232 UnitCellType unit_cell, Tforce* xfrc, Tforce* yfrc, Tforce* zfrc,
233 ScoreCard *ecard, EvaluateForce eval_force = EvaluateForce::NO,
234 int system_index = 0, Tcalc inv_gpos_factor = 1.0,
235 Tcalc force_factor = 1.0);
236
237double evaluateAngleTerms(const ValenceKit<double> vk, PhaseSpaceWriter psw, ScoreCard *ecard,
238 EvaluateForce eval_force = EvaluateForce::NO, int system_index = 0);
239
240double evaluateAngleTerms(const AtomGraph &ag, PhaseSpace *ps, ScoreCard *ecard,
241 EvaluateForce eval_force = EvaluateForce::NO, int system_index = 0);
242
243double evaluateAngleTerms(const AtomGraph *ag, PhaseSpace *ps, ScoreCard *ecard,
244 EvaluateForce eval_force = EvaluateForce::NO, int system_index = 0);
245
246double evaluateAngleTerms(const ValenceKit<double> vk, const CoordinateFrameReader cfr,
247 ScoreCard *ecard, int system_index = 0);
248
249double evaluateAngleTerms(const ValenceKit<double> vk, const CoordinateFrameWriter &cfw,
250 ScoreCard *ecard, int system_index = 0);
251
252double evaluateAngleTerms(const AtomGraph &ag, const CoordinateFrame &cf, ScoreCard *ecard,
253 int system_index = 0);
254
255double evaluateAngleTerms(const AtomGraph *ag, const CoordinateFrame &cf, ScoreCard *ecard,
256 int system_index = 0);
257
258template <typename Tcoord, typename Tcalc>
259double evaluateAngleTerms(const ValenceKit<Tcalc> vk, const CoordinateSeriesReader<Tcoord> csr,
260 ScoreCard *ecard, int system_index = 0, int force_scale_bits = 23);
261
262template <typename Tcoord, typename Tcalc>
263double evaluateAngleTerms(const ValenceKit<Tcalc> vk, const CoordinateSeriesWriter<Tcoord> csr,
264 ScoreCard *ecard, int system_index = 0, int force_scale_bits = 23);
266
276template <typename Tcoord, typename Tforce, typename Tcalc>
277Tcalc evalDihedralTwist(int i_atom, int j_atom, int k_atom, int l_atom, Tcalc amplitude,
278 Tcalc phase_angle, Tcalc frequency, DihedralStyle kind,
279 const Tcoord* xcrd, const Tcoord* ycrd, const Tcoord* zcrd,
280 const double* umat, const double* invu, UnitCellType unit_cell,
281 Tforce* xfrc, Tforce* yfrc, Tforce* zfrc, EvaluateForce eval_force,
282 Tcalc inv_gpos_factor = 1.0, Tcalc force_factor = 1.0,
283 const int* xcrd_ovrf = nullptr, const int* ycrd_ovrf = nullptr,
284 const int* zcrd_ovrf = nullptr, int* xfrc_ovrf = nullptr,
285 int* yfrc_ovrf = nullptr, int* zfrc_ovrf = nullptr);
286
319template <typename Tcoord, typename Tforce, typename Tcalc>
320double2 evaluateDihedralTerms(const ValenceKit<Tcalc> vk, const Tcoord* xcrd, const Tcoord* ycrd,
321 const Tcoord* zcrd, const double* umat, const double* invu,
322 UnitCellType unit_cell, Tforce* xfrc, Tforce* yfrc, Tforce* zfrc,
323 ScoreCard *ecard, EvaluateForce eval_force = EvaluateForce::NO,
324 int system_index = 0, Tcalc inv_gpos_factor = 1.0,
325 Tcalc force_factor = 1.0);
326
327double2 evaluateDihedralTerms(const ValenceKit<double> vk, PhaseSpaceWriter psw, ScoreCard *ecard,
328 EvaluateForce eval_force = EvaluateForce::NO, int system_index = 0);
329
330double2 evaluateDihedralTerms(const AtomGraph &ag, PhaseSpace *ps, ScoreCard *ecard,
331 EvaluateForce eval_force = EvaluateForce::NO, int system_index = 0);
332
333double2 evaluateDihedralTerms(const AtomGraph *ag, PhaseSpace *ps, ScoreCard *ecard,
334 EvaluateForce eval_force = EvaluateForce::NO, int system_index = 0);
335
336double2 evaluateDihedralTerms(const ValenceKit<double> vk, const CoordinateFrameReader cfr,
337 ScoreCard *ecard, int system_index = 0);
338
339double2 evaluateDihedralTerms(const ValenceKit<double> vk, const CoordinateFrameWriter &cfw,
340 ScoreCard *ecard, int system_index = 0);
341
342double2 evaluateDihedralTerms(const AtomGraph &ag, const CoordinateFrame &cf, ScoreCard *ecard,
343 int system_index = 0);
344
345double2 evaluateDihedralTerms(const AtomGraph *ag, const CoordinateFrame &cf, ScoreCard *ecard,
346 int system_index = 0);
347
348template <typename Tcoord, typename Tcalc>
349double2 evaluateDihedralTerms(const ValenceKit<Tcalc> vk, const CoordinateSeriesReader<Tcoord> csr,
350 ScoreCard *ecard, int system_index = 0, int force_scale_bits = 23);
351
352template <typename Tcoord, typename Tcalc>
353double2 evaluateDihedralTerms(const ValenceKit<Tcalc> vk, const CoordinateSeriesWriter<Tcoord> csr,
354 ScoreCard *ecard, int system_index = 0, int force_scale_bits = 23);
356
388template <typename Tcoord, typename Tforce, typename Tcalc>
389double evaluateUreyBradleyTerms(const ValenceKit<Tcalc> vk, const Tcoord* xcrd,
390 const Tcoord* ycrd, const Tcoord* zcrd, const double* umat,
391 const double* invu, const UnitCellType unit_cell, Tforce* xfrc,
392 Tforce* yfrc, Tforce* zfrc, ScoreCard *ecard,
393 EvaluateForce eval_force = EvaluateForce::NO,
394 int system_index = 0, Tcalc inv_gpos_factor = 1.0,
395 Tcalc force_factor = 1.0, const int* xcrd_ovrf = nullptr,
396 const int* ycrd_ovrf = nullptr, const int* zcrd_ovrf = nullptr,
397 int* xfrc_ovrf = nullptr, int* yfrc_ovrf = nullptr,
398 int* zfrc_ovrf = nullptr);
399
400double evaluateUreyBradleyTerms(const ValenceKit<double> vk, PhaseSpaceWriter psw,
401 ScoreCard *ecard, EvaluateForce eval_force = EvaluateForce::NO,
402 int system_index = 0);
403
404double evaluateUreyBradleyTerms(const AtomGraph &ag, PhaseSpace *ps, ScoreCard *ecard,
405 EvaluateForce eval_force = EvaluateForce::NO,
406 int system_index = 0);
407
408double evaluateUreyBradleyTerms(const AtomGraph *ag, PhaseSpace *ps, ScoreCard *ecard,
409 EvaluateForce eval_force = EvaluateForce::NO,
410 int system_index = 0);
411
412double evaluateUreyBradleyTerms(const ValenceKit<double> vk, const CoordinateFrameReader cfr,
413 ScoreCard *ecard, int system_index = 0);
414
415double evaluateUreyBradleyTerms(const ValenceKit<double> vk, const CoordinateFrameWriter &cfw,
416 ScoreCard *ecard, int system_index = 0);
417
418double evaluateUreyBradleyTerms(const AtomGraph &ag, const CoordinateFrame &cf, ScoreCard *ecard,
419 int system_index = 0);
420
421double evaluateUreyBradleyTerms(const AtomGraph *ag, const CoordinateFrame &cf, ScoreCard *ecard,
422 int system_index = 0);
423
424template <typename Tcoord, typename Tcalc>
425double evaluateUreyBradleyTerms(const ValenceKit<Tcalc> vk,
427 int system_index = 0, int force_scale_bits = 23);
428
429template <typename Tcoord, typename Tcalc>
430double evaluateUreyBradleyTerms(const ValenceKit<Tcalc> vk,
432 int system_index = 0, int force_scale_bits = 23);
434
466template <typename Tcoord, typename Tforce, typename Tcalc>
467double evaluateCharmmImproperTerms(const ValenceKit<Tcalc> vk, const Tcoord* xcrd,
468 const Tcoord* ycrd, const Tcoord* zcrd, const double* umat,
469 const double* invu, UnitCellType unit_cell, Tforce* xfrc,
470 Tforce* yfrc, Tforce* zfrc, ScoreCard *ecard,
471 EvaluateForce eval_force = EvaluateForce::NO,
472 int system_index = 0, Tcalc inv_gpos_factor = 1.0,
473 Tcalc force_factor = 1.0, const int* xcrd_ovrf = nullptr,
474 const int* ycrd_ovrf = nullptr, const int* zcrd_ovrf = nullptr,
475 int* xfrc_ovrf = nullptr, int* yfrc_ovrf = nullptr,
476 int* zfrc_ovrf = nullptr);
477
478double evaluateCharmmImproperTerms(const ValenceKit<double> vk, PhaseSpaceWriter psw,
479 ScoreCard *ecard, EvaluateForce eval_force = EvaluateForce::NO,
480 int system_index = 0);
481
482double evaluateCharmmImproperTerms(const AtomGraph &ag, PhaseSpace *ps, ScoreCard *ecard,
483 EvaluateForce eval_force = EvaluateForce::NO,
484 int system_index = 0);
485
486double evaluateCharmmImproperTerms(const AtomGraph *ag, PhaseSpace *ps, ScoreCard *ecard,
487 EvaluateForce eval_force = EvaluateForce::NO,
488 int system_index = 0);
489
490double evaluateCharmmImproperTerms(const ValenceKit<double> vk, const CoordinateFrameReader cfr,
491 ScoreCard *ecard, int system_index = 0);
492
493double evaluateCharmmImproperTerms(const ValenceKit<double> vk, const CoordinateFrameWriter &cfw,
494 ScoreCard *ecard, int system_index = 0);
495
496double evaluateCharmmImproperTerms(const AtomGraph &ag, const CoordinateFrame &cf,
497 ScoreCard *ecard, int system_index = 0);
498
499double evaluateCharmmImproperTerms(const AtomGraph *ag, const CoordinateFrame &cf,
500 ScoreCard *ecard, int system_index = 0);
501
502template <typename Tcoord, typename Tcalc>
503double evaluateCharmmImproperTerms(const ValenceKit<Tcalc> vk,
505 int system_index = 0, int force_scale_bits = 23);
506
507template <typename Tcoord, typename Tcalc>
508double evaluateCharmmImproperTerms(const ValenceKit<Tcalc> vk,
510 int system_index = 0, int force_scale_bits = 23);
512
541template <typename Tcoord, typename Tforce, typename Tcalc>
542Tcalc evalCmap(const Tcalc* cmap_patches, const int* cmap_patch_bounds, int surf_idx,
543 int surf_dim, int i_atom, int j_atom, int k_atom, int l_atom, int m_atom,
544 const Tcoord* xcrd, const Tcoord* ycrd, const Tcoord* zcrd, const double* umat,
545 const double* invu, UnitCellType unit_cell, Tforce* xfrc, Tforce* yfrc,
546 Tforce* zfrc, EvaluateForce eval_force, Tcalc inv_gpos_factor = 1.0,
547 Tcalc force_factor = 1.0, const int* xcrd_ovrf = nullptr,
548 const int* ycrd_ovrf = nullptr, const int* zcrd_ovrf = nullptr,
549 int* xfrc_ovrf = nullptr, int* yfrc_ovrf = nullptr, int* zfrc_ovrf = nullptr);
550
581template <typename Tcoord, typename Tforce, typename Tcalc>
582double evaluateCmapTerms(const ValenceKit<Tcalc> vk, const Tcoord* xcrd, const Tcoord* ycrd,
583 const Tcoord* zcrd, const double* umat, const double* invu,
584 UnitCellType unit_cell, Tforce* xfrc, Tforce* yfrc, Tforce* zfrc,
585 ScoreCard *ecard, EvaluateForce eval_force = EvaluateForce::NO,
586 int system_index = 0, Tcalc inv_gpos_factor = 1.0,
587 Tcalc force_factor = 1.0);
588
589double evaluateCmapTerms(const ValenceKit<double> vk, PhaseSpaceWriter psw, ScoreCard *ecard,
590 EvaluateForce eval_force = EvaluateForce::NO, int system_index = 0);
591
592double evaluateCmapTerms(const AtomGraph &ag, PhaseSpace *ps, ScoreCard *ecard,
593 EvaluateForce eval_force = EvaluateForce::NO, int system_index = 0);
594
595double evaluateCmapTerms(const AtomGraph *ag, PhaseSpace *ps, ScoreCard *ecard,
596 EvaluateForce eval_force = EvaluateForce::NO, int system_index = 0);
597
598double evaluateCmapTerms(const ValenceKit<double> vk, const CoordinateFrameReader cfr,
599 ScoreCard *ecard, int system_index = 0);
600
601double evaluateCmapTerms(const ValenceKit<double> vk, const CoordinateFrameWriter &cfw,
602 ScoreCard *ecard, int system_index = 0);
603
604double evaluateCmapTerms(const AtomGraph &ag, const CoordinateFrame &cf, ScoreCard *ecard,
605 int system_index = 0);
606
607double evaluateCmapTerms(const AtomGraph *ag, const CoordinateFrame &cf, ScoreCard *ecard,
608 int system_index = 0);
609
610template <typename Tcoord, typename Tcalc>
611double evaluateCmapTerms(const ValenceKit<Tcalc> vk, const CoordinateSeriesReader<Tcoord> csr,
612 ScoreCard *ecard, int system_index = 0, int force_scale_bits = 23);
613
614template <typename Tcoord, typename Tcalc>
615double evaluateCmapTerms(const ValenceKit<Tcalc> vk, const CoordinateSeriesWriter<Tcoord> csr,
616 ScoreCard *ecard, int system_index = 0, int force_scale_bits = 23);
618
652template <typename Tcoord, typename Tforce, typename Tcalc>
653Vec2<Tcalc> evalAttenuated14Pair(int i_atom, int l_atom, int attn_idx, Tcalc coulomb_constant,
654 const Tcalc* charges, const int* lj_param_idx,
655 const Tcalc* attn14_elec_factors,
656 const Tcalc* attn14_vdw_factors, const Tcalc* lja_14_coeff,
657 const Tcalc* ljb_14_coeff, const Tcalc* lj_14_sigma,
658 int ljtab_offset, int n_lj_types, const Tcoord* xcrd,
659 const Tcoord* ycrd, const Tcoord* zcrd, const double* umat,
660 const double* invu, UnitCellType unit_cell, Tforce* xfrc,
661 Tforce* yfrc, Tforce* zfrc, EvaluateForce eval_elec_force,
662 EvaluateForce eval_vdw_force, Tcalc inv_gpos_factor = 1.0,
663 Tcalc force_factor = 1.0, Tcalc clash_minimum_distance = 0.0,
664 Tcalc clash_ratio = 0.0, const int* xcrd_ovrf = nullptr,
665 const int* ycrd_ovrf = nullptr,
666 const int* zcrd_ovrf = nullptr, int* xfrc_ovrf = nullptr,
667 int* yfrc_ovrf = nullptr, int* zfrc_ovrf = nullptr);
668
669template <typename Tcoord, typename Tforce, typename Tcalc>
670Vec2<Tcalc> evalAttenuated14Pair(int i_atom, int l_atom, int attn_idx, Tcalc coulomb_constant,
671 const Tcalc* charges, const int* lj_param_idx,
672 const Tcalc* attn14_elec_factors,
673 const Tcalc* attn14_vdw_factors, const Tcalc* lja_14_coeff,
674 const Tcalc* ljb_14_coeff, const Tcalc* lj_14_sigma,
675 int n_lj_types, const Tcoord* xcrd, const Tcoord* ycrd,
676 const Tcoord* zcrd, const double* umat, const double* invu,
677 UnitCellType unit_cell, Tforce* xfrc, Tforce* yfrc,
678 Tforce* zfrc, EvaluateForce eval_elec_force,
679 EvaluateForce eval_vdw_force, Tcalc inv_gpos_factor = 1.0,
680 Tcalc force_factor = 1.0, Tcalc clash_minimum_distance = 0.0,
681 Tcalc clash_ratio = 0.0, const int* xcrd_ovrf = nullptr,
682 const int* ycrd_ovrf = nullptr,
683 const int* zcrd_ovrf = nullptr, int* xfrc_ovrf = nullptr,
684 int* yfrc_ovrf = nullptr, int* zfrc_ovrf = nullptr);
686
721template <typename Tcoord, typename Tforce, typename Tcalc>
722double2 evaluateAttenuated14Terms(const ValenceKit<Tcalc> vk, const NonbondedKit<Tcalc> nbk,
723 const Tcoord* xcrd, const Tcoord* ycrd, const Tcoord* zcrd,
724 const double* umat, const double* invu,
725 UnitCellType unit_cell, Tforce* xfrc, Tforce* yfrc,
726 Tforce* zfrc, ScoreCard *ecard,
727 EvaluateForce eval_elec_force = EvaluateForce::NO,
728 EvaluateForce eval_vdw_force = EvaluateForce::NO,
729 int system_index = 0, Tcalc inv_gpos_factor = 1.0,
730 Tcalc force_factor = 1.0, Tcalc clash_minimum_distance = 0.0,
731 Tcalc clash_ratio = 0.0);
732
733double2 evaluateAttenuated14Terms(const ValenceKit<double> vk, const NonbondedKit<double> nbk,
734 PhaseSpaceWriter psw, ScoreCard *ecard,
735 EvaluateForce eval_elec_force = EvaluateForce::NO,
736 EvaluateForce eval_vdw_force = EvaluateForce::NO,
737 int system_index = 0, double clash_minimum_distance = 0.0,
738 double clash_ratio = 0.0);
739
740double2 evaluateAttenuated14Terms(const AtomGraph &ag, PhaseSpace *ps, ScoreCard *ecard,
741 EvaluateForce eval_elec_force = EvaluateForce::NO,
742 EvaluateForce eval_vdw_force = EvaluateForce::NO,
743 int system_index = 0, double clash_minimum_distance = 0.0,
744 double clash_ratio = 0.0);
745
746double2 evaluateAttenuated14Terms(const AtomGraph *ag, PhaseSpace *ps, ScoreCard *ecard,
747 EvaluateForce eval_elec_force = EvaluateForce::NO,
748 EvaluateForce eval_vdw_force = EvaluateForce::NO,
749 int system_index = 0, double clash_minimum_distance = 0.0,
750 double clash_ratio = 0.0);
751
752double2 evaluateAttenuated14Terms(const ValenceKit<double> vk, const NonbondedKit<double> nbk,
753 const CoordinateFrameReader cfr, ScoreCard *ecard,
754 int system_index = 0, double clash_minimum_distance = 0.0,
755 double clash_ratio = 0.0);
756
757double2 evaluateAttenuated14Terms(const ValenceKit<double> vk, const NonbondedKit<double> nbk,
758 const CoordinateFrameWriter &cfw, ScoreCard *ecard,
759 int system_index = 0, double clash_minimum_distance = 0.0,
760 double clash_ratio = 0.0);
761
762double2 evaluateAttenuated14Terms(const AtomGraph &ag, const CoordinateFrame &cf,
763 ScoreCard *ecard, int system_index = 0,
764 double clash_minimum_distance = 0.0, double clash_ratio = 0.0);
765
766double2 evaluateAttenuated14Terms(const AtomGraph *ag, const CoordinateFrame &cf,
767 ScoreCard *ecard, int system_index = 0,
768 double clash_minimum_distance = 0.0, double clash_ratio = 0.0);
769
770template <typename Tcoord, typename Tcalc>
771double2 evaluateAttenuated14Terms(const ValenceKit<Tcalc> vk,
773 int system_index = 0, int force_scale_bits = 23,
774 Tcalc clash_minimum_distance = 0.0, Tcalc clash_ratio = 0.0);
775
776template <typename Tcoord, typename Tcalc>
777double2 evaluateAttenuated14Terms(const ValenceKit<Tcalc> vk,
779 int system_index = 0, int force_scale_bits = 23,
780 Tcalc clash_minimum_distance = 0.0, Tcalc clash_ratio = 0.0);
782
809template <typename Tcoord, typename Tforce, typename Tcalc, typename Tcalc2, typename Tcalc4>
810Tcalc evalPosnRestraint(int p_atom, int step_number, int init_step, int finl_step,
811 const Tcalc2 init_xy, const Tcalc2 finl_xy, Tcalc init_z, Tcalc finl_z,
812 const Tcalc2 init_keq, const Tcalc2 finl_keq, const Tcalc4 init_r,
813 const Tcalc4 finl_r, const Tcoord* xcrd, const Tcoord* ycrd,
814 const Tcoord* zcrd, const double* umat, const double* invu,
815 UnitCellType unit_cell, Tforce* xfrc, Tforce* yfrc, Tforce* zfrc,
816 EvaluateForce eval_force, Tcalc inv_gpos_factor = 1.0,
817 Tcalc force_factor = 1.0, const int* xcrd_ovrf = nullptr,
818 const int* ycrd_ovrf = nullptr, const int* zcrd_ovrf = nullptr,
819 int* xfrc_ovrf = nullptr, int* yfrc_ovrf = nullptr,
820 int* zfrc_ovrf = nullptr);
821
826template <typename Tcoord, typename Tforce, typename Tcalc, typename Tcalc2, typename Tcalc4>
827Tcalc evalBondRestraint(int i_atom, int j_atom, int step_number, int init_step, int finl_step,
828 const Tcalc2 init_keq, const Tcalc2 finl_keq, const Tcalc4 init_r,
829 const Tcalc4 finl_r, const Tcoord* xcrd, const Tcoord* ycrd,
830 const Tcoord* zcrd, const double* umat, const double* invu,
831 UnitCellType unit_cell, Tforce* xfrc, Tforce* yfrc, Tforce* zfrc,
832 EvaluateForce eval_force, Tcalc inv_gpos_factor = 1.0,
833 Tcalc force_factor = 1.0, const int* xcrd_ovrf = nullptr,
834 const int* ycrd_ovrf = nullptr, const int* zcrd_ovrf = nullptr,
835 int* xfrc_ovrf = nullptr, int* yfrc_ovrf = nullptr,
836 int* zfrc_ovrf = nullptr);
837
842template <typename Tcoord, typename Tforce, typename Tcalc, typename Tcalc2, typename Tcalc4>
843Tcalc evalAnglRestraint(int i_atom, int j_atom, int k_atom, int step_number, const int init_step,
844 const int finl_step, const Tcalc2 init_keq, const Tcalc2 finl_keq,
845 const Tcalc4 init_r, const Tcalc4 finl_r, const Tcoord* xcrd,
846 const Tcoord* ycrd, const Tcoord* zcrd, const double* umat,
847 const double* invu, UnitCellType unit_cell, Tforce* xfrc, Tforce* yfrc,
848 Tforce* zfrc, EvaluateForce eval_force, Tcalc inv_gpos_factor = 1.0,
849 Tcalc force_factor = 1.0, const int* xcrd_ovrf = nullptr,
850 const int* ycrd_ovrf = nullptr, const int* zcrd_ovrf = nullptr,
851 int* xfrc_ovrf = nullptr, int* yfrc_ovrf = nullptr,
852 int* zfrc_ovrf = nullptr);
853
858template <typename Tcoord, typename Tforce, typename Tcalc, typename Tcalc2, typename Tcalc4>
859Tcalc evalDiheRestraint(int i_atom, int j_atom, int k_atom, int l_atom, int step_number,
860 const int init_step, const int finl_step, const Tcalc2 init_keq,
861 const Tcalc2 finl_keq, const Tcalc4 init_r, const Tcalc4 finl_r,
862 const Tcoord* xcrd, const Tcoord* ycrd, const Tcoord* zcrd,
863 const double* umat, const double* invu, UnitCellType unit_cell,
864 Tforce* xfrc, Tforce* yfrc, Tforce* zfrc, EvaluateForce eval_force,
865 Tcalc inv_gpos_factor = 1.0, Tcalc force_factor = 1.0,
866 const int* xcrd_ovrf = nullptr, const int* ycrd_ovrf = nullptr,
867 const int* zcrd_ovrf = nullptr, int* xfrc_ovrf = nullptr,
868 int* yfrc_ovrf = nullptr, int* zfrc_ovrf = nullptr);
869
893template <typename Tcoord, typename Tforce, typename Tcalc, typename Tcalc2, typename Tcalc4>
894double evaluateRestraints(const RestraintKit<Tcalc, Tcalc2, Tcalc4> rar, const Tcoord* xcrd,
895 const Tcoord* ycrd, const Tcoord* zcrd, const double* umat,
896 const double* invu, const UnitCellType unit_cell, Tforce* xfrc,
897 Tforce* yfrc, Tforce* zfrc, ScoreCard *ecard,
898 EvaluateForce eval_force = EvaluateForce::NO, int system_index = 0,
899 int step_number = 0, Tcalc inv_gpos_factor = 1.0,
900 Tcalc force_factor = 1.0);
901
902double evaluateRestraints(const RestraintKit<double, double2, double4> rar,
903 PhaseSpaceWriter psw, ScoreCard *ecard,
904 EvaluateForce eval_force = EvaluateForce::NO, int system_index = 0,
905 int step_number = 0);
906
907double evaluateRestraints(const RestraintApparatus &ra, PhaseSpace *ps, ScoreCard *ecard,
908 EvaluateForce eval_force = EvaluateForce::NO, int system_index = 0,
909 int step_number = 0);
910
911double evaluateRestraints(const RestraintApparatus *ra, PhaseSpace *ps, ScoreCard *ecard,
912 EvaluateForce eval_force = EvaluateForce::NO, int system_index = 0,
913 int step_number = 0);
914
915double evaluateRestraints(const RestraintKit<double, double2, double4> rar,
916 const CoordinateFrameReader cfr, ScoreCard *ecard, int system_index = 0,
917 int step_number = 0);
918
919double evaluateRestraints(const RestraintKit<double, double2, double4> rar,
920 const CoordinateFrameWriter &cfw, ScoreCard *ecard, int system_index = 0,
921 int step_number = 0);
922
923double evaluateRestraints(const RestraintApparatus &ra, const CoordinateFrameReader cfr,
924 ScoreCard *ecard, int system_index = 0, int step_number = 0);
925
926double evaluateRestraints(const RestraintApparatus *ra, const CoordinateFrameReader cfr,
927 ScoreCard *ecard, int system_index = 0, int step_number = 0);
928
929template <typename Tcoord, typename Tcalc, typename Tcalc2, typename Tcalc4>
930double evaluateRestraints(const RestraintKit<Tcalc, Tcalc2, Tcalc4> rar,
932 int system_index = 0, int step_number = 0, int force_scale_bits = 23);
933
934template <typename Tcoord, typename Tcalc, typename Tcalc2, typename Tcalc4>
935double evaluateRestraints(const RestraintKit<Tcalc, Tcalc2, Tcalc4> rar,
937 int system_index = 0, int step_number = 0, int force_scale_bits = 23);
939
940} // namespace energy
941} // namespace stormm
942
943#include "valence_potential.tpp"
944
945#endif
Track the energy components of a collection of systems in an HPC-capable array. This object uses the ...
Definition scorecard.h:101
A collection of all restraints pertaining to a specific topology for the purposes of one simulation,...
Definition restraint_apparatus.h:109
A struct to hold information relating to an Amber topology. This struct's member functions are limite...
Definition atomgraph.h:50
Store the coordinates and box information for a frame, only. This abridged struct can serve when the ...
Definition coordinateframe.h:111
An object to complement a topology and hold positions, velocities, and forces of all particles in a s...
Definition phasespace.h:141
Double-precision reader abstract for the RestraintApparatus class. Restraints are very detailed thing...
Definition restraint_apparatus.h:28
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 C-style pointers for the elements of a read-only CoordinateFrame object.
Definition coordinateframe.h:65
Collect C-style pointers for the elements of a writable CoordinateFrame object.
Definition coordinateframe.h:30
Collect C-style pointers and critical constants for a read-only CoordinateSeries object.
Definition coordinate_series.h:96
Collect C-style pointers and critical constants for a writeable CoordinateSeries object.
Definition coordinate_series.h:66
Collect constants and pointers to the components of a modifiable PhaseSpace object.
Definition phasespace.h:31