1
#-------------------------------------------------------------------------------
2
# This file is part of the Code_Saturne Solver.
4
# Copyright (C) 2009 EDF
6
# The Code_Saturne Preprocessor is free software; you can redistribute it
7
# and/or modify it under the terms of the GNU General Public License
8
# as published by the Free Software Foundation; either version 2 of
9
# the License, or (at your option) any later version.
11
# The Code_Saturne Preprocessor is distributed in the hope that it will be
12
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public Licence
17
# along with the Code_Saturne Preprocessor; if not, write to the
18
# Free Software Foundation, Inc.,
19
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#-------------------------------------------------------------------------------
30
from cs_exec_environment import run_command
32
#-------------------------------------------------------------------------------
36
s_up = string.upper(s)
38
stdgeomfile = 'chr.geo'
39
stdcasefile = 'CHR.case'
42
casefile = s_up + '.case'
44
fd = file(stdcasefile, 'r')
45
fdt = file(casefile, 'w')
46
kwd = re.compile('chr.geo')
48
line = re.sub(kwd, s+'.geo', line)
53
os.remove(stdcasefile)
54
shutil.move(stdgeomfile, geomfile)
57
#-------------------------------------------------------------------------------
61
Run Code_Saturne preprocessor and solver.
67
cmd = os.path.join(cs_config.dirs.ecs_bindir, 'cs_preprocess')
69
for o in ('-h', '--help'):
71
cmd = cmd + " " + str(o)
72
retval = run_command(cmd)
76
cmd = cmd + " " + str(o)
77
cmd = cmd + " --ensight --case check_mesh"
78
retval = run_command(cmd)
80
os.chdir('check_mesh.ensight')
81
subst_name('preprocessor')
87
cmd = os.path.join(cs_config.dirs.bindir, 'cs_solver')
88
cmd = cmd + " --quality --log 0"
89
retval = run_command(cmd)
91
dir_files = os.listdir('chr.ensight')
93
shutil.move(os.path.join('chr.ensight',f), 'check_mesh.ensight')
94
os.rmdir('chr.ensight')
96
os.chdir('check_mesh.ensight')
101
os.remove('preprocessor_output')
105
#-------------------------------------------------------------------------------
112
retcode = run_check(argv)
116
if __name__ == '__main__':