OpenMD 3.1
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
BAOAB.hpp
1/*
2 * Copyright (c) 2019 The University of Notre Dame. All Rights Reserved.
3 *
4 * The University of Notre Dame grants you ("Licensee") a
5 * non-exclusive, royalty free, license to use, modify and
6 * redistribute this software in source and binary code form, provided
7 * that the following conditions are met:
8 *
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the
15 * distribution.
16 *
17 * This software is provided "AS IS," without a warranty of any
18 * kind. All express or implied conditions, representations and
19 * warranties, including any implied warranty of merchantability,
20 * fitness for a particular purpose or non-infringement, are hereby
21 * excluded. The University of Notre Dame and its licensors shall not
22 * be liable for any damages suffered by licensee as a result of
23 * using, modifying or distributing the software or its
24 * derivatives. In no event will the University of Notre Dame or its
25 * licensors be liable for any lost revenue, profit or data, or for
26 * direct, indirect, special, consequential, incidental or punitive
27 * damages, however caused and regardless of the theory of liability,
28 * arising out of the use of or inability to use software, even if the
29 * University of Notre Dame has been advised of the possibility of
30 * such damages.
31 *
32 * SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your
33 * research, please cite the appropriate papers when you publish your
34 * work. Good starting points are:
35 *
36 * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).
37 * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).
38 * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).
39 * [4] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
40 * [5] Kuang & Gezelter, Mol. Phys., 110, 691-701 (2012).
41 * [6] Lamichhane, Gezelter & Newman, J. Chem. Phys. 141, 134109 (2014).
42 * [7] Lamichhane, Newman & Gezelter, J. Chem. Phys. 141, 134110 (2014).
43 * [8] Bhattarai, Newman & Gezelter, Phys. Rev. B 99, 094106 (2019).
44 */
45
46#ifndef INTEGRATOR_BAOAB_HPP
47#define INTEGRATOR_BAOAB_HPP
48#include <map>
49#include <vector>
50#include "integrators/Integrator.hpp"
52#include "math/SeqRandNumGen.hpp"
53#include "hydrodynamics/Shape.hpp"
54#include "brains/Velocitizer.hpp"
55
56namespace OpenMD {
57
58 struct SDShape {
59 StuntDouble* sd;
60 Shape* shape;
61 };
62
63 struct MomentData {
64 Vector3d rcr; /**< Distance between CoM and Center of Resistance */
65 Mat3x3d Icr; /**< Moment of Inertia at Center of Resistance */
66 Mat3x3d IcrInv; /**< Icr^{-1} */
67 };
68
69 /**
70 * @brief Declaration of the Langevin Dynamics BAOAB Integrator
71 *
72 * Langevin Dynamics based on the BAOAB splitting of Matthews and
73 * Leimkuhler for details see http://dx.doi.org/10.1063/1.4802990
74 * Optionally, one can use the ABOBA splitting. Rigid body
75 * hydrodynamics are from Sun, Lin, and Gezelter. For details see
76 * https://doi.org/10.1063/1.2936991
77 *
78 */
79 class BAOAB: public Integrator {
80 /**
81 * @brief Selects the ordering of the integration steps
82 *
83 * The integrator implements both the BAOAB (better for configurational
84 * averages) and ABOBA splittings. This enum is used to select one or the
85 * other. BAOAB is the default.
86 */
87 enum method_t
88 {
89 LANGEVIN_METHOD_BAOAB,
90 LANGEVIN_METHOD_ABOBA
91 };
92
93
94 public:
95 BAOAB(SimInfo* info);
96 virtual void step();
97
98 private:
99 /**
100 * @brief Integrates all particle positions by dt
101 *
102 * @param dt the time interval to integrate over
103 */
104 void PositionStep(double dt);
105
106 /**
107 * @brief Integrates all particle velocities by dt
108 *
109 * @param dt the time interval to integrate over
110 */
111 virtual void VelocityStep(double dt);
112
113 /**
114 * @brief Computes the O part (Ornstein-Uhlenbeck solve) of the BAOAB scheme
115 *
116 * @param dt the time interval to integrate over
117 */
118 virtual void OStep(RealType dt);
119
120 std::map<std::string, HydroProp*> parseFrictionFile(const std::string& filename);
121 MomentData* getMomentData(StuntDouble* sd);
122
123 void genRandomForceAndTorque(Vector3d& force, Vector3d& torque,
124 unsigned int index, RealType variance);
125
126 std::map<std::string, HydroProp*> hydroPropMap_;
127 std::vector<HydroProp*> hydroProps_;
128 std::map<std::string, MomentData*> momentsMap_;
129 std::vector<MomentData*> moments_;
130
131 SeqRandNumGen randNumGen_; /**< @brief the Random Number Generator(s) */
132 RealType variance_;
133 RealType langevinBufferRadius_;
134 RealType frozenBufferRadius_;
135 bool sphericalBoundaryConditions_;
136 Globals* simParams;
137 Velocitizer* veloMunge;
138 };
139
140}
141#endif
Declaration of the Langevin Dynamics BAOAB Integrator.
Definition BAOAB.hpp:79
virtual void step()
Computes an integration step from t to t+dt.
Definition BAOAB.cpp:242
Declaration of the Integrator base class, which all other integrators inherit from.
One of the heavy-weight classes of OpenMD, SimInfo maintains objects and variables relating to the cu...
Definition SimInfo.hpp:93
"Don't move, or you're dead! Stand up! Captain, we've got them!"
Velocity-modifying routines.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
Vector3d rcr
Distance between CoM and Center of Resistance.
Definition BAOAB.hpp:64
Mat3x3d IcrInv
Icr^{-1}
Definition BAOAB.hpp:66
Mat3x3d Icr
Moment of Inertia at Center of Resistance.
Definition BAOAB.hpp:65