mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
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:
17
bin/paraFoam
17
bin/paraFoam
@ -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 () {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user