boundary_conditions#
Includes both abstract and concrete boundary condition classes.
Modules:
-
boundary_system–Includes abstract boundary condition classes.
-
lyapunov–Includes both abstract and concrete Lyapunov solver classes.
-
obc–Includes both abstract and concrete open boundary condition solver classes.
-
system_reduction–Includes abstract classes for reducing the boundary system to a smaller system.
Classes:
-
BaseBoundarySystem–Abstract base class to solve boundary systems with memoization and system reduction.
BaseBoundarySystem
#
BaseBoundarySystem(boundary_solver, cache_compressor: None = None, system_reducer: SystemReducer | None = None, num_ref_iterations: int = 2, relative_tol: float = 0.2, absolute_tol: float = 1e-06, warning_threshold: float = 0.1, memoization_mode: str = 'auto', agreement_threshold: float = 0.999)
Bases: ABC
Abstract base class to solve boundary systems with memoization and system reduction.
Parameters:
-
boundary_solver(callable) –The boundary system solver to be memoized.
-
cache_compressor(object, default:None) –An object with 'compress' and 'decompress' methods to handle cache compression. If None, no compression is applied.
-
num_ref_iterations(int, default:2) –The number of fixed-point iterations to refine the solution. Default is 2.
-
relative_tol(float, default:0.2) –The relative tolerance for convergence. Default is 0.2.
-
absolute_tol(float, default:1e-06) –The absolute tolerance for convergence. Default is 1e-6.
-
warning_threshold(float, default:0.1) –The threshold for issuing a warning about high residuals. Default is 0.1.
-
memoization_mode(str, default:'auto') –The memoization mode. Can be 'off', 'auto', 'force-after-first', or 'force'. Default is 'auto'.
-
agreement_threshold(float, default:0.999) –The threshold for agreement across MPI ranks to consider a memoized solution valid. Default is 0.999.
Methods:
-
__call__–Solve the boundary system with memoization and system reduction.
__call__
#
__call__(boundary_system: tuple[NDArray, ...], contact: str, **kwargs) -> tuple[NDArray, NDArray, NDArray | tuple[NDArray, ...]]
Solve the boundary system with memoization and system reduction.
This is a wrapper around the boundary system solver
Parameters:
-
boundary_system(tuple[NDArray, ...]) –The boundary system to solve.
-
contact(str) –The contact to which the boundary system belongs.
-
**kwargs–Additional arguments to pass to the boundary system solver. Mostly for the injection vectors in case of OBCs / QTBM.
Returns:
-
solution(NDArray | tuple[NDArray, ...]) –The solution of the boundary system.
-
rel_residuals(NDArray) –The relative residuals of the solution.
-
abs_residuals(NDArray) –The absolute residuals of the solution.