GridapSolvers.PatchBasedSmoothers
GridapSolvers.PatchBasedSmoothers.PatchBasedLinearSolver
— Typestruct PatchBasedLinearSolver <: LinearSolver
...
end
Sub-assembled linear solver for patch-based methods. Given a bilinear form a
and a space decomposition V = Σ_i V_i
given by a patch space, returns a global correction given by aggregated local corrections, i.e
dx = Σ_i w_i I_i inv(A_i) (I_i)^* x
where A_i
is the patch-local system matrix defined by
(A_i u_i, v_i) = a(u_i,v_i) ∀ v_i ∈ V_i
and I_i
is the natural injection from the patch space to the global space. The aggregation can be un-weighted (i.e. w_i = 1
) or weighted, where w_i = 1/#(i)
.
GridapSolvers.PatchBasedSmoothers.PatchBasedLinearSolver
— Methodfunction PatchBasedLinearSolver(
biform::Function,
patch_space::FESpace,
space::FESpace;
local_solver = LUSolver(),
is_nonlinear = false,
weighted = false
)
Returns an instance of PatchBasedLinearSolver
from its underlying properties. Local patch-systems are solved with local_solver
. If weighted
, uses weighted patch aggregation to compute the global correction.
GridapSolvers.PatchBasedSmoothers.PatchBoundaryStyle
— Typeabstract type PatchBoundaryStyle end
struct PatchBoundaryExclude <: PatchBoundaryStyle end
struct PatchBoundaryInclude <: PatchBoundaryStyle end
Controls the boundary consitions imposed at the patch boundaries for the sub-spaces.
PatchBoundaryInclude
: No BCs are imposed at the patch boundaries.PatchBoundaryExclude
: Zero dirichlet BCs are imposed at the patch boundaries.
GridapSolvers.PatchBasedSmoothers.PatchDecomposition
— Typestruct PatchDecomposition{Dr,Dc,Dp} <: DiscreteModel{Dc,Dp}
Represents a patch decomposition of a discrete model, i.e an overlapping cell covering {Ω_i}
of Ω
such that Ω = Σ_i Ω_i
.
Properties:
Dr::Integer
: Dimension of the patch rootmodel::DiscreteModel{Dc,Dp}
: Underlying discrete modelpatch_cells::Table
: [patch][local cell] -> cellpatch_cells_faces_on_boundary::Table
: [d][overlapped cell][local face] -> face is on patch boundary
GridapSolvers.PatchBasedSmoothers.PatchDecomposition
— Methodfunction PatchDecomposition(
model::DiscreteModel{Dc,Dp};
Dr=0,
patch_boundary_style::PatchBoundaryStyle=PatchBoundaryExclude(),
boundary_tag_names::AbstractArray{String}=["boundary"]
)
Returns an instance of PatchDecomposition
from a given discrete model.
GridapSolvers.PatchBasedSmoothers.PatchFESpace
— Typestruct PatchFESpace <: SingleFieldFESpace
...
end
FESpace representing a patch-based subspace decomposition V = Σ_i V_i
of a global space V
.
GridapSolvers.PatchBasedSmoothers.PatchFESpace
— Methodfunction PatchFESpace(
space::FESpace,patch_decomposition;kwargs...
)
GridapSolvers.PatchBasedSmoothers.PatchFESpace
— Methodfunction PatchFESpace(
space::FESpaces.SingleFieldFESpace,
patch_decomposition::PatchDecomposition,
cell_conformity::CellConformity;
patches_mask=Fill(false,num_patches(patch_decomposition))
)
Constructs a PatchFESpace
from a global SingleFieldFESpace
, a PatchDecomposition
and a CellConformity
instance.
If patches_mask[p] = true
, the patch p
is ignored. Used in parallel.
GridapSolvers.PatchBasedSmoothers.PatchFESpace
— Methodfunction PatchFESpace(
space::Gridap.MultiField.MultiFieldFESpace,
patch_decomposition::PatchDecomposition,
cell_conformity::Vector{<:CellConformity};
kwargs...
)
PatchFESpace
constructor for MultiFieldFESpace
. Returns a MultiFieldFESpace
of PatchFESpace
s .
GridapSolvers.PatchBasedSmoothers.PatchProlongationOperator
— Typestruct PatchProlongationOperator end
A PatchProlongationOperator
is a modified prolongation operator such that given a coarse solution xH
returns
xh = Ih(xH) - yh
where yh
is a subspace-based correction computed by solving local problems on coarse cells within the fine mesh.
GridapSolvers.PatchBasedSmoothers.PatchProlongationOperator
— Methodfunction PatchProlongationOperator(
lev :: Integer,
sh :: FESpaceHierarchy,
PD :: PatchDecomposition,
lhs :: Function,
rhs :: Function;
is_nonlinear=false
)
Returns an instance of PatchProlongationOperator
for a given level lev
and a given FESpaceHierarchy sh
. The subspace-based correction on a solution uH
is computed by solving local problems given by
lhs(u_i,v_i) = rhs(uH,v_i) ∀ v_i ∈ V_i
where V_i
is the patch-local space indiced by the PatchDecomposition PD
.
GridapSolvers.PatchBasedSmoothers.PatchTriangulation
— Typestruct PatchTriangulation{Dc,Dp} <: Triangulation{Dc,Dp}
...
end
Wrapper around a Triangulation, for patch-based assembly.
GridapSolvers.PatchBasedSmoothers.allocate_patch_cell_array
— Methodallocate_patch_cell_array(PD::PatchDecomposition,cell_to_data::Table{T};init=zero(T))
Allocates a patch-cell-wise array from a cell-wise array.
GridapSolvers.PatchBasedSmoothers.generate_patch_closures
— Methodgenerate_patch_closures(PD::PatchDecomposition{Dr,Dc})
Returns a patch-wise Table containing the closure of each patch.
GridapSolvers.PatchBasedSmoothers.generate_patch_facets
— Methodgenerate_patch_facets(model::DiscreteModel{Dc,Dp},patch_cells)
Given a model and the cells within each patch, returns a patch-wise Table containing the facets on each patch.
GridapSolvers.PatchBasedSmoothers.get_patch_cell_faces
— Methodget_patch_cell_faces(PD::PatchDecomposition,Df::Integer)
get_patch_cell_faces(PD::PatchDecomposition,Df::Integer,faces_mask::AbstractVector{Bool})
Returns a patch-wise Table containing the faces on each patch cell, i.e
patch_faces[pcell] = [face1, face2, ...]
where face1, face2, ... are the faces on the overlapped cell pcell
such that
- they are NOT on the boundary of the patch
- they are flagged
true
infaces_mask
GridapSolvers.PatchBasedSmoothers.get_patch_cell_offsets
— Methodget_patch_cell_offsets(PD::PatchDecomposition)
GridapSolvers.PatchBasedSmoothers.get_patch_cells
— Methodget_patch_cells(PD::PatchDecomposition) -> patch_to_cells
GridapSolvers.PatchBasedSmoothers.get_patch_cells_overlapped
— Methodget_patch_cells_overlapped(PD::PatchDecomposition) -> patch_to_pcells
GridapSolvers.PatchBasedSmoothers.get_patch_faces
— Methodget_patch_faces(PD::PatchDecomposition,Df::Integer,faces_mask::AbstractVector{Bool};reverse=false)
Returns a patch-wise Table containing the faces on each patch, i.e
patch_faces[patch] = [face1, face2, ...]
where face1, face2, ... are the faces on the patch such that
- they are NOT on the boundary of the patch
- they are flagged
true
infaces_mask
If reverse
is true
, the faces are the ones ON the boundary of the patch.
GridapSolvers.PatchBasedSmoothers.get_pface_to_pcell
— Methodget_pface_to_pcell(PD::PatchDecomposition{Dr,Dc},Df::Integer,patch_faces)
Returns two pface-wise Tables containing
- the patch cells touched by each patch face and
- the local cell index (within the face connectivity) of the cell touched by the patch face, which is needed when a pface touches different cells depending on the patch
i.e
pface_to_pcell[pface] = [pcell1, pcell2, ...]
pface_to_lcell[pface] = [lcell1, lcell2, ...]
where pcell1, pcell2, ... are the patch cells touched by the patch face pface
.
This would be the Gridap equivalent to get_faces(patch_topology,Df,Dc)
.
GridapSolvers.PatchBasedSmoothers.num_patches
— Methodnum_patches(a::PatchDecomposition)
GridapSolvers.PatchBasedSmoothers.patch_reindex
— Methodpatch_reindex(PD::PatchDecomposition,cell_to_data) -> pcell_to_data
GridapSolvers.PatchBasedSmoothers.patch_view
— Methodpatch_view(PD::PatchDecomposition,a::AbstractArray,patch::Integer)
patch_view(PD::PatchDecomposition,a::AbstractArray,patch_ids::AbstractUnitRange{<:Integer})
Returns a view of the pcell-wise array a
restricted to the pcells of the patch patch
or patch_ids
.
GridapSolvers.PatchBasedSmoothers.propagate_patch_dof_ids
— Methodpropagate_patch_dof_ids(patch_space::PatchFESpace,new_patch_cells::Table)
Propagates the DoF ids of the patchspace to a new set of patch cells given by a patch-wise Table `newpatch_cells`.