This file is indexed.

/usr/share/code_saturne/runcase_aster is in code-saturne-data 2.1.0-4ubuntu1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
#!/bin/sh
# @configure_input@

#-------------------------------------------------------------------------------

# This file is part of Code_Saturne, a general-purpose CFD tool.
#
# Copyright (C) 1998-2011 EDF S.A.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
# Street, Fifth Floor, Boston, MA 02110-1301, USA.

#-------------------------------------------------------------------------------

echo  "  ********************************************"
echo  "      Code_Saturne / Code_Aster coupling      "
echo  "  ********************************************"
echo
#
# Parameters common to Code_Saturne and Code_Aster
#
NBPDTM=10
NBSSIT=1
DTREF=0.0001
TTINIT=0.0
EPSILO=0.00001
#
# Code_Saturne parameters
#
SAT_PARAM=
SAT_MESH=
#
# Code_Aster parameters
#
AST_COMM=
AST_MESH=
#
# Scratchdir (where the coupling application is going
# to be run)
#
TMP_PREFIX=/tmp
#
# =====================================================
# Initialization
# =====================================================
#
# Directory of the current study
#
STUDY_PATH=CASEDIRNAME
#
# Assign the various names used here (study, Code_Saturne
# case name and Code_Aster case name) to some variables
#
STUDY_NAME=STUDYNAME
SAT_NAME=CASENAME
AST_NAME=ASTERNAME
#
# Define a name for the directory 'RUN_DIR' where the
# coupling application will be run, and the
# corresponding path 'RUN_PATH'
#
# - if the scratchdir is not defined by the user then
#   use the user home as default scratchdir
#
if [ -z "$TMP_PREFIX" ]
then
    TMP_PREFIX=${HOME}
fi
#
# - define the whole path to the working directory
#
USER=`whoami`
DATE=`date '+%m%d%H%M'`
SCRATCH_DIR=tmp_Saturne
#
RUN_DIR=${STUDY_NAME}.${DATE}
RUN_PATH=${TMP_PREFIX}/${SCRATCH_DIR}/${RUN_DIR}
#
# Define the sub-directories where Saturne and Aster
# are run
#
AST_SCRATCH_PATH=${RUN_PATH}/${AST_NAME}
SAT_SCRATCH_PATH=${RUN_PATH}/${SAT_NAME}
#
# Define the results directories
#
RESULTS_DIR=`date '+%Y%m%d-%H%M'`
AST_RESULTS_DIR=${AST_NAME}
SAT_RESULTS_DIR=${SAT_NAME}
#
RESULTS_PATH=${STUDY_PATH}/RESU_COUPLING/${RESULTS_DIR}
AST_RESULTS_PATH=${RESULTS_PATH}/${AST_RESULTS_DIR}
SAT_RESULTS_PATH=${RESULTS_PATH}/${SAT_RESULTS_DIR}
#
# Code_Saturne installation parameters
#
prefix=/usr
bindir=/usr/bin
pkgdatadir=/usr/share/code_saturne
pkglibexecdir=/usr/lib/code_saturne
#
# SALOME
#
salomeroot=
salomekernelbindir=/bin/salome
#
# Code_Aster
#
asterhome=ASTERHOMEDIR
astervers=ASTERVERSION
#
# =====================================================
# Creation of the working directories
# =====================================================
#
cd ${TMP_PREFIX}
#
if [ ! -d ${SCRATCH_DIR} ]
then
    mkdir -p ${SCRATCH_DIR}
fi
#
# Verify that the workdir does not already exist
#
if test -d ${RUN_PATH}
then
    echo "Working directory $RUN_PATH already exists."
    echo "The simulation will not be run"
    exit 1
else
    mkdir -p ${RUN_PATH}
    echo "Working directory successfully created"
    echo "  - $RUN_PATH"
