BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_MaxwellPostprocessor.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#ifndef CL_MAXWELLPOSTPROCESSOR_HPP
12#define CL_MAXWELLPOSTPROCESSOR_HPP
13
14#include "cl_FEM_Kernel.hpp"
16#include "cl_IWG_Maxwell.hpp"
17
18namespace belfem
19{
20 namespace fem
21 {
23 {
26 Conductor, // <- no j/jc
27 SuperConductor, // <- has j/jc
28 ThinShellConductor, // <- no j/jc
30 SideConnector, // <- edge coating walls: full h = ht + hb + hn
31 UNDEFINED
32 };
33
41 {
42 const MaxwellPostprocessorType mType ;
43 const bool mCreateElementFields ;
44
45 Cell< index_t > mMyOwnedElementIndices ;
46 Cell< Vector< index_t > > mAllOwnedElementIndices ;
47
48 Vector< real > mX0 ; // coordinates for node
49 Vector< real > mX ; // coordinates for integration point
52
53 Vector< real > mH ; // magnetic field vector
54 Vector< real > mB ; // magnetic flux density vector
55 Vector< real > mJ ; // current vector
56 Vector< real > mJJc ; // current vector, normalized to critical current
57
58 Vector< real > mDOFs ; // dof vector for current element
59
60 uint mRecoveryDepth = 0 ;
61
62 Cell< string > mElementTargetFields ;
63
64 void
65 ( MaxwellPostprocessor::*mUpdateFunction )();
66
67 const Vector< real > &
68 ( MaxwellPostprocessor::*mComputeFunction )( const uint aK );
69
70
71 Map< id_t, Material * > mMaterialMap ;
72 Matrix< real > mElementData ;
73
74 bool mComputeElementFields = false ;
75
76//------------------------------------------------------------------------------
77 public:
78//------------------------------------------------------------------------------
79
81 Kernel * aKernel,
82 const Map< id_t, DomainType > & aBlockTypes,
83 const Map< id_t, string > & aMaterialMap,
84 const MaxwellPostprocessorType aType,
85 const bool aCreateElementFields = false );
86
87 ~MaxwellPostprocessor() override;
88
89 void
90 run() override ;
91
92 void
93 initialize() override ;
94
95 protected:
96
97 void
98 update_element_dofs() override;
99
100 private:
101
102 void
103 create_other_fields();
104
105 void
106 set_type( const MaxwellPostprocessorType aType );
107
108 void
109 create_element_fields();
110
111 void
112 select_blocks_and_materials( const Map< id_t, DomainType > & aBlockTypes, const Map< id_t, string > & aMaterialMap );
113
114 void
115 select_owned_elements();
116
117 void
118 update_dofs_lagrange();
119
120 void
121 update_dofs_nedelec();
122
123 const Vector< real > &
124 compute( const uint aK ) override;
125
126 const Vector< real > &
127 compute_air( const uint aK );
128
129 const Vector< real > &
130 compute_ferro( const uint aK );
131
132 const Vector< real > &
133 compute_conductor( const uint aK );
134
139 const Vector< real > &
140 compute_conductor_ts( const uint aK );
141
144 const Vector< real > &
145 compute_side_connector( const uint aK );
146
153 void
154 copy_seam_fields();
155
156 const Vector< real > &
157 compute_superconductor( const uint aK );
158
159 const Vector< real > &
160 compute_superconductor_ts( const uint aK );
161
162 void
163 compute_element_data();
164
165 void
166 collect_element_data();
167
169 select_domain_type( const MaxwellPostprocessorType aType );
170
171 };
172
173 inline void
175 {
176 (this->*mUpdateFunction)();
177 }
178
179
180 }
181}
182#endif //CL_MAXWELLPOSTPROCESSOR_HPP
Hash map (unordered key-value).
Definition cl_Map.hpp:75
Top-level orchestrator; owns the mesh, materials, boundary conditions and DOF managers.
Definition cl_FEM_Kernel.hpp:50
MaxwellPostprocessor(Kernel *aKernel, const Map< id_t, DomainType > &aBlockTypes, const Map< id_t, string > &aMaterialMap, const MaxwellPostprocessorType aType, const bool aCreateElementFields=false)
Definition cl_MaxwellPostprocessor.cpp:26
void initialize() override
Definition cl_MaxwellPostprocessor.cpp:300
void update_element_dofs() override
Definition cl_MaxwellPostprocessor.hpp:174
void run() override
Definition cl_MaxwellPostprocessor.cpp:388
Postprocessor(Kernel *aKernel, DofManager *aField=nullptr)
Definition cl_FEM_Postprocessor.cpp:20
Definition cl_IFB_LINE3.hpp:21
MaxwellPostprocessorType
Definition cl_MaxwellPostprocessor.hpp:23
@ Ferro
Definition cl_MaxwellPostprocessor.hpp:25
@ SideConnector
Definition cl_MaxwellPostprocessor.hpp:30
@ Conductor
Definition cl_MaxwellPostprocessor.hpp:26
@ ThinShellConductor
Definition cl_MaxwellPostprocessor.hpp:28
@ SuperConductor
Definition cl_MaxwellPostprocessor.hpp:27
@ Air
Definition cl_MaxwellPostprocessor.hpp:24
@ ThinShellSuperConductor
Definition cl_MaxwellPostprocessor.hpp:29
USER GUIDES:
Definition cl_Capacitor.cpp:16
unsigned int uint
Definition typedefs.hpp:30
DomainType
Definition en_DomainType.hpp:20