Smith  0.1
Smith is an implicit thermal structural mechanics simulation code.
Classes | Public Member Functions | List of all members
smith::SystemSolver Class Reference

Orchestrates staggered solution for multiphysics systems. More...

#include <system_solver.hpp>

Classes

struct  Stage
 Represents a single stage in a staggered iteration. More...
 

Public Member Functions

 SystemSolver (std::shared_ptr< NonlinearBlockSolverBase > single_solver)
 Construct a monolithic SystemSolver from a single block solver. More...
 
 SystemSolver (int max_staggered_iterations, bool exact_staggered_steps=false)
 Construct a SystemSolver for staggered iteration. More...
 
void addSubsystemSolver (const std::vector< size_t > &block_indices, std::shared_ptr< NonlinearBlockSolverBase > solver, double relaxation_factor=1.0)
 Convenience method to add a solver stage. More...
 
void appendStagesWithBlockMapping (const SystemSolver &subsystem_solver, const std::vector< size_t > &global_block_indices)
 Append stages from another solver using a local-to-global block mapping. More...
 
std::vector< FieldStatesolve (const std::vector< WeakForm * > &residual_evals, const std::vector< std::vector< size_t >> &block_indices, const FieldState &shape_disp, const std::vector< std::vector< FieldState >> &states, const std::vector< std::vector< FieldState >> &params, const TimeInfo &time_info, const std::vector< const BoundaryConditionManager * > &bc_managers) const
 Solves the multiphysics system using staggered iterations. More...
 
std::shared_ptr< SystemSolversingleBlockSolver (size_t block_index) const
 Build a single-block solver from the stage responsible for block_index. Prefers constructing a fresh solver instance when the underlying stage solver retains rebuildable config.
 
int maxStaggeredIterations () const
 Maximum number of staggered sweeps allowed for this solver.
 
bool exactStaggeredSteps () const
 Whether solver always performs exactly maxStaggeredIterations() sweeps.
 

Detailed Description

Orchestrates staggered solution for multiphysics systems.

Definition at line 23 of file system_solver.hpp.

Constructor & Destructor Documentation

◆ SystemSolver() [1/2]

smith::SystemSolver::SystemSolver ( std::shared_ptr< NonlinearBlockSolverBase single_solver)

Construct a monolithic SystemSolver from a single block solver.

Parameters
single_solverThe solver to use for all blocks simultaneously.

Definition at line 23 of file system_solver.cpp.

◆ SystemSolver() [2/2]

smith::SystemSolver::SystemSolver ( int  max_staggered_iterations,
bool  exact_staggered_steps = false 
)

Construct a SystemSolver for staggered iteration.

Parameters
max_staggered_iterationsMaximum number of staggered sweeps across all stages. When exact_staggered_steps is false, the solver may exit early once all stage solvers report convergence.
exact_staggered_stepsIf true, always perform exactly max_staggered_iterations sweeps with no early-exit convergence check. Useful when a fixed number of partitioned-stagger steps is required regardless of residual level.

Definition at line 29 of file system_solver.cpp.

Member Function Documentation

◆ addSubsystemSolver()

void smith::SystemSolver::addSubsystemSolver ( const std::vector< size_t > &  block_indices,
std::shared_ptr< NonlinearBlockSolverBase solver,
double  relaxation_factor = 1.0 
)

Convenience method to add a solver stage.

Parameters
block_indicesIndices of the blocks to solve.
solverNonlinear block solver for this stage.
relaxation_factorPer-stage relaxation factor in (0, 1].

Definition at line 35 of file system_solver.cpp.

◆ appendStagesWithBlockMapping()

void smith::SystemSolver::appendStagesWithBlockMapping ( const SystemSolver subsystem_solver,
const std::vector< size_t > &  global_block_indices 
)

Append stages from another solver using a local-to-global block mapping.

Parameters
subsystem_solverSource solver whose stages operate on subsystem-local block indices.
global_block_indicesMapping from subsystem-local block index to global block index.

Definition at line 45 of file system_solver.cpp.

◆ solve()

std::vector< FieldState > smith::SystemSolver::solve ( const std::vector< WeakForm * > &  residual_evals,
const std::vector< std::vector< size_t >> &  block_indices,
const FieldState shape_disp,
const std::vector< std::vector< FieldState >> &  states,
const std::vector< std::vector< FieldState >> &  params,
const TimeInfo time_info,
const std::vector< const BoundaryConditionManager * > &  bc_managers 
) const

Solves the multiphysics system using staggered iterations.

Parameters
residual_evalsVector of WeakForm evaluations for each block.
block_indicesBlock indices for each residual evaluation.
shape_dispCurrent shape displacement.
statesNested vector of field states.
paramsNested vector of parameters.
time_infoCurrent time information.
bc_managersManagers for boundary conditions.
Returns
Updated field states.

Definition at line 67 of file system_solver.cpp.


The documentation for this class was generated from the following files: