42 |
|
#include "io/LennardJonesAtomTypesSectionParser.hpp" |
43 |
|
#include "types/AtomType.hpp" |
44 |
|
#include "UseTheForce/ForceField.hpp" |
45 |
+ |
#include "utils/simError.h" |
46 |
|
namespace oopse { |
47 |
|
|
48 |
|
LennardJonesAtomTypesSectionParser::LennardJonesAtomTypesSectionParser() { |
56 |
|
//in AtomTypeSection, a line at least contains 2 tokens |
57 |
|
//atomTypeName and mass |
58 |
|
if (nTokens < 3) { |
59 |
< |
|
59 |
> |
sprintf(painCave.errMsg, "LennardJonesAtomTypesSectionParser Error: Not enough tokens at line %d\n", |
60 |
> |
lineNo); |
61 |
> |
painCave.isFatal = 1; |
62 |
> |
simError(); |
63 |
|
} else { |
64 |
|
|
65 |
|
std::string atomTypeName = tokenizer.nextToken(); |
71 |
|
ljParam.sigma = tokenizer.nextTokenAsDouble(); |
72 |
|
atomType->addProperty(new LJParamGenericData("LennardJones", ljParam)); |
73 |
|
atomType->setLennardJones(); |
74 |
+ |
}else { |
75 |
+ |
sprintf(painCave.errMsg, "LennardJonesAtomTypesSectionParser Error: Atom Type [%s] is not created yet\n", atomTypeName.c_str()); |
76 |
+ |
painCave.isFatal = 1; |
77 |
+ |
simError(); |
78 |
|
} |
79 |
|
|
80 |
|
} |