pde_opt.utils

This module contains general utility functions.

Functions

check_equation_solver_compatibility(...)

Check that equation type has all required attributes specified by solver.

prepare_solver_params(solver_type, ...)

Prepare solver parameters by extracting required equation attributes.

pde_opt.utils.check_equation_solver_compatibility(solver_type, equation_type)[source]

Check that equation type has all required attributes specified by solver.

This is a check to ensure that the equation and solver are compatible.

Raises:

ValueError – If equation is missing any required attributes from solver.

pde_opt.utils.prepare_solver_params(solver_type, solver_parameters, equation)[source]

Prepare solver parameters by extracting required equation attributes.

Some solvers require attributes from the equation to be passed to them. This function prepares the solver parameters by extracting the required attributes from the equation.

Parameters:
  • solver_parameters (Dict[str, Any]) – The solver parameters to use for the equation

  • equation (BaseEquation) – The equation to solve

Returns:

The prepared solver parameters

Return type:

Dict[str, Any]