mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
CONFIG: handle different paraview (paraFoam) module names
For example, - ParaFoamReader = (paraview >= 5.7) - libParaFoamReader = (paraview < 5.7) and (OPENFOAM > 1912) - libPVFoamReader_SM = (OPENFOAM <= 1912)
This commit is contained in:
78
bin/paraFoam
78
bin/paraFoam
@ -7,11 +7,10 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# Copyright (C) 2016-2018 OpenCFD Ltd.
|
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
# <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
#
|
||||||
# Script
|
# Script
|
||||||
# paraFoam
|
# paraFoam
|
||||||
@ -76,9 +75,9 @@ unset FOAM_ABORT
|
|||||||
# already 2010-07)
|
# already 2010-07)
|
||||||
export LC_ALL=C
|
export LC_ALL=C
|
||||||
|
|
||||||
# Reader extension and plugin
|
# Default reader extension and plugin name
|
||||||
extension=OpenFOAM
|
extension=OpenFOAM
|
||||||
plugin=PVFoamReader
|
plugin=foamReader
|
||||||
|
|
||||||
# Parse options
|
# Parse options
|
||||||
unset regionName optTouch
|
unset regionName optTouch
|
||||||
@ -90,7 +89,7 @@ do
|
|||||||
;;
|
;;
|
||||||
-block*)
|
-block*)
|
||||||
extension=blockMesh
|
extension=blockMesh
|
||||||
plugin=PVblockMeshReader
|
plugin=blockReader
|
||||||
;;
|
;;
|
||||||
-vtk | -built*)
|
-vtk | -built*)
|
||||||
extension=foam
|
extension=foam
|
||||||
@ -139,32 +138,71 @@ done
|
|||||||
|
|
||||||
if [ -n "$plugin" ]
|
if [ -n "$plugin" ]
|
||||||
then
|
then
|
||||||
pluginError="Cannot use ParaView reader module library ($plugin)"
|
pluginError="Cannot use ParaView/OpenFOAM reader modules"
|
||||||
|
|
||||||
# Check if requested reader module exists
|
# Check if requested reader module exists
|
||||||
if [ -z "$PV_PLUGIN_PATH" ]
|
if [ -z "$PV_PLUGIN_PATH" ]
|
||||||
then
|
then
|
||||||
|
echo "The PV_PLUGIN_PATH environment variable is unset" 1>&2
|
||||||
echo "$pluginError" 1>&2
|
echo "$pluginError" 1>&2
|
||||||
echo "The PV_PLUGIN_PATH environment value is not set" 1>&2
|
else
|
||||||
elif [ -f "$PV_PLUGIN_PATH/lib${plugin}_SM.so" ]
|
|
||||||
|
# Check for different names. For example,
|
||||||
|
# - ParaFoamReader = (paraview >= 5.7)
|
||||||
|
# - libParaFoamReader = (paraview < 5.7) and (OPENFOAM > 1912)
|
||||||
|
# - libPVFoamReader_SM = (OPENFOAM <= 1912)
|
||||||
|
|
||||||
|
case "$plugin" in
|
||||||
|
blockReader)
|
||||||
|
for libName in \
|
||||||
|
ParaFoamBlockReader \
|
||||||
|
libParaFoamBlockReader \
|
||||||
|
libPVblockMeshReader_SM \
|
||||||
|
;
|
||||||
|
do
|
||||||
|
if [ -f "$PV_PLUGIN_PATH/$libName.so" ]
|
||||||
then
|
then
|
||||||
unset pluginError
|
unset pluginError
|
||||||
else
|
break
|
||||||
echo "$pluginError - not built?" 1>&2
|
fi
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
foamReader)
|
||||||
|
for libName in \
|
||||||
|
ParaFoamReader \
|
||||||
|
libParaFoamReader \
|
||||||
|
libPVFoamReader_SM \
|
||||||
|
;
|
||||||
|
do
|
||||||
|
if [ -f "$PV_PLUGIN_PATH/$libName.so" ]
|
||||||
|
then
|
||||||
|
unset pluginError
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -n "$pluginError" ]
|
||||||
|
then
|
||||||
cat<< NO_PLUGIN 1>&2
|
cat<< NO_PLUGIN 1>&2
|
||||||
Consider building the reader module
|
=========================
|
||||||
cd \$WM_PROJECT_DIR/applications/utilities/postProcessing/graphics/PVReaders
|
$pluginError - need to build?
|
||||||
./Allwclean
|
|
||||||
./Allwmake
|
cd \$WM_PROJECT_DIR/modules/visualization/src/paraview-plugins
|
||||||
|
OR cd \$WM_PROJECT_DIR/applications/utilities/postProcessing/graphics/PVReaders
|
||||||
|
|
||||||
|
./Allwclean && ./Allwmake
|
||||||
|
=========================
|
||||||
NO_PLUGIN
|
NO_PLUGIN
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "$pluginError" ]
|
if [ -n "$pluginError" ]
|
||||||
then
|
then
|
||||||
# Fallback to native reader, if possible
|
# Fallback to native reader, if possible
|
||||||
if [ "$plugin" = PVFoamReader ]
|
if [ "$plugin" = foamReader ]
|
||||||
then
|
then
|
||||||
echo 1>&2
|
|
||||||
echo "Continuing with builtin reader: paraFoam -vtk" 1>&2
|
echo "Continuing with builtin reader: paraFoam -vtk" 1>&2
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
extension=foam
|
extension=foam
|
||||||
@ -291,7 +329,7 @@ else
|
|||||||
# Check existence of essential files
|
# Check existence of essential files
|
||||||
warn=false
|
warn=false
|
||||||
case "$plugin" in
|
case "$plugin" in
|
||||||
PVblockMeshReader)
|
blockReader)
|
||||||
blockMeshDict=system/blockMeshDict
|
blockMeshDict=system/blockMeshDict
|
||||||
if [ -f constant/polyMesh/blockMeshDict ]
|
if [ -f constant/polyMesh/blockMeshDict ]
|
||||||
then
|
then
|
||||||
@ -301,7 +339,7 @@ else
|
|||||||
hasFiles system/controlDict "$blockMeshDict" || warn=true
|
hasFiles system/controlDict "$blockMeshDict" || warn=true
|
||||||
;;
|
;;
|
||||||
|
|
||||||
PVFoamReader)
|
foamReader)
|
||||||
hasFiles \
|
hasFiles \
|
||||||
system/controlDict \
|
system/controlDict \
|
||||||
"$fvControls/fvSchemes" \
|
"$fvControls/fvSchemes" \
|
||||||
@ -318,9 +356,9 @@ else
|
|||||||
|
|
||||||
# Only create/remove caseFile if it did not previously exist
|
# Only create/remove caseFile if it did not previously exist
|
||||||
[ -e "$caseFile" ] || {
|
[ -e "$caseFile" ] || {
|
||||||
trap "rm -f $caseFile 2>/dev/null; exit 0" EXIT TERM INT
|
|
||||||
touch "$caseFile"
|
touch "$caseFile"
|
||||||
echo "Created temporary '$caseFile'" 1>&2
|
echo "Created temporary '$caseFile'" 1>&2
|
||||||
|
trap "rm -f \"$caseFile\"; exit 0" EXIT TERM INT
|
||||||
}
|
}
|
||||||
|
|
||||||
# For now filter out any ld.so errors. Caused by non-system compiler?
|
# For now filter out any ld.so errors. Caused by non-system compiler?
|
||||||
|
|||||||
Reference in New Issue
Block a user