Add simple one-sided co-sim example taking constant current over zmq - #537
Open
PhilipFackler wants to merge 1 commit into
Open
Add simple one-sided co-sim example taking constant current over zmq#537PhilipFackler wants to merge 1 commit into
PhilipFackler wants to merge 1 commit into
Conversation
PhilipFackler
force-pushed
the
PhilipFackler/simple-zmq-cosim
branch
from
August 13, 2026 17:38
c94431f to
5eef957
Compare
pelesh
reviewed
Aug 13, 2026
pelesh
left a comment
Collaborator
There was a problem hiding this comment.
It would be good to document code and add a README file with description of the cosimulation app and the example.
pelesh
reviewed
Aug 13, 2026
Comment on lines
-36
to
-47
| SystemModelData<double, size_t> parseSystemModelData(const std::string& fileName) | ||
| { | ||
| auto stream = std::ifstream(fileName); | ||
| if (!stream) | ||
| { | ||
| std::stringstream ss; | ||
| ss << "Could not open file: " << fileName; | ||
| Log::error() << ss.str() << std::endl; | ||
| throw std::runtime_error(ss.str()); | ||
| } | ||
| return parseSystemModelData(stream); | ||
| } |
Collaborator
There was a problem hiding this comment.
Why is this function removed?
Collaborator
Author
There was a problem hiding this comment.
It caused a compiler error for my app because it's redundant/ambiguous.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
See #469
Introduce a minimal example using zmq for communication between GridKit processes.
Proposed changes
This example duplicates the behavior of the
ThreeBusConstantSourceexample, but with theConstantSignalSourcecomponent removed and its behavior reproduced in the app (external to the system model) with currents being received over zmq from another app.Checklist
-Wall -Wpedantic -Wconversion -Wextra.Further comments
A lot of comments here. 😄 I have numbered them for reference in discussion.
ConstantSignalSourceexample.Ida::runSimulationrather than managing the stepping itself; this is questionable :), since we are intending to remove that.evaluateResidualComponentSignals. Extend it to make ports configurable...enabling the zmq exchange to be triggered when signals are read from ports.ConstantSignalSourcethat would use zmq to update its "constant" values.I'll add that in either of the "IOPorts" scenarios the co-simulation "manager" could be set up to exchange all necessary variables in one send/recv.