Add transient module - #363
Conversation
|
One initial thing I want to discuss. Having both More detailed review forthcoming... |
|
Maybe this tells us that our current naming for the |
There was a problem hiding this comment.
Pull request overview
This PR introduces a new pcms::transient module to support coupled transient simulations, providing initial APIs for participants, interface-state management, fixed-point acceleration (Aitken), and time-window stepping, along with initial unit tests and build/install integration.
Changes:
- Added
pcms::transientlibrary withParticipant,InterfaceState,InterfaceAccelerator/AitkenRelaxation, andTimestepper/FixedTimestepperAPIs. - Integrated the new library into the build, export, and package config so it can be consumed downstream.
- Added Catch2-based unit tests for participant checkpoint/restore, Aitken relaxation behavior, and fixed timestep behavior.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/test_transient_timestepper.cpp | Adds unit test coverage for fixed-step timestep acceptance behavior. |
| test/test_transient_participant.cpp | Adds unit test coverage for participant checkpoint/save/restore semantics. |
| test/test_transient_accelerator.cpp | Adds unit test coverage for Aitken relaxation update and window reset behavior. |
| test/CMakeLists.txt | Registers new transient test executables with Catch2 discovery. |
| src/pcms/transient/timestepper.hpp | Introduces the transient timestepper interface and fixed-step implementation API. |
| src/pcms/transient/timestepper.cpp | Implements the fixed-step timestepper behavior. |
| src/pcms/transient/participant.hpp | Introduces participant API, checkpoint payload, capabilities, and interface state storage. |
| src/pcms/transient/participant.cpp | Implements InterfaceState and default Participant QoI reporting. |
| src/pcms/transient/CMakeLists.txt | Adds build/install/export rules for the new pcms::transient library. |
| src/pcms/transient/accelerator.hpp | Introduces interface accelerator API and Aitken relaxation interface. |
| src/pcms/transient/accelerator.cpp | Implements residual norm and Aitken relaxation update logic. |
| src/CMakeLists.txt | Adds transient subdirectory and links pcms::transient into the umbrella interface target. |
| config.cmake.in | Exports transient targets in the installed package config. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const std::size_t size = x_in.size(); | ||
| std::vector<Real> residual_values(size); | ||
| for (std::size_t i = 0; i < size; ++i) | ||
| residual_values[i] = x_out[i] - x_in[i]; | ||
| const Real residual = Norm(residual_values); |
| AitkenRelaxation::AitkenRelaxation(Real omega0, Real omega_max) | ||
| : omega0_(omega0), omega_(omega0), omega_max_(omega_max) | ||
| { | ||
| } |
| namespace pcms::transient | ||
| { | ||
|
|
||
| FixedTimestepper::FixedTimestepper(Real dt) : dt_(dt) {} |
|
@hgangwar and I discussed offline the following plan for bringing in the transient/ high-level coupling control as the following PRs:
|
This PR introduces the transient module, adding the capability to run coupled transient simulations in PCMS. As a start we are adding the fundamental transient coupling API:
Participantfor advancing, checkpointing, restoring, and accessing coupled applicationsInterfaceStatefor retaining interface values across fixed-point iterationsAcceleratorwith an Aitken relaxation implementation for the interfaceTimestepperwith a fixed-step implementationUsage
Implement
pcms::transient::Participantfor each coupled application:Testing
Added separate tests for: