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 extrude2DMesh
|
||||||
wmake -all $targetType snappyHexMesh
|
wmake -all $targetType snappyHexMesh
|
||||||
|
|
||||||
if [ -n "$FOAMY_HEX_MESH" ]
|
foamyMesh/Allwmake $targetType $*
|
||||||
then
|
|
||||||
foamyMesh/Allwmake $targetType $*
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -25,8 +25,6 @@ EXE_INC = \
|
|||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
$(CGAL_LIBS) \
|
$(CGAL_LIBS) \
|
||||||
-lmpfr \
|
|
||||||
-lboost_thread \
|
|
||||||
-lconformalVoronoiMesh \
|
-lconformalVoronoiMesh \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
|
|||||||
@ -22,9 +22,6 @@ EXE_INC = \
|
|||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
$(CGAL_LIBS) \
|
$(CGAL_LIBS) \
|
||||||
-lboost_thread \
|
|
||||||
-lmpfr \
|
|
||||||
-lgmp \
|
|
||||||
-lconformalVoronoiMesh \
|
-lconformalVoronoiMesh \
|
||||||
-ldecompositionMethods /* -L$(FOAM_LIBBIN)/dummy -lscotchDecomp */ \
|
-ldecompositionMethods /* -L$(FOAM_LIBBIN)/dummy -lscotchDecomp */ \
|
||||||
-ldecompose \
|
-ldecompose \
|
||||||
|
|||||||
@ -16,8 +16,6 @@ EXE_INC = \
|
|||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
$(CGAL_LIBS) \
|
$(CGAL_LIBS) \
|
||||||
-lboost_thread \
|
|
||||||
-lmpfr \
|
|
||||||
-L$(FASTDUALOCTREE_SRC_PATH) -lperf_main \
|
-L$(FASTDUALOCTREE_SRC_PATH) -lperf_main \
|
||||||
-lGL \
|
-lGL \
|
||||||
-lconformalVoronoiMesh \
|
-lconformalVoronoiMesh \
|
||||||
|
|||||||
@ -57,7 +57,7 @@ export FOAM_INST_DIR=$HOME/$WM_PROJECT
|
|||||||
# $FOAM_INST_DIR/site/$WM_PROJECT_VERSION or $FOAM_INST_DIR/site
|
# $FOAM_INST_DIR/site/$WM_PROJECT_VERSION or $FOAM_INST_DIR/site
|
||||||
|
|
||||||
#- Compiler location:
|
#- Compiler location:
|
||||||
# WM_COMPILER_TYPE= system | ThirdParty (OpenFOAM)
|
# WM_COMPILER_TYPE= system | ThirdParty
|
||||||
export WM_COMPILER_TYPE=system
|
export WM_COMPILER_TYPE=system
|
||||||
|
|
||||||
#- Compiler:
|
#- 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/ensight`
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/gperftools`
|
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/gperftools`
|
||||||
|
|
||||||
if [ ! -z "$FOAMY_HEX_MESH" ]
|
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL`
|
||||||
then
|
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL`
|
|
||||||
fi
|
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch`
|
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch`
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/FFTW`
|
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/FFTW`
|
||||||
|
|
||||||
|
|||||||
@ -82,7 +82,7 @@ alias foamVersion \
|
|||||||
# Change ParaView version
|
# Change ParaView version
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
alias foamPV \
|
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")
|
switch ("$WM_COMPILER_TYPE")
|
||||||
case OpenFOAM:
|
|
||||||
case ThirdParty:
|
case ThirdParty:
|
||||||
# Default versions of GMP, MPFR and MPC, override as necessary
|
# Default versions of GMP, MPFR and MPC, override as necessary
|
||||||
set gmp_version=gmp-system
|
set gmp_version=gmp-system
|
||||||
|
|||||||
@ -3,7 +3,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) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM.
|
||||||
@ -25,40 +25,50 @@
|
|||||||
# config.csh/paraview
|
# config.csh/paraview
|
||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Setup file for paraview-[3-5].x
|
# Setup file for paraview (and cmake)
|
||||||
# Sourced from OpenFOAM-<VERSION>/etc/cshrc or from foamPV alias
|
# Sourced from OpenFOAM-<VERSION>/etc/cshrc or from foamPV alias
|
||||||
#
|
#
|
||||||
# Note
|
# If using system-wide installation for cmake, use the following settings:
|
||||||
# The env. variables 'ParaView_DIR' and 'ParaView_MAJOR'
|
|
||||||
# are required for building plugins
|
|
||||||
#
|
#
|
||||||
|
# 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
|
# 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-"`
|
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
|
if ( $status == 0 ) setenv PATH $cleaned
|
||||||
|
|
||||||
# Determine the cmake to be used
|
# Environment for ThirdParty cmake
|
||||||
unsetenv CMAKE_HOME
|
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_version
|
||||||
set cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake
|
if ( -r $cmake ) then
|
||||||
if ( -r $cmake ) then
|
|
||||||
setenv CMAKE_HOME $cmake
|
setenv CMAKE_HOME $cmake
|
||||||
setenv PATH ${CMAKE_HOME}/bin:${PATH}
|
setenv PATH ${CMAKE_HOME}/bin:${PATH}
|
||||||
break
|
endif
|
||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
# Evaluate command-line parameters for ParaView
|
# Evaluate command-line parameters for ParaView
|
||||||
while ( $#argv > 0 )
|
while ( $#argv > 0 )
|
||||||
@ -72,62 +82,64 @@ while ( $#argv > 0 )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# Set MAJOR version to correspond to VERSION
|
# Require that ParaView_VERSION has not been unset.
|
||||||
# ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
|
# Avoids conflict with an alternative (non-ThirdParty) installation.
|
||||||
switch ("$ParaView_VERSION")
|
if ( $?ParaView_VERSION ) then
|
||||||
case "$ParaView_MAJOR".*:
|
|
||||||
|
# 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
|
# Version and major appear to correspond
|
||||||
breaksw
|
breaksw
|
||||||
|
|
||||||
case [0-9]*:
|
case [0-9]*:
|
||||||
# Extract major from the version
|
# Extract major from the version
|
||||||
setenv ParaView_MAJOR `echo ${ParaView_VERSION} | \
|
setenv ParaView_MAJOR `echo ${ParaView_VERSION} | \
|
||||||
sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
|
sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
|
||||||
breaksw
|
breaksw
|
||||||
endsw
|
endsw
|
||||||
|
|
||||||
|
set pvName=ParaView-$ParaView_VERSION
|
||||||
|
set pvMajor=paraview-$ParaView_MAJOR
|
||||||
|
set pvSrcDir=$WM_THIRD_PARTY_DIR/$pvName
|
||||||
|
|
||||||
set paraviewInstDir=$WM_THIRD_PARTY_DIR/ParaView-${ParaView_VERSION}
|
setenv ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$pvName
|
||||||
set paraviewArchName=ParaView-$ParaView_VERSION
|
|
||||||
|
|
||||||
setenv ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$paraviewArchName
|
# Set paths if binaries or source are present
|
||||||
|
if ( -r $ParaView_DIR || -r $pvSrcDir ) then
|
||||||
# Set paths if binaries or source are present
|
set pvLibDir=${ParaView_DIR}/lib/$pvMajor
|
||||||
if ( -r $ParaView_DIR || -r $paraviewInstDir ) then
|
set pvPython=$ParaView_DIR/Utilities/VTKPythonWrapping
|
||||||
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 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 PATH ${ParaView_DIR}/bin:${PATH}
|
||||||
setenv LD_LIBRARY_PATH "${ParaView_LIB_DIR}:${LD_LIBRARY_PATH}"
|
setenv LD_LIBRARY_PATH "${pvLibDir}:${LD_LIBRARY_PATH}"
|
||||||
setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-${ParaView_MAJOR}
|
|
||||||
|
# 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
|
if ($?FOAM_VERBOSE && $?prompt) then
|
||||||
echo "Using paraview"
|
echo "Using paraview"
|
||||||
echo " ParaView_DIR : $ParaView_DIR"
|
echo " ParaView_DIR : $ParaView_DIR"
|
||||||
echo " ParaView_LIB_DIR : $ParaView_LIB_DIR"
|
|
||||||
echo " ParaView_INCLUDE_DIR : $ParaView_INCLUDE_DIR"
|
echo " ParaView_INCLUDE_DIR : $ParaView_INCLUDE_DIR"
|
||||||
|
echo " library dir : $pvLibDir"
|
||||||
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH"
|
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH"
|
||||||
endif
|
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
|
else
|
||||||
setenv PYTHONPATH ${paraviewPython}:$ParaView_LIB_DIR
|
unsetenv ParaView_INCLUDE_DIR PV_PLUGIN_PATH
|
||||||
|
setenv ParaView_DIR # Defined but empty (used by foamPV alias)
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
else
|
|
||||||
unsetenv PV_PLUGIN_PATH
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
unset cleaned cmake cmake_version pvName pvMajor pvSrcDir pvLibDir pvPython
|
||||||
unset cleaned cmake paraviewInstDir paraviewPython
|
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
|
unset gcc_version gmp_version mpfr_version mpc_version
|
||||||
unsetenv GMP_ARCH_PATH MPFR_ARCH_PATH
|
unsetenv GMP_ARCH_PATH MPFR_ARCH_PATH
|
||||||
|
|
||||||
|
# Compiler installation - default to system
|
||||||
# Location of compiler installation
|
# ~~~~~~~~~~~~~~~~~~~~~
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
if ( ! $?WM_COMPILER_TYPE ) setenv WM_COMPILER_TYPE system
|
||||||
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
|
|
||||||
|
|
||||||
# Load configured compiler versions, regardless of the compiler type
|
# Load configured compiler versions, regardless of the compiler type
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
@ -235,13 +230,16 @@ case ThirdParty:
|
|||||||
|
|
||||||
# Check that the compiler directory can be found
|
# Check that the compiler directory can be found
|
||||||
if ( ! -d "$gccDir" ) then
|
if ( ! -d "$gccDir" ) then
|
||||||
echo
|
cat << GCC_NOT_FOUND
|
||||||
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
|
===============================================================================
|
||||||
echo " Cannot find $gccDir installation."
|
Warning in $WM_PROJECT_DIR/etc/config.csh/settings:
|
||||||
echo " Please install this compiler version or if you wish to" \
|
Cannot find '$WM_COMPILER' compiler installation
|
||||||
" use the system compiler,"
|
$gccDir
|
||||||
echo " change the 'WM_COMPILER_TYPE' setting to 'system'"
|
|
||||||
echo
|
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
|
endif
|
||||||
|
|
||||||
_foamAddMan $gccDir/man
|
_foamAddMan $gccDir/man
|
||||||
@ -268,18 +266,22 @@ case ThirdParty:
|
|||||||
echo " ${gccDir:t} (${gmpDir:t} ${mpfrDir:t} ${mpcDir:t})"
|
echo " ${gccDir:t} (${gmpDir:t} ${mpfrDir:t} ${mpcDir:t})"
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if ( $?clang_version ) then
|
if ( $?clang_version ) then
|
||||||
set clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version
|
set clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version
|
||||||
|
|
||||||
# Check that the compiler directory can be found
|
# Check that the compiler directory can be found
|
||||||
if ( ! -d "$clangDir" ) then
|
if ( ! -d "$clangDir" ) then
|
||||||
echo
|
cat << CLANG_NOT_FOUND
|
||||||
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
|
===============================================================================
|
||||||
echo " Cannot find $clangDir installation."
|
Warning in $WM_PROJECT_DIR/etc/config.csh/settings:
|
||||||
echo " Please install this compiler version or if you wish to" \
|
Cannot find '$WM_COMPILER' compiler installation
|
||||||
" use the system compiler,"
|
$clangDir
|
||||||
echo " change the 'WM_COMPILER_TYPE' setting to 'system'"
|
|
||||||
echo
|
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
|
endif
|
||||||
|
|
||||||
_foamAddMan $clangDir/man
|
_foamAddMan $clangDir/man
|
||||||
|
|||||||
@ -136,12 +136,6 @@ unsetenv GMP_ARCH_PATH
|
|||||||
unsetenv MPFR_ARCH_PATH
|
unsetenv MPFR_ARCH_PATH
|
||||||
unsetenv SCOTCH_ARCH_PATH
|
unsetenv SCOTCH_ARCH_PATH
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
# Unset foamyHexMesh-related environment variables
|
|
||||||
|
|
||||||
unsetenv FOAMY_HEX_MESH
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Cleanup environment
|
# Cleanup environment
|
||||||
# PATH, LD_LIBRARY_PATH, MANPATH
|
# PATH, LD_LIBRARY_PATH, MANPATH
|
||||||
|
|||||||
@ -70,7 +70,7 @@ alias run='cd $FOAM_RUN'
|
|||||||
# Refresh the environment
|
# Refresh the environment
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
# For backward-compatibility unalias wmRefresh if it is defined as an alias
|
# 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()
|
wmRefresh()
|
||||||
{
|
{
|
||||||
wmProjectDir=$WM_PROJECT_DIR
|
wmProjectDir=$WM_PROJECT_DIR
|
||||||
@ -82,7 +82,7 @@ wmRefresh()
|
|||||||
|
|
||||||
# Change OpenFOAM version
|
# Change OpenFOAM version
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
unset foamVersion
|
unset -f foamVersion
|
||||||
foamVersion()
|
foamVersion()
|
||||||
{
|
{
|
||||||
if [ "$1" ]; then
|
if [ "$1" ]; then
|
||||||
@ -99,11 +99,12 @@ foamVersion()
|
|||||||
|
|
||||||
# Change ParaView version
|
# Change ParaView version
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
unset foamPV
|
unset -f foamPV
|
||||||
foamPV()
|
foamPV()
|
||||||
{
|
{
|
||||||
. $WM_PROJECT_DIR/etc/config.sh/paraview ParaView_VERSION=${1:-none}
|
. $WM_PROJECT_DIR/etc/config.sh/paraview "${@+ParaView_VERSION=$1}"
|
||||||
echo "paraview-$ParaView_VERSION (major: $ParaView_MAJOR)" 1>&2
|
local pvdir="${ParaView_DIR##*/}"
|
||||||
|
echo "${pvdir:-ParaView_DIR not set}" 1>&2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
case "$WM_COMPILER_TYPE" in
|
case "$WM_COMPILER_TYPE" in
|
||||||
OpenFOAM | ThirdParty)
|
ThirdParty)
|
||||||
# Default versions of GMP, MPFR and MPC, override as necessary
|
# Default versions of GMP, MPFR and MPC, override as necessary
|
||||||
gmp_version=gmp-system
|
gmp_version=gmp-system
|
||||||
mpfr_version=mpfr-system
|
mpfr_version=mpfr-system
|
||||||
|
|||||||
@ -3,7 +3,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) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM.
|
||||||
@ -25,12 +25,37 @@
|
|||||||
# etc/config.sh/paraview
|
# etc/config.sh/paraview
|
||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Setup file for paraview-[3-5].x
|
# Setup file for paraview (& cmake)
|
||||||
# Sourced from OpenFOAM-<VERSION>/etc/bashrc or from foamPV alias
|
# 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
|
# Note
|
||||||
# The env. variables 'ParaView_DIR' and 'ParaView_MAJOR'
|
# The following env. variables are required for building plugins:
|
||||||
# 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
|
# Clean the PATH
|
||||||
@ -41,32 +66,15 @@ cleaned=$($WM_PROJECT_DIR/bin/foamCleanPath "$PATH" \
|
|||||||
) \
|
) \
|
||||||
&& PATH="$cleaned"
|
&& PATH="$cleaned"
|
||||||
|
|
||||||
# Determine the cmake to be used
|
# Environment for ThirdParty cmake
|
||||||
unset CMAKE_HOME
|
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=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake_version
|
||||||
cmake-2.8.1
|
if [ -r $cmake ]
|
||||||
do
|
then
|
||||||
cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake
|
|
||||||
if [ -r $cmake ]
|
|
||||||
then
|
|
||||||
export CMAKE_HOME=$cmake
|
export CMAKE_HOME=$cmake
|
||||||
export CMAKE_ROOT=$cmake
|
export CMAKE_ROOT=$cmake
|
||||||
export PATH=$CMAKE_HOME/bin:$PATH
|
export PATH=$CMAKE_HOME/bin:$PATH
|
||||||
break
|
fi
|
||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
# Evaluate command-line parameters for ParaView
|
# Evaluate command-line parameters for ParaView
|
||||||
_foamParaviewEval()
|
_foamParaviewEval()
|
||||||
@ -86,67 +94,69 @@ _foamParaviewEval()
|
|||||||
# Evaluate command-line parameters
|
# Evaluate command-line parameters
|
||||||
_foamParaviewEval $@
|
_foamParaviewEval $@
|
||||||
|
|
||||||
|
# Require that ParaView_VERSION has not been unset.
|
||||||
|
# Avoids conflict with an alternative (non-ThirdParty) installation.
|
||||||
|
if [ -n "$ParaView_VERSION" ]
|
||||||
|
then
|
||||||
|
|
||||||
# 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".* )
|
||||||
# Version and major appear to correspond
|
# Version and major appear to correspond
|
||||||
;;
|
;;
|
||||||
|
|
||||||
[0-9]*)
|
[0-9]*)
|
||||||
# Extract major from the version
|
# Extract major from the version
|
||||||
ParaView_MAJOR=$(echo $ParaView_VERSION | \
|
ParaView_MAJOR=$(echo $ParaView_VERSION | \
|
||||||
sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/')
|
sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/')
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
export ParaView_VERSION ParaView_MAJOR
|
|
||||||
|
|
||||||
paraviewInstDir=$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION
|
pvName=ParaView-$ParaView_VERSION
|
||||||
paraviewArchName=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/$paraviewArchName
|
export ParaView_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$pvName
|
||||||
|
|
||||||
# Set paths if binaries or source are present
|
# Set paths if binaries or source are present
|
||||||
if [ -r $ParaView_DIR -o -r $paraviewInstDir ]
|
if [ -r $ParaView_DIR -o -r $pvSrcDir ]
|
||||||
then
|
|
||||||
export ParaView_INCLUDE_DIR=$ParaView_DIR/include/paraview-$ParaView_MAJOR
|
|
||||||
if [ ! -d $ParaView_INCLUDE_DIR -a -d $ParaView_DIR/include/paraview-3.0 ]
|
|
||||||
then
|
then
|
||||||
export ParaView_INCLUDE_DIR=$ParaView_DIR/include/paraview-3.0
|
pvLibDir=$ParaView_DIR/lib/$pvMajor
|
||||||
fi
|
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 PATH=$ParaView_DIR/bin:$PATH
|
||||||
export LD_LIBRARY_PATH=$ParaView_LIB_DIR:$LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH=$pvLibDir:$LD_LIBRARY_PATH
|
||||||
export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-$ParaView_MAJOR
|
|
||||||
|
# Add in python libraries if required
|
||||||
|
if [ -r $pvPython ]
|
||||||
|
then
|
||||||
|
if [ "$PYTHONPATH" ]
|
||||||
|
then
|
||||||
|
export PYTHONPATH=$PYTHONPATH:$pvPython:$pvLibDir
|
||||||
|
else
|
||||||
|
export PYTHONPATH=$pvPython:$pvLibDir
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||||
then
|
then
|
||||||
echo "Using paraview"
|
echo "Using paraview"
|
||||||
echo " ParaView_DIR : $ParaView_DIR"
|
echo " ParaView_DIR : $ParaView_DIR"
|
||||||
echo " ParaView_LIB_DIR : $ParaView_LIB_DIR"
|
|
||||||
echo " ParaView_INCLUDE_DIR : $ParaView_INCLUDE_DIR"
|
echo " ParaView_INCLUDE_DIR : $ParaView_INCLUDE_DIR"
|
||||||
|
echo " library dir : $pvLibDir"
|
||||||
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH"
|
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add in python libraries if required
|
|
||||||
paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
|
|
||||||
if [ -r $paraviewPython ]
|
|
||||||
then
|
|
||||||
if [ "$PYTHONPATH" ]
|
|
||||||
then
|
|
||||||
export PYTHONPATH=$PYTHONPATH:$paraviewPython:$ParaView_LIB_DIR
|
|
||||||
else
|
else
|
||||||
export PYTHONPATH=$paraviewPython:$ParaView_LIB_DIR
|
unset ParaView_DIR ParaView_INCLUDE_DIR PV_PLUGIN_PATH
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
else
|
|
||||||
unset PV_PLUGIN_PATH
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset _foamParaviewEval
|
unset -f _foamParaviewEval
|
||||||
unset cleaned cmake paraviewInstDir paraviewPython
|
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 gcc_version gmp_version mpfr_version mpc_version
|
||||||
unset GMP_ARCH_PATH MPFR_ARCH_PATH
|
unset GMP_ARCH_PATH MPFR_ARCH_PATH
|
||||||
|
|
||||||
# Location of compiler installation
|
# Compiler installation - default to system
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~
|
||||||
if [ -z "$WM_COMPILER_TYPE" ]
|
: ${WM_COMPILER_TYPE:=system}; export 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
|
|
||||||
|
|
||||||
# Load configured compiler versions, regardless of the 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}
|
mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/${mpc_version:-mpc-system}
|
||||||
|
|
||||||
# Check that the compiler directory can be found
|
# Check that the compiler directory can be found
|
||||||
[ -d "$gccDir" ] || {
|
[ -d "$gccDir" ] || cat << GCC_NOT_FOUND 1>&2
|
||||||
echo 1>&2
|
===============================================================================
|
||||||
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/settings:" 1>&2
|
Warning in $WM_PROJECT_DIR/etc/config.sh/settings:
|
||||||
echo " Cannot find $gccDir installation." 1>&2
|
Cannot find '$WM_COMPILER' compiler installation
|
||||||
echo " Please install this compiler version or if you wish to" \
|
$gccDir
|
||||||
" use the system compiler," 1>&2
|
|
||||||
echo " change the 'WM_COMPILER_TYPE' setting to 'system'" 1>&2
|
Either install this compiler version, or use the system compiler by setting
|
||||||
echo
|
WM_COMPILER_TYPE to 'system' in \$WM_PROJECT_DIR/etc/bashrc.
|
||||||
}
|
===============================================================================
|
||||||
|
GCC_NOT_FOUND
|
||||||
|
|
||||||
_foamAddMan $gccDir/man
|
_foamAddMan $gccDir/man
|
||||||
_foamAddPath $gccDir/bin
|
_foamAddPath $gccDir/bin
|
||||||
@ -276,15 +272,16 @@ OpenFOAM | ThirdParty)
|
|||||||
clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version
|
clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version
|
||||||
|
|
||||||
# Check that the compiler directory can be found
|
# Check that the compiler directory can be found
|
||||||
[ -d "$clangDir" ] || {
|
[ -d "$clangDir" ] || cat << CLANG_NOT_FOUND 1>&2
|
||||||
echo 1>&2
|
===============================================================================
|
||||||
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/settings:" 1>&2
|
Warning in $WM_PROJECT_DIR/etc/config.sh/settings:
|
||||||
echo " Cannot find $clangDir installation." 1>&2
|
Cannot find '$WM_COMPILER' compiler installation
|
||||||
echo " Please install this compiler version or if you wish to" \
|
$clangDir
|
||||||
" use the system compiler," 1>&2
|
|
||||||
echo " change the 'WM_COMPILER_TYPE' setting to 'system'" 1>&2
|
Either install this compiler version, or use the system compiler by setting
|
||||||
echo 1>&2
|
WM_COMPILER_TYPE to 'system' in \$WM_PROJECT_DIR/etc/bashrc.
|
||||||
}
|
===============================================================================
|
||||||
|
CLANG_NOT_FOUND
|
||||||
|
|
||||||
_foamAddMan $clangDir/share/man
|
_foamAddMan $clangDir/share/man
|
||||||
_foamAddPath $clangDir/bin
|
_foamAddPath $clangDir/bin
|
||||||
|
|||||||
@ -132,12 +132,6 @@ unset GMP_ARCH_PATH
|
|||||||
unset MPFR_ARCH_PATH
|
unset MPFR_ARCH_PATH
|
||||||
unset SCOTCH_ARCH_PATH
|
unset SCOTCH_ARCH_PATH
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
# Unset foamyHexMesh-related environment variables
|
|
||||||
|
|
||||||
unset FOAMY_HEX_MESH
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Cleanup environment
|
# Cleanup environment
|
||||||
# PATH, LD_LIBRARY_PATH, MANPATH
|
# PATH, LD_LIBRARY_PATH, MANPATH
|
||||||
@ -183,9 +177,9 @@ unalias util
|
|||||||
unalias tut
|
unalias tut
|
||||||
unalias run
|
unalias run
|
||||||
|
|
||||||
unset wmRefresh
|
unset -f wmRefresh
|
||||||
unset foamVersion
|
unset -f foamVersion
|
||||||
unset foamPV
|
unset -f foamPV
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -57,7 +57,7 @@ echo $FOAM_INST_DIR
|
|||||||
# $FOAM_INST_DIR/site/$WM_PROJECT_VERSION or $FOAM_INST_DIR/site
|
# $FOAM_INST_DIR/site/$WM_PROJECT_VERSION or $FOAM_INST_DIR/site
|
||||||
|
|
||||||
#- Compiler location:
|
#- Compiler location:
|
||||||
# WM_COMPILER_TYPE = system | ThirdParty (OpenFOAM)
|
# WM_COMPILER_TYPE = system | ThirdParty
|
||||||
setenv WM_COMPILER_TYPE system
|
setenv WM_COMPILER_TYPE system
|
||||||
|
|
||||||
#- Compiler:
|
#- 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/paraview`
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/ensight`
|
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/ensight`
|
||||||
|
|
||||||
if ( ($?FOAMY_HEX_MESH) ) then
|
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/CGAL`
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/CGAL`
|
|
||||||
endif
|
|
||||||
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/FFTW`
|
_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();
|
results_.clear();
|
||||||
|
|
||||||
@ -163,82 +234,6 @@ void Foam::functionObjects::ddt2::process()
|
|||||||
WarningInFunction
|
WarningInFunction
|
||||||
<< "Unprocessed field " << ignored << endl;
|
<< "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;
|
return true;
|
||||||
}
|
}
|
||||||
@ -246,9 +241,13 @@ bool Foam::functionObjects::ddt2::execute()
|
|||||||
|
|
||||||
bool Foam::functionObjects::ddt2::write()
|
bool Foam::functionObjects::ddt2::write()
|
||||||
{
|
{
|
||||||
|
if (results_.size())
|
||||||
|
{
|
||||||
|
Log << type() << ' ' << name() << " write:" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
// Consistent output order
|
// Consistent output order
|
||||||
const wordList outputList = results_.sortedToc();
|
const wordList outputList = results_.sortedToc();
|
||||||
|
|
||||||
forAll(outputList, i)
|
forAll(outputList, i)
|
||||||
{
|
{
|
||||||
const word& fieldName = outputList[i];
|
const word& fieldName = outputList[i];
|
||||||
@ -257,8 +256,7 @@ bool Foam::functionObjects::ddt2::write()
|
|||||||
{
|
{
|
||||||
const regIOobject& io = lookupObject<regIOobject>(fieldName);
|
const regIOobject& io = lookupObject<regIOobject>(fieldName);
|
||||||
|
|
||||||
Log << type() << " " << name()
|
Log << " " << fieldName << endl;
|
||||||
<< " write: writing field " << fieldName << endl;
|
|
||||||
|
|
||||||
io.write();
|
io.write();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -68,7 +68,7 @@ Description
|
|||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
ddt2.C
|
ddt2.C
|
||||||
IOddt2.H
|
ddt2Templates.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -137,9 +137,6 @@ class ddt2
|
|||||||
//- Process by trying to apply for various volume field types.
|
//- Process by trying to apply for various volume field types.
|
||||||
int process(const word& inputName);
|
int process(const word& inputName);
|
||||||
|
|
||||||
//- Calculate the ddt2 fields
|
|
||||||
void process();
|
|
||||||
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
ddt2(const ddt2&) = delete;
|
ddt2(const ddt2&) = delete;
|
||||||
@ -171,7 +168,7 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return name of the ddt2 function object
|
//- Read the ddt2 specification
|
||||||
virtual bool read(const dictionary&);
|
virtual bool read(const dictionary&);
|
||||||
|
|
||||||
//- Calculate the ddt2 fields
|
//- Calculate the ddt2 fields
|
||||||
|
|||||||
@ -27,6 +27,8 @@ License
|
|||||||
#include "dimensionedType.H"
|
#include "dimensionedType.H"
|
||||||
#include "fvcDdt.H"
|
#include "fvcDdt.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class FieldType>
|
template<class FieldType>
|
||||||
int Foam::functionObjects::ddt2::apply(const word& inputName, int& state)
|
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);
|
store(outputName, tddt2);
|
||||||
}
|
}
|
||||||
|
|
||||||
volScalarField& output = const_cast<volScalarField&>
|
volScalarField& output =
|
||||||
(
|
const_cast<volScalarField&>(lookupObject<volScalarField>(outputName));
|
||||||
lookupObject<volScalarField>(outputName)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (mag_)
|
if (mag_)
|
||||||
{
|
{
|
||||||
@ -91,7 +91,7 @@ int Foam::functionObjects::ddt2::apply(const word& inputName, int& state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Could add additional statistics here
|
// Could add additional statistics here
|
||||||
Log << type() << " " << name()
|
Log << type() << ' ' << name()
|
||||||
<< " field " << outputName
|
<< " field " << outputName
|
||||||
<< " average: " << gAverage(output) << endl;
|
<< " 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 * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::functionObjects::zeroGradient::zeroGradient
|
Foam::functionObjects::zeroGradient::zeroGradient
|
||||||
@ -194,15 +149,59 @@ bool Foam::functionObjects::zeroGradient::read(const dictionary& dict)
|
|||||||
bool Foam::functionObjects::zeroGradient::execute()
|
bool Foam::functionObjects::zeroGradient::execute()
|
||||||
{
|
{
|
||||||
results_.clear();
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjects::zeroGradient::write()
|
bool Foam::functionObjects::zeroGradient::write()
|
||||||
{
|
{
|
||||||
|
if (results_.size())
|
||||||
|
{
|
||||||
|
Log << type() << ' ' << name() << " write:" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
// Consistent output order
|
// Consistent output order
|
||||||
const wordList outputList = results_.sortedToc();
|
const wordList outputList = results_.sortedToc();
|
||||||
|
|
||||||
forAll(outputList, i)
|
forAll(outputList, i)
|
||||||
{
|
{
|
||||||
const word& fieldName = outputList[i];
|
const word& fieldName = outputList[i];
|
||||||
@ -211,8 +210,7 @@ bool Foam::functionObjects::zeroGradient::write()
|
|||||||
{
|
{
|
||||||
const regIOobject& io = lookupObject<regIOobject>(fieldName);
|
const regIOobject& io = lookupObject<regIOobject>(fieldName);
|
||||||
|
|
||||||
Log << type() << " " << name()
|
Log << " " << fieldName << endl;
|
||||||
<< " write: writing field " << fieldName << endl;
|
|
||||||
|
|
||||||
io.write();
|
io.write();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,8 +65,7 @@ Description
|
|||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
zeroGradient.C
|
zeroGradient.C
|
||||||
zeroGradientFunctionObject.C
|
zeroGradientTemplates.C
|
||||||
IOzeroGradient.H
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -114,7 +113,10 @@ class zeroGradient
|
|||||||
static void uniqWords(wordReList&);
|
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>
|
template<class Type>
|
||||||
static bool accept(const GeometricField<Type, fvPatchField, volMesh>&);
|
static bool accept(const GeometricField<Type, fvPatchField, volMesh>&);
|
||||||
|
|
||||||
@ -125,9 +127,6 @@ class zeroGradient
|
|||||||
//- Process by trying to apply for various volume field types.
|
//- Process by trying to apply for various volume field types.
|
||||||
int process(const word& inputName);
|
int process(const word& inputName);
|
||||||
|
|
||||||
//- Calculate the zeroGradient fields
|
|
||||||
void process();
|
|
||||||
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
zeroGradient(const zeroGradient&) = delete;
|
zeroGradient(const zeroGradient&) = delete;
|
||||||
|
|||||||
@ -27,6 +27,8 @@ License
|
|||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
#include "zeroGradientFvPatchField.H"
|
#include "zeroGradientFvPatchField.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
bool Foam::functionObjects::zeroGradient::accept
|
bool Foam::functionObjects::zeroGradient::accept
|
||||||
(
|
(
|
||||||
@ -38,10 +40,10 @@ bool Foam::functionObjects::zeroGradient::accept
|
|||||||
|
|
||||||
forAll(patches, patchi)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const fvPatchField<Type>& p = patches[patchi];
|
if (!polyPatch::constraintType(patches[patchi].patch().patch().type()))
|
||||||
const polyPatch& pp = p.patch().patch();
|
{
|
||||||
|
return true;
|
||||||
return !polyPatch::constraintType(pp.type());
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -104,6 +106,7 @@ int Foam::functionObjects::zeroGradient::apply
|
|||||||
|
|
||||||
VolFieldType& output =
|
VolFieldType& output =
|
||||||
const_cast<VolFieldType&>(lookupObject<VolFieldType>(outputName));
|
const_cast<VolFieldType&>(lookupObject<VolFieldType>(outputName));
|
||||||
|
|
||||||
output = input;
|
output = input;
|
||||||
output.correctBoundaryConditions();
|
output.correctBoundaryConditions();
|
||||||
|
|
||||||
|
|||||||
@ -20,8 +20,8 @@ runAnsysToFoam()
|
|||||||
|
|
||||||
runAnsysToFoam flange.ans 0.001
|
runAnsysToFoam flange.ans 0.001
|
||||||
runApplication $application
|
runApplication $application
|
||||||
runApplication foamToEnsight
|
runApplication foamToEnsight -noZero
|
||||||
runApplication foamToEnsightParts
|
runApplication foamToEnsightParts -noZero
|
||||||
runApplication foamToVTK
|
runApplication foamToVTK
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -10,5 +10,4 @@ CGAL_LIBS = \
|
|||||||
-L$(GMP_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
|
-L$(GMP_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
|
||||||
-L$(BOOST_ARCH_PATH)/lib \
|
-L$(BOOST_ARCH_PATH)/lib \
|
||||||
-L$(CGAL_ARCH_PATH)/lib \
|
-L$(CGAL_ARCH_PATH)/lib \
|
||||||
-lCGAL \
|
-lCGAL
|
||||||
-lmpfr
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#-------------------------------*- makefile -*---------------------------------
|
#-------------------------------*- makefile -*---------------------------------
|
||||||
WM_VERSION = OPENFOAM_PLUS=1606
|
WM_VERSION = OPENFOAM_PLUS=1609
|
||||||
|
|
||||||
AR = ar
|
AR = ar
|
||||||
ARFLAGS = cr
|
ARFLAGS = cr
|
||||||
|
|||||||
Reference in New Issue
Block a user