Skip to content

Add component data structures #133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 10, 2025
Merged

Add component data structures #133

merged 6 commits into from
Jun 10, 2025

Conversation

pelesh
Copy link
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
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
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.

@shakedregev
Copy link
Collaborator

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

Copy link
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
Collaborator

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

@shakedregev
Copy link
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
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
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