# enzo-dev-problem-types

committed 3daa5f2

Added a new cylindrical geometry selection. Allows for cylinder to be oriented in any axis direction.

# src/enzo/InitializationKernel.C

`     else return FALSE;`
` }`
` `
`+Enzo::Geometry::CylindricalRegion::CylindricalRegion(`
`+    FLOAT radius, FLOAT length, FLOAT *center, int axis)`
`+{`
`+    this->radius = radius;`
`+    this->radius2 = radius * radius;`
`+    this->length = length;`
`+    this->halflength = length / 2.0`
`+    this->center[0] = center[0];`
`+    this->center[1] = center[1];`
`+    this->center[2] = center[2];`
`+    this->axis = axis`
`+}`
`+`
`+int Enzo::Geometry::CylindericalRegion::PointContained(`
`+    FLOAT x, FLOAT y, FLOAT z, FLOAT dx, FLOAT dy, FLOAT dz)`
`+{`
`+    /* If the cell center is within the radial or lengthwise extent,`
`+    we return TRUE */`
`+    FLOAT temp[3], r2 = 0, l=0;`
`+    int i;`
`+    `
`+    temp[0] = (x - this->center[0]);`
`+    temp[1] = (y - this->center[1]);`
`+    temp[2] = (z - this->center[2]);`
`+`
`+    l = abs(temp[this->axis])`
`+`
`+    if (axis == 0)`
`+        r2 = (temp[1] * temp[1]) + (temp[2] * temp[2]);`
`+`
`+    if (axis == 1)`
`+        r2 = (temp[0] * temp[0]) + (temp[2] * temp[2]);`
`+`
`+    if (axis == 2)`
`+        r2 = (temp[0] * temp[0]) + (temp[1] * temp[1]);`
`+`
`+    if ( (r2 < this->radius2) && (l < this-halflength) ) return TRUE;`
`+    else return FALSE;`
`+}`
`+`
` #endif`

# src/enzo/InitializationKernel.h

`         FLOAT radius2;`
`         FLOAT center[3];`
`     };`
`+`
`+    class CylindricalRegion : public GeometricRegion`
`+    {`
`+      public:`
`+        CylindricalRegion(FLOAT radius, FLOAT length, FLOAT *center, int axis);`
`+        int PointContained(`
`+                   FLOAT x, FLOAT y, FLOAT z,`
`+                   FLOAT dx, FLOAT dy, FLOAT dz) = 0;`
`+      private:`
`+        FLOAT radius;`
`+        FLOAT radius2;`
`+        FLOAT length;`
`+        FLOAT halflength;`
`+        FLOAT center[3];`
`+        int axis;`
`+    };`
`+`
`   }`
` }`
` `
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.