mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'adjust-config-foundation-merge' into 'merge-foundation'
Adjust config foundation merge Rationalize config files, foamy build, tutorials. See merge request !63
This commit is contained in:
@ -8,10 +8,6 @@ wmake -all $targetType extrude
|
||||
wmake -all $targetType extrude2DMesh
|
||||
wmake -all $targetType snappyHexMesh
|
||||
|
||||
if [ -n "$FOAMY_HEX_MESH" ]
|
||||
then
|
||||
foamyMesh/Allwmake $targetType $*
|
||||
fi
|
||||
|
||||
foamyMesh/Allwmake $targetType $*
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -25,8 +25,6 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
$(CGAL_LIBS) \
|
||||
-lmpfr \
|
||||
-lboost_thread \
|
||||
-lconformalVoronoiMesh \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
|
||||
@ -22,9 +22,6 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
$(CGAL_LIBS) \
|
||||
-lboost_thread \
|
||||
-lmpfr \
|
||||
-lgmp \
|
||||
-lconformalVoronoiMesh \
|
||||
-ldecompositionMethods /* -L$(FOAM_LIBBIN)/dummy -lscotchDecomp */ \
|
||||
-ldecompose \
|
||||
|
||||
@ -16,8 +16,6 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
$(CGAL_LIBS) \
|
||||
-lboost_thread \
|
||||
-lmpfr \
|
||||
-L$(FASTDUALOCTREE_SRC_PATH) -lperf_main \
|
||||
-lGL \
|
||||
-lconformalVoronoiMesh \
|
||||
|
||||
@ -57,7 +57,7 @@ export FOAM_INST_DIR=$HOME/$WM_PROJECT
|
||||
# $FOAM_INST_DIR/site/$WM_PROJECT_VERSION or $FOAM_INST_DIR/site
|
||||
|
||||
#- Compiler location:
|
||||
# WM_COMPILER_TYPE= system | ThirdParty (OpenFOAM)
|
||||
# WM_COMPILER_TYPE= system | ThirdParty
|
||||
export WM_COMPILER_TYPE=system
|
||||
|
||||
#- Compiler:
|
||||
@ -173,10 +173,7 @@ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/paraview`
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/ensight`
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/gperftools`
|
||||
|
||||
if [ ! -z "$FOAMY_HEX_MESH" ]
|
||||
then
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL`
|
||||
fi
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL`
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch`
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/FFTW`
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@ alias foamVersion \
|
||||
# Change ParaView version
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~
|
||||
alias foamPV \
|
||||
'source $WM_PROJECT_DIR/etc/config.csh/paraview ParaView_VERSION=\!*; echo paraview-$ParaView_VERSION'
|
||||
'source $WM_PROJECT_DIR/etc/config.csh/paraview ParaView_VERSION=\!*; echo ${ParaView_DIR:t}'
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -31,7 +31,6 @@
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
switch ("$WM_COMPILER_TYPE")
|
||||
case OpenFOAM:
|
||||
case ThirdParty:
|
||||
# Default versions of GMP, MPFR and MPC, override as necessary
|
||||
set gmp_version=gmp-system
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
@ -25,40 +25,50 @@
|
||||
# config.csh/paraview
|
||||
#
|
||||
# Description
|
||||
# Setup file for paraview-[3-5].x
|
||||
# Setup file for paraview (and cmake)
|
||||
# Sourced from OpenFOAM-<VERSION>/etc/cshrc or from foamPV alias
|
||||
#
|
||||
# Note
|
||||
# The env. variables 'ParaView_DIR' and 'ParaView_MAJOR'
|
||||
# are required for building plugins
|
||||
# If using system-wide installation for cmake, use the following settings:
|
||||
#
|
||||
# cmake_version=cmake-system
|
||||
#
|
||||
# Note
|
||||
# The following env. variables are required for building plugins:
|
||||
# ParaView_DIR
|
||||
# ParaView_INCLUDE_DIR
|
||||
# PV_PLUGIN_PATH
|
||||
#
|
||||
# If using a central installation not located under ThirdParty, you will
|
||||
# need to set some environment values directly. For example,
|
||||
#
|
||||
# setenv ParaView_DIR /opt/paraview/paraview-5.0.1
|
||||
# setenv ParaView_INCLUDE_DIR $ParaView_DIR/include/paraview-5.0
|
||||
# setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-5.0
|
||||
#
|
||||
# setenv PATH ${ParaView_DIR}/bin:${PATH}
|
||||
# setenv LD_LIBRARY_PATH ${ParaView_DIR}/lib/paraview-5.0:${LD_LIBRARY_PATH}
|
||||
# unsetenv ParaView_VERSION # avoid using ThirdParty settings
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
setenv ParaView_VERSION 5.0.1
|
||||
setenv ParaView_MAJOR detect # Automatically determine major version
|
||||
|
||||
set cmake_version=cmake-system
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Clean the PATH
|
||||
set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-"`
|
||||
if ( $status == 0 ) setenv PATH $cleaned
|
||||
|
||||
# Determine the cmake to be used
|
||||
# Environment for ThirdParty cmake
|
||||
unsetenv CMAKE_HOME
|
||||
foreach cmake ( cmake-3.2.1 cmake-2.8.12.1 cmake-2.8.8 cmake-2.8.4 cmake-2.8.3 cmake-2.8.1 )
|
||||
set cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake
|
||||
if ( -r $cmake ) then
|
||||
setenv CMAKE_HOME $cmake
|
||||
setenv PATH ${CMAKE_HOME}/bin:${PATH}
|
||||
break
|
||||
endif
|
||||
end
|
||||
|
||||
#- ParaView version, automatically determine major version:
|
||||
#setenv ParaView_VERSION 3.12.0
|
||||
#setenv ParaView_VERSION 4.0.1
|
||||
#setenv ParaView_VERSION 4.1.0
|
||||
#setenv ParaView_VERSION 4.3.1
|
||||
#setenv ParaView_VERSION 4.4.0
|
||||
#setenv ParaView_VERSION 5.0.0
|
||||
setenv ParaView_VERSION 5.0.1
|
||||
setenv ParaView_MAJOR detect
|
||||
|
||||
set cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake_version
|
||||
if ( -r $cmake ) then
|
||||
setenv CMAKE_HOME $cmake
|
||||
setenv PATH ${CMAKE_HOME}/bin:${PATH}
|
||||
endif
|
||||
|
||||
# Evaluate command-line parameters for ParaView
|
||||
while ( $#argv > 0 )
|
||||
@ -72,62 +82,64 @@ while ( $#argv > 0 )
|
||||
end
|
||||
|
||||
|
||||
# Set MAJOR version to correspond to VERSION
|
||||
# ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
|
||||
switch ("$ParaView_VERSION")
|
||||
case "$ParaView_MAJOR".*:
|
||||
# Version and major appear to correspond
|
||||
breaksw
|
||||
# Require that ParaView_VERSION has not been unset.
|
||||
# Avoids conflict with an alternative (non-ThirdParty) installation.
|
||||
if ( $?ParaView_VERSION ) then
|
||||
|
||||
case [0-9]*:
|
||||
# Extract major from the version
|
||||
setenv ParaView_MAJOR `echo ${ParaView_VERSION} | \
|
||||
sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
|
||||
breaksw
|
||||
endsw
|
||||
# Set MAJOR version to correspond to VERSION
|
||||
# ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
|
||||
switch ("$ParaView_VERSION")
|
||||
case "$ParaView_MAJOR".*:
|
||||
# Version and major appear to correspond
|
||||
breaksw
|
||||
|
||||
case [0-9]*:
|
||||
# Extract major from the version
|
||||
setenv ParaView_MAJOR `echo ${ParaView_VERSION} | \
|
||||
sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
|
||||
breaksw
|
||||
endsw
|
||||
|
||||
set paraviewInstDir=$WM_THIRD_PARTY_DIR/ParaView-${ParaView_VERSION}
|
||||
set paraviewArchName=ParaView-$ParaView_VERSION
|
||||
set pvName=ParaView-$ParaView_VERSION
|
||||
set pvMajor=paraview-$ParaView_MAJOR
|
||||
set pvSrcDir=$WM_THIRD_PARTY_DIR/$pvName
|
||||
|
||||
setenv ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$paraviewArchName
|
||||
setenv ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$pvName
|
||||
|
||||
# Set paths if binaries or source are present
|
||||
if ( -r $ParaView_DIR || -r $paraviewInstDir ) then
|
||||
setenv ParaView_INCLUDE_DIR $ParaView_DIR/include/paraview-${ParaView_MAJOR}
|
||||
if (! -r $ParaView_INCLUDE_DIR && -r $ParaView_DIR/include/paraview-3.0) then
|
||||
setenv ParaView_INCLUDE_DIR $ParaView_DIR/include/paraview-3.0
|
||||
endif
|
||||
# Set paths if binaries or source are present
|
||||
if ( -r $ParaView_DIR || -r $pvSrcDir ) then
|
||||
set pvLibDir=${ParaView_DIR}/lib/$pvMajor
|
||||
set pvPython=$ParaView_DIR/Utilities/VTKPythonWrapping
|
||||
|
||||
set ParaView_LIB_DIR=${ParaView_DIR}/lib/paraview-${ParaView_MAJOR}
|
||||
setenv ParaView_INCLUDE_DIR $ParaView_DIR/include/$pvMajor
|
||||
setenv PV_PLUGIN_PATH $FOAM_LIBBIN/$pvMajor
|
||||
setenv PATH ${ParaView_DIR}/bin:${PATH}
|
||||
setenv LD_LIBRARY_PATH "${pvLibDir}:${LD_LIBRARY_PATH}"
|
||||
|
||||
setenv PATH ${ParaView_DIR}/bin:${PATH}
|
||||
setenv LD_LIBRARY_PATH "${ParaView_LIB_DIR}:${LD_LIBRARY_PATH}"
|
||||
setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-${ParaView_MAJOR}
|
||||
|
||||
if ($?FOAM_VERBOSE && $?prompt) then
|
||||
echo "Using paraview"
|
||||
echo " ParaView_DIR : $ParaView_DIR"
|
||||
echo " ParaView_LIB_DIR : $ParaView_LIB_DIR"
|
||||
echo " ParaView_INCLUDE_DIR : $ParaView_INCLUDE_DIR"
|
||||
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH"
|
||||
endif
|
||||
|
||||
|
||||
# Add in python libraries if required
|
||||
set paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
|
||||
if ( -r $paraviewPython ) then
|
||||
if ($?PYTHONPATH) then
|
||||
setenv PYTHONPATH ${PYTHONPATH}:${paraviewPython}:$ParaView_LIB_DIR
|
||||
else
|
||||
setenv PYTHONPATH ${paraviewPython}:$ParaView_LIB_DIR
|
||||
# Add in python libraries if required
|
||||
if ( -r $pvPython ) then
|
||||
if ($?PYTHONPATH) then
|
||||
setenv PYTHONPATH ${PYTHONPATH}:${pvPython}:$pvLibDir
|
||||
else
|
||||
setenv PYTHONPATH ${pvPython}:$pvLibDir
|
||||
endif
|
||||
endif
|
||||
|
||||
if ($?FOAM_VERBOSE && $?prompt) then
|
||||
echo "Using paraview"
|
||||
echo " ParaView_DIR : $ParaView_DIR"
|
||||
echo " ParaView_INCLUDE_DIR : $ParaView_INCLUDE_DIR"
|
||||
echo " library dir : $pvLibDir"
|
||||
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH"
|
||||
endif
|
||||
else
|
||||
unsetenv ParaView_INCLUDE_DIR PV_PLUGIN_PATH
|
||||
setenv ParaView_DIR # Defined but empty (used by foamPV alias)
|
||||
endif
|
||||
else
|
||||
unsetenv PV_PLUGIN_PATH
|
||||
|
||||
endif
|
||||
|
||||
|
||||
unset cleaned cmake paraviewInstDir paraviewPython
|
||||
unset cleaned cmake cmake_version pvName pvMajor pvSrcDir pvLibDir pvPython
|
||||
unsetenv ParaView_VERSION ParaView_MAJOR
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -204,14 +204,9 @@ _foamAddLib ${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}:${FOAM_EXT_L
|
||||
unset gcc_version gmp_version mpfr_version mpc_version
|
||||
unsetenv GMP_ARCH_PATH MPFR_ARCH_PATH
|
||||
|
||||
|
||||
# Location of compiler installation
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
if ( ! $?WM_COMPILER_TYPE ) then
|
||||
setenv WM_COMPILER_TYPE system
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
|
||||
echo " WM_COMPILER_TYPE not set, using '$WM_COMPILER_TYPE'"
|
||||
endif
|
||||
# Compiler installation - default to system
|
||||
# ~~~~~~~~~~~~~~~~~~~~~
|
||||
if ( ! $?WM_COMPILER_TYPE ) setenv WM_COMPILER_TYPE system
|
||||
|
||||
# Load configured compiler versions, regardless of the compiler type
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@ -235,13 +230,16 @@ case ThirdParty:
|
||||
|
||||
# Check that the compiler directory can be found
|
||||
if ( ! -d "$gccDir" ) then
|
||||
echo
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
|
||||
echo " Cannot find $gccDir installation."
|
||||
echo " Please install this compiler version or if you wish to" \
|
||||
" use the system compiler,"
|
||||
echo " change the 'WM_COMPILER_TYPE' setting to 'system'"
|
||||
echo
|
||||
cat << GCC_NOT_FOUND
|
||||
===============================================================================
|
||||
Warning in $WM_PROJECT_DIR/etc/config.csh/settings:
|
||||
Cannot find '$WM_COMPILER' compiler installation
|
||||
$gccDir
|
||||
|
||||
Either install this compiler version, or use the system compiler by setting
|
||||
WM_COMPILER_TYPE to 'system' in \$WM_PROJECT_DIR/etc/cshrc.
|
||||
===============================================================================
|
||||
GCC_NOT_FOUND
|
||||
endif
|
||||
|
||||
_foamAddMan $gccDir/man
|
||||
@ -268,18 +266,22 @@ case ThirdParty:
|
||||
echo " ${gccDir:t} (${gmpDir:t} ${mpfrDir:t} ${mpcDir:t})"
|
||||
endif
|
||||
endif
|
||||
|
||||
if ( $?clang_version ) then
|
||||
set clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version
|
||||
|
||||
# Check that the compiler directory can be found
|
||||
if ( ! -d "$clangDir" ) then
|
||||
echo
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
|
||||
echo " Cannot find $clangDir installation."
|
||||
echo " Please install this compiler version or if you wish to" \
|
||||
" use the system compiler,"
|
||||
echo " change the 'WM_COMPILER_TYPE' setting to 'system'"
|
||||
echo
|
||||
cat << CLANG_NOT_FOUND
|
||||
===============================================================================
|
||||
Warning in $WM_PROJECT_DIR/etc/config.csh/settings:
|
||||
Cannot find '$WM_COMPILER' compiler installation
|
||||
$clangDir
|
||||
|
||||
Either install this compiler version, or use the system compiler by setting
|
||||
WM_COMPILER_TYPE to 'system' in \$WM_PROJECT_DIR/etc/cshrc.
|
||||
===============================================================================
|
||||
CLANG_NOT_FOUND
|
||||
endif
|
||||
|
||||
_foamAddMan $clangDir/man
|
||||
|
||||
@ -136,12 +136,6 @@ unsetenv GMP_ARCH_PATH
|
||||
unsetenv MPFR_ARCH_PATH
|
||||
unsetenv SCOTCH_ARCH_PATH
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Unset foamyHexMesh-related environment variables
|
||||
|
||||
unsetenv FOAMY_HEX_MESH
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Cleanup environment
|
||||
# PATH, LD_LIBRARY_PATH, MANPATH
|
||||
|
||||
@ -70,7 +70,7 @@ alias run='cd $FOAM_RUN'
|
||||
# Refresh the environment
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# For backward-compatibility unalias wmRefresh if it is defined as an alias
|
||||
[ "$(type -t wmRefresh)" = "alias" ] && unalias wmRefresh || unset wmRefresh
|
||||
[ "$(type -t wmRefresh)" = "alias" ] && unalias wmRefresh || unset -f wmRefresh
|
||||
wmRefresh()
|
||||
{
|
||||
wmProjectDir=$WM_PROJECT_DIR
|
||||
@ -82,7 +82,7 @@ wmRefresh()
|
||||
|
||||
# Change OpenFOAM version
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~
|
||||
unset foamVersion
|
||||
unset -f foamVersion
|
||||
foamVersion()
|
||||
{
|
||||
if [ "$1" ]; then
|
||||
@ -99,11 +99,12 @@ foamVersion()
|
||||
|
||||
# Change ParaView version
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~
|
||||
unset foamPV
|
||||
unset -f foamPV
|
||||
foamPV()
|
||||
{
|
||||
. $WM_PROJECT_DIR/etc/config.sh/paraview ParaView_VERSION=${1:-none}
|
||||
echo "paraview-$ParaView_VERSION (major: $ParaView_MAJOR)" 1>&2
|
||||
. $WM_PROJECT_DIR/etc/config.sh/paraview "${@+ParaView_VERSION=$1}"
|
||||
local pvdir="${ParaView_DIR##*/}"
|
||||
echo "${pvdir:-ParaView_DIR not set}" 1>&2
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
case "$WM_COMPILER_TYPE" in
|
||||
OpenFOAM | ThirdParty)
|
||||
ThirdParty)
|
||||
# Default versions of GMP, MPFR and MPC, override as necessary
|
||||
gmp_version=gmp-system
|
||||
mpfr_version=mpfr-system
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
@ -25,12 +25,37 @@
|
||||
# etc/config.sh/paraview
|
||||
#
|
||||
# Description
|
||||
# Setup file for paraview-[3-5].x
|
||||
# Setup file for paraview (& cmake)
|
||||
# Sourced from OpenFOAM-<VERSION>/etc/bashrc or from foamPV alias
|
||||
#
|
||||
# If using system-wide installation for cmake, use the following settings:
|
||||
#
|
||||
# cmake_version=cmake-system
|
||||
#
|
||||
# Note
|
||||
# The env. variables 'ParaView_DIR' and 'ParaView_MAJOR'
|
||||
# are required for building plugins
|
||||
# The following env. variables are required for building plugins:
|
||||
# ParaView_DIR
|
||||
# ParaView_INCLUDE_DIR
|
||||
# PV_PLUGIN_PATH
|
||||
#
|
||||
# If using a central installation not located under ThirdParty, you will
|
||||
# need to set some environment values directly. For example,
|
||||
#
|
||||
# export ParaView_DIR=/opt/paraview/paraview-5.0.1
|
||||
# export ParaView_INCLUDE_DIR=$ParaView_DIR/include/paraview-5.0
|
||||
# export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-5.0
|
||||
#
|
||||
# export PATH=$ParaView_DIR/bin:$PATH
|
||||
# export LD_LIBRARY_PATH=$ParaView_DIR/lib/paraview-5.0:$LD_LIBRARY_PATH
|
||||
# unset ParaView_VERSION # avoid using ThirdParty settings
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
ParaView_VERSION=5.0.1
|
||||
ParaView_MAJOR=detect # Automatically determine major version
|
||||
|
||||
cmake_version=cmake-system
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Clean the PATH
|
||||
@ -41,32 +66,15 @@ cleaned=$($WM_PROJECT_DIR/bin/foamCleanPath "$PATH" \
|
||||
) \
|
||||
&& PATH="$cleaned"
|
||||
|
||||
# Determine the cmake to be used
|
||||
# Environment for ThirdParty cmake
|
||||
unset CMAKE_HOME
|
||||
for cmake in cmake-3.2.1 cmake-2.8.12.1 cmake-2.8.8 cmake-2.8.4 cmake-2.8.3 \
|
||||
cmake-2.8.1
|
||||
do
|
||||
cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake
|
||||
if [ -r $cmake ]
|
||||
then
|
||||
export CMAKE_HOME=$cmake
|
||||
export CMAKE_ROOT=$cmake
|
||||
export PATH=$CMAKE_HOME/bin:$PATH
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
#- ParaView version, automatically determine major version
|
||||
#export ParaView_VERSION=3.12.0
|
||||
#export ParaView_VERSION=4.0.1
|
||||
#export ParaView_VERSION=4.1.0
|
||||
#export ParaView_VERSION=4.3.1
|
||||
#export ParaView_VERSION=4.4.0
|
||||
#export ParaView_VERSION=5.0.0
|
||||
export ParaView_VERSION=5.0.1
|
||||
export ParaView_MAJOR=detect
|
||||
|
||||
cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake_version
|
||||
if [ -r $cmake ]
|
||||
then
|
||||
export CMAKE_HOME=$cmake
|
||||
export CMAKE_ROOT=$cmake
|
||||
export PATH=$CMAKE_HOME/bin:$PATH
|
||||
fi
|
||||
|
||||
# Evaluate command-line parameters for ParaView
|
||||
_foamParaviewEval()
|
||||
@ -86,67 +94,69 @@ _foamParaviewEval()
|
||||
# Evaluate command-line parameters
|
||||
_foamParaviewEval $@
|
||||
|
||||
|
||||
# Set MAJOR version to correspond to VERSION
|
||||
# ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
|
||||
case "$ParaView_VERSION" in
|
||||
"$ParaView_MAJOR".* )
|
||||
# Version and major appear to correspond
|
||||
;;
|
||||
|
||||
[0-9]*)
|
||||
# Extract major from the version
|
||||
ParaView_MAJOR=$(echo $ParaView_VERSION | \
|
||||
sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/')
|
||||
;;
|
||||
esac
|
||||
export ParaView_VERSION ParaView_MAJOR
|
||||
|
||||
paraviewInstDir=$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION
|
||||
paraviewArchName=ParaView-$ParaView_VERSION
|
||||
|
||||
export ParaView_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$paraviewArchName
|
||||
|
||||
# Set paths if binaries or source are present
|
||||
if [ -r $ParaView_DIR -o -r $paraviewInstDir ]
|
||||
# Require that ParaView_VERSION has not been unset.
|
||||
# Avoids conflict with an alternative (non-ThirdParty) installation.
|
||||
if [ -n "$ParaView_VERSION" ]
|
||||
then
|
||||
export ParaView_INCLUDE_DIR=$ParaView_DIR/include/paraview-$ParaView_MAJOR
|
||||
if [ ! -d $ParaView_INCLUDE_DIR -a -d $ParaView_DIR/include/paraview-3.0 ]
|
||||
|
||||
# Set MAJOR version to correspond to VERSION
|
||||
# ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
|
||||
case "$ParaView_VERSION" in
|
||||
"$ParaView_MAJOR".* )
|
||||
# Version and major appear to correspond
|
||||
;;
|
||||
|
||||
[0-9]*)
|
||||
# Extract major from the version
|
||||
ParaView_MAJOR=$(echo $ParaView_VERSION | \
|
||||
sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/')
|
||||
;;
|
||||
esac
|
||||
|
||||
pvName=ParaView-$ParaView_VERSION
|
||||
pvMajor=paraview-$ParaView_MAJOR
|
||||
pvSrcDir=$WM_THIRD_PARTY_DIR/$pvName
|
||||
|
||||
export ParaView_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$pvName
|
||||
|
||||
# Set paths if binaries or source are present
|
||||
if [ -r $ParaView_DIR -o -r $pvSrcDir ]
|
||||
then
|
||||
export ParaView_INCLUDE_DIR=$ParaView_DIR/include/paraview-3.0
|
||||
fi
|
||||
pvLibDir=$ParaView_DIR/lib/$pvMajor
|
||||
pvPython=$ParaView_DIR/Utilities/VTKPythonWrapping
|
||||
|
||||
ParaView_LIB_DIR=$ParaView_DIR/lib/paraview-$ParaView_MAJOR
|
||||
export ParaView_INCLUDE_DIR=$ParaView_DIR/include/$pvMajor
|
||||
export PV_PLUGIN_PATH=$FOAM_LIBBIN/$pvMajor
|
||||
export PATH=$ParaView_DIR/bin:$PATH
|
||||
export LD_LIBRARY_PATH=$pvLibDir:$LD_LIBRARY_PATH
|
||||
|
||||
export PATH=$ParaView_DIR/bin:$PATH
|
||||
export LD_LIBRARY_PATH=$ParaView_LIB_DIR:$LD_LIBRARY_PATH
|
||||
export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-$ParaView_MAJOR
|
||||
|
||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||
then
|
||||
echo "Using paraview"
|
||||
echo " ParaView_DIR : $ParaView_DIR"
|
||||
echo " ParaView_LIB_DIR : $ParaView_LIB_DIR"
|
||||
echo " ParaView_INCLUDE_DIR : $ParaView_INCLUDE_DIR"
|
||||
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH"
|
||||
fi
|
||||
|
||||
# Add in python libraries if required
|
||||
paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
|
||||
if [ -r $paraviewPython ]
|
||||
then
|
||||
if [ "$PYTHONPATH" ]
|
||||
# Add in python libraries if required
|
||||
if [ -r $pvPython ]
|
||||
then
|
||||
export PYTHONPATH=$PYTHONPATH:$paraviewPython:$ParaView_LIB_DIR
|
||||
else
|
||||
export PYTHONPATH=$paraviewPython:$ParaView_LIB_DIR
|
||||
if [ "$PYTHONPATH" ]
|
||||
then
|
||||
export PYTHONPATH=$PYTHONPATH:$pvPython:$pvLibDir
|
||||
else
|
||||
export PYTHONPATH=$pvPython:$pvLibDir
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||
then
|
||||
echo "Using paraview"
|
||||
echo " ParaView_DIR : $ParaView_DIR"
|
||||
echo " ParaView_INCLUDE_DIR : $ParaView_INCLUDE_DIR"
|
||||
echo " library dir : $pvLibDir"
|
||||
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH"
|
||||
fi
|
||||
else
|
||||
unset ParaView_DIR ParaView_INCLUDE_DIR PV_PLUGIN_PATH
|
||||
fi
|
||||
else
|
||||
unset PV_PLUGIN_PATH
|
||||
|
||||
fi
|
||||
|
||||
unset _foamParaviewEval
|
||||
unset cleaned cmake paraviewInstDir paraviewPython
|
||||
unset -f _foamParaviewEval
|
||||
unset cleaned cmake cmake_version pvName pvMajor pvSrcDir pvLibDir pvPython
|
||||
unset ParaView_VERSION ParaView_MAJOR
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -206,14 +206,9 @@ _foamAddLib $FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN:$FOAM_LIBBIN:$FOAM_EXT_LIBBIN:$
|
||||
unset gcc_version gmp_version mpfr_version mpc_version
|
||||
unset GMP_ARCH_PATH MPFR_ARCH_PATH
|
||||
|
||||
# Location of compiler installation
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
if [ -z "$WM_COMPILER_TYPE" ]
|
||||
then
|
||||
WM_COMPILER_TYPE=system
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/settings:" 1>&2
|
||||
echo " WM_COMPILER_TYPE not set, using '$WM_COMPILER_TYPE'" 1>&2
|
||||
fi
|
||||
# Compiler installation - default to system
|
||||
# ~~~~~~~~~~~~~~~~~~~~~
|
||||
: ${WM_COMPILER_TYPE:=system}; export WM_COMPILER_TYPE
|
||||
|
||||
# Load configured compiler versions, regardless of the compiler type
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@ -232,15 +227,16 @@ OpenFOAM | ThirdParty)
|
||||
mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/${mpc_version:-mpc-system}
|
||||
|
||||
# Check that the compiler directory can be found
|
||||
[ -d "$gccDir" ] || {
|
||||
echo 1>&2
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/settings:" 1>&2
|
||||
echo " Cannot find $gccDir installation." 1>&2
|
||||
echo " Please install this compiler version or if you wish to" \
|
||||
" use the system compiler," 1>&2
|
||||
echo " change the 'WM_COMPILER_TYPE' setting to 'system'" 1>&2
|
||||
echo
|
||||
}
|
||||
[ -d "$gccDir" ] || cat << GCC_NOT_FOUND 1>&2
|
||||
===============================================================================
|
||||
Warning in $WM_PROJECT_DIR/etc/config.sh/settings:
|
||||
Cannot find '$WM_COMPILER' compiler installation
|
||||
$gccDir
|
||||
|
||||
Either install this compiler version, or use the system compiler by setting
|
||||
WM_COMPILER_TYPE to 'system' in \$WM_PROJECT_DIR/etc/bashrc.
|
||||
===============================================================================
|
||||
GCC_NOT_FOUND
|
||||
|
||||
_foamAddMan $gccDir/man
|
||||
_foamAddPath $gccDir/bin
|
||||
@ -276,15 +272,16 @@ OpenFOAM | ThirdParty)
|
||||
clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version
|
||||
|
||||
# Check that the compiler directory can be found
|
||||
[ -d "$clangDir" ] || {
|
||||
echo 1>&2
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/settings:" 1>&2
|
||||
echo " Cannot find $clangDir installation." 1>&2
|
||||
echo " Please install this compiler version or if you wish to" \
|
||||
" use the system compiler," 1>&2
|
||||
echo " change the 'WM_COMPILER_TYPE' setting to 'system'" 1>&2
|
||||
echo 1>&2
|
||||
}
|
||||
[ -d "$clangDir" ] || cat << CLANG_NOT_FOUND 1>&2
|
||||
===============================================================================
|
||||
Warning in $WM_PROJECT_DIR/etc/config.sh/settings:
|
||||
Cannot find '$WM_COMPILER' compiler installation
|
||||
$clangDir
|
||||
|
||||
Either install this compiler version, or use the system compiler by setting
|
||||
WM_COMPILER_TYPE to 'system' in \$WM_PROJECT_DIR/etc/bashrc.
|
||||
===============================================================================
|
||||
CLANG_NOT_FOUND
|
||||
|
||||
_foamAddMan $clangDir/share/man
|
||||
_foamAddPath $clangDir/bin
|
||||
|
||||
@ -132,12 +132,6 @@ unset GMP_ARCH_PATH
|
||||
unset MPFR_ARCH_PATH
|
||||
unset SCOTCH_ARCH_PATH
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Unset foamyHexMesh-related environment variables
|
||||
|
||||
unset FOAMY_HEX_MESH
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Cleanup environment
|
||||
# PATH, LD_LIBRARY_PATH, MANPATH
|
||||
@ -183,9 +177,9 @@ unalias util
|
||||
unalias tut
|
||||
unalias run
|
||||
|
||||
unset wmRefresh
|
||||
unset foamVersion
|
||||
unset foamPV
|
||||
unset -f wmRefresh
|
||||
unset -f foamVersion
|
||||
unset -f foamPV
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -57,7 +57,7 @@ echo $FOAM_INST_DIR
|
||||
# $FOAM_INST_DIR/site/$WM_PROJECT_VERSION or $FOAM_INST_DIR/site
|
||||
|
||||
#- Compiler location:
|
||||
# WM_COMPILER_TYPE = system | ThirdParty (OpenFOAM)
|
||||
# WM_COMPILER_TYPE = system | ThirdParty
|
||||
setenv WM_COMPILER_TYPE system
|
||||
|
||||
#- Compiler:
|
||||
@ -218,9 +218,7 @@ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/mpi`
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/paraview`
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/ensight`
|
||||
|
||||
if ( ($?FOAMY_HEX_MESH) ) then
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/CGAL`
|
||||
endif
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/CGAL`
|
||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/FFTW`
|
||||
|
||||
|
||||
|
||||
@ -121,7 +121,78 @@ int Foam::functionObjects::ddt2::process(const word& fieldName)
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::ddt2::process()
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::ddt2::ddt2
|
||||
(
|
||||
const word& name,
|
||||
const Time& runTime,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fvMeshFunctionObject(name, runTime, dict),
|
||||
selectFields_(),
|
||||
resultName_(word::null),
|
||||
blacklist_(),
|
||||
results_(),
|
||||
mag_(dict.lookupOrDefault<Switch>("mag", false))
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::ddt2::~ddt2()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::ddt2::read(const dictionary& dict)
|
||||
{
|
||||
fvMeshFunctionObject::read(dict);
|
||||
|
||||
if (word(mesh_.ddtScheme("default")) == "steadyState")
|
||||
{
|
||||
WarningInFunction
|
||||
<< typeName << " function object not appropriate for steady-state"
|
||||
<< endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
fvMeshFunctionObject::read(dict);
|
||||
|
||||
dict.lookup("fields") >> selectFields_;
|
||||
uniqWords(selectFields_);
|
||||
|
||||
resultName_ = dict.lookupOrDefault<word>
|
||||
(
|
||||
"result",
|
||||
( mag_ ? "mag(ddt(@@))" : "magSqr(ddt(@@))" )
|
||||
);
|
||||
|
||||
if (checkFormatName(resultName_))
|
||||
{
|
||||
blacklist_.set
|
||||
(
|
||||
string::quotemeta<regExp>
|
||||
(
|
||||
resultName_
|
||||
).replace("@@", "(.+)")
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
blacklist_.clear();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjects::ddt2::execute()
|
||||
{
|
||||
results_.clear();
|
||||
|
||||
@ -163,82 +234,6 @@ void Foam::functionObjects::ddt2::process()
|
||||
WarningInFunction
|
||||
<< "Unprocessed field " << ignored << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::ddt2::ddt2
|
||||
(
|
||||
const word& name,
|
||||
const Time& runTime,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fvMeshFunctionObject(name, runTime, dict),
|
||||
selectFields_(),
|
||||
resultName_(word::null),
|
||||
blacklist_(),
|
||||
results_(),
|
||||
mag_(dict.lookupOrDefault<Switch>("mag", false))
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::ddt2::~ddt2()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::ddt2::read(const dictionary& dict)
|
||||
{
|
||||
fvMeshFunctionObject::read(dict);
|
||||
|
||||
if (word(mesh_.ddtScheme("default")) == "steadyState")
|
||||
{
|
||||
WarningInFunction
|
||||
<< typeName << " function object not appropriate for steady-state"
|
||||
<< endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
dict.lookup("fields") >> selectFields_;
|
||||
uniqWords(selectFields_);
|
||||
|
||||
resultName_ = dict.lookupOrDefault<word>
|
||||
(
|
||||
"result",
|
||||
( mag_ ? "mag(ddt(@@))" : "magSqr(ddt(@@))" )
|
||||
);
|
||||
|
||||
if (checkFormatName(resultName_))
|
||||
{
|
||||
blacklist_.set
|
||||
(
|
||||
string::quotemeta<regExp>
|
||||
(
|
||||
resultName_
|
||||
).replace("@@", "(.+)")
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
blacklist_.clear();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjects::ddt2::execute()
|
||||
{
|
||||
results_.clear();
|
||||
process();
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -246,9 +241,13 @@ bool Foam::functionObjects::ddt2::execute()
|
||||
|
||||
bool Foam::functionObjects::ddt2::write()
|
||||
{
|
||||
if (results_.size())
|
||||
{
|
||||
Log << type() << ' ' << name() << " write:" << endl;
|
||||
}
|
||||
|
||||
// Consistent output order
|
||||
const wordList outputList = results_.sortedToc();
|
||||
|
||||
forAll(outputList, i)
|
||||
{
|
||||
const word& fieldName = outputList[i];
|
||||
@ -257,8 +256,7 @@ bool Foam::functionObjects::ddt2::write()
|
||||
{
|
||||
const regIOobject& io = lookupObject<regIOobject>(fieldName);
|
||||
|
||||
Log << type() << " " << name()
|
||||
<< " write: writing field " << fieldName << endl;
|
||||
Log << " " << fieldName << endl;
|
||||
|
||||
io.write();
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ Description
|
||||
|
||||
SourceFiles
|
||||
ddt2.C
|
||||
IOddt2.H
|
||||
ddt2Templates.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -137,9 +137,6 @@ class ddt2
|
||||
//- Process by trying to apply for various volume field types.
|
||||
int process(const word& inputName);
|
||||
|
||||
//- Calculate the ddt2 fields
|
||||
void process();
|
||||
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
ddt2(const ddt2&) = delete;
|
||||
@ -171,7 +168,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return name of the ddt2 function object
|
||||
//- Read the ddt2 specification
|
||||
virtual bool read(const dictionary&);
|
||||
|
||||
//- Calculate the ddt2 fields
|
||||
|
||||
@ -27,6 +27,8 @@ License
|
||||
#include "dimensionedType.H"
|
||||
#include "fvcDdt.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class FieldType>
|
||||
int Foam::functionObjects::ddt2::apply(const word& inputName, int& state)
|
||||
{
|
||||
@ -76,10 +78,8 @@ int Foam::functionObjects::ddt2::apply(const word& inputName, int& state)
|
||||
store(outputName, tddt2);
|
||||
}
|
||||
|
||||
volScalarField& output = const_cast<volScalarField&>
|
||||
(
|
||||
lookupObject<volScalarField>(outputName)
|
||||
);
|
||||
volScalarField& output =
|
||||
const_cast<volScalarField&>(lookupObject<volScalarField>(outputName));
|
||||
|
||||
if (mag_)
|
||||
{
|
||||
@ -91,7 +91,7 @@ int Foam::functionObjects::ddt2::apply(const word& inputName, int& state)
|
||||
}
|
||||
|
||||
// Could add additional statistics here
|
||||
Log << type() << " " << name()
|
||||
Log << type() << ' ' << name()
|
||||
<< " field " << outputName
|
||||
<< " average: " << gAverage(output) << endl;
|
||||
|
||||
|
||||
@ -108,51 +108,6 @@ int Foam::functionObjects::zeroGradient::process(const word& fieldName)
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::zeroGradient::process()
|
||||
{
|
||||
results_.clear();
|
||||
|
||||
wordHashSet candidates = subsetStrings(selectFields_, mesh_.names());
|
||||
DynamicList<word> missing(selectFields_.size());
|
||||
DynamicList<word> ignored(selectFields_.size());
|
||||
|
||||
// check exact matches first
|
||||
forAll(selectFields_, i)
|
||||
{
|
||||
const wordRe& select = selectFields_[i];
|
||||
if (!select.isPattern())
|
||||
{
|
||||
const word& fieldName = static_cast<const word&>(select);
|
||||
|
||||
if (!candidates.erase(fieldName))
|
||||
{
|
||||
missing.append(fieldName);
|
||||
}
|
||||
else if (process(fieldName) < 1)
|
||||
{
|
||||
ignored.append(fieldName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
forAllConstIter(wordHashSet, candidates, iter)
|
||||
{
|
||||
process(iter.key());
|
||||
}
|
||||
|
||||
if (missing.size())
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Missing field " << missing << endl;
|
||||
}
|
||||
if (ignored.size())
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Unprocessed field " << ignored << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::zeroGradient::zeroGradient
|
||||
@ -194,15 +149,59 @@ bool Foam::functionObjects::zeroGradient::read(const dictionary& dict)
|
||||
bool Foam::functionObjects::zeroGradient::execute()
|
||||
{
|
||||
results_.clear();
|
||||
|
||||
wordHashSet candidates = subsetStrings(selectFields_, mesh_.names());
|
||||
DynamicList<word> missing(selectFields_.size());
|
||||
DynamicList<word> ignored(selectFields_.size());
|
||||
|
||||
// check exact matches first
|
||||
forAll(selectFields_, i)
|
||||
{
|
||||
const wordRe& select = selectFields_[i];
|
||||
if (!select.isPattern())
|
||||
{
|
||||
const word& fieldName = static_cast<const word&>(select);
|
||||
|
||||
if (!candidates.erase(fieldName))
|
||||
{
|
||||
missing.append(fieldName);
|
||||
}
|
||||
else if (process(fieldName) < 1)
|
||||
{
|
||||
ignored.append(fieldName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
forAllConstIter(wordHashSet, candidates, iter)
|
||||
{
|
||||
process(iter.key());
|
||||
}
|
||||
|
||||
if (missing.size())
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Missing field " << missing << endl;
|
||||
}
|
||||
if (ignored.size())
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Unprocessed field " << ignored << endl;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjects::zeroGradient::write()
|
||||
{
|
||||
if (results_.size())
|
||||
{
|
||||
Log << type() << ' ' << name() << " write:" << endl;
|
||||
}
|
||||
|
||||
// Consistent output order
|
||||
const wordList outputList = results_.sortedToc();
|
||||
|
||||
forAll(outputList, i)
|
||||
{
|
||||
const word& fieldName = outputList[i];
|
||||
@ -211,8 +210,7 @@ bool Foam::functionObjects::zeroGradient::write()
|
||||
{
|
||||
const regIOobject& io = lookupObject<regIOobject>(fieldName);
|
||||
|
||||
Log << type() << " " << name()
|
||||
<< " write: writing field " << fieldName << endl;
|
||||
Log << " " << fieldName << endl;
|
||||
|
||||
io.write();
|
||||
}
|
||||
|
||||
@ -65,8 +65,7 @@ Description
|
||||
|
||||
SourceFiles
|
||||
zeroGradient.C
|
||||
zeroGradientFunctionObject.C
|
||||
IOzeroGradient.H
|
||||
zeroGradientTemplates.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -114,7 +113,10 @@ class zeroGradient
|
||||
static void uniqWords(wordReList&);
|
||||
|
||||
|
||||
//- Accept unless field only has empty/zero-gradient/processor patches
|
||||
//- Accept unless field only has constraint patches
|
||||
// (ie, empty/zero-gradient/processor).
|
||||
// This should also avoid fields that were already processed by
|
||||
// zeroGradient.
|
||||
template<class Type>
|
||||
static bool accept(const GeometricField<Type, fvPatchField, volMesh>&);
|
||||
|
||||
@ -125,9 +127,6 @@ class zeroGradient
|
||||
//- Process by trying to apply for various volume field types.
|
||||
int process(const word& inputName);
|
||||
|
||||
//- Calculate the zeroGradient fields
|
||||
void process();
|
||||
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
zeroGradient(const zeroGradient&) = delete;
|
||||
|
||||
@ -27,6 +27,8 @@ License
|
||||
#include "Time.H"
|
||||
#include "zeroGradientFvPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
bool Foam::functionObjects::zeroGradient::accept
|
||||
(
|
||||
@ -38,10 +40,10 @@ bool Foam::functionObjects::zeroGradient::accept
|
||||
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const fvPatchField<Type>& p = patches[patchi];
|
||||
const polyPatch& pp = p.patch().patch();
|
||||
|
||||
return !polyPatch::constraintType(pp.type());
|
||||
if (!polyPatch::constraintType(patches[patchi].patch().patch().type()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -104,6 +106,7 @@ int Foam::functionObjects::zeroGradient::apply
|
||||
|
||||
VolFieldType& output =
|
||||
const_cast<VolFieldType&>(lookupObject<VolFieldType>(outputName));
|
||||
|
||||
output = input;
|
||||
output.correctBoundaryConditions();
|
||||
|
||||
|
||||
@ -20,8 +20,8 @@ runAnsysToFoam()
|
||||
|
||||
runAnsysToFoam flange.ans 0.001
|
||||
runApplication $application
|
||||
runApplication foamToEnsight
|
||||
runApplication foamToEnsightParts
|
||||
runApplication foamToEnsight -noZero
|
||||
runApplication foamToEnsightParts -noZero
|
||||
runApplication foamToVTK
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -10,5 +10,4 @@ CGAL_LIBS = \
|
||||
-L$(GMP_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
|
||||
-L$(BOOST_ARCH_PATH)/lib \
|
||||
-L$(CGAL_ARCH_PATH)/lib \
|
||||
-lCGAL \
|
||||
-lmpfr
|
||||
-lCGAL
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#-------------------------------*- makefile -*---------------------------------
|
||||
WM_VERSION = OPENFOAM_PLUS=1606
|
||||
WM_VERSION = OPENFOAM_PLUS=1609
|
||||
|
||||
AR = ar
|
||||
ARFLAGS = cr
|
||||
|
||||
Reference in New Issue
Block a user