Skip to content

Commit 48ebc8b

Browse files
committed
TL: debug (againg ...)
1 parent df6fa2b commit 48ebc8b

File tree

1 file changed

+13
-13
lines changed
  • pySDC/playgrounds/dedalus/problems

1 file changed

+13
-13
lines changed

pySDC/playgrounds/dedalus/problems/rbc.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,19 @@ def runSimulation(cls, runDir, tEnd, baseDt, tBeg=0, logEvery=100,
256256

257257
p = cls(**pParams)
258258

259+
dt = baseDt/p.resFactor
260+
nSteps = round(float(tEnd-tBeg)/dt, ndigits=3)
261+
if float(tEnd-tBeg) != round(nSteps*dt, ndigits=3):
262+
raise ValueError(f"{tEnd=} is not divisible by timestep {dt=} ({nSteps=})")
263+
nSteps = int(nSteps)
264+
p.infos.update(tEnd=tEnd, dt=dt, nSteps=nSteps)
265+
266+
if os.path.isfile(f"{runDir}/01_finalized.txt"):
267+
cls.log(" -- simulation already finalized, skipping !")
268+
return p
269+
os.makedirs(runDir, exist_ok=True)
270+
p.infos.update(dirName=runDir)
271+
259272
if writeDecomposition:
260273
decompFile = f"{runDir}/decomp.txt"
261274
if MPI_RANK == 0:
@@ -281,19 +294,6 @@ def runSimulation(cls, runDir, tEnd, baseDt, tBeg=0, logEvery=100,
281294
)
282295
COMM_WORLD.Barrier()
283296

284-
dt = baseDt/p.resFactor
285-
nSteps = round(float(tEnd-tBeg)/dt, ndigits=3)
286-
if float(tEnd-tBeg) != round(nSteps*dt, ndigits=3):
287-
raise ValueError(f"{tEnd=} is not divisible by timestep {dt=} ({nSteps=})")
288-
nSteps = int(nSteps)
289-
p.infos.update(tEnd=tEnd, dt=dt, nSteps=nSteps)
290-
291-
if os.path.isfile(f"{runDir}/01_finalized.txt"):
292-
cls.log(" -- simulation already finalized, skipping !")
293-
return p
294-
os.makedirs(runDir, exist_ok=True)
295-
p.infos.update(dirName=runDir)
296-
297297
# Solver
298298
cls.log(" -- building dedalus solver ...")
299299
solver = p.problem.build_solver(TimeStepper)

0 commit comments

Comments
 (0)