STORMM Source Documentation
Loading...
Searching...
No Matches
map_density.h
1// -*-c++-*-
2#ifndef STORMM_MAP_DENSITY_H
3#define STORMM_MAP_DENSITY_H
4
5#include "copyright.h"
6#include "Accelerator/core_kernel_manager.h"
7#include "DataTypes/common_types.h"
8#include "DataTypes/stormm_vector_types.h"
9#include "Math/bspline.h"
10#include "Math/math_enumerators.h"
11#include "Math/rounding.h"
12#include "MolecularMechanics/mm_controls.h"
13#include "Numerics/split_fixed_precision.h"
14#include "Structure/local_arrangement.h"
15#include "Structure/structure_enumerators.h"
16#include "Synthesis/atomgraph_synthesis.h"
17#include "Synthesis/synthesis_abstracts.h"
18#include "cellgrid.h"
19#include "energy_enumerators.h"
20#include "pmigrid.h"
21
22namespace stormm {
23namespace energy {
24
25using card::CoreKlManager;
26using data_types::isFloatingPointScalarType;
27using mm::MolecularMechanicsControls;
28using mm::MMControlKit;
29using numerics::hostDoubleToInt63;
30using numerics::hostDoubleToInt95;
31using stmath::bSpline;
32using stmath::bSplineNoUnity;
33using stmath::BSplineUnity;
34using stmath::roundUp;
35using structure::imageCoordinates;
36using structure::ImagingMethod;
37using synthesis::AtomGraphSynthesis;
38using synthesis::SyNonbondedKit;
39using topology::AtomGraph;
40using topology::NonbondedKit;
41using trajectory::CoordinateFrame;
42using trajectory::CoordinateFrameReader;
43
49void matchThemes(NonbondedTheme pm_theme, NonbondedTheme cg_theme);
50
73template <typename Tcalc, typename Tgrid>
74void particleAlignment(Tcalc x, Tcalc y, Tcalc z, Tcalc inv_lpos_scale, const Tcalc* umat,
75 int cg_mesh_ticks, int cell_i, int cell_j, int cell_k, Tgrid *a_cof,
76 Tgrid *b_cof, Tgrid *c_cof, int bspline_order, int *grid_a, int *grid_b,
77 int *grid_c);
78
105template <typename Tcalc, typename Tgrid>
106void spreadDensity(const Tcalc* a_cof, const Tcalc* b_cof, const Tcalc* c_cof, int bspline_order,
107 int grid_root_a, int grid_root_b, int grid_root_c, const uint4 grid_dims,
108 FFTMode fft_staging, Tgrid* grid_data, int* overflow = nullptr,
109 Tcalc mesh_scaling_factor = 1.0);
110
129template <typename T, typename Tacc, typename Tcalc, typename Tcalc2, typename T4>
130void accumulateCellDensity(PMIGridWriter *pm_wrt, int sysid, int cell_i, int cell_j, int cell_k,
132 const SyNonbondedKit<Tcalc, Tcalc2> &synbk);
133
134template <typename T, typename Tacc, typename Tcalc, typename Tcalc2, typename T4>
135void accumulateCellDensity(PMIGridAccumulator *pm_acc, int sysid, int cell_i, int cell_j,
136 int cell_k, const CellGridReader<T, Tacc, Tcalc, T4> &cgr,
137 const SyNonbondedKit<Tcalc, Tcalc2> &synbk);
139
170template <typename T, typename Tacc, typename Tcalc, typename T4>
171void mapDensity(PMIGrid *pm, const CellGrid<T, Tacc, Tcalc, T4> *cg,
172 const AtomGraphSynthesis *poly_ag);
173
174template <typename T, typename Tacc, typename Tcalc, typename T4>
175void mapDensity(PMIGrid *pm, const CellGrid<T, Tacc, Tcalc, T4> &cg,
176 const AtomGraphSynthesis &poly_ag);
177
178#ifdef STORMM_USE_HPC
179void mapDensity(PMIGridWriter *pm_wrt, PMIGridAccumulator *pm_acc, MMControlKit<double> *ctrl,
180 const CellGridReader<void, void, void, void> &v_cgr, size_t cg_tmat,
181 const SyNonbondedKit<double, double2> &synbk, int block_count, const int2 lp,
182 QMapMethod approach, PMIGrid *pm);
183
184void mapDensity(PMIGridWriter *pm_wrt, PMIGridAccumulator *pm_acc, MMControlKit<float> *ctrl,
185 const CellGridReader<void, void, void, void> &v_cgr, size_t cg_tmat,
186 const SyNonbondedKit<float, float2> &synbk, int block_count, const int2 lp,
187 QMapMethod approach, PMIGrid *pm);
188
189template <typename T, typename Tacc, typename Tcalc, typename T4>
190void mapDensity(PMIGrid *pm, MolecularMechanicsControls *mm_ctrl,
191 const CellGrid<T, Tacc, Tcalc, T4> *cg, const AtomGraphSynthesis *poly_ag,
192 const CoreKlManager &launcher, QMapMethod approach);
193#endif
194
195void mapDensity(PMIGrid *pm, const AtomGraphSynthesis *poly_ag);
196
197void mapDensity(PMIGrid *pm, const AtomGraphSynthesis &poly_ag);
198
199template <typename Tcalc>
200std::vector<Tcalc> mapDensity(const CoordinateFrameReader &cfr, const NonbondedKit<Tcalc> &nbk,
201 NonbondedTheme theme, FFTMode fft_staging, int grid_dim_a,
202 int grid_dim_b, int grid_dim_c, int order = default_bspline_order,
203 BSplineUnity unification = BSplineUnity::CENTER_FILL);
204
205std::vector<double> mapDensity(const CoordinateFrame *cf, const AtomGraph *ag,
206 NonbondedTheme theme, FFTMode fft_staging, int grid_dim_a = -1,
207 int grid_dim_b = -1, int grid_dim_c = -1,
208 int order = default_bspline_order);
209
210std::vector<double> mapDensity(const CoordinateFrame &cf, const AtomGraph &ag,
211 NonbondedTheme theme, FFTMode fft_staging, int grid_dim_a = -1,
212 int grid_dim_b = -1, int grid_dim_c = -1,
213 int order = default_bspline_order);
215
231template <typename T, typename T4>
232void unrollMapDensityCall(PMIGrid *pm, size_t cg_tacc, size_t cg_tcalc,
233 const AtomGraphSynthesis *poly_ag);
234
235template <typename T, typename Tacc, typename T4>
236void unrollMapDensityCall(PMIGrid *pm, size_t cg_tcalc, const AtomGraphSynthesis *poly_ag);
238
239#ifdef STORMM_USE_HPC
272void launchShrAccDensityKernel(PMIGridWriter *pm_wrt, bool overflow, MMControlKit<double> *ctrl,
273 const CellGridReader<void, void, void, void> &v_cgr, size_t cg_tmat,
274 const SyNonbondedKit<double, double2> &synbk, const int2 lp);
275
276void launchShrAccDensityKernel(PMIGridWriter *pm_wrt, bool overflow, MMControlKit<float> *ctrl,
277 const CellGridReader<void, void, void, void> &v_cgr, size_t cg_tmat,
278 const SyNonbondedKit<float, float2> &synbk, const int2 lp);
279
280void launchGenPrpDensityKernel(PMIGridAccumulator *pm_acc,
281 const CellGridReader<void, void, void, void> &v_cgr, size_t cg_tmat,
282 const SyNonbondedKit<double, double2> &synbk, const int2 lp);
283
284void launchGenPrpDensityKernel(PMIGridAccumulator *pm_acc,
285 const CellGridReader<void, void, void, void> &v_cgr, size_t cg_tmat,
286 const SyNonbondedKit<float, float2> &synbk, const int2 lp);
288#endif
289
290} // namespace energy
291} // namespace stormm
292
293#include "map_density.tpp"
294
295#endif
A class to guide the implementation of GPU kernels, with selected thread counts per block and block c...
Definition core_kernel_manager.h:56
An object to manage the spatial decomposition of a system of particles. The general strategy is to ar...
Definition cellgrid.h:562
An object to hold a series of meshes for accumulating density from condensed-phase molecular systems ...
Definition pmigrid.h:271
A collection of contol data for molecular mechanics simulations, conveying the current step number,...
Definition mm_controls.h:100
A collection of one or more AtomGraph objects, with similar components arranged in contiguous arrays ...
Definition atomgraph_synthesis.h:55
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
Read-only abstract for the CellGrid object. This is unused in typical MD applications,...
Definition cellgrid.h:296
A writeable abstract which reinterprets some pointers to enable split fixed-precision accumulation wi...
Definition pmigrid.h:163
A writeable abstract for the Particle-Mesh Interaction Grid class.
Definition pmigrid.h:74
The C-style, always writeable abstract for the MolecularMechanicsControls object. To not be able to m...
Definition mm_controls.h:52
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 C-style pointers for the elements of a read-only CoordinateFrame object.
Definition coordinateframe.h:65