80 |
|
|
81 |
|
} |
82 |
|
|
83 |
< |
void ForceField::addAtomType(const std::string &at, AtomType* atomType) { |
83 |
> |
bool ForceField::addAtomType(const std::string &at, AtomType* atomType) { |
84 |
|
std::vector<std::string> keys; |
85 |
|
keys.push_back(at); |
86 |
|
return atomTypeCont_.add(keys); |
87 |
|
} |
88 |
|
|
89 |
< |
void ForceField::addBondType(const std::string &at1, const std::string &at2, BondType* bondType) { |
89 |
> |
bool ForceField::addBondType(const std::string &at1, const std::string &at2, BondType* bondType) { |
90 |
|
std::vector<std::string> keys; |
91 |
|
keys.push_back(at1); |
92 |
|
keys.push_back(at2); |
94 |
|
|
95 |
|
} |
96 |
|
|
97 |
< |
void ForceField::addBendType(const std::string &at1, const std::string &at2, |
97 |
> |
bool ForceField::addBendType(const std::string &at1, const std::string &at2, |
98 |
|
const std::string &at3, BendType* bendType) { |
99 |
|
std::vector<std::string> keys; |
100 |
|
keys.push_back(at1); |
103 |
|
return bendTypeCont_.add(keys); |
104 |
|
} |
105 |
|
|
106 |
< |
void ForceField::addTorsionType(const std::string &at1, const std::string &at2, |
106 |
> |
bool ForceField::addTorsionType(const std::string &at1, const std::string &at2, |
107 |
|
const std::string &at3, const std::string &at4, TorsionType* torsionType) { |
108 |
|
std::vector<std::string> keys; |
109 |
|
keys.push_back(at1); |
113 |
|
return torsionTypeCont_.add(keys); |
114 |
|
} |
115 |
|
|
116 |
< |
double ForceField::getRcutForAtomType(AtomType* at) { |
116 |
> |
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 |