GridapSolvers.PatchBasedSmoothers

GridapSolvers.PatchBasedSmoothers.PatchBasedLinearSolverType
struct 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).

source
GridapSolvers.PatchBasedSmoothers.PatchBasedLinearSolverMethod
function 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.

source
GridapSolvers.PatchBasedSmoothers.PatchBoundaryStyleType
abstract 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.
source
GridapSolvers.PatchBasedSmoothers.PatchDecompositionType
struct 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 root
  • model::DiscreteModel{Dc,Dp} : Underlying discrete model
  • patch_cells::Table : [patch][local cell] -> cell
  • patch_cells_faces_on_boundary::Table : [d][overlapped cell][local face] -> face is on patch boundary
source
GridapSolvers.PatchBasedSmoothers.PatchFESpaceMethod
function 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.

source
GridapSolvers.PatchBasedSmoothers.PatchFESpaceMethod
function PatchFESpace(
  space::Gridap.MultiField.MultiFieldFESpace,
  patch_decomposition::PatchDecomposition,
  cell_conformity::Vector{<:CellConformity};
  kwargs...
)

PatchFESpace constructor for MultiFieldFESpace. Returns a MultiFieldFESpace of PatchFESpaces .

source
GridapSolvers.PatchBasedSmoothers.PatchProlongationOperatorType
struct 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.

source
GridapSolvers.PatchBasedSmoothers.PatchProlongationOperatorMethod
function 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.

source
GridapSolvers.PatchBasedSmoothers.get_patch_cell_facesMethod
get_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 in faces_mask
source
GridapSolvers.PatchBasedSmoothers.get_patch_facesMethod
get_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 in faces_mask

If reverse is true, the faces are the ones ON the boundary of the patch.

source
GridapSolvers.PatchBasedSmoothers.get_pface_to_pcellMethod
get_pface_to_pcell(PD::PatchDecomposition{Dr,Dc},Df::Integer,patch_faces)

Returns two pface-wise Tables containing

  1. the patch cells touched by each patch face and
  2. 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).

source
GridapSolvers.PatchBasedSmoothers.patch_viewMethod
patch_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.

source