From a02bbfc9401d6eb82bff61fef061c15c80353a59 Mon Sep 17 00:00:00 2001 From: Cristian C Lalescu <Cristian.Lalescu@mpcdf.mpg.de> Date: Mon, 21 Oct 2024 07:57:43 +0200 Subject: [PATCH] [wip] [bug] tweaks "check field exists" settings --- TurTLE/DNS.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/TurTLE/DNS.py b/TurTLE/DNS.py index 606014b0..c1c64645 100644 --- a/TurTLE/DNS.py +++ b/TurTLE/DNS.py @@ -1028,17 +1028,21 @@ class DNS(_code): opt = None, iter0 = 0): """Launches jobs. Prepares initial condition and writes parameters to file if necessary.""" - if not os.path.exists(self.get_data_file_name()): - if not os.path.isdir(self.work_dir): - os.makedirs(self.work_dir) - self.generate_initial_condition(opt = opt) - self.write_par(iter0 = iter0) if (('test' in self.dns_type) or - (self.dns_type in ['kraichnan_field', 'NSVE'])): + (self.dns_type in ['kraichnan_field'])): self.check_current_vorticity_exists = False + self.check_current_velocity_exists = False if self.dns_type in ['NSE', 'NSE_alt_dealias']: self.check_current_vorticity_exists = False self.check_current_velocity_exists = True + if self.dns_type in ['NSVE']: + self.check_current_vorticity_exists = True + self.check_current_velocity_exists = False + if not os.path.exists(self.get_data_file_name()): + if not os.path.isdir(self.work_dir): + os.makedirs(self.work_dir) + self.generate_initial_condition(opt = opt) + self.write_par(iter0 = iter0) self.run( nb_processes = opt.nb_processes, nb_threads_per_process = opt.nb_threads_per_process, -- GitLab