STORMM Source Documentation
Loading...
Searching...
No Matches
nml_remd.h
1// -*-c++-*-
2#ifndef STORMM_NML_REMD_H
3#define STORMM_NML_REMD_H
4
5#include "copyright.h"
6#include "Constants/behavior.h"
7#include "Constants/symbol_values.h"
8#include "Parsing/textfile.h"
9#include "Potential/energy_enumerators.h"
10#include "Structure/structure_enumerators.h"
11#include "Trajectory/trajectory_enumerators.h"
12#include "input.h"
13#include "namelist_emulator.h"
14
15namespace stormm {
16namespace namelist {
17
18using constants:: CartesianDimension;
19using constants::PrecisionModel;
20using constants::ExceptionResponse;
21using parse::TextFile;
22using parse::WrapTextSearch;
23using structure::ApplyConstraints;
24
25constexpr int default_total_swaps = 0;
26constexpr char default_remd_type[] = "Temperature";
27constexpr int default_freq_swaps = 500;
28constexpr char default_swap_store[] = "Successful";
29constexpr char default_temp_distribution[] = "Van Der Spoel";
30constexpr double default_exchange_probability = 0.2;
31constexpr double default_tolerance = 0.00001;
32constexpr int default_max_replicas = 1000;
33constexpr double default_low_temperature = 298.15;
34constexpr double default_high_temperature = 398.15;
35
38public:
39
51 RemdControls(ExceptionResponse policy_in = ExceptionResponse::DIE);
52
53 RemdControls(const TextFile &tf, int *start_line, bool *found_nml,
54 ExceptionResponse policy_in = ExceptionResponse::DIE,
55 WrapTextSearch wrap = WrapTextSearch::NO);
57
60 RemdControls(const RemdControls &original) = default;
61 RemdControls(RemdControls &&original) = default;
62 RemdControls& operator=(const RemdControls &original) = default;
63 RemdControls& operator=(RemdControls &&original) = default;
65
68 int getTotalSwapCount() const;
69
71 std::string getRemdType() const;
72
74 int getFrequencyOfSwaps() const;
75
78 std::string getSwapStore() const;
79
82 std::string getTemperatureDistributionMethod() const;
83
85 double getExchangeProbability() const;
86
88 double getTolerance() const;
89
91 int getMaxReplicas() const;
92
94 // TODO: Change this to just a double
95 double getLowTemperature() const;
96
98 double getHighTemperature() const;
99
101 const NamelistEmulator& getTranscript() const;
102
106 void setTotalSwapCount(int total_swap_count_in);
107
111 void setRemdType(std::string remd_type_in);
112
116 void setFrequencyOfSwaps(int frequency_swaps_in);
117
121 void setSwapStore(std::string swap_store_in);
122
127 void setTemperatureDistributionMethod(std::string temperature_dist_in);
128
132 void setExchangeProbability(double exchange_probability_in);
133
137 void setTolerance(double tolerance_in);
138
142 void setMaxReplicas(int max_replicas_in);
143
147 void setLowTemperature(double low_temperature_in);
148
152 void setHighTemperature(double high_temperature_in);
153
154private:
155 ExceptionResponse policy;
156 int total_swap_count;
157 std::string remd_type;
158 int frequency_swaps;
159 std::string swap_store;
161 std::string temperature_dist;
163 double exchange_probability;
165 double tolerance;
167 int max_replicas;
168
171 double low_temperature;
172
175 double high_temperature;
176
178 NamelistEmulator nml_transcript;
179
182 void validateSwapCount();
183
185 void validateRemdKind();
186
188 void validateFreqOrTotalSwaps();
189
191 void validateSwapFrequency();
192
194 void validateSwapStore();
195
199 void validateTemperature();
200
202 void validateTemperatureDistribution();
203
205 void validateExchangeProbability();
206
208 void validateTolerance();
209
211 void validateMaxReplicas();
212};
213
223NamelistEmulator remdInput(const TextFile &tf, int *start_line, bool *found,
224 ExceptionResponse policy = ExceptionResponse::DIE,
225 WrapTextSearch wrap = WrapTextSearch::NO);
226
227} // namespace namelist
228} // namespace stormm
229
230#endif
Collection of variables to transcribe information contained within a namelist.
Definition namelist_emulator.h:30
const NamelistEmulator & getTranscript() const
Get the original namelist emulator object as a transcript of the user input.
Definition nml_remd.cpp:117
std::string getSwapStore() const
Get the string encoding for the method of storage to use for swaps TODO: Storage methods need to be r...
Definition nml_remd.cpp:82
void setTotalSwapCount(int total_swap_count_in)
Set the total number of swaps to be performed in a REMD simulation.
Definition nml_remd.cpp:122
double getLowTemperature() const
Get the vector of initial temperature targets for all groups of atoms and systems.
Definition nml_remd.cpp:107
int getFrequencyOfSwaps() const
Get the frequency of steps to perform before a swap is attempted.
Definition nml_remd.cpp:77
void setRemdType(std::string remd_type_in)
Set the REMD Type: 1) Temperature, or 2) Hamiltonian.
Definition nml_remd.cpp:127
double getTolerance() const
Get the tolerance set between desired exchange probability and predicted probability.
Definition nml_remd.cpp:97
RemdControls(ExceptionResponse policy_in=ExceptionResponse::DIE)
The Constructors can prepare an object with default settings or read the corresponding namelist to ac...
Definition nml_remd.cpp:21
std::string getRemdType() const
Get the type of REMD to be performed in this simulation.
Definition nml_remd.cpp:72
void setLowTemperature(double low_temperature_in)
Set the initial temperature for the REMD simulation.
Definition nml_remd.cpp:162
void setTemperatureDistributionMethod(std::string temperature_dist_in)
Set the algorithm to be used to calculate the temperature distribution.
Definition nml_remd.cpp:142
void setSwapStore(std::string swap_store_in)
Set the amount of data to be stored for swap history.
Definition nml_remd.cpp:137
double getHighTemperature() const
Get the vector of final temperature targets for all groups of atoms and systems.
Definition nml_remd.cpp:112
int getMaxReplicas() const
Get the user input for Maximum Replicas allowed.
Definition nml_remd.cpp:102
std::string getTemperatureDistributionMethod() const
Get the string encoding for the type of temperature distribution in use TODO: This needs to be revisi...
Definition nml_remd.cpp:87
void setFrequencyOfSwaps(int frequency_swaps_in)
Set the frequency of steps to take before performing a swap.
Definition nml_remd.cpp:132
int getTotalSwapCount() const
Getters for the REMD Namelist.
Definition nml_remd.cpp:67
void setTolerance(double tolerance_in)
Set the tolerance between desired probability and poredicted probability.
Definition nml_remd.cpp:152
double getExchangeProbability() const
Get the user input Exchange Probability between 2 adjacent replicas.
Definition nml_remd.cpp:92
void setHighTemperature(double high_temperature_in)
Set the equilibrium temperature for the REMD simulation.
Definition nml_remd.cpp:167
RemdControls(const RemdControls &original)=default
Copy and Move Constructors, inspired from nml_mesh.h.
void setMaxReplicas(int max_replicas_in)
Set the maximum number of replicas the REMD algorithm is allowed to create.
Definition nml_remd.cpp:157
void setExchangeProbability(double exchange_probability_in)
Set the exchange probability between two adjacent replicas in REMD.
Definition nml_remd.cpp:147
Structure for translating a text file into a compact, rapidly parsable vector of characters in CPU RA...
Definition textfile.h:45