52 |
|
#include "brains/SimInfo.hpp" |
53 |
|
|
54 |
|
namespace OpenMD { |
55 |
– |
|
56 |
– |
struct UniGradPars { |
57 |
– |
RealType a; |
58 |
– |
RealType b; |
59 |
– |
RealType c; |
60 |
– |
RealType alpha; |
61 |
– |
RealType beta; |
62 |
– |
}; |
55 |
|
|
56 |
|
//! Applies a uniform electric field gradient to the system |
57 |
|
/*! The gradient is applied as an external perturbation. The user specifies |
58 |
|
|
59 |
|
\code{.unparsed} |
60 |
< |
uniformGradient = (a, b, c, alpha, beta); |
60 |
> |
uniformGradientStrength = c; |
61 |
> |
uniformGradientDirection1 = (a1, a2, a3) |
62 |
> |
uniformGradientDirection2 = (b1, b2, b3); |
63 |
|
\endcode |
64 |
|
|
65 |
< |
in the .md file where the values of a, b, c, alpha, beta are in units of |
66 |
< |
\f$ V / \AA^2 \f$ |
65 |
> |
in the .md file where the two direction vectors, \f$ \mathbf{a} \f$ |
66 |
> |
and \f$ \mathbf{b} \f$ are unit vectors, and the value of \f$ g \f$ |
67 |
> |
is in units of \f$ V / \AA^2 \f$ |
68 |
|
|
69 |
|
The electrostatic potential corresponding to this uniform gradient is |
70 |
|
|
71 |
< |
\f$ \phi(\mathbf{r}) = - a x y - b x z - c y z - \alpha x^2 / 2 - \beta y^2 / 2 + (\alpha + \beta) z^2 / 2 \f$ |
71 |
> |
\f$ \phi(\mathbf{r}) = - \frac{g}{2} \left[ |
72 |
> |
\left(a_1 b_1 - \frac{\cos\psi}{3}\right) x^2 |
73 |
> |
+ (a_1 b_2 + a_2 b_1) x y + (a_1 b_3 + a_3 b_1) x z + |
74 |
> |
+ (a_2 b_1 + a_1 b_2) y x |
75 |
> |
+ \left(a_2 b_2 - \frac{\cos\psi}{3}\right) y^2 |
76 |
> |
+ (a_2 b_3 + a_3 b_2) y z + (a_3 b_1 + a_1 b_3) z x |
77 |
> |
+ (a_3 b_2 + a_2 b_3) z y |
78 |
> |
+ \left(a_3 b_3 - \frac{\cos\psi}{3}\right) z^2 \right] \f$ |
79 |
|
|
80 |
< |
which grows unbounded and is not periodic. For these reasons, |
80 |
> |
where \f$ \cos \psi = \mathbf{a} \cdot \mathbf{b} \f$. Note that |
81 |
> |
this potential grows unbounded and is not periodic. For these reasons, |
82 |
|
care should be taken in using a Uniform Gradient with point charges. |
83 |
|
|
84 |
|
The corresponding field is: |
85 |
|
|
86 |
< |
\f$ \mathbf{E} = \left( \array{c} \alpha x + a y + b z \\ a x + \beta y + c z \\ b x + c y - (\alpha + \beta) z \end{array} \right) \f$ |
86 |
> |
\f$ \mathbf{E} = \frac{g}{2} \left( |
87 |
> |
2\left(a_1 b_1 - \frac{\cos\psi}{3}\right) x + (a_1 b_2 + a_2 b_1) y |
88 |
> |
+ (a_1 b_3 + a_3 b_1) z \\ |
89 |
> |
(a_2 b_1 + a_1 b_2) x + 2 \left(a_2 b_2 - \frac{\cos\psi}{3}\right) y |
90 |
> |
+ (a_2 b_3 + a_3 b_2) z \\ |
91 |
> |
(a_3 b_1 + a_1 b_3) x + (a_3 b_2 + a_2 b_3) y |
92 |
> |
+ 2 \left(a_3 b_3 - \frac{\cos\psi}{3}\right) z \end{array} \right) \f$ |
93 |
|
|
94 |
|
The field also grows unbounded and is not periodic. For these reasons, |
95 |
|
care should be taken in using a Uniform Gradient with point dipoles. |
96 |
|
|
97 |
|
The corresponding field gradient is: |
98 |
|
|
99 |
< |
\f$ \nabla \mathbf{E} = \left( \array{ccc} \alpha & a & b \\ a & \beta & c \\ b & c & -(\alpha + \beta) \end{array} \right) \f$ |
99 |
> |
\f$ \nabla \mathbf{E} = \frac{g}{2} \left( \array{ccc} |
100 |
> |
2\left(a_1 b_1 - \frac{\cos\psi}{3}\right) & |
101 |
> |
(a_1 b_2 + a_2 b_1) & (a_1 b_3 + a_3 b_1) \\ |
102 |
> |
(a_2 b_1 + a_1 b_2) & 2 \left(a_2 b_2 - \frac{\cos\psi}{3}\right) & |
103 |
> |
(a_2 b_3 + a_3 b_2) \\ |
104 |
> |
(a_3 b_1 + a_1 b_3) & (a_3 b_2 + a_2 b_3) & |
105 |
> |
2 \left(a_3 b_3 - \frac{\cos\psi}{3}\right) \end{array} \right) \f$ |
106 |
|
|
107 |
|
which is uniform everywhere. |
108 |
|
|
134 |
|
bool doParticlePot; |
135 |
|
Globals* simParams; |
136 |
|
SimInfo* info_; |
122 |
– |
UniGradPars pars_; |
137 |
|
Mat3x3d Grad_; |
138 |
< |
Vector3d v1_, v2_, v3_; |
138 |
> |
Vector3d a_, b_; |
139 |
> |
RealType g_, cpsi_; |
140 |
|
}; |
141 |
|
|
142 |
|
|