OpenMD 3.1
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 "perturbations/LightParameters.hpp"
57#include "rnemd/RNEMDParameters.hpp"
58#include "types/Component.hpp"
59#include "types/FragmentStamp.hpp"
60#include "types/MoleculeStamp.hpp"
61#include "types/RestraintStamp.hpp"
62#include "types/ZconsStamp.hpp"
63#include "utils/ParameterManager.hpp"
64
65namespace OpenMD {
66 class Globals : public DataHolder {
67 public:
68 using intPair = std::pair<int, int>;
69
70 Globals();
71 virtual ~Globals();
72
73 DeclareParameter(ForceField, std::string);
74 DeclareParameter(TargetTemp, RealType);
75 DeclareParameter(Ensemble, std::string);
76 DeclareParameter(Dt, RealType);
77 DeclareParameter(RunTime, RealType);
78 DeclareParameter(FinalConfig, std::string);
79 DeclareParameter(SampleTime, RealType);
80 DeclareParameter(ResetTime, RealType);
81 DeclareParameter(StatusTime, RealType);
82 DeclareParameter(CutoffRadius, RealType);
83 DeclareParameter(SwitchingRadius, RealType);
84 DeclareParameter(TempSet, bool);
85 DeclareParameter(ThermalTime, RealType);
86 DeclareParameter(UsePeriodicBoundaryConditions, bool);
87 DeclareParameter(ConserveLinearMomentum, bool);
88 DeclareParameter(ConserveAngularMomentum, bool);
89 DeclareParameter(TargetPressure, RealType);
90 DeclareParameter(UseAtomicVirial, bool);
91 DeclareParameter(UseLongRangeCorrections, bool);
92 DeclareParameter(TauThermostat, RealType);
93 DeclareParameter(TauBarostat, RealType);
94 DeclareParameter(LangevinPistonDrag, RealType);
95 DeclareParameter(ZconsTime, RealType);
96 DeclareParameter(ZconsTol, RealType);
97 DeclareParameter(ZconsForcePolicy, std::string);
98 DeclareParameter(Seed, unsigned long int);
99 DeclareParameter(UseInitalTime, bool);
100 DeclareParameter(UseIntialExtendedSystemState, bool);
101 DeclareParameter(OrthoBoxTolerance, RealType);
102 DeclareParameter(ZconsGap, RealType);
103 DeclareParameter(ZconsFixtime, RealType);
104 DeclareParameter(ZconsUsingSMD, bool);
105 DeclareParameter(UseThermodynamicIntegration, bool);
106 DeclareParameter(ThermodynamicIntegrationLambda, RealType);
107 DeclareParameter(ThermodynamicIntegrationK, RealType);
108 DeclareParameter(ForceFieldVariant, std::string);
109 DeclareParameter(ForceFieldFileName, std::string);
110 DeclareParameter(SurfaceTension, RealType);
111 DeclareParameter(PrintPressureTensor, bool);
112 DeclareParameter(PrintVirialTensor, bool);
113 DeclareParameter(PrintHeatFlux, bool);
114 DeclareParameter(TaggedAtomPair, intPair);
115 DeclareParameter(PrintTaggedPairDistance, bool);
116 DeclareParameter(ElectrostaticSummationMethod, std::string);
117 DeclareParameter(ElectrostaticScreeningMethod, std::string);
118 DeclareParameter(UseSurfaceTerm, bool);
119 DeclareParameter(UseSlabGeometry, bool);
120 DeclareParameter(DampingAlpha, RealType);
121 DeclareParameter(Dielectric, RealType);
122 DeclareParameter(CutoffMethod, std::string);
123 DeclareParameter(SwitchingFunctionType, std::string);
124 DeclareParameter(CompressDumpFile, bool);
125 DeclareParameter(OutputForceVector, bool);
126 DeclareParameter(OutputParticlePotential, bool);
127 DeclareParameter(OutputElectricField, bool);
128 DeclareParameter(OutputFluctuatingCharges, bool);
129 DeclareParameter(OutputSitePotential, bool);
130 DeclareParameter(OutputDensity, bool);
131 DeclareParameter(SkinThickness, RealType);
132 DeclareParameter(StatFileFormat, std::string);
133 DeclareParameter(StatFilePrecision, int);
134 DeclareParameter(HydroPropFile, std::string);
135 DeclareParameter(Viscosity, RealType);
136 DeclareParameter(BeadSize, RealType);
137 DeclareParameter(UseSphericalBoundaryConditions, bool);
138 DeclareParameter(FrozenBufferRadius, RealType);
139 DeclareParameter(LangevinBufferRadius, RealType);
140 DeclareParameter(AccumulateBoxDipole, bool);
141 DeclareParameter(AccumulateBoxQuadrupole, bool);
142 DeclareParameter(NeighborListNeighbors, int);
143 DeclareParameter(UseMultipleTemperatureMethod, bool);
144 DeclareParameter(MTM_Ce, RealType);
145 DeclareParameter(MTM_G, RealType);
146 DeclareParameter(MTM_Io, RealType);
147 DeclareParameter(MTM_Sigma, RealType);
148 DeclareParameter(MTM_R, RealType);
149 DeclareParameter(UseRestraints, bool);
150 DeclareParameter(Restraint_file, std::string);
151 DeclareParameter(HULL_Method, std::string);
152 DeclareParameter(Alpha, RealType);
153 DeclareAlterableParameter(MDfileVersion, int);
154 DeclareParameter(UniformField, std::vector<RealType>);
155 DeclareParameter(MagneticField, std::vector<RealType>);
156 DeclareParameter(UniformGradientStrength, RealType);
157 DeclareParameter(UniformGradientDirection1, std::vector<RealType>);
158 DeclareParameter(UniformGradientDirection2, std::vector<RealType>);
159 DeclareParameter(ElectricField, std::vector<RealType>);
160 DeclareParameter(ConstraintTime, RealType);
161 DeclareParameter(PotentialSelection, std::string);
162 DeclareParameter(PrivilegedAxis, std::string);
163
164 public:
165 bool addComponent(Component* comp);
166 bool addZConsStamp(ZConsStamp* zcons);
167 bool addRestraintStamp(RestraintStamp* rest);
168 bool addMoleculeStamp(MoleculeStamp* molStamp);
169 bool addFragmentStamp(FragmentStamp* fragStamp);
170 size_t getNComponents() { return components_.size(); }
171 std::vector<Component*> getComponents() { return components_; }
172 Component* getComponentAt(int index) { return components_.at(index); }
173
174 size_t getNZconsStamps() { return zconstraints_.size(); }
175 std::vector<ZConsStamp*> getZconsStamps() { return zconstraints_; }
176 ZConsStamp* getZconsStampAt(int index) { return zconstraints_.at(index); }
177
178 size_t getNRestraintStamps() { return restraints_.size(); }
179 std::vector<RestraintStamp*> getRestraintStamps() { return restraints_; }
180 RestraintStamp* getRestraintStampAt(int index) {
181 return restraints_.at(index);
182 }
183
184 bool addFluctuatingChargeParameters(FluctuatingChargeParameters* flucqPars);
185 FluctuatingChargeParameters* getFluctuatingChargeParameters() {
186 return flucQpars_;
187 }
188
189 bool addRNEMDParameters(RNEMD::RNEMDParameters* rnemdPars);
190 RNEMD::RNEMDParameters* getRNEMDParameters() { return rnemdPars_; }
191
192 bool addLightParameters(Perturbations::LightParameters* lightPars);
193 Perturbations::LightParameters* getLightParameters() { return lightPars_; }
194
195 bool addMinimizerParameters(MinimizerParameters* miniPars);
196 MinimizerParameters* getMinimizerParameters() { return minimizerPars_; }
197
198 virtual void validate();
199
200 private:
201 std::vector<Component*> components_;
202 std::vector<ZConsStamp*> zconstraints_;
203 std::vector<RestraintStamp*> restraints_;
204 std::map<std::string, MoleculeStamp*> moleculeStamps_;
205 std::map<std::string, FragmentStamp*> fragmentStamps_;
206 std::pair<int, int> taggedAtomPair_;
207 FluctuatingChargeParameters* flucQpars_;
208 RNEMD::RNEMDParameters* rnemdPars_;
210 MinimizerParameters* minimizerPars_;
211 };
212} // namespace OpenMD
213
214#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