STORMM Source Documentation
Loading...
Searching...
No Matches
pme_potential.h
1// -*-c++-*-
2#ifndef STORMM_PME_POTENTIAL_H
3#define STORMM_PME_POTENTIAL_H
4
5#include "copyright.h"
6#include "Constants/symbol_values.h"
7#include "Math/series_ops.h"
8#include "Math/vector_ops.h"
9#include "Structure/local_arrangement.h"
10#include "Synthesis/atomgraph_synthesis.h"
11#include "Synthesis/phasespace_synthesis.h"
12#include "Topology/atomgraph.h"
13#include "Topology/atomgraph_abstracts.h"
14#include "Trajectory/phasespace.h"
15#include "local_exclusionmask.h"
16#include "cellgrid.h"
17#include "energy_enumerators.h"
18#include "pme_util.h"
19#include "scorecard.h"
20
21namespace stormm {
22namespace energy {
23
24using stmath::findBin;
25using stmath::indexingArray;
26using symbols::amber_ancient_bioq;
27using synthesis::AtomGraphSynthesis;
28using synthesis::SyNonbondedKit;
29using topology::AtomGraph;
30using topology::NonbondedKit;
31using trajectory::PhaseSpace;
32using trajectory::PhaseSpaceWriter;
33
43#ifdef STORMM_USE_CUDA
44constexpr uint no_stagger = (0x20 << 24);
45constexpr uint half_stagger = ((0x10 << 24) | (0x10 << 16) | (0x10 << 8));
46constexpr uint quarter_stagger = ((0x8 << 24) | (0x18 << 16) | (0x10 << 8) | 0x8);
47#endif
49
78template <typename Tcalc>
79double2 cellToCellInteractions(PhaseSpaceWriter *psw, const std::vector<int> &cell_list,
80 const std::vector<int> &cell_bounds, int ncell_a, int ncell_b,
81 int ncell_c, int cell_idx_a, int cell_idx_b, int cell_idx_c,
82 int i_pair, int j_pair, int k_pair,
83 const NonbondedKit<Tcalc> &nbk,
84 const LocalExclusionMaskReader &lemr, Tcalc elec_cutoff,
85 Tcalc vdw_cutoff, Tcalc qqew_coeff, Tcalc ljew_coeff,
86 VdwSumMethod vdw_sum = VdwSumMethod::CUTOFF,
87 EvaluateForce eval_frc = EvaluateForce::YES,
88 NonbondedTheme theme = NonbondedTheme::ALL);
89
113template <typename Tcalc>
114double2 evaluateParticleParticleEnergy(PhaseSpaceWriter *psw, const NonbondedKit<Tcalc> &nbk,
115 const LocalExclusionMaskReader &lemr,
116 Tcalc elec_cutoff = static_cast<Tcalc>(default_pme_cutoff),
117 Tcalc vdw_cutoff = static_cast<Tcalc>(default_pme_cutoff),
118 Tcalc qqew_coeff = static_cast<Tcalc>(0.0),
119 Tcalc ljew_coeff = static_cast<Tcalc>(0.0),
120 VdwSumMethod vdw_sum = VdwSumMethod::CUTOFF,
121 EvaluateForce eval_frc = EvaluateForce::YES,
122 NonbondedTheme theme = NonbondedTheme::ALL);
123
124double2 evaluateParticleParticleEnergy(PhaseSpace *ps, const AtomGraph *ag,
125 const LocalExclusionMask &lema,
126 const PrecisionModel prec = PrecisionModel::SINGLE,
127 double elec_cutoff = default_pme_cutoff,
128 double vdw_cutoff = default_pme_cutoff,
129 double qqew_coeff = 0.0, double ljew_coeff = 0.0,
130 VdwSumMethod vdw_sum = VdwSumMethod::CUTOFF,
131 EvaluateForce eval_frc = EvaluateForce::YES,
132 NonbondedTheme theme = NonbondedTheme::ALL);
133
134double2 evaluateParticleParticleEnergy(PhaseSpace *ps, const AtomGraph &ag,
135 const LocalExclusionMask &lema,
136 const PrecisionModel prec = PrecisionModel::SINGLE,
137 double elec_cutoff = default_pme_cutoff,
138 double vdw_cutoff = default_pme_cutoff,
139 double qqew_coeff = 0.0, double ljew_coeff = 0.0,
140 VdwSumMethod vdw_sum = VdwSumMethod::CUTOFF,
141 EvaluateForce eval_frc = EvaluateForce::YES,
142 NonbondedTheme theme = NonbondedTheme::ALL);
143
144template <typename Tcoord, typename Tacc, typename Tcalc, typename Tcalc2, typename Tcoord4>
145void evaluateParticleParticleEnergy(CellGridWriter<void, void, void, void> *cgw_v,
146 ScoreCardWriter *scw, const PsSynthesisReader &poly_psr,
147 const SyNonbondedKit<Tcalc, Tcalc2> &poly_nbk,
148 const LocalExclusionMaskReader &lemr,
149 Tcalc cutoff = static_cast<Tcalc>(default_pme_cutoff),
150 Tcalc ew_coeff = static_cast<Tcalc>(0.0),
151 VdwSumMethod vdw_sum = VdwSumMethod::CUTOFF,
152 EvaluateForce eval_frc = EvaluateForce::YES,
153 NonbondedTheme theme = NonbondedTheme::ALL);
154
155template <typename Tcoord, typename Tacc, typename Tcalc, typename Tcoord4>
156void evaluateParticleParticleEnergy(CellGrid<Tcoord, Tacc, Tcalc, Tcoord4> *cg, ScoreCard *sc,
157 const LocalExclusionMask &lema,
158 Tcalc cutoff = static_cast<Tcalc>(default_pme_cutoff),
159 Tcalc ew_coeff = static_cast<Tcalc>(0.0),
160 VdwSumMethod vdw_sum = VdwSumMethod::CUTOFF,
161 EvaluateForce eval_frc = EvaluateForce::YES,
162 NonbondedTheme theme = NonbondedTheme::ALL);
164
196template <typename Tcoord, typename Tacc, typename Tcalc, typename Tcalc2, typename Tcalc4>
197double2 basicTileInteractions(const std::vector<Tcalc> &a_xpos, const std::vector<Tcalc> &a_ypos,
198 const std::vector<Tcalc> &a_zpos, const std::vector<Tcalc> &b_xpos,
199 const std::vector<Tcalc> &b_ypos, const std::vector<Tcalc> &b_zpos,
200 const std::vector<Tcalc> &scl_aq, const std::vector<Tcalc> &bq,
201 const std::vector<int> &ofs_aljidx, const std::vector<int> &bljidx,
202 const std::vector<int> &top_aidx, const std::vector<int> &top_bidx,
203 const std::vector<uint> &img_aidx, const std::vector<uint> &img_bidx,
204 int system_index, int na, int nb, bool self_interaction,
206 const PsSynthesisReader &poly_psr,
207 const SyNonbondedKit<Tcalc, Tcalc2> &poly_nbk,
208 const LocalExclusionMaskReader &lemr, Tcalc elec_cutsq,
209 Tcalc vdw_cutsq, Tcalc qqew_coeff, Tcalc ljew_coeff,
210 VdwSumMethod vdw_sum, EvaluateForce eval_frc, NonbondedTheme theme);
211
222template <typename Tcoord, typename Tacc, typename Tcalc, typename Tcalc2, typename Tcoord4>
223double2 towerPlatePairInteractions(CellGridWriter<Tcoord, Tacc, Tcalc, Tcoord4> *cgw,
224 const PsSynthesisReader &poly_psr, int system_idx, int cell_idx,
225 const SyNonbondedKit<Tcalc, Tcalc2> &poly_nbk,
226 const LocalExclusionMaskReader &lemr, Tcalc elec_cutoff,
227 Tcalc vdw_cutoff, Tcalc qqew_coeff, Tcalc ljew_coeff,
228 VdwSumMethod vdw_sum, EvaluateForce eval_frc,
229 NonbondedTheme theme);
230
231} // namespace energy
232} // namespace stormm
233
234#include "pme_potential.tpp"
235
236#endif
An object to manage the spatial decomposition of a system of particles. The general strategy is to ar...
Definition cellgrid.h:562
The local exclusion mask is an generalized form of the ForwardExclusionMask, listing all exclusions i...
Definition local_exclusionmask.h:208
Track the energy components of a collection of systems in an HPC-capable array. This object uses the ...
Definition scorecard.h:101
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
Writeable abstract for the CellGrid object, able to receive new coordinates or accumulate forces.
Definition cellgrid.h:137
A lean, read-only abstract for the LocalExclusionMask class.
Definition local_exclusionmask.h:100
Writeable abstract for the ScoreCard object, useful for accumulating energies in many kernels.
Definition scorecard.h:64
The reader for a PhaseSpaceSynthesis object, containing all of the data relevant for propagating dyna...
Definition phasespace_synthesis.h:199
Collect the critical non-bonded parameters and masking information for work unit-based evaluation of ...
Definition synthesis_abstracts.h:181
Information needed for non-bonded real-space calculations. Templating is used as above,...
Definition atomgraph_abstracts.h:287
Collect constants and pointers to the components of a modifiable PhaseSpace object.
Definition phasespace.h:31