https://mooseframework.inl.gov
Loading...
Searching...
No Matches
LumpedPreconditioner.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12// MOOSE includes
13#include "NonlinearSystem.h"
14#include "FEProblem.h"
15#include "PetscSupport.h"
16
17// libMesh includes
18#include "libmesh/sparse_matrix.h"
19#include "libmesh/nonlinear_solver.h"
20#include "libmesh/preconditioner.h"
21
22// Forward declarations
24
30{
31public:
32 LumpedPreconditioner(const NumericVector<Real> & diag_inverse)
33 : Preconditioner(diag_inverse.comm()), _diag_inverse(diag_inverse)
34 {
35 }
36
37 virtual void init() override
38 {
39 // No more initialization needed here
40 _is_initialized = true;
41 }
42
43 virtual void apply(const NumericVector<Real> & x, NumericVector<Real> & y) override
44 {
45 y.pointwise_mult(_diag_inverse, x);
46 }
47
48protected:
50 const NumericVector<Real> & _diag_inverse;
51};
Class to that applies the lumped mass matrix preconditioner in the ExplicitTimeIntegrator.
LumpedPreconditioner(const NumericVector< Real > &diag_inverse)
virtual void apply(const NumericVector< Real > &x, NumericVector< Real > &y) override
const NumericVector< Real > & _diag_inverse
The inverse of the diagonal of the lumped matrix.
virtual void init() override
const Parallel::Communicator & comm() const
Preconditioner(const libMesh::Parallel::Communicator &comm)