39 |
|
#include "io/BendTypesSectionParser.hpp" |
40 |
|
#include "io/TorsionTypesSectionParser.hpp" |
41 |
|
#include "UseTheForce/ForceFieldCreator.hpp" |
42 |
< |
|
42 |
> |
#include "utils/simError.h" |
43 |
|
namespace oopse { |
44 |
|
|
45 |
|
EAM::EAM(){ |
88 |
|
|
89 |
|
} |
90 |
|
|
91 |
+ |
|
92 |
+ |
double EAM::getRcutFromAtomType(AtomType* at){ |
93 |
+ |
|
94 |
+ |
if (at->isEAM()) { |
95 |
+ |
GenericData* data = at->getPropertyByName("EAM"); |
96 |
+ |
if (data != NULL) { |
97 |
+ |
EAMParamGenericData* eamData = dynamic_cast<EAMParamGenericData*>(data); |
98 |
+ |
|
99 |
+ |
if (eamData != NULL) { |
100 |
+ |
|
101 |
+ |
EAMParam& eamParam = eamData->getData(); |
102 |
+ |
return eamParam.rcut; |
103 |
+ |
} else { |
104 |
+ |
sprintf( painCave.errMsg, |
105 |
+ |
"Can not cast GenericData to EAMParam\n"); |
106 |
+ |
painCave.severity = OOPSE_ERROR; |
107 |
+ |
painCave.isFatal = 1; |
108 |
+ |
simError(); |
109 |
+ |
} |
110 |
+ |
} else { |
111 |
+ |
sprintf( painCave.errMsg, "Can not find EAM Parameters\n"); |
112 |
+ |
painCave.severity = OOPSE_ERROR; |
113 |
+ |
painCave.isFatal = 1; |
114 |
+ |
simError(); |
115 |
+ |
} |
116 |
+ |
} else { |
117 |
+ |
return ForceField::getRcutFromAtomType(at); |
118 |
+ |
} |
119 |
+ |
|
120 |
+ |
} |
121 |
+ |
|
122 |
|
} //end namespace oopse |