paraFoam: launches ParaView with Mesa OpenGL if exists

Can be overridden to use System GL by setting "export ParaView_GL=system" in .bashrc
This commit is contained in:
Chris Greenshields
2019-01-08 16:54:17 +00:00
parent f934eabb0d
commit 6257b17a4c
3 changed files with 13 additions and 15 deletions

View File

@ -3,7 +3,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -61,19 +61,10 @@ error() {
}
pvExec () {
paraview "$@" 2> /dev/null && return 0
_opt=""
[ "$ParaView_GL" = mesa ] && _opt="--mesa"
pvFallback
paraview --mesa "$@"
}
pvFallback () {
cat <<EOF
**********************************************************
ParaView failed to open using available graphics hardware.
Trying fallback to software rendering using MESA.
**********************************************************
EOF
paraview $_opt "$@"
}
noPVReader () {

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -63,6 +63,8 @@ setenv ParaView_VERSION 5.4.0
#setenv ParaView_VERSION 5.5.0
setenv ParaView_MAJOR detect
#setenv ParaView_GL=system
setenv ParaView_GL=mesa
# Evaluate command-line parameters for ParaView
while ( $#argv > 0 )
@ -127,6 +129,7 @@ if ( -r $ParaView_DIR || -r $paraviewInstDir ) then
setenv PYTHONPATH ${paraviewPython}:$ParaView_LIB_DIR
endif
endif
if ("$ParaView_GL" == mesa) alias paraview 'paraview --mesa'
else
unsetenv PV_PLUGIN_PATH
endif

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -69,6 +69,8 @@ export ParaView_VERSION=5.4.0
#export ParaView_VERSION=5.5.0
export ParaView_MAJOR=detect
#export ParaView_GL=system
export ParaView_GL=mesa
# Evaluate command-line parameters for ParaView
_foamParaviewEval()
@ -144,6 +146,8 @@ then
export PYTHONPATH=$paraviewPython:$ParaView_LIB_DIR
fi
fi
[ "$ParaView_GL" = mesa ] && alias paraview="paraview --mesa"
else
unset PV_PLUGIN_PATH
fi