https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ExplicitTimeIntegrator.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 "TimeIntegrator.h"
14
15#include "libmesh/linear_solver.h"
16#include "libmesh/preconditioner.h"
17#include "libmesh/numeric_vector.h"
18
20
26{
27public:
29
31
32 virtual void initialSetup() override;
33 virtual void init() override;
34 virtual void preSolve() override;
35 virtual void meshChanged() override;
36 virtual bool isExplicit() const override { return true; }
37
38protected:
39 void setupSolver();
40
47
53 virtual bool performExplicitSolve(SparseMatrix<Number> & mass_matrix);
54
60 bool solveLinearSystem(SparseMatrix<Number> & mass_matrix);
61
66
70 virtual TagID massMatrixTagID() const { return _Ke_time_tag; }
71
74
76 NumericVector<Real> * _explicit_residual;
77
79 NumericVector<Real> * _solution_update;
80
82 NumericVector<Real> * _mass_matrix_diag_inverted;
83
85 NumericVector<Real> * _ones;
86
89
91 std::unique_ptr<libMesh::LinearSolver<Number>> _linear_solver;
92
94 std::unique_ptr<LumpedPreconditioner> _preconditioner;
95
98};
unsigned int TagID
Definition MooseTypes.h:238
Base class for explicit time integrators that are implemented without using a nonlinear solver.
virtual TagID massMatrixTagID() const
virtual void meshChanged() override
Called on this object when the mesh changes.
virtual void init() override
Called only before the very first timestep (t_step = 0) Never called again (not even during recover/r...
virtual void initialSetup() override
Called to setup datastructures.
virtual bool performExplicitSolve(SparseMatrix< Number > &mass_matrix)
Solves a linear system using the chosen solve type.
bool checkLinearConvergence()
Check for the linear solver convergence.
MooseEnum _solve_type
Solve type for how mass matrix is handled.
NumericVector< Real > * _mass_matrix_diag_inverted
Diagonal of the lumped mass matrix (and its inversion)
Real _current_time
Save off current time to reset it back and forth.
virtual void preSolve() override
NumericVector< Real > * _ones
Vector of 1's to help with creating the lumped mass matrix.
static InputParameters validParams()
std::unique_ptr< LumpedPreconditioner > _preconditioner
For solving with lumped preconditioning.
TagID _Ke_time_tag
For computing the mass matrix.
NumericVector< Real > * _solution_update
Solution vector for the linear solve.
std::unique_ptr< libMesh::LinearSolver< Number > > _linear_solver
For solving with the consistent matrix.
NumericVector< Real > * _explicit_residual
Residual used for the RHS.
bool solveLinearSystem(SparseMatrix< Number > &mass_matrix)
Solves a linear system.
virtual bool isExplicit() const override
Returns whether the explicit solvers are used.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Interface for notifications that the mesh has changed.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55
Base class for time integrators.