| 1 |
gezelter |
2026 |
/* |
| 2 |
|
|
* Copyright (c) 2014 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] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
| 40 |
|
|
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
| 41 |
|
|
*/ |
| 42 |
|
|
|
| 43 |
|
|
|
| 44 |
|
|
/*! \file perturbations/UniformGradient.hpp |
| 45 |
|
|
\brief Uniform Electric Field Gradient perturbation |
| 46 |
|
|
*/ |
| 47 |
|
|
|
| 48 |
|
|
#ifndef PERTURBATIONS_UNIFORMGRADIENT_HPP |
| 49 |
|
|
#define PERTURBATIONS_UNIFORMGRADIENT_HPP |
| 50 |
|
|
|
| 51 |
|
|
#include "perturbations/Perturbation.hpp" |
| 52 |
|
|
#include "brains/SimInfo.hpp" |
| 53 |
|
|
|
| 54 |
|
|
namespace OpenMD { |
| 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 |
gezelter |
2034 |
uniformGradientStrength = c; |
| 61 |
|
|
uniformGradientDirection1 = (a1, a2, a3) |
| 62 |
|
|
uniformGradientDirection2 = (b1, b2, b3); |
| 63 |
gezelter |
2026 |
\endcode |
| 64 |
|
|
|
| 65 |
gezelter |
2034 |
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 |
gezelter |
2026 |
|
| 69 |
|
|
The electrostatic potential corresponding to this uniform gradient is |
| 70 |
|
|
|
| 71 |
gezelter |
2034 |
\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 |
gezelter |
2026 |
|
| 80 |
gezelter |
2034 |
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 |
gezelter |
2026 |
care should be taken in using a Uniform Gradient with point charges. |
| 83 |
|
|
|
| 84 |
|
|
The corresponding field is: |
| 85 |
|
|
|
| 86 |
gezelter |
2034 |
\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 |
gezelter |
2026 |
|
| 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 |
gezelter |
2034 |
\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 |
gezelter |
2026 |
|
| 107 |
|
|
which is uniform everywhere. |
| 108 |
|
|
|
| 109 |
|
|
The uniform field gradient applies a force on charged atoms, |
| 110 |
|
|
\f$ \mathbf{F} = C \mathbf{E}(\mathbf{r}) \f$. |
| 111 |
|
|
For dipolar atoms, the gradient applies both a potential, |
| 112 |
|
|
\f$ U = -\mathbf{D} \cdot \mathbf{E}(\mathbf{r}) \f$, a force, |
| 113 |
|
|
\f$ \mathbf{F} = \mathbf{D} \cdot \nabla \mathbf{E} \f$, and a torque, |
| 114 |
|
|
\f$ \mathbf{\tau} = \mathbf{D} \times \mathbf{E}(\mathbf{r}) \f$. |
| 115 |
|
|
|
| 116 |
|
|
For quadrupolar atoms, the uniform field gradient exerts a potential, |
| 117 |
|
|
\f$ U = - \mathsf{Q}:\nabla \mathbf{E} $\f, and a torque |
| 118 |
|
|
\f$ \mathbf{F} = 2 \mathsf{Q} \times \nabla \mathbf{E} \f$ |
| 119 |
|
|
|
| 120 |
|
|
*/ |
| 121 |
|
|
class UniformGradient : public Perturbation { |
| 122 |
|
|
|
| 123 |
|
|
|
| 124 |
|
|
public: |
| 125 |
|
|
UniformGradient(SimInfo* info); |
| 126 |
|
|
|
| 127 |
|
|
protected: |
| 128 |
|
|
virtual void initialize(); |
| 129 |
|
|
virtual void applyPerturbation(); |
| 130 |
|
|
|
| 131 |
|
|
private: |
| 132 |
|
|
bool initialized; |
| 133 |
|
|
bool doUniformGradient; |
| 134 |
|
|
bool doParticlePot; |
| 135 |
|
|
Globals* simParams; |
| 136 |
|
|
SimInfo* info_; |
| 137 |
|
|
Mat3x3d Grad_; |
| 138 |
gezelter |
2034 |
Vector3d a_, b_; |
| 139 |
|
|
RealType g_, cpsi_; |
| 140 |
gezelter |
2026 |
}; |
| 141 |
|
|
|
| 142 |
|
|
|
| 143 |
|
|
} //end namespace OpenMD |
| 144 |
|
|
#endif |
| 145 |
|
|
|