Pulse adds COVID-19 Simulation Support
×
SECircuitPath.h
1 /* Distributed under the Apache License, Version 2.0.
2  See accompanying NOTICE file for details.*/
3 
4 #pragma once
5 #include "circuit/SECircuitNode.h"
6 #include "properties/SEScalarElectricCapacitance.h"
7 #include "properties/SEScalarElectricCurrent.h"
8 #include "properties/SEScalarElectricInductance.h"
9 #include "properties/SEScalarElectricResistance.h"
10 #include "properties/SEScalarVolumePerPressure.h"
11 #include "properties/SEScalarVolumePerTime.h"
12 #include "properties/SEScalarPressureTimeSquaredPerVolume.h"
13 #include "properties/SEScalarPressureTimePerVolume.h"
14 #include "properties/SEScalarHeatCapacitance.h"
15 #include "properties/SEScalarPower.h"
16 #include "properties/SEScalarHeatInductance.h"
17 #include "properties/SEScalarHeatResistance.h"
18 
19 #define CIRCUIT_PATH_TEMPLATE typename FluxScalar, typename ResistanceScalar, typename CapacitanceScalar, typename InductanceScalar, typename PotentialScalar, typename QuantityScalar
20 #define CIRCUIT_PATH_TYPES FluxScalar,ResistanceScalar,CapacitanceScalar,InductanceScalar,PotentialScalar,QuantityScalar
21 #define ELECTRICAL_CIRCUIT_PATH SEScalarElectricCurrent, SEScalarElectricResistance, SEScalarElectricCapacitance, SEScalarElectricInductance, SEScalarElectricPotential, SEScalarElectricCharge
22 #define FLUID_CIRCUIT_PATH SEScalarVolumePerTime, SEScalarPressureTimePerVolume, SEScalarVolumePerPressure, SEScalarPressureTimeSquaredPerVolume, SEScalarPressure, SEScalarVolume
23 #define THERMAL_CIRCUIT_PATH SEScalarPower, SEScalarHeatResistance, SEScalarHeatCapacitance, SEScalarHeatInductance, SEScalarTemperature, SEScalarEnergy
24 
25 template<CIRCUIT_PATH_TEMPLATE>
26 class SECircuitPath : public Loggable
27 {
28  friend class PBCircuit;//friend the serialization class
29  template<typename NodeType, typename PathType> friend class SECircuit;
30 protected:
32 public:
33  virtual ~SECircuitPath();
34 
35  virtual void Clear();
36 
37  virtual std::string GetName() const;
38 
41 
42  virtual bool HasFlux() const;
43  virtual FluxScalar& GetFlux();
44  virtual bool HasNextFlux() const;
45  virtual FluxScalar& GetNextFlux();
46  virtual bool HasFluxSource() const;
47  virtual FluxScalar& GetFluxSource();
48  virtual bool HasNextFluxSource() const;
49  virtual FluxScalar& GetNextFluxSource();
50  virtual bool HasFluxSourceBaseline() const;
51  virtual FluxScalar& GetFluxSourceBaseline();
52 
53  virtual bool HasResistance() const;
54  virtual ResistanceScalar& GetResistance();
55  virtual bool HasNextResistance() const;
56  virtual ResistanceScalar& GetNextResistance();
57  virtual bool HasResistanceBaseline() const;
58  virtual ResistanceScalar& GetResistanceBaseline();
59 
60  virtual bool HasCapacitance() const;
61  virtual CapacitanceScalar& GetCapacitance();
62  virtual bool HasNextCapacitance() const;
63  virtual CapacitanceScalar& GetNextCapacitance();
64  virtual bool HasCapacitanceBaseline() const;
65  virtual CapacitanceScalar& GetCapacitanceBaseline();
66 
67  virtual bool HasInductance() const;
68  virtual InductanceScalar& GetInductance();
69  virtual bool HasNextInductance() const;
70  virtual InductanceScalar& GetNextInductance();
71  virtual bool HasInductanceBaseline() const;
72  virtual InductanceScalar& GetInductanceBaseline();
73 
74  virtual bool HasPotentialSource() const;
75  virtual PotentialScalar& GetPotentialSource();
76  virtual bool HasNextPotentialSource() const;
77  virtual PotentialScalar& GetNextPotentialSource();
78  virtual bool HasPotentialSourceBaseline() const;
79  virtual PotentialScalar& GetPotentialSourceBaseline();
80  virtual bool HasValveBreakdownPotential() const;
81  virtual PotentialScalar& GetValveBreakdownPotential();
82 
83  virtual bool HasValidElements() const;
84  virtual size_t NumberOfElements() const { return m_NumElements; }
85  virtual size_t NumberOfNextElements() const { return m_NumNextElements; }
86 
87  virtual eGate GetSwitch() const;
88  virtual void SetSwitch(eGate state);
89  virtual void FlipSwitch();
90  virtual bool HasSwitch() const;
91  virtual void InvalidateSwitch();
92 
93  virtual eGate GetNextSwitch() const;
94  virtual void SetNextSwitch(eGate state);
95  virtual void FlipNextSwitch();
96  virtual bool HasNextSwitch() const;
97  virtual void InvalidateNextSwitch();
98 
99  virtual eGate GetValve() const;
100  virtual void SetValve(eGate state);
101  virtual void FlipValve();
102  virtual bool HasValve() const;
103  virtual void InvalidateValve();
104 
105  virtual eGate GetNextValve() const;
106  virtual void SetNextValve(eGate state);
107  virtual void FlipNextValve();
108  virtual bool HasNextValve() const;
109  virtual void InvalidateNextValve();
110 
111  virtual eGate GetPolarizedState() const;
112  virtual void SetPolarizedState(eGate state);
113  virtual void FlipPolarizedState();
114  virtual bool HasPolarizedState() const;
115  virtual void InvalidatePolarizedState();
116 
117  virtual eGate GetNextPolarizedState() const;
118  virtual void SetNextPolarizedState(eGate state);
119  virtual void FlipNextPolarizedState();
120  virtual bool HasNextPolarizedState() const;
121  virtual void InvalidateNextPolarizedState();
122 
123 protected:
124  std::string m_Name;
127  mutable size_t m_NumElements;
128  mutable size_t m_NumNextElements;
130  // Valves and Switches //
132  eGate m_Switch;
134  eGate m_Valve;
135  eGate m_NextValve;
138 
139  ResistanceScalar* m_Resistance;
140  ResistanceScalar* m_NextResistance;
141  ResistanceScalar* m_ResistanceBaseline;
142 
143  CapacitanceScalar* m_Capacitance;
144  CapacitanceScalar* m_NextCapacitance;
145  CapacitanceScalar* m_CapacitanceBaseline;
146 
147  InductanceScalar* m_Inductance;
148  InductanceScalar* m_NextInductance;
149  InductanceScalar* m_InductanceBaseline;
150 
151  FluxScalar* m_Flux;
152  FluxScalar* m_NextFlux;
153  FluxScalar* m_FluxSource;
154  FluxScalar* m_NextFluxSource;
155  FluxScalar* m_FluxSourceBaseline;
156 
157  PotentialScalar* m_PotentialSource;
158  PotentialScalar* m_NextPotentialSource;
159  PotentialScalar* m_PotentialSourceBaseline;
160  PotentialScalar* m_ValveBreakdownPotential;
161 };
eGate m_Valve
Definition: SECircuitPath.h:134
InductanceScalar * m_Inductance
Definition: SECircuitPath.h:147
virtual bool HasPolarizedState() const
Definition: SECircuitPath.cpp:313
virtual CapacitanceScalar & GetCapacitance()
Definition: SECircuitPath.cpp:373
virtual bool HasNextFlux() const
Definition: SECircuitPath.cpp:460
virtual bool HasPotentialSource() const
Definition: SECircuitPath.cpp:512
virtual FluxScalar & GetFlux()
Definition: SECircuitPath.cpp:453
SECircuitNode< CIRCUIT_NODE_TYPES > & m_SourceNode
Definition: SECircuitPath.h:125
CapacitanceScalar * m_NextCapacitance
Definition: SECircuitPath.h:144
eGate m_NextPolarizedState
Definition: SECircuitPath.h:137
virtual bool HasNextPotentialSource() const
Definition: SECircuitPath.cpp:524
virtual InductanceScalar & GetInductanceBaseline()
Definition: SECircuitPath.cpp:437
FluxScalar * m_FluxSourceBaseline
Definition: SECircuitPath.h:155
virtual bool HasInductance() const
Definition: SECircuitPath.cpp:408
virtual void Clear()
Definition: SECircuitPath.cpp:53
virtual PotentialScalar & GetValveBreakdownPotential()
Definition: SECircuitPath.cpp:553
eGate m_NextValve
Definition: SECircuitPath.h:135
virtual InductanceScalar & GetInductance()
Definition: SECircuitPath.cpp:413
virtual FluxScalar & GetNextFluxSource()
Definition: SECircuitPath.cpp:489
virtual CapacitanceScalar & GetNextCapacitance()
Definition: SECircuitPath.cpp:385
virtual FluxScalar & GetNextFlux()
Definition: SECircuitPath.cpp:465
virtual bool HasResistanceBaseline() const
Definition: SECircuitPath.cpp:352
virtual bool HasFlux() const
Definition: SECircuitPath.cpp:448
virtual bool HasValidElements() const
Definition: SECircuitPath.cpp:102
PotentialScalar * m_PotentialSource
Definition: SECircuitPath.h:157
virtual bool HasNextSwitch() const
Definition: SECircuitPath.cpp:209
PotentialScalar * m_ValveBreakdownPotential
Definition: SECircuitPath.h:160
virtual bool HasPotentialSourceBaseline() const
Definition: SECircuitPath.cpp:536
virtual bool HasNextValve() const
Definition: SECircuitPath.cpp:261
CapacitanceScalar * m_CapacitanceBaseline
Definition: SECircuitPath.h:145
virtual bool HasFluxSourceBaseline() const
Definition: SECircuitPath.cpp:496
virtual ResistanceScalar & GetResistanceBaseline()
Definition: SECircuitPath.cpp:357
ResistanceScalar * m_NextResistance
Definition: SECircuitPath.h:140
virtual ResistanceScalar & GetResistance()
Definition: SECircuitPath.cpp:333
virtual PotentialScalar & GetNextPotentialSource()
Definition: SECircuitPath.cpp:529
virtual ~SECircuitPath()
Definition: SECircuitPath.cpp:47
virtual PotentialScalar & GetPotentialSource()
Definition: SECircuitPath.cpp:517
virtual CapacitanceScalar & GetCapacitanceBaseline()
Definition: SECircuitPath.cpp:397
virtual InductanceScalar & GetNextInductance()
Definition: SECircuitPath.cpp:425
virtual bool HasValve() const
Definition: SECircuitPath.cpp:235
virtual eGate GetValve() const
Definition: SECircuitPath.cpp:220
SECircuitNode< CIRCUIT_NODE_TYPES > & m_TargetNode
Definition: SECircuitPath.h:126
Definition: Logger.h:21
virtual FluxScalar & GetFluxSource()
Definition: SECircuitPath.cpp:477
size_t m_NumElements
Definition: SECircuitPath.h:127
PotentialScalar * m_PotentialSourceBaseline
Definition: SECircuitPath.h:159
virtual bool HasNextInductance() const
Definition: SECircuitPath.cpp:420
virtual void InvalidateNextValve()
Definition: SECircuitPath.cpp:266
virtual bool HasSwitch() const
Definition: SECircuitPath.cpp:183
virtual void FlipNextSwitch()
Definition: SECircuitPath.cpp:204
Definition: SECircuitPath.h:26
virtual bool HasNextFluxSource() const
Definition: SECircuitPath.cpp:484
FluxScalar * m_FluxSource
Definition: SECircuitPath.h:153
Definition: SECircuitNode.h:19
virtual void FlipValve()
Definition: SECircuitPath.cpp:230
virtual SECircuitNode< CIRCUIT_NODE_TYPES > & GetTargetNode() const
Definition: SECircuitPath.cpp:93
virtual void FlipNextValve()
Definition: SECircuitPath.cpp:256
virtual bool HasCapacitance() const
Definition: SECircuitPath.cpp:368
virtual bool HasResistance() const
Definition: SECircuitPath.cpp:328
virtual bool HasNextPolarizedState() const
Definition: SECircuitPath.cpp:287
FluxScalar * m_Flux
Definition: SECircuitPath.h:151
virtual void SetSwitch(eGate state)
Definition: SECircuitPath.cpp:173
std::string m_Name
Definition: SECircuitPath.h:124
size_t m_NumNextElements
Definition: SECircuitPath.h:128
FluxScalar * m_NextFlux
Definition: SECircuitPath.h:152
virtual bool HasInductanceBaseline() const
Definition: SECircuitPath.cpp:432
ResistanceScalar * m_Resistance
Definition: SECircuitPath.h:139
Definition: PBCircuit.h:25
virtual eGate GetNextSwitch() const
Definition: SECircuitPath.cpp:194
virtual bool HasFluxSource() const
Definition: SECircuitPath.cpp:472
virtual eGate GetNextValve() const
Definition: SECircuitPath.cpp:246
virtual bool HasCapacitanceBaseline() const
Definition: SECircuitPath.cpp:392
InductanceScalar * m_InductanceBaseline
Definition: SECircuitPath.h:149
virtual std::string GetName() const
Definition: SECircuitPath.cpp:82
CapacitanceScalar * m_Capacitance
Definition: SECircuitPath.h:143
SECircuitPath(SECircuitNode< PotentialScalar, QuantityScalar > &src, SECircuitNode< PotentialScalar, QuantityScalar > &tgt, const std::string &name)
Definition: SECircuitPath.cpp:8
virtual void FlipPolarizedState()
Definition: SECircuitPath.cpp:308
virtual void InvalidateSwitch()
Definition: SECircuitPath.cpp:188
virtual size_t NumberOfNextElements() const
Definition: SECircuitPath.h:85
InductanceScalar * m_NextInductance
Definition: SECircuitPath.h:148
virtual ResistanceScalar & GetNextResistance()
Definition: SECircuitPath.cpp:345
virtual void SetPolarizedState(eGate state)
Definition: SECircuitPath.cpp:303
virtual eGate GetNextPolarizedState() const
Definition: SECircuitPath.cpp:272
virtual FluxScalar & GetFluxSourceBaseline()
Definition: SECircuitPath.cpp:501
virtual bool HasNextCapacitance() const
Definition: SECircuitPath.cpp:380
virtual void InvalidateNextPolarizedState()
Definition: SECircuitPath.cpp:292
virtual void SetValve(eGate state)
Definition: SECircuitPath.cpp:225
virtual void FlipSwitch()
Definition: SECircuitPath.cpp:178
virtual size_t NumberOfElements() const
Definition: SECircuitPath.h:84
virtual void SetNextSwitch(eGate state)
Definition: SECircuitPath.cpp:199
virtual void SetNextPolarizedState(eGate state)
Definition: SECircuitPath.cpp:277
FluxScalar * m_NextFluxSource
Definition: SECircuitPath.h:154
eGate m_PolarizedState
Definition: SECircuitPath.h:136
virtual void InvalidatePolarizedState()
Definition: SECircuitPath.cpp:318
virtual PotentialScalar & GetPotentialSourceBaseline()
Definition: SECircuitPath.cpp:541
PotentialScalar * m_NextPotentialSource
Definition: SECircuitPath.h:158
virtual eGate GetPolarizedState() const
Definition: SECircuitPath.cpp:298
Definition: SECircuit.h:12
virtual void InvalidateValve()
Definition: SECircuitPath.cpp:240
eGate m_Switch
Definition: SECircuitPath.h:132
eGate m_NextSwitch
Definition: SECircuitPath.h:133
virtual bool HasValveBreakdownPotential() const
Definition: SECircuitPath.cpp:548
virtual bool HasNextResistance() const
Definition: SECircuitPath.cpp:340
virtual void InvalidateNextSwitch()
Definition: SECircuitPath.cpp:214
virtual void SetNextValve(eGate state)
Definition: SECircuitPath.cpp:251
virtual void FlipNextPolarizedState()
Definition: SECircuitPath.cpp:282
virtual SECircuitNode< CIRCUIT_NODE_TYPES > & GetSourceNode() const
Definition: SECircuitPath.cpp:88
ResistanceScalar * m_ResistanceBaseline
Definition: SECircuitPath.h:141
virtual eGate GetSwitch() const
Definition: SECircuitPath.cpp:168

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.