#!/bin/bash
#------------------------------------------------------------------------------
# Preamble with the information about the tutorial
echo -en "
-------------------------------------------------------------------------------
${GRAY}Case study by Mr.Variya${NC}	:: Generated on December 2018
${GRAY}Build for OpenFOAM version${NC}  :: OpenFOAM-6
${GRAY}Tested on system${NC}            :: Ubuntu 18.04.1
${GRAY}The case was updated on${NC}     :: 22 December 2018
-------------------------------------------------------------------------------


${RED}Topic: Droplets with velocity field${NC}
-------------------------------------------------------------------------------
This case was done to proof some analytic calculation of 
computational fluid dynamics. Whole case is done to publish on 
cfd.fossee.in website. Which is a part of FOSSEE
(Free and Open Source Software in Engineering Education) project 
in Indian Institute of Technology(IIT), Bombay.
-------------------------------------------------------------------------------
\n
"


#------------------------------------------------------------------------------
# Check the OpenFOAM version
echo -e "   - Check OpenFOAM version. We need $foamVersion"
userFoamVersion=`echo "$WM_PROJECT-$WM_PROJECT_VERSION"`

if [ "$userFoamVersion" == "$foamVersion" ]
then
    echo -e  "   - ${GREEN}$foamVersion found...${NC}"

else
    echo -e  "   - ${RED}You are not using the correct OpenFOAM version"
    echo -en "     Your version is $userFoamVersion and we need ${GREEN}"
    echo -e  "$foamVersion${NC}\n"

    while true
    do
        echo -en  "   - Proceed with your OpenFOAM version (y/n): "
        read proceed

        if [ "$proceed" == "y" ]
        then
            break

        elif [ "$proceed" == "n" ]
        then
            echo -e "\n\n"
            exit

        fi
    done
fi


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