https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NavierStokesProblem.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 "FEProblem.h"
13#include "libmesh/libmesh_config.h"
14#include <petscsnes.h>
15
16class NonlinearSystem;
17
23{
24public:
26
28
29#if PETSC_RELEASE_GREATER_EQUALS(3, 20, 0)
34
39
43 virtual ~NavierStokesProblem();
44
45 virtual void initialSetup() override;
46
47protected:
51 virtual void initPetscOutputAndSomeSolverSettings() override;
52
53private:
66
68 static PetscErrorCode fieldSplitPostSetUpCallback(PC pc);
69
71 void fieldSplitPostSetUp(PC pc, std::size_t tree_position);
72
74 void setFieldSplitPostSetUp(PC pc, std::size_t tree_position);
75
77 void setupLSCMatrices(PC schur_pc);
78
81 const bool _commute_lsc;
83 const TagName & _mass_matrix;
85 const TagName & _L_matrix;
89 const bool _have_L_matrix;
90
95
99 const std::vector<unsigned int> & _schur_fs_index;
100
102 Mat _Q_scale = nullptr;
104 Mat _L = nullptr;
105
117 std::vector<IS> _index_sets;
118
120 std::vector<FieldSplitPostSetUpContext> _field_split_post_setup_contexts;
121#endif
122};
unsigned int TagID
const InputParameters & parameters() const
A problem that handles Schur complement preconditioning of the incompressible Navier-Stokes equations...
void setupLSCMatrices(PC schur_pc)
Set up the Least Squares Commutator (LSC) preconditioner for the Schur complement.
TagID massMatrixTagID() const
virtual void initialSetup() override
std::vector< IS > _index_sets
This will end up being the same length as _schur_fs_index.
const TagName & _mass_matrix
The tag name of the mass matrix.
void setFieldSplitPostSetUp(PC pc, std::size_t tree_position)
Install the post-setup callback and its context on a field split PC.
static PetscErrorCode fieldSplitPostSetUpCallback(PC pc)
Run after PETSc sets up a field split in the tree leading to the Schur complement.
const bool _commute_lsc
Whether to commute operators in the style of Olshanskii.
Mat _L
The Poisson operator.
SetSchurPreType
Whether and what to set as the user-provided Schur complement preconditioner MASS is only appropriate...
enum NavierStokesProblem::SetSchurPreType _set_schur_pre
Mat _Q_scale
The mass matrix used for scaling.
const bool _have_L_matrix
Whether the user attached a Poisson operator matrix.
static InputParameters validParams()
const bool _have_mass_matrix
Whether the user attached a mass matrix.
std::vector< FieldSplitPostSetUpContext > _field_split_post_setup_contexts
Stable callback contexts for each level of the field split tree and its terminal node.
virtual ~NavierStokesProblem()
Will destroy any matrices we allocated.
virtual void initPetscOutputAndSomeSolverSettings() override
Reinitialize PETSc output for proper linear/nonlinear iteration display.
void fieldSplitPostSetUp(PC pc, std::size_t tree_position)
Continue through the field split tree or set up the target Schur complement matrices.
const TagName & _L_matrix
The tag name of the Poisson operator.
const std::vector< unsigned int > & _schur_fs_index
The length of this vector should correspond to the number of split nesting levels there are in the fi...
virtual TagID getMatrixTagID(const TagName &tag_name) const
Context object attached to a field split PC via PCSetApplicationContext so that the static fieldSplit...
NavierStokesProblem * problem
The problem that owns the field split tree being set up.
std::size_t tree_position
The position of this PC within the field split tree; see _schur_fs_index.