Skip to content

Commit

Permalink
Revert 0.8 API changes for release
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgensd committed Feb 7, 2024
1 parent 3775416 commit 50472fc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ requires = ["setuptools>=61.0.0", "wheel"]

[project]
name = "adios4dolfinx"
version = "0.8.0.dev0"
version = "0.7.2"
description = "Wrappers for reading/writing DOLFINx meshes/functions with ADIOS2"
authors = [{ name = "Jørgen S. Dokken", email = "[email protected]" }]
license = { file = "LICENSE" }
readme = "README.md"
dependencies = ["fenics-dolfinx>=0.8.0.dev0"]
dependencies = ["fenics-dolfinx>=0.7.0"]

[project.optional-dependencies]
test = ["pytest", "coverage"]
Expand Down
9 changes: 4 additions & 5 deletions src/adios4dolfinx/checkpointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def write_mesh(mesh: dolfinx.mesh.Mesh, filename: Path, engine: str = "BP4"):
io.DefineAttribute("CellType", mesh.topology.cell_name())

# Write basix properties
cmap = mesh.geometry.cmap
cmap = mesh.geometry.cmaps[0]
io.DefineAttribute("Degree", np.array([cmap.degree], dtype=np.int32))
io.DefineAttribute("LagrangeVariant", np.array([cmap.variant], dtype=np.int32))

Expand Down Expand Up @@ -177,7 +177,7 @@ def write_meshtags(filename: Union[Path, str], mesh: dolfinx.mesh.Mesh, meshtags
local_start = mesh.comm.exscan(num_saved_tag_entities, op=MPI.SUM)
local_start = local_start if mesh.comm.rank != 0 else 0
global_num_tag_entities = mesh.comm.allreduce(num_saved_tag_entities, op=MPI.SUM)
dof_layout = mesh.geometry.cmap.create_dof_layout()
dof_layout = mesh.geometry.cmaps[0].create_dof_layout()
num_dofs_per_entity = dof_layout.num_entity_closure_dofs(dim)

entities_to_geometry = dolfinx.cpp.mesh.entities_to_geometry(
Expand Down Expand Up @@ -388,10 +388,10 @@ def read_function(u: dolfinx.fem.Function, filename: Path, engine: str = "BP4",
start, end = input_dofmap.offsets[l_cell:l_cell+2]
# FIXME: Tempoary cast uint32 to integer as transformations doesn't support uint32 with the switch
# to nanobind
element.pre_apply_transpose_dof_transformation(
element.apply_transpose_dof_transformation(
recv_array[int(start):int(end)], int(input_perms[l_cell]), bs
)
element.pre_apply_inverse_transpose_dof_transformation(
element.apply_inverse_transpose_dof_transformation(
recv_array[int(start):int(end)], int(inc_perms[i]), bs
)
# ------------------Step 6----------------------------------------
Expand Down Expand Up @@ -498,7 +498,6 @@ def read_mesh(
basix.LagrangeVariant(int(lvar)),
shape=(mesh_geometry.shape[1],),
gdim=mesh_geometry.shape[1],
dtype=mesh_geometry.dtype,
)
domain = ufl.Mesh(element)
partitioner = dolfinx.cpp.mesh.create_cell_partitioner(ghost_mode)
Expand Down
2 changes: 1 addition & 1 deletion tests/create_legacy_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from importlib.metadata import version

a4d_version = version("adios4dolfinx")
assert a4d_version < "0.8.0", f"Creating a legacy checkpoint requires adios4dolfinx < 0.8.0, you have {a4d_version}."
assert a4d_version < "0.7.2", f"Creating a legacy checkpoint requires adios4dolfinx < 0.7.2, you have {a4d_version}."


def f(x):
Expand Down
6 changes: 2 additions & 4 deletions tests/test_checkpointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ def test_read_write_P_2D(read_comm, family, degree, complex, mesh_2D):
degree,
basix.LagrangeVariant.gll_warped,
gdim=mesh.geometry.dim,
shape=(mesh.geometry.dim, ),
dtype=mesh.geometry.x.dtype)
shape=(mesh.geometry.dim, ))

def f(x):
values = np.empty((2, x.shape[1]), dtype=f_dtype)
Expand Down Expand Up @@ -101,8 +100,7 @@ def test_read_write_P_2D_time(read_comm, family, degree, complex, mesh_2D):
degree,
basix.LagrangeVariant.gll_warped,
gdim=mesh.geometry.dim,
shape=(mesh.geometry.dim, ),
dtype=mesh.geometry.x.dtype)
shape=(mesh.geometry.dim, ))

def f0(x):
values = np.empty((2, x.shape[1]), dtype=f_dtype)
Expand Down

0 comments on commit 50472fc

Please sign in to comment.