Skip to content

Add component data structures#133

Merged
pelesh merged 6 commits intodevelopfrom
slaven/component_data_dev
Jun 10, 2025
Merged

Add component data structures#133
pelesh merged 6 commits intodevelopfrom
slaven/component_data_dev

Conversation

@pelesh
Copy link
Copy Markdown
Collaborator

@pelesh pelesh commented Jun 9, 2025

Description

Create data structures for each component model type that stores all modeling data.

@alexander-novo @reid-g @nkoukpaizan @shakedregev

Proposed changes

The data structures contain connectivity information and model parameters for each component model type and as such can be understood as meta models. For example, system matrix sparsity pattern and allocations can be done with information stored in these data structures without instantiating component or system models.

The idea is that these data structures are populated by the GridKit input. GridKit then operates on that data to allocate workspaces and instantiate and parametrize component models.

In this PR:

  • Data structures for buses, branches, loads, and Genrou models are added.
  • Each component model type has a constructor that uses data structure instead of parameter list.
  • Phasor dynamics examples are updated to use data structures and simplified component constructors.

Checklist

  • All tests pass.
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows GridKit™ style guidelines.
  • There are unit tests for the new code.
  • The new code is documented.
  • The feature branch is rebased with respect to the target branch.

Further comments

This is first stage in implementing meta models in GridKit. The objective of this PR is to have a matching data structure for each component model type.

@pelesh pelesh added enhancement New feature or request question Further information is requested labels Jun 9, 2025
@pelesh pelesh self-assigned this Jun 9, 2025
@pelesh pelesh marked this pull request as ready for review June 9, 2025 15:28
Copy link
Copy Markdown
Collaborator

@abirchfield abirchfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me

Copy link
Copy Markdown
Collaborator

@shakedregev shakedregev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending me figuring out how to build.

Comment thread examples/PhasorDynamics/Example1/example1.cpp
Comment thread examples/PhasorDynamics/Example1/example1.cpp
Comment thread examples/PhasorDynamics/Example1/example1.cpp Outdated
Comment thread examples/PhasorDynamics/Example1/example1.cpp
Comment thread examples/PhasorDynamics/Example2/example2.cpp
Comment thread src/Model/PhasorDynamics/BusFault/BusFaultData.hpp Outdated
@shakedregev
Copy link
Copy Markdown
Collaborator

The following tests FAILED:
13 - AdjointSens (SEGFAULT)
Revoking approval.

Copy link
Copy Markdown
Collaborator

@shakedregev shakedregev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix test 13
13 - AdjointSens (SEGFAULT)

@superwhiskers
Copy link
Copy Markdown
Collaborator

@shakedregev is your sundials version from the develop branch? this is probably the reason for the segfault. see this comment

@shakedregev
Copy link
Copy Markdown
Collaborator

shakedregev commented Jun 10, 2025

@shakedregev is your sundials version from the develop branch? this is probably the reason for the segfault. see this comment

Can I get some more details on how to fix this? I tried both locally and on Frontier to install sundials on develop and failed. Pretend I am a bot that only knows how to run commands in the terminal and tell me the steps to get this to work. Assume I have cloned GridKit and spack. Alternatively, if I installed sundials@develop with spack, tell me what I should set my directories to in ccmake, because it didn't find it when I put where I think it installed it.

Copy link
Copy Markdown
Collaborator

@shakedregev shakedregev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests pass. The functionality of the code is good. Hopefully the guideline fixes are not too difficult.

@pelesh pelesh changed the title Slaven/component data dev Add component data structures Jun 10, 2025
@pelesh pelesh merged commit 833261b into develop Jun 10, 2025
4 checks passed
@pelesh pelesh deleted the slaven/component_data_dev branch July 24, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants