$extrastylesheet
00001 // The libMesh Finite Element Library. 00002 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner 00003 00004 // This library is free software; you can redistribute it and/or 00005 // modify it under the terms of the GNU Lesser General Public 00006 // License as published by the Free Software Foundation; either 00007 // version 2.1 of the License, or (at your option) any later version. 00008 00009 // This library is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 // Lesser General Public License for more details. 00013 00014 // You should have received a copy of the GNU Lesser General Public 00015 // License along with this library; if not, write to the Free Software 00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 00018 00019 00020 #ifndef LIBMESH_TRANSIENT_SYSTEM_H 00021 #define LIBMESH_TRANSIENT_SYSTEM_H 00022 00023 // Local Includes 00024 #include "libmesh/system.h" 00025 00026 // C++ includes 00027 00028 00029 namespace libMesh 00030 { 00031 00032 // Forward declarations 00033 class LinearImplicitSystem; 00034 class NonlinearImplicitSystem; 00035 class ExplicitSystem; 00036 00045 // ------------------------------------------------------------ 00046 // TransientSystem class definition 00047 template <class Base> 00048 class TransientSystem : public Base 00049 { 00050 public: 00051 00056 TransientSystem (EquationSystems& es, 00057 const std::string& name, 00058 const unsigned int number); 00059 00063 virtual ~TransientSystem (); 00064 00068 typedef TransientSystem<Base> sys_type; 00069 00073 sys_type & system () { return *this; } 00074 00079 virtual void clear (); 00080 00085 virtual void reinit (); 00086 00092 virtual std::string system_type () const; 00093 00094 00095 //----------------------------------------------------------------- 00096 // access to the solution data fields 00097 00102 Number old_solution (const dof_id_type global_dof_number) const; 00103 00108 Number older_solution (const dof_id_type global_dof_number) const; 00109 00116 UniquePtr<NumericVector<Number> > old_local_solution; 00117 00124 UniquePtr<NumericVector<Number> > older_local_solution; 00125 00126 00127 protected: 00128 00129 00134 virtual void init_data (); 00135 00141 virtual void re_update (); 00142 }; 00143 00144 00145 00146 // ----------------------------------------------------------- 00147 // Useful typedefs 00148 typedef TransientSystem<LinearImplicitSystem> TransientImplicitSystem; 00149 typedef TransientSystem<LinearImplicitSystem> TransientLinearImplicitSystem; 00150 typedef TransientSystem<NonlinearImplicitSystem> TransientNonlinearImplicitSystem; 00151 typedef TransientSystem<ExplicitSystem> TransientExplicitSystem; 00152 typedef TransientSystem<System> TransientBaseSystem; 00153 00154 00155 00156 // ------------------------------------------------------------ 00157 // TransientSystem inline methods 00158 template <class Base> 00159 inline 00160 std::string TransientSystem<Base>::system_type () const 00161 { 00162 std::string type = "Transient"; 00163 type += Base::system_type (); 00164 00165 return type; 00166 } 00167 00168 00169 00170 } // namespace libMesh 00171 00172 00173 00174 00175 #endif // LIBMESH_TRANSIENT_SYSTEM_H