ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/io/ElectrostaticAtomTypesSectionParser.cpp
(Generate patch)

Comparing branches/new_design/OOPSE-3.0/src/io/ElectrostaticAtomTypesSectionParser.cpp (file contents):
Revision 1882 by tim, Wed Dec 8 20:37:47 2004 UTC vs.
Revision 1883 by tim, Mon Dec 13 22:30:27 2004 UTC

# Line 24 | Line 24
24   */
25  
26   #include "io/ElectrostaticAtomTypesSectionParser.hpp"
27
27   #include "UseTheForce/ForceField.hpp"
28 <
28 > #include "utils/NumericConstant.hpp"
29   namespace oopse {
30  
31   ElectrostaticAtomTypesSectionParser::ElectrostaticAtomTypesSectionParser() {
# Line 113 | Line 112 | void ElectrostaticAtomTypesSectionParser::parseCharge(
112      AtomType* atomType) {
113  
114      double charge = tokenizer.nextTokenAsDouble();
115 <    atomType->addProperty(new DoubleGenericData("Charge", charge));
116 <    atomType->setCharge();
117 <    
115 >
116 >    if (fabs(charge) > NumericConstant::epsilon) {
117 >        atomType->addProperty(new DoubleGenericData("Charge", charge));
118 >        atomType->setCharge();
119 >    }
120   }
121   void ElectrostaticAtomTypesSectionParser::parseDipole(StringTokenizer& tokenizer,
122      DirectionalAtomType* dAtomType) {
123  
124 <    double Dipole = tokenizer.nextTokenAsDouble();
125 <    dAtomType->addProperty(new DoubleGenericData("Dipole", Dipole));
126 <    dAtomType->setDipole();
124 >    double dipole = tokenizer.nextTokenAsDouble();
125 >
126 >    if (fabs(dipole) > NumericConstant::epsilon) {
127 >
128 >        dAtomType->addProperty(new DoubleGenericData("Dipole", dipole));
129 >        dAtomType->setDipole();
130 >    }
131   }
132  
133   void ElectrostaticAtomTypesSectionParser::parseQuadruple(StringTokenizer& tokenizer,
# Line 132 | Line 137 | void ElectrostaticAtomTypesSectionParser::parseQuadrup
137      Q[0] = tokenizer.nextTokenAsDouble();
138      Q[1] = tokenizer.nextTokenAsDouble();
139      Q[2] = tokenizer.nextTokenAsDouble();
140 <    
141 <    dAtomType->addProperty(new Vector3dGenericData("Quadrupole", Q));
142 <    dAtomType->setQuadrupole();
140 >
141 >    if (fabs(Q[0]) > NumericConstant::epsilon && fabs(Q[1]) > NumericConstant::epsilon
142 >        && fabs(Q[2]) > NumericConstant::epsilon) {    
143 >        
144 >        dAtomType->addProperty(new Vector3dGenericData("Quadrupole", Q));
145 >        dAtomType->setQuadrupole();
146 >    }
147   }
148   void ElectrostaticAtomTypesSectionParser::parseElectroBodyFrame(StringTokenizer& tokenizer,
149      DirectionalAtomType* dAtomType) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines