| 41 |
|
*/ |
| 42 |
|
|
| 43 |
|
#include "applications/hydrodynamics/BeadModel.hpp" |
| 44 |
+ |
#include "types/LennardJonesAdapter.hpp" |
| 45 |
|
|
| 46 |
|
namespace OpenMD { |
| 47 |
|
bool BeadModel::createBeads(std::vector<BeadParam>& beads) { |
| 76 |
|
|
| 77 |
|
bool BeadModel::createSingleBead(Atom* atom, std::vector<BeadParam>& beads) { |
| 78 |
|
AtomType* atomType = atom->getAtomType(); |
| 79 |
< |
|
| 79 |
> |
LennardJonesAdapter lja = LennardJonesAdapter(atomType); |
| 80 |
|
if (atomType->isGayBerne()) { |
| 81 |
|
return false; |
| 82 |
< |
} else if (atomType->isLennardJones()){ |
| 83 |
< |
GenericData* data = atomType->getPropertyByName("LennardJones"); |
| 84 |
< |
if (data != NULL) { |
| 85 |
< |
LJParamGenericData* ljData = dynamic_cast<LJParamGenericData*>(data); |
| 86 |
< |
|
| 87 |
< |
if (ljData != NULL) { |
| 87 |
< |
LJParam ljParam = ljData->getData(); |
| 88 |
< |
BeadParam currBead; |
| 89 |
< |
currBead.atomName = atom->getType(); |
| 90 |
< |
currBead.pos = atom->getPos(); |
| 91 |
< |
currBead.radius = ljParam.sigma/2.0; |
| 92 |
< |
beads.push_back(currBead); |
| 93 |
< |
} else { |
| 94 |
< |
sprintf( painCave.errMsg, |
| 95 |
< |
"Can not cast GenericData to LJParam\n"); |
| 96 |
< |
painCave.severity = OPENMD_ERROR; |
| 97 |
< |
painCave.isFatal = 1; |
| 98 |
< |
simError(); |
| 99 |
< |
} |
| 100 |
< |
} |
| 82 |
> |
} else if (lja.isLennardJones()){ |
| 83 |
> |
BeadParam currBead; |
| 84 |
> |
currBead.atomName = atom->getType(); |
| 85 |
> |
currBead.pos = atom->getPos(); |
| 86 |
> |
currBead.radius = lja.getSigma()/2.0; |
| 87 |
> |
beads.push_back(currBead); |
| 88 |
|
} else { |
| 89 |
|
int obanum = etab.GetAtomicNum((atom->getType()).c_str()); |
| 90 |
|
if (obanum != 0) { |