pyopensn.solver.Solver
- class pyopensn.solver.Solver
Base class for all solvers.
Wrapper of
opensn::Solver.- Advance(self: pyopensn.solver.Solver) None
Advance the solver by one step.
Changes made to the problem since the last step are checked as in
Execute.Initializemust be called first. Solver classes that do not implement stepping leave the state unchanged and log thatAdvanceis unsupported.For MPI transport solvers, this is a collective operation and must be called on all ranks.
- Execute(self: pyopensn.solver.Solver) None
Execute the solver.
The problem’s current state and the solver’s requirements are checked first, so changes made to the problem after
Initialize(for example a mode switch orSetXSMap) are validated before they are used.Initializemust be called beforeExecute.For MPI transport solvers, this is a collective operation and must be called on all ranks.
- Initialize(self: pyopensn.solver.Solver) None
Initialize the solver.
Solvers check that the problem is in a supported state (for example, steady-state mode without external sources for the k-eigenvalue solvers) and raise
ValueErrorotherwise. Setup and post-setup validation must both succeed. CallingInitializeagain clears the previous initialized state first.For MPI transport solvers, this is a collective operation and must be called on all ranks.