OpenMD 3.0
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 appropriate papers when you publish your
33 * work. Good starting points are:
34 *
35 * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).
36 * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).
37 * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).
38 * [4] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
39 * [5] Kuang & Gezelter, Mol. Phys., 110, 691-701 (2012).
40 * [6] Lamichhane, Gezelter & Newman, J. Chem. Phys. 141, 134109 (2014).
41 * [7] Lamichhane, Newman & Gezelter, J. Chem. Phys. 141, 134110 (2014).
42 * [8] Bhattarai, Newman & Gezelter, Phys. Rev. B 99, 094106 (2019).
43 */
44
45#ifndef IO_GLOBALS_HPP
46#define IO_GLOBALS_HPP
47
48#include <cstdlib>
49#include <iostream>
50#include <map>
51#include <string>
52#include <vector>
53
54#include "flucq/FluctuatingChargeParameters.hpp"
55#include "optimization/MinimizerParameters.hpp"
56#include "rnemd/RNEMDParameters.hpp"
57#include "types/Component.hpp"
58#include "types/FragmentStamp.hpp"
59#include "types/MoleculeStamp.hpp"
60#include "types/RestraintStamp.hpp"
61#include "types/ZconsStamp.hpp"
62#include "utils/ParameterManager.hpp"
63
64namespace OpenMD {
65 class Globals : public DataHolder {
66 public:
67 using intPair = std::pair<int, int>;
68
69 Globals();
70 virtual ~Globals();
71
72 DeclareParameter(ForceField, std::string);
73 DeclareParameter(TargetTemp, RealType);
74 DeclareParameter(Ensemble, std::string);
75 DeclareParameter(Dt, RealType);
76 DeclareParameter(RunTime, RealType);
77 DeclareParameter(FinalConfig, std::string);
78 DeclareParameter(SampleTime, RealType);
79 DeclareParameter(ResetTime, RealType);
80 DeclareParameter(StatusTime, RealType);
81 DeclareParameter(CutoffRadius, RealType);
82 DeclareParameter(SwitchingRadius, RealType);
83 DeclareParameter(TempSet, bool);
84 DeclareParameter(ThermalTime, RealType);
85 DeclareParameter(UsePeriodicBoundaryConditions, bool);
86 DeclareParameter(TargetPressure, RealType);
87 DeclareParameter(UseAtomicVirial, bool);
88 DeclareParameter(UseLongRangeCorrections, bool);
89 DeclareParameter(TauThermostat, RealType);
90 DeclareParameter(TauBarostat, RealType);
91 DeclareParameter(LangevinPistonDrag, RealType);
92 DeclareParameter(ZconsTime, RealType);
93 DeclareParameter(ZconsTol, RealType);
94 DeclareParameter(ZconsForcePolicy, std::string);
95 DeclareParameter(Seed, unsigned long int);
96 DeclareParameter(UseInitalTime, bool);
97 DeclareParameter(UseIntialExtendedSystemState, bool);
98 DeclareParameter(OrthoBoxTolerance, RealType);
99 DeclareParameter(ZconsGap, RealType);
100 DeclareParameter(ZconsFixtime, RealType);
101 DeclareParameter(ZconsUsingSMD, bool);
102 DeclareParameter(UseThermodynamicIntegration, bool);
103 DeclareParameter(ThermodynamicIntegrationLambda, RealType);
104 DeclareParameter(ThermodynamicIntegrationK, RealType);
105 DeclareParameter(ForceFieldVariant, std::string);
106 DeclareParameter(ForceFieldFileName, std::string);
107 DeclareParameter(SurfaceTension, RealType);
108 DeclareParameter(PrintPressureTensor, bool);
109 DeclareParameter(PrintVirialTensor, bool);
110 DeclareParameter(PrintHeatFlux, bool);
111 DeclareParameter(TaggedAtomPair, intPair);
112 DeclareParameter(PrintTaggedPairDistance, bool);
113 DeclareParameter(ElectrostaticSummationMethod, std::string);
114 DeclareParameter(ElectrostaticScreeningMethod, std::string);
115 DeclareParameter(UseSurfaceTerm, bool);
116 DeclareParameter(UseSlabGeometry, bool);
117 DeclareParameter(DampingAlpha, RealType);
118 DeclareParameter(Dielectric, RealType);
119 DeclareParameter(CutoffMethod, std::string);
120 DeclareParameter(SwitchingFunctionType, std::string);
121 DeclareParameter(CompressDumpFile, bool);
122 DeclareParameter(OutputForceVector, bool);
123 DeclareParameter(OutputParticlePotential, bool);
124 DeclareParameter(OutputElectricField, bool);
125 DeclareParameter(OutputFluctuatingCharges, bool);
126 DeclareParameter(OutputSitePotential, bool);
127 DeclareParameter(OutputDensity, bool);
128 DeclareParameter(SkinThickness, RealType);
129 DeclareParameter(StatFileFormat, std::string);
130 DeclareParameter(StatFilePrecision, int);
131 DeclareParameter(HydroPropFile, std::string);
132 DeclareParameter(Viscosity, RealType);
133 DeclareParameter(BeadSize, RealType);
134 DeclareParameter(UseSphericalBoundaryConditions, bool);
135 DeclareParameter(FrozenBufferRadius, RealType);
136 DeclareParameter(LangevinBufferRadius, RealType);
137 DeclareParameter(AccumulateBoxDipole, bool);
138 DeclareParameter(AccumulateBoxQuadrupole, bool);
139 DeclareParameter(NeighborListNeighbors, int);
140 DeclareParameter(UseMultipleTemperatureMethod, bool);
141 DeclareParameter(MTM_Ce, RealType);
142 DeclareParameter(MTM_G, RealType);
143 DeclareParameter(MTM_Io, RealType);
144 DeclareParameter(MTM_Sigma, RealType);
145 DeclareParameter(MTM_R, RealType);
146 DeclareParameter(UseRestraints, bool);
147 DeclareParameter(Restraint_file, std::string);
148 DeclareParameter(HULL_Method, std::string);
149 DeclareParameter(Alpha, RealType);
150 DeclareAlterableParameter(MDfileVersion, int);
151 DeclareParameter(UniformField, std::vector<RealType>);
152 DeclareParameter(MagneticField, std::vector<RealType>);
153 DeclareParameter(UniformGradientStrength, RealType);
154 DeclareParameter(UniformGradientDirection1, std::vector<RealType>);
155 DeclareParameter(UniformGradientDirection2, std::vector<RealType>);
156 DeclareParameter(ElectricField, std::vector<RealType>);
157 DeclareParameter(ConstraintTime, RealType);
158 DeclareParameter(PotentialSelection, std::string);
159 DeclareParameter(PrivilegedAxis, std::string);
160
161 public:
162 bool addComponent(Component* comp);
163 bool addZConsStamp(ZConsStamp* zcons);
164 bool addRestraintStamp(RestraintStamp* rest);
165 bool addMoleculeStamp(MoleculeStamp* molStamp);
166 bool addFragmentStamp(FragmentStamp* fragStamp);
167 size_t getNComponents() { return components_.size(); }
168 std::vector<Component*> getComponents() { return components_; }
169 Component* getComponentAt(int index) { return components_.at(index); }
170
171 size_t getNZconsStamps() { return zconstraints_.size(); }
172 std::vector<ZConsStamp*> getZconsStamps() { return zconstraints_; }
173 ZConsStamp* getZconsStampAt(int index) { return zconstraints_.at(index); }
174
175 size_t getNRestraintStamps() { return restraints_.size(); }
176 std::vector<RestraintStamp*> getRestraintStamps() { return restraints_; }
177 RestraintStamp* getRestraintStampAt(int index) {
178 return restraints_.at(index);
179 }
180
181 bool addFluctuatingChargeParameters(FluctuatingChargeParameters* flucqPars);
182 FluctuatingChargeParameters* getFluctuatingChargeParameters() {
183 return flucQpars_;
184 }
185
186 bool addRNEMDParameters(RNEMD::RNEMDParameters* rnemdPars);
187 RNEMD::RNEMDParameters* getRNEMDParameters() { return rnemdPars_; }
188
189 bool addMinimizerParameters(MinimizerParameters* miniPars);
190 MinimizerParameters* getMinimizerParameters() { return minimizerPars_; }
191
192 virtual void validate();
193
194 private:
195 std::vector<Component*> components_;
196 std::vector<ZConsStamp*> zconstraints_;
197 std::vector<RestraintStamp*> restraints_;
198 std::map<std::string, MoleculeStamp*> moleculeStamps_;
199 std::map<std::string, FragmentStamp*> fragmentStamps_;
200 std::pair<int, int> taggedAtomPair_;
201 FluctuatingChargeParameters* flucQpars_;
202 RNEMD::RNEMDParameters* rnemdPars_;
203 MinimizerParameters* minimizerPars_;
204 };
205} // namespace OpenMD
206
207#endif
Applies a uniform (vector) magnetic field to the system.
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