Skip to content

Commit d38a120

Browse files
author
Thomas Baumann
committed
Fixes
1 parent f7151fe commit d38a120

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pySDC/projects/GPU/analysis_scripts/RBC3D_stability.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pySDC.helpers.fieldsIO import FieldsIO
44
from pySDC.projects.GPU.configs.base_config import get_config
55

6-
step_sizes = {'RBC3DG4Ra1e5': [1e3, 1e0, 1e-1, 8e-2, 6e-2], 'RBC3DG4R4Ra1e5': [2e0, 1e0, 1e-1, 5e-2]}
6+
step_sizes = {'RBC3DG4Ra1e5': [1e3, 1e0, 1e-1, 8e-2, 6e-2], 'RBC3DG4R4Ra1e5': [1e0, 1e-1, 9e-2, 8e-2, 7e-2, 6e-2, 5e-2]}
77
n_freefall_times = {}
88

99

@@ -19,7 +19,7 @@ def get_stability(args, dt):
1919
t, u = file.readField(-1)
2020

2121
reachedTend = t >= n_freefall_times.get(type(config).__name__, 3)
22-
isfinite = np.all(np.isfinite(u))
22+
isfinite = u.max() <= 1e9
2323
if not reachedTend:
2424
print(f'Did not reach Tend with {dt=:.2e}')
2525
elif not isfinite:
@@ -29,6 +29,7 @@ def get_stability(args, dt):
2929

3030
def compute_stability(args, dt):
3131
from pySDC.projects.GPU.run_experiment import run_experiment
32+
from pySDC.core.errors import ConvergenceError
3233

3334
args['mode'] = 'run'
3435
args['dt'] = dt
@@ -37,7 +38,10 @@ def compute_stability(args, dt):
3738
config.Tend = n_freefall_times.get(type(config).__name__, 3)
3839
config.ic_config = type(config)
3940

40-
run_experiment(args, config)
41+
try:
42+
run_experiment(args, config)
43+
except ConvergenceError:
44+
pass
4145

4246

4347
if __name__ == '__main__':
@@ -51,4 +55,4 @@ def compute_stability(args, dt):
5155

5256
for i in range(len(dts)):
5357
stability[i] = get_stability(args, dts[i])
54-
print(stability)
58+
print([(dts[i], stability[i]) for i in range(len(dts))])

0 commit comments

Comments
 (0)