Page MenuHomec4science

run_am.sh
No OneTemporary

File Metadata

Created
Tue, Jul 16, 05:22

run_am.sh

#!/bin/bash
#SBATCH --nodes 1
#SBATCH --cpus-per-task 8
#SBATCH --ntasks-per-node 1
#SBATCH --mem 31000
#SBATCH --time 02:00:00
#SBATCH --error=slurm-%j.stderr
#SBATCH --output=slurm-%j.stdout
#SBATCH --job-name=box_am
#SBATCH --mail-user=recep.kubilay@epfl.ch
#SBATCH --mail-type=ALL
echo "*** STARTING JOB ***"
EXTRUDE=true
PART=true
GEOM_FILE="box_real.txt"
THERMAL=true
LAYERS=66
START_LAYER=3
LAYER_THICKNESS=0.03
FREECAD_DIRECTORY="/home/kubilay/anaconda3/envs/freecad_env/lib"
source /home/kubilay/anaconda3/bin/activate
if $PART
then
echo "START PART GEOMETRY"
conda activate freecad_env
#go to Part_geometry directory
cd Part_geometry/
LOG_FILE="part_geometry.log"
#extrude part using the python script if necessary
if $EXTRUDE
then
python3 create_part_geometry.py $FREECAD_DIRECTORY $GEOM_FILE 5 ${GEOM_FILE%.txt}.step > $LOG_FILE
cd ..
conda deactivate
echo "END PART GEOMETRY"
fi
fi
if $THERMAL
then
for z in $(seq $START_LAYER $LAYERS)
do
echo "LAYER $z"
cd Part_geometry/
conda activate freecad_env
LOG_FILE="part_geometry.log"
#layer and mesh the part
echo "START LAYER GEOMETRY"
python3 layer_part.py $FREECAD_DIRECTORY ${GEOM_FILE%.txt}.step/${GEOM_FILE%.txt}.step $LAYER_THICKNESS $z layer mesh >> $LOG_FILE
#convert .msh files into .xml files
conda activate fenicsproject
sh convert_mesh.sh >> $LOG_FILE
echo "END LAYER GEOMETRY"
cd ..
echo "START THERMAL MODEL"
#go the Thermal_model directory
cd Thermal_model/
LOG_FILE="thermal_model.log"
#run thermal problem
mpirun -np 8 python fem_layer_scan_final.py $z 4420 750 27 175 0.8 0.0005 >>$LOG_FILE
echo "END THERMAL MODEL"
cd ..
done
fi
echo "*** JOB FINISHED ***

Event Timeline