Embedded Interfaces
Domain Nomenclature
Throughout this documentation, many methods accept arguments that select different parts of the cut domain. We split the domain into the following parts:
The background mesh entities (cells, facets, nodes) are classified as IN
, OUT
or CUT
. The IN
and OUT
background cells are uncut, i.e completely inside or outside the geometry, respectively. These states are internally defined as constants:
const IN = -1
const OUT = 1
const CUT = 0
The CUT
background cells are cut by the embedded boundary, and split into subcells/subfacets. The subcells/subfacets are classified as IN
or OUT
depending on whether they are inside or outside the geometry. CUT_IN
and CUT_OUT
subentities can be accessed using the CutInOrOut
objects:
struct CutInOrOut
in_or_out::Int
end
const CUT_IN = CutInOrOut(IN)
const CUT_OUT = CutInOrOut(OUT)
For FEM, we generally want to get sets of uncut and cut cells together, for a given state IN/OUT
. These are referred as PHYSICAL
parts of the domain. Moreover, FE spaces are generally defined over the background mesh and need to span both IN/OUT
and CUT
background cells. These are referred as ACTIVE
parts of the domain. You can extract the PHYSICAL
and ACTIVE
parts of the domain using the following constants:
const PHYSICAL_IN = (CUT_IN,IN)
const PHYSICAL_OUT = (CUT_OUT,OUT)
const PHYSICAL = PHYSICAL_IN
struct ActiveInOrOut
in_or_out::Int
end
const ACTIVE_IN = ActiveInOrOut(IN)
const ACTIVE_OUT = ActiveInOrOut(OUT)
const ACTIVE = ACTIVE_IN
Cutters
Cutters are used to cut the background mesh according to a provided geometry.
GridapEmbedded.Interfaces.Cutter
— Typeabstract type Cutter <: GridapType end
Abstract type for all mesh cutters. Has to be paired with a CSG.Geometry
to cut the background mesh.
Methods
cut(cutter::Cutter,background,geom)
cut_facets(cutter::Cutter,background,geom)
compute_bgcell_to_inoutcut(cutter::Cutter,background,geom)
compute_bgfacet_to_inoutcut(cutter::Cutter,background,geom)
Generally cut
and cut_facets
dispatch based on the geometry provided, so it is generally more convennient to call the following methods instead:
GridapEmbedded.Interfaces.compute_bgcell_to_inoutcut
— Methodcompute_bgcell_to_inoutcut(cutter::Cutter,background,geom)
Returns an array of IN/OUT/CUT states for each cell in the background mesh.
GridapEmbedded.Interfaces.compute_bgfacet_to_inoutcut
— Methodcompute_bgfacet_to_inoutcut(cutter::Cutter,background,geom)
Returns an array of IN/OUT/CUT states for each facet in the background mesh.
GridapEmbedded.Interfaces.cut
— Methodcut(cutter::Cutter,background,geom)
Cut the background mesh with the provided cutter and geometry, returnning the cut cells. The cut cells are returned as an EmbeddedDiscretization
object.
GridapEmbedded.Interfaces.cut_facets
— Methodcut_facets(cutter::Cutter,background,geom)
Cut the background mesh with the provided cutter and geometry, returning the cut facets. The cut facets are returned as an EmbeddedFacetDiscretization
object.
We provide several types of cutters, including:
- Level-Set Cutters: Cutters for Level-Set and function-defined geometries. See Level-Set Cutters.
- STL Cutters: Cutters for STL based geometries. Provided by STLCutters.jl.
Embedded Discretizations
After cutting the background mesh, you will be returned an EmbeddedDiscretization
object. These contain all the information you need to generate the integration meshes for embedded methods.
GridapEmbedded.Interfaces.AbstractEmbeddedDiscretization
— Typeabstract type EmbeddedDiscretization <: GridapType
GridapEmbedded.Interfaces.EmbeddedDiscretization
— Typestruct EmbeddedDiscretization{Dc,T} <: AbstractEmbeddedDiscretization
This structure contains all the required information to build integration Triangulation
s for a cut model.
Constructors
cut(cutter::Cutter,background,geom)
Properties
bgmodel::DiscreteModel
: the background meshgeo::CSG.Geometry
: the geometry used to cut the background meshsubcells::SubCellData
: collection of cut subcells, attached to the background meshsubfacets::SubFacetData
: collection of cut facets, attached to the background meshls_to_bgcell_to_inoutcut::Vector{Vector{Int8}}
: list of IN/OUT/CUT states for each cell in the background mesh, for each node in the geometry tree.ls_to_subcell_to_inoutcut::Vector{Vector{Int8}}
: list of IN/OUT/CUT states for each subcell in the cut part of the mesh, for each node in the geometry tree.ls_to_subfacet_to_inoutcut::Vector{Vector{Int8}}
: list of IN/OUT/CUT states for each subfacet in the cut part of the mesh, for each node in the geometry tree.
Methods
GridapEmbedded.Interfaces.EmbeddedFacetDiscretization
— Typestruct EmbeddedFacetDiscretization{Dc,Dp,T} <: AbstractEmbeddedDiscretization
This structure contains all the required information to build integration Triangulations
for a cut model boundary.
Constructors
cut_facets(cutter::Cutter,background,geom)
Properties
bgmodel::DiscreteModel
: the background meshgeo::CSG.Geometry
: the geometry used to cut the background meshsubfacets::SubFacetData
: collection of cut facets, attached to the background meshls_to_facet_to_inoutcut::Vector{Vector{Int8}}
: list of IN/OUT/CUT states for each facet in the background mesh, for each node in the geometry tree.ls_to_subfacet_to_inoutcut::Vector{Vector{Int8}}
: list of IN/OUT/CUT states for each subfacet in the cut part of the mesh, for each node in the geometry tree.
Methods
Embedded Triangulations
From EmbeddedDiscretization
objects, you can extract all the triangulations you need to perform integration for embedded methods. We currently provide the following methods:
Gridap.Geometry.Triangulation
— MethodTriangulation(cut::EmbeddedDiscretization[,in_or_out=PHYSICAL_IN])
Creates a triangulation containing the cell and subcells of the embedded domain selected by in_or_out
.
- If only background cells are selected, the result will be a regular Gridap triangulation.
- If only subcells are selected, the result will be a
SubCellTriangulation
. - If both background cells and subcells are selected, the result will be an
AppendedTriangulation
, containing aSubCellTriangulation
and a regular Gridap triangulation.
GridapEmbedded.Interfaces.EmbeddedBoundary
— MethodEmbeddedBoundary(cut::EmbeddedDiscretization)
Creates a triangulation containing the cut facets of the embedded domain boundary. The result is a SubFacetTriangulation
.
GridapEmbedded.Interfaces.GhostSkeleton
— MethodGhostSkeleton(cut::EmbeddedDiscretization[,in_or_out=ACTIVE_IN])
Creates a triangulation containing the ghost facets. Ghosts facets are defined as the facets of the background mesh that are adjacent to at least one CUT
background cell.
Mostly used for CUT-FEM stabilisation.
Gridap.Geometry.BoundaryTriangulation
— MethodBoundaryTriangulation(cut::EmbeddedFacetDiscretization[, in_or_out=PHYSICAL_IN; tags=nothing])
Gridap.Geometry.SkeletonTriangulation
— MethodSkeletonTriangulation(cut::EmbeddedFacetDiscretization[, in_or_out=PHYSICAL_IN])
GridapEmbedded.Interfaces.SubCellTriangulation
— Typestruct SubCellTriangulation{Dc,Dp} <: Triangulation{Dc,Dp}
A triangulation for subcells.
GridapEmbedded.Interfaces.SubFacetTriangulation
— Typestruct SubFacetTriangulation{Dc,Dp,T,A} <: Triangulation{Dc,Dp}
A triangulation for subfacets.
GridapEmbedded.Interfaces.SubFacetBoundaryTriangulation
— Typestruct SubFacetBoundaryTriangulation{Dc,Dp,T} <: Triangulation{Dc,Dp}
Triangulation of cut facets from the background mesh, i.e each of the facets in this triangulation is part of a background facet that has been cut by the geometry.
This differs from the the SubFacetTriangulation
in that the facets in the SubFacetTriangulation
are not cut background facets, but rather subfacets on the interior of a background cell.
They result from calling Boundary
or Skeleton
on an EmbeddedFacetDiscretization
object.
BoundaryTriangulation(cut::EmbeddedFacetDiscretization,in_or_out;tags=nothing)
SkeletonTriangulation(cut::EmbeddedFacetDiscretization,in_or_out)