| 72 |
|
* by any given interaction. |
| 73 |
|
*/ |
| 74 |
|
struct InteractionData { |
| 75 |
< |
AtomType* atype1; /**< pointer to AtomType of first atom */ |
| 76 |
< |
AtomType* atype2; /**< pointer to AtomType of second atom */ |
| 77 |
< |
Vector3d d; /**< interatomic vector (already wrapped into box) */ |
| 78 |
< |
RealType rij; /**< interatomic separation (precomputed) */ |
| 79 |
< |
RealType r2; /**< square of rij (precomputed) */ |
| 80 |
< |
RealType rcut; /**< cutoff radius for this interaction */ |
| 81 |
< |
RealType sw; /**< switching function value at rij (precomputed) */ |
| 82 |
< |
RealType vdwMult; /**< multiplier for van der Waals interactions */ |
| 83 |
< |
RealType electroMult; /**< multiplier for electrostatic interactions */ |
| 84 |
< |
RealType pot[4]; /**< total potential */ |
| 85 |
< |
RealType vpair[4]; /**< pair potential */ |
| 86 |
< |
Vector3d f1; /**< force between the two atoms */ |
| 87 |
< |
Mat3x3d eFrame1; /**< pointer to electrostatic frame for first atom */ |
| 88 |
< |
Mat3x3d eFrame2; /**< pointer to electrostatic frame for second atom*/ |
| 89 |
< |
RotMat3x3d A1; /**< pointer to rotation matrix of first atom */ |
| 90 |
< |
RotMat3x3d A2; /**< pointer to rotation matrix of second atom */ |
| 91 |
< |
Vector3d t1; /**< pointer to torque on first atom */ |
| 92 |
< |
Vector3d t2; /**< pointer to torque on second atom */ |
| 93 |
< |
RealType rho1; /**< electron density at first atom */ |
| 94 |
< |
RealType rho2; /**< electron density at second atom */ |
| 95 |
< |
RealType dfrho1; /**< derivative of density functional for atom 1 */ |
| 96 |
< |
RealType dfrho2; /**< derivative of density functional for atom 2 */ |
| 97 |
< |
RealType fshift1; /**< indirect potential contribution from atom 1 */ |
| 98 |
< |
RealType fshift2; /**< indirect potential contribution from atom 2 */ |
| 99 |
< |
}; |
| 100 |
< |
|
| 101 |
< |
/** |
| 102 |
< |
* The SkipCorrectionData struct. |
| 103 |
< |
* |
| 104 |
< |
* This is used to pass data for corrections due to "skipped" pairs |
| 105 |
< |
* of atoms. These are atoms that are topologically bonded to each |
| 106 |
< |
* other, but which have indirect effects by way of long range |
| 107 |
< |
* interactions. In the normal pair interaction loop, these atoms |
| 108 |
< |
* are skipped entirely, so a second pass must be made to compute |
| 109 |
< |
* their indirect interactions on each other. |
| 110 |
< |
*/ |
| 111 |
< |
struct SkipCorrectionData { |
| 112 |
< |
AtomType* atype1; /**< pointer to AtomType of first atom */ |
| 113 |
< |
AtomType* atype2; /**< pointer to AtomType of second atom */ |
| 114 |
< |
Vector3d d; /**< interatomic vector (already wrapped into box) */ |
| 115 |
< |
RealType rij; /**< interatomic separation (precomputed) */ |
| 75 |
> |
pair<AtomType*, AtomType*> atypes; /**< pair of atom types interacting */ |
| 76 |
> |
Vector3d d; /**< interatomic vector (already wrapped into box) */ |
| 77 |
> |
RealType rij; /**< interatomic separation */ |
| 78 |
> |
RealType r2; /**< square of rij */ |
| 79 |
> |
RealType rcut; /**< cutoff radius for this interaction */ |
| 80 |
> |
RealType sw; /**< switching function value at rij */ |
| 81 |
> |
int topoDist; /**< topological distance between atoms */ |
| 82 |
> |
RealType vdwMult; /**< multiplier for van der Waals interactions */ |
| 83 |
> |
RealType electroMult; /**< multiplier for electrostatic interactions */ |
| 84 |
> |
RealType pot[4]; /**< total potential */ |
| 85 |
> |
RealType vpair[4]; /**< pair potential */ |
| 86 |
> |
Vector3d f1; /**< force between the two atoms */ |
| 87 |
> |
Mat3x3d eFrame1; /**< pointer to electrostatic frame for first atom */ |
| 88 |
> |
Mat3x3d eFrame2; /**< pointer to electrostatic frame for second atom*/ |
| 89 |
> |
RotMat3x3d A1; /**< pointer to rotation matrix of first atom */ |
| 90 |
> |
RotMat3x3d A2; /**< pointer to rotation matrix of second atom */ |
| 91 |
> |
Vector3d t1; /**< pointer to torque on first atom */ |
| 92 |
> |
Vector3d t2; /**< pointer to torque on second atom */ |
| 93 |
> |
RealType rho_i_at_j; /**< electron density at second atom due to first */ |
| 94 |
> |
RealType rho_j_at_i; /**< electron density at first atom due to second */ |
| 95 |
> |
RealType rho1; /**< total electron density at first atom */ |
| 96 |
> |
RealType rho2; /**< total electron density at second atom */ |
| 97 |
> |
RealType dfrho1; /**< derivative of density functional for atom 1 */ |
| 98 |
> |
RealType dfrho2; /**< derivative of density functional for atom 2 */ |
| 99 |
> |
RealType fshift1; /**< indirect potential contribution from atom 1 */ |
| 100 |
> |
RealType fshift2; /**< indirect potential contribution from atom 2 */ |
| 101 |
|
RealType skippedCharge1; /**< charge skipped in normal pairwise interaction loop */ |
| 102 |
|
RealType skippedCharge2; /**< charge skipped in normal pairwise interaction loop */ |
| 118 |
– |
RealType sw; /**< switching function value at rij (precomputed) */ |
| 119 |
– |
RealType electroMult; /**< multiplier for electrostatic interactions */ |
| 120 |
– |
RealType pot[4]; /**< total potential */ |
| 121 |
– |
RealType vpair[4]; /**< pair potential */ |
| 122 |
– |
Vector3d f1; /**< force correction */ |
| 123 |
– |
Mat3x3d eFrame1; /**< pointer to electrostatic frame for first atom */ |
| 124 |
– |
Mat3x3d eFrame2; /**< pointer to electrostatic frame for second atom*/ |
| 125 |
– |
Vector3d t1; /**< pointer to torque on first atom */ |
| 126 |
– |
Vector3d t2; /**< pointer to torque on second atom */ |
| 103 |
|
}; |
| 104 |
< |
|
| 104 |
> |
|
| 105 |
|
/** |
| 106 |
< |
* The SelfCorrectionData struct. |
| 106 |
> |
* The SelfData struct. |
| 107 |
|
* |
| 108 |
< |
* This is used to pass data for the self-interaction (used by |
| 109 |
< |
* electrostatic methods) that have long-range corrections involving |
| 110 |
< |
* interactions with a medium or a boundary. |
| 108 |
> |
* This is used to pass data for the self-interaction or derived |
| 109 |
> |
* information on a single atom after a pass through all other |
| 110 |
> |
* interactions. This is used by electrostatic methods that have |
| 111 |
> |
* long-range corrections involving interactions with a medium or a |
| 112 |
> |
* boundary and also by specific metal interactions for electron |
| 113 |
> |
* density functional calculations. Not all of the struct members |
| 114 |
> |
* are utilized by any given self interaction. |
| 115 |
|
*/ |
| 116 |
< |
struct SelfCorrectionData { |
| 116 |
> |
struct SelfData { |
| 117 |
|
AtomType* atype; /**< pointer to AtomType of the atom */ |
| 118 |
< |
Mat3x3d eFrame; /**< pointer to electrostatic frame for first atom */ |
| 118 |
> |
Mat3x3d eFrame; /**< pointer to electrostatic frame for atom */ |
| 119 |
|
RealType skippedCharge; /**< charge skipped in normal pairwise interaction loop */ |
| 120 |
< |
RealType pot[4]; /**< total potential contribution */ |
| 121 |
< |
Vector3d t; /**< pointer to resultant torque on atom */ |
| 120 |
> |
RealType pot[4]; /**< total potential contribution */ |
| 121 |
> |
Vector3d t; /**< pointer to resultant torque on atom */ |
| 122 |
> |
RealType rho; /**< electron density */ |
| 123 |
> |
RealType frho; /**< value of density functional for the atom */ |
| 124 |
> |
RealType dfrhodrho; /**< derivative of density functional for the atom */ |
| 125 |
|
}; |
| 143 |
– |
|
| 144 |
– |
|
| 145 |
– |
|
| 146 |
– |
/** |
| 147 |
– |
* The DensityData struct. |
| 148 |
– |
* |
| 149 |
– |
* This is used to pass data to specific metallic interactions for |
| 150 |
– |
* electron density calculations. |
| 151 |
– |
*/ |
| 126 |
|
|
| 153 |
– |
struct DensityData { |
| 154 |
– |
AtomType* atype1; /**< pointer to AtomType of first atom */ |
| 155 |
– |
AtomType* atype2; /**< pointer to AtomType of second atom */ |
| 156 |
– |
RealType rij; /**< interatomic separation (precomputed) */ |
| 157 |
– |
RealType rho_i_at_j; /**< electron density at second atom due to first */ |
| 158 |
– |
RealType rho_j_at_i; /**< electron density at first atom due to second */ |
| 159 |
– |
}; |
| 160 |
– |
|
| 161 |
– |
/** |
| 162 |
– |
* The FunctionalData struct. |
| 163 |
– |
* |
| 164 |
– |
* This is used to pass data to specific metallic interactions for |
| 165 |
– |
* electron density functional calculations. |
| 166 |
– |
*/ |
| 167 |
– |
|
| 168 |
– |
struct FunctionalData { |
| 169 |
– |
AtomType* atype; /**< pointer to AtomType of the atom */ |
| 170 |
– |
RealType rho; /**< electron density (precomputed) */ |
| 171 |
– |
RealType frho; /**< value of density functional for the atom */ |
| 172 |
– |
RealType dfrhodrho; /**< derivative of density functional for the atom */ |
| 173 |
– |
}; |
| 127 |
|
|
| 128 |
|
/** |
| 129 |
|
* The basic interface for non-bonded interactions. |
| 134 |
|
virtual ~NonBondedInteraction() {} |
| 135 |
|
virtual void calcForce(InteractionData &idat) = 0; |
| 136 |
|
virtual InteractionFamily getFamily() = 0; |
| 137 |
< |
virtual RealType getSuggestedCutoffRadius(AtomType* at1, AtomType* at2) = 0; |
| 137 |
> |
virtual RealType getSuggestedCutoffRadius(pair<AtomType*, AtomType*> atypes) = 0; |
| 138 |
|
virtual string getName() = 0; |
| 139 |
|
}; |
| 140 |
|
|
| 155 |
|
public: |
| 156 |
|
ElectrostaticInteraction() : NonBondedInteraction() { } |
| 157 |
|
virtual ~ElectrostaticInteraction() {} |
| 158 |
< |
virtual void calcSkipCorrection(SkipCorrectionData &skdat) = 0; |
| 159 |
< |
virtual void calcSelfCorrection(SelfCorrectionData &scdat) = 0; |
| 158 |
> |
virtual void calcSkipCorrection(InteractionData &idat) = 0; |
| 159 |
> |
virtual void calcSelfCorrection(SelfData &sdat) = 0; |
| 160 |
|
virtual InteractionFamily getFamily() {return ELECTROSTATIC_FAMILY;} |
| 161 |
|
}; |
| 162 |
|
|
| 167 |
|
public: |
| 168 |
|
MetallicInteraction() : NonBondedInteraction() { } |
| 169 |
|
virtual ~MetallicInteraction() {} |
| 170 |
< |
virtual void calcDensity(DensityData &ddat) = 0; |
| 171 |
< |
virtual void calcFunctional(FunctionalData &fdat) = 0; |
| 170 |
> |
virtual void calcDensity(InteractionData &idat) = 0; |
| 171 |
> |
virtual void calcFunctional(SelfData &sdat) = 0; |
| 172 |
|
virtual InteractionFamily getFamily() {return METALLIC_FAMILY;} |
| 173 |
|
}; |
| 174 |
|
|