Skip to content

obc#

Includes classes for the open boundary system, solver and system reduction.

Classes:

  • OBCSolver –

    Abstract base class for the open-boundary condition solver.

  • OBCSystem –

    An obc system solver with memoization and system reduction.

OBCSolver #

Bases: ABC

Abstract base class for the open-boundary condition solver.

The recursion relation for the surface Green's function is given by:

\[ x_{ii} = (a_{ii} - a_{ji} x_{ii} a_{ij})^{-1} \]

Methods:

  • __call__ –

    Returns the surface Green's function.

__call__ abstractmethod #

__call__(a_xx: tuple[NDArray, ...], contact: str) -> NDArray

Returns the surface Green's function.

Parameters:

  • a_xx (tuple[NDArray, ...]) –

    The boundary blocks of the system matrix.

  • contact (str) –

    The contact to which the boundary blocks belong.

Returns:

  • x_ii ( NDArray ) –

    The system's surface Green's function.

OBCSystem #

OBCSystem(boundary_solver: OBCSolver, 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: BaseBoundarySystem

An obc system solver with memoization and system reduction.

Parameters:

  • boundary_solver (OBCSolver) –

    The obc 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.