STORMM Source Documentation
Loading...
Searching...
No Matches
nml_mesh.h
1// -*-c++-*-
2#ifndef STORMM_NML_MESH_H
3#define STORMM_NML_MESH_H
4
5#include <string>
6#include <vector>
7#include "copyright.h"
8#include "Constants/behavior.h"
9#include "Constants/symbol_values.h"
10#include "Parsing/textfile.h"
11#include "Potential/energy_enumerators.h"
12#include "Structure/structure_enumerators.h"
13#include "namelist_element.h"
14#include "namelist_emulator.h"
15
16namespace stormm {
17namespace namelist {
18
19using constants::CartesianDimension;
20using constants::ExceptionResponse;
21using constants::UnitCellAxis;
22using energy::NonbondedPotential;
23using parse::TextFile;
24using parse::WrapTextSearch;
25using structure::BoundaryCondition;
26using structure::GridDetail;
27using structure::MeshPosition;
28using structure::RMSDMethod;
29
31constexpr int default_mesh_grid_dim = -1;
32constexpr int default_mesh_density_averaging_order = 8;
33constexpr double default_mesh_grid_angle = 0.5 * symbols::pi;
34constexpr double default_mesh_grid_origin = 0.0;
35constexpr double default_mesh_grid_spacing = 1.0;
36constexpr double default_mesh_elec_damping_range = 0.5;
37constexpr double default_mesh_vdw_damping_ratio = 0.8;
38constexpr char default_mesh_grid_detail[] = "occlusion";
39constexpr char default_mesh_grid_potential[] = "clash";
40constexpr char default_mesh_grid_boundary[] = "isolated";
41
46public:
47
59 MeshControls(ExceptionResponse policy_in = ExceptionResponse::DIE);
60
61 MeshControls(const TextFile &tf, int *start_line, bool *found_nml,
62 ExceptionResponse policy_in = ExceptionResponse::DIE,
63 WrapTextSearch wrap = WrapTextSearch::NO);
65
69 MeshControls(const MeshControls &original) = default;
70 MeshControls(MeshControls &&original) = default;
71 MeshControls& operator=(const MeshControls &original) = default;
72 MeshControls& operator=(MeshControls &&original) = default;
74
85 int getAxisElementCount(UnitCellAxis dim) const;
86 int getAxisElementCount(CartesianDimension dim) const;
88
92 double getSpacing(UnitCellAxis dim) const;
93 double getSpacing(CartesianDimension dim) const;
95
98 double getAlpha() const;
99
101 double getBeta() const;
102
104 double getGamma() const;
105
107 double getOrigin(CartesianDimension dim) const;
108
118 double getBufferWidth(UnitCellAxis dim) const;
119 double getBufferWidth(CartesianDimension dim) const;
121
129 GridDetail getDetail() const;
130
135 NonbondedPotential getPotential() const;
136
138 BoundaryCondition getBoundaries() const;
139
141 MeshPosition getPosition() const;
142
145 int getScalingBits() const;
146
149 double getElecClashDistance() const;
150
154 double getVdwClashRatio() const;
155
157 const NamelistEmulator& getTranscript() const;
158
168 void setElementCount(int mesh_points_in, UnitCellAxis dim);
169 void setElementCount(int mesh_points_in, CartesianDimension dim);
171
178 void setSpacing(double mesh_spacing_in, UnitCellAxis dim);
179 void setSpacing(double mesh_spacing_in, CartesianDimension dim);
181
185 void setAlphaAngle(double alpha_in);
186
190 void setBetaAngle(double beta_in);
191
195 void setGammaAngle(double gamma_in);
196
201 void setOrigin(double mesh_origin_in, CartesianDimension dim);
202
213 void setBufferWidth(double buffer_width_in);
214 void setBufferWidth(double buffer_width_in, UnitCellAxis dim);
215 void setBufferWidth(double buffer_width_in, CartesianDimension dim);
217
226 void setDetail(const std::string &kind_in);
227 void setDetail(GridDetail kind_in);
229
238 void setPotential(const std::string &potential_in);
239 void setPotential(NonbondedPotential potential_in);
241
247 void setBoundaries(const std::string &boundaries_in);
248 void setBoundaries(BoundaryCondition boundaries_in);
250
254 void setScalingBits(int mesh_scaling_bits_in);
255
260 void setElecClashDistance(double clash_distance_in);
261
267 void setVdwClashRatio(double clash_ratio_in);
268
269private:
270 ExceptionResponse policy;
271 int mesh_points_a;
272 int mesh_points_b;
273 int mesh_points_c;
274 double mesh_spacing_a;
275 double mesh_spacing_b;
276 double mesh_spacing_c;
277 double mesh_alpha;
279 double mesh_beta;
281 double mesh_gamma;
283 double mesh_origin_x;
284 double mesh_origin_y;
285 double mesh_origin_z;
286 double buffer_width_a;
291 double buffer_width_b;
293 double buffer_width_c;
295 std::string kind;
296 std::string potential;
297 std::string boundaries;
298 int mesh_scaling_bits;
300 double clash_distance;
302 double clash_ratio;
305
307 NamelistEmulator nml_transcript;
308
311 void validateMeshElement();
312};
313
323NamelistEmulator meshInput(const TextFile &tf, int *start_line, bool *found,
324 ExceptionResponse policy = ExceptionResponse::DIE,
325 WrapTextSearch wrap = WrapTextSearch::NO);
326
327} // namespace namelist
328} // namespace stormm
329
330#endif
void setBoundaries(const std::string &boundaries_in)
Set the boundary conditions for the mesh. Overloading in this function follows from setPotential() ab...
Definition nml_mesh.cpp:360
void setScalingBits(int mesh_scaling_bits_in)
Set the number of bits after the decimal to be used in mesh calculations.
Definition nml_mesh.cpp:388
double getSpacing(UnitCellAxis dim) const
Get the mesh spacing along a particular axis. Overloads and input parameters to this function follow ...
Definition nml_mesh.cpp:103
void setElecClashDistance(double clash_distance_in)
Set the electrostatic clash distance.
Definition nml_mesh.cpp:393
void setPotential(const std::string &potential_in)
Set the potential energy field that the mesh will represent.
Definition nml_mesh.cpp:332
double getBeta() const
Get the mesh beta angle, between the a and c unit cell axes, in units of radians.
Definition nml_mesh.cpp:126
int getAxisElementCount(UnitCellAxis dim) const
Get the number of grid points in a particular dimension. This can serve to query a particular piece o...
Definition nml_mesh.cpp:85
void setElementCount(int mesh_points_in, UnitCellAxis dim)
Set the number of mesh points along a particular axis.
Definition nml_mesh.cpp:202
void setOrigin(double mesh_origin_in, CartesianDimension dim)
Set the mesh origin along one Cartesian axis.
Definition nml_mesh.cpp:266
double getVdwClashRatio() const
Get the switching ratio for softcore van-der Waals potentials. This will only apply to meshes represe...
Definition nml_mesh.cpp:192
double getAlpha() const
Get the mesh alpha angle, between the b and c unit cell axes. The value is returned in units of radia...
Definition nml_mesh.cpp:121
double getBufferWidth(UnitCellAxis dim) const
Get buffer widths between mesh boundaries and the receptor structure or structures.
Definition nml_mesh.cpp:149
void setSpacing(double mesh_spacing_in, UnitCellAxis dim)
Set the mesh spacing along a particular axis. Overloading of this function follows from setElementCou...
Definition nml_mesh.cpp:227
double getOrigin(CartesianDimension dim) const
Get the origin of the mesh in one Cartesian dimension.
Definition nml_mesh.cpp:136
double getElecClashDistance() const
Get the switching range for softcore electrostatic potentials. This will only apply to meshes represe...
Definition nml_mesh.cpp:187
void setBufferWidth(double buffer_width_in)
Set the buffer distance between the mesh boundary and the nearest van-der Waals sphere.
Definition nml_mesh.cpp:281
MeshPosition getPosition() const
Get the manner in which the mesh is aligned to the rigid molecule it represents.
NonbondedPotential getPotential() const
Get the type of potential to be expressed on the mesh. This complements the getContent() function and...
Definition nml_mesh.cpp:172
void setGammaAngle(double gamma_in)
Set the mesh gamma angle.
Definition nml_mesh.cpp:261
const NamelistEmulator & getTranscript() const
Get the original namelist emulator object as a transcript of the user input.
Definition nml_mesh.cpp:197
MeshControls(ExceptionResponse policy_in=ExceptionResponse::DIE)
The constructor can prepare an object with default settings or read the corresponding namelist to acc...
Definition nml_mesh.cpp:28
double getGamma() const
Get the mesh gamma angle, between the a and b unit cell axes, in units of radians.
Definition nml_mesh.cpp:131
void setAlphaAngle(double alpha_in)
Set the mesh alpha angle.
Definition nml_mesh.cpp:251
void setVdwClashRatio(double clash_ratio_in)
Set the van-der Waals clash ratio.
Definition nml_mesh.cpp:398
BoundaryCondition getBoundaries() const
Get the boundary conditions of the mesh.
Definition nml_mesh.cpp:177
int getScalingBits() const
Get the number of bits after the decimal to be used in composing the mesh-based field as well as the ...
Definition nml_mesh.cpp:182
void setDetail(const std::string &kind_in)
Set the type of mesh that this namelist will be assumed to describe.
Definition nml_mesh.cpp:305
GridDetail getDetail() const
Get the type of content (potential energy field) that the mesh will represent. In general,...
Definition nml_mesh.cpp:167
void setBetaAngle(double beta_in)
Set the mesh beta angle.
Definition nml_mesh.cpp:256
MeshControls(const MeshControls &original)=default
As with other control objects, copy and move constructors, plus copy and move assignment operators,...
Collection of variables to transcribe information contained within a namelist.
Definition namelist_emulator.h:30
Structure for translating a text file into a compact, rapidly parsable vector of characters in CPU RA...
Definition textfile.h:45