Files
openfoam/etc/config.sh/aliases
Mark Olesen 110b00f048 ENH: improved handling of gmp/mpfr library settings (issue #674)
- export library path for gmp/mpfr from CGAL config files.
  This is required when non-system gmp/mpfr libraries are being
  used, but not using a ThirdParty compiler installation.

- automatically handle lib/ vs lib64/ (eg, for central installations)
  for packages such as boost, CGAL, etc. While the ThirdParty
  compilation of these will normally land in lib64/, this may not be
  the case when they are supplied by another means.

- reworked the handling of foamEtcFile and foamCleanPath for less
  clutter in the configuration files.
  Added the bin/tools/lib-dir script to handle logic that is
  too complex to easily manage in csh.
2018-01-11 01:30:23 +01:00

110 lines
3.1 KiB
Bash

#----------------------------------*-sh-*--------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, licensed under GNU General Public License
# <http://www.gnu.org/licenses/>.
#
# File
# etc/config.sh/aliases
# - sourced by OpenFOAM-*/etc/bashrc (or from the user's ~/.bashrc)
#
# Description
# Aliases for working with OpenFOAM.
#
#------------------------------------------------------------------------------
# Change compiled version aliases
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias wmSet='. $WM_PROJECT_DIR/etc/bashrc'
alias wmInt32='wmSet WM_LABEL_SIZE=32'
alias wmInt64='wmSet WM_LABEL_SIZE=64'
alias wmSP='wmSet WM_PRECISION_OPTION=SP'
alias wmDP='wmSet WM_PRECISION_OPTION=DP'
# Clear env
alias wmUnset='. $WM_PROJECT_DIR/etc/config.sh/unset'
# Toggle wmakeScheduler on/off
# - also need to set WM_HOSTS
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias wmSchedOn='export WM_SCHEDULER=$WM_PROJECT_DIR/wmake/wmakeScheduler'
alias wmSchedOff='unset WM_SCHEDULER'
# Change directory aliases
# ~~~~~~~~~~~~~~~~~~~~~~~~
alias foam='cd $WM_PROJECT_DIR'
alias src='cd $FOAM_SRC'
alias lib='cd $FOAM_LIBBIN'
alias app='cd $FOAM_APP'
alias sol='cd $FOAM_SOLVERS'
alias util='cd $FOAM_UTILITIES'
alias tut='cd $FOAM_TUTORIALS'
alias run='cd $FOAM_RUN'
# Refresh the environment
# ~~~~~~~~~~~~~~~~~~~~~~~
unset -f wmRefresh 2>/dev/null
wmRefresh()
{
local projectDir=$WM_PROJECT_DIR
local foamSettings=$FOAM_SETTINGS
wmUnset
. $projectDir/etc/bashrc $foamSettings
}
# Change OpenFOAM version
# ~~~~~~~~~~~~~~~~~~~~~~~
unset -f foamVersion 2>/dev/null
foamVersion()
{
if [ "$#" -gt 0 ]
then
local ver=$1
shift
# The variable foamInstDir had meaning for older OpenFOAM versions
foamInstDir=$FOAM_INST_DIR
if [ -f "$foamInstDir/OpenFOAM-$ver/etc/bashrc" ]
then
wmUnset
. $foamInstDir/OpenFOAM-$ver/etc/bashrc
unset foamInstDir
foam
echo "Changed to OpenFOAM-$WM_PROJECT_VERSION" 1>&2
else
unset foamInstDir
echo "No OpenFOAM-$ver available" 1>&2
echo "Using OpenFOAM-$WM_PROJECT_VERSION" 1>&2
return 1
fi
else
echo "OpenFOAM-$WM_PROJECT_VERSION" 1>&2
fi
}
# Change ParaView version
# ~~~~~~~~~~~~~~~~~~~~~~~
# pass in first value directly (eg, 5.4.1) and transform to
# ParaView_VERSION=...
# Any additional arguments must be fully specified and start with "ParaView".
# Eg,
# ParaView_QT=...
unset -f foamPV 2>/dev/null
foamPV()
{
. $WM_PROJECT_DIR/etc/config.sh/paraview "${@+ParaView_VERSION=$@}"
local pvdir="${ParaView_DIR##*/}"
echo "${pvdir:-ParaView_DIR not set}" 1>&2
}
#------------------------------------------------------------------------------