11#include <dpsim/MNASolverDirect.h>
12#include <dpsim/MNASolverDynInterface.h>
16template <
typename VarType>
27 void solve(Real time, Int timeStepCount)
override;
30 MnaSolverPlugin(String pluginName, String name,
31 CPS::Domain domain = CPS::Domain::DP,
32 CPS::Logger::Level logLevel = CPS::Logger::Level::info);
34 virtual ~MnaSolverPlugin();
40 SolveTask(MnaSolverPlugin<VarType> &solver)
41 : Task(solver.
mName +
".Solve"), mSolver(solver) {
44 if (it->getRightVector()->get().size() != 0)
45 mAttributeDependencies.push_back(it->getRightVector());
47 for (
auto node : solver.
mNodes) {
48 mModifiedAttributes.push_back(node->mVoltage);
53 void execute(Real time, Int timeStepCount) {
54 mSolver.solve(time, timeStepCount);
58 MnaSolverPlugin<VarType> &mSolver;
63 LogTask(MnaSolverPlugin<VarType> &solver)
64 : Task(solver.
mName +
".Log"), mSolver(solver) {
66 mModifiedAttributes.push_back(Scheduler::external);
69 void execute(Real time, Int timeStepCount) {
70 mSolver.log(time, timeStepCount);
74 MnaSolverPlugin<VarType> &mSolver;
Tasks to be defined by every component.
MnaSolverDirect(String name, CPS::Domain domain=CPS::Domain::DP, CPS::Logger::Level logLevel=CPS::Logger::Level::info)
CPS::MNAInterface::List mMNAComponents
List of MNA components with static stamp into system matrix.
CPS::Attribute< Matrix >::Ptr mLeftSideVector
Solution vector of unknown quantities.
CPS::SimNode< VarType >::List mNodes
List of simulation nodes.
CPS::Task::List getTasks() override
Get tasks for scheduler.
void solve(Real time, Int timeStepCount) override
Solves system for single frequency.
void recomputeSystemMatrix(Real time) override
Recomputes systems matrix.
void initialize() override
Initialize cuSparse-library.
String mName
Name for logging.
CPS::Logger::Log mSLog
Logger.