Compare commits

..

No commits in common. "d9297b4312d2380646353e76c884031e661132c0" and "60e0eeafe238bdb279d7f94c7bfaa62e701309e0" have entirely different histories.

2 changed files with 14 additions and 19 deletions

View file

@ -26,7 +26,7 @@ FoamFile
//wavePhase 0.; //wavePhase 0.;
//tSmooth 0.0; //tSmooth 0.0;
waveType solitary; waveType singular;
waveTheory Boussinesq; waveTheory Boussinesq;
genAbs 0; genAbs 0;
absDir 0.0; absDir 0.0;

View file

@ -8,6 +8,7 @@ from time import time
from datetime import timedelta from datetime import timedelta
from pathlib import Path from pathlib import Path
from distutils import dir_util
import subprocess as sp import subprocess as sp
_t0 = time() _t0 = time()
@ -42,27 +43,25 @@ if not work_dir.exists():
case_dir = work_dir.joinpath(config.get('main', 'case')) case_dir = work_dir.joinpath(config.get('main', 'case'))
if case_dir.exists(): if case_dir.exists():
log.info(f'Deleting case ({case_dir})') log.info(f'Deleting case ({case_dir})')
sp.run( dir_util.remove_tree(str(case_dir))
('rm', '-r', case_dir)
)
log.info(f'Copying case ({input_dir} -> {case_dir})') log.info(f'Copying case ({input_dir} -> {case_dir})')
sp.run( dir_util.copy_tree(
('cp', '-r', input_dir, case_dir) str(input_dir),
str(case_dir),
) )
if config.getboolean('stl', 'copy', fallback=False): if config.getboolean('stl', 'copy', fallback=False):
stl_dir = case_dir.joinpath('constant', 'triSurface') stl_dir = case_dir.joinpath('constant', 'triSurface')
if stl_dir.exists(): if stl_dir.exists():
log.info(f'Deleting stl directory ({stl_dir})') log.info(f'Deleting stl directory ({stl_dir})')
sp.run( dir_util.remove_tree(str(stl_dir))
('rm', '-r', stl_dir)
)
stl_in = Path(config.get('stl', 'from')) stl_in = Path(config.get('stl', 'from'))
log.info(f'Copying stl directory ({stl_in} -> {stl_dir})') log.info(f'Copying stl directory ({stl_in} -> {stl_dir})')
sp.run( dir_util.copy_tree(
('cp', '-r', stl_in, stl_dir) str(stl_in),
str(stl_dir),
) )
if config.getboolean('blockMesh', 'enable', fallback=False): if config.getboolean('blockMesh', 'enable', fallback=False):
@ -106,11 +105,9 @@ if config.getboolean('snappyHexMesh', 'enable', fallback=False):
log.info(f'snappyHexMesh finished successfully') log.info(f'snappyHexMesh finished successfully')
log.info('Copying 0.org -> 0') log.info('Copying 0.org -> 0')
sp.run( dir_util.copy_tree(
('cp', '-r', str(case_dir.joinpath('0.org')),
case_dir.joinpath('0.org'), str(case_dir.joinpath('0')),
case_dir.joinpath('0'),
)
) )
if config.getboolean('setFields', 'enable', fallback=False): if config.getboolean('setFields', 'enable', fallback=False):
@ -201,9 +198,7 @@ if config.getboolean('olaFlow', 'enable', fallback=False):
log.info(f'Deleting processor directories') log.info(f'Deleting processor directories')
for proc_dir in case_dir.glob(r'processor*'): for proc_dir in case_dir.glob(r'processor*'):
log.info(f'Deleting {proc_dir}') log.info(f'Deleting {proc_dir}')
sp.run( dir_util.remove_tree(str(proc_dir))
('rm', '-r', proc_dir)
)
_t1 = time() _t1 = time()
log.info(f'Program ended successfully after {timedelta(seconds=_t1-_t0)}') log.info(f'Program ended successfully after {timedelta(seconds=_t1-_t0)}')