SECircuitPath.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
5#include "cdm/circuit/SECircuitNode.h"
6#include "cdm/properties/SEScalarElectricCapacitance.h"
7#include "cdm/properties/SEScalarElectricCurrent.h"
8#include "cdm/properties/SEScalarElectricInductance.h"
9#include "cdm/properties/SEScalarElectricResistance.h"
10#include "cdm/properties/SEScalarVolumePerPressure.h"
11#include "cdm/properties/SEScalarVolumePerTime.h"
12#include "cdm/properties/SEScalarPressureTimeSquaredPerVolume.h"
13#include "cdm/properties/SEScalarPressureTimePerVolume.h"
14#include "cdm/properties/SEScalarHeatCapacitance.h"
15#include "cdm/properties/SEScalarPower.h"
16#include "cdm/properties/SEScalarHeatInductance.h"
17#include "cdm/properties/SEScalarHeatResistance.h"
18
19#define CIRCUIT_PATH_TEMPLATE typename FluxScalar, typename ResistanceScalar, typename CapacitanceScalar, typename InductanceScalar, typename PotentialScalar, typename QuantityScalar, \
20 typename FluxUnit, typename ResistanceUnit, typename CapacitanceUnit, typename InductanceUnit, typename PotentialUnit, typename QuantityUnit
21
22#define CIRCUIT_PATH_TYPES FluxScalar, ResistanceScalar, CapacitanceScalar, InductanceScalar, PotentialScalar, QuantityScalar, \
23 FluxUnit, ResistanceUnit, CapacitanceUnit, InductanceUnit, PotentialUnit, QuantityUnit
24
25#define ELECTRICAL_CIRCUIT_PATH SEScalarElectricCurrent, SEScalarElectricResistance, SEScalarElectricCapacitance, SEScalarElectricInductance, SEScalarElectricPotential, SEScalarElectricCharge, \
26 ElectricCurrentUnit, ElectricResistanceUnit, ElectricCapacitanceUnit, ElectricInductanceUnit, ElectricPotentialUnit, ElectricChargeUnit
27
28#define FLUID_CIRCUIT_PATH SEScalarVolumePerTime, SEScalarPressureTimePerVolume, SEScalarVolumePerPressure, SEScalarPressureTimeSquaredPerVolume, SEScalarPressure, SEScalarVolume, \
29 VolumePerTimeUnit, PressureTimePerVolumeUnit, VolumePerPressureUnit, PressureTimeSquaredPerVolumeUnit, PressureUnit, VolumeUnit
30
31#define THERMAL_CIRCUIT_PATH SEScalarPower, SEScalarHeatResistance, SEScalarHeatCapacitance, SEScalarHeatInductance, SEScalarTemperature, SEScalarEnergy, \
32 PowerUnit, HeatResistanceUnit, HeatCapacitanceUnit, HeatInductanceUnit, TemperatureUnit, EnergyUnit
33
34
35template<CIRCUIT_PATH_TEMPLATE>
36class SECircuitPath : public Loggable
37{
38 friend class PBCircuit;//friend the serialization class
39 template<typename NodeType, typename PathType> friend class SECircuit;
40protected:
42public:
43 virtual ~SECircuitPath();
44
45 virtual void Clear();
46
47 virtual std::string GetName() const;
48
49 virtual bool IsPartOfBlackBox() const;
50 virtual void SetPartOfBlackBox(bool b);
51
54
55 virtual bool HasFlux() const;
56 virtual FluxScalar& GetFlux();
57 virtual bool HasNextFlux() const;
58 virtual FluxScalar& GetNextFlux();
59
60 virtual bool HasFluxSource() const;
61 virtual FluxScalar& GetFluxSource();
62 virtual bool HasNextFluxSource() const;
63 virtual FluxScalar& GetNextFluxSource();
64 virtual bool HasFluxSourceBaseline() const;
65 virtual FluxScalar& GetFluxSourceBaseline();
66 virtual void RemoveFluxSource();
67
68 virtual void RemoveImposedFlux();
69 virtual bool IsFluxImposed() const;
70 virtual void ImposeFlux(const FluxScalar& s);
71 virtual void ImposeFlux(double v, const FluxUnit& unit);
72
73 virtual bool HasResistance() const;
74 virtual ResistanceScalar& GetResistance();
75 virtual bool HasNextResistance() const;
76 virtual ResistanceScalar& GetNextResistance();
77 virtual bool HasResistanceBaseline() const;
78 virtual ResistanceScalar& GetResistanceBaseline();
79 virtual void RemoveResistance();
80
81 virtual bool HasCapacitance() const;
82 virtual CapacitanceScalar& GetCapacitance();
83 virtual bool HasNextCapacitance() const;
84 virtual CapacitanceScalar& GetNextCapacitance();
85 virtual bool HasCapacitanceBaseline() const;
86 virtual CapacitanceScalar& GetCapacitanceBaseline();
87 virtual void RemoveCapacitance();
88
89 virtual bool HasInductance() const;
90 virtual InductanceScalar& GetInductance();
91 virtual bool HasNextInductance() const;
92 virtual InductanceScalar& GetNextInductance();
93 virtual bool HasInductanceBaseline() const;
94 virtual InductanceScalar& GetInductanceBaseline();
95 virtual void RemoveInductance();
96
97 virtual bool HasPotentialSource() const;
98 virtual PotentialScalar& GetPotentialSource();
99 virtual bool HasNextPotentialSource() const;
100 virtual PotentialScalar& GetNextPotentialSource();
101 virtual bool HasPotentialSourceBaseline() const;
102 virtual PotentialScalar& GetPotentialSourceBaseline();
103 virtual void RemovePotentialSource();
104
105 virtual bool HasValveBreakdownPotential() const;
106 virtual PotentialScalar& GetValveBreakdownPotential();
107
108 virtual eGate GetSwitch() const;
109 virtual void SetSwitch(eGate state);
110 virtual void FlipSwitch();
111 virtual bool HasSwitch() const;
112 virtual void InvalidateSwitch();
113 virtual eGate GetNextSwitch() const;
114 virtual void SetNextSwitch(eGate state);
115 virtual void FlipNextSwitch();
116 virtual bool HasNextSwitch() const;
117 virtual void InvalidateNextSwitch();
118 virtual void RemoveSwitch();
119
120 virtual eGate GetValve() const;
121 virtual void SetValve(eGate state);
122 virtual void FlipValve();
123 virtual bool HasValve() const;
124 virtual void InvalidateValve();
125 virtual eGate GetNextValve() const;
126 virtual void SetNextValve(eGate state);
127 virtual void FlipNextValve();
128 virtual bool HasNextValve() const;
129 virtual void InvalidateNextValve();
130 virtual void RemoveValve();
131
132 virtual eGate GetPolarizedState() const;
133 virtual void SetPolarizedState(eGate state);
134 virtual void FlipPolarizedState();
135 virtual bool HasPolarizedState() const;
136 virtual void InvalidatePolarizedState();
137 virtual eGate GetNextPolarizedState() const;
138 virtual void SetNextPolarizedState(eGate state);
139 virtual void FlipNextPolarizedState();
140 virtual bool HasNextPolarizedState() const;
141 virtual void InvalidateNextPolarizedState();
142
143 virtual bool HasValidElements() const;
144 virtual unsigned short NumberOfElements() const { return m_NumElements; }
145 virtual unsigned short NumberOfNextElements() const { return m_NumNextElements; }
146
147protected:
148 std::string m_Name;
151 mutable unsigned short m_NumElements;
152 mutable unsigned short m_NumNextElements;
153 bool m_IsPartOfBlackBox = false;
155 // Valves and Switches //
157 eGate m_Switch;
159 eGate m_Valve;
163
164 ResistanceScalar* m_Resistance;
165 ResistanceScalar* m_NextResistance;
166 ResistanceScalar* m_ResistanceBaseline;
167
168 CapacitanceScalar* m_Capacitance;
169 CapacitanceScalar* m_NextCapacitance;
170 CapacitanceScalar* m_CapacitanceBaseline;
171
172 InductanceScalar* m_Inductance;
173 InductanceScalar* m_NextInductance;
174 InductanceScalar* m_InductanceBaseline;
175
176 FluxScalar* m_Flux;
177 FluxScalar* m_NextFlux;
178 FluxScalar* m_FluxSource;
179 FluxScalar* m_NextFluxSource;
181 eBlackBox_Property_Type m_FluxType = eBlackBox_Property_Type::Calculate;
182
183 PotentialScalar* m_PotentialSource;
184 PotentialScalar* m_NextPotentialSource;
187};
188
189
190
191#include "cdm/circuit/SECircuitPath.hxx"
Definition: Logger.h:23
Definition: PBCircuit.h:26
Definition: SECircuit.h:13
Definition: SECircuitPath.h:37
virtual bool HasNextPotentialSource() const
Definition: SECircuitPath.cpp:613
virtual void SetNextValve(eGate state)
Definition: SECircuitPath.cpp:267
virtual bool HasNextValve() const
Definition: SECircuitPath.cpp:277
virtual void RemoveImposedFlux()
Definition: SECircuitPath.cpp:571
virtual void RemoveCapacitance()
Definition: SECircuitPath.cpp:436
virtual bool HasPolarizedState() const
Definition: SECircuitPath.cpp:335
std::string m_Name
Definition: SECircuitPath.h:148
PotentialScalar * m_NextPotentialSource
Definition: SECircuitPath.h:184
FluxScalar * m_NextFlux
Definition: SECircuitPath.h:177
virtual bool HasInductance() const
Definition: SECircuitPath.cpp:450
virtual bool HasNextSwitch() const
Definition: SECircuitPath.cpp:219
virtual bool IsPartOfBlackBox() const
Definition: SECircuitPath.cpp:87
virtual void SetPolarizedState(eGate state)
Definition: SECircuitPath.cpp:325
virtual bool HasNextResistance() const
Definition: SECircuitPath.cpp:362
virtual void InvalidateNextPolarizedState()
Definition: SECircuitPath.cpp:314
virtual bool HasSwitch() const
Definition: SECircuitPath.cpp:193
virtual bool HasResistance() const
Definition: SECircuitPath.cpp:350
virtual bool HasCapacitanceBaseline() const
Definition: SECircuitPath.cpp:424
virtual eGate GetSwitch() const
Definition: SECircuitPath.cpp:178
virtual FluxScalar & GetNextFlux()
Definition: SECircuitPath.cpp:517
ResistanceScalar * m_NextResistance
Definition: SECircuitPath.h:165
virtual void InvalidateSwitch()
Definition: SECircuitPath.cpp:198
virtual void SetPartOfBlackBox(bool b)
Definition: SECircuitPath.cpp:92
CapacitanceScalar * m_CapacitanceBaseline
Definition: SECircuitPath.h:170
FluxScalar * m_FluxSource
Definition: SECircuitPath.h:178
virtual void RemoveValve()
Definition: SECircuitPath.cpp:287
CapacitanceScalar * m_Capacitance
Definition: SECircuitPath.h:168
FluxScalar * m_Flux
Definition: SECircuitPath.h:176
ResistanceScalar * m_Resistance
Definition: SECircuitPath.h:164
unsigned short m_NumElements
Definition: SECircuitPath.h:151
SECircuitPath(SECircuitNode< CIRCUIT_NODE_TYPES > &src, SECircuitNode< CIRCUIT_NODE_TYPES > &tgt, const std::string &name)
Definition: SECircuitPath.cpp:7
eGate m_Valve
Definition: SECircuitPath.h:159
InductanceScalar * m_Inductance
Definition: SECircuitPath.h:172
virtual void FlipSwitch()
Definition: SECircuitPath.cpp:188
virtual void Clear()
Definition: SECircuitPath.cpp:52
virtual ResistanceScalar & GetNextResistance()
Definition: SECircuitPath.cpp:367
eGate m_PolarizedState
Definition: SECircuitPath.h:161
virtual std::string GetName() const
Definition: SECircuitPath.cpp:81
FluxScalar * m_NextFluxSource
Definition: SECircuitPath.h:179
virtual bool HasNextCapacitance() const
Definition: SECircuitPath.cpp:412
virtual void FlipNextValve()
Definition: SECircuitPath.cpp:272
virtual void SetValve(eGate state)
Definition: SECircuitPath.cpp:241
virtual ~SECircuitPath()
Definition: SECircuitPath.cpp:46
virtual FluxScalar & GetFlux()
Definition: SECircuitPath.cpp:505
eGate m_NextPolarizedState
Definition: SECircuitPath.h:162
InductanceScalar * m_InductanceBaseline
Definition: SECircuitPath.h:174
virtual unsigned short NumberOfNextElements() const
Definition: SECircuitPath.h:145
bool m_IsPartOfBlackBox
Definition: SECircuitPath.h:153
virtual void SetSwitch(eGate state)
Definition: SECircuitPath.cpp:183
virtual bool HasNextInductance() const
Definition: SECircuitPath.cpp:462
eBlackBox_Property_Type m_FluxType
Definition: SECircuitPath.h:181
virtual bool HasFluxSourceBaseline() const
Definition: SECircuitPath.cpp:548
virtual FluxScalar & GetNextFluxSource()
Definition: SECircuitPath.cpp:541
virtual bool HasNextFlux() const
Definition: SECircuitPath.cpp:512
virtual eGate GetNextSwitch() const
Definition: SECircuitPath.cpp:204
virtual void RemovePotentialSource()
Definition: SECircuitPath.cpp:637
virtual bool IsFluxImposed() const
Definition: SECircuitPath.cpp:576
virtual ResistanceScalar & GetResistanceBaseline()
Definition: SECircuitPath.cpp:379
virtual void FlipNextPolarizedState()
Definition: SECircuitPath.cpp:304
virtual CapacitanceScalar & GetCapacitance()
Definition: SECircuitPath.cpp:405
virtual bool HasValveBreakdownPotential() const
Definition: SECircuitPath.cpp:649
virtual void RemoveInductance()
Definition: SECircuitPath.cpp:486
virtual bool HasFluxSource() const
Definition: SECircuitPath.cpp:524
virtual eGate GetNextValve() const
Definition: SECircuitPath.cpp:262
virtual InductanceScalar & GetInductanceBaseline()
Definition: SECircuitPath.cpp:479
PotentialScalar * m_PotentialSourceBaseline
Definition: SECircuitPath.h:185
ResistanceScalar * m_ResistanceBaseline
Definition: SECircuitPath.h:166
virtual SECircuitNode< CIRCUIT_NODE_TYPES > & GetTargetNode() const
Definition: SECircuitPath.cpp:103
unsigned short m_NumNextElements
Definition: SECircuitPath.h:152
virtual bool HasValve() const
Definition: SECircuitPath.cpp:251
InductanceScalar * m_NextInductance
Definition: SECircuitPath.h:173
virtual ResistanceScalar & GetResistance()
Definition: SECircuitPath.cpp:355
virtual eGate GetNextPolarizedState() const
Definition: SECircuitPath.cpp:294
virtual void InvalidatePolarizedState()
Definition: SECircuitPath.cpp:340
CapacitanceScalar * m_NextCapacitance
Definition: SECircuitPath.h:169
virtual bool HasFlux() const
Definition: SECircuitPath.cpp:500
virtual bool HasPotentialSource() const
Definition: SECircuitPath.cpp:601
eGate m_Switch
Definition: SECircuitPath.h:157
virtual PotentialScalar & GetValveBreakdownPotential()
Definition: SECircuitPath.cpp:654
virtual bool HasPotentialSourceBaseline() const
Definition: SECircuitPath.cpp:625
virtual CapacitanceScalar & GetCapacitanceBaseline()
Definition: SECircuitPath.cpp:429
virtual void RemoveSwitch()
Definition: SECircuitPath.cpp:229
virtual InductanceScalar & GetInductance()
Definition: SECircuitPath.cpp:455
virtual FluxScalar & GetFluxSource()
Definition: SECircuitPath.cpp:529
virtual PotentialScalar & GetPotentialSource()
Definition: SECircuitPath.cpp:606
PotentialScalar * m_PotentialSource
Definition: SECircuitPath.h:183
SECircuitNode< CIRCUIT_NODE_TYPES > & m_TargetNode
Definition: SECircuitPath.h:150
virtual bool HasNextPolarizedState() const
Definition: SECircuitPath.cpp:309
virtual InductanceScalar & GetNextInductance()
Definition: SECircuitPath.cpp:467
virtual void ImposeFlux(const FluxScalar &s)
Definition: SECircuitPath.cpp:589
virtual void InvalidateNextValve()
Definition: SECircuitPath.cpp:282
virtual void InvalidateValve()
Definition: SECircuitPath.cpp:256
virtual void FlipValve()
Definition: SECircuitPath.cpp:246
virtual void SetNextSwitch(eGate state)
Definition: SECircuitPath.cpp:209
virtual bool HasCapacitance() const
Definition: SECircuitPath.cpp:400
virtual bool HasResistanceBaseline() const
Definition: SECircuitPath.cpp:374
virtual void FlipNextSwitch()
Definition: SECircuitPath.cpp:214
virtual void FlipPolarizedState()
Definition: SECircuitPath.cpp:330
virtual FluxScalar & GetFluxSourceBaseline()
Definition: SECircuitPath.cpp:553
virtual eGate GetValve() const
Definition: SECircuitPath.cpp:236
SECircuitNode< CIRCUIT_NODE_TYPES > & m_SourceNode
Definition: SECircuitPath.h:149
virtual bool HasInductanceBaseline() const
Definition: SECircuitPath.cpp:474
virtual bool HasNextFluxSource() const
Definition: SECircuitPath.cpp:536
virtual void RemoveFluxSource()
Definition: SECircuitPath.cpp:560
virtual PotentialScalar & GetPotentialSourceBaseline()
Definition: SECircuitPath.cpp:630
eGate m_NextSwitch
Definition: SECircuitPath.h:158
FluxScalar * m_FluxSourceBaseline
Definition: SECircuitPath.h:180
PotentialScalar * m_ValveBreakdownPotential
Definition: SECircuitPath.h:186
virtual void SetNextPolarizedState(eGate state)
Definition: SECircuitPath.cpp:299
virtual PotentialScalar & GetNextPotentialSource()
Definition: SECircuitPath.cpp:618
virtual SECircuitNode< CIRCUIT_NODE_TYPES > & GetSourceNode() const
Definition: SECircuitPath.cpp:98
virtual CapacitanceScalar & GetNextCapacitance()
Definition: SECircuitPath.cpp:417
eGate m_NextValve
Definition: SECircuitPath.h:160
virtual eGate GetPolarizedState() const
Definition: SECircuitPath.cpp:320
virtual bool HasValidElements() const
Definition: SECircuitPath.cpp:112
virtual void InvalidateNextSwitch()
Definition: SECircuitPath.cpp:224
virtual void RemoveResistance()
Definition: SECircuitPath.cpp:386
virtual unsigned short NumberOfElements() const
Definition: SECircuitPath.h:144

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.