Skip to content
Draft
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 .github/workflows/ci_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion conda/recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ requirements:
- python >={{ python_min }}
- fenics-dolfinx >=0.9,<=0.10
- scifem >=0.2.13
- adios4dolfinx
- io4dolfinx
- tqdm

test:
Expand Down
2 changes: 1 addition & 1 deletion docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
- numpy==1.24
- tqdm
- scifem>=0.2.8
- adios4dolfinx
- io4dolfinx
- sphinx-design
- sphinxcontrib-bibtex
- sympy
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions src/festim/exports/vtx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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__(
Expand Down
26 changes: 16 additions & 10 deletions src/festim/hydrogen_transport_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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,
)
Expand Down Expand Up @@ -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), (
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
)
Expand Down
11 changes: 6 additions & 5 deletions src/festim/initial_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

from mpi4py import MPI

import adios4dolfinx
import dolfinx
import io4dolfinx
import numpy as np
import ufl
from dolfinx import fem
Expand Down Expand Up @@ -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
Expand All @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions test/test_initial_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from mpi4py import MPI

import adios4dolfinx
import dolfinx
import io4dolfinx
import numpy as np
import pytest
from dolfinx import fem
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
Loading