STORMM Source Documentation
Loading...
Searching...
No Matches
convolution_manager.h
1// -*-c++-*-
2#ifndef STORMM_CONVOLUTION_MANAGER_H
3#define STORMM_CONVOLUTION_MANAGER_H
4
5#include "copyright.h"
6#include "Accelerator/hybrid.h"
7#include "Constants/behavior.h"
8#include "Synthesis/atomgraph_synthesis.h"
9#include "pmigrid.h"
10
11namespace stormm {
12namespace energy {
13
14using constants::PrecisionModel;
15using card::Hybrid;
16using card::HybridTargetLevel;
17using synthesis::AtomGraphSynthesis;
18
20template <typename T> struct ConvolutionKit {
21
25 ConvolutionKit(int system_count_in, T ew_coeff_in, const int* sys_offsets_in,
26 const T* self_ecorr_in, const T* bmesh_a_in, const T* bmesh_b_in,
27 const T* bmesh_c_in, const T* mval_a_in, const T* mval_b_in, const T* mval_c_in,
28 const T* msval_a_in, const T* msval_b_in, const T* msval_c_in,
29 const T* cmesh_a_in, const T* cmesh_b_in, const T* cmesh_c_in);
30
37 ConvolutionKit(const ConvolutionKit &original) = default;
38 ConvolutionKit(ConvolutionKit &&original) = default;
40
41 const int system_count;
42 const T ew_coeff;
43 const int* sys_offsets;
48 const T* self_ecorr;
50 const T* bmesh_a;
51 const T* bmesh_b;
52 const T* bmesh_c;
53 const T* mval_a;
54 const T* mval_b;
55 const T* mval_c;
56 const T* msval_a;
57 const T* msval_b;
58 const T* msval_c;
59 const T* cmesh_a;
62 const T* cmesh_b;
63 const T* cmesh_c;
64};
65
75public:
76
80 ConvolutionManager(const PMIGrid *pmig_in, const double ewald_coefficient_in);
81 ConvolutionManager(const PMIGrid &pmig_in, const double ewald_coefficient_in);
83
92 ConvolutionManager& operator=(const ConvolutionManager &other);
93 ConvolutionManager& operator=(ConvolutionManager &&other);
95
97 int getSystemCount() const;
98
100 double getEwaldCoefficient() const;
101
104 double getCoulombConstant() const;
105
108
111
115 std::vector<double> getSelfEcorr(PrecisionModel prec) const;
116
117#ifdef STORMM_USE_HPC
119 void upload();
120
122 void download();
123#endif
124
125private:
126 int system_count;
127 double ewald_coefficient;
129 Hybrid<int> system_offsets;
131 Hybrid<double> self_ecorr;
133 Hybrid<double> b_prefactor_a;
135 Hybrid<double> b_prefactor_b;
137 Hybrid<double> b_prefactor_c;
139 Hybrid<double> m_values_a;
141 Hybrid<double> m_values_b;
143 Hybrid<double> m_values_c;
145 Hybrid<double> mshift_values_a;
147 Hybrid<double> mshift_values_b;
149 Hybrid<double> mshift_values_c;
151 Hybrid<double> c_prefactor_a;
155 Hybrid<double> c_prefactor_b;
157 Hybrid<double> c_prefactor_c;
159 Hybrid<double> double_data;
161
162 // Single-precision (32-bit) variants of each of the above arrays
163 Hybrid<float> sp_self_ecorr;
164 Hybrid<float> sp_b_prefactor_a;
165 Hybrid<float> sp_b_prefactor_b;
166 Hybrid<float> sp_b_prefactor_c;
167 Hybrid<float> sp_m_values_a;
168 Hybrid<float> sp_m_values_b;
169 Hybrid<float> sp_m_values_c;
170 Hybrid<float> sp_mshift_values_a;
171 Hybrid<float> sp_mshift_values_b;
172 Hybrid<float> sp_mshift_values_c;
173 Hybrid<float> sp_c_prefactor_a;
177 Hybrid<float> sp_c_prefactor_b;
179 Hybrid<float> sp_c_prefactor_c;
181 Hybrid<float> float_data;
183
184 // Pointers to associated objects
185 PMIGrid *pmig_ptr;
186 AtomGraphSynthesis *poly_ag_ptr;
187
189 void allocate();
190
193 void computeSystemSelfEnergies();
194};
195
196} // namespace energy
197} // namespace stormm
198
199#include "convolution_manager.tpp"
200
201#endif
An evolution of GpuBuffer in pmemd.cuda, the Composite array has elements that are accessible from ei...
Definition hybrid.h:202
ConvolutionManager(const PMIGrid *pmig_in, const double ewald_coefficient_in)
The constructor depends on a PMIGrid and will refer back to the PMIGrid's associated CellGrid object ...
Definition convolution_manager.cpp:15
std::vector< double > getSelfEcorr(PrecisionModel prec) const
Report the self energies of charges for each system, for inspection.
double getCoulombConstant() const
Get the definition of Coulomb's constant used by the convolution. This will return Coulomb's constant...
Definition convolution_manager.cpp:284
int getSystemCount() const
Get the number of systems in the associated synthesis.
const PMIGrid * getPMIGridPointer() const
Get the Particle-Mesh Ewald grid dimensions for any one system.
const AtomGraphSynthesis * getTopologySynthesisPointer() const
Get a pointer to the topology synthesis.
double getEwaldCoefficient() const
Get the Ewald coefficient used by the convolution.
Definition convolution_manager.cpp:279
An object to hold a series of meshes for accumulating density from condensed-phase molecular systems ...
Definition pmigrid.h:271
A collection of one or more AtomGraph objects, with similar components arranged in contiguous arrays ...
Definition atomgraph_synthesis.h:55
const T * msval_a
Shifted "M" values for each system along the unit cell A axis.
Definition convolution_manager.h:56
const T * bmesh_b
"B" mesh prefactors for each system along the unit cell B axis
Definition convolution_manager.h:51
const T * msval_c
Shifted "M" values for each system along the unit cell C axis.
Definition convolution_manager.h:58
const T * cmesh_a
Definition convolution_manager.h:59
const int system_count
The number of indepedent systems.
Definition convolution_manager.h:41
const T ew_coeff
The Ewald coefficien in use by the splitting function.
Definition convolution_manager.h:42
const T * cmesh_c
"C" mesh prefactors for each system along the unit cell C axis.
Definition convolution_manager.h:63
const T * bmesh_c
"B" mesh prefactors for each system along the unit cell C axis
Definition convolution_manager.h:52
const T * self_ecorr
Definition convolution_manager.h:48
const T * cmesh_b
"C" mesh prefactors for each system along the unit cell B axis.
Definition convolution_manager.h:62
const T * mval_c
"M" values for each system along the unit cell C axis
Definition convolution_manager.h:55
const int * sys_offsets
Definition convolution_manager.h:43
const T * bmesh_a
"B" mesh prefactors for each system along the unit cell A axis
Definition convolution_manager.h:50
ConvolutionKit(int system_count_in, T ew_coeff_in, const int *sys_offsets_in, const T *self_ecorr_in, const T *bmesh_a_in, const T *bmesh_b_in, const T *bmesh_c_in, const T *mval_a_in, const T *mval_b_in, const T *mval_c_in, const T *msval_a_in, const T *msval_b_in, const T *msval_c_in, const T *cmesh_a_in, const T *cmesh_b_in, const T *cmesh_c_in)
As with other abstracts, the convolution kit is constructed with a series of values for each associat...
const T * mval_a
"M" values for each system along the unit cell A axis
Definition convolution_manager.h:53
const T * msval_b
Shifted "M" values for each system along the unit cell B axis.
Definition convolution_manager.h:57
ConvolutionKit(const ConvolutionKit &original)=default
Like other abstracts, the presence of const members implicitly forbids the copy and move assignment o...
const T * mval_b
"M" values for each system along the unit cell B axis
Definition convolution_manager.h:54