Skip to content

Commit

Permalink
replaced time comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
RemDelaporteMathurin committed Jul 3, 2024
1 parent 9ed1b38 commit bfb2b60
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion festim/exports/xdmf_export.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import warnings
from festim import Export
import fenics as f
import numpy as np


field_to_label = {
Expand Down Expand Up @@ -151,7 +152,7 @@ def is_export(self, t, final_time, nb_iterations):
Returns:
bool: True if export should be exported, else False
"""
if self.mode == "last" and t >= final_time:
if self.mode == "last" and np.isclose(t, final_time, atol=0):
return True
elif isinstance(self.mode, int):
if nb_iterations % self.mode == 0:
Expand Down

0 comments on commit bfb2b60

Please sign in to comment.