BELFEM
0.9.0
Berkeley Lab Finite Element Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
cl_Switch.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_SWITCH_HPP
13
#define BELFEM_CL_SWITCH_HPP
14
15
#include "
cl_TwoTerminals.hpp
"
16
#include "
Component_Enums.hpp
"
17
18
namespace
belfem
19
{
20
namespace
electronics
21
{
22
//-----------------------------------------------------------------------------
23
24
class
Switch
:
public
TwoTerminals
25
{
27
bool
mIsClosed ;
28
30
real
mSwitchTime ;
31
33
bool
mIsSwitched = false ;
34
36
bool
mPrevIsClosed ;
37
bool
mPrevIsSwitched = false ;
38
39
40
41
//------------------------------------------------------------------------------
42
public
:
43
//------------------------------------------------------------------------------
44
45
Switch
(
const
bool
aIsClosed ,
const
real
aSwitchTime, Cell < ElectricNode* > & aTerminals,
string
aLabel =
""
) ;
46
47
//------------------------------------------------------------------------------
48
49
ComponentType
50
component_type
()
const override
;
51
52
//-----------------------------------------------------------------------------
53
54
bool
55
is_closed
()
const override
;
56
57
//------------------------------------------------------------------------------
58
59
void
60
switch_state
()
override
;
61
62
//------------------------------------------------------------------------------
63
64
void
65
shift
(
const
real
aTime,
const
real
aDeltaTime )
override
;
66
67
//------------------------------------------------------------------------------
68
69
void
70
shift_back
()
override
;
71
72
//------------------------------------------------------------------------------
73
74
void
75
save_state
(
hid_t
aGroup,
const
string
& aPrefix )
override
;
76
77
//------------------------------------------------------------------------------
78
79
void
80
load_state
(
hid_t
aGroup,
const
string
& aPrefix )
override
;
81
82
//------------------------------------------------------------------------------
83
84
};
85
86
inline
ComponentType
87
Switch::component_type
()
const
88
{
89
return
ComponentType::SWITCH
;
90
}
91
92
//-----------------------------------------------------------------------------
93
}
94
}
95
96
#endif
//BELFEM_CL_SWITCH_HPP
Component_Enums.hpp
cl_TwoTerminals.hpp
belfem::electronics::Switch::switch_state
void switch_state() override
Definition
cl_Switch.cpp:39
belfem::electronics::Switch::shift
void shift(const real aTime, const real aDeltaTime) override
Definition
cl_Switch.cpp:47
belfem::electronics::Switch::shift_back
void shift_back() override
Definition
cl_Switch.cpp:63
belfem::electronics::Switch::load_state
void load_state(hid_t aGroup, const string &aPrefix) override
restore the state written by save_state().
Definition
cl_Switch.cpp:85
belfem::electronics::Switch::Switch
Switch(const bool aIsClosed, const real aSwitchTime, Cell< ElectricNode * > &aTerminals, string aLabel="")
Definition
cl_Switch.cpp:23
belfem::electronics::Switch::component_type
ComponentType component_type() const override
Definition
cl_Switch.hpp:87
belfem::electronics::Switch::save_state
void save_state(hid_t aGroup, const string &aPrefix) override
write this component's time-stepping state into the restart group, dataset names prefixed with aPrefi...
Definition
cl_Switch.cpp:73
belfem::electronics::Switch::is_closed
bool is_closed() const override
Definition
cl_Switch.cpp:31
belfem::electronics::TwoTerminals::TwoTerminals
TwoTerminals(Cell< ElectricNode * > &aTerminals, string aLabel="")
Definition
cl_TwoTerminals.cpp:20
belfem::electronics
Definition
cl_Capacitor.cpp:18
belfem::electronics::ComponentType
ComponentType
Definition
Component_Enums.hpp:22
belfem::electronics::ComponentType::SWITCH
@ SWITCH
Definition
Component_Enums.hpp:28
belfem
USER GUIDES:
Definition
cl_Capacitor.cpp:16
belfem::hid_t
int hid_t
Definition
hdf5_types.hpp:20
belfem::real
double real
Definition
typedefs.hpp:36
src
circuit
cl_Switch.hpp
Generated by
1.18.0