Skip to content

Commit

Permalink
Different Boundary Conditions for Standard Abaqus (#1799)
Browse files Browse the repository at this point in the history
* first take on BCs for standard Abaqus

* simplify

* Couple comments, example

* comments

* shorten code

* refactor

* fmt

* refactor

* 3D

* tests and fmt

* comment

* news

* comment

* stick to polydeg

* polydeg 3

* polydeg

* Update examples/p4est_2d_dgsem/elixir_euler_airfoil_mach2.jl

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

* Update examples/p4est_2d_dgsem/elixir_euler_airfoil_mach2.jl

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

* Update src/meshes/p4est_mesh.jl

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

* Update NEWS.md

Co-authored-by: Erik Faulhaber <[email protected]>

* Update examples/p4est_3d_dgsem/elixir_euler_free_stream_boundaries.jl

* improve (?) formatting

* fmt

* split constructor

* comment

* two boundaries

* comment

* comment

* rename elixir, change mesh

* comments

* add doc

* avoid unicode

* improve doc

* Add tutorial

* typos

* Update docs/src/meshes/p4est_mesh.md

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

* Update docs/literate/src/files/p4est_from_gmsh.jl

Co-authored-by: Joshua Lampert <[email protected]>

* Update docs/literate/src/files/p4est_from_gmsh.jl

Co-authored-by: Joshua Lampert <[email protected]>

* Update docs/literate/src/files/p4est_from_gmsh.jl

Co-authored-by: Joshua Lampert <[email protected]>

* Update docs/src/meshes/p4est_mesh.md

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

* Update docs/src/meshes/p4est_mesh.md

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

* Update docs/src/meshes/p4est_mesh.md

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

* Update docs/src/meshes/p4est_mesh.md

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

* Update docs/src/meshes/p4est_mesh.md

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

* Update docs/literate/src/files/p4est_from_gmsh.jl

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

* Update docs/literate/src/files/p4est_from_gmsh.jl

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

* Update docs/src/meshes/p4est_mesh.md

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

* Update docs/src/meshes/p4est_mesh.md

* Update docs/literate/src/files/p4est_from_gmsh.jl

* Update docs/literate/src/files/p4est_from_gmsh.jl

* Update docs/literate/src/files/p4est_from_gmsh.jl

* Update docs/literate/src/files/p4est_from_gmsh.jl

* Update docs/literate/src/files/p4est_from_gmsh.jl

* Update docs/literate/src/files/p4est_from_gmsh.jl

* Apply suggestions from code review

Polish

* Update docs/literate/src/files/p4est_from_gmsh.jl

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

* Comments

* Update p4est_mesh.jl

* Update src/meshes/p4est_mesh.jl

Co-authored-by: Johannes Markert <[email protected]>

* Update docs/src/meshes/p4est_mesh.md

Co-authored-by: Johannes Markert <[email protected]>

* Update docs/src/meshes/p4est_mesh.md

Co-authored-by: Johannes Markert <[email protected]>

* Update docs/src/meshes/p4est_mesh.md

Co-authored-by: Johannes Markert <[email protected]>

* Update docs/src/meshes/p4est_mesh.md

Co-authored-by: Johannes Markert <[email protected]>

* more robust parsing

* print warning if there has been a bc name supplied for which no nodes have been found

* Update docs/literate/src/files/p4est_from_gmsh.jl

Co-authored-by: Hendrik Ranocha <[email protected]>

* Update docs/literate/src/files/p4est_from_gmsh.jl

Co-authored-by: Hendrik Ranocha <[email protected]>

* Update src/meshes/p4est_mesh.jl

Co-authored-by: Hendrik Ranocha <[email protected]>

* Update docs/literate/src/files/p4est_from_gmsh.jl

---------

Co-authored-by: Andrew Winters <[email protected]>
Co-authored-by: Erik Faulhaber <[email protected]>
Co-authored-by: Joshua Lampert <[email protected]>
Co-authored-by: Johannes Markert <[email protected]>
Co-authored-by: Hendrik Ranocha <[email protected]>
  • Loading branch information
6 people authored Jan 25, 2024
1 parent ba812be commit 585fb93
Show file tree
Hide file tree
Showing 9 changed files with 1,145 additions and 11 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ for human readability.
#### Added
- AMR for hyperbolic-parabolic equations on 3D `P4estMesh`
- `flux_hllc` on non-cartesian meshes for `CompressibleEulerEquations{2,3}D`
- Different boundary conditions for quad/hex meshes in Abaqus format, even if not generated by HOHQMesh,
can now be digested by Trixi in 2D and 3D.

## Changes when updating to v0.6 from v0.5.x

Expand Down
459 changes: 459 additions & 0 deletions docs/literate/src/files/p4est_from_gmsh.jl

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ files = [
"Adaptive mesh refinement" => "adaptive_mesh_refinement.jl",
"Structured mesh with curvilinear mapping" => "structured_mesh_mapping.jl",
"Unstructured meshes with HOHQMesh.jl" => "hohqmesh_tutorial.jl",
"P4est mesh from gmsh" => "p4est_from_gmsh.jl",
# Topic: other stuff
"Explicit time stepping" => "time_stepping.jl",
"Differentiable programming" => "differentiable_programming.jl",
Expand Down
256 changes: 253 additions & 3 deletions docs/src/meshes/p4est_mesh.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ This heading is used to indicate to the mesh constructor which of the above mapp
create a curvilinear mesh.
If the Abaqus file header is **not** present then the `P4estMesh` is created with the first strategy above.

#### List of corner nodes
#### <a name="nodes"></a>List of corner nodes

Next, prefaced with `*NODE`, comes a list of the physical `(x,y,z)` coordinates of all the corners.
The first integer in the list of the corners provides its id number.
Expand All @@ -71,7 +71,7 @@ Thus, for the two-dimensional example mesh this block of corner information is
7, 3.0, -1.0, 0.0
```

#### List of elements
#### <a name="elements"></a>List of elements

The element connectivity is given after the list of corners. The header for this information block is
```
Expand All @@ -98,7 +98,9 @@ The construction of the element neighbor ids and identifying physical boundary s
directly from the [`p4est`](https://github.com/cburstedde/p4est) library.
For example, the neighbor connectivity is created in the mesh constructor using the wrapper `read_inp_p4est` function.

#### HOHQMesh boundary information
#### Encoding of boundaries

##### HOHQMesh boundary information

If present, any additional information in the mesh file that was created by `HOHQMesh` is prefaced with
`** ` to make it an Abaqus comment.
Expand Down Expand Up @@ -230,8 +232,38 @@ For completeness, we provide the entire Abaqus mesh file for the example mesh in
** Bottom --- Right ---
```

##### Standard Abaqus format boundary information

As an alternative to an Abaqus mesh generated by `HOHQMesh`, `.inp` files with boundary information encoded as nodesets `*NSET,NSET=` can be used to construct a `p4est` mesh.
This is especially useful for usage of existing meshes (consisting of bilinear elements) which could stem from the popular [`gmsh`](https://gmsh.info/) meshing software.

In addition to the list of [nodes](#nodes) and [elements](#elements) given above, there are nodesets of the form
```
*NSET,NSET=PhysicalLine1
1, 4, 52, 53, 54, 55, 56, 57, 58,
```
present which are used to associate the edges defined through their corner nodes with a label. In this case it is called `PhysicalLine1`.
By looping over every element and its associated edges, consisting of two nodes, we query the read in `NSET`s if the current node pair is present.

To prevent that every nodeset following `*NSET,NSET=` is treated as a boundary, the user must supply a `boundary_symbols` keyword to the [`P4estMesh`](@ref) constructor:

```julia
boundary_symbols = [:PhysicalLine1]

mesh = P4estMesh{2}(mesh_file, polydeg = polydeg, boundary_symbols = boundary_symbols)
```
By doing so, only nodesets with a label present in `boundary_symbols` are treated as physical boundaries.
Other nodesets that could be used for diagnostics are not treated as external boundaries.
Note that there is a leading colon `:` compared to the label in the `.inp` mesh file.
This is required to turn the label into a [`Symbol`](https://docs.julialang.org/en/v1/manual/metaprogramming/#Symbols).

A 2D example for this mesh, which is read-in for an unstructured mesh file created with `gmsh`, is presented in
`examples/p4est_2d_dgsem/elixir_euler_NACA6412airfoil_mach2.jl`.

### Mesh in three spatial dimensions

#### `HOHQMesh`-Extended Abaqus format

The 3D Abaqus file format with high-order boundary information from `HOHQMesh` is very similar to the
2D version discussed above. There are only three changes:

Expand Down Expand Up @@ -346,4 +378,222 @@ transfinite map of the straight sided hexahedral element to find
\mathbf{X}(\boldsymbol{\xi}) = \boldsymbol\Sigma(\boldsymbol{\xi})
- \mathcal{C}_{\texttt{edge}}(\boldsymbol{\xi})
+ \mathbf{X}_{linear}(\boldsymbol{\xi}).
```

#### Construction from standard Abaqus

Also for a mesh in standard Abaqus format there are no qualitative changes when going from 2D to 3D.
The most notable difference is that boundaries are formed in 3D by faces defined by four nodes while in 2D boundaries are edges consisting of two elements.
A simple mesh file, which is used also in `examples/p4est_3d_dgsem/elixir_euler_free_stream_boundaries.jl`, is given below:
```
*Heading
<SOMETHING DIFFERENT FROM "File created by HOHQMesh">
*NODE
1, -2, 0, 0
2, -1, 0, 0
3, -1, 1, 0
4, -2, 1, 0
5, -2, 0, 1
6, -1, 0, 1
7, -1, 1, 1
8, -2, 1, 1
9, -1.75, 1, 0
10, -1.5, 1, 0
11, -1.25, 1, 0
12, -1, 0.75000000000035, 0
13, -1, 0.50000000000206, 0
14, -1, 0.25000000000104, 0
15, -1.25, 0, 0
16, -1.5, 0, 0
17, -1.75, 0, 0
18, -2, 0.24999999999941, 0
19, -2, 0.49999999999869, 0
20, -2, 0.74999999999934, 0
21, -1.75, 0, 1
22, -1.5, 0, 1
23, -1.25, 0, 1
24, -1, 0.24999999999941, 1
25, -1, 0.49999999999869, 1
26, -1, 0.74999999999934, 1
27, -1.25, 1, 1
28, -1.5, 1, 1
29, -1.75, 1, 1
30, -2, 0.75000000000035, 1
31, -2, 0.50000000000206, 1
32, -2, 0.25000000000104, 1
33, -2, 0, 0.24999999999941
34, -2, 0, 0.49999999999869
35, -2, 0, 0.74999999999934
36, -2, 1, 0.24999999999941
37, -2, 1, 0.49999999999869
38, -2, 1, 0.74999999999934
39, -1, 0, 0.24999999999941
40, -1, 0, 0.49999999999869
41, -1, 0, 0.74999999999934
42, -1, 1, 0.24999999999941
43, -1, 1, 0.49999999999869
44, -1, 1, 0.74999999999934
45, -1.25, 0.25000000000063, 0
46, -1.25, 0.50000000000122, 0
47, -1.25, 0.7500000000001, 0
48, -1.5, 0.25000000000023, 0
49, -1.5, 0.50000000000038, 0
50, -1.5, 0.74999999999984, 0
51, -1.75, 0.24999999999982, 0
52, -1.75, 0.49999999999953, 0
53, -1.75, 0.74999999999959, 0
54, -1.75, 0.25000000000063, 1
55, -1.75, 0.50000000000122, 1
56, -1.75, 0.7500000000001, 1
57, -1.5, 0.25000000000023, 1
58, -1.5, 0.50000000000038, 1
59, -1.5, 0.74999999999984, 1
60, -1.25, 0.24999999999982, 1
61, -1.25, 0.49999999999953, 1
62, -1.25, 0.74999999999959, 1
63, -2, 0.24999999999982, 0.24999999999941
64, -2, 0.49999999999953, 0.24999999999941
65, -2, 0.74999999999959, 0.24999999999941
66, -2, 0.25000000000023, 0.49999999999869
67, -2, 0.50000000000038, 0.49999999999869
68, -2, 0.74999999999984, 0.49999999999869
69, -2, 0.25000000000063, 0.74999999999934
70, -2, 0.50000000000122, 0.74999999999934
71, -2, 0.7500000000001, 0.74999999999934
72, -1.25, 1, 0.74999999999934
73, -1.25, 1, 0.49999999999869
74, -1.25, 1, 0.24999999999941
75, -1.5, 1, 0.74999999999934
76, -1.5, 1, 0.49999999999869
77, -1.5, 1, 0.24999999999941
78, -1.75, 1, 0.74999999999934
79, -1.75, 1, 0.49999999999869
80, -1.75, 1, 0.24999999999941
81, -1, 0.25000000000063, 0.24999999999941
82, -1, 0.50000000000122, 0.24999999999941
83, -1, 0.7500000000001, 0.24999999999941
84, -1, 0.25000000000023, 0.49999999999869
85, -1, 0.50000000000038, 0.49999999999869
86, -1, 0.74999999999984, 0.49999999999869
87, -1, 0.24999999999982, 0.74999999999934
88, -1, 0.49999999999953, 0.74999999999934
89, -1, 0.74999999999959, 0.74999999999934
90, -1.75, 0, 0.74999999999934
91, -1.75, 0, 0.49999999999869
92, -1.75, 0, 0.24999999999941
93, -1.5, 0, 0.74999999999934
94, -1.5, 0, 0.49999999999869
95, -1.5, 0, 0.24999999999941
96, -1.25, 0, 0.74999999999934
97, -1.25, 0, 0.49999999999869
98, -1.25, 0, 0.24999999999941
99, -1.75, 0.25000000000043, 0.74999999999934
100, -1.75, 0.25000000000023, 0.49999999999869
101, -1.75, 0.25000000000002, 0.24999999999941
102, -1.75, 0.5000000000008, 0.74999999999934
103, -1.75, 0.50000000000038, 0.49999999999869
104, -1.75, 0.49999999999995, 0.24999999999941
105, -1.75, 0.74999999999997, 0.74999999999934
106, -1.75, 0.74999999999984, 0.49999999999869
107, -1.75, 0.74999999999972, 0.24999999999941
108, -1.5, 0.25000000000023, 0.74999999999934
109, -1.5, 0.25000000000023, 0.49999999999869
110, -1.5, 0.25000000000023, 0.24999999999941
111, -1.5, 0.50000000000038, 0.74999999999934
112, -1.5, 0.50000000000038, 0.49999999999869
113, -1.5, 0.50000000000038, 0.24999999999941
114, -1.5, 0.74999999999984, 0.74999999999934
115, -1.5, 0.74999999999984, 0.49999999999869
116, -1.5, 0.74999999999984, 0.24999999999941
117, -1.25, 0.25000000000002, 0.74999999999934
118, -1.25, 0.25000000000023, 0.49999999999869
119, -1.25, 0.25000000000043, 0.24999999999941
120, -1.25, 0.49999999999995, 0.74999999999934
121, -1.25, 0.50000000000038, 0.49999999999869
122, -1.25, 0.5000000000008, 0.24999999999941
123, -1.25, 0.74999999999972, 0.74999999999934
124, -1.25, 0.74999999999984, 0.49999999999869
125, -1.25, 0.74999999999997, 0.24999999999941
******* E L E M E N T S *************
*ELEMENT, type=C3D8, ELSET=Volume1
153, 54, 21, 5, 32, 99, 90, 35, 69
154, 99, 90, 35, 69, 100, 91, 34, 66
155, 100, 91, 34, 66, 101, 92, 33, 63
156, 101, 92, 33, 63, 51, 17, 1, 18
157, 55, 54, 32, 31, 102, 99, 69, 70
158, 102, 99, 69, 70, 103, 100, 66, 67
159, 103, 100, 66, 67, 104, 101, 63, 64
160, 104, 101, 63, 64, 52, 51, 18, 19
161, 56, 55, 31, 30, 105, 102, 70, 71
162, 105, 102, 70, 71, 106, 103, 67, 68
163, 106, 103, 67, 68, 107, 104, 64, 65
164, 107, 104, 64, 65, 53, 52, 19, 20
165, 29, 56, 30, 8, 78, 105, 71, 38
166, 78, 105, 71, 38, 79, 106, 68, 37
167, 79, 106, 68, 37, 80, 107, 65, 36
168, 80, 107, 65, 36, 9, 53, 20, 4
169, 57, 22, 21, 54, 108, 93, 90, 99
170, 108, 93, 90, 99, 109, 94, 91, 100
171, 109, 94, 91, 100, 110, 95, 92, 101
172, 110, 95, 92, 101, 48, 16, 17, 51
173, 58, 57, 54, 55, 111, 108, 99, 102
174, 111, 108, 99, 102, 112, 109, 100, 103
175, 112, 109, 100, 103, 113, 110, 101, 104
176, 113, 110, 101, 104, 49, 48, 51, 52
177, 59, 58, 55, 56, 114, 111, 102, 105
178, 114, 111, 102, 105, 115, 112, 103, 106
179, 115, 112, 103, 106, 116, 113, 104, 107
180, 116, 113, 104, 107, 50, 49, 52, 53
181, 28, 59, 56, 29, 75, 114, 105, 78
182, 75, 114, 105, 78, 76, 115, 106, 79
183, 76, 115, 106, 79, 77, 116, 107, 80
184, 77, 116, 107, 80, 10, 50, 53, 9
185, 60, 23, 22, 57, 117, 96, 93, 108
186, 117, 96, 93, 108, 118, 97, 94, 109
187, 118, 97, 94, 109, 119, 98, 95, 110
188, 119, 98, 95, 110, 45, 15, 16, 48
189, 61, 60, 57, 58, 120, 117, 108, 111
190, 120, 117, 108, 111, 121, 118, 109, 112
191, 121, 118, 109, 112, 122, 119, 110, 113
192, 122, 119, 110, 113, 46, 45, 48, 49
193, 62, 61, 58, 59, 123, 120, 111, 114
194, 123, 120, 111, 114, 124, 121, 112, 115
195, 124, 121, 112, 115, 125, 122, 113, 116
196, 125, 122, 113, 116, 47, 46, 49, 50
197, 27, 62, 59, 28, 72, 123, 114, 75
198, 72, 123, 114, 75, 73, 124, 115, 76
199, 73, 124, 115, 76, 74, 125, 116, 77
200, 74, 125, 116, 77, 11, 47, 50, 10
201, 24, 6, 23, 60, 87, 41, 96, 117
202, 87, 41, 96, 117, 84, 40, 97, 118
203, 84, 40, 97, 118, 81, 39, 98, 119
204, 81, 39, 98, 119, 14, 2, 15, 45
205, 25, 24, 60, 61, 88, 87, 117, 120
206, 88, 87, 117, 120, 85, 84, 118, 121
207, 85, 84, 118, 121, 82, 81, 119, 122
208, 82, 81, 119, 122, 13, 14, 45, 46
209, 26, 25, 61, 62, 89, 88, 120, 123
210, 89, 88, 120, 123, 86, 85, 121, 124
211, 86, 85, 121, 124, 83, 82, 122, 125
212, 83, 82, 122, 125, 12, 13, 46, 47
213, 7, 26, 62, 27, 44, 89, 123, 72
214, 44, 89, 123, 72, 43, 86, 124, 73
215, 43, 86, 124, 73, 42, 83, 125, 74
216, 42, 83, 125, 74, 3, 12, 47, 11
*NSET,NSET=PhysicalSurface1
1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
31, 32, 33, 34, 35, 36, 37, 38, 45, 46,
47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
67, 68, 69, 70, 71,
*NSET,NSET=PhysicalSurface2
1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 21, 22, 23,
24, 25, 26, 27, 28, 29, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 72, 73,
74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
94, 95, 96, 97, 98,
```
Loading

0 comments on commit 585fb93

Please sign in to comment.