MFEM
v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
miniapps
hooke
preconditioners
diagonal_preconditioner.hpp
Go to the documentation of this file.
1
// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced
2
// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3
// LICENSE and NOTICE for details. LLNL-CODE-806117.
4
//
5
// This file is part of the MFEM library. For more information and source code
6
// availability visit https://mfem.org.
7
//
8
// MFEM is free software; you can redistribute it and/or modify it under the
9
// terms of the BSD-3 license. We welcome feedback and contributions, see file
10
// CONTRIBUTING.md for details.
11
12
#ifndef MFEM_ELASTICITY_DIAGONAL_PC_HPP
13
#define MFEM_ELASTICITY_DIAGONAL_PC_HPP
14
15
#include "
../operators/elasticity_gradient_operator.hpp
"
16
17
namespace
mfem
18
{
19
/**
20
* @brief ElasticityDiagonalPreconditioner acts as a matrix-free preconditioner
21
* for ElasticityOperator.
22
*
23
* @note There are two types to choose from
24
* - Diagonal: A classic Jacobi type preconditioner
25
* - BlockDiagonal: A Jacobi type preconditioner which calculates the diagonal
26
* contribution of ElasticityOperator on each diagonal element and applies
27
* its inverted submatrix.
28
*/
29
class
ElasticityDiagonalPreconditioner
:
public
Solver
30
{
31
static
constexpr
int
dim = 3;
32
33
public
:
34
enum
Type
{
Diagonal
= 0,
BlockDiagonal
};
35
36
ElasticityDiagonalPreconditioner
(
Type
type =
Type::Diagonal
)
37
:
Solver
(), type_(type) {}
38
39
void
SetOperator
(
const
Operator
&op)
override
;
40
41
void
Mult
(
const
Vector
&x,
Vector
&y)
const override
;
42
43
private
:
44
const
ElasticityGradientOperator
*gradient_operator_;
45
int
num_submats_, submat_height_;
46
Vector
Ke_diag_, K_diag_local_, K_diag_;
47
Type
type_;
48
};
49
50
}
// namespace mfem
51
52
#endif
mfem::ElasticityDiagonalPreconditioner
ElasticityDiagonalPreconditioner acts as a matrix-free preconditioner for ElasticityOperator.
Definition
diagonal_preconditioner.hpp:30
mfem::ElasticityDiagonalPreconditioner::ElasticityDiagonalPreconditioner
ElasticityDiagonalPreconditioner(Type type=Type::Diagonal)
Definition
diagonal_preconditioner.hpp:36
mfem::ElasticityDiagonalPreconditioner::Type
Type
Definition
diagonal_preconditioner.hpp:34
mfem::ElasticityDiagonalPreconditioner::Diagonal
@ Diagonal
Definition
diagonal_preconditioner.hpp:34
mfem::ElasticityDiagonalPreconditioner::BlockDiagonal
@ BlockDiagonal
Definition
diagonal_preconditioner.hpp:34
mfem::ElasticityDiagonalPreconditioner::SetOperator
void SetOperator(const Operator &op) override
Set/update the solver for the given operator.
Definition
diagonal_preconditioner.cpp:21
mfem::ElasticityDiagonalPreconditioner::Mult
void Mult(const Vector &x, Vector &y) const override
Operator application: y=A(x).
Definition
diagonal_preconditioner.cpp:37
mfem::ElasticityGradientOperator
ElasticityGradientOperator is a wrapper class to pass ElasticityOperator::AssembleGradientDiagonal an...
Definition
elasticity_gradient_operator.hpp:26
mfem::Operator
Abstract operator.
Definition
operator.hpp:25
mfem::Solver
Base class for solvers.
Definition
operator.hpp:683
mfem::Vector
Vector data type.
Definition
vector.hpp:80
elasticity_gradient_operator.hpp
mfem
Definition
CodeDocumentation.dox:1
1.11.0