libMesh
second_order_unsteady_solver.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2024 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 #ifndef LIBMESH_SECOND_ORDER_UNSTEADY_SOLVER_H
19 #define LIBMESH_SECOND_ORDER_UNSTEADY_SOLVER_H
20 
21 #include "libmesh/unsteady_solver.h"
22 
23 namespace libMesh
24 {
25 
26 // Forward declarations
27 template <typename T> class FunctionBase;
28 template <typename T> class VectorValue;
29 typedef VectorValue<Number> NumberVectorValue;
31 
46 {
47 public:
52  explicit
54 
58  virtual ~SecondOrderUnsteadySolver ();
59 
60  virtual unsigned int time_order() const override
61  { return 2; }
62 
67  virtual void init () override;
68 
74  virtual void init_data () override;
75 
80  virtual void reinit () override;
81 
86  virtual void retrieve_timestep () override;
87 
95  FunctionBase<Gradient> * g = nullptr);
96 
101  Number old_solution_rate (const dof_id_type global_dof_number) const;
102 
107  Number old_solution_accel (const dof_id_type global_dof_number) const;
108 
109 protected:
110 
114  std::unique_ptr<NumericVector<Number>> _old_local_solution_rate;
115 
119  std::unique_ptr<NumericVector<Number>> _old_local_solution_accel;
120 };
121 
122 } // end namespace libMesh
123 
124 # endif // LIBMESH_SECOND_ORDER_UNSTEADY_SOLVER_H
Number old_solution_accel(const dof_id_type global_dof_number) const
std::unique_ptr< NumericVector< Number > > _old_local_solution_accel
Serial vector of previous time step acceleration .
The libMesh namespace provides an interface to certain functionality in the library.
virtual void init() override
The initialization function.
SecondOrderUnsteadySolver(sys_type &s)
Constructor.
This class provides a specific system class.
Definition: diff_system.h:54
virtual void reinit() override
The reinitialization function.
virtual void init_data() override
The data initialization function.
virtual ~SecondOrderUnsteadySolver()
Destructor.
NumberVectorValue Gradient
virtual void retrieve_timestep() override
This method retrieves all the stored solutions at the current system.time.
Number old_solution_rate(const dof_id_type global_dof_number) const
Generic class from which second order UnsteadySolvers should subclass.
This is a generic class that defines a solver to handle time integration of DifferentiableSystems.
virtual unsigned int time_order() const override
void project_initial_rate(FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr)
Specify non-zero initial velocity.
std::unique_ptr< NumericVector< Number > > _old_local_solution_rate
Serial vector of previous time step velocity .
VectorValue< Number > NumberVectorValue
uint8_t dof_id_type
Definition: id_types.h:67