Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ conda install -c conda-forge dolfinx-adjoint
To install the latest development version directly from the repository, use:

```bash
python3 -m pip install git+[https://github.com/scientificcomputing/dolfinx-adjoint.git](https://github.com/scientificcomputing/dolfinx-adjoint.git)
python3 -m pip install git+https://github.com/scientificcomputing/dolfinx-adjoint.git
```

If you plan to actively modify the code, clone the repository and install the optional dependencies for testing, development, and documentation generation:

```bash
git clone [https://github.com/scientificcomputing/dolfinx-adjoint.git](https://github.com/scientificcomputing/dolfinx-adjoint.git)
git clone https://github.com/scientificcomputing/dolfinx-adjoint.git
cd dolfinx-adjoint
python3 -m pip install -e ".[all]"
```
Expand Down
4 changes: 2 additions & 2 deletions demos/poisson_mother.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def refinement_region(x, tol=1e-14):
# the `dolfinx.fem.petsc.LinearProblem` class.
#
# ```{note}
# When creating the :py:func:`dolfinx_adjoint.LinearProblem`, we can specify the solver options that
# When creating the :py:class:`dolfinx_adjoint.LinearProblem`, we can specify the solver options that
# are passed on to the underlying PETSc Krylov subspace solver.
# This is also the place to pass in solver options for the first and second order adjoint equations
# and the tangent linear model (TLM) equation.
Expand All @@ -182,7 +182,7 @@ def refinement_region(x, tol=1e-14):

# ```{note}
# Note that we can pass in solver options for the adjoint equation via the keyword argument
# `adjoint_petsc_options`. As we a solving a linear, symmetric problem, i,e, a self-adjoint problem,
# `adjoint_petsc_options`. As we are solving a linear, symmetric problem, i.e. a self-adjoint problem,
# we use the same options for both the forward and adjoint problems.
# ```

Expand Down
8 changes: 4 additions & 4 deletions src/dolfinx_adjoint/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ def error_norm(
u_ex: ufl.core.expr.Expr,
u: ufl.core.expr.Expr,
norm_type=typing.Literal["L2", "H1"],
jit_options: typing.Optional[dict] = None,
form_compiler_options: typing.Optional[dict] = None,
entity_map: typing.Optional[dict[dolfinx.mesh.Mesh, npt.NDArray[numpy.int32]]] = None,
ad_block_tag: typing.Optional[str] = None,
jit_options: dict | None = None,
form_compiler_options: dict | None = None,
entity_map: dict[dolfinx.mesh.Mesh, npt.NDArray[numpy.int32]] | None = None,
ad_block_tag: str | None = None,
annotate: bool = True,
) -> float:
"""Compute the error norm between the exact solution and the computed solution.
Expand Down
18 changes: 9 additions & 9 deletions src/dolfinx_adjoint/blocks/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


def assemble_compiled_form(
form: dolfinx.fem.Form, tensor: typing.Optional[typing.Union[dolfinx.la.Vector, _SpecialVector | float]] = None
form: dolfinx.fem.Form, tensor: typing.Union[dolfinx.la.Vector, _SpecialVector | float] | None = None
) -> typing.Union[dolfinx.la.Vector, _SpecialVector, float]:
"""Assemble a compiled form and optionally apply Dirichlet boundary condition.

Expand Down Expand Up @@ -54,10 +54,10 @@ class AssembleBlock(Block):
def __init__(
self,
form: ufl.Form,
ad_block_tag: typing.Optional[str] = None,
jit_options: typing.Optional[dict] = None,
form_compiler_options: typing.Optional[dict] = None,
entity_maps: typing.Optional[typing.Sequence[dolfinx.mesh.EntityMap]] = None,
ad_block_tag: str | None = None,
jit_options: dict | None = None,
form_compiler_options: dict | None = None,
entity_maps: typing.Sequence[dolfinx.mesh.EntityMap] | None = None,
):
super(AssembleBlock, self).__init__(ad_block_tag=ad_block_tag)

Expand Down Expand Up @@ -87,10 +87,10 @@ def compute_action_adjoint(
self,
adj_input: typing.Union[float, dolfinx.la.Vector],
arity_form: int,
form: typing.Optional[ufl.Form] = None,
c_rep: typing.Optional[typing.Union[ufl.Coefficient, ufl.Constant]] = None,
space: typing.Optional[dolfinx.fem.FunctionSpace] = None,
dform: typing.Optional[dolfinx.fem.Form] = None,
form: ufl.Form | None = None,
c_rep: typing.Union[ufl.Coefficient, ufl.Constant] | None = None,
space: dolfinx.fem.FunctionSpace | None = None,
dform: dolfinx.fem.Form | None = None,
):
"""This computes the action of the adjoint of the derivative of `form` wrt `c_rep` on `adj_input`.

Expand Down
2 changes: 1 addition & 1 deletion src/dolfinx_adjoint/blocks/function_assigner.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(
self,
other: np.inexact | int | float | _Function | ufl.core.expr.Expr,
func: _Function,
ad_block_tag: typing.Optional[str] = None,
ad_block_tag: str | None = None,
):
super().__init__(ad_block_tag=ad_block_tag)

Expand Down
Loading