Skip to content

Commit 161459e

Browse files
committed
cleanup + testing
1 parent 86a721c commit 161459e

File tree

6 files changed

+18
-237
lines changed

6 files changed

+18
-237
lines changed

pySDC/playgrounds/Allen_Cahn/contracting_circle.py

Lines changed: 0 additions & 123 deletions
This file was deleted.

pySDC/playgrounds/Allen_Cahn/monitor.py

Lines changed: 0 additions & 107 deletions
This file was deleted.

pySDC/projects/TOMS/AllenCahn_contracting_circle.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,16 @@ def run_SDC_variant(variant=None, inexact=False):
171171
return stats
172172

173173

174-
def show_results(fname):
174+
def show_results(fname, cwd=''):
175175
"""
176176
Plotting routine
177177
178178
Args:
179-
fname: file name to read in and name plots
179+
fname (str): file name to read in and name plots
180+
cwd (str): current working directory
180181
"""
181182

182-
file = open(fname + '.pkl', 'rb')
183+
file = open(cwd + fname + '.pkl', 'rb')
183184
results = dill.load(file)
184185
file.close()
185186

@@ -293,14 +294,14 @@ def main(cwd=''):
293294
results[(variant, 'inexact')] = run_SDC_variant(variant=variant, inexact=True)
294295

295296
# dump result
296-
fname = cwd + 'data/results_SDC_variants_AllenCahn_1E-03'
297-
file = open(fname + '.pkl', 'wb')
297+
fname = 'data/results_SDC_variants_AllenCahn_1E-03'
298+
file = open(cwd + fname + '.pkl', 'wb')
298299
dill.dump(results, file)
299300
file.close()
300-
assert os.path.isfile(fname + '.pkl'), 'ERROR: dill did not create file'
301+
assert os.path.isfile(cwd + fname + '.pkl'), 'ERROR: dill did not create file'
301302

302303
# visualize
303-
show_results(fname)
304+
show_results(fname, cwd=cwd)
304305

305306

306307
if __name__ == "__main__":
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from pySDC.projects.TOMS.AllenCahn_contracting_circle import main
2+
3+
4+
def test_AllenCahn_contracting_circle():
5+
main(cwd='pySDC/projects/TOMS/')
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from pySDC.projects.TOMS.visualize_pySDC_with_PETSc import main
2+
3+
4+
def test_visualize_pySDC_with_PETSc():
5+
main(cwd='pySDC/projects/TOMS/')

0 commit comments

Comments
 (0)