39 |
|
* such damages. |
40 |
|
*/ |
41 |
|
#include "applications/hydrodynamics/ShapeBuilder.hpp" |
42 |
< |
#include "applications/hydrodynamics/Spheric.hpp" |
43 |
< |
#include "applications/hydrodynamics/Ellipsoid.hpp" |
42 |
> |
#include "hydrodynamics/Sphere.hpp" |
43 |
> |
#include "hydrodynamics/Ellipsoid.hpp" |
44 |
|
#include "applications/hydrodynamics/CompositeShape.hpp" |
45 |
|
namespace oopse { |
46 |
|
|
66 |
|
|
67 |
|
if (ljData != NULL) { |
68 |
|
LJParam ljParam = ljData->getData(); |
69 |
< |
currShape = new Spheric(atom->getPos(), ljParam.sigma/2.0); |
69 |
> |
currShape = new Sphere(atom->getPos(), ljParam.sigma/2.0); |
70 |
|
} else { |
71 |
|
sprintf( painCave.errMsg, |
72 |
|
"Can not cast GenericData to LJParam\n"); |
75 |
|
simError(); |
76 |
|
} |
77 |
|
} |
78 |
< |
} else if (atomType->isEAM()) { |
79 |
< |
GenericData* data = atomType->getPropertyByName("EAM"); |
80 |
< |
if (data != NULL) { |
81 |
< |
EAMParamGenericData* eamData = dynamic_cast<EAMParamGenericData*>(data); |
82 |
< |
|
83 |
< |
if (eamData != NULL) { |
84 |
< |
EAMParam eamParam = eamData->getData(); |
85 |
< |
currShape = new Spheric(atom->getPos(), eamParam.rcut); |
86 |
< |
} else { |
87 |
< |
sprintf( painCave.errMsg, |
88 |
< |
"Can not cast GenericData to EAMParam\n"); |
89 |
< |
painCave.severity = OOPSE_ERROR; |
90 |
< |
painCave.isFatal = 1; |
91 |
< |
simError(); |
92 |
< |
} |
78 |
> |
} else { |
79 |
> |
int obanum = etab.GetAtomicNum((atom->getType()).c_str()); |
80 |
> |
if (obanum != 0) { |
81 |
> |
currShape = new Sphere(atom->getPos(), etab.GetVdwRad(obanum)); |
82 |
> |
} else { |
83 |
> |
sprintf( painCave.errMsg, |
84 |
> |
"Could not find atom type in default element.txt\n"); |
85 |
> |
painCave.severity = OOPSE_ERROR; |
86 |
> |
painCave.isFatal = 1; |
87 |
> |
simError(); |
88 |
|
} |
89 |
< |
} |
89 |
> |
} |
90 |
|
return currShape; |
91 |
|
} |
92 |
|
|
102 |
|
|
103 |
|
if (gayBerneData != NULL) { |
104 |
|
GayBerneParam gayBerneParam = gayBerneData->getData(); |
105 |
< |
currShape = new Ellipsoid(datom->getPos(), gayBerneParam.GB_sigma/2.0, gayBerneParam.GB_l2b_ratio*gayBerneParam.GB_sigma/2.0, datom->getA()); |
105 |
> |
currShape = new Ellipsoid(datom->getPos(), gayBerneParam.GB_l/2.0, |
106 |
> |
gayBerneParam.GB_d/2.0, datom->getA()); |
107 |
|
} else { |
108 |
|
sprintf( painCave.errMsg, |
109 |
|
"Can not cast GenericData to GayBerneParam\n"); |
124 |
|
|
125 |
|
if (ljData != NULL) { |
126 |
|
LJParam ljParam = ljData->getData(); |
127 |
< |
currShape = new Spheric(datom->getPos(), ljParam.sigma/2.0); |
127 |
> |
currShape = new Sphere(datom->getPos(), ljParam.sigma/2.0); |
128 |
|
} else { |
129 |
|
sprintf( painCave.errMsg, |
130 |
|
"Can not cast GenericData to LJParam\n"); |
132 |
|
painCave.isFatal = 1; |
133 |
|
simError(); |
134 |
|
} |
135 |
< |
} else if (atomType->isEAM()) { |
136 |
< |
GenericData* data = atomType->getPropertyByName("EAM"); |
137 |
< |
if (data != NULL) { |
138 |
< |
EAMParamGenericData* eamData = dynamic_cast<EAMParamGenericData*>(data); |
139 |
< |
if (eamData != NULL) { |
140 |
< |
EAMParam eamParam = eamData->getData(); |
141 |
< |
currShape = new Spheric(datom->getPos(), eamParam.rcut); |
142 |
< |
} else { |
143 |
< |
sprintf( painCave.errMsg, |
144 |
< |
"Can not cast GenericData to EAMParam\n"); |
149 |
< |
painCave.severity = OOPSE_ERROR; |
150 |
< |
painCave.isFatal = 1; |
151 |
< |
simError(); |
152 |
< |
} |
135 |
> |
} else { |
136 |
> |
int obanum = etab.GetAtomicNum((datom->getType()).c_str()); |
137 |
> |
if (obanum != 0) { |
138 |
> |
currShape = new Sphere(datom->getPos(), etab.GetVdwRad(obanum)); |
139 |
> |
} else { |
140 |
> |
sprintf( painCave.errMsg, |
141 |
> |
"Could not find atom type in default element.txt\n"); |
142 |
> |
painCave.severity = OOPSE_ERROR; |
143 |
> |
painCave.isFatal = 1; |
144 |
> |
simError(); |
145 |
|
} |
146 |
< |
} |
146 |
> |
} |
147 |
|
} |
148 |
|
return currShape; |
149 |
|
} |