BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_Component.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 BELFEM_CL_COMPONENT_HPP
13#define BELFEM_CL_COMPONENT_HPP
14
15#include "typedefs.hpp"
16#include "cl_Cell.hpp"
17#include "cl_Graph_Vertex.hpp"
18#include "cl_ElectricNode.hpp"
19#include "Component_Enums.hpp"
20#include "hdf5_types.hpp"
21
22namespace belfem
23{
24 namespace electronics
25 {
26//-----------------------------------------------------------------------------
33 class Component : public graph::Vertex
34 {
35 protected:
36
39
41 string mLabel ;
42
44 ElectricNode ** mTerminals = nullptr ;
45
46//------------------------------------------------------------------------------
47 public:
48//------------------------------------------------------------------------------
49
50 Component( const uint aNumTerminals, Cell < ElectricNode* > & aTerminals, string aLabel = "") ;
51
52 ~Component() override;
53
54//------------------------------------------------------------------------------
55
56 virtual ComponentType
57 component_type() const ;
58
59//-----------------------------------------------------------------------------
60
61 uint
62 number_of_terminals() const ;
63
64//------------------------------------------------------------------------------
65
67 node( index_t tIndex ) const ;
68
69//------------------------------------------------------------------------------
70
71 virtual real
72 get_value() const ;
73
74//------------------------------------------------------------------------------
75
76 virtual real
77 dIdV() const ;
78
79//------------------------------------------------------------------------------
80
81 virtual real
83
84//------------------------------------------------------------------------------
85
86 virtual real
88
89//------------------------------------------------------------------------------
90
91 virtual real
92 get_current() const ;
93
94//------------------------------------------------------------------------------
95
96 string
97 get_label() const ;
98
99//------------------------------------------------------------------------------
100
101 virtual void
102 set_current( const real aCurrent) ;
103
104//------------------------------------------------------------------------------
105
106 virtual void
108
109//------------------------------------------------------------------------------
110
111 virtual void
112 set_timestep( const real aDeltaTime ) ;
113
114//------------------------------------------------------------------------------
115
116 virtual void
117 shift( const real aTime, const real aDeltaTime ) ;
118
119//------------------------------------------------------------------------------
120
121 virtual void
122 shift_back() ;
123
124//------------------------------------------------------------------------------
125
131 virtual void
132 save_state( hid_t aGroup, const string & aPrefix ) ;
133
134//------------------------------------------------------------------------------
135
143 virtual void
144 load_state( hid_t aGroup, const string & aPrefix ) ;
145
146//------------------------------------------------------------------------------
147
148 virtual bool
149 is_closed() const ;
150
151//------------------------------------------------------------------------------
152
153 virtual void
154 switch_state() ;
155
156//------------------------------------------------------------------------------
157
158 virtual ElectricNode *
159 get_node_plus() const ;
160
161//------------------------------------------------------------------------------
162
163 virtual ElectricNode *
164 get_node_minus() const ;
165
166//------------------------------------------------------------------------------
167
168 };
169 }
170}
171
172#endif //BELFEM_CL_COMPONENT_HPP
virtual ElectricNode * get_node_plus() const
Definition cl_Component.cpp:202
virtual void set_timestep(const real aDeltaTime)
Definition cl_Component.cpp:141
virtual void shift_back()
Definition cl_Component.cpp:159
virtual real get_value() const
Definition cl_Component.cpp:70
string mLabel
Label.
Definition cl_Component.hpp:41
virtual ElectricNode * get_node_minus() const
Definition cl_Component.cpp:211
virtual bool is_closed() const
Definition cl_Component.cpp:184
virtual void compute_current()
Definition cl_Component.cpp:132
virtual real get_current() const
Definition cl_Component.cpp:106
virtual void shift(const real aTime, const real aDeltaTime)
Definition cl_Component.cpp:150
virtual void load_state(hid_t aGroup, const string &aPrefix)
restore the state written by save_state().
Definition cl_Component.cpp:176
virtual real get_discretized_resistance() const
Definition cl_Component.cpp:88
virtual real get_discretized_source() const
Definition cl_Component.cpp:97
string get_label() const
Definition cl_Component.cpp:115
virtual void save_state(hid_t aGroup, const string &aPrefix)
write this component's time-stepping state into the restart group, dataset names prefixed with aPrefi...
Definition cl_Component.cpp:168
Component(const uint aNumTerminals, Cell< ElectricNode * > &aTerminals, string aLabel="")
Definition cl_Component.cpp:21
uint number_of_terminals() const
Definition cl_Component.cpp:54
ElectricNode ** mTerminals
Nodes at each terminal ( non-owning ).
Definition cl_Component.hpp:44
ElectricNode * node(index_t tIndex) const
Definition cl_Component.cpp:62
const uint mNumTerminals
Number of terminals.
Definition cl_Component.hpp:38
virtual void switch_state()
Definition cl_Component.cpp:193
virtual real dIdV() const
Definition cl_Component.cpp:79
virtual ComponentType component_type() const
Definition cl_Component.cpp:45
virtual void set_current(const real aCurrent)
Definition cl_Component.cpp:123
Circuit node; the unknowns of the modified nodal analysis.
Definition cl_ElectricNode.hpp:31
Graph node with an adjacency list; the vertex type the graph algorithms operate on.
Definition cl_Graph_Vertex.hpp:32
Definition cl_Capacitor.cpp:18
ComponentType
Definition Component_Enums.hpp:22
USER GUIDES:
Definition cl_Capacitor.cpp:16
int hid_t
Definition hdf5_types.hpp:20
unsigned int uint
Definition typedefs.hpp:30
uint32_t index_t
Definition typedefs.hpp:52
double real
Definition typedefs.hpp:36