libMesh
unsteady_solver.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2019 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_UNSTEADY_SOLVER_H
21 #define LIBMESH_UNSTEADY_SOLVER_H
22 
23 // Local includes
24 #include "libmesh/libmesh_common.h"
25 #include "libmesh/numeric_vector.h"
26 #include "libmesh/time_solver.h"
27 
28 // C++ includes
29 #include <memory>
30 
31 namespace libMesh
32 {
33 
48 class UnsteadySolver : public TimeSolver
49 {
50 public:
55  explicit
57 
61  virtual ~UnsteadySolver ();
62 
67  virtual void init () override;
68 
74  virtual void init_data () override;
75 
80  virtual void reinit () override;
81 
87  virtual void solve () override;
88 
95  virtual void advance_timestep () override;
96 
102  virtual void adjoint_advance_timestep () override;
103 
108  virtual void retrieve_timestep () override;
109 
117  virtual Real error_order () const = 0;
118 
126  virtual unsigned int time_order () const = 0;
127 
132  Number old_nonlinear_solution (const dof_id_type global_dof_number) const;
133 
137  std::unique_ptr<NumericVector<Number>> old_local_nonlinear_solution;
138 
148  virtual Real du(const SystemNorm & norm) const override;
149 
153  virtual bool is_steady() const override { return false; }
154 
155 protected:
156 
162 
168 };
169 
170 
171 
172 } // namespace libMesh
173 
174 
175 #endif // LIBMESH_UNSTEADY_SOLVER_H
libMesh::dof_id_type
uint8_t dof_id_type
Definition: id_types.h:67
libMesh::Number
Real Number
Definition: libmesh_common.h:195
libMesh::UnsteadySolver::du
virtual Real du(const SystemNorm &norm) const override
Computes the size of ||u^{n+1} - u^{n}|| in some norm.
Definition: unsteady_solver.C:227
libMesh::UnsteadySolver::reinit
virtual void reinit() override
The reinitialization function.
Definition: unsteady_solver.C:70
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
Definition: factoryfunction.C:55
libMesh::UnsteadySolver::UnsteadySolver
UnsteadySolver(sys_type &s)
Constructor.
Definition: unsteady_solver.C:30
libMesh::DifferentiableSystem
This class provides a specific system class.
Definition: diff_system.h:53
libMesh::UnsteadySolver::old_nonlinear_solution
Number old_nonlinear_solution(const dof_id_type global_dof_number) const
Definition: unsteady_solver.C:216
libMesh::UnsteadySolver::is_steady
virtual bool is_steady() const override
This is not a steady-state solver.
Definition: unsteady_solver.h:153
libMesh::UnsteadySolver
This is a generic class that defines a solver to handle time integration of DifferentiableSystems.
Definition: unsteady_solver.h:48
libMesh::UnsteadySolver::init_data
virtual void init_data() override
The data initialization function.
Definition: unsteady_solver.C:55
libMesh::UnsteadySolver::retrieve_timestep
virtual void retrieve_timestep() override
This method retrieves all the stored solutions at the current system.time.
Definition: unsteady_solver.C:204
libMesh::UnsteadySolver::first_solve
bool first_solve
A bool that will be true the first time solve() is called, and false thereafter.
Definition: unsteady_solver.h:161
libMesh::UnsteadySolver::old_local_nonlinear_solution
std::unique_ptr< NumericVector< Number > > old_local_nonlinear_solution
Serial vector of _system.get_vector("_old_nonlinear_solution")
Definition: unsteady_solver.h:137
libMesh::UnsteadySolver::time_order
virtual unsigned int time_order() const =0
libMesh::UnsteadySolver::error_order
virtual Real error_order() const =0
This method should return the expected convergence order of the (non-local) error of the time discret...
libMesh::UnsteadySolver::~UnsteadySolver
virtual ~UnsteadySolver()
Destructor.
Definition: unsteady_solver.C:40
libMesh::UnsteadySolver::init
virtual void init() override
The initialization function.
Definition: unsteady_solver.C:46
libMesh::UnsteadySolver::advance_timestep
virtual void advance_timestep() override
This method advances the solution to the next timestep, after a solve() has been performed.
Definition: unsteady_solver.C:152
std::norm
MetaPhysicL::DualNumber< T, D > norm(const MetaPhysicL::DualNumber< T, D > &in)
libMesh::TimeSolver
This is a generic class that defines a solver to handle time integration of DifferentiableSystems.
Definition: time_solver.h:58
libMesh::SystemNorm
This class defines a norm/seminorm to be applied to a NumericVector which contains coefficients in a ...
Definition: system_norm.h:51
libMesh::UnsteadySolver::first_adjoint_step
bool first_adjoint_step
A bool that will be true the first time adjoint_advance_timestep() is called, (when the primal soluti...
Definition: unsteady_solver.h:167
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition: libmesh_common.h:121
libMesh::UnsteadySolver::adjoint_advance_timestep
virtual void adjoint_advance_timestep() override
This method advances the adjoint solution to the previous timestep, after an adjoint_solve() has been...
Definition: unsteady_solver.C:178
libMesh::UnsteadySolver::solve
virtual void solve() override
This method solves for the solution at the next timestep.
Definition: unsteady_solver.C:93