BELFEM 0.9.3
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
mt_maxwell_h.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California,
4 * through Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
12#ifndef MT_MAXWELL_H_HPP
13#define MT_MAXWELL_H_HPP
14
15#include "typedefs.hpp"
16#include "constants.hpp"
17#include "globals.hpp"
18
19#include "cl_Vector.hpp"
20#include "cl_Matrix.hpp"
21
22#include "cl_FEM_Element.hpp"
23#include "cl_FEM_Calculator.hpp"
25
26
27namespace belfem
28{
29 namespace fem
30 {
31 namespace maxwell
32 {
33 inline void
34 save_resistivity( Calculator * aCalc , const real aRhoM )
35 {
36 aCalc->mesh()->field_data( "element_rho" )( aCalc->element()->element()->index() ) = aRhoM ;
37 }
38
39 // ohmic dissipation of one element, added into the mesh-wide
40 // "dotQ" global. This is a POWER in watts ( rho |j|^2 dV ), not an
41 // energy: an AC loss per cycle is the time integral of it, which
42 // nothing in the tree takes. The global is zeroed before every
43 // assembly by Controller::reset_dotQ(), so what reaches the Exodus
44 // file is the value from that timestep's LAST assembly
45 inline void
46 save_dotQ( Calculator * aCalc , const real aDotQ )
47 {
48 aCalc->mesh()->global_variable( "dotQ" )->value() += aDotQ ;
49 }
50
51 inline real
53 {
54 return std::clamp( aCalc->mesh()->field_data( "element_rho" )
55 ( aIndex == BELFEM_UINT_MAX ? aCalc->element()->element()->index() : aIndex ), gRhoMin, gRhoMax );
56 }
57
69 void
70 h_picard( Calculator * aCalc, TimestepMatrices * aMatrices );
71
72 void
73 h_newton_mu0( Calculator * aCalc, TimestepMatrices * aMatrices );
74
75 void
76 h_newton_mu( Calculator * aCalc, TimestepMatrices * aMatrices );
77
81 void
82 h_ghost( Calculator * aCalc, TimestepMatrices * aMatrices );
83
84 void
85 h_side_connector( Calculator * aCalc, TimestepMatrices * aMatrices );
86
87 void
89 }
90 }
91}
92
93#endif //MT_MAXWELL_H_HPP
Vector< real > & field_data(const string &aLabel)
Definition cl_Mesh.hpp:1520
mesh::GlobalVariable * global_variable(const id_t aID)
Definition cl_Mesh.hpp:1539
Definition cl_FEM_Calculator.hpp:596
Element * element()
Definition cl_FEM_Calculator.hpp:2418
Mesh * mesh()
Definition cl_FEM_Calculator.hpp:2506
mesh::Element * element()
expose the underlying element on the mesh
Definition cl_FEM_Element.hpp:574
Container for element-level DENSE matrices in transient nonlinear FEM.
Definition cl_TimestepMatrices.hpp:71
virtual index_t index() const
Definition cl_Graph_Vertex.hpp:234
real & value()
Definition cl_Mesh_GlobalVariable.hpp:89
Definition cl_EF_PENTA6TS.hpp:30
void h_side_connector(Calculator *aCalc, TimestepMatrices *aMatrices)
Definition mt_maxwell_h.cpp:347
void h_newton_mu(Calculator *aCalc, TimestepMatrices *aMatrices)
Definition mt_maxwell_h.cpp:237
void h_picard(Calculator *aCalc, TimestepMatrices *aMatrices)
Collapsed h-kernels: all per-point material math is delegated to aCalc->maxwell(),...
Definition mt_maxwell_h.cpp:124
void save_resistivity(Calculator *aCalc, const real aRhoM)
Definition mt_maxwell_h.hpp:34
void save_dotQ(Calculator *aCalc, const real aDotQ)
Definition mt_maxwell_h.hpp:46
void h_side_connector_newton(Calculator *aCalc, TimestepMatrices *aMatrices)
Definition mt_maxwell_h.cpp:388
void h_ghost(Calculator *aCalc, TimestepMatrices *aMatrices)
facet-based thin-shell interface / stabilization kernel
Definition mt_maxwell_h.cpp:436
void h_newton_mu0(Calculator *aCalc, TimestepMatrices *aMatrices)
Definition mt_maxwell_h.cpp:166
real get_resistivity(Calculator *aCalc, const index_t aIndex=BELFEM_UINT_MAX)
Definition mt_maxwell_h.hpp:52
Definition cl_IFB_LINE3.hpp:21
USER GUIDES:
Definition cl_Capacitor.cpp:16
greal gRhoMin
Definition globals.hpp:51
greal gRhoMax
maximum resistivity in Ohm*m, default: 1e10
Definition globals.hpp:54
uint32_t index_t
Definition typedefs.hpp:52
double real
Definition typedefs.hpp:36
#define BELFEM_UINT_MAX
Definition typedefs.hpp:79