25 typename CPS::SimNode<VarType>::List nodes;
27 CPS::MNAInterface::List components;
39 CPS::LUFactorized luFactorization;
41 std::vector<const Matrix *> rightVectorStamps;
43 CPS::Attribute<Matrix>::Ptr leftVector;
47 Real mSystemFrequency;
52 std::shared_ptr<DataLogger> mLeftVectorLog;
54 std::shared_ptr<DataLogger> mRightVectorLog;
56 std::vector<Subnet> mSubnets;
57 std::unordered_map<typename CPS::SimNode<VarType>::Ptr, Subnet *>
59 typename CPS::SimPowerComp<VarType>::List mTearComponents;
60 CPS::SimSignalComp::List mSimSignalComps;
62 Matrix mRightSideVector;
63 Matrix mLeftSideVector;
67 Matrix mSystemInverse;
71 CPS::SparseMatrixRow mTearImpedance;
74 CPS::LUFactorized mTotalTearImpedance;
80 CPS::PhaseType mPhaseType;
84 void initSubnets(
const std::vector<CPS::SystemTopology> &subnets);
85 void collectVirtualNodes(
int net);
86 void assignMatrixNodeIndices(
int net);
87 void setSubnetSize(
int net, UInt nodes);
91 void createMatrices();
92 void createTearMatrices(UInt totalSize);
94 void initComponents();
97 void applyTearComponentStamp(UInt compIdx);
99 void log(Real time, Int timeStepCount)
override;
109 CPS::IdentifiedObject::List tearComponents, Real timeStep,
110 CPS::Logger::Level logLevel);
112 CPS::Task::List
getTasks()
override;
116 SubnetSolveTask(DiakopticsSolver<VarType> &solver, UInt net)
117 : Task(solver.
mName +
".SubnetSolve_" + std::to_string(net)),
118 mSolver(solver), mSubnet(solver.mSubnets[net]) {
119 for (
auto it : mSubnet.components) {
120 if (it->getRightVector()->get().size() != 0) {
121 mAttributeDependencies.push_back(it->getRightVector());
127 void execute(Real time, Int timeStepCount);
130 DiakopticsSolver<VarType> &mSolver;
137 PreSolveTask(DiakopticsSolver<VarType> &solver)
138 : Task(solver.
mName +
".PreSolve"), mSolver(solver) {
143 void execute(Real time, Int timeStepCount);
146 DiakopticsSolver<VarType> &mSolver;
151 SolveTask(DiakopticsSolver<VarType> &solver, UInt net)
152 : Task(solver.
mName +
".Solve_" + std::to_string(net)), mSolver(solver),
153 mSubnet(solver.mSubnets[net]) {
155 mModifiedAttributes.push_back(mSubnet.leftVector);
158 void execute(Real time, Int timeStepCount);
161 DiakopticsSolver<VarType> &mSolver;
167 PostSolveTask(DiakopticsSolver<VarType> &solver)
168 : Task(solver.
mName +
".PostSolve"), mSolver(solver) {
169 for (
auto &net : solver.mSubnets) {
170 mAttributeDependencies.push_back(net.leftVector);
172 mModifiedAttributes.push_back(Scheduler::external);
175 void execute(Real time, Int timeStepCount);
178 DiakopticsSolver<VarType> &mSolver;
183 LogTask(DiakopticsSolver<VarType> &solver)
184 : Task(solver.
mName +
".Log"), mSolver(solver) {
185 for (
auto &net : solver.mSubnets) {
186 mAttributeDependencies.push_back(net.leftVector);
188 mModifiedAttributes.push_back(Scheduler::external);
191 void execute(Real time, Int timeStepCount);
194 DiakopticsSolver<VarType> &mSolver;