--- trunk/src/applications/hydrodynamics/ShapeBuilder.cpp 2006/04/25 02:06:12 944 +++ trunk/src/applications/hydrodynamics/ShapeBuilder.cpp 2006/05/24 18:31:12 972 @@ -39,8 +39,8 @@ * such damages. */ #include "applications/hydrodynamics/ShapeBuilder.hpp" -#include "applications/hydrodynamics/Spheric.hpp" -#include "applications/hydrodynamics/Ellipsoid.hpp" +#include "hydrodynamics/Sphere.hpp" +#include "hydrodynamics/Ellipsoid.hpp" #include "applications/hydrodynamics/CompositeShape.hpp" namespace oopse { @@ -66,7 +66,7 @@ namespace oopse { if (ljData != NULL) { LJParam ljParam = ljData->getData(); - currShape = new Spheric(atom->getPos(), ljParam.sigma/2.0); + currShape = new Sphere(atom->getPos(), ljParam.sigma/2.0); } else { sprintf( painCave.errMsg, "Can not cast GenericData to LJParam\n"); @@ -75,23 +75,18 @@ namespace oopse { simError(); } } - } else if (atomType->isEAM()) { - GenericData* data = atomType->getPropertyByName("EAM"); - if (data != NULL) { - EAMParamGenericData* eamData = dynamic_cast(data); - - if (eamData != NULL) { - EAMParam eamParam = eamData->getData(); - currShape = new Spheric(atom->getPos(), eamParam.rcut); - } else { - sprintf( painCave.errMsg, - "Can not cast GenericData to EAMParam\n"); - painCave.severity = OOPSE_ERROR; - painCave.isFatal = 1; - simError(); - } + } else { + int obanum = etab.GetAtomicNum((atom->getType()).c_str()); + if (obanum != 0) { + currShape = new Sphere(atom->getPos(), etab.GetVdwRad(obanum)); + } else { + sprintf( painCave.errMsg, + "Could not find atom type in default element.txt\n"); + painCave.severity = OOPSE_ERROR; + painCave.isFatal = 1; + simError(); } - } + } return currShape; } @@ -128,7 +123,7 @@ namespace oopse { if (ljData != NULL) { LJParam ljParam = ljData->getData(); - currShape = new Spheric(datom->getPos(), ljParam.sigma/2.0); + currShape = new Sphere(datom->getPos(), ljParam.sigma/2.0); } else { sprintf( painCave.errMsg, "Can not cast GenericData to LJParam\n"); @@ -136,22 +131,18 @@ namespace oopse { painCave.isFatal = 1; simError(); } - } else if (atomType->isEAM()) { - GenericData* data = atomType->getPropertyByName("EAM"); - if (data != NULL) { - EAMParamGenericData* eamData = dynamic_cast(data); - if (eamData != NULL) { - EAMParam eamParam = eamData->getData(); - currShape = new Spheric(datom->getPos(), eamParam.rcut); - } else { - sprintf( painCave.errMsg, - "Can not cast GenericData to EAMParam\n"); - painCave.severity = OOPSE_ERROR; - painCave.isFatal = 1; - simError(); - } + } else { + int obanum = etab.GetAtomicNum((datom->getType()).c_str()); + if (obanum != 0) { + currShape = new Sphere(datom->getPos(), etab.GetVdwRad(obanum)); + } else { + sprintf( painCave.errMsg, + "Could not find atom type in default element.txt\n"); + painCave.severity = OOPSE_ERROR; + painCave.isFatal = 1; + simError(); } - } + } } return currShape; }