Skip to content
Snippets Groups Projects
Commit b39b430f authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

adds mechanism for control of initial condition behavior

parent 294a2437
No related branches found
No related tags found
1 merge request!134adds mechanism for control of initial condition behavior
Pipeline #239606 passed
...@@ -929,16 +929,32 @@ class DNS(_code): ...@@ -929,16 +929,32 @@ class DNS(_code):
return None return None
def generate_initial_condition( def generate_initial_condition(
self, self,
opt = None): opt = None,
need_field = None,
checkpoint_field = None):
"""Creates the "checkpoint 0" file.
Keyword arguments:
opt --- options object, this method may access any of
* opt.src_simname,
* opt.src_work_dir,
* opt.src_iteration
need_field --- boolean: does the DNS need the "0" iteration field
to be present in the "checkpoint 0" file?
checkpoint_field --- string: name of field used for checkpoints, one of
'velocity' or 'vorticity'.
"""
# take care of fields' initial condition # take care of fields' initial condition
# first, check if initial field exists if type(checkpoint_field) == type(None):
need_field = False
if self.check_current_vorticity_exists:
need_field = True
if self.dns_type in ['NSE', 'NSE_alt_dealias']: if self.dns_type in ['NSE', 'NSE_alt_dealias']:
checkpoint_field = 'velocity' checkpoint_field = 'velocity'
else: else:
checkpoint_field = 'vorticity' checkpoint_field = 'vorticity'
# first, check if initial field exists
if type(need_field) == type(None):
need_field = False
if self.check_current_vorticity_exists:
need_field = True
if self.dns_type in [ if self.dns_type in [
'NSE', 'NSE',
'NSE_alt_dealias', 'NSE_alt_dealias',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment