PDEProblem
The PDEProblem class encapsulates the problem definition for a partial differential equation (PDE) in the context of the HPS method. It includes the domain, source term, and coefficients for the differential operator.
One important argument when creating a PDEProblem is the boolean argument use_ItI. If this argument is set to True, the solver will use the Impedance-to-Impedance version of the HPS method, which was designed for Helmholtz-like problems where DtN matrices may be ill-conditioned. Importantly, when using the ItI version, the implicit assumption is that the PDE is of the form:
Note this is a Robin boundary condition with parameter \(\eta\). So, when using the ItI version of the code, one must remember to specify Robin boundary data when calling jaxhps.solve() or jaxhps.down_pass.down_pass_uniform_2D_ItI(). This is in contrast to the DtN version of the HPS method, specified by use_ItI=False, which assumes a Dirichlet boundary condition on the boundary of the domain.
The PDEProblem class has two utility functions, jaxhps.PDEProblem.reset() and jaxhps.PDEProblem.update_coefficients(), which are meant to be used for cases such as inverse problems, where a sequence of PDE on the same domian must be solved iteratively, each time with slightly different coefficients.
Note
When initializing the PDEProblem class, the source argument is optional. This is because the jaxhps.build_solver() routine for 2D uniform problems is implemented to build the solver for an arbitrary source term. In this case, jaxhps.solve() performs an upward pass to compute a particular solution given a new source term, and then a downward pass to compute the homogeneous solution.
If source is specified when initializing the PDEProblem instance, the jaxhps.build_solver() routine will only build a solver for that particular source term.
- class jaxhps.PDEProblem(domain: Domain, source: Array = None, D_xx_coefficients: Array = None, D_xy_coefficients: Array = None, D_xz_coefficients: Array = None, D_yy_coefficients: Array = None, D_yz_coefficients: Array = None, D_zz_coefficients: Array = None, D_x_coefficients: Array = None, D_y_coefficients: Array = None, D_z_coefficients: Array = None, I_coefficients: Array = None, use_ItI: bool = False, eta: float = None)
-
- D_xx_coefficients: Array | None
Coefficient array with shape (n_leaves, p^d).
- D_xy_coefficients: Array | None
Coefficient array with shape (n_leaves, p^d).
- D_xz_coefficients: Array | None
Coefficient array with shape (n_leaves, p^d).
- D_yy_coefficients: Array | None
Coefficient array with shape (n_leaves, p^d).
- D_yz_coefficients: Array | None
Coefficient array with shape (n_leaves, p^d).
- D_zz_coefficients: Array | None
Coefficient array with shape (n_leaves, p^d).
- D_x_coefficients: Array | None
Coefficient array with shape (n_leaves, p^d).
- D_y_coefficients: Array | None
Coefficient array with shape (n_leaves, p^d).
- D_z_coefficients: Array | None
Coefficient array with shape (n_leaves, p^d).
- I_coefficients: Array | None
Coefficient array with shape (n_leaves, p^d).
- source: Array | None
Source function array with shape (n_leaves, p^d).
- use_ItI: bool
Whether to use ItI merges.
- eta: float | None
Parameter for ItI matrices and Robin boundary condition.
- Y: Array
(jax.Array) Stores pre-computed interior solution operators.
- v: Array
(jax.Array) Stores pre-computed interior particular solutions.
- S_lst: List[Array]
(jax.Array) Stores pre-computed propagation operators when performing uniform merges.
- g_tilde_lst: List[Array]
(jax.Array) Stores pre-computed incoming data along merge interfaces when performing uniform merges.
- D_inv_lst: List[Array]
(jax.Array) Stores pre-computed operators for the upward pass.
- BD_inv_lst: List[Array]
(jax.Array) Stores pre-computed BD^{-1} operators for the upward pass.
- Phi: Array
(jax.Array) Stores pre-computed particular solution operators.
- reset() None
Resets the stored solution operators.
- update_coefficients(source: Array = None, D_xx_coefficients: Array = None, D_xy_coefficients: Array = None, D_xz_coefficients: Array = None, D_yy_coefficients: Array = None, D_yz_coefficients: Array = None, D_zz_coefficients: Array = None, D_x_coefficients: Array = None, D_y_coefficients: Array = None, D_z_coefficients: Array = None, I_coefficients: Array = None) None
This function can be used to update the coefficients of the PDEProblem. When this function is called, it resets the stored solution operators.
- Parameters:
source (jax.Array, optional) – If specified, will replace the current source. Defaults to None.
D_xx_coefficients (jax.Array, optional) – If specified, will replace the current D_xx_coefficients. Defaults to None.
D_xy_coefficients (jax.Array, optional) – If specified, will replace the current D_xy_coefficients. Defaults to None.
D_xz_coefficients (jax.Array, optional) – If specified, will replace the current D_xz_coefficients. Defaults to None.
D_yy_coefficients (jax.Array, optional) – If specified, will replace the current D_yy_coefficients. Defaults to None.
D_yz_coefficients (jax.Array, optional) – If specified, will replace the current D_yz_coefficients. Defaults to None.
D_zz_coefficients (jax.Array, optional) – If specified, will replace the current D_zz_coefficients. Defaults to None.
D_x_coefficients (jax.Array, optional) – If specified, will replace the current D_x_coefficients. Defaults to None.
D_y_coefficients (jax.Array, optional) – If specified, will replace the current D_y_coefficients. Defaults to None.
D_z_coefficients (jax.Array, optional) – If specified, will replace the current D_z_coefficients. Defaults to None.
I_coefficients (jax.Array, optional) – If specified, will replace the current I_coefficients. Defaults to None.