diff --git a/include/multiblock_solver.hpp b/include/multiblock_solver.hpp index b1f6d2e0..8c9b98b2 100644 --- a/include/multiblock_solver.hpp +++ b/include/multiblock_solver.hpp @@ -137,6 +137,8 @@ friend class ParameterizedProblem; BlockVector* GetSolution() { return U; } BlockVector* GetSolutionCopy() { return new BlockVector(*U); } + void SetSolutionSaveMode(const bool save_sol_); + void GetVariableVector(const int &var_idx, BlockVector &global, BlockVector &var); void SetVariableVector(const int &var_idx, BlockVector &var, BlockVector &global); diff --git a/src/advdiff_solver.cpp b/src/advdiff_solver.cpp index 57ca4245..242d87f5 100644 --- a/src/advdiff_solver.cpp +++ b/src/advdiff_solver.cpp @@ -241,6 +241,7 @@ void AdvDiffSolver::GetFlowField(ParameterizedProblem *flow_problem) stokes_solver = new StokesSolver; stokes_solver->InitVariables(); + stokes_solver->SetSolutionSaveMode(save_flow); if (load_flow && FileExists(flow_file)) stokes_solver->LoadSolution(flow_file); diff --git a/src/multiblock_solver.cpp b/src/multiblock_solver.cpp index daa06802..c0f07553 100644 --- a/src/multiblock_solver.cpp +++ b/src/multiblock_solver.cpp @@ -125,7 +125,13 @@ void MultiBlockSolver::ParseInputs() train_mode = SetTrainMode(); // save solution if single run. - save_sol = config.GetOption("save_solution/enabled", false); + SetSolutionSaveMode(config.GetOption("save_solution/enabled", false)); +} + +void MultiBlockSolver::SetSolutionSaveMode(const bool save_sol_) +{ + // save solution if single run. + save_sol = save_sol_; if (save_sol) { // Default file path if no input file name is provided.