4#ifndef ONEDSOLVER_INTERFACE_H
5#define ONEDSOLVER_INTERFACE_H
50 void initialize(
const std::string& input_file,
int& problem_id,
51 int& system_size,
const std::string& coupling_type);
77 void run_simulation(
int problem_id,
double current_time,
int save_incr,
78 const std::string& coupling_type,
double* params,
79 double* solution,
double& cpl_value,
char last_flag,
85 const std::string& coupling_type);
94 void* library_handle_ =
nullptr;
99 void (*initialize_1d_)(
const char*,
int&,
int&,
const char*) =
nullptr;
102 void (*set_external_step_size_1d_)(int, double) =
nullptr;
105 void (*return_1d_solution_)(int,
double*, int) =
nullptr;
108 void (*update_1d_solution_)(int,
double*, int) =
nullptr;
111 void (*run_1d_simulation_step_1d_)(int, double, int,
const char*,
double*,
112 double*,
double&,
char*,
int&) =
nullptr;
116 void (*extract_coupled_dof_)(int,
int&,
char*) =
nullptr;
Wrapper class for dynamically loading and calling the 1D solver shared library.
Definition OneDSolverInterface.h:36
void load_library(const std::string &interface_lib)
Load the 1D solver shared library from the given path.
Definition OneDSolverInterface.cpp:20
void update_solution(int problem_id, double *solution, int size)
Push a solution vector into the 1D solver as the current state.
Definition OneDSolverInterface.cpp:107
void run_simulation(int problem_id, double current_time, int save_incr, const std::string &coupling_type, double *params, double *solution, double &cpl_value, char last_flag, int &error_code)
Advance the 1D solver by one time step.
Definition OneDSolverInterface.cpp:120
void extract_coupled_dof(int problem_id, int &coupled_dof, const std::string &coupling_type)
Retrieve the index within the solution vector that corresponds to the coupled boundary DOF.
Definition OneDSolverInterface.cpp:160
void return_solution(int problem_id, double *solution, int size)
Copy the current 1D solution into the caller-provided buffer.
Definition OneDSolverInterface.cpp:94
void initialize(const std::string &input_file, int &problem_id, int &system_size, const std::string &coupling_type)
Initialize the 1D solver from an input file.
Definition OneDSolverInterface.cpp:59
void set_external_step_size(int problem_id, double dt)
Synchronize the 1D solver's internal time step with the 3D solver.
Definition OneDSolverInterface.cpp:81