https://mooseframework.inl.gov
FieldSplitPreconditioner.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 #include "MoosePreconditioner.h"
13 
14 // Forward declarations
16 class InputParameters;
17 namespace libMesh
18 {
19 class DofMapBase;
20 }
21 
22 #include <vector>
23 #include <string>
24 
29 {
30 public:
31  FieldSplitPreconditionerBase() = default;
32 
36  virtual void setupDM() = 0;
37 
41  virtual KSP getKSP() = 0;
42 };
43 
47 template <typename Base>
49 {
50 public:
55 
57 
58 protected:
62  virtual const libMesh::DofMapBase & dofMap() const = 0;
63 
67  virtual const libMesh::System & system() const = 0;
68 
72  virtual std::string prefix() const = 0;
73 
77  void createMooseDM(DM * dm);
78 
81 
85  std::string _decomposition_split;
86 };
87 
88 class FieldSplitPreconditioner : public FieldSplitPreconditionerTempl<MoosePreconditioner>
89 {
90 public:
92 
94 
95  virtual void setupDM() override;
96  virtual KSP getKSP() override;
97 
98 protected:
99  virtual const libMesh::DofMapBase & dofMap() const override;
100  virtual const libMesh::System & system() const override;
101  virtual std::string prefix() const override;
102 };
FieldSplitPreconditionerTempl(const InputParameters &parameters)
virtual const libMesh::System & system() const override
NonlinearSystemBase & _nl
The nonlinear system this FSP is associated with (convenience reference)
static InputParameters validParams()
Constructor.
virtual void setupDM() override
setup the data management data structure that manages the field split
virtual const libMesh::DofMapBase & dofMap() const =0
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:127
FieldSplitPreconditioner(const InputParameters &parameters)
PetscErrorCode PetscOptionItems *PetscErrorCode DM dm
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
Nonlinear system to be solved.
virtual const libMesh::DofMapBase & dofMap() const override
virtual void setupDM()=0
setup the data management data structure that manages the field split
Implements a preconditioner designed to map onto PETSc&#39;s PCFieldSplit.
virtual std::string prefix() const override
std::string _decomposition_split
The decomposition split.
void createMooseDM(DM *dm)
creates the MOOSE data management object
Base interface for field split preconditioner.
static InputParameters validParams()
virtual std::string prefix() const =0
virtual const libMesh::System & system() const =0