linear_implicit_system.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_LINEAR_IMPLICIT_SYSTEM_H
21 #define LIBMESH_LINEAR_IMPLICIT_SYSTEM_H
22 
23 // Local Includes
25 
26 // C++ includes
27 #include <cstddef>
28 
29 namespace libMesh
30 {
31 
32 
33 // Forward Declarations
34 template <typename T> class LinearSolver;
35 template <typename T> class ShellMatrix;
36 
37 
56 {
57 public:
58 
64  const std::string & name,
65  const unsigned int number);
66 
70  virtual ~LinearImplicitSystem ();
71 
76 
81 
85  sys_type & system () { return *this; }
86 
91  virtual void clear () override;
92 
96  virtual void init_data () override;
97 
102  virtual void reinit () override;
103 
110  virtual void assemble () override { ImplicitSystem::assemble(); }
111 
117  virtual void restrict_solve_to (const SystemSubset * subset,
118  const SubsetSolveMode subset_solve_mode=SUBSET_ZERO) override;
119 
123  virtual void solve () override;
124 
129  virtual LinearSolver<Number> * get_linear_solver() const override;
130 
135  virtual void release_linear_solver(LinearSolver<Number> *) const override;
136 
141  virtual void assembly(bool get_residual,
142  bool get_jacobian,
143  bool apply_heterogeneous_constraints = false,
144  bool apply_no_constraints = false) override;
145 
150  virtual std::string system_type () const override { return "LinearImplicit"; }
151 
158  std::unique_ptr<LinearSolver<Number>> linear_solver;
159 
164  unsigned int n_linear_iterations() const { return _n_linear_iterations; }
165 
170 
180  void attach_shell_matrix (ShellMatrix<Number> * shell_matrix);
181 
186 
192 
193 protected:
194 
199  unsigned int _n_linear_iterations;
200 
205 
210 
215 
221 };
222 
223 } // namespace libMesh
224 
225 #endif // LIBMESH_LINEAR_IMPLICIT_SYSTEM_H
virtual void restrict_solve_to(const SystemSubset *subset, const SubsetSolveMode subset_solve_mode=SUBSET_ZERO) override
ShellMatrix< Number > * get_shell_matrix()
void attach_shell_matrix(ShellMatrix< Number > *shell_matrix)
Manages multiples systems of equations.
ShellMatrix< Number > * _shell_matrix
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and linear solvers ...
LinearImplicitSystem(EquationSystems &es, const std::string &name, const unsigned int number)
std::unique_ptr< LinearSolver< Number > > linear_solver
virtual std::string system_type() const override
virtual LinearSolver< Number > * get_linear_solver() const override
unsigned int number() const
Definition: system.h:2025
virtual void init_data() override
unsigned int n_linear_iterations() const
virtual void assembly(bool get_residual, bool get_jacobian, bool apply_heterogeneous_constraints=false, bool apply_no_constraints=false) override
virtual void release_linear_solver(LinearSolver< Number > *) const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void assemble() override
const std::string & name() const
Definition: system.h:2017
Manages consistently variables, degrees of freedom, and coefficient vectors for explicit systems...
Manages consistently variables, degrees of freedom, coefficient vectors, and matrices for implicit sy...