19#include "libmesh/transient_system.h"
20#include "libmesh/linear_implicit_system.h"
21#include "libmesh/linear_solver.h"
56 virtual void solve()
override;
57 virtual void preInit()
override;
67 virtual void reinit()
override;
69#ifdef MOOSE_KOKKOS_ENABLED
77 const std::string &
name,
87 const std::string &
name,
100 const std::set<TagID> & vector_tags_to_close)
override;
119 const std::set<TagID> & matrix_tags,
120 const bool compute_gradients =
true);
138 std::vector<dof_id_type> & n_nz,
139 std::vector<dof_id_type> & n_oz)
override;
147 virtual const System &
system()
const override {
return _sys; }
183 const std::set<TagID> & matrix_tags,
184 const bool compute_gradients =
true);
186#ifdef MOOSE_KOKKOS_ENABLED
198 const std::set<TagID> & matrix_tags);
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Base class for boundary conditions for linear FV systems.
Finite volume kernel that contributes approximations of volumetric integral terms to the matrix and r...
Finite volume kernel that contributes approximations of discretized face flux terms to the matrix and...
Shared storage and allocation logic for linear finite-volume cell gradients for variables in the syst...
void requestLinearFVLimitedGradients(const Moose::FV::GradientLimiterType limiter_type, unsigned int variable_number)
Request storage and assembly of limiter-specific cell gradients.
const std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > & linearFVLimitedGradientContainer(const Moose::FV::GradientLimiterType limiter_type) const
Access the stored raw or limited cell-centered gradient components.
void computeGradients()
Compute and store raw and requested limited Green-Gauss gradients for linear FV variables.
Base class for finite volume kernels that contribute to a linear systems.
Linear system to be solved.
virtual void augmentSparsity(SparsityPattern::Graph &sparsity, std::vector< dof_id_type > &n_nz, std::vector< dof_id_type > &n_oz) override
Will modify the sparsity pattern to add logical geometric connections.
NumericVector< Number > & getRightHandSideNonTimeVector()
Return a numeric vector that is associated with the nontime tag.
virtual const System & system() const override
virtual bool containsTimeKernel() override
If the system has a kernel that corresponds to a time derivative.
Real _initial_linear_residual
The initial linear residual.
virtual void initialSetup() override
Setup Functions.
virtual void stopSolve(const ExecFlagType &exec_flag, const std::set< TagID > &vector_tags_to_close) override
Quit the current solve as soon as possible.
TagID rightHandSideVectorTag() const
TagID _rhs_tag
Used for the right hand side vector from PETSc.
TagID _system_matrix_tag
Tag for every contribution to system matrix.
System & _sys
Base class reference to the libmesh system.
virtual TagID systemMatrixTag() const override
Return the Matrix Tag ID for System.
TagID rightHandSideNonTimeVectorTag() const
unsigned int nLinearIterations() const
Return the number of linear iterations.
void addKokkosBoundaryCondition(const std::string &bc_name, const std::string &name, InputParameters ¶meters)
Add a Kokkos linear finite volume boundary condition to this system.
virtual void residualSetup() override
NumericVector< Number > & getRightHandSideVector()
Fetching the right hand side vector from the libmesh system.
SparseMatrix< Number > & getSystemMatrix()
Fetching the system matrix from the libmesh system.
std::set< TagID > _matrix_tags
Matrix tags to temporarily store all tags associated with the current system.
virtual void reinit() override
Reinitialize the system when the degrees of freedom in this system have changed.
virtual void preInit() override
This is called prior to the libMesh system has been init'd.
unsigned int _n_linear_iters
Number of linear iterations.
libMesh::LinearImplicitSystem & linearImplicitSystem()
Return a reference to the stored linear implicit system.
std::set< TagID > _vector_tags
Vector tags to temporarily store all tags associated with the current system.
TagID _system_matrix_non_time_tag
Tag for non-time contribution to the system matrix.
virtual System & system() override
Get the reference to the libMesh system.
NumericVector< Number > * _rhs_non_time
right hand side vector for non-time contributions
NumericVector< Number > & getRightHandSideTimeVector()
Return a numeric vector that is associated with the time tag.
unsigned int _current_l_its
The linear iterations needed for convergence.
void computeKokkosLinearSystem(const std::set< TagID > &vector_tags, const std::set< TagID > &matrix_tags)
Assemble the Kokkos contributions to the linear system for the given tags.
const SparseMatrix< Number > & getSystemMatrix() const
TagID rightHandSideTimeVectorTag() const
Real _final_linear_residual
The final linear residual.
libMesh::LinearImplicitSystem & _linear_implicit_system
Base class reference to the linear implicit system in libmesh.
void computeLinearSystemInternal(const std::set< TagID > &vector_tags, const std::set< TagID > &matrix_tags, const bool compute_gradients=true)
Compute the right hand side and system matrix for given tags.
bool _converged
If the solve on the linear system converged.
void computeLinearSystemTags(const std::set< TagID > &vector_tags, const std::set< TagID > &matrix_tags, const bool compute_gradients=true)
Compute the right hand side and the system matrix of the system for given tags.
TagID _rhs_time_tag
Tag for time contribution rhs.
TagID _rhs_non_time_tag
Tag for non-time contribution rhs.
std::vector< NumericVector< Number > * > _solution_state
The current states of the solution (0 = current, 1 = old, etc)
virtual std::vector< std::string > timeKernelVariableNames() override
Returns the names of the variables that have time derivative kernels in the system.
virtual void jacobianSetup() override
void initialSetupKokkosLinearFV()
Perform the initial setup of the Kokkos linear finite volume kernels and boundary conditions.
virtual void compute(ExecFlagType type) override
Compute time derivatives, auxiliary variables, etc.
const NumericVector< Number > & getRightHandSideVector() const
NumericVector< Number > * _rhs_time
right hand side vector for time contributions
virtual void solve() override
Solve the system (using libMesh magic)
void addKokkosKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
Add a Kokkos linear finite volume kernel to this system.
virtual bool converged() override
At the moment, this is only used for the multi-system fixed point iteration.
Class for containing MooseEnum item information.
Interface for objects interacting with the PerfGraph.
virtual const std::string & name() const
NumericVector< Number > * rhs
SparseMatrix< Number > * matrix
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...