Page MenuHomec4science

pipeline_fast.bash
No OneTemporary

File Metadata

Created
Sun, Jul 6, 22:12

pipeline_fast.bash

#!/bin/bash
# Sets the paths to the data
WORKDIR='/home/jarunanp/work/bone/18_11_bonepro_implementation/test'
AIMDIR=${WORKDIR}/1_AIM
FEADIR=${WORKDIR}/2_FEA
UMAT=${WORKDIR}/3_SCRIPT/UMAT_homogenization.f
SUMDIR=${AIMDIR}/Summaries
mkdir -p ${SUMDIR}
BONEPYDIR='/home/jarunanp/work/bone/18_11_bonepro_implementation/bonepy_package/bonepy'
CALCTIME=${FEADIR}/Calculation_Time.txt
touch ${CALCTIME}
declare -A folder
folder[C0002234]=D_FEA_PRE_179
folder[C0002240]=D_FEA_PRE_180
folder[C0002241]=D_FEA_PRE_181
folder[C0002256]=D_FEA_PRE_182
folder[C0002245]=D_FEA_PRE_183
folder[C0002252]=D_FEA_PRE_184
folder[C0002265]=D_FEA_PRE_185
folder[C0002266]=D_FEA_PRE_186
folder[C0002255]=D_FEA_PRE_187
folder[C0002260]=D_FEA_PRE_188
folder[C0002263]=D_FEA_PRE_189
folder[C0002250]=D_FEA_PRE_190
folder[C0002249]=D_FEA_PRE_191
folder[C0002259]=D_FEA_PRE_193
folder[C0002248]=D_FEA_PRE_194
folder[C0002261]=D_FEA_PRE_195
folder[C0002262]=D_FEA_PRE_196
folder[C0002239]=D_FEA_PRE_197
folder[C0002258]=D_FEA_PRE_200
folder[C0002243]=D_FEA_PRE_201
folder[C0002253]=D_FEA_PRE_203
VERSION=07_fast
ABAQUSEXE='/home/jarunanp/software/Abaqus/build/6.14-1/Commands/abq6141'
# Stop clock for measuring process time
STARTTIME_FULL=$(date +%s)
printf "\nCALCULATION TIMES FOR FEA PIPELINE\n" >> ${CALCTIME}
printf "\nAuthor: Denis Elia Schenk\nISTB 2017" >> ${CALCTIME}
printf "\nV1: This file prints out the time spamps during proessing and calculates processing time\nfor all samples and overall processing time of the full batch\n" >> ${CALCTIME}
printf "\n*****************************\nRun from $(date '+%d/%m/%Y_%H:%M:%S')\n*****************************\n" >> ${CALCTIME}
printf "\nStarting time job: $STARTTIME_FULL" >> ${CALCTIME}
for name in C0002234
do
SAMPLEDIR=${FEADIR}/${folder[$name]}
INPUTFILE=${AIMDIR}/${folder[$name]}/${name}_V_${VERSION}.inp
SUMMARYFILE=${AIMDIR}/${folder[$name]}/${name}_V_${VERSION}_summary.txt
RESULTDIR=${FEADIR}/Results_${VERSION}
# measure and writing starting time for sample processing time
STARTTIME_SAMPLE=$(date +%s)
printf "\n--------------------------\nStart time sample ${folder[$name]}: $STARTTIME_SAMPLE" >> ${CALCTIME}
# Convert AIM file to FE solver input file
python ${BONEPYDIR}/aim_to_fe.py --configfile ${BONEPYDIR}/config.yaml
# Copy summary file to folder Summaries
cp ${SUMMARYFILE} ${SUMDIR}
# Starts the abaqus analysis
mkdir -p ${SAMPLEDIR}
cd ${SAMPLEDIR}
cp ${INPUTFILE} ${SAMPLEDIR}
${ABAQUSEXE} interactive cpus=4 job=${name} inp=${INPUTFILE} user=${UMAT} ask_delete=OFF
# Post processing
python ${BONEPYDIR}/datfilereader.py ${name}.dat
mkdir -p ${RESULTDIR}
cp ${SAMPLEDIR}/${name}.txt ${RESULTDIR}/${name}.txt
# Block for writing out sample processing time to txt file
ENDTIME_SAMPLE=$(date +%s)
printf "\nEnd time sample ${folder[$name]}: $ENDTIME_SAMPLE" >> ${CALCTIME}
printf "\nTotal processing time for sample ${folder[$name]}: $((ENDTIME_SAMPLE - STARTTIME_SAMPLE)) seconds\n--------------------------" >> ${CALCTIME}
done
# Block for writing total processing time to file
ENDTIME_FULL=$(date +%s)
printf "\n\nThe time for analyis of this job was $((ENDTIME_FULL - STARTTIME_FULL)) seconds\n*****************************\n*****************************" >> ${CALCTIME}

Event Timeline