Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
fa14a0e
Work in progress code for cosim integration
abdourahmanbarry Apr 21, 2026
60a34ac
Added partition interfaces to power electronics and updated cmake fil…
abdourahmanbarry Jun 1, 2026
8004577
Made minor changes to partition interface code
abdourahmanbarry Jun 3, 2026
be232c7
Updated Hires test problem to implicit form
abdourahmanbarry Jun 3, 2026
6d79ba4
Change comments in partition interfaces
abdourahmanbarry Jun 3, 2026
a4ec893
Added a subsystem model for evaluating partitions
abdourahmanbarry Jun 15, 2026
5f99b22
Added a partitioned microgrid test problem
abdourahmanbarry Jun 15, 2026
9dbf8b6
Updated bus partition interface to work with new SubsystemModel
abdourahmanbarry Jun 15, 2026
1a5a75b
Work in progress cosimulation implementation: in rought shape
abdourahmanbarry Jun 15, 2026
a4b1c71
Cleaned up code in subsystem and made the partition microgrid test ex…
abdourahmanbarry Jun 15, 2026
70bcfa8
First attempt at arbitrary partitioning
abdourahmanbarry Jun 24, 2026
ef1bbd3
Added microgrid with four partitions
abdourahmanbarry Jun 24, 2026
a98fb80
first version of subsystem
abdourahmanbarry Jun 24, 2026
a1d5882
Added partitioned scale microgrid example
abdourahmanbarry Jun 24, 2026
91ac768
Rmoved obsolete interfaces and clean up partitioning code
abdourahmanbarry Jun 26, 2026
1b94018
Partition Scale Microgrid configured with 10000IBRs
abdourahmanbarry Jun 27, 2026
08f320a
Added Jacobian contributions for bus interfaces
abdourahmanbarry Jul 6, 2026
b4a62ff
Benchmark Setup for Parallel Function Evaluation
abdourahmanbarry Jun 27, 2026
3937b52
Minor updates
abdourahmanbarry Jul 7, 2026
8762af8
Added subsystem Jacobian
abdourahmanbarry Jul 7, 2026
28671aa
Updated Hires test problem
abdourahmanbarry Jul 13, 2026
48b0285
Add subsystem Jacobian testing utilities and update partition test pr…
abdourahmanbarry Jul 13, 2026
def6655
Update partitioning code to work with recent changes in develop
abdourahmanbarry Jul 19, 2026
533806f
Updated copy constructor in circuit component
abdourahmanbarry Jul 20, 2026
9ebecc9
Removed Neumaier Compensation
abdourahmanbarry Jul 20, 2026
f8b56be
Updated Hires test problem
abdourahmanbarry Jul 20, 2026
85d29f9
Removed print statements
abdourahmanbarry Jul 20, 2026
81819c0
Apply pre-commit fixes
abdourahmanbarry Jul 20, 2026
1344722
Make SubsystemModel inherit from PowerElectronicsModel for code reuse
abdourahmanbarry Jul 23, 2026
b48a401
Apply pre-commit fixes
abdourahmanbarry Jul 23, 2026
a287624
Updated SubsystemModel and Partition interfaces
abdourahmanbarry Jul 24, 2026
dd82bb6
Updated examples to reflect new changes in subsystem model and partit…
abdourahmanbarry Jul 24, 2026
060c525
Apply pre-commit fixes
abdourahmanbarry Jul 24, 2026
a375b1f
Addressed leaks
abdourahmanbarry Jul 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
282 changes: 282 additions & 0 deletions GridKit/Model/PartitionEvaluator.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,282 @@
#pragma once

#include <functional>

#include "Evaluator.hpp"

