diff --git a/.github/workflows/ci_conda.yml b/.github/workflows/ci_conda.yml index 67b71db64..cc7917aef 100644 --- a/.github/workflows/ci_conda.yml +++ b/.github/workflows/ci_conda.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - dolfinx: ['0.9.0', '0.10.0'] + dolfinx: ['0.9.0', '0.10.0', '0.11.0'] steps: - name: Checkout code @@ -26,7 +26,7 @@ jobs: - name: Create Conda environment shell: bash -l {0} run: | - conda install -c conda-forge python pip fenics-dolfinx=${{ matrix.dolfinx }} scifem adios4dolfinx + conda install -c conda-forge python pip fenics-dolfinx=${{ matrix.dolfinx }} scifem io4dolfinx - name: Install local package and dependencies shell: bash -l {0} diff --git a/.github/workflows/ci_docker.yml b/.github/workflows/ci_docker.yml index 4dbf7bfd7..8ad4ec2e1 100644 --- a/.github/workflows/ci_docker.yml +++ b/.github/workflows/ci_docker.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - container_version: [v0.9.0, v0.10.0, nightly] + container_version: [v0.9.0, v0.10.0, v0.11.0, nightly] container: dolfinx/dolfinx:${{ matrix.container_version }} steps: - name: Checkout code @@ -23,9 +23,9 @@ jobs: python -m pip install scipy # needed in scifem, can be removed when scifem adds it to their dependencies python -m pip install .[test] - - name: Overload adios4dolfinx - if: ${{ matrix.container_version == 'nightly' }} - run: python3 -m pip install git+https://github.com/jorgensd/adios4dolfinx.git + - name: Overload io4dolfinx + # if: ${{ matrix.container_version == 'nightly' }} + run: python3 -m pip install git+https://github.com/scientificcomputing/io4dolfinx.git - name: Run tests run: | diff --git a/conda/recipe/meta.yaml b/conda/recipe/meta.yaml index 16abb7cb1..02e790304 100644 --- a/conda/recipe/meta.yaml +++ b/conda/recipe/meta.yaml @@ -27,7 +27,7 @@ requirements: - python >={{ python_min }} - fenics-dolfinx >=0.9,<=0.10 - scifem >=0.2.13 - - adios4dolfinx + - io4dolfinx - tqdm test: diff --git a/docs/environment.yml b/docs/environment.yml index d7785a9b7..4cb8c9e09 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -11,7 +11,7 @@ dependencies: - numpy==1.24 - tqdm - scifem>=0.2.8 - - adios4dolfinx + - io4dolfinx - sphinx-design - sphinxcontrib-bibtex - sympy diff --git a/pyproject.toml b/pyproject.toml index 50046b102..7a3da1d94 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ description = "Finite element simulations of hydrogen transport" readme = "README.md" requires-python = ">=3.9" license = "Apache-2.0" -dependencies = ["tqdm", "scifem>=0.2.13", "adios4dolfinx"] +dependencies = ["tqdm", "scifem>=0.2.13", "io4dolfinx"] classifiers = [ "Natural Language :: English", "Topic :: Scientific/Engineering", diff --git a/src/festim/exports/vtx.py b/src/festim/exports/vtx.py index 26e67f1f0..120c74cec 100644 --- a/src/festim/exports/vtx.py +++ b/src/festim/exports/vtx.py @@ -89,7 +89,7 @@ class VTXSpeciesExport(ExportBaseClass): field: Set of species to export subdomain: A field can be defined on multiple domains. This arguments specifies what subdomains we export on. If `None` we export on all domains. - checkpoint: If True, the export will be a checkpoint file using adios4dolfinx + checkpoint: If True, the export will be a checkpoint file using io4dolfinx and won't be readable by ParaView. Default is False. times: if provided, the field will be exported at these timesteps. Otherwise exports at all timesteps. Defaults to None. @@ -196,7 +196,7 @@ class CustomFieldExport(ExportBaseClass): subdomain: The volume subdomain on which the custom field is evaluated. Defaults to None. checkpoint: If True, the export will be a checkpoint file using - adios4dolfinx and won't be readable by ParaView. Default is False. + io4dolfinx and won't be readable by ParaView. Default is False. Attributes: filename: The name of the output file @@ -358,7 +358,7 @@ class ReactionRateExport(CustomFieldExport): subdomain: The volume subdomain on which the reaction rate is evaluated. Defaults to None. checkpoint: If True, the export will be a checkpoint file using - adios4dolfinx and won't be readable by ParaView. Default is False. + io4dolfinx and won't be readable by ParaView. Default is False. """ def __init__( diff --git a/src/festim/hydrogen_transport_problem.py b/src/festim/hydrogen_transport_problem.py index 1e6682ccb..5232d2def 100644 --- a/src/festim/hydrogen_transport_problem.py +++ b/src/festim/hydrogen_transport_problem.py @@ -4,9 +4,9 @@ from mpi4py import MPI from petsc4py import PETSc -import adios4dolfinx import basix import dolfinx +import io4dolfinx import numpy as np import numpy.typing as npt import tqdm.auto @@ -450,7 +450,11 @@ def initialise_exports(self): ) else: - adios4dolfinx.write_mesh(export.filename, mesh=self.mesh.mesh) + io4dolfinx.write_mesh( + filename=export.filename, + mesh=self.mesh.mesh, + backend="adios2", + ) elif isinstance(export, exports.CustomFieldExport): export.function = fem.Function(self.V_CG_1) @@ -1003,9 +1007,9 @@ def post_processing(self): if isinstance(export, exports.VTXSpeciesExport): if export._checkpoint: for field in export.field: - adios4dolfinx.write_function( - export.filename, - field.post_processing_solution, + io4dolfinx.write_function( + filename=export.filename, + u=field.post_processing_solution, time=float(self.t), name=field.name, ) @@ -1723,9 +1727,10 @@ def initialise_exports(self): engine="BP5", ) else: - adios4dolfinx.write_mesh( - export.filename, + io4dolfinx.write_mesh( + filename=export.filename, mesh=functions[0].function_space.mesh, + backend="adios2", ) elif isinstance(export, exports.VTXTemperatureExport): assert isinstance(self.temperature_fenics, fem.Function), ( @@ -1754,6 +1759,7 @@ def initialise_exports(self): output=export.function, engine="BP5", ) + # compute diffusivity function for surface fluxes # for the discontinuous case, we don't use D_global as in # HydrogenTransportProblem @@ -1843,9 +1849,9 @@ def post_processing(self): export._subdomain ] ) - adios4dolfinx.write_function( - export.filename, - post_processing_solution, + io4dolfinx.write_function( + filename=export.filename, + u=post_processing_solution, time=float(self.t), name=species.name, ) diff --git a/src/festim/initial_condition.py b/src/festim/initial_condition.py index e10768a80..1fb3b7a5a 100644 --- a/src/festim/initial_condition.py +++ b/src/festim/initial_condition.py @@ -3,8 +3,8 @@ from mpi4py import MPI -import adios4dolfinx import dolfinx +import io4dolfinx import numpy as np import ufl from dolfinx import fem @@ -247,8 +247,9 @@ def read_function_from_file( """Read a function from a file. note:: - The function is read from a file using adios4dolfinx. For more information - see the [adios4dolfinx documentation](https://jsdokken.com/adios4dolfinx/README.html). + The function is read from a file using io4dolfinx. For more information + see the [io4dolfinx documentation]( + scientificcomputing.github.io/io4dolfinx/README.html). Args: filename: the filename @@ -261,10 +262,10 @@ def read_function_from_file( Returns: the function """ - mesh_in = adios4dolfinx.read_mesh(filename, MPI.COMM_WORLD) + mesh_in = io4dolfinx.read_mesh(filename=filename, comm=MPI.COMM_WORLD) V_in = fem.functionspace(mesh_in, (family, order)) u_in = fem.Function(V_in) - adios4dolfinx.read_function( + io4dolfinx.read_function( filename=filename, u=u_in, name=name, diff --git a/test/test_initial_condition.py b/test/test_initial_condition.py index 4c25758d0..442be688e 100644 --- a/test/test_initial_condition.py +++ b/test/test_initial_condition.py @@ -2,8 +2,8 @@ from mpi4py import MPI -import adios4dolfinx import dolfinx +import io4dolfinx import numpy as np import pytest from dolfinx import fem @@ -159,8 +159,8 @@ def f(x): u_ref.interpolate(f) filename = tmpdir.join("initial_condition.bp") - adios4dolfinx.write_mesh(filename, mesh) - adios4dolfinx.write_function(filename, u_ref, name="my_function", time=0.2) + io4dolfinx.write_mesh(filename, mesh) + io4dolfinx.write_function(filename, u_ref, name="my_function", time=0.2) # create problem my_problem = F.HydrogenTransportProblem() @@ -213,9 +213,9 @@ def f2(x): u_ref2.interpolate(f2) filename = tmpdir.join("initial_condition.bp") - adios4dolfinx.write_mesh(filename, mesh) - adios4dolfinx.write_function(filename, u_ref1, name="my_function1", time=0.2) - adios4dolfinx.write_function(filename, u_ref2, name="my_function2", time=0.3) + io4dolfinx.write_mesh(filename, mesh) + io4dolfinx.write_function(filename, u_ref1, name="my_function1", time=0.2) + io4dolfinx.write_function(filename, u_ref2, name="my_function2", time=0.3) # create problem my_problem = F.HydrogenTransportProblem()