From 0b7d1d70fa10c22932fae4a3e5720505419f695d Mon Sep 17 00:00:00 2001 From: Koen Hillewaert <koen.hillewaert@cenaero.be> Date: Wed, 12 Aug 2009 16:43:48 +0000 Subject: [PATCH] change to frustrated cylinder, as defined by extent of the axis --- Mesh/Field.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Mesh/Field.cpp b/Mesh/Field.cpp index 5facf32e49..73d0f58031 100644 --- a/Mesh/Field.cpp +++ b/Mesh/Field.cpp @@ -485,9 +485,10 @@ class CylinderField : public Field public: 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" " ||dX||^2 < R^2 &&\n" + " (X-X0).A < ||A||^2\n" " dX = (X - X0) - ((X - X0).A)/(||A||^2) . A"; } CylinderField() @@ -535,7 +536,7 @@ class CylinderField : public Field dy -= adx * ya; 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; } }; -- GitLab