OpenMD 3.2
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
Globals.hpp
1/*
2 * Copyright (c) 2004-present, The University of Notre Dame. All rights
3 * reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
14 *
15 * 3. Neither the name of the copyright holder nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 *
31 * SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your
32 * research, please cite the following paper when you publish your work:
33 *
34 * [1] Drisko et al., J. Open Source Softw. 9, 7004 (2024).
35 *
36 * Good starting points for code and simulation methodology are:
37 *
38 * [2] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).
39 * [3] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).
40 * [4] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).
41 * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
42 * [6] Kuang & Gezelter, Mol. Phys., 110, 691-701 (2012).
43 * [7] Lamichhane, Gezelter & Newman, J. Chem. Phys. 141, 134109 (2014).
44 * [8] Bhattarai, Newman & Gezelter, Phys. Rev. B 99, 094106 (2019).
45 * [9] Drisko & Gezelter, J. Chem. Theory Comput. 20, 4986-4997 (2024).
46 */
47
48#ifndef IO_GLOBALS_HPP
49#define IO_GLOBALS_HPP
50
51#include <cstdlib>
52#include <iostream>
53#include <map>
54#include <string>
55#include <vector>
56
57#include "flucq/FluctuatingChargeParameters.hpp"
58#include "optimization/MinimizerParameters.hpp"
59#include "perturbations/LightParameters.hpp"
60#include "perturbations/VelocityFieldParameters.hpp"
61#include "rnemd/RNEMDParameters.hpp"
62#include "types/Component.hpp"
63#include "types/FragmentStamp.hpp"
64#include "types/MoleculeStamp.hpp"
65#include "types/RestraintStamp.hpp"
66#include "types/ZconsStamp.hpp"
67#include "utils/ParameterManager.hpp"
68
69namespace OpenMD {
70 class Globals : public DataHolder {
71 public:
72 using intPair = std::pair<int, int>;
73
74 Globals();
75 virtual ~Globals();
76
77 DeclareParameter(ForceField, std::string);
78 DeclareParameter(TargetTemp, RealType);
79 DeclareParameter(Ensemble, std::string);
80 DeclareParameter(Dt, RealType);
81 DeclareParameter(RunTime, RealType);
82 DeclareParameter(FinalConfig, std::string);
83 DeclareParameter(SampleTime, RealType);
84 DeclareParameter(ResetTime, RealType);
85 DeclareParameter(StatusTime, RealType);
86 DeclareParameter(CutoffRadius, RealType);
87 DeclareParameter(SwitchingRadius, RealType);
88 DeclareParameter(TempSet, bool);
89 DeclareParameter(ThermalTime, RealType);
90 DeclareParameter(UsePeriodicBoundaryConditions, bool);
91 DeclareParameter(ConserveLinearMomentum, bool);
92 DeclareParameter(ConserveAngularMomentum, bool);
93 DeclareParameter(TargetPressure, RealType);
94 DeclareParameter(UseAtomicVirial, bool);
95 DeclareParameter(UseLongRangeCorrections, bool);
96 DeclareParameter(TauThermostat, RealType);
97 DeclareParameter(TauBarostat, RealType);
98 DeclareParameter(LangevinPistonDrag, RealType);
99 DeclareParameter(ZconsTime, RealType);
100 DeclareParameter(ZconsTol, RealType);
101 DeclareParameter(ZconsForcePolicy, std::string);
102 DeclareParameter(Seed, unsigned long int);
103 DeclareParameter(UseInitalTime, bool);
104 DeclareParameter(UseIntialExtendedSystemState, bool);
105 DeclareParameter(OrthoBoxTolerance, RealType);
106 DeclareParameter(ZconsGap, RealType);
107 DeclareParameter(ZconsFixtime, RealType);
108 DeclareParameter(ZconsUsingSMD, bool);
109 DeclareParameter(UseThermodynamicIntegration, bool);
110 DeclareParameter(ThermodynamicIntegrationLambda, RealType);
111 DeclareParameter(ThermodynamicIntegrationK, RealType);
112 DeclareParameter(ForceFieldVariant, std::string);
113 DeclareParameter(ForceFieldFileName, std::string);
114 DeclareParameter(SurfaceTension, RealType);
115 DeclareParameter(PrintPressureTensor, bool);
116 DeclareParameter(PrintVirialTensor, bool);
117 DeclareParameter(PrintHeatFlux, bool);
118 DeclareParameter(TaggedAtomPair, intPair);
119 DeclareParameter(PrintTaggedPairDistance, bool);
120 DeclareParameter(ElectrostaticSummationMethod, std::string);
121 DeclareParameter(ElectrostaticScreeningMethod, std::string);
122 DeclareParameter(UseSurfaceTerm, bool);
123 DeclareParameter(UseSlabGeometry, bool);
124 DeclareParameter(DampingAlpha, RealType);
125 DeclareParameter(Dielectric, RealType);
126 DeclareParameter(CutoffMethod, std::string);
127 DeclareParameter(SwitchingFunctionType, std::string);
128 DeclareParameter(CompressDumpFile, bool);
129 DeclareParameter(OutputForceVector, bool);
130 DeclareParameter(OutputParticlePotential, bool);
131 DeclareAlterableParameter(OutputElectricField, bool);
132 DeclareParameter(OutputFluctuatingCharges, bool);
133 DeclareParameter(OutputSitePotential, bool);
134 DeclareParameter(OutputDensity, bool);
135 DeclareParameter(SkinThickness, RealType);
136 DeclareParameter(StatFileFormat, std::string);
137 DeclareParameter(StatFilePrecision, int);
138 DeclareParameter(HydroPropFile, std::string);
139 DeclareParameter(Viscosity, RealType);
140 DeclareParameter(BeadSize, RealType);
141 DeclareParameter(UseSphericalBoundaryConditions, bool);
142 DeclareParameter(SkipPairLoop, bool);
143 DeclareParameter(FrozenBufferRadius, RealType);
144 DeclareParameter(LangevinBufferRadius, RealType);
145 DeclareParameter(AccumulateBoxDipole, bool);
146 DeclareParameter(AccumulateBoxQuadrupole, bool);
147 DeclareParameter(NeighborListNeighbors, int);
148 DeclareParameter(UseMultipleTemperatureMethod, bool);
149 DeclareParameter(MTM_Ce, RealType);
150 DeclareParameter(MTM_G, RealType);
151 DeclareParameter(MTM_Io, RealType);
152 DeclareParameter(MTM_Sigma, RealType);
153 DeclareParameter(MTM_R, RealType);
154 DeclareParameter(UseRestraints, bool);
155 DeclareParameter(Restraint_file, std::string);
156 DeclareParameter(HULL_Method, std::string);
157 DeclareParameter(Alpha, RealType);
158 DeclareAlterableParameter(MDfileVersion, int);
159 DeclareParameter(UniformField, std::vector<RealType>);
160 DeclareParameter(MagneticField, std::vector<RealType>);
161 DeclareParameter(UniformGradientStrength, RealType);
162 DeclareParameter(UniformGradientDirection1, std::vector<RealType>);
163 DeclareParameter(UniformGradientDirection2, std::vector<RealType>);
164 DeclareParameter(ElectricField, std::vector<RealType>);
165 DeclareParameter(ConstraintTime, RealType);
166 DeclareParameter(PotentialSelection, std::string);
167 DeclareParameter(PrivilegedAxis, std::string);
168
169 public:
170 bool addComponent(Component* comp);
171 bool addZConsStamp(ZConsStamp* zcons);
172 bool addRestraintStamp(RestraintStamp* rest);
173 bool addMoleculeStamp(MoleculeStamp* molStamp);
174 bool addFragmentStamp(FragmentStamp* fragStamp);
175 size_t getNComponents() { return components_.size(); }
176 std::vector<Component*> getComponents() { return components_; }
177 Component* getComponentAt(int index) { return components_.at(index); }
178
179 size_t getNZconsStamps() { return zconstraints_.size(); }
180 std::vector<ZConsStamp*> getZconsStamps() { return zconstraints_; }
181 ZConsStamp* getZconsStampAt(int index) { return zconstraints_.at(index); }
182
183 size_t getNRestraintStamps() { return restraints_.size(); }
184 std::vector<RestraintStamp*> getRestraintStamps() { return restraints_; }
185 RestraintStamp* getRestraintStampAt(int index) {
186 return restraints_.at(index);
187 }
188
189 bool addFluctuatingChargeParameters(FluctuatingChargeParameters* flucqPars);
190 FluctuatingChargeParameters* getFluctuatingChargeParameters() {
191 return flucQpars_;
192 }
193
194 bool addRNEMDParameters(RNEMD::RNEMDParameters* rnemdPars);
195 RNEMD::RNEMDParameters* getRNEMDParameters() { return rnemdPars_; }
196
197 bool addLightParameters(Perturbations::LightParameters* lightPars);
198 Perturbations::LightParameters* getLightParameters() { return lightPars_; }
199
200 bool addVelocityFieldParameters(Perturbations::VelocityFieldParameters* vfPars);
201 Perturbations::VelocityFieldParameters* getVelocityFieldParameters() { return vfPars_; }
202
203 bool addMinimizerParameters(MinimizerParameters* miniPars);
204 MinimizerParameters* getMinimizerParameters() { return minimizerPars_; }
205
206 virtual void validate();
207
208 private:
209 std::vector<Component*> components_;
210 std::vector<ZConsStamp*> zconstraints_;
211 std::vector<RestraintStamp*> restraints_;
212 std::map<std::string, MoleculeStamp*> moleculeStamps_;
213 std::map<std::string, FragmentStamp*> fragmentStamps_;
214 std::pair<int, int> taggedAtomPair_;
215 FluctuatingChargeParameters* flucQpars_;
216 RNEMD::RNEMDParameters* rnemdPars_;
219 MinimizerParameters* minimizerPars_;
220 };
221} // namespace OpenMD
222
223#endif
Applies a uniform (vector) magnetic field to the system.
Parsed contents of the velocityField{ ... } block.
Applies a uniform (vector) electric field to the system.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
ElectrostaticSummationMethod