ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/nonbonded/NonBondedInteraction.hpp
(Generate patch)

Comparing branches/development/src/nonbonded/NonBondedInteraction.hpp (file contents):
Revision 1505 by gezelter, Sun Oct 3 22:18:59 2010 UTC vs.
Revision 1549 by gezelter, Wed Apr 27 18:38:15 2011 UTC

# Line 60 | Line 60 | namespace OpenMD {
60      VANDERWAALS_FAMILY,    /**< Long-range dispersion and short-range pauli repulsion */
61      ELECTROSTATIC_FAMILY,  /**< Coulombic and point-multipole interactions */
62      METALLIC_FAMILY,       /**< Transition metal interactions involving electron density */
63 <    HYDROGENBONDING_FAMILY /**< Short-range directional interactions */
63 >    HYDROGENBONDING_FAMILY,/**< Short-range directional interactions */
64 >    N_INTERACTION_FAMILIES
65    };
66  
67    /**
# Line 71 | Line 72 | namespace OpenMD {
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;         /**< total potential */
85 <    RealType vpair;       /**< pair potential */
86 <    Vector3d f1;         /**< force between the two atoms */
86 <    Mat3x3d eFrame1;     /**< pointer to electrostatic frame for first atom */
87 <    Mat3x3d eFrame2;     /**< pointer to electrostatic frame for second atom*/
88 <    RotMat3x3d A1;       /**< pointer to rotation matrix of first atom */
89 <    RotMat3x3d A2;       /**< pointer to rotation matrix of second atom */
90 <    Vector3d t1;         /**< pointer to torque on first atom */
91 <    Vector3d t2;         /**< pointer to torque on second atom */
92 <    RealType rho1;        /**< electron density at first atom */
93 <    RealType rho2;        /**< electron density at second atom */
94 <    RealType dfrho1;      /**< derivative of density functional for atom 1 */
95 <    RealType dfrho2;      /**< derivative of density functional for atom 2 */
96 <    RealType fshift1;     /**< indirect potential contribution from atom 1 */
97 <    RealType fshift2;     /**< indirect potential contribution from atom 2 */
98 <  };
99 <  
100 <  /**
101 <   * The SkipCorrectionData struct.
102 <   *
103 <   * This is used to pass data for corrections due to "skipped" pairs
104 <   * of atoms.  These are atoms that are topologically bonded to each
105 <   * other, but which have indirect effects by way of long range
106 <   * interactions.  In the normal pair interaction loop, these atoms
107 <   * are skipped entirely, so a second pass must be made to compute
108 <   * their indirect interactions on each other.
109 <   */
110 <  struct SkipCorrectionData {
111 <    AtomType* atype1;         /**< pointer to AtomType of first atom */
112 <    AtomType* atype2;         /**< pointer to AtomType of second atom */
113 <    Vector3d d;               /**< interatomic vector (already wrapped into box) */
114 <    RealType rij;             /**< interatomic separation (precomputed) */
115 <    RealType skippedCharge1;  /**< charge skipped in normal pairwise interaction loop */
116 <    RealType skippedCharge2;  /**< charge skipped in normal pairwise interaction loop */
117 <    RealType sw;              /**< switching function value at rij (precomputed) */
118 <    RealType electroMult;     /**< multiplier for electrostatic interactions */
119 <    RealType pot;             /**< total potential */
120 <    RealType vpair;           /**< pair potential */
121 <    Vector3d f1;              /**< force correction */
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;          /**< 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 */
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;           /**< 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    };
142
143
144
145  /**
146   * The DensityData struct.  
147   *
148   * This is used to pass data to specific metallic interactions for
149   * electron density calculations.  
150   */
126    
152  struct DensityData {
153    AtomType* atype1;     /**< pointer to AtomType of first atom */
154    AtomType* atype2;     /**< pointer to AtomType of second atom */
155    RealType rij;         /**< interatomic separation (precomputed) */
156    RealType rho_i_at_j;  /**< electron density at second atom due to first */
157    RealType rho_j_at_i;  /**< electron density at first atom due to second */
158  };
159  
160  /**
161   * The FunctionalData struct.  
162   *
163   * This is used to pass data to specific metallic interactions for
164   * electron density functional calculations.  
165   */
166  
167  struct FunctionalData {
168    AtomType* atype;     /**< pointer to AtomType of the atom */
169    RealType rho;        /**< electron density (precomputed) */
170    RealType frho;       /**< value of density functional for the atom */
171    RealType dfrhodrho;  /**< derivative of density functional for the atom */
172  };
127      
128    /**
129     * The basic interface for non-bonded interactions.  
# Line 178 | Line 132 | namespace OpenMD {
132    public:
133      NonBondedInteraction() {}
134      virtual ~NonBondedInteraction() {}
135 <    virtual void calcForce(InteractionData idat) = 0;
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  
# Line 201 | Line 155 | namespace OpenMD {
155    public:
156      ElectrostaticInteraction() : NonBondedInteraction() { }
157      virtual ~ElectrostaticInteraction() {}
158 <    virtual void calcSkipCorrection(SkipCorrectionData skdat) = 0;
159 <    virtual void calcSelfCorrection(SelfCorrectionData scdat) = 0;
160 <    virtual InteractionFamily getFamily() {return ELECTROSTATIC_FAMILY;}
158 >    virtual void calcSkipCorrection(InteractionData &idat) = 0;
159 >    virtual void calcSelfCorrection(SelfData &sdat) = 0;
160 >    virtual InteractionFamily getFamily() {return ELECTROSTATIC_FAMILY;}    
161    };    
162  
163    /**
# Line 213 | Line 167 | namespace OpenMD {
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            

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines