From 66690d41cd15823eec9674f845ae83011590c50d Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Tue, 24 Sep 2024 07:00:00 +0000 Subject: [PATCH] build based on 3705a71 --- dev/.documenter-siteinfo.json | 2 +- dev/BlockSolvers/index.html | 28 ++++++++++++------------- dev/Examples/DarcyGMG/index.html | 2 +- dev/Examples/NavierStokes/index.html | 2 +- dev/Examples/NavierStokesGMG/index.html | 2 +- dev/Examples/Stokes/index.html | 2 +- dev/Examples/StokesGMG/index.html | 2 +- dev/LinearSolvers/index.html | 24 ++++++++++----------- dev/MultilevelTools/index.html | 10 ++++----- dev/NonlinearSolvers/index.html | 2 +- dev/PatchBasedSmoothers/index.html | 20 +++++++++--------- dev/SolverInterfaces/index.html | 10 ++++----- dev/index.html | 2 +- 13 files changed, 54 insertions(+), 54 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 82da58a..013a05d 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-08-15T16:21:58","documenter_version":"1.5.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-24T06:59:57","documenter_version":"1.5.0"}} \ No newline at end of file diff --git a/dev/BlockSolvers/index.html b/dev/BlockSolvers/index.html index 969272d..68926c3 100644 --- a/dev/BlockSolvers/index.html +++ b/dev/BlockSolvers/index.html @@ -1,36 +1,36 @@ -BlockSolvers · GridapSolvers.jl

GridapSolvers.BlockSolvers

Many scalable preconditioners for multiphysics problems are based on (possibly partial) block factorizations. This module provides a simple interface to define and use block solvers for block-assembled systems.

Block types

In a same preconditioner, blocks can come from different sources. For example, in a Schur-complement-based preconditioner you might want to solve the eliminated block (which comes from the original matrix), while having an approximation for your Schur complement (which can come from a matrix assembled in your driver, or from a weakform).

For this reason, we define the following abstract interface:

GridapSolvers.BlockSolvers.SolverBlockType
abstract type SolverBlock end

Abstract type representing a block in a block solver. More specifically, it indicates how a block is obtained from the original system matrix.

source

On top of this interface, we provide some useful block implementations:

GridapSolvers.BlockSolvers.LinearSystemBlockType
struct LinearSystemBlock <: LinearSolverBlock

SolverBlock representing a linear (i.e non-updateable) block that is directly taken from the system matrix. This block will not be updated between nonlinear iterations.

source
GridapSolvers.BlockSolvers.NonlinearSystemBlockType
struct NonlinearSystemBlock <: LinearSolverBlock
+BlockSolvers · GridapSolvers.jl

GridapSolvers.BlockSolvers

Many scalable preconditioners for multiphysics problems are based on (possibly partial) block factorizations. This module provides a simple interface to define and use block solvers for block-assembled systems.

Block types

In a same preconditioner, blocks can come from different sources. For example, in a Schur-complement-based preconditioner you might want to solve the eliminated block (which comes from the original matrix), while having an approximation for your Schur complement (which can come from a matrix assembled in your driver, or from a weakform).

For this reason, we define the following abstract interface:

GridapSolvers.BlockSolvers.SolverBlockType
abstract type SolverBlock end

Abstract type representing a block in a block solver. More specifically, it indicates how a block is obtained from the original system matrix.

source

On top of this interface, we provide some useful block implementations:

GridapSolvers.BlockSolvers.LinearSystemBlockType
struct LinearSystemBlock <: LinearSolverBlock

SolverBlock representing a linear (i.e non-updateable) block that is directly taken from the system matrix. This block will not be updated between nonlinear iterations.

source
GridapSolvers.BlockSolvers.NonlinearSystemBlockType
struct NonlinearSystemBlock <: LinearSolverBlock
   I :: Vector{Int}
 end

SolverBlock representing a nonlinear (i.e updateable) block that is directly taken from the system matrix. This block will be updated between nonlinear iterations.

Parameters:

- `ids::Vector{Int8}`: Block indices considered when updating the nonlinear block. 
-   By default, all indices are considered.
source
GridapSolvers.BlockSolvers.BiformBlockType
struct BiformBlock <: LinearSolverBlock

SolverBlock representing a linear block assembled from a bilinear form. This block will be not updated between nonlinear iterations.

Parameters:

  • f::Function: The bilinear form, i.e f(du,dv) = ∫(...)dΩ
  • trial::FESpace: The trial space.
  • test::FESpace: The test space.
  • assem::Assembler: The assembler to use.
source
GridapSolvers.BlockSolvers.TriformBlockType
struct TriformBlock <: NonlinearSolverBlock

SolverBlock representing a nonlinear block assembled from a trilinear form. This block will be updated between nonlinear iterations.

Parameters:

  • f::Function: The trilinear form, i.e f(u,du,dv) = ∫(...)dΩ
  • param::FESpace: The parameter space, where u lives.
  • trial::FESpace: The trial space, where du lives.
  • test::FESpace: The test space, where dv lives.
  • assem::Assembler: The assembler to use.
  • ids::Vector{Int8}: Block indices considered when updating the nonlinear block. By default, all indices are considered.
source

To create a new type of block, one needs to implement the following implementation (similar to the one for LinearSolver):

GridapSolvers.BlockSolvers.block_symbolic_setupFunction
block_symbolic_setup(block::SolverBlock,solver::LinearSolver,mat::AbstractMatrix)
-block_symbolic_setup(block::SolverBlock,solver::LinearSolver,mat::AbstractMatrix,x::AbstractVector)

Given a SolverBlock, returns the symbolic setup associated to the LinearSolver.

source
GridapSolvers.BlockSolvers.block_numerical_setupFunction
block_numerical_setup(block::SolverBlock,ss::BlockSS,mat::AbstractMatrix)
-block_numerical_setup(block::SolverBlock,ss::BlockSS,mat::AbstractMatrix,x::AbstractVector)

Given a SolverBlock, returns the numerical setup associated to it.

source
GridapSolvers.BlockSolvers.block_numerical_setup!Function
block_numerical_setup!(block::SolverBlock,ns::BlockNS,mat::AbstractMatrix)
-block_numerical_setup!(block::SolverBlock,ns::BlockNS,mat::AbstractMatrix,x::AbstractVector)

Given a SolverBlock, updates the numerical setup associated to it.

source
GridapSolvers.BlockSolvers.block_offdiagonal_setupFunction
block_offdiagonal_setup(block::SolverBlock,mat::AbstractMatrix)
-block_offdiagonal_setup(block::SolverBlock,mat::AbstractMatrix,x::AbstractVector)

Given a SolverBlock, returns the off-diagonal block of associated to it.

source
GridapSolvers.BlockSolvers.block_offdiagonal_setup!Function
block_offdiagonal_setup!(cache,block::SolverBlock,mat::AbstractMatrix)
-block_offdiagonal_setup!(cache,block::SolverBlock,mat::AbstractMatrix,x::AbstractVector)

Given a SolverBlock, updates the off-diagonal block of associated to it.

source

Block solvers

We can combine blocks to define a block solver. All block solvers take an array of blocks and a vector of solvers for the diagonal blocks (which need to be solved for). We provide two common types of block solvers:

BlockDiagonalSolvers

GridapSolvers.BlockSolvers.BiformBlockType
struct BiformBlock <: LinearSolverBlock

SolverBlock representing a linear block assembled from a bilinear form. This block will be not updated between nonlinear iterations.

Parameters:

  • f::Function: The bilinear form, i.e f(du,dv) = ∫(...)dΩ
  • trial::FESpace: The trial space.
  • test::FESpace: The test space.
  • assem::Assembler: The assembler to use.
source
GridapSolvers.BlockSolvers.TriformBlockType
struct TriformBlock <: NonlinearSolverBlock

SolverBlock representing a nonlinear block assembled from a trilinear form. This block will be updated between nonlinear iterations.

Parameters:

  • f::Function: The trilinear form, i.e f(u,du,dv) = ∫(...)dΩ
  • param::FESpace: The parameter space, where u lives.
  • trial::FESpace: The trial space, where du lives.
  • test::FESpace: The test space, where dv lives.
  • assem::Assembler: The assembler to use.
  • ids::Vector{Int8}: Block indices considered when updating the nonlinear block. By default, all indices are considered.
source

To create a new type of block, one needs to implement the following implementation (similar to the one for LinearSolver):

GridapSolvers.BlockSolvers.block_symbolic_setupFunction
block_symbolic_setup(block::SolverBlock,solver::LinearSolver,mat::AbstractMatrix)
+block_symbolic_setup(block::SolverBlock,solver::LinearSolver,mat::AbstractMatrix,x::AbstractVector)

Given a SolverBlock, returns the symbolic setup associated to the LinearSolver.

source
GridapSolvers.BlockSolvers.block_numerical_setupFunction
block_numerical_setup(block::SolverBlock,ss::BlockSS,mat::AbstractMatrix)
+block_numerical_setup(block::SolverBlock,ss::BlockSS,mat::AbstractMatrix,x::AbstractVector)

Given a SolverBlock, returns the numerical setup associated to it.

source
GridapSolvers.BlockSolvers.block_numerical_setup!Function
block_numerical_setup!(block::SolverBlock,ns::BlockNS,mat::AbstractMatrix)
+block_numerical_setup!(block::SolverBlock,ns::BlockNS,mat::AbstractMatrix,x::AbstractVector)

Given a SolverBlock, updates the numerical setup associated to it.

source
GridapSolvers.BlockSolvers.block_offdiagonal_setupFunction
block_offdiagonal_setup(block::SolverBlock,mat::AbstractMatrix)
+block_offdiagonal_setup(block::SolverBlock,mat::AbstractMatrix,x::AbstractVector)

Given a SolverBlock, returns the off-diagonal block of associated to it.

source
GridapSolvers.BlockSolvers.block_offdiagonal_setup!Function
block_offdiagonal_setup!(cache,block::SolverBlock,mat::AbstractMatrix)
+block_offdiagonal_setup!(cache,block::SolverBlock,mat::AbstractMatrix,x::AbstractVector)

Given a SolverBlock, updates the off-diagonal block of associated to it.

source

Block solvers

We can combine blocks to define a block solver. All block solvers take an array of blocks and a vector of solvers for the diagonal blocks (which need to be solved for). We provide two common types of block solvers:

BlockDiagonalSolvers

GridapSolvers.BlockSolvers.BlockDiagonalSolverType
struct BlockDiagonalSolver{N} <: LinearSolver

Solver representing a block-diagonal solver, i.e

│ A11   0    0  │   │ x1 │   │ r1 │
 │  0   A22   0  │ ⋅ │ x2 │ = │ r2 │
-│  0    0   A33 │   │ x3 │   │ r3 │

where N is the number of diagonal blocks.

Properties:

  • blocks::AbstractVector{<:SolverBlock}: Matrix of solver blocks, indicating how each diagonal block of the preconditioner is obtained.
  • solvers::AbstractVector{<:LinearSolver}: Vector of solvers, one for each diagonal block.
source
GridapSolvers.BlockSolvers.BlockDiagonalSolverMethod
function BlockDiagonalSolver(
+│  0    0   A33 │   │ x3 │   │ r3 │

where N is the number of diagonal blocks.

Properties:

  • blocks::AbstractVector{<:SolverBlock}: Matrix of solver blocks, indicating how each diagonal block of the preconditioner is obtained.
  • solvers::AbstractVector{<:LinearSolver}: Vector of solvers, one for each diagonal block.
source
GridapSolvers.BlockSolvers.BlockDiagonalSolverMethod
function BlockDiagonalSolver(
   funcs   :: AbstractArray{<:Function},
   trials  :: AbstractArray{<:FESpace},
   tests   :: AbstractArray{<:FESpace},
   solvers :: AbstractArray{<:LinearSolver};
   is_nonlinear::Vector{Bool}=fill(false,length(solvers))
-)

Create and instance of BlockDiagonalSolver where all blocks are given by integral forms.

source

BlockTriangularSolvers

BlockTriangularSolvers

GridapSolvers.BlockSolvers.BlockTriangularSolverType
struct BlockTriangularSolver{T,N} <: LinearSolver

Solver representing a block-triangular (upper/lower) solver, i.e

│ A11  c12⋅A12  c13⋅A13 │   │ x1 │   │ r1 │
 │  0       A22  c23⋅A23 │ ⋅ │ x2 │ = │ r2 │
-│  0      0         A33 │   │ x3 │   │ r3 │

where N is the number of diagonal blocks and T is either Val{:upper} or Val{:lower}.

Properties:

  • blocks::AbstractMatrix{<:SolverBlock}: Matrix of solver blocks, indicating how each block of the preconditioner is obtained.
  • solvers::AbstractVector{<:LinearSolver}: Vector of solvers, one for each diagonal block.
  • coeffs::AbstractMatrix{<:Real}: Matrix of coefficients, indicating the contribution of the off-diagonal blocks to the right-hand side of each diagonal. In particular, blocks can be turned off by setting the corresponding coefficient to zero.
source
GridapSolvers.BlockSolvers.BlockTriangularSolverMethod
function BlockTriangularSolver(
+│  0      0         A33 │   │ x3 │   │ r3 │

where N is the number of diagonal blocks and T is either Val{:upper} or Val{:lower}.

Properties:

  • blocks::AbstractMatrix{<:SolverBlock}: Matrix of solver blocks, indicating how each block of the preconditioner is obtained.
  • solvers::AbstractVector{<:LinearSolver}: Vector of solvers, one for each diagonal block.
  • coeffs::AbstractMatrix{<:Real}: Matrix of coefficients, indicating the contribution of the off-diagonal blocks to the right-hand side of each diagonal. In particular, blocks can be turned off by setting the corresponding coefficient to zero.
source
GridapSolvers.BlockSolvers.BlockTriangularSolverMethod
function BlockTriangularSolver(
   solvers::AbstractVector{<:LinearSolver}; 
   is_nonlinear::Matrix{Bool}=fill(false,(length(solvers),length(solvers))),
   coeffs=fill(1.0,size(is_nonlinear)),
   half=:upper
-)

Create and instance of BlockTriangularSolver where all blocks are extracted from the linear system. The kwarg half can have values :upper or :lower.

source
+)

Create and instance of BlockTriangularSolver where all blocks are extracted from the linear system. The kwarg half can have values :upper or :lower.

source
diff --git a/dev/Examples/DarcyGMG/index.html b/dev/Examples/DarcyGMG/index.html index 2cf6481..416310a 100644 --- a/dev/Examples/DarcyGMG/index.html +++ b/dev/Examples/DarcyGMG/index.html @@ -118,4 +118,4 @@ @test norm(r) < 1.e-5 end -end # module

This page was generated using Literate.jl.

+end # module

This page was generated using Literate.jl.

diff --git a/dev/Examples/NavierStokes/index.html b/dev/Examples/NavierStokes/index.html index 90b4565..c73b7b3 100644 --- a/dev/Examples/NavierStokes/index.html +++ b/dev/Examples/NavierStokes/index.html @@ -101,4 +101,4 @@ @test true end -end # module

This page was generated using Literate.jl.

+end # module

This page was generated using Literate.jl.

diff --git a/dev/Examples/NavierStokesGMG/index.html b/dev/Examples/NavierStokesGMG/index.html index f524335..348f5db 100644 --- a/dev/Examples/NavierStokesGMG/index.html +++ b/dev/Examples/NavierStokesGMG/index.html @@ -146,4 +146,4 @@ @test true end -end # module

This page was generated using Literate.jl.

+end # module

This page was generated using Literate.jl.

diff --git a/dev/Examples/Stokes/index.html b/dev/Examples/Stokes/index.html index 4f444b2..e4fedf6 100644 --- a/dev/Examples/Stokes/index.html +++ b/dev/Examples/Stokes/index.html @@ -93,4 +93,4 @@ @test norm(r) < 1.e-7 end -end # module

This page was generated using Literate.jl.

+end # module

This page was generated using Literate.jl.

diff --git a/dev/Examples/StokesGMG/index.html b/dev/Examples/StokesGMG/index.html index 5dd8244..8a3e9a2 100644 --- a/dev/Examples/StokesGMG/index.html +++ b/dev/Examples/StokesGMG/index.html @@ -139,4 +139,4 @@ @test norm(r) < 1.e-7 end -end # module

This page was generated using Literate.jl.

+end # module

This page was generated using Literate.jl.

diff --git a/dev/LinearSolvers/index.html b/dev/LinearSolvers/index.html index 353036e..725c8e2 100644 --- a/dev/LinearSolvers/index.html +++ b/dev/LinearSolvers/index.html @@ -3,29 +3,29 @@ ... end -CGSolver(Pl;maxiter=1000,atol=1e-12,rtol=1.e-6,flexible=false,verbose=0,name="CG")

Left-Preconditioned Conjugate Gradient solver.

source
GridapSolvers.LinearSolvers.MINRESSolverType
struct MINRESSolver <: LinearSolver 
+CGSolver(Pl;maxiter=1000,atol=1e-12,rtol=1.e-6,flexible=false,verbose=0,name="CG")

Left-Preconditioned Conjugate Gradient solver.

source
GridapSolvers.LinearSolvers.MINRESSolverType
struct MINRESSolver <: LinearSolver 
   ...
 end
 
-MINRESSolver(m;Pl=nothing,maxiter=100,atol=1e-12,rtol=1.e-6,verbose=false,name="MINRES")

MINRES solver, with optional left preconditioners Pl. The preconditioner must be symmetric and positive definite.

source
GridapSolvers.LinearSolvers.GMRESSolverType
struct GMRESSolver <: LinearSolver 
+MINRESSolver(m;Pl=nothing,maxiter=100,atol=1e-12,rtol=1.e-6,verbose=false,name="MINRES")

MINRES solver, with optional left preconditioners Pl. The preconditioner must be symmetric and positive definite.

source
GridapSolvers.LinearSolvers.GMRESSolverType
struct GMRESSolver <: LinearSolver 
   ...
 end
 
-GMRESSolver(m;Pr=nothing,Pl=nothing,restart=false,m_add=1,maxiter=100,atol=1e-12,rtol=1.e-6,verbose=false,name="GMRES")

GMRES solver, with optional right and left preconditioners Pr and Pl.

The solver starts by allocating a basis of size m. Then:

  • If restart=true, the basis size is fixed and restarted every m iterations.
  • If restart=false, the basis size is allowed to increase. When full, the solver allocates m_add new basis vectors.
source
GridapSolvers.LinearSolvers.FGMRESSolverType
struct FGMRESSolver <: LinearSolver 
+GMRESSolver(m;Pr=nothing,Pl=nothing,restart=false,m_add=1,maxiter=100,atol=1e-12,rtol=1.e-6,verbose=false,name="GMRES")

GMRES solver, with optional right and left preconditioners Pr and Pl.

The solver starts by allocating a basis of size m. Then:

  • If restart=true, the basis size is fixed and restarted every m iterations.
  • If restart=false, the basis size is allowed to increase. When full, the solver allocates m_add new basis vectors.
source
GridapSolvers.LinearSolvers.FGMRESSolverType
struct FGMRESSolver <: LinearSolver 
   ...
 end
 
-FGMRESSolver(m,Pr;Pl=nothing,restart=false,m_add=1,maxiter=100,atol=1e-12,rtol=1.e-6,verbose=false,name="FGMRES")

Flexible GMRES solver, with right-preconditioner Pr and optional left-preconditioner Pl.

The solver starts by allocating a basis of size m. Then:

  • If restart=true, the basis size is fixed and restarted every m iterations.
  • If restart=false, the basis size is allowed to increase. When full, the solver allocates m_add new basis vectors at a time.
source
GridapSolvers.LinearSolvers.krylov_mul!Function

Computes the Krylov matrix-vector product

y = Pl⁻¹⋅A⋅Pr⁻¹⋅x

by solving

Pr⋅wr = x wl = A⋅wr Pl⋅y = wl

source
GridapSolvers.LinearSolvers.krylov_residual!Function

Computes the Krylov residual

r = Pl⁻¹(A⋅x - b)

by solving

w = A⋅x - b Pl⋅r = w

source

Smoothers

Given a linear system $Ax = b$, a smoother is an operator S that takes an iterative solution $x_k$ and its residual $r_k = b - A x_k$, and modifies them in place

\[ S : (x_k,r_k) \rightarrow (x_{k+1},r_{k+1})\]

such that $|r_{k+1}| < |r_k|$.

GridapSolvers.LinearSolvers.RichardsonSmootherType
struct RichardsonSmoother{A} <: LinearSolver
+FGMRESSolver(m,Pr;Pl=nothing,restart=false,m_add=1,maxiter=100,atol=1e-12,rtol=1.e-6,verbose=false,name="FGMRES")

Flexible GMRES solver, with right-preconditioner Pr and optional left-preconditioner Pl.

The solver starts by allocating a basis of size m. Then:

  • If restart=true, the basis size is fixed and restarted every m iterations.
  • If restart=false, the basis size is allowed to increase. When full, the solver allocates m_add new basis vectors at a time.
source
GridapSolvers.LinearSolvers.krylov_mul!Function

Computes the Krylov matrix-vector product

y = Pl⁻¹⋅A⋅Pr⁻¹⋅x

by solving

Pr⋅wr = x wl = A⋅wr Pl⋅y = wl

source
GridapSolvers.LinearSolvers.krylov_residual!Function

Computes the Krylov residual

r = Pl⁻¹(A⋅x - b)

by solving

w = A⋅x - b Pl⋅r = w

source

Smoothers

Given a linear system $Ax = b$, a smoother is an operator S that takes an iterative solution $x_k$ and its residual $r_k = b - A x_k$, and modifies them in place

\[ S : (x_k,r_k) \rightarrow (x_{k+1},r_{k+1})\]

such that $|r_{k+1}| < |r_k|$.

GridapSolvers.LinearSolvers.RichardsonSmootherType
struct RichardsonSmoother{A} <: LinearSolver
   M     :: A
   niter :: Int64
   ω     :: Float64
 end

Iterative Richardson smoother. Given a solution x and a residual r, performs niter Richardson iterations with damping parameter ω using the linear solver M. A Richardson iteration is given by:

dx = ω * inv(M) * r
 x  = x + dx
-r  = r - A * dx

Updates both the solution x and the residual r in place.

source
GridapSolvers.LinearSolvers.RichardsonSmootherMethod
function RichardsonSmoother(M::LinearSolver,niter::Int=1,ω::Float64=1.0)

Returns an instance of RichardsonSmoother from its underlying properties.

source

Preconditioners

Given a linear system $Ax = b$, a preconditioner is an operator that takes an iterative residual $r_k$ and returns a correction $dx_k$.

GridapSolvers.LinearSolvers.JacobiLinearSolverType
struct JacobiLinearSolver <: LinearSolver end

Given a matrix A, the Jacobi or Diagonal preconditioner is defined as P = diag(A).

source
GridapSolvers.LinearSolvers.GMGLinearSolverFromMatricesType
struct GMGLinearSolverFromMatrices <: LinearSolver
+r  = r - A * dx

Updates both the solution x and the residual r in place.

source
GridapSolvers.LinearSolvers.RichardsonSmootherMethod
function RichardsonSmoother(M::LinearSolver,niter::Int=1,ω::Float64=1.0)

Returns an instance of RichardsonSmoother from its underlying properties.

source

Preconditioners

Given a linear system $Ax = b$, a preconditioner is an operator that takes an iterative residual $r_k$ and returns a correction $dx_k$.

GridapSolvers.LinearSolvers.JacobiLinearSolverType
struct JacobiLinearSolver <: LinearSolver end

Given a matrix A, the Jacobi or Diagonal preconditioner is defined as P = diag(A).

source
GridapSolvers.LinearSolvers.GMGLinearSolverFromMatricesType
struct GMGLinearSolverFromMatrices <: LinearSolver
   ...
-end

Geometric MultiGrid solver, from algebraic parts.

source
GridapSolvers.LinearSolvers.GMGLinearSolverFromWeakformType
struct GMGLinearSolverFromWeakForm <: LinearSolver
+end

Geometric MultiGrid solver, from algebraic parts.

source
GridapSolvers.LinearSolvers.GMGLinearSolverFromWeakformType
struct GMGLinearSolverFromWeakForm <: LinearSolver
   ...
-end

Geometric MultiGrid solver, from FE parts.

source
GridapSolvers.LinearSolvers.GMGLinearSolverFunction
GMGLinearSolver(
+end

Geometric MultiGrid solver, from FE parts.

source
GridapSolvers.LinearSolvers.GMGLinearSolverFunction
GMGLinearSolver(
   mh::ModelHierarchy,
   matrices::AbstractArray{<:AbstractMatrix},
   prolongations,
@@ -35,7 +35,7 @@
   coarsest_solver = LUSolver(),
   mode::Symbol    = :preconditioner,
   maxiter = 100, atol = 1.0e-14, rtol = 1.0e-08, verbose = false,
-)

Creates an instance of GMGLinearSolverFromMatrices from the underlying model hierarchy, the system matrices at each level and the transfer operators and smoothers at each level except the coarsest.

The solver has two modes of operation, defined by the kwarg mode:

  • :solver: The GMG solver takes a rhs b and returns a solution x.
  • :preconditioner: The GMG solver takes a residual r and returns a correction dx.
source
GMGLinearSolver(
+)

Creates an instance of GMGLinearSolverFromMatrices from the underlying model hierarchy, the system matrices at each level and the transfer operators and smoothers at each level except the coarsest.

The solver has two modes of operation, defined by the kwarg mode:

  • :solver: The GMG solver takes a rhs b and returns a solution x.
  • :preconditioner: The GMG solver takes a residual r and returns a correction dx.
source
GMGLinearSolver(
   mh::ModelHierarchy,
   trials::FESpaceHierarchy,
   tests::FESpaceHierarchy,
@@ -48,10 +48,10 @@
   mode::Symbol    = :preconditioner,
   is_nonlinear    = false,
   maxiter = 100, atol = 1.0e-14, rtol = 1.0e-08, verbose = false,
-)

Creates an instance of GMGLinearSolverFromMatrices from the underlying model hierarchy, the trial and test FEspace hierarchies, the weakform lhs at each level and the transfer operators and smoothers at each level except the coarsest.

The solver has two modes of operation, defined by the kwarg mode:

  • :solver: The GMG solver takes a rhs b and returns a solution x.
  • :preconditioner: The GMG solver takes a residual r and returns a correction dx.
source

Wrappers

PETSc

Building on top of GridapPETSc.jl, GridapSolvers provides specific solvers for some particularly complex PDEs:

GridapSolvers.LinearSolvers.ElasticitySolverType
struct ElasticitySolver <: LinearSolver
+)

Creates an instance of GMGLinearSolverFromMatrices from the underlying model hierarchy, the trial and test FEspace hierarchies, the weakform lhs at each level and the transfer operators and smoothers at each level except the coarsest.

The solver has two modes of operation, defined by the kwarg mode:

  • :solver: The GMG solver takes a rhs b and returns a solution x.
  • :preconditioner: The GMG solver takes a residual r and returns a correction dx.
source

Wrappers

PETSc

Building on top of GridapPETSc.jl, GridapSolvers provides specific solvers for some particularly complex PDEs:

GridapSolvers.LinearSolvers.ElasticitySolverType
struct ElasticitySolver <: LinearSolver
   ...
-end

GMRES + AMG solver, specifically designed for linear elasticity problems.

Follows PETSc's documentation for PCAMG and MatNullSpaceCreateRigidBody.

source
GridapSolvers.LinearSolvers.ElasticitySolverMethod
function ElasticitySolver(space::FESpace; maxiter=500, atol=1.e-12, rtol=1.e-8)

Returns an instance of ElasticitySolver from its underlying properties.

source
GridapSolvers.LinearSolvers.CachedPETScNSType
struct CachedPETScNS <: NumericalSetup
+end

GMRES + AMG solver, specifically designed for linear elasticity problems.

Follows PETSc's documentation for PCAMG and MatNullSpaceCreateRigidBody.

source
GridapSolvers.LinearSolvers.ElasticitySolverMethod
function ElasticitySolver(space::FESpace; maxiter=500, atol=1.e-12, rtol=1.e-8)

Returns an instance of ElasticitySolver from its underlying properties.

source
GridapSolvers.LinearSolvers.CachedPETScNSType
struct CachedPETScNS <: NumericalSetup
   ...
-end

Wrapper around a PETSc NumericalSetup, providing highly efficiend reusable caches:

When converting julia vectors/PVectors to PETSc vectors, we purposely create aliasing of the vector values. This means we can avoid copying data from one to another before solving, but we need to be careful about it.

This structure takes care of this, and makes sure you do not attempt to solve the system with julia vectors that are not the ones you used to create the solver cache.

source
GridapSolvers.LinearSolvers.CachedPETScNSMethod
function CachedPETScNS(ns::PETScLinearSolverNS,x::AbstractVector,b::AbstractVector)

Create a new instance of CachedPETScNS from its underlying properties. Once this structure is created, you can only solve the system with the same vectors you used to create it.

source
GridapSolvers.LinearSolvers.get_dof_coordinatesFunction
get_dof_coordinates(space::FESpace)

Given a lagrangian FESpace, returns the physical coordinates of the DoFs, as required by some PETSc solvers. See PETSc documentation.

source

IterativeSolvers.jl

GridapSolvers provides wrappers for some iterative solvers from the package IterativeSolvers.jl:

GridapSolvers.LinearSolvers.IterativeLinearSolverType
struct IterativeLinearSolver <: LinearSolver
+end

Wrapper around a PETSc NumericalSetup, providing highly efficiend reusable caches:

When converting julia vectors/PVectors to PETSc vectors, we purposely create aliasing of the vector values. This means we can avoid copying data from one to another before solving, but we need to be careful about it.

This structure takes care of this, and makes sure you do not attempt to solve the system with julia vectors that are not the ones you used to create the solver cache.

source
GridapSolvers.LinearSolvers.CachedPETScNSMethod
function CachedPETScNS(ns::PETScLinearSolverNS,x::AbstractVector,b::AbstractVector)

Create a new instance of CachedPETScNS from its underlying properties. Once this structure is created, you can only solve the system with the same vectors you used to create it.

source
GridapSolvers.LinearSolvers.get_dof_coordinatesFunction
get_dof_coordinates(space::FESpace)

Given a lagrangian FESpace, returns the physical coordinates of the DoFs, as required by some PETSc solvers. See PETSc documentation.

source

IterativeSolvers.jl

GridapSolvers provides wrappers for some iterative solvers from the package IterativeSolvers.jl:

GridapSolvers.LinearSolvers.IterativeLinearSolverType
struct IterativeLinearSolver <: LinearSolver
   ...
-end

Wrappers for IterativeSolvers.jl krylov-like iterative solvers.

All wrappers take the same kwargs as the corresponding solver in IterativeSolvers.jl.

The following solvers are available:

source
GridapSolvers.LinearSolvers.IS_ConjugateGradientSolverFunction
IS_ConjugateGradientSolver(;kwargs...)

Wrapper for the Conjugate Gradient solver.

source
GridapSolvers.LinearSolvers.IS_GMRESSolverFunction
IS_GMRESSolver(;kwargs...)

Wrapper for the GMRES solver.

source
GridapSolvers.LinearSolvers.IS_MINRESSolverFunction
IS_MINRESSolver(;kwargs...)

Wrapper for the MINRES solver.

source
GridapSolvers.LinearSolvers.IS_SSORSolverFunction
IS_SSORSolver(ω;kwargs...)

Wrapper for the SSOR solver.

source
+end

Wrappers for IterativeSolvers.jl krylov-like iterative solvers.

All wrappers take the same kwargs as the corresponding solver in IterativeSolvers.jl.

The following solvers are available:

source
GridapSolvers.LinearSolvers.IS_ConjugateGradientSolverFunction
IS_ConjugateGradientSolver(;kwargs...)

Wrapper for the Conjugate Gradient solver.

source
GridapSolvers.LinearSolvers.IS_GMRESSolverFunction
IS_GMRESSolver(;kwargs...)

Wrapper for the GMRES solver.

source
GridapSolvers.LinearSolvers.IS_MINRESSolverFunction
IS_MINRESSolver(;kwargs...)

Wrapper for the MINRES solver.

source
GridapSolvers.LinearSolvers.IS_SSORSolverFunction
IS_SSORSolver(ω;kwargs...)

Wrapper for the SSOR solver.

source
diff --git a/dev/MultilevelTools/index.html b/dev/MultilevelTools/index.html index f1c0ab5..b659926 100644 --- a/dev/MultilevelTools/index.html +++ b/dev/MultilevelTools/index.html @@ -1,5 +1,5 @@ -MultilevelTools · GridapSolvers.jl

GridapSolvers.MultilevelTools

Nested subpartitions

One of the main difficulties of multilevel algorithms is dealing with the complexity of having multiple subcommunicators. We provide some tools to deal with it. In particular we introduce HierarchicalArrays.

GridapSolvers.MultilevelTools.HierarchicalArrayType
HierarchicalArray{T,A,B} <: AbstractVector{T}

Array of hierarchical (nested) distributed objects. Each level might live in a different subcommunicator. If a processor does not belong to subcommunicator ranks[i], then array[i] is nothing.

However, it assumes: - The subcommunicators are nested, so that ranks[i] contains ranks[i+1]. - The first subcommunicator does not have empty parts.

source
Base.mapFunction
Base.map(f::Function,args::Vararg{HierarchicalArray,N}) where N

Maps a function to a set of HierarchicalArrays. The function is applied only in the subcommunicators where the processor belongs to.

source
GridapSolvers.MultilevelTools.with_levelFunction
with_level(f::Function,a::HierarchicalArray,lev::Integer;default=nothing)

Applies a function to the lev-th level of a HierarchicalArray. If the processor does not belong to the subcommunicator of the lev-th level, then default is returned.

source

ModelHierarchies and FESpaceHierarchies

This objects are the multilevel counterparts of Gridap's DiscreteModel and FESpace.

GridapSolvers.MultilevelTools.ModelHierarchyType
const ModelHierarchy = HierarchicalArray{<:ModelHierarchyLevel}

A ModelHierarchy is a hierarchical array of ModelHierarchyLevel objects. It stores the adapted/redistributed models and the corresponding subcommunicators.

For convenience, implements some of the API of DiscreteModel.

source
GridapSolvers.MultilevelTools.CartesianModelHierarchyFunction
CartesianModelHierarchy(
+MultilevelTools · GridapSolvers.jl

GridapSolvers.MultilevelTools

Nested subpartitions

One of the main difficulties of multilevel algorithms is dealing with the complexity of having multiple subcommunicators. We provide some tools to deal with it. In particular we introduce HierarchicalArrays.

GridapSolvers.MultilevelTools.HierarchicalArrayType
HierarchicalArray{T,A,B} <: AbstractVector{T}

Array of hierarchical (nested) distributed objects. Each level might live in a different subcommunicator. If a processor does not belong to subcommunicator ranks[i], then array[i] is nothing.

However, it assumes: - The subcommunicators are nested, so that ranks[i] contains ranks[i+1]. - The first subcommunicator does not have empty parts.

source
Base.mapFunction
Base.map(f::Function,args::Vararg{HierarchicalArray,N}) where N

Maps a function to a set of HierarchicalArrays. The function is applied only in the subcommunicators where the processor belongs to.

source
GridapSolvers.MultilevelTools.with_levelFunction
with_level(f::Function,a::HierarchicalArray,lev::Integer;default=nothing)

Applies a function to the lev-th level of a HierarchicalArray. If the processor does not belong to the subcommunicator of the lev-th level, then default is returned.

source

ModelHierarchies and FESpaceHierarchies

This objects are the multilevel counterparts of Gridap's DiscreteModel and FESpace.

GridapSolvers.MultilevelTools.ModelHierarchyType
const ModelHierarchy = HierarchicalArray{<:ModelHierarchyLevel}

A ModelHierarchy is a hierarchical array of ModelHierarchyLevel objects. It stores the adapted/redistributed models and the corresponding subcommunicators.

For convenience, implements some of the API of DiscreteModel.

source
GridapSolvers.MultilevelTools.CartesianModelHierarchyFunction
CartesianModelHierarchy(
   ranks::AbstractVector{<:Integer},
   np_per_level::Vector{<:NTuple{D,<:Integer}},
   domain::Tuple,
@@ -8,13 +8,13 @@
   map::Function = identity,
   isperiodic::NTuple{D,Bool} = Tuple(fill(false,D)),
   add_labels!::Function = (labels -> nothing),
-) where D

Returns a ModelHierarchy with a Cartesian model as coarsest level. The i-th level will be distributed among np_per_level[i] processors. Two consecutive levels are refined by a factor of nrefs[i].

Parameters:

  • ranks: Initial communicator. Will be used to generate subcommunicators.
  • domain: Tuple containing the domain limits.
  • nc: Tuple containing the number of cells in each direction for the coarsest model.
  • np_per_level: Vector containing the number of processors we want to distribute each level into. Requires a tuple np = (np_1,...,np_d) for each level, then each level will be distributed among prod(np) processors with np_i processors in the i-th direction.
  • nrefs: Vector containing the refinement factor for each level. Has nlevs-1 entries, and each entry can either be an integer (homogeneous refinement) or a tuple with D integers (inhomogeneous refinement).
source
GridapSolvers.MultilevelTools.P4estCartesianModelHierarchyFunction
P4estCartesianModelHierarchy(
+) where D

Returns a ModelHierarchy with a Cartesian model as coarsest level. The i-th level will be distributed among np_per_level[i] processors. Two consecutive levels are refined by a factor of nrefs[i].

Parameters:

  • ranks: Initial communicator. Will be used to generate subcommunicators.
  • domain: Tuple containing the domain limits.
  • nc: Tuple containing the number of cells in each direction for the coarsest model.
  • np_per_level: Vector containing the number of processors we want to distribute each level into. Requires a tuple np = (np_1,...,np_d) for each level, then each level will be distributed among prod(np) processors with np_i processors in the i-th direction.
  • nrefs: Vector containing the refinement factor for each level. Has nlevs-1 entries, and each entry can either be an integer (homogeneous refinement) or a tuple with D integers (inhomogeneous refinement).
source
GridapSolvers.MultilevelTools.P4estCartesianModelHierarchyFunction
P4estCartesianModelHierarchy(
   ranks,np_per_level,domain,nc::NTuple{D,<:Integer};
   num_refs_coarse::Integer = 0,
   add_labels!::Function = (labels -> nothing),
   map::Function = identity,
   isperiodic::NTuple{D,Bool} = Tuple(fill(false,D))
-) where D

Returns a ModelHierarchy with a Cartesian model as coarsest level, using GridapP4est.jl. The i-th level will be distributed among np_per_level[i] processors. The seed model is given by cmodel = CartesianDiscreteModel(domain,nc).

source
GridapSolvers.MultilevelTools.FESpaceHierarchyType
const FESpaceHierarchy = HierarchicalArray{<:FESpaceHierarchyLevel}

A FESpaceHierarchy is a hierarchical array of FESpaceHierarchyLevel objects. It stores the adapted/redistributed fe spaces and the corresponding subcommunicators.

For convenience, implements some of the API of FESpace.

source

Grid transfer operators

To move information between different levels, we will require grid transfer operators. Although any custom-made operator can be used, we provide some options.

Local projection maps

GridapSolvers.MultilevelTools.ReffeProjectionMapType
struct ReffeProjectionMap{T} <: LocalProjectionMap{T}
+) where D

Returns a ModelHierarchy with a Cartesian model as coarsest level, using GridapP4est.jl. The i-th level will be distributed among np_per_level[i] processors. The seed model is given by cmodel = CartesianDiscreteModel(domain,nc).

source
GridapSolvers.MultilevelTools.FESpaceHierarchyType
const FESpaceHierarchy = HierarchicalArray{<:FESpaceHierarchyLevel}

A FESpaceHierarchy is a hierarchical array of FESpaceHierarchyLevel objects. It stores the adapted/redistributed fe spaces and the corresponding subcommunicators.

For convenience, implements some of the API of FESpace.

source

Grid transfer operators

To move information between different levels, we will require grid transfer operators. Although any custom-made operator can be used, we provide some options.

Local projection maps

GridapSolvers.MultilevelTools.ReffeProjectionMapType
struct ReffeProjectionMap{T} <: LocalProjectionMap{T}
   op      :: Operation{T}
   reffe   :: Tuple{<:ReferenceFEName,Any,Any}
   qdegree :: Int
@@ -29,8 +29,8 @@
 dΩ = Measure(Ω,2)
 
 Π = LocalProjectionMap(reffe_l2)
-u_l2 = Π(u_h1,dΩ)
source
GridapSolvers.MultilevelTools.SpaceProjectionMapType
struct SpaceProjectionMap{T} <: LocalProjectionMap{T}
   op      :: Operation{T}
   space   :: A
   qdegree :: Int
-end

Map that projects a CellField onto another FESpace. Necessary when the arrival space has constraints (e.g. boundary conditions) that need to be taken into account.

source
+end

Map that projects a CellField onto another FESpace. Necessary when the arrival space has constraints (e.g. boundary conditions) that need to be taken into account.

source
diff --git a/dev/NonlinearSolvers/index.html b/dev/NonlinearSolvers/index.html index 86c3c10..24093bf 100644 --- a/dev/NonlinearSolvers/index.html +++ b/dev/NonlinearSolvers/index.html @@ -2,4 +2,4 @@ NonlinearSolvers · GridapSolvers.jl

GridapSolvers.NonlinearSolvers

GridapSolvers.NonlinearSolvers.NLsolveNonlinearSolverType
NLsolveNonlinearSolver <: NonlinearSolver
 
 NLsolveNonlinearSolver(ls::LinearSolver;kwargs...)
-NLsolveNonlinearSolver(;kwargs...)

Wrapper for NLsolve.jl nonlinear solvers. It is equivalent to the wrappers in Gridap, but with support for nonlinear preconditioners. Same kwargs as in nlsolve. Due to NLSolve.jl not using LinearAlgebra's API, these solvers are not compatible with PartitionedArrays.jl. For parallel computations, use NewtonSolver instead.

source
GridapSolvers.NonlinearSolvers.NewtonSolverType
struct NewtonSolver <: Algebra.NonlinearSolver

Newton-Raphson solver. Same as NewtonRaphsonSolver in Gridap, but with a couple addons:

  • Better logging and verbosity control.
  • Better convergence criteria.
  • Works with geometric LinearSolvers/Preconditioners.
source
+NLsolveNonlinearSolver(;kwargs...)

Wrapper for NLsolve.jl nonlinear solvers. It is equivalent to the wrappers in Gridap, but with support for nonlinear preconditioners. Same kwargs as in nlsolve. Due to NLSolve.jl not using LinearAlgebra's API, these solvers are not compatible with PartitionedArrays.jl. For parallel computations, use NewtonSolver instead.

source
GridapSolvers.NonlinearSolvers.NewtonSolverType
struct NewtonSolver <: Algebra.NonlinearSolver

Newton-Raphson solver. Same as NewtonRaphsonSolver in Gridap, but with a couple addons:

  • Better logging and verbosity control.
  • Better convergence criteria.
  • Works with geometric LinearSolvers/Preconditioners.
source
diff --git a/dev/PatchBasedSmoothers/index.html b/dev/PatchBasedSmoothers/index.html index e0deecb..e48aff5 100644 --- a/dev/PatchBasedSmoothers/index.html +++ b/dev/PatchBasedSmoothers/index.html @@ -1,45 +1,45 @@ PatchBasedSmoothers · GridapSolvers.jl

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(
+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_overlapped::Table : [patch][local cell] -> overlapped cell
  • patch_cells_faces_on_boundary::Table : [d][overlapped cell][local face] -> face is on patch boundary
source
GridapSolvers.PatchBasedSmoothers.PatchDecompositionMethod
function PatchDecomposition(
+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_overlapped::Table : [patch][local cell] -> overlapped 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(
+)

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::FESpaces.SingleFieldFESpace,
   patch_decomposition::PatchDecomposition,
   reffe::Union{ReferenceFE,Tuple{<:ReferenceFEs.ReferenceFEName,Any,Any}};
   conformity=nothing,
   patches_mask=Fill(false,num_patches(patch_decomposition))
-)

Constructs a PatchFESpace from a global SingleFieldFESpace and a PatchDecomposition. The conformity of the FESpace is deduced from reffe and conformity, which need to be the same as the ones used to construct the global FESpace.

If patches_mask[p] = true, the patch p is ignored. Used in parallel.

source
GridapSolvers.PatchBasedSmoothers.PatchFESpaceMethod
function PatchFESpace(
+)

Constructs a PatchFESpace from a global SingleFieldFESpace and a PatchDecomposition. The conformity of the FESpace is deduced from reffe and conformity, which need to be the same as the ones used to construct the global FESpace.

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.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.PatchTriangulationType
struct PatchTriangulation{Dc,Dp} <: Triangulation{Dc,Dp}
+)

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
+end

Wrapper around a Triangulation, for patch-based assembly.

source diff --git a/dev/SolverInterfaces/index.html b/dev/SolverInterfaces/index.html index bd0aaa3..f24dd82 100644 --- a/dev/SolverInterfaces/index.html +++ b/dev/SolverInterfaces/index.html @@ -8,17 +8,17 @@ atol :: T = eps(T), rtol :: T = 1.e-5, dtol :: T = Inf -)

Structure to check convergence conditions for iterative linear solvers.

Methods:

source
GridapSolvers.SolverInterfaces.SolverConvergenceFlagType
@enum SolverConvergenceFlag begin
+)

Structure to check convergence conditions for iterative linear solvers.

Methods:

source
GridapSolvers.SolverInterfaces.SolverConvergenceFlagType
@enum SolverConvergenceFlag begin
   SOLVER_CONVERGED_ATOL     = 0
   SOLVER_CONVERGED_RTOL     = 1
   SOLVER_DIVERGED_MAXITER   = 2
   SOLVER_DIVERGED_BREAKDOWN = 3
-end

Convergence flags for iterative linear solvers.

source
GridapSolvers.SolverInterfaces.get_solver_tolerancesFunction
get_solver_tolerances(s::LinearSolver)

Returns the solver tolerances of the linear solver s.

source
GridapSolvers.SolverInterfaces.set_solver_tolerances!Function
set_solver_tolerances!(s::LinearSolver;
+end

Convergence flags for iterative linear solvers.

source
GridapSolvers.SolverInterfaces.get_solver_tolerancesFunction
get_solver_tolerances(s::LinearSolver)

Returns the solver tolerances of the linear solver s.

source
GridapSolvers.SolverInterfaces.set_solver_tolerances!Function
set_solver_tolerances!(s::LinearSolver;
   maxiter = 1000,
   atol   = eps(T),
   rtol   = T(1.e-5),
   dtol   = T(Inf)
-)

Modifies tolerances of the linear solver s.

source
GridapSolvers.SolverInterfaces.finishedFunction
finished(tols::SolverTolerances,niter,e_a,e_r) :: Bool

Returns true if the solver has finished, false otherwise.

source
GridapSolvers.SolverInterfaces.convergedFunction
converged(tols::SolverTolerances,niter,e_a,e_r) :: Bool

Returns true if the solver has converged, false otherwise.

source
GridapSolvers.SolverInterfaces.finished_flagFunction
finished_flag(tols::SolverTolerances,niter,e_a,e_r) :: SolverConvergenceFlag

Computes the solver exit condition given

  • the number of iterations niter
  • the absolute error e_a
  • and the relative error e_r.

Returns the corresponding SolverConvergenceFlag.

source

ConvergenceLogs

GridapSolvers.SolverInterfaces.ConvergenceLogType
mutable struct ConvergenceLog{T}
+)

Modifies tolerances of the linear solver s.

source
GridapSolvers.SolverInterfaces.finishedFunction
finished(tols::SolverTolerances,niter,e_a,e_r) :: Bool

Returns true if the solver has finished, false otherwise.

source
GridapSolvers.SolverInterfaces.convergedFunction
converged(tols::SolverTolerances,niter,e_a,e_r) :: Bool

Returns true if the solver has converged, false otherwise.

source
GridapSolvers.SolverInterfaces.finished_flagFunction
finished_flag(tols::SolverTolerances,niter,e_a,e_r) :: SolverConvergenceFlag

Computes the solver exit condition given

  • the number of iterations niter
  • the absolute error e_a
  • and the relative error e_r.

Returns the corresponding SolverConvergenceFlag.

source

ConvergenceLogs

GridapSolvers.SolverInterfaces.ConvergenceLogType
mutable struct ConvergenceLog{T}
   ...
 end
 
@@ -27,11 +27,11 @@
   tols :: SolverTolerances{T};
   verbose = SOLVER_VERBOSE_NONE,
   depth   = 0
-)

Standarized logging system for iterative linear solvers.

Methods:

source
GridapSolvers.SolverInterfaces.SolverVerboseLevelType
@enum SolverVerboseLevel begin
+)

Standarized logging system for iterative linear solvers.

Methods:

source
GridapSolvers.SolverInterfaces.SolverVerboseLevelType
@enum SolverVerboseLevel begin
   SOLVER_VERBOSE_NONE = 0
   SOLVER_VERBOSE_LOW  = 1
   SOLVER_VERBOSE_HIGH = 2
 end
 
 SolverVerboseLevel(true) = SOLVER_VERBOSE_HIGH
-SolverVerboseLevel(false) = SOLVER_VERBOSE_NONE
source
GridapSolvers.SolverInterfaces.reset!Function
reset!(log::ConvergenceLog{T})

Resets the convergence log log to its initial state.

source
GridapSolvers.SolverInterfaces.init!Function
init!(log::ConvergenceLog{T},r0::T)

Initializes the convergence log log with the initial residual r0.

source
GridapSolvers.SolverInterfaces.update!Function
update!(log::ConvergenceLog{T},r::T)

Updates the convergence log log with the residual r at the current iteration.

source
GridapSolvers.SolverInterfaces.finalize!Function
finalize!(log::ConvergenceLog{T},r::T)

Finalizes the convergence log log with the final residual r.

source
GridapSolvers.SolverInterfaces.print_messageFunction
print_message(log::ConvergenceLog{T},msg::String)

Prints the message msg to the output stream of the convergence log log.

source
+SolverVerboseLevel(false) = SOLVER_VERBOSE_NONEsource
GridapSolvers.SolverInterfaces.reset!Function
reset!(log::ConvergenceLog{T})

Resets the convergence log log to its initial state.

source
GridapSolvers.SolverInterfaces.init!Function
init!(log::ConvergenceLog{T},r0::T)

Initializes the convergence log log with the initial residual r0.

source
GridapSolvers.SolverInterfaces.update!Function
update!(log::ConvergenceLog{T},r::T)

Updates the convergence log log with the residual r at the current iteration.

source
GridapSolvers.SolverInterfaces.finalize!Function
finalize!(log::ConvergenceLog{T},r::T)

Finalizes the convergence log log with the final residual r.

source
GridapSolvers.SolverInterfaces.print_messageFunction
print_message(log::ConvergenceLog{T},msg::String)

Prints the message msg to the output stream of the convergence log log.

source
diff --git a/dev/index.html b/dev/index.html index 4339e39..caf95b7 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -Home · GridapSolvers.jl
+Home · GridapSolvers.jl