STORMM Source Documentation
Loading...
Searching...
No Matches
layered_potential_metrics.h
1// -*-c++-*-
2#ifndef STORMM_LAYERED_POTENTIAL_METRICS_H
3#define STORMM_LAYERED_POTENTIAL_METRICS_H
4
5#include <vector>
6#include "copyright.h"
7#include "Constants/scaling.h"
8#include "Constants/symbol_values.h"
9#include "Math/log_scale_spline.h"
10#include "Structure/structure_enumerators.h"
11#include "energy_enumerators.h"
12
13namespace stormm {
14namespace energy {
15
16using structure::BoundaryCondition;
17using symbols::amber_ancient_bioq;
18
21constexpr double hail_minimum_range_limit = 4.0;
22constexpr double hail_minimum_range_multiplier = 1.5;
23constexpr double hail_maximum_range_multiplier = 3.0;
24constexpr double hail_default_vdw_xtn_midpoint = 7.0;
25constexpr double hail_default_vdw_xtn_intensity = 3.0;
26constexpr double hail_default_ewald_coefficient = 0.3;
28
34public:
35
43 LayeredPotentialMetrics(DecomposablePotential form_in = DecomposablePotential::ELECTROSTATIC,
44 BoundaryCondition boundaries_in = BoundaryCondition::ISOLATED,
45 double coulomb_in = amber_ancient_bioq,
46 VdwCombiningRule mixing_rule_in = VdwCombiningRule::GEOMETRIC,
47 const std::vector<double> &exponent_c_in = { 1.0, 1.5, 2.0 },
48 double particle_particle_cutoff = 5.0,
49 double range_multiplier_in = 2.0,
50 double range_limit_in = 1000.0,
51 double vdw_transition_midpoint_in = hail_default_vdw_xtn_midpoint,
52 double vdw_transition_intensity_in = hail_default_vdw_xtn_intensity,
53 double ewald_coefficient_in = hail_default_ewald_coefficient,
54 const std::vector<double> &box_vectors_in = { 50.0, 0.0, 0.0,
55 0.0, 50.0, 0.0,
56 0.0, 0.0, 50.0 });
57
64 LayeredPotentialMetrics& operator=(const LayeredPotentialMetrics &other) = default;
65 LayeredPotentialMetrics& operator=(LayeredPotentialMetrics &&other) = default;
67
69 DecomposablePotential getForm() const;
70
72 BoundaryCondition getBoundaryCondition() const;
73
75 int getLayerCount() const;
76
81 double getCutoff(int layer_index) const;
82
85 double getCoulombConstant() const;
86
90 VdwCombiningRule getMixingRule() const;
91
118 double getExponentFactor(int factor_index, int layer_index = 1) const;
119
128 double getRangeCompounding() const;
129
132 double getMaximumRange() const;
133
137 double getVdwTransitionMidpoint() const;
138
144 double getVdwTransitionIntensity() const;
145
147 double getEwaldCoefficient() const;
148
152 const std::vector<double>& getUnitCellVectors() const;
153
157 void setForm(DecomposablePotential form_in);
158
162 void setBoundaryCondition(BoundaryCondition boundary_in);
163
167 void setCutoff(double cutoff_in);
168
172 void setCoulombConstant(double coulomb_in);
173
178 void setMixingRule(VdwCombiningRule mixing_rule_in);
179
193 void setExponentFactor(int factor_index, double exp_c_in);
194 void setExponentFactor(const std::vector<double> &exp_c_in);
195 void setExponentFactor(const double3 exp_c_in);
197
202 void setRangeCompounding(double range_multiplier_in);
203
208 void setMaximumRange(double range_limit_in);
209
215 void setVdwTransitionMidpoint(double midpoint_in);
216
222 void setVdwTransitionIntensity(double intensity_in);
223
229 void setEwaldCoefficient(double ewald_coefficient_in);
230
236 void setUnitCellVectors(const std::vector<double> &box_vectors_in);
237
238private:
239
240 DecomposablePotential form;
241 BoundaryCondition boundaries;
246 int layer_count;
247 std::vector<double> cutoffs;
251 double coulomb_constant;
253 VdwCombiningRule mixing_rule;
257 std::vector<double3> exponent_c;
263 double range_multiplier;
267 double range_limit;
271 double vdw_transition_midpoint;
274 double vdw_transition_intensity;
277 double ewald_coefficient;
279 std::vector<double> box_vectors;
282
287 void validateLayerIndex(int layer_index, const char* caller = nullptr) const;
288
293 void computeLayers();
294};
295
296} // namespace energy
297} // namespace stormm
298
299#endif
void setCutoff(double cutoff_in)
Set the cutoff for particle-particle interactions.
Definition layered_potential_metrics.cpp:133
void setEwaldCoefficient(double ewald_coefficient_in)
Set the Ewald coefficient for decomposition of a PME direct space interaction.
Definition layered_potential_metrics.cpp:243
double getExponentFactor(int factor_index, int layer_index=1) const
Get one of the three baseline exponential coefficients. The strategy with Layered Interpolation in Re...
Definition layered_potential_metrics.cpp:72
void setExponentFactor(int factor_index, double exp_c_in)
Set one of the baseline exponential factors. These apply to the first smoothed potential,...
Definition layered_potential_metrics.cpp:153
void setForm(DecomposablePotential form_in)
Set the form of the potential that will be expressed.
Definition layered_potential_metrics.cpp:123
void setMixingRule(VdwCombiningRule mixing_rule_in)
Set the mixing rule to apply to Lennard-Jones parameter pairs. This will determine the forms of parti...
Definition layered_potential_metrics.cpp:148
void setCoulombConstant(double coulomb_in)
Set the value of Coulomb's constant.
Definition layered_potential_metrics.cpp:143
double getCoulombConstant() const
Get the value of Coulomb's constant to use in preparing potentials. This will raise an exception if t...
Definition layered_potential_metrics.cpp:62
VdwCombiningRule getMixingRule() const
Get the mixing rule applicable to dispersion interactions. Specific Lennard-Jones parameters are not ...
Definition layered_potential_metrics.cpp:67
const std::vector< double > & getUnitCellVectors() const
Get the rough unit cell dimensions, expressed as a 3 x 3 matrix whose columns are the Cartesian X,...
Definition layered_potential_metrics.cpp:118
double getVdwTransitionMidpoint() const
Get the dispersion interaction switching midpoint, at which point whatever applicable interaction is ...
Definition layered_potential_metrics.cpp:103
LayeredPotentialMetrics(DecomposablePotential form_in=DecomposablePotential::ELECTROSTATIC, BoundaryCondition boundaries_in=BoundaryCondition::ISOLATED, double coulomb_in=amber_ancient_bioq, VdwCombiningRule mixing_rule_in=VdwCombiningRule::GEOMETRIC, const std::vector< double > &exponent_c_in={ 1.0, 1.5, 2.0 }, double particle_particle_cutoff=5.0, double range_multiplier_in=2.0, double range_limit_in=1000.0, double vdw_transition_midpoint_in=hail_default_vdw_xtn_midpoint, double vdw_transition_intensity_in=hail_default_vdw_xtn_intensity, double ewald_coefficient_in=hail_default_ewald_coefficient, const std::vector< double > &box_vectors_in={ 50.0, 0.0, 0.0, 0.0, 50.0, 0.0, 0.0, 0.0, 50.0 })
The constructor takes input for all member variables, but various modifier functions can set them one...
Definition layered_potential_metrics.cpp:16
double getMaximumRange() const
Get the maximum range for calculated interactions, applicable to systems with isolated boundary condi...
Definition layered_potential_metrics.cpp:98
double getEwaldCoefficient() const
Get the Ewald coefficient for decomposition of a PME direct space interaction.
Definition layered_potential_metrics.cpp:113
int getLayerCount() const
Get the number of layers by which the potential is split.
Definition layered_potential_metrics.cpp:51
void setVdwTransitionIntensity(double intensity_in)
Set the intensity with which the dispersion interaction switches between its native form and the inte...
Definition layered_potential_metrics.cpp:238
BoundaryCondition getBoundaryCondition() const
Get the expected boundary conditions.
Definition layered_potential_metrics.cpp:46
double getVdwTransitionIntensity() const
Get the intensity with which the dispersion interaction switches between its native form and the inte...
Definition layered_potential_metrics.cpp:108
double getCutoff(int layer_index) const
Get the cutoff value for one of the layers. The cutoff for one layer is the handoff point for the nex...
Definition layered_potential_metrics.cpp:56
LayeredPotentialMetrics(const LayeredPotentialMetrics &original)=default
Using Standard Template Library objects for anything that is not a scalar value, and with no const me...
DecomposablePotential getForm() const
Get the requested potential form.
Definition layered_potential_metrics.cpp:41
void setRangeCompounding(double range_multiplier_in)
Set the range compounding factor.
Definition layered_potential_metrics.cpp:198
void setMaximumRange(double range_limit_in)
Set the maximum range for the layered potential cutoffs. This will provide an upper bound on the inte...
Definition layered_potential_metrics.cpp:213
double getRangeCompounding() const
Get the general scaling factor for the handoff points between successive layers. Two is a natural cho...
Definition layered_potential_metrics.cpp:93
void setBoundaryCondition(BoundaryCondition boundary_in)
Set the boundary conditions to use.
Definition layered_potential_metrics.cpp:128
void setVdwTransitionMidpoint(double midpoint_in)
Set the dispersion interaction switching midpoint, at which point whatever applicable interaction is ...
Definition layered_potential_metrics.cpp:233
void setUnitCellVectors(const std::vector< double > &box_vectors_in)
Set the unit cell vectors. This will provide an upper bound on the interactions in the case of period...
Definition layered_potential_metrics.cpp:255
Definition stormm_vector_types.h:117