https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MoosePreconditioner.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 "MooseObject.h"
14#include "Restartable.h"
15#include "PerfGraphInterface.h"
16
17// Libmesh include
18#include "libmesh/preconditioner.h"
19#include "libmesh/linear_solver.h"
20#include "libmesh/coupling_matrix.h"
21
22// Forward declarations
23class FEProblemBase;
25namespace libMesh
26{
27class MeshBase;
28template <typename T>
29class NumericVector;
30}
31
36{
37public:
39
41 virtual ~MoosePreconditioner() = default;
42
47 static void copyVarValues(MeshBase & mesh,
48 const unsigned int from_system,
49 const unsigned int from_var,
50 const NumericVector<Number> & from_vector,
51 const unsigned int to_system,
52 const unsigned int to_var,
53 NumericVector<Number> & to_vector);
54
58 virtual void initialSetup();
59
60protected:
62 void setCouplingMatrix(std::unique_ptr<libMesh::CouplingMatrix> cm);
63
66
68 const unsigned int _nl_sys_num;
69
72
74};
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
Base class for MOOSE preconditioners.
FEProblemBase & _fe_problem
Subproblem this preconditioner is part of.
static void copyVarValues(MeshBase &mesh, const unsigned int from_system, const unsigned int from_var, const NumericVector< Number > &from_vector, const unsigned int to_system, const unsigned int to_var, NumericVector< Number > &to_vector)
Helper function for copying values associated with variables in vectors from two different systems.
void setCouplingMatrix(std::unique_ptr< libMesh::CouplingMatrix > cm)
Setup the coupling matrix on the finite element problem.
static InputParameters validParams()
virtual void initialSetup()
Perform some setup tasks such as storing the PETSc options.
const unsigned int _nl_sys_num
The nonlinear system number whose linearization this preconditioner should be applied to.
virtual ~MoosePreconditioner()=default
NonlinearSystemBase & _nl
The nonlinear system whose linearization this preconditioner should be applied to.
Nonlinear system to be solved.
Interface for objects interacting with the PerfGraph.
A class for creating restricted objects.
Definition Restartable.h:29
Set the preconditioner up.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...