Skip to content

Instantly share code, notes, and snippets.

@petebachant
Last active May 28, 2016 13:39
Show Gist options
  • Select an option

  • Save petebachant/29163ef98ba9c2e63db63883c2d7dbba to your computer and use it in GitHub Desktop.

Select an option

Save petebachant/29163ef98ba9c2e63db63883c2d7dbba to your computer and use it in GitHub Desktop.
Function in my bashrc for activating OpenFOAM envs
function openfoam() {
OF_VERSION=$1
# echo "Activating OpenFOAM-$OF_VERSION environment"
source /home/pete/OpenFOAM/OpenFOAM-$OF_VERSION/etc/bashrc
if [[ "$OF_VERSION" == "2"* ]]
then
export ParaView_DIR=/home/pete/OpenFOAM/ThirdParty-$OF_VERSION/platforms/linux64Gcc/ParaView-4.1.0
export PATH=$ParaView_DIR/bin:$PATH
export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-4.1
else
export ParaView_DIR=/home/pete/OpenFOAM/ThirdParty-$OF_VERSION/platforms/linux64Gcc/ParaView-4.4.0
export PATH=$ParaView_DIR/bin:$PATH
export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-4.4
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment