Skip to content
Snippets Groups Projects
Commit 4425db22 authored by Mark Olesen's avatar Mark Olesen
Browse files

STYLE: set ParaView_VERSION in etc/apps/paraview3/*rc only

- this change was wished by Mattijs and/or Henry

- allow command-line settings to retain the flexibility of 'foamPV'
  alias mechanism.
parent 8deef93a
Branches
Tags
No related merge requests found
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -44,9 +44,9 @@ alias wmDP 'wmSET WM_PRECISION_OPTION=DP'
alias wmSchedON 'setenv WM_SCHEDULER $WM_PROJECT_DIR/wmake/wmakeScheduler'
alias wmSchedOFF 'unsetenv WM_SCHEDULER'
# Change paraview version
# Change ParaView version
# ~~~~~~~~~~~~~~~~~~~~~~~
alias foamPV 'setenv ParaView_VERSION \!*; source $WM_PROJECT_DIR/etc/apps/paraview3/cshrc; echo paraview-$ParaView_VERSION'
alias foamPV 'source `$WM_PROJECT_DIR/etc/apps/paraview3/cshrc` ParaView_VERSION=\!*; echo paraview-$ParaView_VERSION'
# Change directory aliases
......
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -44,16 +44,13 @@ alias wmDP='wmSET WM_PRECISION_OPTION=DP'
alias wmSchedON='export WM_SCHEDULER=$WM_PROJECT_DIR/wmake/wmakeScheduler'
alias wmSchedOFF='unset WM_SCHEDULER'
# Change paraview version
# Change ParaView version
# ~~~~~~~~~~~~~~~~~~~~~~~
unset foamPV
foamPV()
{
export ParaView_VERSION=$1
. $WM_PROJECT_DIR/etc/apps/paraview3/bashrc
. $WM_PROJECT_DIR/etc/apps/paraview3/bashrc ParaView_VERSION=$1
echo "paraview-$ParaView_VERSION (major: $ParaView_MAJOR)"
echo "dir: $ParaView_DIR"
[ -d "$ParaView_DIR" ] || echo "WARNING: directory does not exist"
}
......
......@@ -50,17 +50,25 @@ do
done
# set VERSION and MAJOR (version) variables
if [ -z "$ParaView_VERSION" ]
then
ParaView_VERSION=3.8.0
ParaView_MAJOR=unknown
echo "Warning in app/paraview3/bashrc:" 1>&2
echo " ParaView_VERSION not set, using '$ParaView_VERSION'" 1>&2
fi
[ -n "$ParaView_MAJOR" ] || ParaView_MAJOR=unknown
#- ParaView version, automatically determine major version
export ParaView_VERSION=3.8.0
export ParaView_MAJOR=detect
# Evaluate command-line parameters for ParaView
while [ $# -gt 0 ]
do
case "$1" in
ParaView*=*)
# name=value -> export name=value
eval "export $1"
;;
esac
shift
done
# if needed, set MAJOR version to correspond to VERSION
# set MAJOR version to correspond to VERSION
# ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
case "$ParaView_VERSION" in
"$ParaView_MAJOR".* )
......
......@@ -48,17 +48,24 @@ foreach cmake ( cmake-2.8.3 cmake-2.8.1 )
endif
end
# set VERSION and MAJOR (version) variables
if ( ! $?ParaView_VERSION )
then
setenv ParaView_VERSION 3.8.0
setenv ParaView_MAJOR unknown
echo "Warning in app/paraview3/cshrc:"
echo " ParaView_VERSION not set, using '$ParaView_VERSION'"
fi
if ( ! $?ParaView_MAJOR ) setenv ParaView_MAJOR unknown
#- ParaView version, automatically determine major version:
setenv ParaView_VERSION 3.8.0
setenv ParaView_MAJOR detect
# if needed, set MAJOR version to correspond to VERSION
# Evaluate command-line parameters for ParaView
while ( $#argv > 0 )
switch ($argv[1])
case ParaView*=*:
# name=value -> setenv name value
eval "setenv $argv[1]:s/=/ /"
breaksw
endsw
shift
end
# set MAJOR version to correspond to VERSION
# ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
switch ("$ParaView_VERSION")
case "$ParaView_MAJOR".*:
......
......@@ -57,10 +57,6 @@ foamInstall=$HOME/$WM_PROJECT
#- note the location for later use (eg, in job scripts)
: ${FOAM_INST_DIR:=$foamInstall}; export FOAM_INST_DIR
#- ParaView version, automatically determine major version:
export ParaView_VERSION=3.8.0
export ParaView_MAJOR=unknown
#- Compiler location:
# foamCompiler= system | ThirdParty (OpenFOAM)
foamCompiler=system
......
......@@ -56,10 +56,6 @@ set foamInstall = $HOME/$WM_PROJECT
#- note the location for later use (eg, in job scripts)
if ( ! $?FOAM_INST_DIR ) setenv FOAM_INST_DIR $foamInstall
#- ParaView version, automatically determine major version:
setenv ParaView_VERSION 3.8.0
setenv ParaView_MAJOR unknown
#- Compiler location:
# foamCompiler= system | ThirdParty (OpenFOAM)
set foamCompiler=system
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment