Skip to content

Commit

Permalink
Merge branch 'main' into to_dense
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisrichardson authored Aug 28, 2024
2 parents dbbbb05 + 9ca6d60 commit acc536e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions python/dolfinx/fem/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def form(
dtype: npt.DTypeLike = default_scalar_type,
form_compiler_options: typing.Optional[dict] = None,
jit_options: typing.Optional[dict] = None,
entity_maps: dict[Mesh, np.typing.NDArray[np.int32]] = {},
entity_maps: typing.Optional[dict[Mesh, np.typing.NDArray[np.int32]]] = None,
):
"""Create a Form or an array of Forms.
Expand Down Expand Up @@ -282,7 +282,10 @@ def _form(form):
for (key, subdomain_data) in sd.get(domain).items()
}

_entity_maps = {msh._cpp_object: emap for (msh, emap) in entity_maps.items()}
if entity_maps is None:
_entity_maps = dict()
else:
_entity_maps = {msh._cpp_object: emap for (msh, emap) in entity_maps.items()}

f = ftype(
module.ffi.cast("uintptr_t", module.ffi.addressof(ufcx_form)),
Expand Down
3 changes: 2 additions & 1 deletion python/dolfinx/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ def refine(
mesh1 = _cpp.refinement.refine(mesh._cpp_object, redistribute)
else:
mesh1 = _cpp.refinement.refine(mesh._cpp_object, edges, redistribute)
return Mesh(mesh1, mesh._ufl_domain)
ufl_domain = ufl.Mesh(mesh._ufl_domain.ufl_coordinate_element()) # type: ignore
return Mesh(mesh1, ufl_domain)


def refine_interval(
Expand Down

0 comments on commit acc536e

Please sign in to comment.