Skip to content
Snippets Groups Projects
Commit 0b7d1d70 authored by Koen Hillewaert's avatar Koen Hillewaert
Browse files

change to frustrated cylinder, as defined by extent of the axis

parent 7c510e71
No related branches found
No related tags found
No related merge requests found
...@@ -485,9 +485,10 @@ class CylinderField : public Field ...@@ -485,9 +485,10 @@ class CylinderField : public Field
public: public:
std::string getDescription() std::string getDescription()
{ {
return "The value of this field is VIn inside the cylinder, VOut outside.\n" return "The value of this field is VIn inside a frustrated cylinder, VOut outside.\n"
"The cylinder is given by\n\n" "The cylinder is given by\n\n"
" ||dX||^2 < R^2 &&\n" " ||dX||^2 < R^2 &&\n"
" (X-X0).A < ||A||^2\n"
" dX = (X - X0) - ((X - X0).A)/(||A||^2) . A"; " dX = (X - X0) - ((X - X0).A)/(||A||^2) . A";
} }
CylinderField() CylinderField()
...@@ -535,7 +536,7 @@ class CylinderField : public Field ...@@ -535,7 +536,7 @@ class CylinderField : public Field
dy -= adx * ya; dy -= adx * ya;
dz -= adx * za; dz -= adx * za;
return (dx*dx + dy*dy + dz*dz < R*R) ? v_in : v_out; return ((dx*dx + dy*dy + dz*dz < R*R) && fabs(adx) < 1) ? v_in : v_out;
} }
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment