2#ifndef STORMM_NML_PRECISION_H
3#define STORMM_NML_PRECISION_H
6#include "Constants/behavior.h"
7#include "Constants/fixed_precision.h"
8#include "Parsing/textfile.h"
10#include "namelist_emulator.h"
15using constants::PrecisionModel;
16using parse::WrapTextSearch;
17using numerics::default_charge_mesh_scale_bits;
18using numerics::default_energy_scale_bits;
19using numerics::default_force_scale_bits;
20using numerics::default_globalpos_scale_bits;
21using numerics::default_localpos_scale_bits;
22using numerics::default_velocity_scale_bits;
28constexpr char default_precision_valence_method[] =
"single";
29constexpr char default_precision_nonbonded_method[] =
"single";
30constexpr char default_precision_pme_method[] =
"single";
31constexpr double default_precision_constraint_tol = 1.0e-5;
32constexpr double min_precision_constraint_tol = 5.0e-9;
55 WrapTextSearch wrap = WrapTextSearch::NO);
57 ExceptionResponse policy_in = ExceptionResponse::DIE,
58 WrapTextSearch wrap = WrapTextSearch::NO);
162 ExceptionResponse policy;
167 int globalpos_scale_bits;
168 int localpos_scale_bits;
169 int velocity_scale_bits;
170 int force_scale_bits;
171 int energy_scale_bits;
172 int charge_mesh_scale_bits;
173 double bond_constraint_tol;
174 PrecisionModel valence_method;
175 PrecisionModel nonbonded_method;
176 PrecisionModel pme_method;
183 void validateBondConstraintTol();
200 ExceptionResponse policy = ExceptionResponse::DIE,
201 WrapTextSearch wrap = WrapTextSearch::NO);
PrecisionControls(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_precision.cpp:24
Collection of variables to transcribe information contained within a namelist.
Definition namelist_emulator.h:30
int getEnergyScalingBits() const
Get the energy accumulation fixed-precision bits.
Definition nml_precision.cpp:93
void setForceScalingBits(int bitval)
Set the fixed-precision force accumulation bits.
Definition nml_precision.cpp:146
double getBondConstraintTolerance() const
Get the SHAKE / RATTLE convergence tolerance.
Definition nml_precision.cpp:103
int getForceScalingBits() const
Get the force accumulation fixed-precision bits.
Definition nml_precision.cpp:88
void setNonbondedMethod(PrecisionModel pmodel)
Set the precision model to use in non-bonded short-ranged pair computations.
Definition nml_precision.cpp:175
const NamelistEmulator & getTranscript() const
Get the original namelist emulator object as a transcript of the user input.
Definition nml_precision.cpp:123
PrecisionModel getParticleMeshEwaldMethod() const
Get the precision level for Particle-Mesh Ewald computations.
Definition nml_precision.cpp:118
PrecisionModel getValenceMethod() const
Get the precision level for valence computations.
Definition nml_precision.cpp:108
PrecisionControls(const PrecisionControls &original)=default
As with other control objects, copy and move constructors, plus copy and move assignment operators,...
PrecisionModel getNonbondedMethod() const
Get the precision level for short-ranged, non-bonded computations.
Definition nml_precision.cpp:113
void setChargeMeshScalingBits(int bitval)
Set the fixed-precision charge mesh accumulation bits.
Definition nml_precision.cpp:158
int getChargeMeshScalingBits() const
Get the PME charge accumulation fixed-precision bits.
Definition nml_precision.cpp:98
void setValenceMethod(PrecisionModel pmodel)
Set the precision model to use in valence term computations.
Definition nml_precision.cpp:170
void setEnergyScalingBits(int bitval)
Set the fixed-precision energy accumulation bits.
Definition nml_precision.cpp:152
int getGlobalPosScalingBits() const
Get the global position fixed-precision bits.
Definition nml_precision.cpp:73
void setParticleMeshEwaldMethod(PrecisionModel pmodel)
Set the precision model to use in Particle Mesh Ewald (charge density accumulation,...
Definition nml_precision.cpp:180
PrecisionControls(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_precision.cpp:24
void setGlobalPosScalingBits(int bitval)
Set the global position fixed-precision bits.
Definition nml_precision.cpp:128
void setVelocityScalingBits(int bitval)
Set the fixed-precision velocity scaling bits.
Definition nml_precision.cpp:140
int getLocalPosScalingBits() const
Get the local position fixed-precision bits.
Definition nml_precision.cpp:78
void setBondConstraintTolerance(double tol)
Set the bond constraint convergence tolerance.
Definition nml_precision.cpp:164
void setLocalPosScalingBits(int bitval)
Set the local position fixed-precision bits.
Definition nml_precision.cpp:134
int getVelocityScalingBits() const
Get the velocity fixed-precision bits.
Definition nml_precision.cpp:83
Structure for translating a text file into a compact, rapidly parsable vector of characters in CPU RA...
Definition textfile.h:45