Skip to content

Add transient module - #363

Closed
hgangwar wants to merge 3 commits into
SCOREC:developfrom
hgangwar:add_transient_module
Closed

Add transient module#363
hgangwar wants to merge 3 commits into
SCOREC:developfrom
hgangwar:add_transient_module

Conversation

@hgangwar

Copy link
Copy Markdown
Contributor

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:

  • Participant for advancing, checkpointing, restoring, and accessing coupled applications
  • InterfaceState for retaining interface values across fixed-point iterations
  • Accelerator with an Aitken relaxation implementation for the interface
  • Timestepper with a fixed-step implementation

Usage

Implement pcms::transient::Participant for each coupled application:

class ApplicationParticipant : public pcms::transient::Participant
{
  // Implement advance, checkpoint, restore, and interface-data access.
};

Configure the transient components:

pcms::transient::FixedTimestepper timestepper(0.1);
pcms::transient::AitkenRelaxation accelerator(0.5);

Testing

Added separate tests for:

  • Participant checkpoint and restore behavior
  • Aitken relaxation and window reset
  • Fixed timestep acceptance and step size

@jacobmerson

jacobmerson commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

One initial thing I want to discuss. Having both Application and Participant is pretty confusing naming wise. Would something like TransientSolver make sense? I think you are trying to model the state of the independent solvers here.

More detailed review forthcoming...

@jacobmerson

Copy link
Copy Markdown
Collaborator

Maybe this tells us that our current naming for the Coupler, Application, etc. is wrong and those should be more targeted towards something related to the communication tasks they are doing?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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::transient library with Participant, InterfaceState, InterfaceAccelerator/AitkenRelaxation, and Timestepper/FixedTimestepper APIs.
  • 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.

Comment on lines +34 to +38
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);
Comment on lines +19 to +22
AitkenRelaxation::AitkenRelaxation(Real omega0, Real omega_max)
: omega0_(omega0), omega_(omega0), omega_max_(omega_max)
{
}
namespace pcms::transient
{

FixedTimestepper::FixedTimestepper(Real dt) : dt_(dt) {}
@jacobmerson

Copy link
Copy Markdown
Collaborator

@hgangwar and I discussed offline the following plan for bringing in the transient/ high-level coupling control as the following PRs:

  1. rename coupler and application classes to something related to their real job which is related to communication, not the high-level coupling control.
  2. timestepper class which is independently tested, with initial implementation as steady-state (this is where we will later integrate sundials)
  3. New coupler capability which include the fixed point iteration, participant, and transient APIs and baseline implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants