5#ifndef D3F_ISUBMODULEBRIDGE_H
6#define D3F_ISUBMODULEBRIDGE_H
39 template<
typename TDomain,
int dim = TDomain::dim>
63 template<
typename TGr
idFunction,
int dim = TGr
idFunction::dim>
91 template<
typename TGr
idFunction,
int dim = TGr
idFunction::dim>
Orchestrates the coupling between the main solver and a submodule.
Definition i_coupling_bridge.h:92
virtual bool finalize_timestep(SmartPtr< TGridFunction > u, int step, number time, number dt)=0
virtual void finalize(number time)=0
Performs any final operations after the submodule has finished its step.
ISubmoduleBridge()=default
domain_type::position_type position_type
Definition i_coupling_bridge.h:97
bool apply(SmartPtr< TGridFunction > u, int step, number time, number dt)
Core coupling step called by the main time integrator. Performs communication, executes the submodule...
Definition i_coupling_bridge.h:106
virtual ~ISubmoduleBridge()=default
TGridFunction::domain_type domain_type
Definition i_coupling_bridge.h:96
SmartPtr< ISurjectiveInterface< domain_type > > m_interface
Definition i_coupling_bridge.h:143
void set_submodule(SmartPtr< ISubmodule< TGridFunction > > submodule)
Attaches the submodule to the bridge.
Definition i_coupling_bridge.h:120
SmartPtr< ISubmodule< TGridFunction > > m_submodule
Definition i_coupling_bridge.h:142
virtual bool init_timestep(SmartPtr< TGridFunction > u, int step, number time, number dt)=0
void set_interface(SmartPtr< ISurjectiveInterface< domain_type > > interface)
Attaches the surjective interface for vertex mapping.
Definition i_coupling_bridge.h:127
virtual void communicate(number time)=0
Synchronizes data from the primary domain to the submodule.
Abstract base class for independent sub-solvers (e.g., 1D St. Venant).
Definition i_coupling_bridge.h:64
virtual ~ISubmodule()=default
virtual void run(number tStart, number tEnd, number dt)=0
Executes the submodule's internal solver for the given time interval.
SmartPtr< TGridFunction > m_u
The internal state of the submodule.
Definition i_coupling_bridge.h:78
Interface for mapping vertices between a subdomain and the primary domain.
Definition i_coupling_bridge.h:40
virtual Vertex * subdom_to_dom(Vertex *subdom_vertex) const =0
Maps a vertex from the subdomain to its counterpart in the primary domain.
virtual ~ISurjectiveInterface()=default
virtual std::vector< Vertex * > dom_to_subdom(Vertex *dom_vertex) const =0
Maps a vertex from the primary domain to all corresponding vertices in the subdomain.
ISurjectiveInterface()=default