libMesh
examples
fem_system
fem_system_ex4
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
10
HeatSystem
(
libMesh::EquationSystems
& es,
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
40
libMesh::Real
_k
[4];
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
};
libMesh::EquationSystems
This is the EquationSystems class.
Definition:
equation_systems.h:68
HeatSystem::_k
Real _k
Definition:
heatsystem.h:120
HeatSystem::HeatSystem
HeatSystem(libMesh::EquationSystems &es, const std::string &name, const unsigned int number)
Definition:
heatsystem.h:10
libMesh::DiffContext
This class provides all data required for a physics package (e.g.
Definition:
diff_context.h:55
HeatSystem::element_time_derivative
virtual bool element_time_derivative(bool request_jacobian, DiffContext &context)
Adds the time derivative contribution on elem to elem_residual.
Definition:
heatsystem.C:78
std::sqrt
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
Definition:
type_vector.h:53
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
libMesh::FEMSystem
This class provides a specific system class.
Definition:
fem_system.h:53
HeatSystem::T_var
unsigned int T_var
Definition:
heatsystem.h:133
libMesh::System::number
unsigned int number() const
Definition:
system.h:2269
HeatSystem::init_context
virtual void init_context(DiffContext &context)
Definition:
heatsystem.C:48
libMesh::FEMSystem::FEMSystem
FEMSystem(EquationSystems &es, const std::string &name, const unsigned int number)
Constructor.
Definition:
fem_system.C:858
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition:
libmesh_common.h:143
HeatSystem::_fe_family
std::string _fe_family
Definition:
heatsystem.h:129
HeatSystem::_fe_order
unsigned int _fe_order
Definition:
heatsystem.h:130
HeatSystem::fe_family
std::string & fe_family()
Definition:
heatsystem.h:23
HeatSystem::init_data
virtual void init_data()
Initializes the member data fields associated with the system, so that, e.g., assemble() may be used...
Definition:
heatsystem.C:37
libMesh::System::name
const std::string & name() const
Definition:
system.h:2261
HeatSystem
Definition:
heatsystem.h:31
HeatSystem::fe_order
unsigned int & fe_order()
Definition:
heatsystem.h:24
libMesh::pi
const Real pi
.
Definition:
libmesh.h:274
Generated on Fri Mar 29 2024 04:50:02 for libMesh by
1.8.14