Skip to content

Commit

Permalink
Add EllipticArc Module (#112)
Browse files Browse the repository at this point in the history
* Added SMEllipticArcClass module

* Added documentation for elliptic curve

* Fixed minor syntax errors

* Shortened warning message to suppress "Error: Line truncated"

* Fixed typos

* Added RotatedEllipseAnd4Circle example

* Fixed more typos

* Added initWithParametersNameAndID_SMEllipticArc override

* Fixed typos

* Corrected documentation

* Changed RotatedEllipse example for coverage

* Added elliptic arc to AllFeatures.control

* Added RotatedEllipse example to Benchmarks

* Updated documentation

* Update Benchmarks/TestGeneratorControlFiles/AllFeatures.control

Co-authored-by: Andrew Winters <[email protected]>

* Update Documentation/docs/examples.md

Co-authored-by: Andrew Winters <[email protected]>

* Update Examples/2D/AllFeatures/AllFeatures.control

Co-authored-by: Andrew Winters <[email protected]>

* Update Benchmarks/TestGeneratorControlFiles/RotatedEllipseWithSubregions.control

Co-authored-by: Andrew Winters <[email protected]>

* Update Benchmarks/TestGeneratorControlFiles/RotatedEllipseWithSubregions.control

Co-authored-by: Andrew Winters <[email protected]>

* Update Benchmarks/TestGeneratorControlFiles/RotatedEllipseWithSubregions.control

Co-authored-by: Andrew Winters <[email protected]>

* Update Benchmarks/TestGeneratorControlFiles/RotatedEllipseWithSubregions.control

Co-authored-by: Andrew Winters <[email protected]>

* Update Examples/2D/RotatedEllipseWithSubregions/RotatedEllipseWithSubregions.control

Co-authored-by: Andrew Winters <[email protected]>

* Update Examples/2D/RotatedEllipseWithSubregions/RotatedEllipseWithSubregions.control

Co-authored-by: Andrew Winters <[email protected]>

* Update Examples/2D/RotatedEllipseWithSubregions/RotatedEllipseWithSubregions.control

Co-authored-by: Andrew Winters <[email protected]>

* Update Examples/2D/RotatedEllipseWithSubregions/RotatedEllipseWithSubregions.control

Co-authored-by: Andrew Winters <[email protected]>

* Make CircularArc inherit from EllipticArc

* Added/fixed RotatedEllipse in Benchmarks directory

* Updated structure to use GENERIC

* Updated documentation

* Fixed typo

* Fixed tests

* Specified missing type

* Fixed typos and moved AllFeatures image

* Removed initDefaultEllipse subroutine

* Formatting

* Added printDescription tests for line and ellipse

* Update ControlFileReader.f90

Updated the control file grammar in the comments. Added the keywords used to construct an elliptic arc, etc.

* Modify Curve tests

Move the scratch iUnit open to test routine out of the printDescription procedure.

* Update CurveTests.f90

Use newunit to generate an unused file unit. Remove extraneous lines in TestPrintDescription

* Update CurveTests.f90

Fix SAVEd bug introduced in last commit.

---------

Co-authored-by: Andrew Winters <[email protected]>
Co-authored-by: David Kopriva <[email protected]>
  • Loading branch information
3 people authored Nov 8, 2024
1 parent e7ed7d0 commit 85e586d
Show file tree
Hide file tree
Showing 19 changed files with 21,594 additions and 263 deletions.
9 changes: 9 additions & 0 deletions Benchmarks/BenchmarkData/RotatedEllipseWithSubregions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
1
2436 2674 5116 7
8.99660E-03
1.09943E+00
1.07198E+00
1.19205E+00
8.43429E-03
8.30762E+01
9.80230E+01
1 change: 1 addition & 0 deletions Benchmarks/BenchmarkFiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ Benchmarks/ControlFiles/Box3D.control
Benchmarks/ControlFiles/Box3DRotated.control
Benchmarks/ControlFiles/BoneAndMarrow.control
Benchmarks/ControlFiles/PacMan.control
Benchmarks/ControlFiles/RotatedEllipseWithSubregions.control
147 changes: 147 additions & 0 deletions Benchmarks/ControlFiles/RotatedEllipseWithSubregions.control
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
\begin{CONTROL_INPUT}

\begin{RUN_PARAMETERS}
mesh file name = Benchmarks/MeshFiles/Tests/RotatedEllipseWithSubregions.mesh
plot file name = Benchmarks/PlotFiles/Tests/RotatedEllipseWithSubregions.tec
stats file name = Benchmarks/StatsFiles/Tests/RotatedEllipseWithSubregions.txt
test file name = Benchmarks/BenchmarkData/RotatedEllipseWithSubregions.txt
mesh file format = ISM
polynomial order = 5
plot file format = skeleton
\end{RUN_PARAMETERS}

\begin{BACKGROUND_GRID}
background grid size = [0.1,0.1,0.1]
\end{BACKGROUND_GRID}

\begin{SPRING_SMOOTHER}
smoothing = ON
smoothing type = LinearAndCrossBarSpring
number of iterations = 10
\end{SPRING_SMOOTHER}

\end{CONTROL_INPUT}

\begin{MODEL}

\begin{OUTER_BOUNDARY}
\begin{ELLIPTIC_ARC}
name = outer
center = [0.0,0.0,0.0]
xRadius = 4
yRadius = 2
start angle = 0.0
end angle = 360.0
rotation = 45.0
units = degrees
\end{ELLIPTIC_ARC}
\end{OUTER_BOUNDARY}

\begin{INNER_BOUNDARIES}

\begin{CHAIN}
name = Inner circle 1
\begin{PARAMETRIC_EQUATION_CURVE}
name = Circle1
xEqn = f(t) = 0.3*cos(2*pi*t)
yEqn = f(t) = 0.5 + 0.3*sin(2*pi*t)
zEqn = z(t) = 0.0
\end{PARAMETRIC_EQUATION_CURVE}
\end{CHAIN}

\begin{CHAIN}
name = Inner circle 2
\begin{PARAMETRIC_EQUATION_CURVE}
name = Circle2
xEqn = f(t) = -1.0 + 0.5*cos(2*pi*t)
yEqn = f(t) = 0.5*sin(2*pi*t)
zEqn = z(t) = 0.0
\end{PARAMETRIC_EQUATION_CURVE}
\end{CHAIN}

\begin{CHAIN}
name = Inner circle 3
\begin{PARAMETRIC_EQUATION_CURVE}
name = Circle3
xEqn = f(t) = 1.0 + 0.2*cos(2*pi*t)
yEqn = f(t) = 0.2*sin(2*pi*t)
zEqn = z(t) = 0.0
\end{PARAMETRIC_EQUATION_CURVE}
\end{CHAIN}

\begin{CHAIN}
name = Inner circle 4
\begin{PARAMETRIC_EQUATION_CURVE}
name = Circle4
xEqn = f(t) = 0.5 + 0.15*cos(2*pi*t)
yEqn = f(t) = 0.15*sin(2*pi*t) - 0.5
zEqn = z(t) = 0.0
\end{PARAMETRIC_EQUATION_CURVE}
\end{CHAIN}

\begin{CHAIN}
name = Inner Half Ellipse 1
\begin{ELLIPTIC_ARC}
name = Ellipse1
center = [1.5,1.5,0.0]
xRadius = 1.0
yRadius = 0.5
start angle = -180.0
end angle = 0.0
rotation = 0.0
units = degrees
\end{ELLIPTIC_ARC}
\begin{END_POINTS_LINE}
name = E1
xStart = [2.5,1.5,0.0]
xEnd = [0.5,1.5,0.0]
\end{END_POINTS_LINE}
\end{CHAIN}

\begin{CHAIN}
name = Inner Half Ellipse 2
\begin{ELLIPTIC_ARC}
name = Ellipse2
center = [1.5,2.0,0.0]
xRadius = 1.0
yRadius = 0.5
start angle = 0.0
end angle = 3.14159265358979323846
rotation = 0.0
units = radians
\end{ELLIPTIC_ARC}
\begin{END_POINTS_LINE}
name = E2
xStart = [0.5,2.0,0.0]
xEnd = [2.5,2.0,0.0]
\end{END_POINTS_LINE}
\end{CHAIN}

\begin{CHAIN}
name = Inner Third Ellipse
\begin{ELLIPTIC_ARC}
name = Ellipse3
center = [-2.0,-2.0,0.0]
xRadius = 0.5
yRadius = 1.0
start angle = 0.0
end angle = 90.0
rotation = 0.0
units = degrees
\end{ELLIPTIC_ARC}
\begin{END_POINTS_LINE}
name = E3
xStart = [-2.0,-1.0,0.0]
xEnd = [-2.0,-2.0,0.0]
\end{END_POINTS_LINE}
\begin{END_POINTS_LINE}
name = E4
xStart = [-2.0,-2.0,0.0]
xEnd = [-1.5,-2.0,0.0]
\end{END_POINTS_LINE}
\end{CHAIN}

\end{INNER_BOUNDARIES}

\end{MODEL}
\end{FILE}
18 changes: 17 additions & 1 deletion Benchmarks/TestGeneratorControlFiles/AllFeatures.control
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
% Using Circular Arc
%
\begin{CHAIN}
name = Arc
name = Circular Arc
\begin{CIRCULAR_ARC}
name = InnerCircle1
units = degrees
Expand All @@ -120,6 +120,22 @@
\end{CIRCULAR_ARC}
\end{CHAIN}
%
% Using Elliptic Arc
%
\begin{CHAIN}
name = Elliptic Arc
\begin{ELLIPTIC_ARC}
name = InnerEllipse1
units = degrees
center = [-6.0,8.0,0.0]
xRadius = 2.0
yRadius = 1.0
start angle = 0.0
end angle = 360.0
rotation = 45.0
\end{ELLIPTIC_ARC}
\end{CHAIN}
%
% Using parametric equation curve
%
\begin{CHAIN}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
\begin{CONTROL_INPUT}

\begin{RUN_PARAMETERS}
mesh file name = Benchmarks/MeshFiles/Benchmarks/RotatedEllipseWithSubregions.mesh
plot file name = Benchmarks/PlotFiles/Benchmarks/RotatedEllipseWithSubregions.tec
stats file name = Benchmarks/StatsFiles/Benchmarks/RotatedEllipseWithSubregions.txt
test file name = Benchmarks/BenchmarkData/RotatedEllipseWithSubregions.txt
mesh file format = ISM
polynomial order = 5
plot file format = skeleton
\end{RUN_PARAMETERS}

\begin{BACKGROUND_GRID}
background grid size = [0.1,0.1,0.1]
\end{BACKGROUND_GRID}

\begin{SPRING_SMOOTHER}
smoothing = ON
smoothing type = LinearAndCrossBarSpring
number of iterations = 10
\end{SPRING_SMOOTHER}

\end{CONTROL_INPUT}

\begin{MODEL}

\begin{OUTER_BOUNDARY}
\begin{ELLIPTIC_ARC}
name = outer
center = [0.0,0.0,0.0]
xRadius = 4
yRadius = 2
start angle = 0.0
end angle = 360.0
units = degrees
rotation = 45.0
\end{ELLIPTIC_ARC}
\end{OUTER_BOUNDARY}

\begin{INNER_BOUNDARIES}

\begin{CHAIN}
name = Inner circle 1
\begin{PARAMETRIC_EQUATION_CURVE}
name = Circle1
xEqn = f(t) = 0.3*cos(2*pi*t)
yEqn = f(t) = 0.5 + 0.3*sin(2*pi*t)
zEqn = z(t) = 0.0
\end{PARAMETRIC_EQUATION_CURVE}
\end{CHAIN}

\begin{CHAIN}
name = Inner circle 2
\begin{PARAMETRIC_EQUATION_CURVE}
name = Circle2
xEqn = f(t) = -1.0 + 0.5*cos(2*pi*t)
yEqn = f(t) = 0.5*sin(2*pi*t)
zEqn = z(t) = 0.0
\end{PARAMETRIC_EQUATION_CURVE}
\end{CHAIN}

\begin{CHAIN}
name = Inner circle 3
\begin{PARAMETRIC_EQUATION_CURVE}
name = Circle3
xEqn = f(t) = 1.0 + 0.2*cos(2*pi*t)
yEqn = f(t) = 0.2*sin(2*pi*t)
zEqn = z(t) = 0.0
\end{PARAMETRIC_EQUATION_CURVE}
\end{CHAIN}

\begin{CHAIN}
name = Inner circle 4
\begin{PARAMETRIC_EQUATION_CURVE}
name = Circle4
xEqn = f(t) = 0.5 + 0.15*cos(2*pi*t)
yEqn = f(t) = 0.15*sin(2*pi*t) - 0.5
zEqn = z(t) = 0.0
\end{PARAMETRIC_EQUATION_CURVE}
\end{CHAIN}

\begin{CHAIN}
name = Inner Half Ellipse 1
\begin{ELLIPTIC_ARC}
name = Ellipse1
center = [1.5,1.5,0.0]
xRadius = 1.0
yRadius = 0.5
start angle = -180.0
end angle = 0.0
units = degrees
\end{ELLIPTIC_ARC}
\begin{END_POINTS_LINE}
name = E1
xStart = [2.5,1.5,0.0]
xEnd = [0.5,1.5,0.0]
\end{END_POINTS_LINE}
\end{CHAIN}

\begin{CHAIN}
name = Inner Half Ellipse 2
\begin{ELLIPTIC_ARC}
name = Ellipse2
center = [1.5,2.0,0.0]
xRadius = 1.0
yRadius = 0.5
start angle = 0.0
end angle = 3.14159265358979323846
units = radians
\end{ELLIPTIC_ARC}
\begin{END_POINTS_LINE}
name = E2
xStart = [0.5,2.0,0.0]
xEnd = [2.5,2.0,0.0]
\end{END_POINTS_LINE}
\end{CHAIN}

\begin{CHAIN}
name = Inner Third Ellipse
\begin{ELLIPTIC_ARC}
name = Ellipse3
center = [-2.0,-2.0,0.0]
xRadius = 0.5
yRadius = 1.0
start angle = 0.0
end angle = 90.0
units = degrees
\end{ELLIPTIC_ARC}
\begin{END_POINTS_LINE}
name = E3
xStart = [-2.0,-1.0,0.0]
xEnd = [-2.0,-2.0,0.0]
\end{END_POINTS_LINE}
\begin{END_POINTS_LINE}
name = E4
xStart = [-2.0,-2.0,0.0]
xEnd = [-1.5,-2.0,0.0]
\end{END_POINTS_LINE}
\end{CHAIN}

\end{INNER_BOUNDARIES}

\end{MODEL}
\end{FILE}
42 changes: 23 additions & 19 deletions Documentation/docs/examples.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
# Examples

HOHQMesh comes with 12 example control, mesh, and plot files for two-dimensional meshes found in the *Examples/2D* directory. These examples illustrate the use of the the control and model features, and the resulting meshes and plot files.
HOHQMesh comes with 18 example control, mesh, and plot files for two-dimensional meshes found in the *Examples/2D* directory. These examples illustrate the use of the the control and model features, and the resulting meshes and plot files.

Also included in the Examples directory is a control template: ControlTemplate.control,
that can (like any of the examples) be modified at will.

| Name | Description | Outer | Inner | Chain | Parametric Eqn | Spline | Line | Arc | Refinement Center | Refinement Line |
| ----------- | ------------------------------------ |-------|-------|-------|----------------|--------|------|-----|--------------| --------------- |
| AllFeatures | A triangle with three holes |:material-check: | :material-check:3 | :material-check: | :material-check: | :material-check: | :material-check: | :material-check: | :material-check:| :material-check:
| CavityRamp | A cavity domain with a sloping ramp on the exit side |:material-check: | :material-close: | :material-check: | :material-close: | :material-close: | :material-check: | :material-close: | :material-close:| :material-close:|
| Circles3 | Three circles enclosed by a large circle |:material-check: | :material-check:3 | :material-close: | :material-check: | :material-close: | :material-close: | :material-close: | :material-close:| :material-close:|
| EllipseAndFourCircles | Four circles enclosed by an ellipse |:material-check: | :material-check:4 | :material-close: | :material-check: | :material-close: | :material-close: | :material-close: | :material-close:| :material-close:|
| EastCoastUS | A region of the US East Coast |:material-check: | :material-close: | :material-check: | :material-close: | :material-check:(From file) | :material-check: | :material-close: | :material-close:| :material-close:|
| GingerbreadMan | Geometry with lots of holes |:material-check: | :material-check:6 | :material-close: | :material-check: | :material-check: | :material-close: | :material-close: | :material-close:| :material-close:|
| Half Circle | A half circle |:material-check: | :material-close: | :material-close: | :material-check: | :material-close: | :material-check: | :material-close: | :material-close:| :material-close:
| Indian Ocean | Complex domain with islands and inlets |:material-check: | :material-check:3 | :material-close: | :material-close: | :material-check: | :material-close: | :material-close: | :material-close:| :material-close:
| KT3Element | Three element Karman-Trefftz airfoil |:material-close: | :material-check:3 | :material-close: | :material-close: | :material-check: | :material-close: | :material-close: | :material-close:| :material-close:
| Lake Superior | Complex domain with islands |:material-check: | :material-check:2 | :material-close: | :material-close: | :material-check: | :material-close: | :material-close: | :material-close:| :material-close:
| NACA0012 | Standard Airfoil geometry |:material-close: | :material-check: | :material-close: | :material-check: | :material-close: | :material-close: | :material-close: | :material-check:| :material-close:
| Pill | Oblong domain with interior circles |:material-check: | :material-check:3 | :material-check: | :material-close: | :material-close: | :material-close: |:material-close: | :material-close:| :material-close:
| SplineGeometry | Free form domain defined as a spline |:material-check: | :material-close: | :material-close: | :material-close: | :material-check: | :material-close: |:material-close: | :material-close:| :material-close:
| Square | Generation of a Cartesian mesh with no model |:material-close: | :material-close: | :material-close: | :material-close: | :material-close: | :material-close: | :material-close: | :material-close:| :material-close:
| BoneAndMarrow | Two embedded domains |:material-check: | :material-close: | :material-close: | :material-check: | :material-close: | :material-close: | :material-close: | :material-close:| :material-close:
| PacMan | A symmetric mesh |:material-check: | :material-close: | :material-close: | :material-check: | :material-close: | :material-check: | :material-close: | :material-close:| :material-close:
| Name | Description | Outer | Inner | Chain | Parametric Eqn | Spline | Line | Circular Arc | Elliptic Arc | Refinement Center | Refinement Line |
| ------------|--------------------------------------|-------|-------|-------|----------------|--------|------|--------------|--------------|-------------------|-----------------|
| AllFeatures | A triangle with four holes |:material-check: | :material-check:4 | :material-check: | :material-check: | :material-check: | :material-check: | :material-check: | :material-check: | :material-check:| :material-check:|
| BoneAndMarrow | Two embedded domains |:material-check: | :material-close: | :material-close: | :material-check: | :material-close: | :material-close: | :material-close: | :material-close: | :material-close:| :material-close:|
| BoxWithRefinement | A square domain with a refined mesh | :material-close: | :material-close: | :material-close: | :material-close: | :material-close: | :material-close: | :material-close: | :material-close: | :material-check: | :material-check: |
| CavityRamp | A cavity domain with a sloping ramp on the exit side |:material-check: | :material-close: | :material-check: | :material-close: | :material-close: | :material-check: | :material-close: | :material-close: | :material-close:| :material-close:|
| Circles3 | Three circles enclosed by a large circle |:material-check: | :material-check:3 | :material-close: | :material-check: | :material-close: | :material-close: | :material-close: | :material-close: | :material-close:| :material-close:|
| EastCoastUS | A region of the US East Coast |:material-check: | :material-close: | :material-check: | :material-close: | :material-check:(From file) | :material-check: | :material-close: | :material-close: | :material-close:| :material-close:|
| EllipseAndFourCircles | Four circles enclosed by an ellipse |:material-check: | :material-check:4 | :material-close: | :material-check: | :material-close: | :material-close: | :material-close: | :material-close: | :material-close:| :material-close:|
| GingerbreadMan | Geometry with lots of holes |:material-check: | :material-check:6 | :material-close: | :material-check: | :material-check: | :material-close: | :material-close: | :material-close: | :material-close:| :material-close:|
| Half Circle | A half circle |:material-check: | :material-close: | :material-close: | :material-check: | :material-close: | :material-check: | :material-close: | :material-close: | :material-close:| :material-close:|
| Indian Ocean | Complex domain with islands and inlets |:material-check: | :material-check:3 | :material-close: | :material-close: | :material-check: | :material-close: | :material-close: | :material-close: | :material-close:| :material-close:|
| KT3Element | Three element Karman-Trefftz airfoil |:material-close: | :material-check:3 | :material-close: | :material-close: | :material-check: | :material-close: | :material-close: | :material-close: | :material-close:| :material-close:|
| Lake Superior | Complex domain with islands |:material-check: | :material-check:2 | :material-close: | :material-close: | :material-check: | :material-close: | :material-close: | :material-close: | :material-close:| :material-close:|
| NACA0012 | Standard Airfoil geometry |:material-close: | :material-check: | :material-close: | :material-check: | :material-close: | :material-close: | :material-close: | :material-close: | :material-check:| :material-close:|
| PacMan | A symmetric mesh |:material-check: | :material-close: | :material-close: | :material-check: | :material-close: | :material-check: | :material-close: | :material-close: | :material-close:| :material-close:|
| Pill | Oblong domain with interior circles |:material-check: | :material-check:3 | :material-check: | :material-close: | :material-close: | :material-close: |:material-close: | :material-close: | :material-close:| :material-close:|
| RotatedEllipseWithSubregions | Four circles, two half ellipses, and one quarter ellipse enclosed by an ellipse |:material-check: | :material-check:4 | :material-close: | :material-check: | :material-close: | :material-close: | :material-close: | :material-check: | :material-close:| :material-close:|
| SplineGeometry | Free form domain defined as a spline |:material-check: | :material-close: | :material-close: | :material-close: | :material-check: | :material-close: |:material-close: | :material-close: | :material-close:| :material-close:|
| Square | Generation of a Cartesian mesh with no model |:material-close: | :material-close: | :material-close: | :material-close: | :material-close: | :material-close: | :material-close: | :material-close: | :material-close:| :material-close:|



There are also ten three dimensional examples that illustrate the different extrusion algorithms in the *Examples/3D* directory

Expand Down
Loading

0 comments on commit 85e586d

Please sign in to comment.