namespace GridKit
{
namespace Model
{

template <class ScalarT, typename IdxT>
class PartitionEvaluator : public Evaluator<ScalarT, IdxT>
{
public:
using Base = Evaluator<ScalarT, IdxT>;
using RealT = typename Base::RealT;
using MatrixT = typename Base::MatrixT;
using CsrMatrixT = typename Base::CsrMatrixT;

using ForcingFunc = std::function<ScalarT(RealT)>;

private:
std::vector<ScalarT> y_;
std::vector<ScalarT> yp_;
std::vector<ScalarT> yB_;
std::vector<ScalarT> ypB_;
std::vector<ScalarT> param_;
std::vector<ScalarT> param_up_;
std::vector<ScalarT> param_lo_;
std::vector<ScalarT> residual_;
std::vector<ScalarT> integrand_;
std::vector<ScalarT> adj_integrand_;
std::vector<ScalarT> adj_residual_;
std::vector<bool> tag_;

MatrixT jacobian_;

std::vector<ScalarT> coupling_;
std::vector<ForcingFunc> forcing_;

public:
int allocate() override
{
return 0;
}

int initialize() override
{
return 0;
}

int tagDifferentiable() override
{
return 0;
}

int evaluateResidual() override
{
return 0;
}

int evaluateJacobian() override
{
return 0;
}

int evaluateIntegrand() override
{
return 0;
}

int initializeAdjoint() override
{
return 0;
}

int evaluateAdjointResidual() override
{
return 0;
}

int evaluateAdjointIntegrand() override
{
return 0;
}

IdxT size() override
{
return 0;
}

IdxT nnz() override
{
return 0;
}

bool hasJacobian() override
{
return false;
}

IdxT sizeQuadrature() override
{
return 0;
}

IdxT sizeParams() override
{
return 0;
}

void updateTime(RealT, RealT) override
{
}

void setTolerances(RealT&, RealT&) const override
{
}

void setMaxSteps(IdxT&) const override
{
}

std::vector<ScalarT>& y() override
{
return y_;
}

const std::vector<ScalarT>& y() const override
{
return y_;
}

std::vector<ScalarT>& yp() override
{
return yp_;
}

const std::vector<ScalarT>& yp() const override
{
return yp_;
}

std::vector<bool>& tag() override
{
return tag_;
}

const std::vector<bool>& tag() const override
{
return tag_;
}

std::vector<ScalarT>& yB() override
{
return yB_;
}

const std::vector<ScalarT>& yB() const override
{
return yB_;
}

std::vector<ScalarT>& ypB() override
{
return ypB_;
}

const std::vector<ScalarT>& ypB() const override
{
return ypB_;
}

std::vector<ScalarT>& param() override
{
return param_;
}

const std::vector<ScalarT>& param() const override
{
return param_;
}

std::vector<ScalarT>& param_up() override
{
return param_up_;
}

const std::vector<ScalarT>& param_up() const override
{
return param_up_;
}

std::vector<ScalarT>& param_lo() override
{
return param_lo_;
}

const std::vector<ScalarT>& param_lo() const override
{
return param_lo_;
}

std::vector<ScalarT>& getResidual() override
{
return residual_;
}

const std::vector<ScalarT>& getResidual() const override
{
return residual_;
}

MatrixT& getJacobian() override
{
return jacobian_;
}

const MatrixT& getJacobian() const override
{
return jacobian_;
}

std::vector<ScalarT>& getIntegrand() override
{
return integrand_;
}

const std::vector<ScalarT>& getIntegrand() const override
{
return integrand_;
}

std::vector<ScalarT>& getAdjointResidual() override
{
return adj_residual_;
}

const std::vector<ScalarT>& getAdjointResidual() const override
{
return adj_residual_;
}

std::vector<ScalarT>& getAdjointIntegrand() override
{
return adj_integrand_;
}

const std::vector<ScalarT>& getAdjointIntegrand() const override
{
return adj_integrand_;
}

void addForcing(const ForcingFunc& f)
{
forcing_.push_back(f);
}

IdxT getCouplingSize() const
{
return static_cast<IdxT>(coupling_.size());
}

IdxT getStateSize() const
{
return static_cast<IdxT>(y_.size());
}

std::vector<ScalarT>& getCoupling()
{
return coupling_;
}

const std::vector<ScalarT>& getCoupling() const
{
return coupling_;
}
};

} // namespace Model
} // namespace GridKit
2 changes: 2 additions & 0 deletions GridKit/Model/PowerElectronics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ add_subdirectory(TransmissionLine)
add_subdirectory(MicrogridLoad)
add_subdirectory(MicrogridLine)
add_subdirectory(MicrogridBusDQ)
add_subdirectory(PartitionInterface)

install(
FILES CircuitComponent.hpp
CircuitNode.hpp
CircuitGraph.hpp
SystemModelPowerElectronics.hpp
NodeBase.hpp
SubsystemModel.hpp
DESTINATION include/GridKit/Model/PowerElectronics)
Loading
Loading