evoxels.solvers

Classes

BaseSolver(vf, fieldnames, backend[, ...])

Generic wrapper for solving one or more fields with a time stepper.

SteadyStatePseudoTimeSolver(vf, fieldnames, ...)

Solver for steady-state problems.

TimeDependentSolver(vf, fieldnames, backend)

Solver for time-dependent problems.

class evoxels.solvers.BaseSolver(vf: Any, fieldnames: str | list[str], backend: str, problem_cls: Type[ODE] | None = None, timestepper_cls: Type[TimeStepper] | None = None, step_fn: Callable | None = None, device: str = 'cuda')

Generic wrapper for solving one or more fields with a time stepper.

__init__(vf: Any, fieldnames: str | list[str], backend: str, problem_cls: Type[ODE] | None = None, timestepper_cls: Type[TimeStepper] | None = None, step_fn: Callable | None = None, device: str = 'cuda') None
backend: str
device: str = 'cuda'
fieldnames: str | list[str]
problem_cls: Type[ODE] | None = None
solve(time_increment=0.1, frames=10, max_iters=100, problem_kwargs=None, jit=True, verbose=True, vtk_out=False, plot_bounds=None, colormap='viridis')

Run the time integration loop.

Parameters:
  • time_increment (float) – Size of a single time step.

  • frames (int) – Number of output frames (for plotting, vtk, checks).

  • max_iters (int) – Number of time steps to compute.

  • problem_kwargs (dict | None) – Problem-specific input arguments.

  • jit (bool) – Create just-in-time compiled kernel if True

  • verbose (bool | str) – If True prints memory stats, 'plot' updates an interactive plot.

  • vtk_out (bool) – Write VTK files for each frame if True.

  • plot_bounds (tuple | None) – Optional value range for plots.

step_fn: Callable | None = None
timestepper_cls: Type[TimeStepper] | None = None
vf: Any
class evoxels.solvers.SteadyStatePseudoTimeSolver(vf: Any, fieldnames: str | list[str], backend: str, problem_cls: Type[ODE] | None = None, timestepper_cls: Type[TimeStepper] | None = None, step_fn: Callable | None = None, device: str = 'cuda', conv_crit: float = 1e-06, check_freq: int = 10)

Solver for steady-state problems.

__init__(vf: Any, fieldnames: str | list[str], backend: str, problem_cls: Type[ODE] | None = None, timestepper_cls: Type[TimeStepper] | None = None, step_fn: Callable | None = None, device: str = 'cuda', conv_crit: float = 1e-06, check_freq: int = 10) None
check_convergence(diff, verbose)

Check for convergence based on relative change in fields.

check_freq: int = 10
conv_crit: float = 1e-06
class evoxels.solvers.TimeDependentSolver(vf: Any, fieldnames: str | list[str], backend: str, problem_cls: Type[ODE] | None = None, timestepper_cls: Type[TimeStepper] | None = None, step_fn: Callable | None = None, device: str = 'cuda')

Solver for time-dependent problems.

__init__(vf: Any, fieldnames: str | list[str], backend: str, problem_cls: Type[ODE] | None = None, timestepper_cls: Type[TimeStepper] | None = None, step_fn: Callable | None = None, device: str = 'cuda') None