libMesh
Loading...
Searching...
No Matches
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
Definition
sigma_physics.h:13
SigmaPhysics::_fe_order
unsigned int _fe_order
Definition
sigma_physics.h:51
SigmaPhysics::k
Real & k()
Definition
sigma_physics.h:25
SigmaPhysics::_fe_family
std::string _fe_family
Definition
sigma_physics.h:50
SigmaPhysics::SigmaPhysics
SigmaPhysics()
Definition
sigma_physics.h:16
SigmaPhysics::~SigmaPhysics
virtual ~SigmaPhysics()=default
SigmaPhysics::SigmaPhysics
SigmaPhysics(const SigmaPhysics &)=default
SigmaPhysics::analytic_jacobians
bool & analytic_jacobians()
Definition
sigma_physics.h:26
SigmaPhysics::init_data
virtual void init_data(System &sys)
Definition
sigma_physics.C:39
SigmaPhysics::clone_physics
virtual std::unique_ptr< DifferentiablePhysics > clone_physics() override
Copy of this object.
Definition
sigma_physics.C:174
SigmaPhysics::T_var
unsigned int T_var
Definition
sigma_physics.h:54
SigmaPhysics::computed_QoI
Number computed_QoI[1]
Definition
sigma_physics.h:47
SigmaPhysics::SigmaPhysics
SigmaPhysics(SigmaPhysics &&)=default
SigmaPhysics::init_context
virtual void init_context(DiffContext &context) override
Definition
sigma_physics.C:63
SigmaPhysics::_k
Real _k
Definition
sigma_physics.h:44
SigmaPhysics::element_time_derivative
virtual bool element_time_derivative(bool request_jacobian, DiffContext &context) override
Adds the time derivative contribution on elem to elem_residual.
Definition
sigma_physics.C:106
SigmaPhysics::operator=
SigmaPhysics & operator=(const SigmaPhysics &)=default
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:56
libMesh::FEMPhysics
This class provides a specific system class.
Definition
fem_physics.h:45
libMesh::System
Manages consistently variables, degrees of freedom, and coefficient vectors.
Definition
system.h:100
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
libMesh::Number
Real Number
Definition
libmesh_common.h:253
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition
libmesh_common.h:144
Generated on Fri Aug 21 2026 13:32:26 for libMesh by
1.9.8