diff --git a/LDDsimulation/solutionFile.py b/LDDsimulation/solutionFile.py new file mode 100644 index 0000000000000000000000000000000000000000..7ae0a95ab11f211b552a6a9ec491e4e59a201e39 --- /dev/null +++ b/LDDsimulation/solutionFile.py @@ -0,0 +1,13 @@ +import dolfin as df +# https://github.com/geo-fluid-dynamics/phaseflow-fenics +# adapted from Lucas Ostrowski +class SolutionFile(df.XDMFFile): + """ + This class extends `df.XDMFFile` with some minor changes for convenience. + """ + def __init__(self, mpicomm, filepath): + df.XDMFFile.__init__(self, mpicomm, filepath) + + self.parameters["functions_share_mesh"] = True + self.parameters["flush_output"] = False + self.path = filepath # Mimic the file path attribute from a `file` returned by `open`