Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VTX export capability #603

Merged
merged 10 commits into from
Oct 17, 2023
Merged

VTX export capability #603

merged 10 commits into from
Oct 17, 2023

Conversation

RemDelaporteMathurin
Copy link
Collaborator

@RemDelaporteMathurin RemDelaporteMathurin commented Oct 13, 2023

Proposed changes

This implements a VTXExport class that exports fields as VTX.
It takes a filename and a species or list of species as argument.

VTX files are readable with the MPI version of paraview.
Note: I opened an issue on the VTK repo to track progress on the development of a non-MPI VTX writer.

Usage

import dolfinx
import festim

u = dolfinx.fem.Function(V)
my_export = festim.VTXExport("my_export.bp")
my_export.define_writer(mesh.comm, [u])
for t in range(10):
    u.interpolate(lambda x: t * (x[0] ** 2 + x[1] ** 2 + x[2] ** 2))
    my_export.write(t)

with HTransportProblem

my_model.species = [F.Species("H")]
my_model.exports = [F.VTXExport("my_new_export.bp", field=my_model.species[0])]

my_model.initialise()

Current limitations:

  • the field argument takes only festim.Species of list of festim.Species

Types of changes

What types of changes does your code introduce to FESTIM?

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code refactoring
  • Documentation Update (if none of the other choices apply)
  • New tests

Checklist

  • Black formatted
  • Unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (2fc987a) 95.06% compared to head (c9bfbc0) 95.83%.

Additional details and impacted files
@@             Coverage Diff             @@
##           fenicsx     #603      +/-   ##
===========================================
+ Coverage    95.06%   95.83%   +0.76%     
===========================================
  Files            9       10       +1     
  Lines          223      264      +41     
===========================================
+ Hits           212      253      +41     
  Misses          11       11              
Files Coverage Δ
festim/__init__.py 68.18% <100.00%> (+1.51%) ⬆️
festim/exports/vtx.py 100.00% <100.00%> (ø)
festim/hydrogen_transport_problem.py 97.52% <100.00%> (+0.10%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@RemDelaporteMathurin RemDelaporteMathurin marked this pull request as ready for review October 15, 2023 18:39
@jhdark
Copy link
Collaborator

jhdark commented Oct 16, 2023

might be worth just updating the permeation tests to use this new vtx output too

@jhdark jhdark added enhancement New feature or request fenicsx Issue that is related to the fenicsx support labels Oct 16, 2023
Copy link
Collaborator

@jhdark jhdark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jhdark jhdark merged commit a2fc5c3 into fenicsx Oct 17, 2023
6 of 7 checks passed
@RemDelaporteMathurin RemDelaporteMathurin deleted the vtx_export branch November 3, 2023 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fenicsx Issue that is related to the fenicsx support
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants