Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
366 changes: 77 additions & 289 deletions GridKit/LinearAlgebra/Vector/Vector.cpp

Large diffs are not rendered by default.

389 changes: 371 additions & 18 deletions GridKit/LinearAlgebra/Vector/Vector.hpp

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int Branch<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate DependencyTracking Jacobian for Branch...\n";
Log::misc() << "Jacobian evaluation is experimental!\n";

return 0;
}

Expand Down
3 changes: 0 additions & 3 deletions GridKit/Model/PhasorDynamics/Branch/BranchEnzyme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int Branch<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate Jacobian for Branch..." << std::endl;
Log::misc() << "Jacobian evaluation is experimental!" << std::endl;

if (J_rows_buffer_ == nullptr)
{
// Reserve space for the dense blocks.
Expand Down
3 changes: 0 additions & 3 deletions GridKit/Model/PhasorDynamics/Bus/BusDependencyTracking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int Bus<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate DependencyTracking Jacobian for Bus...\n";
Log::misc() << "Jacobian evaluation is not implemented!\n";

return 0;
}

Expand Down
3 changes: 0 additions & 3 deletions GridKit/Model/PhasorDynamics/Bus/BusEnzyme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int Bus<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate Jacobian for Bus..." << std::endl;
Log::misc() << "Jacobian evaluation is experimental!" << std::endl;

