Skip to content
Snippets Groups Projects
Commit 72970536 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

Sphere is a reserved keyword -> use Ball instead

parent 1b043016
No related branches found
No related tags found
No related merge requests found
...@@ -485,7 +485,7 @@ class CylinderField : public Field ...@@ -485,7 +485,7 @@ class CylinderField : public Field
} }
}; };
class SphereField : public Field class BallField : public Field
{ {
double v_in, v_out; double v_in, v_out;
double xc,yc,zc; double xc,yc,zc;
...@@ -494,35 +494,33 @@ class SphereField : public Field ...@@ -494,35 +494,33 @@ class SphereField : public Field
public: public:
std::string getDescription() std::string getDescription()
{ {
return "The value of this field is VIn inside a sphere, VOut outside. " return "The value of this field is VIn inside a spherical ball, VOut outside. "
"The sphere is given by\n\n" "The ball is defined by\n\n"
" ||dX||^2 < R^2 &&\n" " ||dX||^2 < R^2 &&\n"
" dX = (X - XC)^2 + (Y-YC)^2 + (Z-ZC)^2"; " dX = (X - XC)^2 + (Y-YC)^2 + (Z-ZC)^2";
} }
SphereField() BallField()
{ {
v_in = v_out = xc = yc = zc = R = 0; v_in = v_out = xc = yc = zc = R = 0;
options["VIn"] = new FieldOptionDouble options["VIn"] = new FieldOptionDouble
(v_in, "Value inside the sphere"); (v_in, "Value inside the ball");
options["VOut"] = new FieldOptionDouble options["VOut"] = new FieldOptionDouble
(v_out, "Value outside the sphere"); (v_out, "Value outside the ball");
options["XCenter"] = new FieldOptionDouble options["XCenter"] = new FieldOptionDouble
(xc, "X coordinate of the sphere center"); (xc, "X coordinate of the ball center");
options["YCenter"] = new FieldOptionDouble options["YCenter"] = new FieldOptionDouble
(yc, "Y coordinate of the sphere center"); (yc, "Y coordinate of the ball center");
options["ZCenter"] = new FieldOptionDouble options["ZCenter"] = new FieldOptionDouble
(zc, "Z coordinate of the sphere center"); (zc, "Z coordinate of the ball center");
options["Radius"] = new FieldOptionDouble options["Radius"] = new FieldOptionDouble
(R,"Radius"); (R,"Radius");
} }
const char *getName() const char *getName()
{ {
return "Sphere"; return "Ball";
} }
double operator() (double x, double y, double z, GEntity *ge=0) double operator() (double x, double y, double z, GEntity *ge=0)
{ {
...@@ -2300,7 +2298,7 @@ FieldManager::FieldManager() ...@@ -2300,7 +2298,7 @@ FieldManager::FieldManager()
#endif #endif
map_type_name["Box"] = new FieldFactoryT<BoxField>(); map_type_name["Box"] = new FieldFactoryT<BoxField>();
map_type_name["Cylinder"] = new FieldFactoryT<CylinderField>(); map_type_name["Cylinder"] = new FieldFactoryT<CylinderField>();
map_type_name["Sphere"] = new FieldFactoryT<SphereField>(); map_type_name["Ball"] = new FieldFactoryT<BallField>();
map_type_name["Frustum"] = new FieldFactoryT<FrustumField>(); map_type_name["Frustum"] = new FieldFactoryT<FrustumField>();
map_type_name["LonLat"] = new FieldFactoryT<LonLatField>(); map_type_name["LonLat"] = new FieldFactoryT<LonLatField>();
#if defined(HAVE_POST) #if defined(HAVE_POST)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment