STORMM Source Documentation
Loading...
Searching...
No Matches
nml_pppm.h
1// -*-c++-*-
2#ifndef STORMM_NML_PPPM_H
3#define STORMM_NML_PPPM_H
4
5#include "copyright.h"
6#include "Constants/behavior.h"
7#include "Parsing/parsing_enumerators.h"
8#include "Parsing/textfile.h"
9#include "Potential/cellgrid.h"
10#include "Potential/energy_enumerators.h"
11#include "input.h"
12#include "namelist_emulator.h"
13
14namespace stormm {
15namespace namelist {
16
17using constants::ExceptionResponse;
18using energy::default_mesh_ticks;
19using energy::maximum_cell_width;
20using energy::NonbondedTheme;
21using energy::VdwSumMethod;
22using energy::PMIStrategy;
23using parse::TextFile;
24using parse::WrapTextSearch;
25
28constexpr double max_pp_cutoff = 2.0 * maximum_cell_width;
29constexpr NonbondedTheme default_pppm_theme = NonbondedTheme::ELECTROSTATIC;
30constexpr PMIStrategy default_pppm_accuracy = PMIStrategy::NO_AUTOMATION;
32
39public:
40
52 PPPMControls(ExceptionResponse policy_in = ExceptionResponse::DIE,
53 WrapTextSearch wrap = WrapTextSearch::NO);
54 PPPMControls(const TextFile &tf, int *start_line, bool *found_nml,
55 ExceptionResponse policy_in = ExceptionResponse::DIE,
56 WrapTextSearch wrap = WrapTextSearch::NO);
58
62 PPPMControls(const PPPMControls &original) = default;
63 PPPMControls(PPPMControls &&original) = default;
64 PPPMControls& operator=(const PPPMControls &original) = default;
65 PPPMControls& operator=(PPPMControls &&original) = default;
67
69 NonbondedTheme getTheme() const;
70
72 int getInterpolationOrder() const;
73
75 double getEwaldCoefficient() const;
76
78 double getGaussianWidth() const;
79
81 double getCutoff() const;
82
84 double getDirectSumTolerance() const;
85
88 int getMeshSubdivisions() const;
89
93 PMIStrategy getStrategy() const;
94
96 VdwSumMethod getVdwSummation() const;
97
106 void setTheme(NonbondedTheme theme_in);
107 void setTheme(const std::string &theme_in);
109
113 void setInterpolationOrder(int order_in);
114
118 void setEwaldCoefficient(double ewald_coefficient_in);
119
121 void setGaussianWidth(double spread_in);
122
124 void setCutoff(double cutoff_in);
125
127 void setDirectSumTolerance(double dsum_tol_in);
128
130 void setMeshSubdivisions(int mesh_ticks_in);
131
137 void setStrategy(PMIStrategy strat_in);
138 void setStrategy(const std::string &strat_in);
140
150 void setVdwSummation(const std::string &vdw_method_in);
151 void setVdwSummation(const VdwSumMethod vdw_method_in);
153
156 void applyStrategy();
157
158private:
159 ExceptionResponse policy;
163 NonbondedTheme theme;
165 int order;
171 double ewald_coefficient;
175 double cutoff;
182 double dsum_tol;
185 int mesh_ticks;
192 PMIStrategy strat;
197 VdwSumMethod vdw_method;
200
202 NamelistEmulator nml_transcript;
203
209 bool validateOrder(const int order_in) const;
210
215 bool validateEwaldCoefficient(double ewald_coefficient_in) const;
216
220 bool validateCutoff(double cutoff_in) const;
221
225 bool validateDirectSumTolerance(double tol_in) const;
226
231 bool validateMeshSubdivisions(int mesh_ticks_in) const;
232};
233
253NamelistEmulator pppmInput(const TextFile &tf, int *start_line, bool *found,
254 ExceptionResponse policy = ExceptionResponse::DIE,
255 WrapTextSearch wrap = WrapTextSearch::NO);
256
257} // namespace namelist
258} // namespace stormm
259
260#endif
PPPMControls(ExceptionResponse policy_in=ExceptionResponse::DIE, WrapTextSearch wrap=WrapTextSearch::NO)
The constructor can prepare an object with default settings or read the corresponding namelist to acc...
Definition nml_pppm.cpp:27
Collection of variables to transcribe information contained within a namelist.
Definition namelist_emulator.h:30
void setTheme(NonbondedTheme theme_in)
Set the non-bonded potential type.
Definition nml_pppm.cpp:100
int getMeshSubdivisions() const
Get the number of particle-mesh interaction grid ticks per spatial decomposition cell.
Definition nml_pppm.cpp:90
void applyStrategy()
Apply the current strategy, to the extent possible, for filling in missing parameters from the &pppm ...
Definition nml_pppm.cpp:194
void setGaussianWidth(double spread_in)
Set the Gaussian particle density spreading sigma.
double getGaussianWidth() const
Get the Gaussian particle density spreading sigma.
Definition nml_pppm.cpp:75
int getInterpolationOrder() const
Get the interpolation order.
Definition nml_pppm.cpp:65
double getDirectSumTolerance() const
Get the direct sum tolerance.
Definition nml_pppm.cpp:85
void setDirectSumTolerance(double dsum_tol_in)
Set the direct sum tolerance.
Definition nml_pppm.cpp:145
void setVdwSummation(const std::string &vdw_method_in)
Set the strategy for evaluating the tails of van-der Waals (Lennard-Jones) interactions.
Definition nml_pppm.cpp:184
void setStrategy(PMIStrategy strat_in)
Set the strategy for determining various parameters of the particle-mesh interaction grid....
Definition nml_pppm.cpp:159
VdwSumMethod getVdwSummation() const
Get the method for computing van-der Waals interactions between particles.
void setCutoff(double cutoff_in)
Set the particle-particle interaction cutoff.
Definition nml_pppm.cpp:138
void setMeshSubdivisions(int mesh_ticks_in)
Set the number of particle-interaction grid elements per spatial decomposition cell.
Definition nml_pppm.cpp:152
double getCutoff() const
Get the particle-particle interaction cutoff.
Definition nml_pppm.cpp:80
PPPMControls(ExceptionResponse policy_in=ExceptionResponse::DIE, WrapTextSearch wrap=WrapTextSearch::NO)
The constructor can prepare an object with default settings or read the corresponding namelist to acc...
Definition nml_pppm.cpp:27
void setEwaldCoefficient(double ewald_coefficient_in)
Set the Ewald coefficient.
Definition nml_pppm.cpp:131
PPPMControls(const PPPMControls &original)=default
As with other control objects, copy and move constructors, plus copy and move assignment operators,...
PMIStrategy getStrategy() const
Get the strategy for choosing particle-mesh interaction grid parameters. This is not passed along to ...
Definition nml_pppm.cpp:95
NonbondedTheme getTheme() const
Get the non-bonded potential theme.
Definition nml_pppm.cpp:60
void setInterpolationOrder(int order_in)
Set the interpolation order.
Definition nml_pppm.cpp:124
double getEwaldCoefficient() const
Get the Ewald coefficient.
Definition nml_pppm.cpp:70
Structure for translating a text file into a compact, rapidly parsable vector of characters in CPU RA...
Definition textfile.h:45