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

Comparing branches/new_design/OOPSE-2.0/src/UseTheForce/ForceField.cpp (file contents):
Revision 1739 by tim, Fri Nov 12 17:40:03 2004 UTC vs.
Revision 1740 by tim, Mon Nov 15 23:00:32 2004 UTC

# Line 117 | Line 117 | double ForceField::getRcutFromAtomType(AtomType* at) {
117      
118   }
119  
120 +
121 + ifstrstream* ForceField::openForceFiledFile(const std::string& filename) {
122 +    std::string forceFieldFilename(filename);
123 +    ifstrstream* ffStream = new ifstrstream();
124 +    
125 +    //try to open the force filed file in current directory first    
126 +    ffStream.open(forceFieldFilename.c_str());
127 +    if(!ffStream.is_open()){
128 +
129 +        forceFieldFilename = ffPath_ + "/" + forceFieldFilename;
130 +        ffStream.open( forceFieldFilename.c_str() );
131 +
132 +        //if current directory does not contain the force field file,
133 +        //try to open it in the path        
134 +        if(!ffStream.is_open()){
135 +
136 +            sprintf( painCave.errMsg,
137 +               "Error opening the force field parameter file:\n"
138 +               "\t%s\n"
139 +               "\tHave you tried setting the FORCE_PARAM_PATH environment "
140 +               "variable?\n",
141 +               forceFieldFilename.c_str() );
142 +            painCave.severity = OOPSE_ERROR;
143 +            painCave.isFatal = 1;
144 +            simError();
145 +        }
146 +    }  
147 +
148 +    return ffStream;
149 +
150 + }
151 +
152   } //end namespace oopse

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines