transient_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_TRANSIENT_SYSTEM_H
21 #define LIBMESH_TRANSIENT_SYSTEM_H
22 
23 // Local Includes
24 #include "libmesh/system.h"
25 #include "libmesh/libmesh_config.h"
26 
27 namespace libMesh
28 {
29 
30 // Forward declarations
31 class LinearImplicitSystem;
32 class NonlinearImplicitSystem;
33 class ExplicitSystem;
34 #ifdef LIBMESH_HAVE_SLEPC
35 class EigenSystem;
36 #endif
37 
56 template <class Base>
57 class TransientSystem : public Base
58 {
59 public:
60 
66  const std::string & name,
67  const unsigned int number);
68 
72  virtual ~TransientSystem ();
73 
78 
82  sys_type & system () { return *this; }
83 
88  virtual void clear () override;
89 
95  virtual std::string system_type () const override;
96 
97 
98  //-----------------------------------------------------------------
99  // access to the solution data fields
100 
105  Number old_solution (const dof_id_type global_dof_number) const;
106 
111  Number older_solution (const dof_id_type global_dof_number) const;
112 
119  std::unique_ptr<NumericVector<Number>> old_local_solution;
120 
127  std::unique_ptr<NumericVector<Number>> older_local_solution;
128 
129 
130 protected:
131 
137  virtual void re_update () override;
138 
139 private:
140 
144  virtual void add_old_vectors ();
145 };
146 
147 
148 
149 // -----------------------------------------------------------
150 // Useful typedefs
156 #ifdef LIBMESH_HAVE_SLEPC
158 #endif
159 
160 
161 
162 // ------------------------------------------------------------
163 // TransientSystem inline methods
164 template <class Base>
165 inline
167 {
168  std::string type = "Transient";
169  type += Base::system_type ();
170 
171  return type;
172 }
173 
174 
175 
176 } // namespace libMesh
177 
178 
179 
180 
181 #endif // LIBMESH_TRANSIENT_SYSTEM_H
std::string name(const ElemQuality q)
Definition: elem_quality.C:42
TransientSystem< LinearImplicitSystem > TransientImplicitSystem
Manages multiples systems of equations.
TransientSystem< Base > sys_type
TransientSystem< EigenSystem > TransientEigenSystem
virtual std::string system_type() const override
virtual void add_old_vectors()
TransientSystem< System > TransientBaseSystem
TransientSystem< NonlinearImplicitSystem > TransientNonlinearImplicitSystem
Number older_solution(const dof_id_type global_dof_number) const
std::unique_ptr< NumericVector< Number > > old_local_solution
Manages storage and variables for transient systems.
TransientSystem(EquationSystems &es, const std::string &name, const unsigned int number)
TransientSystem< ExplicitSystem > TransientExplicitSystem
Number old_solution(const dof_id_type global_dof_number) const
TransientSystem< LinearImplicitSystem > TransientLinearImplicitSystem
virtual void clear() override
std::unique_ptr< NumericVector< Number > > older_local_solution
virtual void re_update() override
Manages consistently variables, degrees of freedom, and coefficient vectors for explicit systems...
uint8_t dof_id_type
Definition: id_types.h:64