STORMM Source Documentation
Loading...
Searching...
No Matches
mesh_rulers.h
1// -*-c++-*-
2#ifndef STORMM_MESH_COMPONENTS_H
3#define STORMM_MESH_COMPONENTS_H
4
5#include "copyright.h"
6#include "Accelerator/hybrid.h"
7#include "DataTypes/stormm_vector_types.h"
8#include "Numerics/split_fixed_precision.h"
9#include "local_arrangement.h"
10#include "mesh_parameters.h"
11
12namespace stormm {
13namespace structure {
14
15using card::Hybrid;
16using card::HybridTargetLevel;
17#ifndef STORMM_USE_HPC
18using data_types::double3;
19#endif
20
22
28 MeshRulerKit(const llint* avec_x_in, const llint* avec_y_in, const llint* avec_z_in,
29 const llint* bvec_x_in, const llint* bvec_y_in, const llint* bvec_z_in,
30 const llint* cvec_x_in, const llint* cvec_y_in, const llint* cvec_z_in,
31 const llint* avec_abs_x_in, const llint* avec_abs_y_in, const llint* avec_abs_z_in,
32 const int* avec_x_ovrf_in, const int* avec_y_ovrf_in, const int* avec_z_ovrf_in,
33 const int* bvec_x_ovrf_in, const int* bvec_y_ovrf_in, const int* bvec_z_ovrf_in,
34 const int* cvec_x_ovrf_in, const int* cvec_y_ovrf_in, const int* cvec_z_ovrf_in,
35 const int* avec_abs_x_ovrf_in, const int* avec_abs_y_ovrf_in,
36 const int* avec_abs_z_ovrf_in);
37
38 // As with other abstracts, the default copy and move constructors are acceptable, but the copy
39 // and move assignment operators are implicitly deleted because of const member variables.
41 MeshRulerKit(const MeshRulerKit &original) = default;
42 MeshRulerKit(MeshRulerKit &&original) = default;
44
45 // Public, const member variables for the coordinates of tick marks along each axis
46 const llint* avec_x;
47 const llint* avec_y;
48 const llint* avec_z;
49 const llint* bvec_x;
50 const llint* bvec_y;
51 const llint* bvec_z;
52 const llint* cvec_x;
53 const llint* cvec_y;
54 const llint* cvec_z;
55 const llint* avec_abs_x;
56 const llint* avec_abs_y;
57 const llint* avec_abs_z;
58 const int* avec_x_ovrf;
59 const int* avec_y_ovrf;
60 const int* avec_z_ovrf;
61 const int* bvec_x_ovrf;
62 const int* bvec_y_ovrf;
63 const int* bvec_z_ovrf;
64 const int* cvec_x_ovrf;
65 const int* cvec_y_ovrf;
66 const int* cvec_z_ovrf;
67 const int* avec_abs_x_ovrf;
68 const int* avec_abs_y_ovrf;
69 const int* avec_abs_z_ovrf;
70};
71
76public:
77
80
87 MeshRulers(const MeshRulers &original);
88 MeshRulers(MeshRulers &&original);
89 MeshRulers& operator=(const MeshRulers &original);
90 MeshRulers& operator=(MeshRulers &&original);
92
94 double3 getMeshOrigin() const;
95
101 double3 getRealLocation(const double3 mesh_loc) const;
102
108 double3 getMeshLocation(const double3 real_loc) const;
109
114 const MeshRulerKit data(HybridTargetLevel tier = HybridTargetLevel::HOST) const;
115
116#ifdef STORMM_USE_HPC
118 void upload();
119
121 void download();
122
123# ifdef STORMM_USE_CUDA
126 const MeshRulerKit deviceViewToHostData() const;
127# endif
128#endif
129
130private:
131
139 Hybrid<llint> a_line_x; //
140 Hybrid<llint> a_line_y; // Positions of "a" vector tick marks relative to the mesh origin
141 Hybrid<llint> a_line_z; //
142 Hybrid<llint> b_line_x; //
143 Hybrid<llint> b_line_y; // Positions of "b" vector tick marks relative to the mesh origin
144 Hybrid<llint> b_line_z; //
145 Hybrid<llint> c_line_x; //
146 Hybrid<llint> c_line_y; // Positions of "c" vector tick marks relative to the mesh origin
147 Hybrid<llint> c_line_z; //
148 Hybrid<llint> a_abs_line_x; //
149 Hybrid<llint> a_abs_line_y; // Absolute positions of the "a" vector tick marks
150 Hybrid<llint> a_abs_line_z; //
152
156 Hybrid<int> a_line_x_overflow; // Overflow bits for positions of the "a" vector tick marks
157 Hybrid<int> a_line_y_overflow; // relative to the mesh origin. These engage when the mesh
158 Hybrid<int> a_line_z_overflow; // serves double-precision coefficients and calculatons.
159 Hybrid<int> b_line_x_overflow; //
160 Hybrid<int> b_line_y_overflow; // Overflow bits for "b" vector tick mark relative positions
161 Hybrid<int> b_line_z_overflow; //
162 Hybrid<int> c_line_x_overflow; //
163 Hybrid<int> c_line_y_overflow; // Overflow bits for "c" vector tick mark relative positions
164 Hybrid<int> c_line_z_overflow; //
165 Hybrid<int> a_abs_line_x_overflow; //
166 Hybrid<int> a_abs_line_y_overflow; // Overflow bits for "a" vector tick mark absolute positions
167 Hybrid<int> a_abs_line_z_overflow; //
169
171 Hybrid<int> int_data;
172
174 Hybrid<llint> llint_data;
175
179 MeshParameters *mps_pointer;
180
182 void rebasePointers();
183};
184
185} // namespace structure
186} // namespace stormm
187
188#endif
An evolution of GpuBuffer in pmemd.cuda, the Composite array has elements that are accessible from ei...
Definition hybrid.h:202
Encode the critical dimensions of a regular, rectilinear mesh. The locations of mesh points as well a...
Definition mesh_parameters.h:121
double3 getMeshLocation(const double3 real_loc) const
Get the location of a point on the mesh based on its coordinates in Cartesian space....
Definition mesh_rulers.cpp:334
const MeshRulerKit data(HybridTargetLevel tier=HybridTargetLevel::HOST) const
Get a collection of all relevant pointers for memory on either the CPU host or the GPU device....
Definition mesh_rulers.cpp:365
double3 getRealLocation(const double3 mesh_loc) const
Get the location of a point in Cartesian space based on its coordinates on the mesh....
Definition mesh_rulers.cpp:281
MeshRulers(const MeshParameters &mps=MeshParameters())
The constructor takes a full collection of mesh parameters.
Definition mesh_rulers.cpp:40
double3 getMeshOrigin() const
Get the origin from the rulers themselves.
Definition mesh_rulers.cpp:270
Definition stormm_vector_types.h:117
Definition mesh_rulers.h:21
const llint * cvec_y
Relative Cartesian Y coordinates of c axis tick marks.
Definition mesh_rulers.h:53
const llint * avec_abs_y
Absolute Cartesian Y coordinates of a axis tick marks.
Definition mesh_rulers.h:56
const llint * avec_abs_z
Absolute Cartesian Z coordinates of a axis tick marks.
Definition mesh_rulers.h:57
const int * cvec_y_ovrf
Overflow bits for c axis relative Cartesian Y coordinates.
Definition mesh_rulers.h:65
const int * bvec_x_ovrf
Overflow bits for b axis relative Cartesian X coordinates.
Definition mesh_rulers.h:61
const int * avec_z_ovrf
Overflow bits for a axis relative Cartesian Z coordinates.
Definition mesh_rulers.h:60
const int * avec_abs_y_ovrf
Overflow bits for Cartesian Y absolute a axis coordinates.
Definition mesh_rulers.h:68
const int * avec_abs_z_ovrf
Overflow bits for Cartesian Z absolute a axis coordinates.
Definition mesh_rulers.h:69
const llint * cvec_z
Relative Cartesian Z coordinates of c axis tick marks.
Definition mesh_rulers.h:54
const int * cvec_z_ovrf
Overflow bits for c axis relative Cartesian Z coordinates.
Definition mesh_rulers.h:66
const int * cvec_x_ovrf
Overflow bits for c axis relative Cartesian X coordinates.
Definition mesh_rulers.h:64
const llint * avec_abs_x
Absolute Cartesian X coordinates of a axis tick marks.
Definition mesh_rulers.h:55
const llint * bvec_y
Relative Cartesian Y coordinates of b axis tick marks.
Definition mesh_rulers.h:50
const llint * bvec_z
Relative Cartesian Z coordinates of b axis tick marks.
Definition mesh_rulers.h:51
const int * avec_x_ovrf
Overflow bits for a axis relative Cartesian X coordinates.
Definition mesh_rulers.h:58
const llint * avec_y
Relative Cartesian Y coordinates of a axis tick marks.
Definition mesh_rulers.h:47
const int * avec_y_ovrf
Overflow bits for a axis relative Cartesian Y coordinates.
Definition mesh_rulers.h:59
const llint * cvec_x
Relative Cartesian X coordinates of c axis tick marks.
Definition mesh_rulers.h:52
const int * bvec_z_ovrf
Overflow bits for b axis relative Cartesian Z coordinates.
Definition mesh_rulers.h:63
const llint * bvec_x
Relative Cartesian X coordinates of b axis tick marks.
Definition mesh_rulers.h:49
const llint * avec_x
Relative Cartesian X coordinates of a axis tick marks.
Definition mesh_rulers.h:46
const int * bvec_y_ovrf
Overflow bits for b axis relative Cartesian Y coordinates.
Definition mesh_rulers.h:62
const int * avec_abs_x_ovrf
Overflow bits for Cartesian X absolute a axis coordinates.
Definition mesh_rulers.h:67
MeshRulerKit(const llint *avec_x_in, const llint *avec_y_in, const llint *avec_z_in, const llint *bvec_x_in, const llint *bvec_y_in, const llint *bvec_z_in, const llint *cvec_x_in, const llint *cvec_y_in, const llint *cvec_z_in, const llint *avec_abs_x_in, const llint *avec_abs_y_in, const llint *avec_abs_z_in, const int *avec_x_ovrf_in, const int *avec_y_ovrf_in, const int *avec_z_ovrf_in, const int *bvec_x_ovrf_in, const int *bvec_y_ovrf_in, const int *bvec_z_ovrf_in, const int *cvec_x_ovrf_in, const int *cvec_y_ovrf_in, const int *cvec_z_ovrf_in, const int *avec_abs_x_ovrf_in, const int *avec_abs_y_ovrf_in, const int *avec_abs_z_ovrf_in)
As with all abstracts, the constructor takes a straight list of inputs corresponding to member variab...
Definition mesh_rulers.cpp:18
const llint * avec_z
Relative Cartesian Z coordinates of a axis tick marks.
Definition mesh_rulers.h:48