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

Comparing branches/development/src/primitives/StuntDouble.hpp (file contents):
Revision 1808 by gezelter, Mon Oct 22 20:42:10 2012 UTC vs.
Revision 1839 by gezelter, Fri Jan 25 15:21:04 2013 UTC

# Line 1142 | Line 1142 | namespace OpenMD{
1142      }
1143  
1144      /**
1145 <     * Sets  the previous electric field of this stuntDouble
1146 <     * @param pos  new electric field
1145 >     * Sets the previous electric field of this stuntDouble
1146 >     * @param eField  new electric field
1147       * @see #getElectricField
1148       */        
1149 <    void setPrevElectricField(const Vector3d& pos) {
1150 <      ((snapshotMan_->getPrevSnapshot())->*storage_).electricField[localIndex_] = pos;
1149 >    void setPrevElectricField(const Vector3d& eField) {
1150 >      ((snapshotMan_->getPrevSnapshot())->*storage_).electricField[localIndex_] = eField;
1151      }
1152        
1153      /**
1154 <     * Sets  the current electric field of this stuntDouble
1155 <     * @param pos  new electric field
1154 >     * Sets the current electric field of this stuntDouble
1155 >     * @param eField  new electric field
1156       */        
1157 <    void setElectricField(const Vector3d& pos) {
1158 <      DataStorage&  data = snapshotMan_->getCurrentSnapshot()->*storage_;
1159 <      data.electricField[localIndex_] = pos;
1160 <      //((snapshotMan_->getCurrentSnapshot())->*storage_).electricField[localIndex_] = pos;
1157 >    void setElectricField(const Vector3d& eField) {
1158 >      ((snapshotMan_->getCurrentSnapshot())->*storage_).electricField[localIndex_] = eField;
1159      }
1160  
1161      /**
1162 <     * Sets  the electric field of this stuntDouble in specified snapshot
1163 <     * @param pos electric field to be set
1162 >     * Sets the electric field of this stuntDouble in specified snapshot
1163 >     * @param eField electric field to be set
1164       * @param snapshotNo
1165       * @see #getElectricField
1166       */        
1167 <    void setElectricField(const Vector3d& pos, int snapshotNo) {
1168 <
1169 <      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).electricField[localIndex_] = pos;
1167 >    void setElectricField(const Vector3d& eField, int snapshotNo) {
1168 >      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).electricField[localIndex_] = eField;
1169 >    }
1170  
1171 +    /**
1172 +     * Adds electric field into the previous electric field of this
1173 +     * stuntDouble
1174 +     *
1175 +     * @param eField new electric field
1176 +     * @see #getElectricField
1177 +     */        
1178 +    void addPrevEelectricField(const Vector3d& eField) {
1179 +      ((snapshotMan_->getPrevSnapshot())->*storage_).electricField[localIndex_] += eField;
1180      }
1181 +      
1182 +    /**
1183 +     * Adds electric field into the current electric field of this stuntDouble
1184 +     * @param eField  new electric field
1185 +     */        
1186 +    void addElectricField(const Vector3d& eField) {
1187 +      ((snapshotMan_->getCurrentSnapshot())->*storage_).electricField[localIndex_] += eField;
1188 +    }
1189  
1190 +    /**
1191 +     * Adds electric field into the electric field of this stuntDouble in specified snapshot
1192 +     *
1193 +     * @param eField electric field to be added
1194 +     * @param snapshotNo
1195 +     * @see #getElectricField
1196 +     */        
1197 +    void addElectricField(const Vector3d& eField, int snapshotNo) {
1198 +      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).electricField[localIndex_] += eField;
1199 +    }      
1200  
1201 +
1202      /** Set the force of this stuntDouble to zero */
1203      void zeroForcesAndTorques();
1204      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines