Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interior boundary cracks for meshes #261

Merged
merged 24 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
53ba6a1
Preliminary implementation for interior boundary mesh cracking
sebastiangrimberg May 23, 2024
51d0fd5
Fix mesh cracking when domain or boundary elements are removed
sebastiangrimberg May 24, 2024
efcb685
Correct detection of which boundary attributes require cracking
sebastiangrimberg May 24, 2024
07f81ed
Add configuration file option for boundary element cracking
sebastiangrimberg May 24, 2024
4dce60f
Reorganizing mesh cracking and adding case requiring local AMR for th…
sebastiangrimberg May 31, 2024
cf57621
Address some lingering TODO items and print status messages
sebastiangrimberg Jun 1, 2024
a2a6868
Add temporary debugging code for crack visualization and testing
sebastiangrimberg Jun 1, 2024
f2f1abf
Implement local refinement of narrow internal boundaries for cracking
sebastiangrimberg Jun 3, 2024
8bb9d21
Minor improvement for geodata functions and two small bug fixes
sebastiangrimberg Jun 3, 2024
9a607bf
Fix local mesh refinement for boundary mesh cracking to add fewer ele…
sebastiangrimberg Jun 4, 2024
f1e6ff0
Fix two small bugs for mesh refinement
sebastiangrimberg Jun 4, 2024
9c018da
Add configuration file keyword to control refinement option for thin …
sebastiangrimberg Jun 4, 2024
041eef7
Resolve GCC compiler warning
sebastiangrimberg Jun 4, 2024
1b1e65c
Two fixes: Fix refinement of interior crack boundary elements to acco…
sebastiangrimberg Jun 5, 2024
a225bef
Remove debugging code from testing
sebastiangrimberg Jun 5, 2024
5fcb560
Interior boundary postprocessing improvements after mesh cracking
sebastiangrimberg May 29, 2024
b03a6a4
Add mesh displacement for interior boundary cracking to help boundary…
sebastiangrimberg Jun 10, 2024
a93f6b0
Add configuration file parameter to modify interior boundary crack di…
sebastiangrimberg Jun 10, 2024
ca3245a
Further improve underresolved internal boundary refinement
sebastiangrimberg Jun 11, 2024
0c6e7de
Fix AMR + uniform refinement with tet meshes marking
sebastiangrimberg Jun 12, 2024
87772c0
Performance upgrades for mesh cracking
sebastiangrimberg Jun 20, 2024
027b147
Rebaseline rings and cpw examples with interior boundaries
sebastiangrimberg Jul 11, 2024
4f99688
Minor fixes
hughcars Jul 19, 2024
508e4e7
Update CHANGELOG.md
hughcars Aug 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ The format of this changelog is based on
- Added `"MakeSimplex"` and `"MakeHexahedral"` mesh options to convert an input mesh to
all tetrahedra or all hexahedra. Also adds `"SerialUniformLevels"` option to
`config["Model"]["Refinement"]` for testing or debugging.
- Added `config["Model"]["CrackInternalBoundaryElements"]` which will separate or "crack" the mesh
along all internal boundaries. This improves the performance of error estimation and AMR
as the recovered smooth fields do not enforce additional erroneous continuity at
internal boundaries. This will change the default behaviour in the case of internal
impedance boundary conditions, and can be disabled by setting this option to false.

## [0.13.0] - 2024-05-20

Expand Down
32 changes: 2 additions & 30 deletions docs/src/config/boundaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
],
"Postprocessing":
{
"Side": <string>,
"SurfaceFlux":
[
...
Expand Down Expand Up @@ -123,19 +122,6 @@ each terminal boundary.

`"Postprocessing"` : Top-level object for configuring boundary postprocessing.

`"Side" ["SmallerRefractiveIndex"]` : Defines the postprocessing side for internal
boundary surfaces where the fields are in general double-valued. This is only relevant for
output for [boundary visualization with ParaView](../guide/postprocessing.md#Visualization).
The available options are:

- `"SmallerRefractiveIndex"` : Take the value from the side where the material index of
refraction is smaller (speed of light is larger). Typically this selects the vacuum
side. For anisotropic materials, the index of refraction associated with the principal
direction with the smallest value is used.
- `"LargerRefractiveIndex"` : Take the value from the side where the material index of
refraction is larger (speed of light is smaller). Typically this selects the non-vacuum
side.

`"SurfaceFlux"` : Array of objects for postprocessing surface flux.

`"Dielectric"` : Array of objects for postprocessing surface interface dielectric loss.
Expand Down Expand Up @@ -572,8 +558,7 @@ axis-aligned bounding box for all elements making up the postprocessing boundary
"Type": <string>,
"Thickness": <float>,
"Permittivity": <float>,
"LossTan": <float>,
"Side": <string>
"LossTan": <float>
},
...
]
Expand All @@ -585,8 +570,7 @@ with
`"Index" [None]` : Index of this dielectric interface, used in postprocessing output files.

`"Attributes" [None]` : Integer array of mesh boundary attributes for this dielectric
interface. If the interface consists of multiple elements with different `"Side"` values,
use the `"Elements"` array described below.
interface.

`"Type" [None]` : Specifies the type of dielectric interface for this postprocessing
boundary. See also [this page](../reference.md#Bulk-and-interface-dielectric-loss).
Expand All @@ -608,15 +592,3 @@ units.
be the interface layer permittivity for the specific `"Type"` of interface specified.

`"LossTan" [0.0]` : Loss tangent for this lossy dielectric interface.

`"Side" ["SmallerRefractiveIndex"]` : Defines the postprocessing side when this dielectric
interface is an internal boundary surface (and thus the electric field on the boundary is in
general double-valued). The available options are:

- `"SmallerRefractiveIndex"` : Take the value from the side where the material index of
refraction is smaller (speed of light is larger). Typically this selects the vacuum
side. For anisotropic materials, the index of refraction associated with the principal
direction with the smallest value is used.
- `"LargerRefractiveIndex"` : Take the value from the side where the material index of
refraction is larger (speed of light is smaller). Typically this selects the non-vacuum
side.
3 changes: 3 additions & 0 deletions docs/src/config/model.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ mesh length units.
- `"MakeHexahedral" [false]`
- `"ReorderElements" [false]`
- `"CleanUnusedElements" [true]`
- `"CrackInternalBoundaryElements" [true]`
- `"RefineCrackElements" [true]`
- `"CrackDisplacementFactor" [1.0e-3]`
- `"AddInterfaceBoundaryElements" [true]`
- `"ReorientTetMesh" [false]`
- `"Partitioning" [""]`
Expand Down
2 changes: 1 addition & 1 deletion docs/src/guide/boundaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ reference.

Unlike lumped ports, wave port boundaries cannot be defined internal to the
computational domain and instead must exist only on the outer boundary of the domain
(they are to be "one-sided" in the sense that mesh elements only exist on one side of
(they are to be "one-sided" in the sense that mesh elements only exist on one side of
the boundary).

Wave ports are not currently compatible with nonconformal mesh refinement.
Expand Down
6 changes: 2 additions & 4 deletions examples/cpw/cpw_coax_adaptive.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,15 @@
"Type": "MS",
"Thickness": 2.0e-3, // μm
"Permittivity": 10.0,
"LossTan": 1.0,
"Side": "LargerRefractiveIndex"
"LossTan": 1.0
},
{
"Index": 3,
"Attributes": [11],
"Type": "MA",
"Thickness": 2.0e-3, // μm
"Permittivity": 10.0,
"LossTan": 1.0,
"Side": "SmallerRefractiveIndex"
"LossTan": 1.0
}
]
}
Expand Down
6 changes: 2 additions & 4 deletions examples/cpw/cpw_coax_uniform.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,15 @@
"Type": "MS",
"Thickness": 2.0e-3, // μm
"Permittivity": 10.0,
"LossTan": 1.0,
"Side": "LargerRefractiveIndex"
"LossTan": 1.0
},
{
"Index": 3,
"Attributes": [11],
"Type": "MA",
"Thickness": 2.0e-3, // μm
"Permittivity": 10.0,
"LossTan": 1.0,
"Side": "SmallerRefractiveIndex"
"LossTan": 1.0
}
]
}
Expand Down
6 changes: 2 additions & 4 deletions examples/cpw/cpw_lumped_adaptive.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,15 @@
"Type": "MS",
"Thickness": 2.0e-3, // μm
"Permittivity": 10.0,
"LossTan": 1.0,
"Side": "LargerRefractiveIndex"
"LossTan": 1.0
},
{
"Index": 3,
"Attributes": [13],
"Type": "MA",
"Thickness": 2.0e-3, // μm
"Permittivity": 10.0,
"LossTan": 1.0,
"Side": "SmallerRefractiveIndex"
"LossTan": 1.0
}
]
}
Expand Down
6 changes: 2 additions & 4 deletions examples/cpw/cpw_lumped_uniform.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,15 @@
"Type": "MS",
"Thickness": 2.0e-3, // μm
"Permittivity": 10.0,
"LossTan": 1.0,
"Side": "LargerRefractiveIndex"
"LossTan": 1.0
},
{
"Index": 3,
"Attributes": [13],
"Type": "MA",
"Thickness": 2.0e-3, // μm
"Permittivity": 10.0,
"LossTan": 1.0,
"Side": "SmallerRefractiveIndex"
"LossTan": 1.0
}
]
}
Expand Down
6 changes: 2 additions & 4 deletions examples/cpw/cpw_wave_adaptive.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,15 @@
"Type": "MS",
"Thickness": 2.0e-3, // μm
"Permittivity": 10.0,
"LossTan": 1.0,
"Side": "LargerRefractiveIndex"
"LossTan": 1.0
},
{
"Index": 3,
"Attributes": [11],
"Type": "MA",
"Thickness": 2.0e-3, // μm
"Permittivity": 10.0,
"LossTan": 1.0,
"Side": "SmallerRefractiveIndex"
"LossTan": 1.0
}
]
}
Expand Down
6 changes: 2 additions & 4 deletions examples/cpw/cpw_wave_uniform.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,15 @@
"Type": "MS",
"Thickness": 2.0e-3, // μm
"Permittivity": 10.0,
"LossTan": 1.0,
"Side": "LargerRefractiveIndex"
"LossTan": 1.0
},
{
"Index": 3,
"Attributes": [11],
"Type": "MA",
"Thickness": 2.0e-3, // μm
"Permittivity": 10.0,
"LossTan": 1.0,
"Side": "SmallerRefractiveIndex"
"LossTan": 1.0
}
]
}
Expand Down
4 changes: 1 addition & 3 deletions palace/drivers/basesolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,13 @@ void BaseSolver::SolveEstimateMarkRefine(std::vector<std::unique_ptr<Mesh>> &mes
Mpi::Warning("AMR is not currently supported for transient simulations!\n");
return false;
}
return refinement.max_it > 0;
return (refinement.max_it > 0);
}();
if (use_amr && mesh.size() > 1)
{
Mpi::Print("\nFlattening mesh sequence:\n AMR will start from the final mesh in "
"the sequence of a priori refinements\n");
mesh.erase(mesh.begin(), mesh.end() - 1);
constexpr bool refine = true, fix_orientation = true;
mesh.back()->Get().Finalize(refine, fix_orientation);
}
MPI_Comm comm = mesh.back()->GetComm();

Expand Down
Loading
Loading