6 |
|
* redistribute this software in source and binary code form, provided |
7 |
|
* that the following conditions are met: |
8 |
|
* |
9 |
< |
* 1. Acknowledgement of the program authors must be made in any |
10 |
< |
* publication of scientific results based in part on use of the |
11 |
< |
* program. An acceptable form of acknowledgement is citation of |
12 |
< |
* the article in which the program was described (Matthew |
13 |
< |
* A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher |
14 |
< |
* J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented |
15 |
< |
* Parallel Simulation Engine for Molecular Dynamics," |
16 |
< |
* J. Comput. Chem. 26, pp. 252-271 (2005)) |
17 |
< |
* |
18 |
< |
* 2. Redistributions of source code must retain the above copyright |
9 |
> |
* 1. Redistributions of source code must retain the above copyright |
10 |
|
* notice, this list of conditions and the following disclaimer. |
11 |
|
* |
12 |
< |
* 3. Redistributions in binary form must reproduce the above copyright |
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. |
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] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
40 |
+ |
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
41 |
|
*/ |
42 |
|
#include "applications/hydrodynamics/HydrodynamicsModel.hpp" |
43 |
< |
#include "applications/hydrodynamics/Spheric.hpp" |
44 |
< |
#include "applications/hydrodynamics/Ellipsoid.hpp" |
43 |
> |
#include "hydrodynamics/Shape.hpp" |
44 |
> |
#include "hydrodynamics/Sphere.hpp" |
45 |
> |
#include "hydrodynamics/Ellipsoid.hpp" |
46 |
|
#include "applications/hydrodynamics/CompositeShape.hpp" |
47 |
|
|
48 |
< |
namespace oopse { |
49 |
< |
|
50 |
< |
bool HydrodynamicsModel::calcHydroProps(Spheric* spheric, double viscosity, double temperature) { |
48 |
> |
namespace OpenMD { |
49 |
> |
|
50 |
> |
bool HydrodynamicsModel::calcHydroProps(Shape* shape, RealType viscosity, RealType temperature) { |
51 |
|
return false; |
52 |
< |
} |
52 |
> |
} |
53 |
> |
|
54 |
> |
void HydrodynamicsModel::writeHydroProps(std::ostream& os) { |
55 |
|
|
56 |
< |
bool HydrodynamicsModel::calcHydroProps(Ellipsoid* ellipsoid, double viscosity, double temperature) { |
57 |
< |
return false; |
54 |
< |
} |
55 |
< |
|
56 |
< |
bool HydrodynamicsModel::calcHydroProps(CompositeShape* compositexShape, double viscosity, double temperature) { |
57 |
< |
return false; |
58 |
< |
} |
59 |
< |
|
60 |
< |
void HydrodynamicsModel::writeHydroProps(std::ostream& os) { |
61 |
< |
|
56 |
> |
Vector3d center; |
57 |
> |
Mat6x6d Xi, D; |
58 |
|
|
59 |
|
os << sd_->getType() << "\t"; |
60 |
|
|
61 |
|
//center of resistance |
66 |
– |
os << cr_.center[0] << "\t" << cr_.center[1] << "\t" << cr_.center[2] << "\t"; |
62 |
|
|
63 |
+ |
center = cr_->getCOR(); |
64 |
+ |
|
65 |
+ |
os << center[0] << "\t" << center[1] << "\t" << center[2] << "\t"; |
66 |
+ |
|
67 |
|
//resistance tensor at center of resistance |
68 |
|
//translation |
70 |
– |
os << cr_.Xi(0, 0) << "\t" << cr_.Xi(0, 1) << "\t" << cr_.Xi(0, 2) << "\t" |
71 |
– |
<< cr_.Xi(1, 0) << "\t" << cr_.Xi(1, 1) << "\t" << cr_.Xi(1, 2) << "\t" |
72 |
– |
<< cr_.Xi(2, 0) << "\t" << cr_.Xi(2, 1) << "\t" << cr_.Xi(2, 2) << "\t"; |
69 |
|
|
70 |
< |
//rotation-translation |
75 |
< |
os << cr_.Xi(0, 3) << "\t" << cr_.Xi(0, 4) << "\t" << cr_.Xi(0, 5) << "\t" |
76 |
< |
<< cr_.Xi(1, 3) << "\t" << cr_.Xi(1, 4) << "\t" << cr_.Xi(1, 5) << "\t" |
77 |
< |
<< cr_.Xi(2, 3) << "\t" << cr_.Xi(2, 4) << "\t" << cr_.Xi(2, 5) << "\t"; |
70 |
> |
Xi = cr_->getXi(); |
71 |
|
|
72 |
+ |
os << Xi(0, 0) << "\t" << Xi(0, 1) << "\t" << Xi(0, 2) << "\t" |
73 |
+ |
<< Xi(1, 0) << "\t" << Xi(1, 1) << "\t" << Xi(1, 2) << "\t" |
74 |
+ |
<< Xi(2, 0) << "\t" << Xi(2, 1) << "\t" << Xi(2, 2) << "\t"; |
75 |
+ |
|
76 |
+ |
//rotation-translation |
77 |
+ |
os << Xi(0, 3) << "\t" << Xi(0, 4) << "\t" << Xi(0, 5) << "\t" |
78 |
+ |
<< Xi(1, 3) << "\t" << Xi(1, 4) << "\t" << Xi(1, 5) << "\t" |
79 |
+ |
<< Xi(2, 3) << "\t" << Xi(2, 4) << "\t" << Xi(2, 5) << "\t"; |
80 |
+ |
|
81 |
|
//translation-rotation |
82 |
< |
os << cr_.Xi(3, 0) << "\t" << cr_.Xi(3, 1) << "\t" << cr_.Xi(3, 2) << "\t" |
83 |
< |
<< cr_.Xi(4, 0) << "\t" << cr_.Xi(4, 1) << "\t" << cr_.Xi(4, 2) << "\t" |
84 |
< |
<< cr_.Xi(5, 0) << "\t" << cr_.Xi(5, 1) << "\t" << cr_.Xi(5, 2) << "\t"; |
85 |
< |
|
82 |
> |
os << Xi(3, 0) << "\t" << Xi(3, 1) << "\t" << Xi(3, 2) << "\t" |
83 |
> |
<< Xi(4, 0) << "\t" << Xi(4, 1) << "\t" << Xi(4, 2) << "\t" |
84 |
> |
<< Xi(5, 0) << "\t" << Xi(5, 1) << "\t" << Xi(5, 2) << "\t"; |
85 |
> |
|
86 |
|
//rotation |
87 |
< |
os << cr_.Xi(3, 3) << "\t" << cr_.Xi(3, 4) << "\t" << cr_.Xi(3, 5) << "\t" |
88 |
< |
<< cr_.Xi(4, 3) << "\t" << cr_.Xi(4, 4) << "\t" << cr_.Xi(4, 5) << "\t" |
89 |
< |
<< cr_.Xi(5, 3) << "\t" << cr_.Xi(5, 4) << "\t" << cr_.Xi(5, 5) << "\t"; |
90 |
< |
|
91 |
< |
|
87 |
> |
os << Xi(3, 3) << "\t" << Xi(3, 4) << "\t" << Xi(3, 5) << "\t" |
88 |
> |
<< Xi(4, 3) << "\t" << Xi(4, 4) << "\t" << Xi(4, 5) << "\t" |
89 |
> |
<< Xi(5, 3) << "\t" << Xi(5, 4) << "\t" << Xi(5, 5) << "\t"; |
90 |
> |
|
91 |
> |
|
92 |
|
//diffusion tensor at center of resistance |
93 |
|
//translation |
92 |
– |
os << cr_.D(0, 0) << "\t" << cr_.D(0, 1) << "\t" << cr_.D(0, 2) << "\t" |
93 |
– |
<< cr_.D(1, 0) << "\t" << cr_.D(1, 1) << "\t" << cr_.D(1, 2) << "\t" |
94 |
– |
<< cr_.D(2, 0) << "\t" << cr_.D(2, 1) << "\t" << cr_.D(2, 2) << "\t"; |
94 |
|
|
95 |
< |
//rotation-translation |
97 |
< |
os << cr_.D(0, 3) << "\t" << cr_.D(0, 4) << "\t" << cr_.D(0, 5) << "\t" |
98 |
< |
<< cr_.D(1, 3) << "\t" << cr_.D(1, 4) << "\t" << cr_.D(1, 5) << "\t" |
99 |
< |
<< cr_.D(2, 3) << "\t" << cr_.D(2, 4) << "\t" << cr_.D(2, 5) << "\t"; |
95 |
> |
D = cr_->getD(); |
96 |
|
|
97 |
+ |
os << D(0, 0) << "\t" << D(0, 1) << "\t" << D(0, 2) << "\t" |
98 |
+ |
<< D(1, 0) << "\t" << D(1, 1) << "\t" << D(1, 2) << "\t" |
99 |
+ |
<< D(2, 0) << "\t" << D(2, 1) << "\t" << D(2, 2) << "\t"; |
100 |
+ |
|
101 |
+ |
//rotation-translation |
102 |
+ |
os << D(0, 3) << "\t" << D(0, 4) << "\t" << D(0, 5) << "\t" |
103 |
+ |
<< D(1, 3) << "\t" << D(1, 4) << "\t" << D(1, 5) << "\t" |
104 |
+ |
<< D(2, 3) << "\t" << D(2, 4) << "\t" << D(2, 5) << "\t"; |
105 |
+ |
|
106 |
|
//translation-rotation |
107 |
< |
os << cr_.D(3, 0) << "\t" << cr_.D(3, 1) << "\t" << cr_.D(3, 2) << "\t" |
108 |
< |
<< cr_.D(4, 0) << "\t" << cr_.D(4, 1) << "\t" << cr_.D(4, 2) << "\t" |
109 |
< |
<< cr_.D(5, 0) << "\t" << cr_.D(5, 1) << "\t" << cr_.D(5, 2) << "\t"; |
110 |
< |
|
107 |
> |
os << D(3, 0) << "\t" << D(3, 1) << "\t" << D(3, 2) << "\t" |
108 |
> |
<< D(4, 0) << "\t" << D(4, 1) << "\t" << D(4, 2) << "\t" |
109 |
> |
<< D(5, 0) << "\t" << D(5, 1) << "\t" << D(5, 2) << "\t"; |
110 |
> |
|
111 |
|
//rotation |
112 |
< |
os << cr_.D(3, 3) << "\t" << cr_.D(3, 4) << "\t" << cr_.D(3, 5) << "\t" |
113 |
< |
<< cr_.D(4, 3) << "\t" << cr_.D(4, 4) << "\t" << cr_.D(4, 5) << "\t" |
114 |
< |
<< cr_.D(5, 3) << "\t" << cr_.D(5, 4) << "\t" << cr_.D(5, 5) << "\t"; |
115 |
< |
|
112 |
> |
os << D(3, 3) << "\t" << D(3, 4) << "\t" << D(3, 5) << "\t" |
113 |
> |
<< D(4, 3) << "\t" << D(4, 4) << "\t" << D(4, 5) << "\t" |
114 |
> |
<< D(5, 3) << "\t" << D(5, 4) << "\t" << D(5, 5) << "\t"; |
115 |
> |
|
116 |
|
//--------------------------------------------------------------------- |
117 |
< |
|
117 |
> |
|
118 |
|
//center of diffusion |
114 |
– |
os << cd_.center[0] << "\t" << cd_.center[1] << "\t" << cd_.center[2] << "\t"; |
119 |
|
|
120 |
+ |
center = cd_->getCOR(); |
121 |
+ |
|
122 |
+ |
os << center[0] << "\t" << center[1] << "\t" << center[2] << "\t"; |
123 |
+ |
|
124 |
|
//resistance tensor at center of diffusion |
125 |
|
//translation |
118 |
– |
os << cd_.Xi(0, 0) << "\t" << cd_.Xi(0, 1) << "\t" << cd_.Xi(0, 2) << "\t" |
119 |
– |
<< cd_.Xi(1, 0) << "\t" << cd_.Xi(1, 1) << "\t" << cd_.Xi(1, 2) << "\t" |
120 |
– |
<< cd_.Xi(2, 0) << "\t" << cd_.Xi(2, 1) << "\t" << cd_.Xi(2, 2) << "\t"; |
126 |
|
|
127 |
< |
//rotation-translation |
123 |
< |
os << cd_.Xi(0, 3) << "\t" << cd_.Xi(0, 4) << "\t" << cd_.Xi(0, 5) << "\t" |
124 |
< |
<< cd_.Xi(1, 3) << "\t" << cd_.Xi(1, 4) << "\t" << cd_.Xi(1, 5) << "\t" |
125 |
< |
<< cd_.Xi(2, 3) << "\t" << cd_.Xi(2, 4) << "\t" << cd_.Xi(2, 5) << "\t"; |
127 |
> |
Xi = cd_->getXi(); |
128 |
|
|
129 |
+ |
os << Xi(0, 0) << "\t" << Xi(0, 1) << "\t" << Xi(0, 2) << "\t" |
130 |
+ |
<< Xi(1, 0) << "\t" << Xi(1, 1) << "\t" << Xi(1, 2) << "\t" |
131 |
+ |
<< Xi(2, 0) << "\t" << Xi(2, 1) << "\t" << Xi(2, 2) << "\t"; |
132 |
+ |
|
133 |
+ |
//rotation-translation |
134 |
+ |
os << Xi(0, 3) << "\t" << Xi(0, 4) << "\t" << Xi(0, 5) << "\t" |
135 |
+ |
<< Xi(1, 3) << "\t" << Xi(1, 4) << "\t" << Xi(1, 5) << "\t" |
136 |
+ |
<< Xi(2, 3) << "\t" << Xi(2, 4) << "\t" << Xi(2, 5) << "\t"; |
137 |
+ |
|
138 |
|
//translation-rotation |
139 |
< |
os << cd_.Xi(3, 0) << "\t" << cd_.Xi(3, 1) << "\t" << cd_.Xi(3, 2) << "\t" |
140 |
< |
<< cd_.Xi(4, 0) << "\t" << cd_.Xi(4, 1) << "\t" << cd_.Xi(4, 2) << "\t" |
141 |
< |
<< cd_.Xi(5, 0) << "\t" << cd_.Xi(5, 1) << "\t" << cd_.Xi(5, 2) << "\t"; |
142 |
< |
|
139 |
> |
os << Xi(3, 0) << "\t" << Xi(3, 1) << "\t" << Xi(3, 2) << "\t" |
140 |
> |
<< Xi(4, 0) << "\t" << Xi(4, 1) << "\t" << Xi(4, 2) << "\t" |
141 |
> |
<< Xi(5, 0) << "\t" << Xi(5, 1) << "\t" << Xi(5, 2) << "\t"; |
142 |
> |
|
143 |
|
//rotation |
144 |
< |
os << cd_.Xi(3, 3) << "\t" << cd_.Xi(3, 4) << "\t" << cd_.Xi(3, 5) << "\t" |
145 |
< |
<< cd_.Xi(4, 3) << "\t" << cd_.Xi(4, 4) << "\t" << cd_.Xi(4, 5) << "\t" |
146 |
< |
<< cd_.Xi(5, 3) << "\t" << cd_.Xi(5, 4) << "\t" << cd_.Xi(5, 5) << "\t"; |
147 |
< |
|
148 |
< |
|
144 |
> |
os << Xi(3, 3) << "\t" << Xi(3, 4) << "\t" << Xi(3, 5) << "\t" |
145 |
> |
<< Xi(4, 3) << "\t" << Xi(4, 4) << "\t" << Xi(4, 5) << "\t" |
146 |
> |
<< Xi(5, 3) << "\t" << Xi(5, 4) << "\t" << Xi(5, 5) << "\t"; |
147 |
> |
|
148 |
> |
|
149 |
|
//diffusion tensor at center of diffusion |
150 |
|
//translation |
140 |
– |
os << cd_.D(0, 0) << "\t" << cd_.D(0, 1) << "\t" << cd_.D(0, 2) << "\t" |
141 |
– |
<< cd_.D(1, 0) << "\t" << cd_.D(1, 1) << "\t" << cd_.D(1, 2) << "\t" |
142 |
– |
<< cd_.D(2, 0) << "\t" << cd_.D(2, 1) << "\t" << cd_.D(2, 2) << "\t"; |
151 |
|
|
152 |
< |
//rotation-translation |
145 |
< |
os << cd_.D(0, 3) << "\t" << cd_.D(0, 4) << "\t" << cd_.D(0, 5) << "\t" |
146 |
< |
<< cd_.D(1, 3) << "\t" << cd_.D(1, 4) << "\t" << cd_.D(1, 5) << "\t" |
147 |
< |
<< cd_.D(2, 3) << "\t" << cd_.D(2, 4) << "\t" << cd_.D(2, 5) << "\t"; |
152 |
> |
D = cd_->getD(); |
153 |
|
|
154 |
+ |
os << D(0, 0) << "\t" << D(0, 1) << "\t" << D(0, 2) << "\t" |
155 |
+ |
<< D(1, 0) << "\t" << D(1, 1) << "\t" << D(1, 2) << "\t" |
156 |
+ |
<< D(2, 0) << "\t" << D(2, 1) << "\t" << D(2, 2) << "\t"; |
157 |
+ |
|
158 |
+ |
//rotation-translation |
159 |
+ |
os << D(0, 3) << "\t" << D(0, 4) << "\t" << D(0, 5) << "\t" |
160 |
+ |
<< D(1, 3) << "\t" << D(1, 4) << "\t" << D(1, 5) << "\t" |
161 |
+ |
<< D(2, 3) << "\t" << D(2, 4) << "\t" << D(2, 5) << "\t"; |
162 |
+ |
|
163 |
|
//translation-rotation |
164 |
< |
os << cd_.D(3, 0) << "\t" << cd_.D(3, 1) << "\t" << cd_.D(3, 2) << "\t" |
165 |
< |
<< cd_.D(4, 0) << "\t" << cd_.D(4, 1) << "\t" << cd_.D(4, 2) << "\t" |
166 |
< |
<< cd_.D(5, 0) << "\t" << cd_.D(5, 1) << "\t" << cd_.D(5, 2) << "\t"; |
167 |
< |
|
164 |
> |
os << D(3, 0) << "\t" << D(3, 1) << "\t" << D(3, 2) << "\t" |
165 |
> |
<< D(4, 0) << "\t" << D(4, 1) << "\t" << D(4, 2) << "\t" |
166 |
> |
<< D(5, 0) << "\t" << D(5, 1) << "\t" << D(5, 2) << "\t"; |
167 |
> |
|
168 |
|
//rotation |
169 |
< |
os << cd_.D(3, 3) << "\t" << cd_.D(3, 4) << "\t" << cd_.D(3, 5) << "\t" |
170 |
< |
<< cd_.D(4, 3) << "\t" << cd_.D(4, 4) << "\t" << cd_.D(4, 5) << "\t" |
171 |
< |
<< cd_.D(5, 3) << "\t" << cd_.D(5, 4) << "\t" << cd_.D(5, 5) << "\n"; |
172 |
< |
|
173 |
< |
|
169 |
> |
os << D(3, 3) << "\t" << D(3, 4) << "\t" << D(3, 5) << "\t" |
170 |
> |
<< D(4, 3) << "\t" << D(4, 4) << "\t" << D(4, 5) << "\t" |
171 |
> |
<< D(5, 3) << "\t" << D(5, 4) << "\t" << D(5, 5) << "\n"; |
172 |
> |
|
173 |
> |
} |
174 |
> |
|
175 |
|
} |
161 |
– |
|
162 |
– |
} |