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 @@ ...@@ -2,7 +2,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
...@@ -44,9 +44,9 @@ alias wmDP 'wmSET WM_PRECISION_OPTION=DP' ...@@ -44,9 +44,9 @@ alias wmDP 'wmSET WM_PRECISION_OPTION=DP'
alias wmSchedON 'setenv WM_SCHEDULER $WM_PROJECT_DIR/wmake/wmakeScheduler' alias wmSchedON 'setenv WM_SCHEDULER $WM_PROJECT_DIR/wmake/wmakeScheduler'
alias wmSchedOFF 'unsetenv WM_SCHEDULER' 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 # Change directory aliases
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
...@@ -44,16 +44,13 @@ alias wmDP='wmSET WM_PRECISION_OPTION=DP' ...@@ -44,16 +44,13 @@ alias wmDP='wmSET WM_PRECISION_OPTION=DP'
alias wmSchedON='export WM_SCHEDULER=$WM_PROJECT_DIR/wmake/wmakeScheduler' alias wmSchedON='export WM_SCHEDULER=$WM_PROJECT_DIR/wmake/wmakeScheduler'
alias wmSchedOFF='unset WM_SCHEDULER' alias wmSchedOFF='unset WM_SCHEDULER'
# Change paraview version # Change ParaView version
# ~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~
unset foamPV unset foamPV
foamPV() foamPV()
{ {
export ParaView_VERSION=$1 . $WM_PROJECT_DIR/etc/apps/paraview3/bashrc ParaView_VERSION=$1
. $WM_PROJECT_DIR/etc/apps/paraview3/bashrc
echo "paraview-$ParaView_VERSION (major: $ParaView_MAJOR)" 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 ...@@ -50,17 +50,25 @@ do
done done
# set VERSION and MAJOR (version) variables #- ParaView version, automatically determine major version
if [ -z "$ParaView_VERSION" ] export ParaView_VERSION=3.8.0
then export ParaView_MAJOR=detect
ParaView_VERSION=3.8.0
ParaView_MAJOR=unknown
echo "Warning in app/paraview3/bashrc:" 1>&2 # Evaluate command-line parameters for ParaView
echo " ParaView_VERSION not set, using '$ParaView_VERSION'" 1>&2 while [ $# -gt 0 ]
fi do
[ -n "$ParaView_MAJOR" ] || ParaView_MAJOR=unknown 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 # ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
case "$ParaView_VERSION" in case "$ParaView_VERSION" in
"$ParaView_MAJOR".* ) "$ParaView_MAJOR".* )
......
...@@ -48,17 +48,24 @@ foreach cmake ( cmake-2.8.3 cmake-2.8.1 ) ...@@ -48,17 +48,24 @@ foreach cmake ( cmake-2.8.3 cmake-2.8.1 )
endif endif
end end
# set VERSION and MAJOR (version) variables #- ParaView version, automatically determine major version:
if ( ! $?ParaView_VERSION ) setenv ParaView_VERSION 3.8.0
then setenv ParaView_MAJOR detect
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
# 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 # ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
switch ("$ParaView_VERSION") switch ("$ParaView_VERSION")
case "$ParaView_MAJOR".*: case "$ParaView_MAJOR".*:
......
...@@ -57,10 +57,6 @@ foamInstall=$HOME/$WM_PROJECT ...@@ -57,10 +57,6 @@ foamInstall=$HOME/$WM_PROJECT
#- note the location for later use (eg, in job scripts) #- note the location for later use (eg, in job scripts)
: ${FOAM_INST_DIR:=$foamInstall}; export FOAM_INST_DIR : ${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: #- Compiler location:
# foamCompiler= system | ThirdParty (OpenFOAM) # foamCompiler= system | ThirdParty (OpenFOAM)
foamCompiler=system foamCompiler=system
......
...@@ -56,10 +56,6 @@ set foamInstall = $HOME/$WM_PROJECT ...@@ -56,10 +56,6 @@ set foamInstall = $HOME/$WM_PROJECT
#- note the location for later use (eg, in job scripts) #- note the location for later use (eg, in job scripts)
if ( ! $?FOAM_INST_DIR ) setenv FOAM_INST_DIR $foamInstall 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: #- Compiler location:
# foamCompiler= system | ThirdParty (OpenFOAM) # foamCompiler= system | ThirdParty (OpenFOAM)
set foamCompiler=system 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