diff --git a/src/dolfinx_adjoint/blocks/_vector.py b/src/dolfinx_adjoint/blocks/_vector.py index d7e9177..e9645c4 100644 --- a/src/dolfinx_adjoint/blocks/_vector.py +++ b/src/dolfinx_adjoint/blocks/_vector.py @@ -41,6 +41,15 @@ def _vector( Returns: A distributed vector. """ + vtype: ( + type[dolfinx.cpp.la.Vector_float32] + | type[dolfinx.cpp.la.Vector_float64] + | type[dolfinx.cpp.la.Vector_complex64] + | type[dolfinx.cpp.la.Vector_complex128] + | type[dolfinx.cpp.la.Vector_int8] + | type[dolfinx.cpp.la.Vector_int32] + | type[dolfinx.cpp.la.Vector_int64] + ) if np.issubdtype(dtype, np.float32): vtype = dolfinx.cpp.la.Vector_float32 elif np.issubdtype(dtype, np.float64): diff --git a/src/dolfinx_adjoint/types/function.py b/src/dolfinx_adjoint/types/function.py index 15b0d7e..8168012 100644 --- a/src/dolfinx_adjoint/types/function.py +++ b/src/dolfinx_adjoint/types/function.py @@ -89,7 +89,7 @@ def _ad_dot(self, other: typing.Self, options: typing.Optional[dict] = None): options = {} if options is None else options riesz_representation = options.get("riesz_representation", "l2") if riesz_representation == "l2": - return dolfinx.cpp.la.inner_product(self.x._cpp_object, other.x._cpp_object) + return dolfinx.cpp.la.inner_product(self.x._cpp_object, other.x._cpp_object) # type: ignore[arg-type] elif riesz_representation == "L2": form_compiler_options = options.get("form_compiler_options", None) jit_options = options.get("jit_options", None) diff --git a/tests/test_poisson_mother.py b/tests/test_poisson_mother.py index ee465f4..6aa0892 100644 --- a/tests/test_poisson_mother.py +++ b/tests/test_poisson_mother.py @@ -136,8 +136,8 @@ def reference_solution( J_org = mesh.comm.allreduce(dolfinx.fem.assemble_scalar(dolfinx.fem.form(J_compiled)), op=MPI.SUM) steps = [step_length * (1 / 2) ** i for i in range(num_steps)] - dJac_dm = dolfinx.cpp.la.inner_product(Jac_vec._cpp_object, dm.x._cpp_object) - Hm_dm = dolfinx.cpp.la.inner_product(Hm_vec._cpp_object, dm.x._cpp_object) + dJac_dm = dolfinx.cpp.la.inner_product(Jac_vec._cpp_object, dm.x._cpp_object) # type: ignore[arg-type] + Hm_dm = dolfinx.cpp.la.inner_product(Hm_vec._cpp_object, dm.x._cpp_object) # type: ignore[arg-type] errors = [] errors_der = []