26 Switch(
const std::string& symbol,
const std::string& location,
int pins,
const std::vector<bool>& state);
29 void writeMNAmatrix(SymEngine::DenseMatrix&, std::unordered_map<Bus*, int>&,
int, std::map<
Element*, std::vector<RCP<const Basic>>>&)
override;
33 phaseState.assign(phaseState.size(),
false);
36 phaseState.assign(phaseState.size(),
true);
39 if (phase >= 0 && phase < phaseState.size()) {
40 phaseState[phase] = state;
44 for (
int phase; phase < phaseState.size(); phase++) {
45 phaseState[phase] = state;
50 bool getState(
int phase = 0)
const {
return phaseState[phase]; }
55 std::vector<bool> phaseState;
Base class for multi-phase network elements with Y-parameters and MNA stamping hooks.
Definition Element.h:29
Single- or multi-phase switch with per-phase open/closed state.
Definition Switch.h:16
bool getState(int phase=0) const
Definition Switch.h:50
void writeMNAmatrix(SymEngine::DenseMatrix &, std::unordered_map< Bus *, int > &, int, std::map< Element *, std::vector< RCP< const Basic > > > &) override
Stamp this element into the symbolic MNA matrix (override in derived classes).
Definition Switch.cpp:18
void printElementValues() override
Print extended element-specific values (override in derived classes).
Definition Switch.cpp:46
void setOpen()
Definition Switch.h:32
void setClosed()
Definition Switch.h:35
void setState(int phase, bool state)
Definition Switch.h:38
void setState(bool state)
Definition Switch.h:43