OpenMD 3.1
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
HydroProp.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 HYDRODYNAMICS_HYDROPROP_HPP
46#define HYDRODYNAMICS_HYDROPROP_HPP
47
49#include "math/Vector3.hpp"
50
51namespace OpenMD {
52
53 /**
54 * @class HydroProp HydroProp.hpp "hydrodynamics/HydroProp.hpp"
55 * Container for information about the hydrodynamic behavior of objects
56 * interacting with surroundings.
57 * @note the units for the center of resistance (a location) are in Angstroms
58 *
59 * @note the units of the resistance tensor are:
60 * Xitt (Translation-translation) : kcal fs mol^-1 Angstroms^-2
61 * Xirt (Rotation-translation) : kcal fs mol^-1 Angstroms^-1 radians^-1
62 * Xitr (Translation-rotation) : kcal fs mol^-1 Angstroms^-1 radians^-1
63 * Xirr (Rotation-rotation) : kcal fs mol^-1 radians^-2
64 *
65 * @note the units of D, the diffusion tensor are:
66 * Dtt (Translation-translation) : Angstroms^2 fs^-1
67 * Drt (Rotation-translation) : Angstroms fs^-1
68 * Dtr (Translation-rotation) : Angstroms fs^-1
69 * Drr (Rotation-rotation) : fs^-1
70 *
71 * @note after setting the value of Xi manually, the complete() function
72 * should be called to perform the Cholesky Decomposition.
73 */
74 class HydroProp {
75 public:
76 HydroProp();
77 HydroProp(Vector3d cor, Mat6x6d Xi);
78
79 void setName(std::string name) { name_ = name; }
80 std::string getName() { return name_; }
81
82 void setCenterOfResistance(Vector3d cor) {
83 cor_ = cor;
84 hasCOR_ = true;
85 }
86 Vector3d getCenterOfResistance() { return cor_; }
87
88 void setResistanceTensor(Mat6x6d Xi) {
89 Xi_ = Xi;
90 hasXi_ = true;
91 complete();
92 }
93 Mat6x6d getResistanceTensor() { return Xi_; }
94 Mat3x3d getXitt();
95 Mat3x3d getXitr();
96 Mat3x3d getXirt();
97 Mat3x3d getXirr();
98
99 void complete();
100 /*
101 * Returns the result of a Cholesky decomposition to obtain the
102 * square root matrix of the resistance tensor,
103 * \f[ \Xi = S S^T \f]
104 * where S is a lower triangular matrix.
105 */
106 Mat6x6d getS();
107
108 Mat6x6d getDiffusionTensor(RealType temperature);
109
110 /*
111 * Recomputes the Resistance Tensor at a new location
112 */
113 Mat6x6d getResistanceTensorAtPos(Vector3d pos);
114 /*
115 * Recomputes the Diffusion Tensor at a new location (and temperature)
116 */
117 Mat6x6d getDiffusionTensorAtPos(Vector3d pos, RealType temperature);
118 /*
119 * Computes the Center Of Diffusion at a particular temperature
120 */
121 Vector3d getCenterOfDiffusion(RealType temperature);
122
123 Mat3x3d getPitchMatrix();
124 RealType getScalarPitch();
125 void pitchAxes(Mat3x3d& pitchAxes, Vector3d& pitches,
126 RealType& pitchScalar);
127
128 /*
129 * Computes the Center of Pitch
130 */
131 Vector3d getCenterOfPitch();
132
133 private:
134 std::string name_;
135 Vector3d cor_; // Center of Resistance
136 Mat6x6d Xi_; // Resistance Tensor
137 Mat6x6d S_; // Cholesky Decomposition of Xi_
138 bool hasCOR_;
139 bool hasXi_;
140 bool hasS_;
141 };
142} // namespace OpenMD
143
144#endif
Container for information about the hydrodynamic behavior of objects interacting with surroundings.
Definition HydroProp.hpp:74
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.