libMesh
heatsystem.h
Go to the documentation of this file.
1 #include "libmesh/enum_fe_family.h"
2 #include "libmesh/fem_system.h"
3 
4 // FEMSystem, TimeSolver and NewtonSolver will handle most tasks,
5 // but we must specify element residuals
6 class HeatSystem : public libMesh::FEMSystem
7 {
8 public:
9  // Constructor
11  const std::string & name,
12  const unsigned int number) :
13  libMesh::FEMSystem(es, name, number),
14  _fe_family("LAGRANGE"), _fe_order(1)
15  {
16  // Get the conductivity ratios right for both 2D and 3D
17  // benchmarks
18  _k[1] = 1/libMesh::pi/std::sqrt(libMesh::Real(3));
19  _k[2] = 1;
20  _k[3] = 2*libMesh::pi*std::sqrt(libMesh::Real(3));
21  }
22 
23  std::string & fe_family() { return _fe_family; }
24  unsigned int & fe_order() { return _fe_order; }
25 
26 protected:
27  // System initialization
28  virtual void init_data ();
29 
30  // Context initialization
31  virtual void init_context (libMesh::DiffContext & context);
32 
33  // Element residual and jacobian calculations
34  // Time dependent parts
35  virtual bool element_time_derivative (bool request_jacobian,
36  libMesh::DiffContext & context);
37 
38  // The conductivity for the various dimensional elements, indexed by
39  // dim (with _k[0] unused) for simplicity
41 
42  // The FE type to use
43  std::string _fe_family;
44  unsigned int _fe_order;
45 
46  // The variable index (yes, this will be 0...)
47  unsigned int T_var;
48 };
This is the EquationSystems class.
HeatSystem(libMesh::EquationSystems &es, const std::string &name, const unsigned int number)
Definition: heatsystem.h:10
This class provides all data required for a physics package (e.g.
Definition: diff_context.h:54
virtual bool element_time_derivative(bool request_jacobian, DiffContext &context)
Adds the time derivative contribution on elem to elem_residual.
Definition: heatsystem.C:110
The libMesh namespace provides an interface to certain functionality in the library.
This class provides a specific system class.
Definition: fem_system.h:53
unsigned int T_var
Definition: heatsystem.h:126
const std::string & name() const
Definition: system.h:1998
virtual void init_context(DiffContext &context)
Definition: heatsystem.C:77
FEMSystem(EquationSystems &es, const std::string &name, const unsigned int number)
Constructor.
Definition: fem_system.C:828
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
unsigned int number() const
Definition: system.h:2006
std::string _fe_family
Definition: heatsystem.h:122
unsigned int _fe_order
Definition: heatsystem.h:123
std::string & fe_family()
Definition: heatsystem.h:23
virtual void init_data()
Initializes the member data fields associated with the system, so that, e.g., assemble() may be used...
Definition: heatsystem.C:36
unsigned int & fe_order()
Definition: heatsystem.h:24
const Real pi
.
Definition: libmesh.h:172