From 771a3c5670f6fd7e918bd230e12205289b669909 Mon Sep 17 00:00:00 2001 From: Andrew Winters Date: Tue, 12 Mar 2024 20:08:57 +0100 Subject: [PATCH] add output_directory creation if not already done. Necessary if this callback is used without the SaveSolution callback --- src/callbacks_step/time_series.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/callbacks_step/time_series.jl b/src/callbacks_step/time_series.jl index 8ca8fe4db8a..f6d76f0fb15 100644 --- a/src/callbacks_step/time_series.jl +++ b/src/callbacks_step/time_series.jl @@ -96,6 +96,11 @@ function TimeSeriesCallback(mesh, equations, solver, cache, point_coordinates; throw(ArgumentError("`point_coordinates` must be a matrix of size n_points × ndims")) end + # create the output folder if it does not exist already + if mpi_isroot() && !isdir(output_directory) + mkpath(output_directory) + end + # Transpose point_coordinates to our usual format [ndims, n_points] # Note: They are accepted in a different format to allow direct input from `readdlm` point_coordinates_ = permutedims(point_coordinates)