Skip to content

Commit

Permalink
Merge pull request #261 from awslabs/sjg/bdr-mesh-crack
Browse files Browse the repository at this point in the history
[WIP] Interior boundary cracks for meshes
  • Loading branch information
hughcars authored Aug 19, 2024
2 parents d03e1d9 + 508e4e7 commit ddfe4a3
Show file tree
Hide file tree
Showing 60 changed files with 5,347 additions and 4,720 deletions.
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

0 comments on commit ddfe4a3

Please sign in to comment.