if (J_rows_buffer_ == nullptr)
{
J_rows_buffer_ = new IdxT[4];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ namespace GridKit
template <class scalar_type, typename index_type>
int BusFault<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate DependencyTracking Jacobian for BusFault...\n";
Log::misc() << "Jacobian evaluation is experimental!\n";

this->constructCsr();

return 0;
Expand Down
3 changes: 0 additions & 3 deletions GridKit/Model/PhasorDynamics/BusFault/BusFaultEnzyme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ namespace GridKit
template <class scalar_type, typename index_type>
int BusFault<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate Jacobian for BusFault..." << std::endl;
Log::misc() << "Jacobian evaluation is experimental!" << std::endl;

if (J_rows_buffer_ == nullptr)
{
// Reserve space for the dense blocks.
Expand Down
18 changes: 9 additions & 9 deletions GridKit/Model/PhasorDynamics/Component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ namespace GridKit
/**
* @brief CSR construction dispatch depending on ScalarT
*
* @note Currently only used for testing, particularly for comparing
* @note Currently only used for testing, particularly for comparing
* Enzyme and DependencyTracking Jacobians.
*/
int constructCsr()
Expand Down Expand Up @@ -340,7 +340,7 @@ namespace GridKit
/**
* @brief CSR construction from COO.
*
* @note Currently only used for testing, particularly for comparing
* @note Currently only used for testing, particularly for comparing
* Enzyme and DependencyTracking Jacobians.
*
* @todo The matrix is only computed on the first call, and the data is stale on subsequent calls.
Expand Down Expand Up @@ -374,17 +374,17 @@ namespace GridKit
/**
* @brief CSR construction from Dependency maps.
*
* This merges the y and yp dependencies back to the same location in the Jacobian.
* This merges the y and yp dependencies back to the same location in the Jacobian.
* See \ref initializeDependencyTrackingVariableNumbers() for the initial even/odd split.
* The DependencyMap manipulations are expected to be a bottleneck, so this is not intended
* for simulations.
* The DependencyMap manipulations are expected to be a bottleneck, so this is not intended
* for simulations.
*
* @note Currently only used for testing, particularly for comparing
* Enzyme and DependencyTracking Jacobians. Will be used to benchmark the
* @note Currently only used for testing, particularly for comparing
* Enzyme and DependencyTracking Jacobians. Will be used to benchmark the
* performance of the two methods in the near future.
*
* @note For dependency maps, there is no functional difference in Jacobian construction
* between components and systems. However, the resulting component-level CSR will
* @note For dependency maps, there is no functional difference in Jacobian construction
* between components and systems. However, the resulting component-level CSR will
* be invalid if tracked indices are greater than the local `size_`, and should not
* be used for simulation. Systems do not rely on the component-level results.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int Reecb<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate DependencyTracking Jacobian for Reecb...\n";
Log::misc() << "Jacobian evaluation is experimental!\n";

this->constructCsr();

return 0;
Expand Down
3 changes: 0 additions & 3 deletions GridKit/Model/PhasorDynamics/Controller/REECB/ReecbEnzyme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int Reecb<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate Jacobian for Reecb...\n";
Log::misc() << "Jacobian evaluation is experimental!\n";

if (J_rows_buffer_ == nullptr)
{
const auto size = static_cast<size_t>(size_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int Repca<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate DependencyTracking Jacobian for Repca...\n";
Log::misc() << "Jacobian evaluation is experimental!\n";

this->constructCsr();

return 0;
Expand Down
3 changes: 0 additions & 3 deletions GridKit/Model/PhasorDynamics/Controller/REPCA/RepcaEnzyme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int Repca<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate Jacobian for Repca...\n";
Log::misc() << "Jacobian evaluation is experimental!\n";

if (J_rows_buffer_ == nullptr)
{
const auto size = static_cast<size_t>(size_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int Regca<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate DependencyTracking Jacobian for Regca...\n";
Log::misc() << "Jacobian evaluation is experimental!\n";

this->constructCsr();

return 0;
Expand Down
3 changes: 0 additions & 3 deletions GridKit/Model/PhasorDynamics/Converter/REGCA/RegcaEnzyme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int Regca<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate Jacobian for Regca..." << std::endl;
Log::misc() << "Jacobian evaluation is experimental!" << std::endl;

if (J_rows_buffer_ == nullptr)
{
// Reserve space for the dense blocks. Enzyme keeps only structural
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int Esdc1a<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate DependencyTracking Jacobian for Esdc1a...\n";
Log::misc() << "Jacobian evaluation is experimental!\n";

this->constructCsr();

return 0;
Expand Down
3 changes: 0 additions & 3 deletions GridKit/Model/PhasorDynamics/Exciter/ESDC1A/Esdc1aEnzyme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int Esdc1a<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate Jacobian for Esdc1a..." << std::endl;
Log::misc() << "Jacobian evaluation is experimental!" << std::endl;

if (J_rows_buffer_ == nullptr)
{
auto size = static_cast<size_t>(size_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int Ieeet1<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate DependencyTracking Jacobian for Ieeet1...\n";
Log::misc() << "Jacobian evaluation is experimental!\n";

this->constructCsr();

return 0;
Expand Down
3 changes: 0 additions & 3 deletions GridKit/Model/PhasorDynamics/Exciter/IEEET1/Ieeet1Enzyme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ namespace GridKit
template <class scalar_type, typename index_type>
int Ieeet1<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate Jacobian for Ieeet1..." << std::endl;
Log::misc() << "Jacobian evaluation is experimental!" << std::endl;

if (J_rows_buffer_ == nullptr)
{
// Reserve space for the dense blocks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int SexsPti<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate DependencyTracking Jacobian for SexsPti...\n";
Log::misc() << "Jacobian evaluation is experimental!\n";

this->constructCsr();

return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int SexsPti<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate Jacobian for SexsPti..." << std::endl;
Log::misc() << "Jacobian evaluation is experimental!" << std::endl;

if (J_rows_buffer_ == nullptr)
{
// Reserve space for the dense blocks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int GastPti<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate DependencyTracking Jacobian for GastPti...\n";
Log::misc() << "Jacobian evaluation is experimental!\n";

this->constructCsr();

return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int GastPti<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate Jacobian for GastPti..." << std::endl;
Log::misc() << "Jacobian evaluation is experimental!" << std::endl;

if (J_rows_buffer_ == nullptr)
{
auto size = static_cast<size_t>(size_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int Hygov<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate DependencyTracking Jacobian for Hygov...\n";
Log::misc() << "Jacobian evaluation is experimental!\n";

this->constructCsr();

return 0;
Expand Down
3 changes: 0 additions & 3 deletions GridKit/Model/PhasorDynamics/Governor/HYGOV/HygovEnzyme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int Hygov<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate Jacobian for Hygov..." << std::endl;
Log::misc() << "Jacobian evaluation is experimental!" << std::endl;

if (J_rows_buffer_ == nullptr)
{
auto size = static_cast<size_t>(size_);
Expand Down
3 changes: 0 additions & 3 deletions GridKit/Model/PhasorDynamics/Governor/Tgov1/Tgov1Enzyme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int Tgov1<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate Jacobian for Tgov1..." << std::endl;
Log::misc() << "Jacobian evaluation is experimental!" << std::endl;

if (J_rows_buffer_ == nullptr)
{
// Reserve space for the dense blocks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int LoadZ<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate DependencyTracking Jacobian for LoadZ...\n";
Log::misc() << "Jacobian evaluation is experimental!\n";

this->constructCsr();

return 0;
Expand Down
3 changes: 0 additions & 3 deletions GridKit/Model/PhasorDynamics/Load/LoadZ/LoadZEnzyme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int LoadZ<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate Jacobian for LoadZ..." << std::endl;
Log::misc() << "Jacobian evaluation is experimental!" << std::endl;

if (J_rows_buffer_ == nullptr)
{
// Reserve space for the dense blocks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int LoadZIP<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate DependencyTracking Jacobian for LoadZIP...\n";
Log::misc() << "Jacobian evaluation is experimental!\n";

this->constructCsr();

return 0;
Expand Down
3 changes: 0 additions & 3 deletions GridKit/Model/PhasorDynamics/Load/LoadZIP/LoadZIPEnzyme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int LoadZIP<scalar_type, index_type>::evaluateJacobian()
{
Log::misc() << "Evaluate Jacobian for LoadZIP..." << std::endl;
Log::misc() << "Jacobian evaluation is experimental!" << std::endl;

if (J_rows_buffer_ == nullptr)
{
// Reserve space for the dense blocks.
Expand Down
2 changes: 1 addition & 1 deletion GridKit/Model/PhasorDynamics/SignalNode/SignalNode.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @file SignalNode model implementation.
*/
#include "SignalNodeImpl.hpp"
#include "SignalNode.hpp"

namespace GridKit
{
Expand Down
Loading
Loading