hippylibX.modeling package

Submodules

hippylibX.modeling.PDEProblem module

class hippylibX.modeling.PDEProblem.PDEVariationalProblem(Vh: list, varf_handler, bc=[], bc0=[], is_fwd_linear=False)[source]

Bases: object

_createLUSolver() petsc4py.PETSc.KSP[source]
apply_ij(i: int, j: int, dir: dolfinx.la.Vector, out: dolfinx.la.Vector) None[source]

Given \(u, m, p\); compute \(\delta_{ij} F(u, m, p; \hat{i}, \tilde{j})\) in the direction \(\tilde{j} =\) disr, \(\forall \hat{i}\).

evalGradientParameter(x: list, out: dolfinx.la.Vector) None[source]

Given \(u, m, p\); evaluate \(\delta_m F(u, m, p; \hat{m}),\, \forall \hat{m}.\)

generate_parameter() dolfinx.la.Vector[source]

Return a vector in the shape of the parameter.

generate_state() dolfinx.la.Vector[source]

Return a vector in the shape of the state.

setLinearizationPoint(x: list, gauss_newton_approx) None[source]

Set the values of the state and parameter for the incremental forward and adjoint solvers.

solveAdj(adj: dolfinx.la.Vector, x: dolfinx.la.Vector, adj_rhs: dolfinx.la.Vector) None[source]

Solve the linear adjoint problem: Given \(m, u\); find \(p\) such that .. math:: delta_u F(u, m, p;hat{u}) = 0, quad forall hat{u}.

solveFwd(state: dolfinx.la.Vector, x: list) None[source]

Solve the possibly nonlinear forward problem: Given \(m\), find \(u\) such that

\[\delta_p F(u, m, p;\hat{p}) = 0,\quad \forall \hat{p}.\]
solveIncremental(out: dolfinx.la.Vector, rhs: dolfinx.la.Vector, is_adj: bool) None[source]

If is_adj == False:

Solve the forward incremental system: Given \(u, m\), find \(\tilde{u}\) such that

\[\delta_{pu} F(u, m, p; \hat{p}, \tilde{u}) = \mbox{rhs},\quad \forall \hat{p}.\]

If is_adj == True:

Solve the adjoint incremental system: Given \(u, m\), find \(\tilde{p}\) such that

\[\delta_{up} F(u, m, p; \hat{u}, \tilde{p}) = \mbox{rhs},\quad \forall \hat{u}.\]
hippylibX.modeling.PDEProblem.unused_function(func)[source]

hippylibX.modeling.laplaceApproximation module

hippylibX.modeling.misfit module

class hippylibX.modeling.misfit.DiscreteStateObservationMisfit(B: petsc4py.PETSc.Mat, d: petsc4py.PETSc.Mat, sigma2: float)[source]

Bases: object

This class define a misfit function for a discrete linear observation operator B math: 1/(2sigma^2) || B u - d ||^2

Constructor: B is the observation operator d is the data sigma2 is the variance of the noise

apply_ij(i: int, j: int, dir: dolfinx.la.Vector, out: dolfinx.la.Vector) None[source]

Apply the second variation \(\delta_{ij}\) (i,j = STATE,PARAMETER) of the cost in direction dir.

cost(x: list) float[source]
grad(i: int, x: list, out: dolfinx.la.Vector) None[source]
setLinearizationPoint(x: list, gauss_newton_approx=False) None[source]
class hippylibX.modeling.misfit.NonGaussianContinuousMisfit(Vh: list, form, bc0=[])[source]

Bases: object

Abstract class to model the misfit component of the cost functional. In the following x will denote the variable [u, m, p], denoting respectively the state u, the parameter m, and the adjoint variable p.

The methods in the class misfit will usually access the state u and possibly the parameter m. The adjoint variables will never be accessed.

apply_ij(i: int, j: int, dir: dolfinx.la.Vector, out: dolfinx.la.Vector) None[source]

Apply the second variation \(\delta_{ij}\) (i,j = STATE,PARAMETER) of the cost in direction dir.

cost(x: list) float[source]

Given x evaluate the cost functional. Only the state u and (possibly) the parameter m are accessed.

grad(i: int, x: list, out: dolfinx.la.Vector) None[source]

Given the state and the paramter in x, compute the partial gradient of the misfit functional in with respect to the state (i == STATE) or with respect to the parameter (i == PARAMETER).

setLinearizationPoint(x: list, gauss_newton_approx=False) None[source]

hippylibX.modeling.model module

hippylibX.modeling.modelVerify module

hippylibX.modeling.prior module

hippylibX.modeling.reducedHessian module

hippylibX.modeling.Regularization module

hippylibX.modeling.variables module

Enumerator for the variables of the inverse problem: - the STATE, PARAMETER, and ADJOINT variables.

Module contents