libMesh
examples
adjoints
adjoints_ex7
sigma_physics.h
Go to the documentation of this file.
1
#include "libmesh/fem_system.h"
2
#include "libmesh/mesh.h"
3
#include "libmesh/mesh_function.h"
4
#include "libmesh/fem_physics.h"
5
#include "libmesh/system.h"
6
7
// Using namespace libMesh
8
using namespace
libMesh
;
9
10
// FEMSystem, TimeSolver and NewtonSolver will handle most tasks,
11
// but we must specify element residuals
12
class
SigmaPhysics
:
public
FEMPhysics
13
{
14
public
:
15
// Constructor
16
SigmaPhysics
() :
FEMPhysics
() {}
17
18
// Special functions
19
SigmaPhysics
(
SigmaPhysics
&&) =
default
;
20
SigmaPhysics
(
const
SigmaPhysics
&) =
default
;
21
SigmaPhysics
& operator= (
const
SigmaPhysics
&) =
default
;
22
SigmaPhysics
& operator= (
SigmaPhysics
&&) =
default
;
23
virtual
~
SigmaPhysics
() =
default
;
24
25
Real
&
k
() {
return
_k; }
26
bool
&
analytic_jacobians
() {
return
_analytic_jacobians; }
27
28
// System initialization
29
virtual
void
init_data (
System
& sys);
30
31
virtual
std::unique_ptr<DifferentiablePhysics> clone_physics()
override
;
32
33
protected
:
34
35
// Context initialization
36
virtual
void
init_context (
DiffContext
& context)
override
;
37
38
// Element residual and jacobian calculations
39
// Time dependent parts
40
virtual
bool
element_time_derivative (
bool
request_jacobian,
41
DiffContext
& context)
override
;
42
43
// The parameters to solve for
44
Real
_k
;
45
46
// Variables to hold the computed QoIs
47
Number
computed_QoI[1];
48
49
// The FE type to use
50
std::string
_fe_family
;
51
unsigned
int
_fe_order
;
52
53
// Index for T variable
54
unsigned
int
T_var
;
55
56
// Calculate Jacobians analytically or not?
57
bool
_analytic_jacobians
;
58
};
SigmaPhysics::_fe_family
std::string _fe_family
Definition:
sigma_physics.h:50
SigmaPhysics::_k
Real _k
Definition:
sigma_physics.h:44
SigmaPhysics::_analytic_jacobians
bool _analytic_jacobians
Definition:
sigma_physics.h:57
libMesh::DiffContext
This class provides all data required for a physics package (e.g.
Definition:
diff_context.h:55
libMesh::FEMPhysics
This class provides a specific system class.
Definition:
fem_physics.h:44
SigmaPhysics::_fe_order
unsigned int _fe_order
Definition:
sigma_physics.h:51
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
SigmaPhysics::SigmaPhysics
SigmaPhysics()
Definition:
sigma_physics.h:16
SigmaPhysics::analytic_jacobians
bool & analytic_jacobians()
Definition:
sigma_physics.h:26
libMesh::System
Manages consistently variables, degrees of freedom, and coefficient vectors.
Definition:
system.h:96
SigmaPhysics::T_var
unsigned int T_var
Definition:
sigma_physics.h:54
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition:
libmesh_common.h:144
SigmaPhysics
Definition:
sigma_physics.h:12
libMesh::Number
Real Number
Definition:
libmesh_common.h:219
SigmaPhysics::k
Real & k()
Definition:
sigma_physics.h:25
Generated on Thu Jul 17 2025 01:29:03 for libMesh by
1.8.14