fi
#
# Create workdirs for Code_Saturne and Code_Aster
#
mkdir -p ${SAT_SCRATCH_PATH} ${AST_SCRATCH_PATH}
#
# Copy the present script file in the working directory
#
cp ${STUDY_PATH}/runcase_coupling ${RUN_PATH}
chmod +x ${RUN_PATH}/runcase_coupling
#
# =====================================================
# Setting up Code_Saturne temporary workdir
# =====================================================
#
echo "Setting up Code_Saturne workdir"
#
cd ${SAT_SCRATCH_PATH}
#
# Create Code_Saturne user source temporary directory
# ===================================================
#
mkdir -p src_saturne
#
# Get user sources
#
USER_SRC=${STUDY_PATH}/${SAT_NAME}/SRC/*.f90" "${STUDY_PATH}/${SAT_NAME}/SRC/*.h" "${STUDY_PATH}/${SAT_NAME}/SRC/*.c
#
for file in ${USER_SRC}
do
  if [ -f ${file} ]
      then
      cp -f ${file} src_saturne
  fi
done
#
# Compile Saturne
# ===============
#
${bindir}/code_saturne compile --source=src_saturne > compile.log 2>&1
#
if [ $? -ne 0 ]
    then
    echo "$SAT_NAME sources compilation or link error "
    echo "The simulation will not be run"
    rm -f *.o
    exit 1
else
    echo "  - $SAT_NAME sources compilation Ok"
fi
#
# Run the Saturne pre-processor
# =============================
#
cp ${STUDY_PATH}/MESH/${SAT_MESH} .
#
${pkglibexecdir}/cs_preprocess --out mesh_input --case ${SAT_NAME} ${COMMAND_REORIENT} ${SAT_MESH} > preprocessor.log 2>&1
#
if [ $? != 0 ]
    then
    echo "*********************************************"
    echo "Error running Code_Saturne preprocessor.     "
    echo "Check preprocessor log (listpre) for details."
    echo "     The simulation will not be run          "
    echo "*********************************************"
    echo
    exit 1
else
    echo "  - Normal end of CS preprocessor"
fi
#
# Copy of the parameter file
# ==========================
#
if [ ! -z "$SAT_PARAM" ]
    then
    file=${STUDY_PATH}/${SAT_NAME}/DATA/${SAT_PARAM}
    if [ -f ${file} ]
        then
        cp ${file} .
        file_tmp=${SAT_SCRATCH_PATH}/${SAT_PARAM}
        COMMAND_PARAM="--param $file_tmp"
    else
        echo '***********************************************'
        echo ' ERROR                                         '
        echo ' The parameters file ' ${file}
        echo ' can not be accessed.                          '
        echo ' The simulation will not be run                '
        echo '***********************************************'
        exit 1
    fi
fi
#
# =====================================================
# Setting up Code_Aster temporary workdir
# =====================================================
#
echo "Setting up Code_Aster workdir"
#
if [ ! -z "$AST_COMM" ]
    then
    file=${STUDY_PATH}/${AST_NAME}/${AST_COMM}
    #
    if [ -f $file ]
        then
        cp $file $AST_SCRATCH_PATH
    else
        echo '***********************************************'
        echo ' ERROR                                         '
        echo ' The command file ' $file
        echo ' can not be accessed.                          '
        echo ' The simulation will not be run                '
        echo '***********************************************'
        exit 1
    fi
else
    echo "**************************************"
    echo "AST command file name is not specified"
    echo "The simulation will not be run        "
    echo "**************************************"
    exit 1
fi
#
if [ ! -z "$AST_MESH" ]
    then
    file=$STUDY_PATH/$AST_NAME/$AST_MESH
    #
    if [ -f $file ]
        then
        cp $file $AST_SCRATCH_PATH
        AST_MESH_GLOB_NAME=$AST_SCRATCH_PATH/$AST_MESH
    else
        echo '***********************************************'
        echo ' ERROR                                         '
        echo ' The command file ' $file
        echo ' can not be accessed.                          '
        echo ' The simulation will not be run                '
        echo '***********************************************'
        exit 1
    fi
else
    echo "*************************************"
    echo "AST mesh file name is not specified  "
    echo "The simulation will not be run       "
    echo "*************************************"
    exit 1
fi
#
# =====================================================
# Starting calculation
# =====================================================
#
echo
echo  "  ********************************************"
echo  "               Starting calculation           "
echo  "  ********************************************"
echo
#
# Go to the working directory
#
cd $RUN_PATH
#
# Creating YACS coupling scheme
# =============================
#
echo "Creating YACS coupling scheme"
#
awk '{
       gsub(/@AST_WORKINGDIR@/,"'"$AST_SCRATCH_PATH"'",$0);
       gsub(/@COCAS_WORKINGDIR@/,"'"$RUN_PATH"'",$0);
       gsub(/@CFD_WORKINGDIR@/,"'"$SAT_SCRATCH_PATH"'",$0);
       gsub(/@AST_MAIL@/,"'"$AST_MESH_GLOB_NAME"'",$0);
       gsub(/@NBPDTM@/,"'"$NBPDTM"'",$0);
       gsub(/@NBSSIT@/,"'"$NBSSIT"'",$0);
       gsub(/@DTREF@/,"'"$DTREF"'",$0);
       gsub(/@TTINIT@/,"'"$TTINIT"'",$0);
       gsub(/@EPSILO@/,"'"$EPSILO"'",$0);
       gsub(/@COMM_FNAME@/,"'"$STUDY_PATH/$AST_NAME/$AST_COMM"'",$0);
       print
    }' \
    ${pkgdatadir}/salome/fsi_yacs_scheme.xml > fsi_yacs_scheme.xml
#
# Creating SALOME application
# ===========================
#
appli=$RUN_PATH/appli
#
$salomekernelbindir/appli_gen.py --prefix=$appli --config=$pkgdatadir/salome/fsi_appli_config.xml
#
# Create a localexec script
#
localexec=$RUN_PATH/localexec
echo '#!/bin/sh' > $localexec
echo '. '${asterhome}'/'${astervers}'/profile.sh' >> $localexec
echo 'export ROOT_SALOME='$salomeroot >> $localexec
echo 'export PATH='$bindir':$PATH' >> $localexec
echo 'appli='$appli >> $localexec
echo '$appli/runSession killSalome.py' >> $localexec
echo 'unset PYTHONHOME' >> $localexec
echo '$appli/runAppli -t' >> $localexec
echo '$appli/runSession $appli/bin/salome/driver -e -d 0 fsi_yacs_scheme.xml' >> $localexec
echo "exit \$?" >> $localexec
chmod 700 $localexec
#
# Excecute the script
#
./localexec
#
echo
echo  "  ********************************************"
echo  "               End of calculation            "
echo  "  ********************************************"
echo
#
# =====================================================
# End of calculation, copying results...
# =====================================================
#
echo "Copying results in ${RESULTS_PATH}"
#
cd ${STUDY_PATH}/RESU_COUPLING
#
mkdir -p ${AST_RESULTS_PATH}
mkdir -p ${SAT_RESULTS_PATH}
#
cp -r ${AST_SCRATCH_PATH}/* ${AST_RESULTS_PATH}
cp -r ${SAT_SCRATCH_PATH}/* ${SAT_RESULTS_PATH}
#