-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.sh
27 lines (23 loc) · 940 Bytes
/
run.sh
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
echo "Prepare....>>>>>>"
cd asterinput
ln -s ../../src module
cd ..
# generate mesh
/opt/salome_meca/appli_V2019.0.3_universal/salome -t ./asterinput/module/mesh/SSM.py
# prepare files for code aster
echo "Prepare file >>>>>>"
mkdir asteroutput
mkdir pythonOutput
mv *.med asterinput/inputMesh.med
VAR=$(shuf -i 555-1000 -n 1)
sed -i "s|PATH_OF_THE_CURRENT_FOLDER|$(pwd)|g" asterinput/asterInput1.py
sed -i "s|PATH_OF_THE_CURRENT_FOLDER|$(pwd)|g" asterinput/ASTERRUN.export
sed -i "s|RANDOMNUMBER|$VAR|g" asterinput/ASTERRUN.export
# run the simulation using code aster
echo "Run....>>>>>>"
/opt/aster146/bin/as_run asterinput/ASTERRUN.export
# 2> $(pwd)/error.log
echo "Change the variable back to the default value....>>>>>>"
sed -i "s|$VAR|RANDOMNUMBER|g" asterinput/ASTERRUN.export
sed -i "s|$(pwd)|PATH_OF_THE_CURRENT_FOLDER|g" asterinput/ASTERRUN.export
sed -i "s|$(pwd)|PATH_OF_THE_CURRENT_FOLDER|g" asterinput/asterInput1.py