www.mooseframework.org
MoosePreconditioner.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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
23 class FEProblemBase;
25 namespace libMesh
26 {
27 class MeshBase;
28 template <typename T>
29 class NumericVector;
30 }
31 
36 {
37 public:
39 
40  MoosePreconditioner(const InputParameters & params);
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 
55 protected:
57  void setCouplingMatrix(std::unique_ptr<CouplingMatrix> cm);
58 
61 
63  const unsigned int _nl_sys_num;
64 
67 
69 };
NonlinearSystemBase & _nl
The nonlinear system whose linearization this preconditioner should be applied to.
virtual ~MoosePreconditioner()=default
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...
A class for creating restricted objects.
Definition: Restartable.h:28
MeshBase & mesh
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const unsigned int _nl_sys_num
The nonlinear system number whose linearization this preconditioner should be applied to...
FEProblemBase & _fe_problem
Subproblem this preconditioner is part of.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Base class for MOOSE preconditioners.
Nonlinear system to be solved.
Set the preconditioner up.
MoosePreconditioner(const InputParameters &params)
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:33
static InputParameters validParams()
Interface for objects interacting with the PerfGraph.
void setCouplingMatrix(std::unique_ptr< CouplingMatrix > cm)
Setup the coupling matrix on the finite element problem.