Commit 118c6211 authored by Markus Mirz's avatar Markus Mirz
Browse files

remove Component class files

parent 718ca558
/**
* @file
* @author Markus Mirz <mmirz@eonerc.rwth-aachen.de>
* @copyright 2017-2018, Institute for Automation of Complex Power Systems, EONERC
*
* CPowerSystems
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
#pragma once
#include <typeinfo>
#include <iostream>
#include <vector>
#include <memory>
#include <cps/Logger.h>
#include <cps/IdentifiedObject.h>
namespace CPS {
/// Base class of all objects running internal calculations and
/// having states or measurements.
class Component : public IdentifiedObject {
public:
enum Behaviour { Initialization, Simulation };
protected:
/// Component logger
Logger::Log mSLog;
/// Component logger control for internal variables
Logger::Level mLogLevel;
///
Bool mBehaviour = Behaviour::Simulation;
public:
typedef std::shared_ptr<Component> Ptr;
typedef std::vector<Ptr> List;
/// Basic constructor that takes UID, name and log level
Component(String uid, String name, Logger::Level logLevel = Logger::Level::off);
/// Basic constructor that takes name and log level and sets the UID to name as well
Component(String name, Logger::Level logLevel = Logger::Level::off);
/// Destructor - does not do anything
virtual ~Component() { }
///
void setBehaviour(Behaviour behaviour) { mBehaviour = behaviour; }
};
}
/**
* @file
* @author Markus Mirz <mmirz@eonerc.rwth-aachen.de>
* @copyright 2017-2018, Institute for Automation of Complex Power Systems, EONERC
* @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
*
* CPowerSystems
*
......@@ -21,7 +19,7 @@
#pragma once
#include <cps/Component.h>
#include <cps/IdentifiedObject.h>
#include <cps/MathUtils.h>
#include <cps/PtrFactory.h>
#include <cps/Task.h>
......
......@@ -12,7 +12,6 @@ add_library(cps STATIC
Node.cpp
TopologicalNode.cpp
TopologicalTerminal.cpp
Component.cpp
PowerComponent.cpp
SystemTopology.cpp
CSVReader.cpp
......
/**
* @author Markus Mirz <mmirz@eonerc.rwth-aachen.de>
* @copyright 2017-2018, Institute for Automation of Complex Power Systems, EONERC
*
* CPowerSystems
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
#include <cps/Component.h>
#include <cps/Logger.h>
#include <iostream>
using namespace CPS;
Component::Component(String uid, String name, Logger::Level logLevel)
: IdentifiedObject(uid, name),
mLogLevel(logLevel) {
mSLog = Logger::get(name, logLevel);
}
Component::Component(String name, Logger::Level logLevel)
: Component(name, name, logLevel) { }
/**
* @author Markus Mirz <mmirz@eonerc.rwth-aachen.de>
* @copyright 2017-2018, Institute for Automation of Complex Power Systems, EONERC
* @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
*
* DPsim
*
......@@ -28,13 +27,13 @@
using namespace DPsim;
using namespace CPS;
Component::List multiply_diakoptics(SystemTopology& sys, Int copies,
IdentifiedObject::List multiply_diakoptics(SystemTopology& sys, Int copies,
Real resistance, Real inductance, Real capacitance, Int splits = 0) {
sys.multiply(copies);
int counter = 0;
std::vector<String> nodes = {"BUS5", "BUS8", "BUS6"};
Component::List tear_components;
IdentifiedObject::List tear_components;
Int splitEvery = 0;
if ((splits == 0) || (splits == copies+1)) {
......@@ -83,7 +82,7 @@ void simulateDiakoptics(std::list<fs::path> filenames,
SystemTopology sys = reader.loadCIM(60, filenames);
if (copies > 0)
Component::List tearComps = multiply_diakoptics(sys, copies, 12.5, 0.16, 1e-6, splits);
IdentifiedObject::List tearComps = multiply_diakoptics(sys, copies, 12.5, 0.16, 1e-6, splits);
Simulation sim(simName, Logger::Level::off);
sim.setSystem(sys);
......
/** PFSolver
* @author Jan Dinkelbach <jdinkelbach@eonerc.rwth-aachen.de>
* @copyright 2019, Institute for Automation of Complex Power Systems, EONERC
/**
* @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
*
* DPsim
*
......@@ -27,7 +26,6 @@
#include <dpsim/Scheduler.h>
#include "cps/SystemTopology.h"
#include "cps/Components.h"
#include "cps/Component.h"
namespace DPsim {
/// Solver class using the nonlinear powerflow (PF) formulation.
......@@ -61,7 +59,7 @@ namespace DPsim {
/// Admittance matrix
CPS::SparseMatrixCompRow mY;
/// Jacobian matrix
/// Jacobian matrix
CPS::Matrix mJ;
/// Solution vector
CPS::Vector mX;
......@@ -95,7 +93,7 @@ namespace DPsim {
CPS::Real mBaseApparentPower;
/// Convergence flag
CPS::Bool isConverged = false;
/// Flag whether solution vectors are initialized
/// Flag whether solution vectors are initialized
CPS::Bool solutionInitialized = false;
/// Flag whether complex solution vectors are initialized
CPS::Bool solutionComplexInitialized = false;
......@@ -110,7 +108,7 @@ namespace DPsim {
virtual void updateSolution() = 0;
/// Set final solution
virtual void setSolution() = 0;
/// Initialization of the solver
void initialize();
/// Initialization of individual components
......@@ -146,7 +144,7 @@ namespace DPsim {
CPS::Logger::Level logLevel);
///
virtual ~PFSolver() { };
/// Set a node to VD using its name
void setVDNode(CPS::String name);
/// Allows to modify the powerflow bus type of a specific component
......@@ -165,4 +163,4 @@ namespace DPsim {
PFSolver& mSolver;
};
};
}
\ No newline at end of file
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment