Compare commits
13 Commits
develop.me
...
OpenFOAM-v
| Author | SHA1 | Date | |
|---|---|---|---|
| e000a3cdc5 | |||
| 3c596fe9bd | |||
| 169e482066 | |||
| 0c68f1be4b | |||
| ff16d27f63 | |||
| 54f23b9577 | |||
| 4dd1433133 | |||
| c1cbfe5780 | |||
| be420e7a71 | |||
| c278b93d7a | |||
| fce7948915 | |||
| e91dbcf834 | |||
| 00552eff17 |
29
Allwmake
29
Allwmake
@ -25,7 +25,7 @@ command -v mpirun 2>/dev/null || true
|
|||||||
echo "========================================"
|
echo "========================================"
|
||||||
date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown"
|
date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown"
|
||||||
echo "Starting compile ${WM_PROJECT_DIR##*/} ${0##*/}"
|
echo "Starting compile ${WM_PROJECT_DIR##*/} ${0##*/}"
|
||||||
echo " $WM_COMPILER $WM_COMPILER_TYPE compiler"
|
echo " $WM_COMPILER ${WM_COMPILER_TYPE:-system} compiler"
|
||||||
echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
|
echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
|
||||||
echo "========================================"
|
echo "========================================"
|
||||||
echo
|
echo
|
||||||
@ -36,9 +36,18 @@ echo
|
|||||||
# Compile ThirdParty libraries and applications
|
# Compile ThirdParty libraries and applications
|
||||||
if [ -d "$WM_THIRD_PARTY_DIR" ]
|
if [ -d "$WM_THIRD_PARTY_DIR" ]
|
||||||
then
|
then
|
||||||
$WM_THIRD_PARTY_DIR/Allwmake
|
if [ -e "$WM_THIRD_PARTY_DIR"/Allwmake.override ]
|
||||||
|
then
|
||||||
|
if [ -x "$WM_THIRD_PARTY_DIR"/Allwmake.override ]
|
||||||
|
then "$WM_THIRD_PARTY_DIR"/Allwmake.override
|
||||||
|
fi
|
||||||
|
elif [ -x "$WM_THIRD_PARTY_DIR"/Allwmake ]
|
||||||
|
then "$WM_THIRD_PARTY_DIR"/Allwmake
|
||||||
|
else
|
||||||
|
echo "Skip ThirdParty (no Allwmake* files)"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "No ThirdParty directory found - skipping"
|
echo "Skip ThirdParty (no directory)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "========================================"
|
echo "========================================"
|
||||||
@ -57,13 +66,13 @@ then
|
|||||||
echo "========================================"
|
echo "========================================"
|
||||||
echo "Compile OpenFOAM modules"
|
echo "Compile OpenFOAM modules"
|
||||||
echo
|
echo
|
||||||
(cd $WM_PROJECT_DIR/modules 2>/dev/null && wmake -all)
|
(cd "$WM_PROJECT_DIR/modules" 2>/dev/null && wmake -all)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Count files in given directory. Ignore "Test-*" binaries.
|
# Count files in given directory. Ignore "Test-*" binaries.
|
||||||
_foamCountDirEntries()
|
_foamCountDirEntries()
|
||||||
{
|
{
|
||||||
(cd "$1" 2>/dev/null && find -mindepth 1 -maxdepth 1 -type f 2>/dev/null) |\
|
(cd "$1" 2>/dev/null && find . -mindepth 1 -maxdepth 1 -type f 2>/dev/null) |\
|
||||||
sed -e '\@/Test-@d' | wc -l
|
sed -e '\@/Test-@d' | wc -l
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,13 +81,13 @@ echo
|
|||||||
date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown"
|
date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown"
|
||||||
echo "========================================"
|
echo "========================================"
|
||||||
echo " ${WM_PROJECT_DIR##*/}"
|
echo " ${WM_PROJECT_DIR##*/}"
|
||||||
echo " $WM_COMPILER $WM_COMPILER_TYPE compiler"
|
echo " $WM_COMPILER ${WM_COMPILER_TYPE:-system} compiler"
|
||||||
echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
|
echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
|
||||||
echo
|
echo
|
||||||
echo " api = $(foamEtcFile -show-api 2>/dev/null)"
|
echo " api = $(etc/openfoam -show-api 2>/dev/null)"
|
||||||
echo " patch = $(foamEtcFile -show-patch 2>/dev/null)"
|
echo " patch = $(etc/openfoam -show-patch 2>/dev/null)"
|
||||||
echo " bin = $(_foamCountDirEntries $FOAM_APPBIN) entries"
|
echo " bin = $(_foamCountDirEntries "$FOAM_APPBIN") entries"
|
||||||
echo " lib = $(_foamCountDirEntries $FOAM_LIBBIN) entries"
|
echo " lib = $(_foamCountDirEntries "$FOAM_LIBBIN") entries"
|
||||||
echo
|
echo
|
||||||
echo "========================================"
|
echo "========================================"
|
||||||
|
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
api=1906
|
api=1906
|
||||||
patch=191111
|
patch=200417
|
||||||
|
|||||||
@ -143,6 +143,13 @@ public:
|
|||||||
typedef indexedVertex<Gt,Vb2> Other;
|
typedef indexedVertex<Gt,Vb2> Other;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
indexedVertex(const indexedVertex&) = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
inline indexedVertex();
|
inline indexedVertex();
|
||||||
|
|||||||
114
bin/foamEtcFile
114
bin/foamEtcFile
@ -7,14 +7,13 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# Copyright (C) 2017-2018 OpenCFD Ltd.
|
# Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
# <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
#
|
||||||
# Script
|
# Script
|
||||||
# foamEtcFile
|
# bin/foamEtcFile
|
||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Locate user/group/other file as per '#includeEtc'.
|
# Locate user/group/other file as per '#includeEtc'.
|
||||||
@ -33,7 +32,13 @@
|
|||||||
# \endcode
|
# \endcode
|
||||||
#
|
#
|
||||||
# Environment
|
# Environment
|
||||||
# - WM_PROJECT_SITE (unset defaults to PROJECT/site)
|
# FOAM_CONFIG_ETC
|
||||||
|
# Alternative etc directory for shipped files
|
||||||
|
#
|
||||||
|
# FOAM_CONFIG_MODE
|
||||||
|
# Fallback search mode for etc files. Unset is the same as "ugo".
|
||||||
|
#
|
||||||
|
# WM_PROJECT_SITE (unset defaults to PROJECT/site)
|
||||||
#
|
#
|
||||||
# Note
|
# Note
|
||||||
# This script must exist in the project 'bin' directory
|
# This script must exist in the project 'bin' directory
|
||||||
@ -46,8 +51,8 @@
|
|||||||
printHelp() {
|
printHelp() {
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
Usage: foamEtcFile [OPTION] fileName [-- args]
|
Usage: ${0##*/} [OPTION] fileName [-- args]
|
||||||
foamEtcFile [OPTION] [-list|-list-test] [fileName]
|
${0##*/} [OPTION] [-list|-list-test] [fileName]
|
||||||
|
|
||||||
options:
|
options:
|
||||||
-all (-a) Return all files (otherwise stop after the first match)
|
-all (-a) Return all files (otherwise stop after the first match)
|
||||||
@ -61,8 +66,8 @@ options:
|
|||||||
-config Add config directory prefix for shell type:
|
-config Add config directory prefix for shell type:
|
||||||
with -csh* for a config.csh/ prefix
|
with -csh* for a config.csh/ prefix
|
||||||
with -sh* for a config.sh/ prefix
|
with -sh* for a config.sh/ prefix
|
||||||
-show-api Print api value from wmake/rules, or meta-info and exit
|
-show-api Print META-INFO api value and exit
|
||||||
-show-patch Print patch value from meta-info and exit
|
-show-patch Print META-INFO patch value and exit
|
||||||
-with-api=NUM Specify alternative api value to search with
|
-with-api=NUM Specify alternative api value to search with
|
||||||
-quiet (-q) Suppress all normal output
|
-quiet (-q) Suppress all normal output
|
||||||
-silent (-s) Suppress stderr, except -csh-verbose, -sh-verbose output
|
-silent (-s) Suppress stderr, except -csh-verbose, -sh-verbose output
|
||||||
@ -106,64 +111,40 @@ projectDir="$(\cd $(dirname $binDir) && \pwd -L)" # Project dir
|
|||||||
|
|
||||||
userDir="$HOME/.OpenFOAM" # As per foamVersion.H
|
userDir="$HOME/.OpenFOAM" # As per foamVersion.H
|
||||||
groupDir="${WM_PROJECT_SITE:-$projectDir/site}" # As per foamVersion.H
|
groupDir="${WM_PROJECT_SITE:-$projectDir/site}" # As per foamVersion.H
|
||||||
|
optMode=ugo # Default search = 'ugo'
|
||||||
|
|
||||||
|
# Environment overrides
|
||||||
|
case "$FOAM_CONFIG_MODE" in ([ugo]*) optMode="$FOAM_CONFIG_MODE" ;; esac
|
||||||
|
|
||||||
|
# Verify validity of FOAM_CONFIG_ETC
|
||||||
|
if [ -n "$FOAM_CONFIG_ETC" ]
|
||||||
|
then
|
||||||
|
if [ ! -d "$FOAM_CONFIG_ETC" ] || [ "$FOAM_CONFIG_ETC" = "$projectDir/etc" ]
|
||||||
|
then
|
||||||
|
# Bad directory or redundant value
|
||||||
|
unset FOAM_CONFIG_ETC
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
# The API locations. See wmake/wmakeBuildInfo
|
# Get a value from META-INFO/api-info
|
||||||
rulesFile="$projectDir/wmake/rules/General/general"
|
# $1 : keyword
|
||||||
metaInfoDir="$projectDir/META-INFO"
|
getApiInfo()
|
||||||
|
|
||||||
# Get api from rules/General/general
|
|
||||||
#
|
|
||||||
# Failure modes:
|
|
||||||
# - No api information (can't find file etc).
|
|
||||||
# -> Fatal for building, but could be OK for a stripped down version
|
|
||||||
#
|
|
||||||
# Fallback. Get from api-info
|
|
||||||
#
|
|
||||||
getApi()
|
|
||||||
{
|
{
|
||||||
local value
|
value="$(sed -ne 's@^'"$1"' *= *\([0-9][0-9]*\).*@\1@p' "$projectDir"/META-INFO/api-info 2>/dev/null)"
|
||||||
|
|
||||||
value="$(sed -ne '/^ *#/!{ /WM_VERSION.*OPENFOAM=/{ s@^.*OPENFOAM= *\([0-9][0-9]*\).*@\1@p; q }}' $rulesFile 2>/dev/null)"
|
|
||||||
if [ -z "$value" ] && [ -f "$metaInfoDir/api-info" ]
|
|
||||||
then
|
|
||||||
# Fallback. Get from api-info
|
|
||||||
value="$(sed -ne 's@^ *api *= *\([0-9][0-9]*\).*@\1@p' $metaInfoDir/api-info 2>/dev/null)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$value" ]
|
|
||||||
then
|
|
||||||
echo "$value"
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Get patch from meta-info / api-info
|
|
||||||
#
|
|
||||||
# Failure modes:
|
|
||||||
# - No patch information (can't find file etc).
|
|
||||||
#
|
|
||||||
getPatchLevel()
|
|
||||||
{
|
|
||||||
local value
|
|
||||||
|
|
||||||
# Fallback. Get from api-info
|
|
||||||
value="$(sed -ne 's@^ *patch *= *\([0-9][0-9]*\).*@\1@p' $metaInfoDir/api-info 2>/dev/null)"
|
|
||||||
|
|
||||||
if [ -n "$value" ]
|
if [ -n "$value" ]
|
||||||
then
|
then
|
||||||
echo "$value"
|
echo "$value"
|
||||||
else
|
else
|
||||||
|
echo "Could not determine OPENFOAM '$1' value" 1>&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
optMode=ugo # Default mode is always 'ugo'
|
|
||||||
unset shellOutput verboseOutput
|
unset shellOutput verboseOutput
|
||||||
unset optAll optConfig optList projectApi
|
unset optAll optConfig optList projectApi
|
||||||
|
|
||||||
@ -174,14 +155,12 @@ do
|
|||||||
-h | -help*)
|
-h | -help*)
|
||||||
printHelp
|
printHelp
|
||||||
;;
|
;;
|
||||||
-show-api)
|
-show-api) # Show API and exit
|
||||||
# Show API and exit
|
getApiInfo api
|
||||||
getApi
|
|
||||||
exit $?
|
exit $?
|
||||||
;;
|
;;
|
||||||
-show-patch)
|
-show-patch) # Show patch level and exit
|
||||||
# Show patch level and exit
|
getApiInfo patch
|
||||||
getPatchLevel
|
|
||||||
exit $?
|
exit $?
|
||||||
;;
|
;;
|
||||||
-with-api=*)
|
-with-api=*)
|
||||||
@ -208,7 +187,7 @@ do
|
|||||||
-config)
|
-config)
|
||||||
optConfig=true
|
optConfig=true
|
||||||
;;
|
;;
|
||||||
-mode=[ugoa]*)
|
-mode=[ugo]*)
|
||||||
optMode="${1#*=}"
|
optMode="${1#*=}"
|
||||||
;;
|
;;
|
||||||
-m | -mode)
|
-m | -mode)
|
||||||
@ -216,7 +195,7 @@ do
|
|||||||
shift
|
shift
|
||||||
# Sanity check. Handles missing argument too.
|
# Sanity check. Handles missing argument too.
|
||||||
case "$optMode" in
|
case "$optMode" in
|
||||||
([ugoa]*)
|
([ugo]*)
|
||||||
;;
|
;;
|
||||||
(*)
|
(*)
|
||||||
die "invalid mode '$optMode'"
|
die "invalid mode '$optMode'"
|
||||||
@ -257,8 +236,7 @@ done
|
|||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Establish the API value
|
# Establish the API value
|
||||||
[ -n "$projectApi" ] || projectApi=$(getApi)
|
[ -n "$projectApi" ] || projectApi=$(getApiInfo api)
|
||||||
|
|
||||||
|
|
||||||
# Split arguments into filename (for searching) and trailing bits for shell eval
|
# Split arguments into filename (for searching) and trailing bits for shell eval
|
||||||
# Silently remove leading ~OpenFOAM/ (as per Foam::findEtcFile)
|
# Silently remove leading ~OpenFOAM/ (as per Foam::findEtcFile)
|
||||||
@ -293,23 +271,23 @@ fi
|
|||||||
|
|
||||||
# Define the various places to be searched:
|
# Define the various places to be searched:
|
||||||
unset dirList
|
unset dirList
|
||||||
case "$optMode" in (*[au]*) # (A)ll or (U)ser
|
case "$optMode" in (*[u]*) # (U)ser
|
||||||
dirList="$dirList $userDir/$projectApi $userDir"
|
dirList="$dirList $userDir/$projectApi $userDir"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$optMode" in (*[ag]*) # (A)ll or (G)roup == site
|
case "$optMode" in (*[g]*) # (G)roup == site
|
||||||
dirList="$dirList $groupDir/$projectApi/etc $groupDir/etc"
|
dirList="$dirList $groupDir/$projectApi/etc $groupDir/etc"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$optMode" in (*[ao]*) # (A)ll or (O)ther == shipped
|
case "$optMode" in (*[o]*) # (O)ther == shipped
|
||||||
dirList="$dirList $projectDir/etc"
|
dirList="$dirList $FOAM_CONFIG_ETC $projectDir/etc"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
set -- $dirList
|
set -- $dirList
|
||||||
|
|
||||||
[ "$#" -ge 1 ] || die "No directories to scan. Programming error?"
|
[ "$#" -ge 1 ] || die "No directories to scan. Programming or user error?"
|
||||||
exitCode=2 # Fallback is a FileNotFound error
|
exitCode=2 # Fallback is a FileNotFound error
|
||||||
|
|
||||||
|
|
||||||
@ -318,7 +296,7 @@ exitCode=2 # Fallback is a FileNotFound error
|
|||||||
#
|
#
|
||||||
|
|
||||||
# Special handling of config.sh/ , config.csh/ directories
|
# Special handling of config.sh/ , config.csh/ directories
|
||||||
if [ -n "$optConfig" -a -n "$shellOutput" -a -n "$fileName" ]
|
if [ -n "$optConfig" ] && [ -n "$shellOutput" ] && [ -n "$fileName" ]
|
||||||
then
|
then
|
||||||
case "$shellOutput" in
|
case "$shellOutput" in
|
||||||
csh*)
|
csh*)
|
||||||
|
|||||||
272
bin/tools/create-mpi-config
Executable file
272
bin/tools/create-mpi-config
Executable file
@ -0,0 +1,272 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# ========= |
|
||||||
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
# \\ / O peration |
|
||||||
|
# \\ / A nd | www.openfoam.com
|
||||||
|
# \\/ M anipulation |
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Copyright (C) 2020 OpenCFD Ltd.
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# License
|
||||||
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
|
#
|
||||||
|
# Script
|
||||||
|
# bin/tools/create-mpi-config
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Define hard-coded packaging settings for MPI flavours,
|
||||||
|
# primarily for system openmpi.
|
||||||
|
# This eliminates a runtime dependency on mpicc, for example.
|
||||||
|
#
|
||||||
|
# Instead of querying/parsing 'mpicc --showme:link' each time,
|
||||||
|
# it is done once during packaging.
|
||||||
|
#
|
||||||
|
# Environment
|
||||||
|
# FOAM_MPI, MPI_ARCH_PATH, DEB_TARGET_MULTIARCH
|
||||||
|
#
|
||||||
|
# Possible Dependencies
|
||||||
|
# - dpkg-architecture
|
||||||
|
# - mpicc
|
||||||
|
#
|
||||||
|
# Notes
|
||||||
|
# Run from top-level directory when creating config files
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
printHelp() {
|
||||||
|
exec 1>&2
|
||||||
|
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||||
|
cat<<USAGE
|
||||||
|
|
||||||
|
usage: ${0##*/} options
|
||||||
|
|
||||||
|
options:
|
||||||
|
-dry-run Report but do not write config files
|
||||||
|
-no-mpicc Bypass any use of mpicc
|
||||||
|
-query-openmpi Report installation directory for system openmpi
|
||||||
|
-write-openmpi Query system openmpi and write config files
|
||||||
|
-write Write config files using FOAM_MPI, MPI_ARCH_PATH
|
||||||
|
|
||||||
|
Define hard-coded packaging settings for MPI flavours.
|
||||||
|
|
||||||
|
Equivalent options:
|
||||||
|
-write-system-openmpi | -write-openmpi
|
||||||
|
-query-system-openmpi | -query-openmpi
|
||||||
|
|
||||||
|
USAGE
|
||||||
|
exit 0 # A clean exit
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Report error and exit
|
||||||
|
die()
|
||||||
|
{
|
||||||
|
exec 1>&2
|
||||||
|
echo
|
||||||
|
echo "Error encountered:"
|
||||||
|
while [ "$#" -ge 1 ]; do echo " $1"; shift; done
|
||||||
|
echo
|
||||||
|
echo "See '${0##*/} -help' for usage"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Options
|
||||||
|
unset optDryRun
|
||||||
|
useMpicc=true
|
||||||
|
|
||||||
|
# Get installation directory for system openmpi
|
||||||
|
# - from "mpicc --showme:link"
|
||||||
|
# - manual fallback
|
||||||
|
#
|
||||||
|
# The mpicc content looks like this:
|
||||||
|
# ----
|
||||||
|
# -pthread -L/usr/lib64/mpi/gcc/openmpi/lib64 -lmpi
|
||||||
|
# ----
|
||||||
|
|
||||||
|
query_system_openmpi()
|
||||||
|
{
|
||||||
|
unset arch_path
|
||||||
|
|
||||||
|
if [ "$useMpicc" = true ]
|
||||||
|
then
|
||||||
|
arch_path=$(mpicc --showme:link 2>/dev/null | sed -e 's#^.*-L\([^ ]*\).*#\1#')
|
||||||
|
arch_path="${arch_path%/*}"
|
||||||
|
|
||||||
|
if [ -n "$arch_path" ]
|
||||||
|
then
|
||||||
|
echo "$arch_path"
|
||||||
|
return 0 # Clean exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "No mpicc found. Attempt manually" 1>&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Manual discovery
|
||||||
|
if [ -z "$DEB_TARGET_MULTIARCH" ]
|
||||||
|
then
|
||||||
|
DEB_TARGET_MULTIARCH=$(dpkg-architecture -qDEB_TARGET_MULTIARCH 2>/dev/null || true)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Include is under /usr/lib... (eg, debian, openSUSE)
|
||||||
|
for testdir in \
|
||||||
|
/usr/lib/"${DEB_TARGET_MULTIARCH:+${DEB_TARGET_MULTIARCH}/}"openmpi/include \
|
||||||
|
/usr/lib64/mpi/gcc/openmpi/include \
|
||||||
|
;
|
||||||
|
do
|
||||||
|
if [ -e "$testdir/mpi.h" ]
|
||||||
|
then
|
||||||
|
echo "${testdir%/*}"
|
||||||
|
return 0 # Clean exit
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Include is under /usr/include (eg, RedHat)
|
||||||
|
for testdir in \
|
||||||
|
/usr/include/openmpi-"$(uname -m)" \
|
||||||
|
/usr/include/openmpi \
|
||||||
|
;
|
||||||
|
do
|
||||||
|
if [ -e "$testdir/mpi.h" ]
|
||||||
|
then
|
||||||
|
echo "/usr"
|
||||||
|
return 0 # Clean exit
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Failed (should not happen)
|
||||||
|
# - report '/usr', but with error code 2
|
||||||
|
echo "/usr"
|
||||||
|
return 2
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Generate etc/config.{csh,sh}/MPI-TYPE files
|
||||||
|
# based on the values for FOAM_MPI and MPI_ARCH_PATH
|
||||||
|
|
||||||
|
create_files()
|
||||||
|
{
|
||||||
|
[ -n "$FOAM_MPI" ] || die "FOAM_MPI not set"
|
||||||
|
|
||||||
|
if [ -d "$MPI_ARCH_PATH" ]
|
||||||
|
then
|
||||||
|
echo "Define $FOAM_MPI with $MPI_ARCH_PATH" 1>&2
|
||||||
|
|
||||||
|
case "$FOAM_MPI" in
|
||||||
|
(openmpi-system)
|
||||||
|
configDir="etc/config.sh"
|
||||||
|
if [ "$optDryRun" = true ]
|
||||||
|
then
|
||||||
|
cat << CONTENT 1>&2
|
||||||
|
dry-run: $configDir/$FOAM_MPI
|
||||||
|
#
|
||||||
|
# Packaging configured value for $FOAM_MPI
|
||||||
|
export MPI_ARCH_PATH="$MPI_ARCH_PATH"
|
||||||
|
|
||||||
|
CONTENT
|
||||||
|
elif [ -d "$configDir" ]
|
||||||
|
then
|
||||||
|
echo "Write $configDir/$FOAM_MPI" 1>&2
|
||||||
|
cat << CONTENT > "$configDir/$FOAM_MPI"
|
||||||
|
# $configDir/$FOAM_MPI
|
||||||
|
#
|
||||||
|
# Packaging configured value for $FOAM_MPI
|
||||||
|
|
||||||
|
export MPI_ARCH_PATH="$MPI_ARCH_PATH"
|
||||||
|
#----
|
||||||
|
CONTENT
|
||||||
|
else
|
||||||
|
echo "Cannot write $configDir/$FOAM_MPI - no directory" 1>&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
configDir="etc/config.csh"
|
||||||
|
if [ "$optDryRun" = true ]
|
||||||
|
then
|
||||||
|
cat << CONTENT 1>&2
|
||||||
|
dry-run: $configDir/$FOAM_MPI
|
||||||
|
#
|
||||||
|
# Packaging configured value for $FOAM_MPI
|
||||||
|
setenv MPI_ARCH_PATH "$MPI_ARCH_PATH"
|
||||||
|
|
||||||
|
CONTENT
|
||||||
|
elif [ -d "$configDir" ]
|
||||||
|
then
|
||||||
|
echo "Write $configDir/$FOAM_MPI" 1>&2
|
||||||
|
cat << CONTENT > "$configDir/$FOAM_MPI"
|
||||||
|
# $configDir/$FOAM_MPI
|
||||||
|
#
|
||||||
|
# Packaging configured value for $FOAM_MPI
|
||||||
|
|
||||||
|
setenv MPI_ARCH_PATH "$MPI_ARCH_PATH"
|
||||||
|
#----
|
||||||
|
CONTENT
|
||||||
|
else
|
||||||
|
echo "Cannot write $configDir/$FOAM_MPI - no directory" 1>&2
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
echo "Warning: $FOAM_MPI with bad MPI_ARCH_PATH: $MPI_ARCH_PATH" 1>&2
|
||||||
|
# TBD - remove old/bad entries?
|
||||||
|
#
|
||||||
|
# for file in "etc/config.sh/$FOAM_MPI" "etc/config.csh/$FOAM_MPI"
|
||||||
|
# do
|
||||||
|
# [ -f "$file" ] && rm -f "$file"
|
||||||
|
# done
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Parse options
|
||||||
|
while [ "$#" -gt 0 ]
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
-h | -help* | --help*)
|
||||||
|
printHelp
|
||||||
|
;;
|
||||||
|
'')
|
||||||
|
# Discard empty arguments
|
||||||
|
;;
|
||||||
|
|
||||||
|
-dry-run)
|
||||||
|
optDryRun=true
|
||||||
|
;;
|
||||||
|
|
||||||
|
-no-mpicc)
|
||||||
|
unset useMpicc
|
||||||
|
;;
|
||||||
|
|
||||||
|
-query-openmpi | -query-system-openmpi)
|
||||||
|
query_system_openmpi
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
|
||||||
|
-write-openmpi | -write-system-openmpi)
|
||||||
|
if MPI_ARCH_PATH=$(query_system_openmpi)
|
||||||
|
then
|
||||||
|
FOAM_MPI="openmpi-system"
|
||||||
|
create_files
|
||||||
|
else
|
||||||
|
die "Failed query for system openmpi"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
-write)
|
||||||
|
create_files
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "Ignore unknown option/argument: '$1'" 1>&2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
exit 0 # A clean exit, if we get this far
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
@ -7,11 +7,10 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# Copyright (C) 2016-2019 OpenCFD Ltd.
|
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
# <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
#
|
||||||
# Script
|
# Script
|
||||||
# foamConfigurePaths
|
# foamConfigurePaths
|
||||||
@ -20,69 +19,26 @@
|
|||||||
# Adjust hardcoded installation versions and paths
|
# Adjust hardcoded installation versions and paths
|
||||||
# in etc/{bashrc,cshrc} and etc/config.{sh,csh}/
|
# in etc/{bashrc,cshrc} and etc/config.{sh,csh}/
|
||||||
#
|
#
|
||||||
|
# Requires
|
||||||
|
# - sed
|
||||||
|
# - bin/foamEtcFile
|
||||||
|
#
|
||||||
|
# Environment
|
||||||
|
# FOAM_CONFIG_ETC
|
||||||
|
# Alternative etc directory for shipped files
|
||||||
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printHelp() {
|
||||||
exec 1>&2
|
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
|
||||||
|
|
||||||
usage: ${0##*/} options
|
case "$1" in
|
||||||
|
(*compat*)
|
||||||
Basic
|
cat<<HELP_COMPAT
|
||||||
-project-path DIR specify 'WM_PROJECT_DIR' (eg, /opt/openfoam1806-patch1)
|
Obsolete options:
|
||||||
-version VER specify project version (eg, v1806)
|
|
||||||
-SP | -float32 single precision (WM_PRECISION_OPTION)
|
|
||||||
-DP | -float64 double precision (WM_PRECISION_OPTION)
|
|
||||||
-SPDP mixed single/double precision
|
|
||||||
-int32 | -int64 the 'WM_LABEL_SIZE'
|
|
||||||
|
|
||||||
Compiler
|
|
||||||
-system NAME specify 'system' compiler to use (eg, Gcc, Icc,...)
|
|
||||||
-third NAME specify 'ThirdParty' compiler to use (eg, Clang40,...)
|
|
||||||
-gcc VER specify 'gcc_version' for ThirdParty Gcc
|
|
||||||
-clang VER specify 'clang_version' for ThirdParty Clang
|
|
||||||
gmp-VERSION for ThirdParty gcc (gmp-system for system library)
|
|
||||||
mpfr-VERSION for ThirdParty gcc (mpfr-system for system library)
|
|
||||||
mpc-VERSION for ThirdParty gcc (mpc-system for system library)
|
|
||||||
|
|
||||||
MPI
|
|
||||||
-mpi NAME specify 'WM_MPLIB' type (eg, INTELMPI, etc)
|
|
||||||
-openmpi VER use ThirdParty openmpi, with version for 'FOAM_MPI'
|
|
||||||
-openmpi-system use system openmpi
|
|
||||||
-openmpi-third use ThirdParty openmpi (using default version)
|
|
||||||
|
|
||||||
Components
|
|
||||||
-boost VER specify 'boost_version'
|
|
||||||
-boost-path DIR specify 'BOOST_ARCH_PATH'
|
|
||||||
-cgal ver specify 'cgal_version'
|
|
||||||
-cgal-path DIR specify 'CGAL_ARCH_PATH'
|
|
||||||
-cmake VER specify 'cmake_version'
|
|
||||||
-fftw VER specify 'fffw_version'
|
|
||||||
-fftw-path DIR specify 'FFTW_ARCH_PATH'
|
|
||||||
-kahip VER specify 'KAHIP_VERSION'
|
|
||||||
-kahip-path DIR specify 'KAHIP_ARCH_PATH'
|
|
||||||
-metis ver specify 'METIS_VERSION'
|
|
||||||
-metis-path DIR specify 'METIS_ARCH_PATH'
|
|
||||||
-scotch VER specify 'SCOTCH_VERSION' (eg, scotch_6.0.4)
|
|
||||||
-scotch-path DIR specify 'SCOTCH_ARCH_PATH' (eg, /opt/scotch_6.0.4)
|
|
||||||
|
|
||||||
Graphics
|
|
||||||
-paraview VER specify 'ParaView_VERSION' (eg, 5.4.1 or system)
|
|
||||||
-paraview-qt VER specify 'ParaView_QT' (eg, qt-system)
|
|
||||||
-paraview-path DIR specify 'ParaView_DIR' (eg, /opt/ParaView-5.4.1)
|
|
||||||
-vtk VER specify 'vtk_version' (eg, VTK-7.1.0)
|
|
||||||
-mesa VER specify 'mesa_version' (eg, mesa-13.0.1)
|
|
||||||
|
|
||||||
Misc
|
|
||||||
-foamInstall DIR [obsolete]
|
-foamInstall DIR [obsolete]
|
||||||
-projectName NAME [obsolete]
|
-projectName NAME [obsolete]
|
||||||
-sigfpe|-no-sigfpe [obsolete - now under etc/controlDict]
|
-sigfpe|-no-sigfpe [obsolete - now under etc/controlDict]
|
||||||
-archOption 32|64 [obsolete setting of 'WM_ARCH_OPTION' - edit manually]
|
-archOption 32|64 [obsolete setting of 'WM_ARCH_OPTION' - edit manually]
|
||||||
|
|
||||||
|
|
||||||
Adjusts hardcoded versions and installation paths (POSIX and C-shell).
|
|
||||||
|
|
||||||
|
|
||||||
Equivalent options:
|
Equivalent options:
|
||||||
-version -foamVersion --projectVersion
|
-version -foamVersion --projectVersion
|
||||||
-archOption --archOption
|
-archOption --archOption
|
||||||
@ -91,11 +47,96 @@ Equivalent options:
|
|||||||
-paraview-path --paraviewInstall | -paraviewInstall
|
-paraview-path --paraviewInstall | -paraviewInstall
|
||||||
-scotch --scotchVersion | -scotchVersion
|
-scotch --scotchVersion | -scotchVersion
|
||||||
-scotch-path --scotchArchPath | -scotchArchPath
|
-scotch-path --scotchArchPath | -scotchArchPath
|
||||||
|
-system-compiler -system
|
||||||
|
-third-compiler -third
|
||||||
|
|
||||||
USAGE
|
HELP_COMPAT
|
||||||
exit 1
|
exit 0 # A clean exit
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
cat<<HELP_HEAD
|
||||||
|
|
||||||
|
usage: $0 options
|
||||||
|
|
||||||
|
Options
|
||||||
|
-h | -help Display short help and exit
|
||||||
|
-help-compat Display compatibility options and exit
|
||||||
|
-help-full Display full help and exit
|
||||||
|
|
||||||
|
Basic
|
||||||
|
-etc=DIR set FOAM_CONFIG_ETC for alternative project files
|
||||||
|
-project-path DIR specify 'WM_PROJECT_DIR' (eg, /opt/openfoam1806-patch1)
|
||||||
|
-version VER specify project version (eg, v1806)
|
||||||
|
-sp | -SP | -float32 single precision (WM_PRECISION_OPTION)
|
||||||
|
-dp | -DP | -float64 double precision (WM_PRECISION_OPTION)
|
||||||
|
-spdp | -SPDP mixed precision (WM_PRECISION_OPTION)
|
||||||
|
-int32 | -int64 label-size (WM_LABEL_SIZE)
|
||||||
|
|
||||||
|
Compiler
|
||||||
|
-system-compiler NAME The 'system' compiler to use (eg, Gcc, Clang, Icc,...)
|
||||||
|
-third-compiler NAME The 'ThirdParty' compiler to use (eg, Clang40,...)
|
||||||
|
-gcc VER The 'default_gcc_version' for ThirdParty Gcc
|
||||||
|
-clang VER The 'default_clang_version' for ThirdParty Clang
|
||||||
|
gmp-VERSION For ThirdParty gcc (gmp-system for system library)
|
||||||
|
mpfr-VERSION For ThirdParty gcc (mpfr-system for system library)
|
||||||
|
mpc-VERSION For ThirdParty gcc (mpc-system for system library)
|
||||||
|
|
||||||
|
MPI
|
||||||
|
-mpi NAME specify 'WM_MPLIB' type (eg, INTELMPI, etc)
|
||||||
|
-openmpi VER use ThirdParty openmpi, with version for 'FOAM_MPI'
|
||||||
|
-openmpi-system use system openmpi
|
||||||
|
-openmpi-third use ThirdParty openmpi (using default version)
|
||||||
|
|
||||||
|
Components versions (ThirdParty)
|
||||||
|
-adios VER specify 'adios2_version'
|
||||||
|
-boost VER specify 'boost_version'
|
||||||
|
-cgal VER specify 'cgal_version'
|
||||||
|
-cmake VER specify 'cmake_version'
|
||||||
|
-fftw VER specify 'fffw_version'
|
||||||
|
-kahip VER specify 'KAHIP_VERSION'
|
||||||
|
-metis VER specify 'METIS_VERSION'
|
||||||
|
-scotch VER specify 'SCOTCH_VERSION' (eg, scotch_6.0.4)
|
||||||
|
|
||||||
|
HELP_HEAD
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
(*full*)
|
||||||
|
cat<<HELP_FULL
|
||||||
|
Components specified by absolute path
|
||||||
|
-adios-path DIR Path for 'ADIOS2_ARCH_PATH' (overrides -adios)
|
||||||
|
-boost-path DIR Path for 'BOOST_ARCH_PATH' (overrides -boost)
|
||||||
|
-cgal-path DIR Path for 'CGAL_ARCH_PATH' (overrides -cgal)
|
||||||
|
-fftw-path DIR Path for 'FFTW_ARCH_PATH' (overrides -fftw)
|
||||||
|
-kahip-path DIR Path for 'KAHIP_ARCH_PATH' (overrides -kahip)
|
||||||
|
-metis-path DIR Path for 'METIS_ARCH_PATH' (overrides -metis)
|
||||||
|
-scotch-path DIR Path for 'SCOTCH_ARCH_PATH' (overrides -scotch)
|
||||||
|
|
||||||
|
Graphics
|
||||||
|
-paraview VER specify 'ParaView_VERSION' (eg, 5.4.1 or system)
|
||||||
|
-paraview-qt VER specify 'ParaView_QT' (eg, qt-system)
|
||||||
|
-paraview-path DIR specify 'ParaView_DIR' (eg, /opt/ParaView-5.4.1)
|
||||||
|
-llvm VER specify 'mesa_llvm'
|
||||||
|
-mesa VER specify 'mesa_version' (eg, mesa-13.0.1)
|
||||||
|
-vtk VER specify 'vtk_version' (eg, VTK-7.1.0)
|
||||||
|
-llvm-path DIR Path for 'LLVM_ARCH_PATH' (overrides -llvm)
|
||||||
|
-mesa-path DIR Path for 'MESA_ARCH_PATH' (overrides -mesa)
|
||||||
|
-vtk-path DIR Path for 'VTK_DIR' (overrides -vtk)
|
||||||
|
|
||||||
|
HELP_FULL
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
cat<<HELP_TAIL_COMMON
|
||||||
|
Adjusts hardcoded versions and installation paths (POSIX and C-shell)
|
||||||
|
for OpenFOAM.
|
||||||
|
|
||||||
|
HELP_TAIL_COMMON
|
||||||
|
|
||||||
|
exit 0 # A clean exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Report error and exit
|
# Report error and exit
|
||||||
die()
|
die()
|
||||||
{
|
{
|
||||||
@ -104,16 +145,32 @@ die()
|
|||||||
echo "Error encountered:"
|
echo "Error encountered:"
|
||||||
while [ "$#" -ge 1 ]; do echo " $1"; shift; done
|
while [ "$#" -ge 1 ]; do echo " $1"; shift; done
|
||||||
echo
|
echo
|
||||||
echo "See '${0##*/} -help' for usage"
|
echo "See '$0 -help' for usage"
|
||||||
echo
|
echo
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
projectDir="$(\pwd -L)" # Project dir
|
||||||
|
|
||||||
# Check that it appears to be an OpenFOAM installation
|
# Check that it appears to be an OpenFOAM installation
|
||||||
[ -f etc/bashrc -a -d etc/config.sh ] || \
|
if [ -f etc/bashrc ] && [ -d "META-INFO" ]
|
||||||
usage "Please run from top-level directory of installation"
|
then
|
||||||
|
echo "Configuring OpenFOAM ($projectDir)" 1>&2
|
||||||
|
else
|
||||||
|
die "Please run from the OpenFOAM top-level installation directory" \
|
||||||
|
"No etc/bashrc or META-INFO/ found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use foamEtcFile to locate files, but only edit shipped files
|
||||||
|
if [ -x bin/foamEtcFile ]
|
||||||
|
then
|
||||||
|
_foamEtc() {
|
||||||
|
./bin/foamEtcFile -mode=o "$@"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
die "No bin/foamEtcFile found in installation"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Check if argument matches the expected input. Respects case.
|
# Check if argument matches the expected input. Respects case.
|
||||||
@ -144,18 +201,22 @@ _inlineSed()
|
|||||||
local replacement="$3"
|
local replacement="$3"
|
||||||
local msg="$4"
|
local msg="$4"
|
||||||
local cmd='/^[^#]/s@'"$regexp"'@'"$replacement"'@'
|
local cmd='/^[^#]/s@'"$regexp"'@'"$replacement"'@'
|
||||||
|
local localFile
|
||||||
|
|
||||||
[ -f "$file" ] || {
|
[ -f "$file" ] || {
|
||||||
echo "Missing file: $file"
|
echo "Missing file: $file"
|
||||||
exit 2 # Fatal
|
exit 2 # Fatal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Local filename (for reporting)
|
||||||
|
localFile="$(echo "$file" | sed -e "s#^$projectDir/##")"
|
||||||
|
|
||||||
grep -q "$regexp" "$file" && sed -i -e "$cmd" "$file" || { \
|
grep -q "$regexp" "$file" && sed -i -e "$cmd" "$file" || { \
|
||||||
echo "Failed: ${msg:-replacement} in $file"
|
echo "Failed: ${msg:-replacement} in $localFile"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
[ -n "$msg" ] && echo " $msg ($file)"
|
[ -n "$msg" ] && echo " $msg ($localFile)"
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -181,7 +242,7 @@ replace()
|
|||||||
"$file" \
|
"$file" \
|
||||||
"$key=.*" \
|
"$key=.*" \
|
||||||
"$key=$val" \
|
"$key=$val" \
|
||||||
"Replaced $key setting by '$val'"
|
"Replaced $key by '$val'"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,12 +265,34 @@ replaceCsh()
|
|||||||
|
|
||||||
_inlineSed \
|
_inlineSed \
|
||||||
"$file" \
|
"$file" \
|
||||||
"setenv *$key [^ #]*" \
|
"setenv [ ]*$key [^ #]*" \
|
||||||
"setenv $key $val" \
|
"setenv $key $val" \
|
||||||
"Replaced $key setenv by '$val'"
|
"Replaced $key by '$val'"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Locate file with foamEtcFile -mode=o and forward to replace()
|
||||||
|
replaceEtc()
|
||||||
|
{
|
||||||
|
local file="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
file=$(_foamEtc "$file")
|
||||||
|
replace $file "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Locate file with foamEtcFile -mode=o and forward to replaceCsh()
|
||||||
|
replaceEtcCsh()
|
||||||
|
{
|
||||||
|
local file="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
file=$(_foamEtc "$file")
|
||||||
|
replaceCsh $file "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Get the option's value (argument), or die on missing or empty argument
|
# Get the option's value (argument), or die on missing or empty argument
|
||||||
# $1 option
|
# $1 option
|
||||||
# $2 value
|
# $2 value
|
||||||
@ -273,23 +356,62 @@ unset adjusted optMpi
|
|||||||
while [ "$#" -gt 0 ]
|
while [ "$#" -gt 0 ]
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-h | -help* | --help*)
|
-help-c*) # Compat help
|
||||||
usage
|
printHelp -compat
|
||||||
|
;;
|
||||||
|
-help-f*) # Full help
|
||||||
|
printHelp -full
|
||||||
|
;;
|
||||||
|
-h | -help*) # Short help
|
||||||
|
printHelp
|
||||||
;;
|
;;
|
||||||
'')
|
'')
|
||||||
# Discard empty arguments
|
# Discard empty arguments
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
-debug-list)
|
||||||
|
# Undocumented (experimental)
|
||||||
|
# TDB: List files that can be edited by this script
|
||||||
|
cat << CONFIG_SH
|
||||||
|
etc/bashrc
|
||||||
|
etc/config.sh/adios2
|
||||||
|
etc/config.sh/compiler
|
||||||
|
etc/config.sh/paraview
|
||||||
|
etc/config.sh/vtk
|
||||||
|
etc/config.sh/CGAL
|
||||||
|
etc/config.sh/FFTW
|
||||||
|
etc/config.sh/metis
|
||||||
|
etc/config.sh/kahip
|
||||||
|
etc/config.sh/scotch
|
||||||
|
CONFIG_SH
|
||||||
|
|
||||||
|
cat << CONFIG_CSH
|
||||||
|
etc/cshrc
|
||||||
|
etc/config.csh/adios2
|
||||||
|
etc/config.csh/compiler
|
||||||
|
etc/config.csh/paraview
|
||||||
|
etc/config.csh/vtk
|
||||||
|
etc/config.csh/CGAL
|
||||||
|
etc/config.csh/FFTW
|
||||||
|
CONFIG_CSH
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
|
||||||
## Basic ##
|
## Basic ##
|
||||||
|
|
||||||
|
-etc=*)
|
||||||
|
# Define FOAM_CONFIG_ETC for finding files
|
||||||
|
export FOAM_CONFIG_ETC="${1#*=}"
|
||||||
|
;;
|
||||||
|
|
||||||
-project-path)
|
-project-path)
|
||||||
# Replace WM_PROJECT_DIR=...
|
# Replace WM_PROJECT_DIR=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/bashrc WM_PROJECT_DIR "\"$optionValue\""
|
replaceEtc bashrc WM_PROJECT_DIR "\"$optionValue\""
|
||||||
replaceCsh etc/cshrc WM_PROJECT_DIR "\"$optionValue\""
|
replaceEtcCsh cshrc WM_PROJECT_DIR "\"$optionValue\""
|
||||||
|
|
||||||
removeBashMagic etc/bashrc
|
removeBashMagic $(_foamEtc bashrc)
|
||||||
removeCshMagic etc/cshrc
|
removeCshMagic $(_foamEtc cshrc)
|
||||||
|
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
@ -298,8 +420,8 @@ do
|
|||||||
-version | -foamVersion | --projectVersion)
|
-version | -foamVersion | --projectVersion)
|
||||||
# Replace WM_PROJECT_VERSION=...
|
# Replace WM_PROJECT_VERSION=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/bashrc WM_PROJECT_VERSION "$optionValue"
|
replaceEtc bashrc WM_PROJECT_VERSION "$optionValue"
|
||||||
replaceCsh etc/cshrc WM_PROJECT_VERSION "$optionValue"
|
replaceEtcCsh cshrc WM_PROJECT_VERSION "$optionValue"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -311,32 +433,32 @@ do
|
|||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-SP | -float32)
|
-sp | -SP | -float32)
|
||||||
# Replace WM_PRECISION_OPTION=...
|
# Replace WM_PRECISION_OPTION=...
|
||||||
replace etc/bashrc WM_PRECISION_OPTION "SP"
|
replaceEtc bashrc WM_PRECISION_OPTION "SP"
|
||||||
replaceCsh etc/cshrc WM_PRECISION_OPTION "SP"
|
replaceEtcCsh cshrc WM_PRECISION_OPTION "SP"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-DP | -float64)
|
-dp | -DP | -float64)
|
||||||
# Replace WM_PRECISION_OPTION=...
|
# Replace WM_PRECISION_OPTION=...
|
||||||
replace etc/bashrc WM_PRECISION_OPTION "DP"
|
replaceEtc bashrc WM_PRECISION_OPTION "DP"
|
||||||
replaceCsh etc/cshrc WM_PRECISION_OPTION "DP"
|
replaceEtcCsh cshrc WM_PRECISION_OPTION "DP"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-SPDP)
|
-spdp | -SPDP)
|
||||||
# Replace WM_PRECISION_OPTION=...
|
# Replace WM_PRECISION_OPTION=...
|
||||||
replace etc/bashrc WM_PRECISION_OPTION "SPDP"
|
replaceEtc bashrc WM_PRECISION_OPTION "SPDP"
|
||||||
replaceCsh etc/cshrc WM_PRECISION_OPTION "SPDP"
|
replaceEtcCsh cshrc WM_PRECISION_OPTION "SPDP"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-int32 | -int64)
|
-int32 | -int64)
|
||||||
# Replace WM_LABEL_SIZE=...
|
# Replace WM_LABEL_SIZE=...
|
||||||
optionValue="${1#-int}"
|
optionValue="${1#-int}"
|
||||||
replace etc/bashrc WM_LABEL_SIZE "$optionValue"
|
replaceEtc bashrc WM_LABEL_SIZE "$optionValue"
|
||||||
replaceCsh etc/cshrc WM_LABEL_SIZE "$optionValue"
|
replaceEtcCsh cshrc WM_LABEL_SIZE "$optionValue"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@ -344,43 +466,43 @@ do
|
|||||||
## Compiler ##
|
## Compiler ##
|
||||||
|
|
||||||
-clang)
|
-clang)
|
||||||
# Replace clang_version=...
|
# Replace default_clang_version=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/config.sh/compiler clang_version "$optionValue"
|
replaceEtc config.sh/compiler default_clang_version "$optionValue"
|
||||||
replace etc/config.csh/compiler clang_version "$optionValue"
|
replaceEtc config.csh/compiler default_clang_version "$optionValue"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-gcc)
|
-gcc)
|
||||||
# Replace gcc_version=...
|
# Replace default_gcc_version=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/config.sh/compiler gcc_version "$optionValue"
|
replaceEtc config.sh/compiler default_gcc_version "$optionValue"
|
||||||
replace etc/config.csh/compiler gcc_version "$optionValue"
|
replaceEtc config.csh/compiler default_gcc_version "$optionValue"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-system)
|
-system-compiler | -system)
|
||||||
# Replace WM_COMPILER_TYPE=... and WM_COMPILER=...
|
# Replace WM_COMPILER_TYPE=... and WM_COMPILER=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/bashrc \
|
replaceEtc bashrc \
|
||||||
WM_COMPILER_TYPE system \
|
WM_COMPILER_TYPE system \
|
||||||
WM_COMPILER "$optionValue"
|
WM_COMPILER "$optionValue"
|
||||||
replaceCsh etc/cshrc \
|
replaceEtcCsh cshrc \
|
||||||
WM_COMPILER_TYPE system \
|
WM_COMPILER_TYPE system \
|
||||||
WM_COMPILER "$optionValue"
|
WM_COMPILER "$optionValue"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-third | -ThirdParty)
|
-third-compiler | -third | -ThirdParty)
|
||||||
# Replace WM_COMPILER_TYPE=... and WM_COMPILER=...
|
# Replace WM_COMPILER_TYPE=... and WM_COMPILER=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/bashrc \
|
replaceEtc bashrc \
|
||||||
WM_COMPILER_TYPE ThirdParty \
|
WM_COMPILER_TYPE ThirdParty \
|
||||||
WM_COMPILER "$optionValue"
|
WM_COMPILER "$optionValue"
|
||||||
replaceCsh etc/cshrc \
|
replaceEtcCsh cshrc \
|
||||||
WM_COMPILER_TYPE ThirdParty \
|
WM_COMPILER_TYPE ThirdParty \
|
||||||
WM_COMPILER "$optionValue"
|
WM_COMPILER "$optionValue"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
@ -389,22 +511,22 @@ do
|
|||||||
|
|
||||||
gmp-[4-9]* | gmp-system)
|
gmp-[4-9]* | gmp-system)
|
||||||
# gcc-related package
|
# gcc-related package
|
||||||
replace etc/config.sh/compiler gmp_version "$1"
|
replaceEtc config.sh/compiler default_gmp_version "$1"
|
||||||
replace etc/config.csh/compiler gmp_version "$1"
|
replaceEtc config.csh/compiler default_gmp_version "$1"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
;;
|
;;
|
||||||
|
|
||||||
mpfr-[2-9]* | mpfr-system)
|
mpfr-[2-9]* | mpfr-system)
|
||||||
# gcc-related package
|
# gcc-related package
|
||||||
replace etc/config.sh/compiler mpfr_version "$1"
|
replaceEtc config.sh/compiler default_mpfr_version "$1"
|
||||||
replace etc/config.csh/compiler mpfr_version "$1"
|
replaceEtc config.csh/compiler default_mpfr_version "$1"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
;;
|
;;
|
||||||
|
|
||||||
mpc-[0-9]* | mpc-system)
|
mpc-[0-9]* | mpc-system)
|
||||||
# gcc-related package
|
# gcc-related package
|
||||||
replace etc/config.sh/compiler mpc_version "$1"
|
replaceEtc config.sh/compiler default_mpc_version "$1"
|
||||||
replace etc/config.csh/compiler mpc_version "$1"
|
replaceEtc config.csh/compiler default_mpc_version "$1"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@ -414,8 +536,8 @@ do
|
|||||||
-mpi)
|
-mpi)
|
||||||
# Explicitly set WM_MPLIB=...
|
# Explicitly set WM_MPLIB=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/bashrc WM_MPLIB "$optionValue"
|
replaceEtc bashrc WM_MPLIB "$optionValue"
|
||||||
replaceCsh etc/bashrc WM_MPLIB "$optionValue"
|
replaceEtcCsh cshrc WM_MPLIB "$optionValue"
|
||||||
optMpi=system
|
optMpi=system
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
@ -430,34 +552,34 @@ do
|
|||||||
_matches "$optMpi" "$expected" || \
|
_matches "$optMpi" "$expected" || \
|
||||||
die "'$1' has bad value: '$optMpi'"
|
die "'$1' has bad value: '$optMpi'"
|
||||||
|
|
||||||
_inlineSed etc/config.sh/mpi \
|
_inlineSed $(_foamEtc config.sh/mpi) \
|
||||||
"FOAM_MPI=$expected" \
|
"FOAM_MPI=$expected" \
|
||||||
"FOAM_MPI=$optMpi" \
|
"FOAM_MPI=$optMpi" \
|
||||||
"Replaced 'FOAM_MPI=$expected' setting by 'FOAM_MPI=$optMpi'"
|
"Replaced 'FOAM_MPI=$expected' by 'FOAM_MPI=$optMpi'"
|
||||||
|
|
||||||
_inlineSed etc/config.csh/mpi \
|
_inlineSed $(_foamEtc config.csh/mpi) \
|
||||||
"FOAM_MPI $expected" \
|
"FOAM_MPI $expected" \
|
||||||
"FOAM_MPI $optMpi" \
|
"FOAM_MPI $optMpi" \
|
||||||
"Replaced 'FOAM_MPI $expected' setting by 'FOAM_MPI $optMpi'"
|
"Replaced 'FOAM_MPI $expected' by 'FOAM_MPI $optMpi'"
|
||||||
|
|
||||||
replace etc/bashrc WM_MPLIB OPENMPI
|
replaceEtc bashrc WM_MPLIB OPENMPI
|
||||||
replaceCsh etc/cshrc WM_MPLIB OPENMPI
|
replaceEtcCsh cshrc WM_MPLIB OPENMPI
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-openmpi-system)
|
-openmpi-system)
|
||||||
# Explicitly set WM_MPLIB=SYSTEMOPENMPI
|
# Explicitly set WM_MPLIB=SYSTEMOPENMPI
|
||||||
replace etc/bashrc WM_MPLIB SYSTEMOPENMPI
|
replaceEtc bashrc WM_MPLIB SYSTEMOPENMPI
|
||||||
replaceCsh etc/cshrc WM_MPLIB SYSTEMOPENMPI
|
replaceEtcCsh cshrc WM_MPLIB SYSTEMOPENMPI
|
||||||
optMpi=system
|
optMpi=system
|
||||||
adjusted=true
|
adjusted=true
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-openmpi-third)
|
-openmpi-third)
|
||||||
# Explicitly set WM_MPLIB=OPENMPI, using default setting for openmpi
|
# Explicitly set WM_MPLIB=OPENMPI, using default setting for openmpi
|
||||||
replace etc/bashrc WM_MPLIB OPENMPI
|
replaceEtc bashrc WM_MPLIB OPENMPI
|
||||||
replaceCsh etc/cshrc WM_MPLIB OPENMPI
|
replaceEtcCsh cshrc WM_MPLIB OPENMPI
|
||||||
optMpi=third
|
optMpi=third
|
||||||
adjusted=true
|
adjusted=true
|
||||||
;;
|
;;
|
||||||
@ -465,11 +587,29 @@ do
|
|||||||
|
|
||||||
## Components ##
|
## Components ##
|
||||||
|
|
||||||
|
-adios | -adios2)
|
||||||
|
# Replace adios2_version=...
|
||||||
|
optionValue=$(getOptionValue "$@")
|
||||||
|
replaceEtc config.sh/adios2 adios2_version "$optionValue"
|
||||||
|
replaceEtc config.csh/adios2 adios2_version "$optionValue"
|
||||||
|
adjusted=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
|
-adios-path | -adios2-path)
|
||||||
|
# Replace ADIOS2_ARCH_PATH=...
|
||||||
|
optionValue=$(getOptionValue "$@")
|
||||||
|
replaceEtc config.sh/adios2 ADIOS2_ARCH_PATH "\"$optionValue\""
|
||||||
|
replaceEtcCsh config.csh/adios2 ADIOS2_ARCH_PATH "\"$optionValue\""
|
||||||
|
adjusted=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
-boost)
|
-boost)
|
||||||
# Replace boost_version=...
|
# Replace boost_version=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/config.sh/CGAL boost_version "$optionValue"
|
replaceEtc config.sh/CGAL boost_version "$optionValue"
|
||||||
replace etc/config.csh/CGAL boost_version "$optionValue"
|
replaceEtc config.csh/CGAL boost_version "$optionValue"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -477,8 +617,8 @@ do
|
|||||||
-boost-path)
|
-boost-path)
|
||||||
# Replace BOOST_ARCH_PATH=...
|
# Replace BOOST_ARCH_PATH=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/config.sh/CGAL BOOST_ARCH_PATH "\"$optionValue\""
|
replaceEtc config.sh/CGAL BOOST_ARCH_PATH "\"$optionValue\""
|
||||||
replaceCsh etc/config.csh/CGAL BOOST_ARCH_PATH "\"$optionValue\""
|
replaceEtcCsh config.csh/CGAL BOOST_ARCH_PATH "\"$optionValue\""
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -486,8 +626,8 @@ do
|
|||||||
-cgal)
|
-cgal)
|
||||||
# Replace cgal_version=...
|
# Replace cgal_version=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/config.sh/CGAL cgal_version "$optionValue"
|
replaceEtc config.sh/CGAL cgal_version "$optionValue"
|
||||||
replace etc/config.csh/CGAL cgal_version "$optionValue"
|
replaceEtc config.csh/CGAL cgal_version "$optionValue"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -495,8 +635,8 @@ do
|
|||||||
-cgal-path)
|
-cgal-path)
|
||||||
# Replace CGAL_ARCH_PATH=...
|
# Replace CGAL_ARCH_PATH=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/config.sh/CGAL CGAL_ARCH_PATH "$optionValue"
|
replaceEtc config.sh/CGAL CGAL_ARCH_PATH "$optionValue"
|
||||||
replaceCsh etc/config.csh/CGAL CGAL_ARCH_PATH "$optionValue"
|
replaceEtcCsh config.csh/CGAL CGAL_ARCH_PATH "$optionValue"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -504,8 +644,8 @@ do
|
|||||||
-fftw)
|
-fftw)
|
||||||
# Replace fftw_version=...
|
# Replace fftw_version=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/config.sh/FFTW fftw_version "$optionValue"
|
replaceEtc config.sh/FFTW fftw_version "$optionValue"
|
||||||
replace etc/config.csh/FFTW fftw_version "$optionValue"
|
replaceEtc config.csh/FFTW fftw_version "$optionValue"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -513,8 +653,8 @@ do
|
|||||||
-fftw-path)
|
-fftw-path)
|
||||||
# Replace FFTW_ARCH_PATH=...
|
# Replace FFTW_ARCH_PATH=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/config.sh/FFTW FFTW_ARCH_PATH "\"$optionValue\""
|
replaceEtc config.sh/FFTW FFTW_ARCH_PATH "\"$optionValue\""
|
||||||
replaceCsh etc/config.csh/FFTW FFTW_ARCH_PATH "\"$optionValue\""
|
replaceEtcCsh config.csh/FFTW FFTW_ARCH_PATH "\"$optionValue\""
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -522,8 +662,8 @@ do
|
|||||||
-cmake)
|
-cmake)
|
||||||
# Replace cmake_version=...
|
# Replace cmake_version=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/config.sh/paraview cmake_version "$optionValue"
|
replaceEtc config.sh/paraview cmake_version "$optionValue"
|
||||||
replace etc/config.csh/paraview cmake_version "$optionValue"
|
replaceEtc config.csh/paraview cmake_version "$optionValue"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -531,7 +671,7 @@ do
|
|||||||
-kahip)
|
-kahip)
|
||||||
# Replace KAHIP_VERSION=...
|
# Replace KAHIP_VERSION=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/config.sh/kahip KAHIP_VERSION "$optionValue"
|
replaceEtc config.sh/kahip KAHIP_VERSION "$optionValue"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -539,7 +679,7 @@ do
|
|||||||
-kahip-path)
|
-kahip-path)
|
||||||
# Replace KAHIP_ARCH_PATH=...
|
# Replace KAHIP_ARCH_PATH=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/config.sh/kahip KAHIP_ARCH_PATH "\"$optionValue\""
|
replaceEtc config.sh/kahip KAHIP_ARCH_PATH "\"$optionValue\""
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -547,7 +687,7 @@ do
|
|||||||
-metis)
|
-metis)
|
||||||
# Replace METIS_VERSION=...
|
# Replace METIS_VERSION=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/config.sh/metis METIS_VERSION "$optionValue"
|
replaceEtc config.sh/metis METIS_VERSION "$optionValue"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -555,7 +695,7 @@ do
|
|||||||
-metis-path)
|
-metis-path)
|
||||||
# Replace METIS_ARCH_PATH=...
|
# Replace METIS_ARCH_PATH=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/config.sh/metis METIS_ARCH_PATH "\"$optionValue\""
|
replaceEtc config.sh/metis METIS_ARCH_PATH "\"$optionValue\""
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -563,7 +703,7 @@ do
|
|||||||
-scotch | -scotchVersion | --scotchVersion)
|
-scotch | -scotchVersion | --scotchVersion)
|
||||||
# Replace SCOTCH_VERSION=...
|
# Replace SCOTCH_VERSION=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/config.sh/scotch SCOTCH_VERSION "$optionValue"
|
replaceEtc config.sh/scotch SCOTCH_VERSION "$optionValue"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -571,7 +711,7 @@ do
|
|||||||
-scotch-path | -scotchArchPath | --scotchArchPath)
|
-scotch-path | -scotchArchPath | --scotchArchPath)
|
||||||
# Replace SCOTCH_ARCH_PATH=...
|
# Replace SCOTCH_ARCH_PATH=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/config.sh/scotch SCOTCH_ARCH_PATH "\"$optionValue\""
|
replaceEtc config.sh/scotch SCOTCH_ARCH_PATH "\"$optionValue\""
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -586,8 +726,8 @@ do
|
|||||||
_matches "$optionValue" "$expected" || \
|
_matches "$optionValue" "$expected" || \
|
||||||
[ "$optionValue" != "${optionValue%system}" ] || \
|
[ "$optionValue" != "${optionValue%system}" ] || \
|
||||||
die "'$1' has bad value: '$optionValue'"
|
die "'$1' has bad value: '$optionValue'"
|
||||||
replace etc/config.sh/paraview ParaView_VERSION "$optionValue"
|
replaceEtc config.sh/paraview ParaView_VERSION "$optionValue"
|
||||||
replace etc/config.csh/paraview ParaView_VERSION "$optionValue"
|
replaceEtc config.csh/paraview ParaView_VERSION "$optionValue"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -595,8 +735,8 @@ do
|
|||||||
-paraview-qt)
|
-paraview-qt)
|
||||||
# Replace ParaView_QT=...
|
# Replace ParaView_QT=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/config.sh/paraview ParaView_QT "$optionValue"
|
replaceEtc config.sh/paraview ParaView_QT "$optionValue"
|
||||||
replace etc/config.csh/paraview ParaView_QT "$optionValue"
|
replaceEtc config.csh/paraview ParaView_QT "$optionValue"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -604,17 +744,17 @@ do
|
|||||||
-paraview-path | -paraviewInstall | --paraviewInstall)
|
-paraview-path | -paraviewInstall | --paraviewInstall)
|
||||||
# Replace ParaView_DIR=...
|
# Replace ParaView_DIR=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/config.sh/paraview ParaView_DIR \""$optionValue\""
|
replaceEtc config.sh/paraview ParaView_DIR \""$optionValue\""
|
||||||
replaceCsh etc/config.csh/paraview ParaView_DIR \""$optionValue\""
|
replaceEtcCsh config.csh/paraview ParaView_DIR \""$optionValue\""
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-vtk)
|
-llvm)
|
||||||
# Replace vtk_version=...
|
# Replace mesa_llvm=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/config.sh/vtk vtk_version "$optionValue"
|
replaceEtc config.sh/vtk mesa_llvm "$optionValue"
|
||||||
replace etc/config.csh/vtk vtk_version "$optionValue"
|
replaceEtc config.csh/vtk mesa_llvm "$optionValue"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -622,8 +762,44 @@ do
|
|||||||
-mesa)
|
-mesa)
|
||||||
# Replace mesa_version=...
|
# Replace mesa_version=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replace etc/config.sh/vtk mesa_version "$optionValue"
|
replaceEtc config.sh/vtk mesa_version "$optionValue"
|
||||||
replace etc/config.csh/vtk mesa_version "$optionValue"
|
replaceEtc config.csh/vtk mesa_version "$optionValue"
|
||||||
|
adjusted=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
|
-vtk)
|
||||||
|
# Replace vtk_version=...
|
||||||
|
optionValue=$(getOptionValue "$@")
|
||||||
|
replaceEtc config.sh/vtk vtk_version "$optionValue"
|
||||||
|
replaceEtc config.csh/vtk vtk_version "$optionValue"
|
||||||
|
adjusted=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
|
-llvm-path)
|
||||||
|
# Replace LLVM_ARCH_PATH=...
|
||||||
|
optionValue=$(getOptionValue "$@")
|
||||||
|
replaceEtc config.sh/vtk LLVM_ARCH_PATH \""$optionValue\""
|
||||||
|
replaceEtcCsh config.csh/vtk LLVM_ARCH_PATH \""$optionValue\""
|
||||||
|
adjusted=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
|
-mesa-path)
|
||||||
|
# Replace MESA_ARCH_PATH...
|
||||||
|
optionValue=$(getOptionValue "$@")
|
||||||
|
replaceEtc config.sh/vtk MESA_ARCH_PATH \""$optionValue\""
|
||||||
|
replaceEtcCsh config.csh/vtk MESA_ARCH_PATH \""$optionValue\""
|
||||||
|
adjusted=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
|
-vtk-path)
|
||||||
|
# Replace VTK_DIR...
|
||||||
|
optionValue=$(getOptionValue "$@")
|
||||||
|
replaceEtc config.sh/vtk VTK_DIR \""$optionValue\""
|
||||||
|
replaceEtcCsh config.csh/vtk VTK_DIR \""$optionValue\""
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|||||||
@ -1,193 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
# ========= |
|
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
# \\ / O peration |
|
|
||||||
# \\ / A nd | www.openfoam.com
|
|
||||||
# \\/ M anipulation |
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
# Copyright (C) 2019 OpenCFD Ltd.
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
# License
|
|
||||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
|
||||||
# <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
# Script
|
|
||||||
# openfoam [args]
|
|
||||||
#
|
|
||||||
# Description
|
|
||||||
# Open an interactive bash session with an OpenFOAM environment,
|
|
||||||
# or run an OpenFOAM application (with arguments) after first sourcing
|
|
||||||
# the OpenFOAM etc/bashrc file from the project directory.
|
|
||||||
#
|
|
||||||
# This script normally exists in $WM_PROJECT_DIR/bin/tools but can also
|
|
||||||
# be modified to use a hard-coded PROJECT_DIR entry and placed elsewhere
|
|
||||||
# in the filesystem (eg, /usr/bin).
|
|
||||||
#
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
# Hard-coded value (eg, with autoconfig)
|
|
||||||
projectDir="@PROJECT_DIR@"
|
|
||||||
|
|
||||||
if [ -z "$projectDir" ] || [ "${projectDir#@}" != "$projectDir" ]
|
|
||||||
then
|
|
||||||
# Auto-detect from location
|
|
||||||
toolsDir="${0%/*}" # The bin/tools dir
|
|
||||||
projectDir="${toolsDir%/bin/tools}" # Project dir
|
|
||||||
|
|
||||||
case "$projectDir" in
|
|
||||||
(/bin | /usr/bin | /usr/local/bin)
|
|
||||||
# This shouldn't happen.
|
|
||||||
# If copied to a system dir, should also be using hard-coded values!
|
|
||||||
echo "Warning: suspicious looking project dir: $projectDir" 1>&2
|
|
||||||
;;
|
|
||||||
|
|
||||||
("$toolsDir")
|
|
||||||
# Eg, called as ./openfoam etc - need to try harder
|
|
||||||
projectDir="$(\cd $(dirname $0)/../.. && \pwd -L)" || unset projectDir
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
usage() {
|
|
||||||
exec 1>&2
|
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
cat<<USAGE
|
|
||||||
|
|
||||||
Usage: ${0##*/} [OPTION] [application ...]
|
|
||||||
|
|
||||||
options:
|
|
||||||
-prefix=DIR Specify alternative OpenFOAM directory
|
|
||||||
-sp Single precision
|
|
||||||
-dp Double precision
|
|
||||||
-spdp Mixed single/double precision
|
|
||||||
-int32 | -int64 The label-size
|
|
||||||
-help Print the usage
|
|
||||||
|
|
||||||
Open an interactive bash session with an OpenFOAM environment,
|
|
||||||
or run an OpenFOAM application (with arguments) after first sourcing
|
|
||||||
the OpenFOAM etc/bashrc file from the project directory:
|
|
||||||
($projectDir)
|
|
||||||
|
|
||||||
For more information: www.OpenFOAM.com
|
|
||||||
|
|
||||||
USAGE
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# Only preserve settings for non-interactive?
|
|
||||||
|
|
||||||
if [ "$#" -eq 0 ]
|
|
||||||
then
|
|
||||||
unset _foamSettings FOAM_SETTINGS
|
|
||||||
else
|
|
||||||
_foamSettings="$FOAM_SETTINGS"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Parse options
|
|
||||||
while [ "$#" -gt 0 ]
|
|
||||||
do
|
|
||||||
case "$1" in
|
|
||||||
-h | -help*)
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
-prefix=* | -foam=*)
|
|
||||||
projectDir="${1#*=}"
|
|
||||||
;;
|
|
||||||
|
|
||||||
-sp | -SP)
|
|
||||||
# WM_PRECISION_OPTION=...
|
|
||||||
_foamSettings="$_foamSettings${_foamSettings:+ }WM_PRECISION_OPTION=SP"
|
|
||||||
;;
|
|
||||||
|
|
||||||
-dp | -DP)
|
|
||||||
# WM_PRECISION_OPTION=...
|
|
||||||
_foamSettings="$_foamSettings${_foamSettings:+ }WM_PRECISION_OPTION=DP"
|
|
||||||
;;
|
|
||||||
|
|
||||||
-spdp | -SPDP)
|
|
||||||
# WM_PRECISION_OPTION=...
|
|
||||||
_foamSettings="$_foamSettings${_foamSettings:+ }WM_PRECISION_OPTION=SPDP"
|
|
||||||
;;
|
|
||||||
|
|
||||||
-int32 | -int64)
|
|
||||||
# WM_LABEL_SIZE=...
|
|
||||||
_foamSettings="$_foamSettings${_foamSettings:+ }WM_LABEL_SIZE=${1#-int}"
|
|
||||||
;;
|
|
||||||
|
|
||||||
--)
|
|
||||||
shift
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
-*)
|
|
||||||
echo "Error: unknown option: '$1'" 1>&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# Remove current OpenFOAM environment
|
|
||||||
if [ -d "$WM_PROJECT_DIR" ] && [ -f "$WM_PROJECT_DIR/etc/config.sh/unset" ]
|
|
||||||
then
|
|
||||||
. "$WM_PROJECT_DIR/etc/config.sh/unset"
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ -d "$projectDir" ] || {
|
|
||||||
echo "Error: no project dir: $projectDir" 1>&2
|
|
||||||
exit 2
|
|
||||||
}
|
|
||||||
|
|
||||||
_foamSourceBashEnv="$projectDir/etc/bashrc"
|
|
||||||
|
|
||||||
if [ "$#" -eq 0 ]
|
|
||||||
then
|
|
||||||
# Interactive shell
|
|
||||||
_foamSourceBashEnv="$projectDir/bin/tools/source-bashrc"
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ -f "$_foamSourceBashEnv" ] || {
|
|
||||||
echo "Error: file not found: $_foamSourceBashEnv" 1>&2
|
|
||||||
exit 2
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "$#" -eq 0 ]
|
|
||||||
then
|
|
||||||
# Source user ~/.bashrc and OpenFOAM etc/bashrc.
|
|
||||||
# 1) Can either use a tmp file, or 2) chain off to a dedicated file
|
|
||||||
# We use a dedicated file.
|
|
||||||
|
|
||||||
if [ -n "$_foamSettings" ]
|
|
||||||
then
|
|
||||||
export FOAM_SETTINGS="$_foamSettings"
|
|
||||||
fi
|
|
||||||
|
|
||||||
## echo "Source with $_foamSourceBashEnv with '$FOAM_SETTINGS'" 1>&2
|
|
||||||
|
|
||||||
# Interactive shell (newer bash can use --init-file instead of --rcfile)
|
|
||||||
exec bash --rcfile "$_foamSourceBashEnv" -i
|
|
||||||
|
|
||||||
else
|
|
||||||
# Non-interactive
|
|
||||||
|
|
||||||
# Source bashrc within a function to preserve command-line arguments
|
|
||||||
# - this will not have aliases, but working non-interactively anyhow
|
|
||||||
sourceBashrc()
|
|
||||||
{
|
|
||||||
. "$_foamSourceBashEnv" $_foamSettings
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceBashrc
|
|
||||||
exec "$@"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
19
bin/tools/openfoam.in
Normal file
19
bin/tools/openfoam.in
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
exec "@PROJECT_DIR@"/etc/openfoam "$@"
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# ========= |
|
||||||
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
# \\ / O peration |
|
||||||
|
# \\ / A nd | www.openfoam.com
|
||||||
|
# \\/ M anipulation |
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Copyright (C) 2020 OpenCFD Ltd.
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# License
|
||||||
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Forwarding to OpenFOAM etc/openfoam bash session script.
|
||||||
|
# Uses a hard-code directory path (eg, generated with autoconfig).
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
1
doc/modules/README
Normal file
1
doc/modules/README
Normal file
@ -0,0 +1 @@
|
|||||||
|
Modules-related documents when collated for an installation package.
|
||||||
70
doc/openfoam.1.in
Normal file
70
doc/openfoam.1.in
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
.TH "OPENFOAM" 1 "OpenFOAM-version" "www.openfoam.com" "OpenFOAM Commands Manual"
|
||||||
|
|
||||||
|
.SH NAME
|
||||||
|
openfoam \- OpenFOAM bash(1) session
|
||||||
|
|
||||||
|
.SH SYNOPSIS
|
||||||
|
\fBopenfoam\fR [\fIOPTIONS\fR] [\fIapplication ...\fR]
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
Activate an \fBOpenFOAM\fR environment in an interactive or
|
||||||
|
non-interactive bash(1) session.
|
||||||
|
|
||||||
|
If no application is given, an interactive bash session will be used.
|
||||||
|
If an application (optionally with arguments) is provided, the
|
||||||
|
OpenFOAM \fIetc/bashrc\fR file will be sourced from the project directory
|
||||||
|
prior to running the application.
|
||||||
|
|
||||||
|
.SH OPTIONS
|
||||||
|
.TP
|
||||||
|
\fB\-c\fR \fIcommand\fR
|
||||||
|
Execute shell commands with OpenFOAM environment
|
||||||
|
.TP
|
||||||
|
\fB\-D\fR\fIkey=[value]\fR
|
||||||
|
Define key/value to pass as a preference
|
||||||
|
.TP
|
||||||
|
\fB\-sp\fR
|
||||||
|
Use single precision for scalar-size
|
||||||
|
.TP
|
||||||
|
\fB\-dp\fR
|
||||||
|
Use double precision for scalar-size
|
||||||
|
.TP
|
||||||
|
\fB\-spdp\fR
|
||||||
|
Use single precision for scalar-size, double for solve-scalar size
|
||||||
|
.TP
|
||||||
|
\fB\-int32\fR
|
||||||
|
Use 32-bit label-size
|
||||||
|
.TP
|
||||||
|
\fB\-int64\fR
|
||||||
|
Use 64-bit label-size
|
||||||
|
.TP
|
||||||
|
\fB\-prefix=DIR\fR
|
||||||
|
Specify alternative OpenFOAM project directory
|
||||||
|
.TP
|
||||||
|
\fB\-show-api\fR | \fB\-version\fR
|
||||||
|
Print META-INFO api value and exit
|
||||||
|
.TP
|
||||||
|
\fB\-show-patch\fR
|
||||||
|
Print META-INFO patch value and exit
|
||||||
|
.TP
|
||||||
|
\fB\-show-prefix\fR
|
||||||
|
Print project directory and exit
|
||||||
|
.TP
|
||||||
|
\fB\-help\fR
|
||||||
|
Print the usage
|
||||||
|
|
||||||
|
.SH ARGUMENTS
|
||||||
|
|
||||||
|
If arguments remain after option processing, the first argument is
|
||||||
|
assumed to be an application with options and arguments.
|
||||||
|
|
||||||
|
.SH FILES
|
||||||
|
|
||||||
|
The \fIetc/bashrc\fR file from the OpenFOAM project directory supplies
|
||||||
|
the environment settings.
|
||||||
|
|
||||||
|
.SH "SEE ALSO"
|
||||||
|
Online documentation https://www.openfoam.com/documentation/
|
||||||
|
|
||||||
|
.SH COPYRIGHT
|
||||||
|
Copyright \(co 2020 OpenCFD Ltd.
|
||||||
@ -6,11 +6,10 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2016 OpenFOAM Foundation
|
# Copyright (C) 2016 OpenFOAM Foundation
|
||||||
# Copyright (C) 2016-2018 OpenCFD Ltd.
|
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
# <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
#
|
||||||
# File
|
# File
|
||||||
# etc/config.csh/compiler
|
# etc/config.csh/compiler
|
||||||
@ -24,14 +23,19 @@
|
|||||||
|
|
||||||
switch ("$WM_COMPILER_TYPE")
|
switch ("$WM_COMPILER_TYPE")
|
||||||
case ThirdParty:
|
case ThirdParty:
|
||||||
# Default versions of GMP, MPFR, MPC - override as necessary
|
# Default versions (CLANG, GCC, GMP, MPFR, MPC) - override as necessary
|
||||||
|
|
||||||
set gmp_version=gmp-system
|
set default_clang_version=llvm-3.7.1
|
||||||
set mpfr_version=mpfr-system
|
set default_gcc_version=gcc-4.8.5
|
||||||
set mpc_version=mpc-system
|
|
||||||
|
set default_gmp_version=gmp-system
|
||||||
|
set default_mpfr_version=mpfr-system
|
||||||
|
set default_mpc_version=mpc-system
|
||||||
|
|
||||||
switch ("$WM_COMPILER")
|
switch ("$WM_COMPILER")
|
||||||
case Gcc:
|
case Gcc:
|
||||||
|
set gcc_version="$default_gcc_version"
|
||||||
|
breaksw
|
||||||
case Gcc48*:
|
case Gcc48*:
|
||||||
set gcc_version=gcc-4.8.5
|
set gcc_version=gcc-4.8.5
|
||||||
breaksw
|
breaksw
|
||||||
@ -86,7 +90,19 @@ case ThirdParty:
|
|||||||
case Gcc82*:
|
case Gcc82*:
|
||||||
set gcc_version=gcc-8.2.0
|
set gcc_version=gcc-8.2.0
|
||||||
breaksw
|
breaksw
|
||||||
|
case Gcc83*:
|
||||||
|
set gcc_version=gcc-8.3.0
|
||||||
|
breaksw
|
||||||
|
case Gcc91*:
|
||||||
|
set gcc_version=gcc-9.1.0
|
||||||
|
breaksw
|
||||||
|
case Gcc92*:
|
||||||
|
set gcc_version=gcc-9.2.0
|
||||||
|
breaksw
|
||||||
|
|
||||||
case Clang:
|
case Clang:
|
||||||
|
set clang_version="$default_clang_version"
|
||||||
|
breaksw
|
||||||
case Clang37*:
|
case Clang37*:
|
||||||
set clang_version=llvm-3.7.1
|
set clang_version=llvm-3.7.1
|
||||||
breaksw
|
breaksw
|
||||||
@ -108,6 +124,13 @@ case ThirdParty:
|
|||||||
case Clang70*:
|
case Clang70*:
|
||||||
set clang_version=llvm-7.0.1
|
set clang_version=llvm-7.0.1
|
||||||
breaksw
|
breaksw
|
||||||
|
case Clang80*:
|
||||||
|
set clang_version=llvm-8.0.1
|
||||||
|
breaksw
|
||||||
|
case Clang90*:
|
||||||
|
set clang_version=llvm-9.0.0
|
||||||
|
breaksw
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/bin/cat << UNKNOWN_COMPILER
|
/bin/cat << UNKNOWN_COMPILER
|
||||||
===============================================================================
|
===============================================================================
|
||||||
@ -125,4 +148,7 @@ UNKNOWN_COMPILER
|
|||||||
breaksw
|
breaksw
|
||||||
endsw
|
endsw
|
||||||
|
|
||||||
|
unset default_gcc_version default_clang_version
|
||||||
|
unset default_gmp_version default_mpfr_version default_mpc_version
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -9,15 +9,17 @@
|
|||||||
# Copyright (C) 2017 OpenCFD Ltd.
|
# Copyright (C) 2017 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
# <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
#
|
||||||
# File
|
# File
|
||||||
# config.csh/example/compiler
|
# config.csh/example/compiler
|
||||||
# - sourced by OpenFOAM-*/etc/config.csh/settings
|
# - sourced by OpenFOAM-*/etc/config.csh/settings
|
||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Example of fine tuning ThirdParty compiler settings for OpenFOAM
|
# Older example of fine tuning compiler settings for OpenFOAM
|
||||||
|
#
|
||||||
|
# The preferred mechanism is now with a "compiler-$WM_COMPILER" file
|
||||||
|
# in one of the etc/ directories.
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -26,7 +28,7 @@ eval `$WM_PROJECT_DIR/bin/foamEtcFile -csh -config -mode=o compiler`
|
|||||||
|
|
||||||
# Modify/override compiler settings
|
# Modify/override compiler settings
|
||||||
switch ("$WM_COMPILER")
|
switch ("$WM_COMPILER")
|
||||||
case Gcc70:
|
case Gcc70*:
|
||||||
set gcc_version=gcc-7.0.0
|
set gcc_version=gcc-7.0.0
|
||||||
set gmp_version=gmp-6.1.2
|
set gmp_version=gmp-6.1.2
|
||||||
set mpfr_version=mpfr-3.1.5
|
set mpfr_version=mpfr-3.1.5
|
||||||
|
|||||||
28
etc/config.csh/example/compiler-Gcc92
Normal file
28
etc/config.csh/example/compiler-Gcc92
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#----------------------------------*-sh-*--------------------------------------
|
||||||
|
# ========= |
|
||||||
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
# \\ / O peration |
|
||||||
|
# \\ / A nd | www.openfoam.com
|
||||||
|
# \\/ M anipulation |
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Copyright (C) 2020 OpenCFD Ltd.
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# License
|
||||||
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
|
#
|
||||||
|
# File
|
||||||
|
# config.csh/example/compiler-Gcc92
|
||||||
|
# - sourced by OpenFOAM-*/etc/config.csh/compiler
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Example of fine tuning compiler settings with a hook
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Modify/override compiler settings
|
||||||
|
set gcc_version=gcc-9.2.0
|
||||||
|
set gmp_version=gmp-6.2.0
|
||||||
|
set mpfr_version=mpfr-4.0.2
|
||||||
|
set mpc_version=mpc-1.1.0
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
@ -6,11 +6,10 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# Copyright (C) 2016-2018 OpenCFD Ltd.
|
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
# <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
#
|
||||||
# File
|
# File
|
||||||
# etc/config.sh/compiler
|
# etc/config.sh/compiler
|
||||||
@ -24,90 +23,56 @@
|
|||||||
|
|
||||||
case "$WM_COMPILER_TYPE" in
|
case "$WM_COMPILER_TYPE" in
|
||||||
ThirdParty)
|
ThirdParty)
|
||||||
# Default versions of GMP, MPFR, MPC - override as necessary
|
# Default versions (CLANG, GCC, GMP, MPFR, MPC) - override as necessary
|
||||||
gmp_version=gmp-system
|
|
||||||
mpfr_version=mpfr-system
|
default_clang_version=llvm-3.7.1
|
||||||
mpc_version=mpc-system
|
default_gcc_version=gcc-4.8.5
|
||||||
|
|
||||||
|
default_gmp_version=gmp-system
|
||||||
|
default_mpfr_version=mpfr-system
|
||||||
|
default_mpc_version=mpc-system
|
||||||
|
|
||||||
|
gmp_version="$default_gmp_version"
|
||||||
|
mpfr_version="$default_mpfr_version"
|
||||||
|
mpc_version="$default_mpc_version"
|
||||||
|
|
||||||
case "$WM_COMPILER" in
|
case "$WM_COMPILER" in
|
||||||
Gcc | Gcc48*)
|
Gcc) gcc_version="$default_gcc_version" ;;
|
||||||
gcc_version=gcc-4.8.5
|
Gcc48*) gcc_version=gcc-4.8.5 ;;
|
||||||
;;
|
Gcc49*) gcc_version=gcc-4.9.4 ;;
|
||||||
Gcc49*)
|
Gcc51*) gcc_version=gcc-5.1.0 ;;
|
||||||
gcc_version=gcc-4.9.4
|
Gcc52*) gcc_version=gcc-5.2.0 ;;
|
||||||
;;
|
Gcc53*) gcc_version=gcc-5.3.0 ;;
|
||||||
Gcc51*)
|
Gcc54*) gcc_version=gcc-5.4.0 ;;
|
||||||
gcc_version=gcc-5.1.0
|
Gcc55*) gcc_version=gcc-5.5.0 ;;
|
||||||
;;
|
Gcc61*) gcc_version=gcc-6.1.0 ;;
|
||||||
Gcc52*)
|
Gcc62*) gcc_version=gcc-6.2.0 ;;
|
||||||
gcc_version=gcc-5.2.0
|
Gcc63*) gcc_version=gcc-6.3.0 ;;
|
||||||
;;
|
Gcc64*) gcc_version=gcc-6.4.0 ;;
|
||||||
Gcc53*)
|
Gcc65*) gcc_version=gcc-6.5.0 ;;
|
||||||
gcc_version=gcc-5.3.0
|
Gcc71*) gcc_version=gcc-7.1.0 ;;
|
||||||
;;
|
Gcc72*) gcc_version=gcc-7.2.0 ;;
|
||||||
Gcc54*)
|
Gcc73*) gcc_version=gcc-7.3.0 ;;
|
||||||
gcc_version=gcc-5.4.0
|
Gcc74*) gcc_version=gcc-7.4.0 ;;
|
||||||
;;
|
Gcc75*) gcc_version=gcc-7.5.0 ;;
|
||||||
Gcc55*)
|
Gcc81*) gcc_version=gcc-8.1.0 ;;
|
||||||
gcc_version=gcc-5.5.0
|
Gcc82*) gcc_version=gcc-8.2.0 ;;
|
||||||
;;
|
Gcc83*) gcc_version=gcc-8.3.0 ;;
|
||||||
Gcc61*)
|
Gcc91*) gcc_version=gcc-9.1.0 ;;
|
||||||
gcc_version=gcc-6.1.0
|
Gcc92*) gcc_version=gcc-9.2.0 ;;
|
||||||
;;
|
|
||||||
Gcc62*)
|
Clang) clang_version="$default_clang_version" ;;
|
||||||
gcc_version=gcc-6.2.0
|
Clang37*) clang_version=llvm-3.7.1 ;;
|
||||||
;;
|
Clang38*) clang_version=llvm-3.8.1 ;;
|
||||||
Gcc63*)
|
Clang39*) clang_version=llvm-3.9.1 ;;
|
||||||
gcc_version=gcc-6.3.0
|
Clang40*) clang_version=llvm-4.0.1 ;;
|
||||||
;;
|
Clang50*) clang_version=llvm-5.0.2 ;;
|
||||||
Gcc64*)
|
Clang60*) clang_version=llvm-6.0.1 ;;
|
||||||
gcc_version=gcc-6.4.0
|
Clang70*) clang_version=llvm-7.0.1 ;;
|
||||||
;;
|
Clang71*) clang_version=llvm-7.1.0 ;;
|
||||||
Gcc65*)
|
Clang80*) clang_version=llvm-8.0.1 ;;
|
||||||
gcc_version=gcc-6.5.0
|
Clang90*) clang_version=llvm-9.0.0 ;;
|
||||||
;;
|
|
||||||
Gcc71*)
|
|
||||||
gcc_version=gcc-7.1.0
|
|
||||||
;;
|
|
||||||
Gcc72*)
|
|
||||||
gcc_version=gcc-7.2.0
|
|
||||||
;;
|
|
||||||
Gcc73*)
|
|
||||||
gcc_version=gcc-7.3.0
|
|
||||||
;;
|
|
||||||
Gcc74*)
|
|
||||||
gcc_version=gcc-7.4.0
|
|
||||||
;;
|
|
||||||
Gcc81*)
|
|
||||||
gcc_version=gcc-8.1.0
|
|
||||||
;;
|
|
||||||
Gcc82*)
|
|
||||||
gcc_version=gcc-8.2.0
|
|
||||||
;;
|
|
||||||
Clang | Clang37*)
|
|
||||||
clang_version=llvm-3.7.1
|
|
||||||
;;
|
|
||||||
Clang38*)
|
|
||||||
clang_version=llvm-3.8.1
|
|
||||||
;;
|
|
||||||
Clang39*)
|
|
||||||
clang_version=llvm-3.9.1
|
|
||||||
;;
|
|
||||||
Clang40*)
|
|
||||||
clang_version=llvm-4.0.1
|
|
||||||
;;
|
|
||||||
Clang50*)
|
|
||||||
clang_version=llvm-5.0.2
|
|
||||||
;;
|
|
||||||
Clang60*)
|
|
||||||
clang_version=llvm-6.0.1
|
|
||||||
;;
|
|
||||||
Clang70*)
|
|
||||||
clang_version=llvm-7.0.1
|
|
||||||
;;
|
|
||||||
Clang80*)
|
|
||||||
clang_version=llvm-8.0.0
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
/bin/cat << UNKNOWN_COMPILER 1>&2
|
/bin/cat << UNKNOWN_COMPILER 1>&2
|
||||||
===============================================================================
|
===============================================================================
|
||||||
@ -125,4 +90,7 @@ UNKNOWN_COMPILER
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
unset default_gcc_version default_clang_version
|
||||||
|
unset default_gmp_version default_mpfr_version default_mpc_version
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -9,15 +9,17 @@
|
|||||||
# Copyright (C) 2017 OpenCFD Ltd.
|
# Copyright (C) 2017 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
# <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
#
|
||||||
# File
|
# File
|
||||||
# config.sh/example/compiler
|
# config.sh/example/compiler
|
||||||
# - sourced by OpenFOAM-*/etc/config.sh/settings
|
# - sourced by OpenFOAM-*/etc/config.sh/settings
|
||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Example of fine tuning compiler versions and settings for OpenFOAM
|
# Older example of fine tuning compiler settings for OpenFOAM.
|
||||||
|
#
|
||||||
|
# The preferred mechanism is now with a "compiler-$WM_COMPILER" file
|
||||||
|
# in one of the etc/ directories.
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -26,18 +28,12 @@ eval $($WM_PROJECT_DIR/bin/foamEtcFile -sh -config -mode=o compiler)
|
|||||||
|
|
||||||
# Modify/override compiler settings
|
# Modify/override compiler settings
|
||||||
case "$WM_COMPILER" in
|
case "$WM_COMPILER" in
|
||||||
Gcc70)
|
Gcc70*)
|
||||||
gcc_version=gcc-7.0.0
|
gcc_version=gcc-7.0.0
|
||||||
gmp_version=gmp-6.1.2
|
gmp_version=gmp-6.1.2
|
||||||
mpfr_version=mpfr-3.1.5
|
mpfr_version=mpfr-3.1.5
|
||||||
mpc_version=mpc-1.0.3
|
mpc_version=mpc-1.0.3
|
||||||
;;
|
;;
|
||||||
Gcc48u)
|
|
||||||
# Example of using the system GCC 4.8 in Ubuntu 15.10. Keep in mind you
|
|
||||||
# will also need to create the respective directory in "wmake/rules"
|
|
||||||
export CC='gcc-4.8'
|
|
||||||
export CXX='g++-4.8'
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
28
etc/config.sh/example/compiler-Gcc92
Normal file
28
etc/config.sh/example/compiler-Gcc92
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#----------------------------------*-sh-*--------------------------------------
|
||||||
|
# ========= |
|
||||||
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
# \\ / O peration |
|
||||||
|
# \\ / A nd | www.openfoam.com
|
||||||
|
# \\/ M anipulation |
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Copyright (C) 2020 OpenCFD Ltd.
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# License
|
||||||
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
|
#
|
||||||
|
# File
|
||||||
|
# config.sh/example/compiler-Gcc92
|
||||||
|
# - sourced by OpenFOAM-*/etc/config.sh/compiler
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Example of fine tuning compiler settings with a hook
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Modify/override compiler settings
|
||||||
|
gcc_version=gcc-9.2.0
|
||||||
|
gmp_version=gmp-6.2.0
|
||||||
|
mpfr_version=mpfr-4.0.2
|
||||||
|
mpc_version=mpc-1.1.0
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
@ -9,12 +9,11 @@
|
|||||||
# Copyright (C) 2016-2018 OpenCFD Ltd.
|
# Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
# <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
#
|
||||||
# File
|
# File
|
||||||
# etc/config.sh/gperftools
|
# etc/config.sh/gperftools
|
||||||
# - sourced by OpenFOAM-*/etc/bashrc
|
# Not normally sourced by OpenFOAM-*/etc/bashrc
|
||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Setup file for GPERFTOOLS binaries/libraries.
|
# Setup file for GPERFTOOLS binaries/libraries.
|
||||||
@ -48,7 +47,7 @@ then
|
|||||||
echo "Using gperftools ($gperftools_version) -> $GPERFTOOLS_ARCH_PATH" 1>&2
|
echo "Using gperftools ($gperftools_version) -> $GPERFTOOLS_ARCH_PATH" 1>&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v _foamAddLib > /dev/null 2>&1 # Normal sourcing
|
if command -v _foamAddLib >/dev/null # Normal sourcing
|
||||||
then
|
then
|
||||||
|
|
||||||
# If GPERFTOOLS_ARCH_PATH does not end with '-system' or '-none',
|
# If GPERFTOOLS_ARCH_PATH does not end with '-system' or '-none',
|
||||||
|
|||||||
@ -121,7 +121,6 @@ _foamEtc -config settings
|
|||||||
_foamEtc -config mpi
|
_foamEtc -config mpi
|
||||||
_foamEtc -config paraview -- "$@" # Pass through for evaluation
|
_foamEtc -config paraview -- "$@" # Pass through for evaluation
|
||||||
_foamEtc -config vtk
|
_foamEtc -config vtk
|
||||||
_foamEtc -config gperftools
|
|
||||||
## _foamEtc -config ADIOS
|
## _foamEtc -config ADIOS
|
||||||
## _foamEtc -config ADIOS2
|
## _foamEtc -config ADIOS2
|
||||||
_foamEtc -config CGAL
|
_foamEtc -config CGAL
|
||||||
|
|||||||
301
etc/openfoam
Executable file
301
etc/openfoam
Executable file
@ -0,0 +1,301 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# ========= |
|
||||||
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
# \\ / O peration |
|
||||||
|
# \\ / A nd | www.openfoam.com
|
||||||
|
# \\/ M anipulation |
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# License
|
||||||
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
|
#
|
||||||
|
# Script
|
||||||
|
# openfoam [options] [args]
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Open an interactive bash session with an OpenFOAM environment,
|
||||||
|
# or run an OpenFOAM application (with arguments) after first sourcing
|
||||||
|
# the OpenFOAM etc/bashrc file from the project directory.
|
||||||
|
#
|
||||||
|
# Note
|
||||||
|
# This script normally exists in the $WM_PROJECT_DIR/etc/ directory.
|
||||||
|
# Do not copy/move/link to other locations. Use instead an edited copy of
|
||||||
|
# `bin/tools/openfoam.in` with a hard-coded projectDir entry.
|
||||||
|
#
|
||||||
|
# See OpenFOAM etc/bashrc for (command-line) preferences.
|
||||||
|
# Some equivalent settings:
|
||||||
|
# -sp | -DWM_PRECISION_OPTION=SP
|
||||||
|
# -dp | -DWM_PRECISION_OPTION=DP
|
||||||
|
# -int32 | -DWM_LABEL_SIZE=32
|
||||||
|
# -int64 | -DWM_LABEL_SIZE=64
|
||||||
|
#
|
||||||
|
# However, the '-D' options grant more flexibility. For example,
|
||||||
|
# etc/openfoam -DWM_COMPILER=Clang
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Auto-detect from location. Do not call from within the etc/directory itself!
|
||||||
|
projectDir="$(\cd "$(dirname "${0%/*}")" && \pwd -L)"
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
printHelp() {
|
||||||
|
cat<<USAGE
|
||||||
|
|
||||||
|
Usage: ${0##*/} [OPTION] [application ...]
|
||||||
|
|
||||||
|
options:
|
||||||
|
-c command Execute shell commands with OpenFOAM environment
|
||||||
|
-Dkey[=value] Define key/value to pass as a preference
|
||||||
|
-sp Single precision
|
||||||
|
-dp Double precision
|
||||||
|
-spdp Mixed single/double precision
|
||||||
|
-int32 | -int64 The label-size
|
||||||
|
-etc=DIR Additional project etc/ directory
|
||||||
|
-prefix=DIR Alternative OpenFOAM project directory
|
||||||
|
-show-api | -version Print META-INFO api value and exit
|
||||||
|
-show-patch Print META-INFO patch value and exit
|
||||||
|
-show-prefix Print project directory and exit
|
||||||
|
-test-tutorial Forward arguments to tutorials/AutoTest
|
||||||
|
-verbose Set FOAM_VERBOSE=true (interactive only)
|
||||||
|
-help Print the usage
|
||||||
|
|
||||||
|
Open an interactive bash session with an OpenFOAM environment,
|
||||||
|
or run an OpenFOAM application (with arguments) after first sourcing
|
||||||
|
the OpenFOAM etc/bashrc file from the project directory:
|
||||||
|
($projectDir)
|
||||||
|
|
||||||
|
For more information: www.openfoam.com
|
||||||
|
|
||||||
|
USAGE
|
||||||
|
exit 0 # A clean exit
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Get a value from META-INFO/api-info
|
||||||
|
# $1 : keyword
|
||||||
|
getApiInfo()
|
||||||
|
{
|
||||||
|
value="$(sed -ne 's@^'"$1"' *= *\([0-9][0-9]*\).*@\1@p' "$projectDir"/META-INFO/api-info 2>/dev/null)"
|
||||||
|
|
||||||
|
if [ -n "$value" ]
|
||||||
|
then
|
||||||
|
echo "$value"
|
||||||
|
else
|
||||||
|
echo "Could not determine OPENFOAM '$1' value" 1>&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# No inheritance of FOAM_SETTINGS
|
||||||
|
unset FOAM_SETTINGS
|
||||||
|
unset _foamEtcDir _foamSettings _foamScriptCommand
|
||||||
|
unset optTestTut
|
||||||
|
|
||||||
|
# Parse options
|
||||||
|
while [ "$#" -gt 0 ]
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
-h | -help* | --help*)
|
||||||
|
printHelp
|
||||||
|
;;
|
||||||
|
-show-api | -version | --version) # Show API and exit
|
||||||
|
getApiInfo api
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
-show-patch) # Show patch level and exit
|
||||||
|
getApiInfo patch
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
-show-prefix) # Show project directory and exit
|
||||||
|
echo "$projectDir"
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
|
||||||
|
-test-tutorial) # Run tutorials/AutoTest
|
||||||
|
optTestTut=true
|
||||||
|
;;
|
||||||
|
|
||||||
|
-c) # Shell command
|
||||||
|
_foamScriptCommand="$2"
|
||||||
|
[ -n "$_foamScriptCommand" ] || {
|
||||||
|
echo "$0: missing or bad command argument: $2" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
shift 2
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
|
||||||
|
-D*) # Define key/value to pass as preference
|
||||||
|
setting="${1#-D}"
|
||||||
|
if [ -n "$setting" ]
|
||||||
|
then
|
||||||
|
_foamSettings="$_foamSettings${_foamSettings:+ }$setting"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
-sp | -dp | -spdp )
|
||||||
|
# WM_PRECISION_OPTION=(SP|DP|SPDP)
|
||||||
|
setting=$(echo "${1#-}" | sed -e 's/-//g;y/sdp/SDP/')
|
||||||
|
_foamSettings="$_foamSettings${_foamSettings:+ }WM_PRECISION_OPTION=$setting"
|
||||||
|
;;
|
||||||
|
|
||||||
|
-int32 | -int64)
|
||||||
|
# WM_LABEL_SIZE=...
|
||||||
|
_foamSettings="$_foamSettings${_foamSettings:+ }WM_LABEL_SIZE=${1#-int}"
|
||||||
|
;;
|
||||||
|
|
||||||
|
-etc=*)
|
||||||
|
# Define FOAM_CONFIG_ETC for finding files
|
||||||
|
_foamEtcDir="${1#*=}"
|
||||||
|
;;
|
||||||
|
|
||||||
|
-prefix=*)
|
||||||
|
projectDir="${1#*=}"
|
||||||
|
;;
|
||||||
|
|
||||||
|
-verbose)
|
||||||
|
export FOAM_VERBOSE=true
|
||||||
|
;;
|
||||||
|
|
||||||
|
--)
|
||||||
|
shift
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
-*)
|
||||||
|
echo "$0: unknown option: '$1'" 1>&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Sanity check (installed under /bin, /usr/bin, /usr/local/bin)
|
||||||
|
# This should not happen.
|
||||||
|
# If copied to a system dir, should also be using hard-coded values!
|
||||||
|
|
||||||
|
if [ "${projectDir%/bin}" != "$projectDir" ]
|
||||||
|
then
|
||||||
|
echo "Warning: suspicious project dir: $projectDir" 1>&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ -d "$projectDir/META-INFO" ] || {
|
||||||
|
echo "Warning: missing META-INFO in OpenFOAM directory:" 1>&2
|
||||||
|
echo " $projectDir" 1>&2
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Remove current OpenFOAM environment
|
||||||
|
if [ -d "$WM_PROJECT_DIR" ] && [ -f "$WM_PROJECT_DIR/etc/config.sh/unset" ]
|
||||||
|
then
|
||||||
|
. "$WM_PROJECT_DIR/etc/config.sh/unset" || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset interactive
|
||||||
|
|
||||||
|
if [ "$#" -eq 0 ] && [ -z "$_foamScriptCommand" ] && [ -z "$optTestTut" ]
|
||||||
|
then
|
||||||
|
# Interactive shell, chain off via a file
|
||||||
|
interactive=true
|
||||||
|
_foamSourceBashEnv="$projectDir/bin/tools/source-bashrc"
|
||||||
|
else
|
||||||
|
# Non-interactive shell, use the OPENFOAM etc/bashrc
|
||||||
|
_foamSourceBashEnv="$projectDir/etc/bashrc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ -f "$_foamSourceBashEnv" ] || {
|
||||||
|
echo "Error: file not found: $_foamSourceBashEnv" 1>&2
|
||||||
|
exit 2
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -n "$_foamEtcDir" ] && [ -d "$_foamEtcDir" ]
|
||||||
|
then
|
||||||
|
# Additional etc directory
|
||||||
|
export FOAM_CONFIG_ETC="$_foamEtcDir"
|
||||||
|
else
|
||||||
|
unset FOAM_CONFIG_ETC
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$interactive" ]
|
||||||
|
then
|
||||||
|
# Interactive shell
|
||||||
|
# -----------------
|
||||||
|
|
||||||
|
# Source ~/.bashrc and OpenFOAM etc/bashrc in one of two ways:
|
||||||
|
# 1) Generate and use a tmp file
|
||||||
|
# 2) Chain off to a dedicated file [This is what we use]
|
||||||
|
|
||||||
|
if [ -n "$_foamSettings" ]
|
||||||
|
then
|
||||||
|
# Pass preferences via the FOAM_SETTINGS mechanism
|
||||||
|
export FOAM_SETTINGS="$_foamSettings"
|
||||||
|
fi
|
||||||
|
|
||||||
|
## echo "Source with $_foamSourceBashEnv with '$FOAM_SETTINGS'" 1>&2
|
||||||
|
|
||||||
|
# Newer bash can use --init-file instead of --rcfile
|
||||||
|
exec bash --rcfile "$_foamSourceBashEnv" -i
|
||||||
|
exit $? # Safety
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Non-interactive shell
|
||||||
|
# ---------------------
|
||||||
|
|
||||||
|
# Source bashrc within a function to preserve command-line arguments
|
||||||
|
# Suppresses aliases as a side-effect, but non-interactive anyhow.
|
||||||
|
sourceBashrc()
|
||||||
|
{
|
||||||
|
. "$_foamSourceBashEnv" $_foamSettings
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if [ -n "$_foamScriptCommand" ]
|
||||||
|
then
|
||||||
|
# A shell command
|
||||||
|
|
||||||
|
sourceBashrc
|
||||||
|
exec bash -c "$_foamScriptCommand" "$@"
|
||||||
|
exit $? # Safety
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ -n "$optTestTut" ]
|
||||||
|
then
|
||||||
|
|
||||||
|
sourceBashrc
|
||||||
|
exec "$WM_PROJECT_DIR/tutorials/AutoTest" "$@"
|
||||||
|
exit $? # Safety
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# An application or a shell script
|
||||||
|
|
||||||
|
# It may actually be a script with a '#!/project-path/bin/openfoam',
|
||||||
|
# so we need to catch this to avoid infinite recursion.
|
||||||
|
if [ -f "$1" ] \
|
||||||
|
&& [ -n "$(sed -ne '1{/^#!.*\/openfoam$/p; q}' "$1" 2>/dev/null)" ]
|
||||||
|
then
|
||||||
|
# A shell script
|
||||||
|
|
||||||
|
sourceBashrc
|
||||||
|
exec bash "$@"
|
||||||
|
|
||||||
|
else
|
||||||
|
# An application
|
||||||
|
|
||||||
|
sourceBashrc
|
||||||
|
exec "$@"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
@ -1428,7 +1428,7 @@ bool Foam::ping
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fill sockaddr_in structure with dest address and port
|
// Fill sockaddr_in structure with dest address and port
|
||||||
memset(reinterpret_cast<char *>(&destAddr), '\0', sizeof(destAddr));
|
std::memset(reinterpret_cast<char *>(&destAddr), '\0', sizeof(destAddr));
|
||||||
destAddr.sin_family = AF_INET;
|
destAddr.sin_family = AF_INET;
|
||||||
destAddr.sin_port = htons(ushort(destPort));
|
destAddr.sin_port = htons(ushort(destPort));
|
||||||
destAddr.sin_addr.s_addr = addr;
|
destAddr.sin_addr.s_addr = addr;
|
||||||
|
|||||||
@ -472,6 +472,12 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
reference(const reference&) = default;
|
||||||
|
|
||||||
|
//- Move construct
|
||||||
|
reference(reference&&) = default;
|
||||||
|
|
||||||
//- Value assignment
|
//- Value assignment
|
||||||
inline void operator=(const reference& other);
|
inline void operator=(const reference& other);
|
||||||
|
|
||||||
|
|||||||
@ -447,6 +447,12 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
reference(const reference&) = default;
|
||||||
|
|
||||||
|
//- Move construct
|
||||||
|
reference(reference&&) = default;
|
||||||
|
|
||||||
//- Flip the bit at the position, no range-checking
|
//- Flip the bit at the position, no range-checking
|
||||||
inline void flip();
|
inline void flip();
|
||||||
|
|
||||||
|
|||||||
@ -766,8 +766,11 @@ public:
|
|||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null (end iterator)
|
//- Default construct (end iterator)
|
||||||
inline const_iterator() = default;
|
const_iterator() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
const_iterator(const const_iterator&) = default;
|
||||||
|
|
||||||
//- Copy construct from similar access type
|
//- Copy construct from similar access type
|
||||||
inline explicit const_iterator(const Iterator<true>& iter)
|
inline explicit const_iterator(const Iterator<true>& iter)
|
||||||
|
|||||||
@ -233,6 +233,9 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
iterator(const iterator&) = default;
|
||||||
|
|
||||||
//- Construct for a node on a list
|
//- Construct for a node on a list
|
||||||
inline iterator(DLListBase* list, link* item);
|
inline iterator(DLListBase* list, link* item);
|
||||||
|
|
||||||
|
|||||||
@ -209,6 +209,9 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
iterator(const iterator&) = default;
|
||||||
|
|
||||||
//- Construct for a node on the list
|
//- Construct for a node on the list
|
||||||
inline iterator(SLListBase* list, link* item);
|
inline iterator(SLListBase* list, link* item);
|
||||||
|
|
||||||
|
|||||||
@ -59,7 +59,10 @@ void Foam::List<T>::doResize(const label newSize)
|
|||||||
#ifdef USEMEMCPY
|
#ifdef USEMEMCPY
|
||||||
if (contiguous<T>())
|
if (contiguous<T>())
|
||||||
{
|
{
|
||||||
memcpy(nv, this->v_, overlap*sizeof(T));
|
std::memcpy
|
||||||
|
(
|
||||||
|
static_cast<void*>(nv), this->v_, overlap*sizeof(T)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
@ -185,21 +188,26 @@ Foam::List<T>::List(const UList<T>& a)
|
|||||||
:
|
:
|
||||||
UList<T>(nullptr, a.size_)
|
UList<T>(nullptr, a.size_)
|
||||||
{
|
{
|
||||||
if (this->size_)
|
const label len = this->size_;
|
||||||
|
|
||||||
|
if (len)
|
||||||
{
|
{
|
||||||
doAlloc();
|
doAlloc();
|
||||||
|
|
||||||
#ifdef USEMEMCPY
|
#ifdef USEMEMCPY
|
||||||
if (contiguous<T>())
|
if (contiguous<T>())
|
||||||
{
|
{
|
||||||
memcpy(this->v_, a.v_, this->byteSize());
|
std::memcpy
|
||||||
|
(
|
||||||
|
static_cast<void*>(this->v_), a.v_, this->byteSize()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
List_ACCESS(T, (*this), vp);
|
List_ACCESS(T, (*this), vp);
|
||||||
List_CONST_ACCESS(T, a, ap);
|
List_CONST_ACCESS(T, a, ap);
|
||||||
List_FOR_ALL((*this), i)
|
for (label i = 0; i < len; ++i)
|
||||||
{
|
{
|
||||||
vp[i] = ap[i];
|
vp[i] = ap[i];
|
||||||
}
|
}
|
||||||
@ -213,21 +221,26 @@ Foam::List<T>::List(const List<T>& a)
|
|||||||
:
|
:
|
||||||
UList<T>(nullptr, a.size_)
|
UList<T>(nullptr, a.size_)
|
||||||
{
|
{
|
||||||
if (this->size_)
|
const label len = this->size_;
|
||||||
|
|
||||||
|
if (len)
|
||||||
{
|
{
|
||||||
doAlloc();
|
doAlloc();
|
||||||
|
|
||||||
#ifdef USEMEMCPY
|
#ifdef USEMEMCPY
|
||||||
if (contiguous<T>())
|
if (contiguous<T>())
|
||||||
{
|
{
|
||||||
memcpy(this->v_, a.v_, this->byteSize());
|
std::memcpy
|
||||||
|
(
|
||||||
|
static_cast<void*>(this->v_), a.v_, this->byteSize()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
List_ACCESS(T, (*this), vp);
|
List_ACCESS(T, (*this), vp);
|
||||||
List_CONST_ACCESS(T, a, ap);
|
List_CONST_ACCESS(T, a, ap);
|
||||||
List_FOR_ALL((*this), i)
|
for (label i = 0; i < len; ++i)
|
||||||
{
|
{
|
||||||
vp[i] = ap[i];
|
vp[i] = ap[i];
|
||||||
}
|
}
|
||||||
@ -247,22 +260,29 @@ Foam::List<T>::List(List<T>& a, bool reuse)
|
|||||||
this->v_ = a.v_;
|
this->v_ = a.v_;
|
||||||
a.v_ = nullptr;
|
a.v_ = nullptr;
|
||||||
a.size_ = 0;
|
a.size_ = 0;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (this->size_)
|
|
||||||
|
const label len = this->size_;
|
||||||
|
|
||||||
|
if (len)
|
||||||
{
|
{
|
||||||
doAlloc();
|
doAlloc();
|
||||||
|
|
||||||
#ifdef USEMEMCPY
|
#ifdef USEMEMCPY
|
||||||
if (contiguous<T>())
|
if (contiguous<T>())
|
||||||
{
|
{
|
||||||
memcpy(this->v_, a.v_, this->byteSize());
|
std::memcpy
|
||||||
|
(
|
||||||
|
static_cast<void*>(this->v_), a.v_, this->byteSize()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
List_ACCESS(T, (*this), vp);
|
List_ACCESS(T, (*this), vp);
|
||||||
List_CONST_ACCESS(T, a, ap);
|
List_CONST_ACCESS(T, a, ap);
|
||||||
List_FOR_ALL((*this), i)
|
for (label i = 0; i < len; ++i)
|
||||||
{
|
{
|
||||||
vp[i] = ap[i];
|
vp[i] = ap[i];
|
||||||
}
|
}
|
||||||
@ -454,19 +474,24 @@ void Foam::List<T>::operator=(const UList<T>& a)
|
|||||||
{
|
{
|
||||||
reAlloc(a.size_);
|
reAlloc(a.size_);
|
||||||
|
|
||||||
if (this->size_)
|
const label len = this->size_;
|
||||||
|
|
||||||
|
if (len)
|
||||||
{
|
{
|
||||||
#ifdef USEMEMCPY
|
#ifdef USEMEMCPY
|
||||||
if (contiguous<T>())
|
if (contiguous<T>())
|
||||||
{
|
{
|
||||||
memcpy(this->v_, a.v_, this->byteSize());
|
std::memcpy
|
||||||
|
(
|
||||||
|
static_cast<void*>(this->v_), a.v_, this->byteSize()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
List_ACCESS(T, (*this), vp);
|
List_ACCESS(T, (*this), vp);
|
||||||
List_CONST_ACCESS(T, a, ap);
|
List_CONST_ACCESS(T, a, ap);
|
||||||
List_FOR_ALL((*this), i)
|
for (label i = 0; i < len; ++i)
|
||||||
{
|
{
|
||||||
vp[i] = ap[i];
|
vp[i] = ap[i];
|
||||||
}
|
}
|
||||||
@ -522,7 +547,7 @@ void Foam::List<T>::operator=(const IndirectListBase<T, Addr>& list)
|
|||||||
{
|
{
|
||||||
List_ACCESS(T, (*this), vp);
|
List_ACCESS(T, (*this), vp);
|
||||||
|
|
||||||
for (label i=0; i<len; ++i)
|
for (label i=0; i < len; ++i)
|
||||||
{
|
{
|
||||||
vp[i] = list[i];
|
vp[i] = list[i];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,6 +76,12 @@ public:
|
|||||||
inline static const SubList<T>& null();
|
inline static const SubList<T>& null();
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
SubList(const SubList&) = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from UList and sub-list size, start at 0
|
//- Construct from UList and sub-list size, start at 0
|
||||||
|
|||||||
@ -118,7 +118,10 @@ void Foam::UList<T>::deepCopy(const UList<T>& list)
|
|||||||
#ifdef USEMEMCPY
|
#ifdef USEMEMCPY
|
||||||
if (contiguous<T>())
|
if (contiguous<T>())
|
||||||
{
|
{
|
||||||
memcpy(this->v_, list.v_, this->byteSize());
|
std::memcpy
|
||||||
|
(
|
||||||
|
static_cast<void*>(this->v_), list.v_, this->byteSize()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -213,6 +213,12 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
UList(const UList<T>&) = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Null constructor
|
//- Null constructor
|
||||||
|
|||||||
@ -259,6 +259,15 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
IOobject(const IOobject&) = default;
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~IOobject() = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from name, instance, registry, io options
|
//- Construct from name, instance, registry, io options
|
||||||
@ -328,10 +337,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~IOobject() = default;
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// General access
|
// General access
|
||||||
|
|||||||
@ -77,12 +77,6 @@ Foam::baseIOdictionary::baseIOdictionary
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::baseIOdictionary::~baseIOdictionary()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Members Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Members Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const Foam::word& Foam::baseIOdictionary::name() const
|
const Foam::word& Foam::baseIOdictionary::name() const
|
||||||
|
|||||||
@ -68,6 +68,18 @@ public:
|
|||||||
TypeName("dictionary");
|
TypeName("dictionary");
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
baseIOdictionary(const baseIOdictionary&) = default;
|
||||||
|
|
||||||
|
//- Move construct
|
||||||
|
baseIOdictionary(baseIOdictionary&&) = default;
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~baseIOdictionary() = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct given an IOobject
|
//- Construct given an IOobject
|
||||||
@ -80,11 +92,7 @@ public:
|
|||||||
baseIOdictionary(const IOobject&, Istream&);
|
baseIOdictionary(const IOobject&, Istream&);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
// Member Functions
|
||||||
virtual ~baseIOdictionary();
|
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
|
||||||
|
|
||||||
//- Return complete path + object name if the file exists
|
//- Return complete path + object name if the file exists
|
||||||
// either in the case/processor or case otherwise null
|
// either in the case/processor or case otherwise null
|
||||||
|
|||||||
@ -140,6 +140,15 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
IOstream(const IOstream&) = default;
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~IOstream() = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct with specified stream option
|
//- Construct with specified stream option
|
||||||
@ -165,10 +174,6 @@ public:
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~IOstream() = default;
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|||||||
@ -72,6 +72,15 @@ class Istream
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
Istream(const Istream&) = default;
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~Istream() = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct and set stream status
|
//- Construct and set stream status
|
||||||
@ -87,11 +96,7 @@ public:
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
// Member Functions
|
||||||
virtual ~Istream() = default;
|
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
|
||||||
|
|
||||||
// Read functions
|
// Read functions
|
||||||
|
|
||||||
|
|||||||
@ -75,6 +75,15 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
Ostream(const Ostream&) = default;
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~Ostream() = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct and set stream status
|
//- Construct and set stream status
|
||||||
@ -90,11 +99,7 @@ public:
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
// Member Functions
|
||||||
virtual ~Ostream() = default;
|
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
|
||||||
|
|
||||||
// Write functions
|
// Write functions
|
||||||
|
|
||||||
|
|||||||
@ -62,14 +62,17 @@ class OSstream
|
|||||||
std::ostream& os_;
|
std::ostream& os_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
public:
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
OSstream(const OSstream&) = default;
|
||||||
|
|
||||||
//- No copy assignment
|
//- No copy assignment
|
||||||
void operator=(const OSstream&) = delete;
|
void operator=(const OSstream&) = delete;
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct as wrapper around std::ostream and set stream status
|
//- Construct as wrapper around std::ostream and set stream status
|
||||||
|
|||||||
@ -301,4 +301,32 @@ void Foam::ITstream::rewind()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::ITstream::operator=(const ITstream& is)
|
||||||
|
{
|
||||||
|
Istream::operator=(is);
|
||||||
|
tokenList::operator=(is);
|
||||||
|
name_ = is.name_;
|
||||||
|
|
||||||
|
rewind();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::ITstream::operator=(const tokenList& toks)
|
||||||
|
{
|
||||||
|
tokenList::operator=(toks);
|
||||||
|
|
||||||
|
rewind();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::ITstream::operator=(tokenList&& toks)
|
||||||
|
{
|
||||||
|
tokenList::operator=(std::move(toks));
|
||||||
|
|
||||||
|
rewind();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -273,10 +273,22 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Print
|
// Output
|
||||||
|
|
||||||
//- Print description of stream to Ostream
|
//- Print stream description to Ostream
|
||||||
void print(Ostream& os) const;
|
void print(Ostream& os) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Member Operators
|
||||||
|
|
||||||
|
//- Copy assignment, with rewind()
|
||||||
|
void operator=(const ITstream& is);
|
||||||
|
|
||||||
|
//- Copy assignment of tokens, with rewind()
|
||||||
|
void operator=(const tokenList& toks);
|
||||||
|
|
||||||
|
//- Move assignment of tokens, with rewind()
|
||||||
|
void operator=(tokenList&& toks);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2018 OpenCFD Ltd.
|
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -144,7 +144,8 @@ bool Foam::functionEntries::includeEntry::execute
|
|||||||
{
|
{
|
||||||
if (Foam::functionEntries::includeEntry::log)
|
if (Foam::functionEntries::includeEntry::log)
|
||||||
{
|
{
|
||||||
DetailInfo << fName << endl;
|
// Report to stdout which file is included
|
||||||
|
Info<< fName << nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add watch on included file
|
// Add watch on included file
|
||||||
@ -189,7 +190,8 @@ bool Foam::functionEntries::includeEntry::execute
|
|||||||
{
|
{
|
||||||
if (Foam::functionEntries::includeEntry::log)
|
if (Foam::functionEntries::includeEntry::log)
|
||||||
{
|
{
|
||||||
DetailInfo << fName << endl;
|
// Report to stdout which file is included
|
||||||
|
Info<< fName << nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add watch on included file
|
// Add watch on included file
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2015-2017 OpenFOAM Foundation
|
Copyright (C) 2015-2017 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -104,7 +105,8 @@ bool Foam::functionEntries::includeEtcEntry::execute
|
|||||||
{
|
{
|
||||||
if (Foam::functionEntries::includeEtcEntry::log)
|
if (Foam::functionEntries::includeEtcEntry::log)
|
||||||
{
|
{
|
||||||
DetailInfo << fName << endl;
|
// Report to stdout which file is included
|
||||||
|
Info<< fName << nl;
|
||||||
}
|
}
|
||||||
parentDict.read(ifs);
|
parentDict.read(ifs);
|
||||||
return true;
|
return true;
|
||||||
@ -137,7 +139,8 @@ bool Foam::functionEntries::includeEtcEntry::execute
|
|||||||
{
|
{
|
||||||
if (Foam::functionEntries::includeEtcEntry::log)
|
if (Foam::functionEntries::includeEtcEntry::log)
|
||||||
{
|
{
|
||||||
DetailInfo << fName << endl;
|
// Report to stdout which file is included
|
||||||
|
Info<< fName << nl;
|
||||||
}
|
}
|
||||||
entry.read(parentDict, ifs);
|
entry.read(parentDict, ifs);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -55,7 +55,7 @@ Foam::IOerror::IOerror(const dictionary& errDict)
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::IOerror::~IOerror() throw()
|
Foam::IOerror::~IOerror() noexcept
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -128,7 +128,7 @@ Foam::error::error(const error& err)
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::error::~error() throw()
|
Foam::error::~error() noexcept
|
||||||
{
|
{
|
||||||
delete messageStreamPtr_;
|
delete messageStreamPtr_;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -95,7 +95,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~error() throw();
|
virtual ~error() noexcept;
|
||||||
|
|
||||||
|
|
||||||
// Static Member Functions
|
// Static Member Functions
|
||||||
@ -239,7 +239,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~IOerror() throw();
|
virtual ~IOerror() noexcept;
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|||||||
@ -65,6 +65,12 @@ public:
|
|||||||
TypeName("value");
|
TypeName("value");
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
valuePointPatchField(const valuePointPatchField&) = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from patch and internal field
|
//- Construct from patch and internal field
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2016 OpenCFD Ltd.
|
Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -56,7 +56,7 @@ void Foam::interpolation2DTable<Type>::readTable()
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::interpolation2DTable<Type>::interpolation2DTable()
|
Foam::interpolation2DTable<Type>::interpolation2DTable()
|
||||||
:
|
:
|
||||||
List<Tuple2<scalar, List<Tuple2<scalar, Type>>>>(),
|
List<value_type>(),
|
||||||
bounding_(bounds::normalBounding::WARN),
|
bounding_(bounds::normalBounding::WARN),
|
||||||
fileName_("fileNameIsUndefined"),
|
fileName_("fileNameIsUndefined"),
|
||||||
reader_(nullptr)
|
reader_(nullptr)
|
||||||
@ -71,7 +71,7 @@ Foam::interpolation2DTable<Type>::interpolation2DTable
|
|||||||
const fileName& fName
|
const fileName& fName
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
List<Tuple2<scalar, List<Tuple2<scalar, Type>>>>(values),
|
List<value_type>(values),
|
||||||
bounding_(bounding),
|
bounding_(bounding),
|
||||||
fileName_(fName),
|
fileName_(fName),
|
||||||
reader_(nullptr)
|
reader_(nullptr)
|
||||||
@ -81,7 +81,7 @@ Foam::interpolation2DTable<Type>::interpolation2DTable
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::interpolation2DTable<Type>::interpolation2DTable(const fileName& fName)
|
Foam::interpolation2DTable<Type>::interpolation2DTable(const fileName& fName)
|
||||||
:
|
:
|
||||||
List<Tuple2<scalar, List<Tuple2<scalar, Type>>>>(),
|
List<value_type>(),
|
||||||
bounding_(bounds::normalBounding::WARN),
|
bounding_(bounds::normalBounding::WARN),
|
||||||
fileName_(fName),
|
fileName_(fName),
|
||||||
reader_(new openFoamTableReader<Type>(dictionary()))
|
reader_(new openFoamTableReader<Type>(dictionary()))
|
||||||
@ -93,7 +93,7 @@ Foam::interpolation2DTable<Type>::interpolation2DTable(const fileName& fName)
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::interpolation2DTable<Type>::interpolation2DTable(const dictionary& dict)
|
Foam::interpolation2DTable<Type>::interpolation2DTable(const dictionary& dict)
|
||||||
:
|
:
|
||||||
List<Tuple2<scalar, List<Tuple2<scalar, Type>>>>(),
|
List<value_type>(),
|
||||||
bounding_
|
bounding_
|
||||||
(
|
(
|
||||||
bounds::normalBoundingNames.lookupOrDefault
|
bounds::normalBoundingNames.lookupOrDefault
|
||||||
@ -114,13 +114,13 @@ Foam::interpolation2DTable<Type>::interpolation2DTable(const dictionary& dict)
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::interpolation2DTable<Type>::interpolation2DTable
|
Foam::interpolation2DTable<Type>::interpolation2DTable
|
||||||
(
|
(
|
||||||
const interpolation2DTable& interpTable
|
const interpolation2DTable& tbl
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
List<Tuple2<scalar, List<Tuple2<scalar, Type>>>>(interpTable),
|
List<value_type>(tbl),
|
||||||
bounding_(interpTable.bounding_),
|
bounding_(tbl.bounding_),
|
||||||
fileName_(interpTable.fileName_),
|
fileName_(tbl.fileName_),
|
||||||
reader_(interpTable.reader_) // note: steals reader. Used in write().
|
reader_(tbl.reader_.clone())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -312,6 +312,24 @@ Foam::label Foam::interpolation2DTable<Type>::Xi
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::interpolation2DTable<Type>::operator=
|
||||||
|
(
|
||||||
|
const interpolation2DTable<Type>& rhs
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (this == &rhs)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
static_cast<List<value_type>&>(*this) = rhs;
|
||||||
|
bounding_ = rhs.bounding_;
|
||||||
|
fileName_ = rhs.fileName_;
|
||||||
|
reader_.reset(rhs.reader_.clone());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Type Foam::interpolation2DTable<Type>::operator()
|
Type Foam::interpolation2DTable<Type>::operator()
|
||||||
(
|
(
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -57,17 +58,7 @@ class interpolation2DTable
|
|||||||
:
|
:
|
||||||
public List<Tuple2<scalar, List<Tuple2<scalar, Type>>>>
|
public List<Tuple2<scalar, List<Tuple2<scalar, Type>>>>
|
||||||
{
|
{
|
||||||
public:
|
// Private Data
|
||||||
|
|
||||||
// Public data types
|
|
||||||
|
|
||||||
//- Convenience typedef
|
|
||||||
typedef List<Tuple2<scalar, List<Tuple2<scalar, Type>>>> table;
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- Handling for out-of-bound values
|
//- Handling for out-of-bound values
|
||||||
bounds::normalBounding bounding_;
|
bounds::normalBounding bounding_;
|
||||||
@ -103,6 +94,15 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Public Data Types
|
||||||
|
|
||||||
|
//- The element data type
|
||||||
|
typedef Tuple2<scalar, List<Tuple2<scalar, Type>>> value_type;
|
||||||
|
|
||||||
|
//- Convenience typedef
|
||||||
|
typedef List<Tuple2<scalar, List<Tuple2<scalar, Type>>>> table;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
//- Construct null
|
||||||
@ -122,8 +122,8 @@ public:
|
|||||||
//- Construct by reading file name and outOfBounds from dictionary
|
//- Construct by reading file name and outOfBounds from dictionary
|
||||||
interpolation2DTable(const dictionary& dict);
|
interpolation2DTable(const dictionary& dict);
|
||||||
|
|
||||||
//- Construct copy
|
//- Copy construct
|
||||||
interpolation2DTable(const interpolation2DTable& interpTable);
|
interpolation2DTable(const interpolation2DTable& tbl);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
@ -141,6 +141,9 @@ public:
|
|||||||
//- Return an element of constant List<Tuple2<scalar, Type>>
|
//- Return an element of constant List<Tuple2<scalar, Type>>
|
||||||
const List<Tuple2<scalar, Type>>& operator[](const label) const;
|
const List<Tuple2<scalar, Type>>& operator[](const label) const;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
void operator=(const interpolation2DTable<Type>& rhs);
|
||||||
|
|
||||||
//- Return an interpolated value
|
//- Return an interpolated value
|
||||||
Type operator()(const scalar valueX, const scalar valueY) const;
|
Type operator()(const scalar valueX, const scalar valueY) const;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -59,7 +60,7 @@ void Foam::interpolationTable<Type>::readTable()
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::interpolationTable<Type>::interpolationTable()
|
Foam::interpolationTable<Type>::interpolationTable()
|
||||||
:
|
:
|
||||||
List<Tuple2<scalar, Type>>(),
|
List<value_type>(),
|
||||||
bounding_(bounds::repeatableBounding::WARN),
|
bounding_(bounds::repeatableBounding::WARN),
|
||||||
fileName_("fileNameIsUndefined"),
|
fileName_("fileNameIsUndefined"),
|
||||||
reader_(nullptr)
|
reader_(nullptr)
|
||||||
@ -74,7 +75,7 @@ Foam::interpolationTable<Type>::interpolationTable
|
|||||||
const fileName& fName
|
const fileName& fName
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
List<Tuple2<scalar, Type>>(values),
|
List<value_type>(values),
|
||||||
bounding_(bounding),
|
bounding_(bounding),
|
||||||
fileName_(fName),
|
fileName_(fName),
|
||||||
reader_(nullptr)
|
reader_(nullptr)
|
||||||
@ -84,7 +85,7 @@ Foam::interpolationTable<Type>::interpolationTable
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::interpolationTable<Type>::interpolationTable(const fileName& fName)
|
Foam::interpolationTable<Type>::interpolationTable(const fileName& fName)
|
||||||
:
|
:
|
||||||
List<Tuple2<scalar, Type>>(),
|
List<value_type>(),
|
||||||
bounding_(bounds::repeatableBounding::WARN),
|
bounding_(bounds::repeatableBounding::WARN),
|
||||||
fileName_(fName),
|
fileName_(fName),
|
||||||
reader_(new openFoamTableReader<Type>(dictionary()))
|
reader_(new openFoamTableReader<Type>(dictionary()))
|
||||||
@ -96,7 +97,7 @@ Foam::interpolationTable<Type>::interpolationTable(const fileName& fName)
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::interpolationTable<Type>::interpolationTable(const dictionary& dict)
|
Foam::interpolationTable<Type>::interpolationTable(const dictionary& dict)
|
||||||
:
|
:
|
||||||
List<Tuple2<scalar, Type>>(),
|
List<value_type>(),
|
||||||
bounding_
|
bounding_
|
||||||
(
|
(
|
||||||
bounds::repeatableBoundingNames.lookupOrDefault
|
bounds::repeatableBoundingNames.lookupOrDefault
|
||||||
@ -117,17 +118,16 @@ Foam::interpolationTable<Type>::interpolationTable(const dictionary& dict)
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::interpolationTable<Type>::interpolationTable
|
Foam::interpolationTable<Type>::interpolationTable
|
||||||
(
|
(
|
||||||
const interpolationTable& interpTable
|
const interpolationTable& tbl
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
List<Tuple2<scalar, Type>>(interpTable),
|
List<value_type>(tbl),
|
||||||
bounding_(interpTable.bounding_),
|
bounding_(tbl.bounding_),
|
||||||
fileName_(interpTable.fileName_),
|
fileName_(tbl.fileName_),
|
||||||
reader_(interpTable.reader_) // note: steals reader. Used in write().
|
reader_(tbl.reader_.clone())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
@ -318,6 +318,24 @@ Type Foam::interpolationTable<Type>::rateOfChange(const scalar value) const
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::interpolationTable<Type>::operator=
|
||||||
|
(
|
||||||
|
const interpolationTable<Type>& rhs
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (this == &rhs)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
static_cast<List<value_type>&>(*this) = rhs;
|
||||||
|
bounding_ = rhs.bounding_;
|
||||||
|
fileName_ = rhs.fileName_;
|
||||||
|
reader_.reset(rhs.reader_.clone());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
const Foam::Tuple2<Foam::scalar, Type>&
|
const Foam::Tuple2<Foam::scalar, Type>&
|
||||||
Foam::interpolationTable<Type>::operator[](const label i) const
|
Foam::interpolationTable<Type>::operator[](const label i) const
|
||||||
|
|||||||
@ -104,6 +104,15 @@ class interpolationTable
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Public Data Types
|
||||||
|
|
||||||
|
//- The element data type
|
||||||
|
typedef Tuple2<scalar, Type> value_type;
|
||||||
|
|
||||||
|
//- The mapped data type
|
||||||
|
typedef Type mapped_type;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
//- Construct null
|
||||||
@ -125,8 +134,8 @@ public:
|
|||||||
// This is a specialised constructor used by patchFields
|
// This is a specialised constructor used by patchFields
|
||||||
interpolationTable(const dictionary& dict);
|
interpolationTable(const dictionary& dict);
|
||||||
|
|
||||||
//- Construct copy
|
//- Copy construct
|
||||||
interpolationTable(const interpolationTable& interpTable);
|
interpolationTable(const interpolationTable& tbl);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
@ -145,6 +154,9 @@ public:
|
|||||||
|
|
||||||
// Member Operators
|
// Member Operators
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
void operator=(const interpolationTable<Type>& rhs);
|
||||||
|
|
||||||
//- Return an element of constant Tuple2<scalar, Type>
|
//- Return an element of constant Tuple2<scalar, Type>
|
||||||
const Tuple2<scalar, Type>& operator[](const label) const;
|
const Tuple2<scalar, Type>& operator[](const label) const;
|
||||||
|
|
||||||
|
|||||||
@ -50,7 +50,7 @@ void Foam::processorLduInterface::send
|
|||||||
(
|
(
|
||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
reinterpret_cast<const char*>(f.begin()),
|
reinterpret_cast<const char*>(f.cdata()),
|
||||||
nBytes,
|
nBytes,
|
||||||
tag(),
|
tag(),
|
||||||
comm()
|
comm()
|
||||||
@ -64,20 +64,23 @@ void Foam::processorLduInterface::send
|
|||||||
(
|
(
|
||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
receiveBuf_.begin(),
|
receiveBuf_.data(),
|
||||||
nBytes,
|
nBytes,
|
||||||
tag(),
|
tag(),
|
||||||
comm()
|
comm()
|
||||||
);
|
);
|
||||||
|
|
||||||
resizeBuf(sendBuf_, nBytes);
|
resizeBuf(sendBuf_, nBytes);
|
||||||
memcpy(sendBuf_.begin(), f.begin(), nBytes);
|
std::memcpy
|
||||||
|
(
|
||||||
|
static_cast<void*>(sendBuf_.data()), f.cdata(), nBytes
|
||||||
|
);
|
||||||
|
|
||||||
OPstream::write
|
OPstream::write
|
||||||
(
|
(
|
||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
sendBuf_.begin(),
|
sendBuf_.cdata(),
|
||||||
nBytes,
|
nBytes,
|
||||||
tag(),
|
tag(),
|
||||||
comm()
|
comm()
|
||||||
@ -109,7 +112,7 @@ void Foam::processorLduInterface::receive
|
|||||||
(
|
(
|
||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
reinterpret_cast<char*>(f.begin()),
|
reinterpret_cast<char*>(f.data()),
|
||||||
f.byteSize(),
|
f.byteSize(),
|
||||||
tag(),
|
tag(),
|
||||||
comm()
|
comm()
|
||||||
@ -117,7 +120,10 @@ void Foam::processorLduInterface::receive
|
|||||||
}
|
}
|
||||||
else if (commsType == Pstream::commsTypes::nonBlocking)
|
else if (commsType == Pstream::commsTypes::nonBlocking)
|
||||||
{
|
{
|
||||||
memcpy(f.begin(), receiveBuf_.begin(), f.byteSize());
|
std::memcpy
|
||||||
|
(
|
||||||
|
static_cast<void*>(f.data()), receiveBuf_.cdata(), f.byteSize()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -156,10 +162,10 @@ void Foam::processorLduInterface::compressedSend
|
|||||||
label nFloats = nm1 + nlast;
|
label nFloats = nm1 + nlast;
|
||||||
label nBytes = nFloats*sizeof(float);
|
label nBytes = nFloats*sizeof(float);
|
||||||
|
|
||||||
const scalar *sArray = reinterpret_cast<const scalar*>(f.begin());
|
const scalar *sArray = reinterpret_cast<const scalar*>(f.cdata());
|
||||||
const scalar *slast = &sArray[nm1];
|
const scalar *slast = &sArray[nm1];
|
||||||
resizeBuf(sendBuf_, nBytes);
|
resizeBuf(sendBuf_, nBytes);
|
||||||
float *fArray = reinterpret_cast<float*>(sendBuf_.begin());
|
float *fArray = reinterpret_cast<float*>(sendBuf_.data());
|
||||||
|
|
||||||
for (label i=0; i<nm1; i++)
|
for (label i=0; i<nm1; i++)
|
||||||
{
|
{
|
||||||
@ -178,7 +184,7 @@ void Foam::processorLduInterface::compressedSend
|
|||||||
(
|
(
|
||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
sendBuf_.begin(),
|
sendBuf_.cdata(),
|
||||||
nBytes,
|
nBytes,
|
||||||
tag(),
|
tag(),
|
||||||
comm()
|
comm()
|
||||||
@ -192,7 +198,7 @@ void Foam::processorLduInterface::compressedSend
|
|||||||
(
|
(
|
||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
receiveBuf_.begin(),
|
receiveBuf_.data(),
|
||||||
nBytes,
|
nBytes,
|
||||||
tag(),
|
tag(),
|
||||||
comm()
|
comm()
|
||||||
@ -202,7 +208,7 @@ void Foam::processorLduInterface::compressedSend
|
|||||||
(
|
(
|
||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
sendBuf_.begin(),
|
sendBuf_.cdata(),
|
||||||
nBytes,
|
nBytes,
|
||||||
tag(),
|
tag(),
|
||||||
comm()
|
comm()
|
||||||
@ -248,7 +254,7 @@ void Foam::processorLduInterface::compressedReceive
|
|||||||
(
|
(
|
||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
receiveBuf_.begin(),
|
receiveBuf_.data(),
|
||||||
nBytes,
|
nBytes,
|
||||||
tag(),
|
tag(),
|
||||||
comm()
|
comm()
|
||||||
@ -262,9 +268,9 @@ void Foam::processorLduInterface::compressedReceive
|
|||||||
}
|
}
|
||||||
|
|
||||||
const float *fArray =
|
const float *fArray =
|
||||||
reinterpret_cast<const float*>(receiveBuf_.begin());
|
reinterpret_cast<const float*>(receiveBuf_.cdata());
|
||||||
f.last() = reinterpret_cast<const Type&>(fArray[nm1]);
|
f.last() = reinterpret_cast<const Type&>(fArray[nm1]);
|
||||||
scalar *sArray = reinterpret_cast<scalar*>(f.begin());
|
scalar *sArray = reinterpret_cast<scalar*>(f.data());
|
||||||
const scalar *slast = &sArray[nm1];
|
const scalar *slast = &sArray[nm1];
|
||||||
|
|
||||||
for (label i=0; i<nm1; i++)
|
for (label i=0; i<nm1; i++)
|
||||||
|
|||||||
@ -73,6 +73,18 @@ class patchIdentifier
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
patchIdentifier(const patchIdentifier&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
patchIdentifier& operator=(const patchIdentifier&) = default;
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~patchIdentifier() = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
@ -100,10 +112,6 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~patchIdentifier() = default;
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return the patch name
|
//- Return the patch name
|
||||||
|
|||||||
@ -83,6 +83,15 @@ public:
|
|||||||
static const word emptyType;
|
static const word emptyType;
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
surfZoneIdentifier(const surfZoneIdentifier&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
surfZoneIdentifier& operator=(const surfZoneIdentifier&) = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
//- Construct null
|
||||||
|
|||||||
@ -79,10 +79,19 @@ public:
|
|||||||
enum components { XX, XY, XZ, YY, YZ, ZZ };
|
enum components { XX, XY, XZ, YY, YZ, ZZ };
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline SymmTensor();
|
SymmTensor() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
SymmTensor(const SymmTensor&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
SymmTensor& operator=(const SymmTensor&) = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct initialized to zero
|
//- Construct initialized to zero
|
||||||
inline SymmTensor(const Foam::zero);
|
inline SymmTensor(const Foam::zero);
|
||||||
|
|||||||
@ -30,11 +30,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Cmpt>
|
|
||||||
inline Foam::SymmTensor<Cmpt>::SymmTensor()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::SymmTensor<Cmpt>::SymmTensor(const Foam::zero)
|
inline Foam::SymmTensor<Cmpt>::SymmTensor(const Foam::zero)
|
||||||
:
|
:
|
||||||
|
|||||||
@ -79,10 +79,19 @@ public:
|
|||||||
enum components { XX, XY, YY };
|
enum components { XX, XY, YY };
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline SymmTensor2D();
|
SymmTensor2D() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
SymmTensor2D(const SymmTensor2D&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
SymmTensor2D& operator=(const SymmTensor2D&) = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct initialized to zero
|
//- Construct initialized to zero
|
||||||
inline SymmTensor2D(const Foam::zero);
|
inline SymmTensor2D(const Foam::zero);
|
||||||
|
|||||||
@ -30,11 +30,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Cmpt>
|
|
||||||
inline Foam::SymmTensor2D<Cmpt>::SymmTensor2D()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::SymmTensor2D<Cmpt>::SymmTensor2D(const Foam::zero)
|
inline Foam::SymmTensor2D<Cmpt>::SymmTensor2D(const Foam::zero)
|
||||||
:
|
:
|
||||||
|
|||||||
@ -89,10 +89,19 @@ public:
|
|||||||
enum components { XX, XY, XZ, YX, YY, YZ, ZX, ZY, ZZ };
|
enum components { XX, XY, XZ, YX, YY, YZ, ZX, ZY, ZZ };
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline Tensor();
|
Tensor() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
Tensor(const Tensor&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
Tensor& operator=(const Tensor&) = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct initialized to zero
|
//- Construct initialized to zero
|
||||||
inline Tensor(const Foam::zero);
|
inline Tensor(const Foam::zero);
|
||||||
|
|||||||
@ -30,11 +30,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Cmpt>
|
|
||||||
inline Foam::Tensor<Cmpt>::Tensor()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::Tensor<Cmpt>::Tensor(const Foam::zero)
|
inline Foam::Tensor<Cmpt>::Tensor(const Foam::zero)
|
||||||
:
|
:
|
||||||
|
|||||||
@ -83,10 +83,19 @@ public:
|
|||||||
enum components { XX, XY, YX, YY };
|
enum components { XX, XY, YX, YY };
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline Tensor2D();
|
Tensor2D() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
Tensor2D(const Tensor2D&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
Tensor2D& operator=(const Tensor2D&) = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct initialized to zero
|
//- Construct initialized to zero
|
||||||
inline Tensor2D(const Foam::zero);
|
inline Tensor2D(const Foam::zero);
|
||||||
|
|||||||
@ -28,11 +28,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Cmpt>
|
|
||||||
inline Foam::Tensor2D<Cmpt>::Tensor2D()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::Tensor2D<Cmpt>::Tensor2D(const Foam::zero)
|
inline Foam::Tensor2D<Cmpt>::Tensor2D(const Foam::zero)
|
||||||
:
|
:
|
||||||
|
|||||||
@ -80,10 +80,19 @@ public:
|
|||||||
enum components { X, Y, Z };
|
enum components { X, Y, Z };
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline Vector();
|
Vector() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
Vector(const Vector&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
Vector& operator=(const Vector&) = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct initialized to zero
|
//- Construct initialized to zero
|
||||||
inline Vector(const Foam::zero);
|
inline Vector(const Foam::zero);
|
||||||
|
|||||||
@ -28,11 +28,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Cmpt>
|
|
||||||
inline Foam::Vector<Cmpt>::Vector()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::Vector<Cmpt>::Vector(const Foam::zero)
|
inline Foam::Vector<Cmpt>::Vector(const Foam::zero)
|
||||||
:
|
:
|
||||||
|
|||||||
@ -73,10 +73,19 @@ public:
|
|||||||
enum components { X, Y };
|
enum components { X, Y };
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline Vector2D();
|
Vector2D() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
Vector2D(const Vector2D&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
Vector2D& operator=(const Vector2D&) = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct initialized to zero
|
//- Construct initialized to zero
|
||||||
inline Vector2D(const Foam::zero);
|
inline Vector2D(const Foam::zero);
|
||||||
|
|||||||
@ -28,11 +28,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Cmpt>
|
|
||||||
inline Foam::Vector2D<Cmpt>::Vector2D()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Cmpt>
|
template<class Cmpt>
|
||||||
inline Foam::Vector2D<Cmpt>::Vector2D(const Foam::zero)
|
inline Foam::Vector2D<Cmpt>::Vector2D(const Foam::zero)
|
||||||
:
|
:
|
||||||
|
|||||||
@ -90,14 +90,26 @@ class complex
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
complex(const complex&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
complex& operator=(const complex&) = default;
|
||||||
|
|
||||||
|
//- Move construct
|
||||||
|
complex(complex&&) = default;
|
||||||
|
|
||||||
|
//- Move assignment
|
||||||
|
complex& operator=(complex&&) = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null as zero-initialized
|
//- Default construct, as zero-initialized
|
||||||
inline constexpr complex() noexcept;
|
inline constexpr complex() noexcept;
|
||||||
|
|
||||||
//- Default copy constructor
|
|
||||||
complex(const complex&) = default;
|
|
||||||
|
|
||||||
//- Construct zero-initialized from zero class
|
//- Construct zero-initialized from zero class
|
||||||
inline constexpr complex(const Foam::zero) noexcept;
|
inline constexpr complex(const Foam::zero) noexcept;
|
||||||
|
|
||||||
@ -173,9 +185,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Copy assignment
|
|
||||||
inline void operator=(const complex& c);
|
|
||||||
|
|
||||||
//- Assign zero
|
//- Assign zero
|
||||||
inline void operator=(const Foam::zero);
|
inline void operator=(const Foam::zero);
|
||||||
|
|
||||||
|
|||||||
@ -116,13 +116,6 @@ inline Foam::complex Foam::complex::conjugate() const
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline void Foam::complex::operator=(const complex& c)
|
|
||||||
{
|
|
||||||
re = c.re;
|
|
||||||
im = c.im;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline void Foam::complex::operator=(const Foam::zero)
|
inline void Foam::complex::operator=(const Foam::zero)
|
||||||
{
|
{
|
||||||
re = 0;
|
re = 0;
|
||||||
|
|||||||
@ -63,18 +63,21 @@ class Uniform
|
|||||||
:
|
:
|
||||||
public Constant<Type>
|
public Constant<Type>
|
||||||
{
|
{
|
||||||
// Private Member Functions
|
public:
|
||||||
|
|
||||||
|
//- Declare type-name, virtual type (with debug switch)
|
||||||
|
TypeName("uniform");
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
Uniform<Type>(const Uniform&) = default;
|
||||||
|
|
||||||
//- No copy assignment
|
//- No copy assignment
|
||||||
void operator=(const Uniform<Type>&) = delete;
|
void operator=(const Uniform<Type>&) = delete;
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Runtime type information
|
|
||||||
TypeName("uniform");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from entry name and dictionary
|
//- Construct from entry name and dictionary
|
||||||
|
|||||||
@ -43,18 +43,6 @@ Foam::Polynomial<PolySize>::Polynomial()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<int PolySize>
|
|
||||||
Foam::Polynomial<PolySize>::Polynomial
|
|
||||||
(
|
|
||||||
const Polynomial<PolySize>& poly
|
|
||||||
)
|
|
||||||
:
|
|
||||||
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(poly),
|
|
||||||
logActive_(poly.logActive_),
|
|
||||||
logCoeff_(poly.logCoeff_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<int PolySize>
|
template<int PolySize>
|
||||||
Foam::Polynomial<PolySize>::Polynomial(const scalar coeffs[PolySize])
|
Foam::Polynomial<PolySize>::Polynomial(const scalar coeffs[PolySize])
|
||||||
:
|
:
|
||||||
|
|||||||
@ -108,9 +108,6 @@ public:
|
|||||||
//- Construct null, with all coefficients = 0.0
|
//- Construct null, with all coefficients = 0.0
|
||||||
Polynomial();
|
Polynomial();
|
||||||
|
|
||||||
//- Copy constructor
|
|
||||||
Polynomial(const Polynomial&);
|
|
||||||
|
|
||||||
//- Construct from C-array of coefficients
|
//- Construct from C-array of coefficients
|
||||||
explicit Polynomial(const scalar coeffs[PolySize]);
|
explicit Polynomial(const scalar coeffs[PolySize]);
|
||||||
|
|
||||||
|
|||||||
@ -88,6 +88,16 @@ public:
|
|||||||
static const vectorTensorTransform I;
|
static const vectorTensorTransform I;
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
vectorTensorTransform(const vectorTensorTransform&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
vectorTensorTransform&
|
||||||
|
operator=(const vectorTensorTransform&) = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
//- Construct null
|
||||||
@ -151,11 +161,11 @@ public:
|
|||||||
tmp<Field<Type>> transform(const Field<Type>&) const;
|
tmp<Field<Type>> transform(const Field<Type>&) const;
|
||||||
|
|
||||||
|
|
||||||
// Member operators
|
// Member Operators
|
||||||
|
|
||||||
inline void operator=(const vectorTensorTransform&);
|
|
||||||
inline void operator&=(const vectorTensorTransform&);
|
inline void operator&=(const vectorTensorTransform&);
|
||||||
|
|
||||||
|
//- Assign translation
|
||||||
inline void operator=(const vector&);
|
inline void operator=(const vector&);
|
||||||
inline void operator+=(const vector&);
|
inline void operator+=(const vector&);
|
||||||
inline void operator-=(const vector&);
|
inline void operator-=(const vector&);
|
||||||
|
|||||||
@ -173,17 +173,6 @@ inline Foam::pointField Foam::vectorTensorTransform::invTransformPosition
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline void Foam::vectorTensorTransform::operator=
|
|
||||||
(
|
|
||||||
const vectorTensorTransform& tr
|
|
||||||
)
|
|
||||||
{
|
|
||||||
t_ = tr.t_;
|
|
||||||
R_ = tr.R_;
|
|
||||||
hasR_ = tr.hasR_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline void Foam::vectorTensorTransform::operator&=
|
inline void Foam::vectorTensorTransform::operator&=
|
||||||
(
|
(
|
||||||
const vectorTensorTransform& tr
|
const vectorTensorTransform& tr
|
||||||
|
|||||||
@ -68,7 +68,7 @@ static inline uint32_t swapBytes(uint32_t n)
|
|||||||
// *(uint32_t *) cp = val
|
// *(uint32_t *) cp = val
|
||||||
static inline void set_uint32(unsigned char *dst, uint32_t v)
|
static inline void set_uint32(unsigned char *dst, uint32_t v)
|
||||||
{
|
{
|
||||||
memcpy(dst, &v, sizeof(uint32_t));
|
std::memcpy(dst, &v, sizeof(uint32_t));
|
||||||
}
|
}
|
||||||
//! \endcond
|
//! \endcond
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ void Foam::SHA1::processBytes(const void *data, size_t len)
|
|||||||
|
|
||||||
unsigned char* bufp = reinterpret_cast<unsigned char*>(buffer_);
|
unsigned char* bufp = reinterpret_cast<unsigned char*>(buffer_);
|
||||||
|
|
||||||
memcpy(&bufp[remaining], data, add);
|
std::memcpy(&bufp[remaining], data, add);
|
||||||
bufLen_ += add;
|
bufLen_ += add;
|
||||||
|
|
||||||
if (bufLen_ > 64)
|
if (bufLen_ > 64)
|
||||||
@ -106,7 +106,7 @@ void Foam::SHA1::processBytes(const void *data, size_t len)
|
|||||||
bufLen_ &= 63;
|
bufLen_ &= 63;
|
||||||
// The regions in the following copy operation do not
|
// The regions in the following copy operation do not
|
||||||
// (cannot) overlap
|
// (cannot) overlap
|
||||||
memcpy(buffer_, &bufp[(remaining + add) & ~63], bufLen_);
|
std::memcpy(buffer_, &bufp[(remaining + add) & ~63], bufLen_);
|
||||||
}
|
}
|
||||||
|
|
||||||
data = reinterpret_cast<const unsigned char*>(data) + add;
|
data = reinterpret_cast<const unsigned char*>(data) + add;
|
||||||
@ -116,7 +116,7 @@ void Foam::SHA1::processBytes(const void *data, size_t len)
|
|||||||
// Process available complete blocks
|
// Process available complete blocks
|
||||||
while (len >= 64)
|
while (len >= 64)
|
||||||
{
|
{
|
||||||
processBlock(memcpy(buffer_, data, 64), 64);
|
processBlock(std::memcpy(buffer_, data, 64), 64);
|
||||||
data = reinterpret_cast<const unsigned char*>(data) + 64;
|
data = reinterpret_cast<const unsigned char*>(data) + 64;
|
||||||
len -= 64;
|
len -= 64;
|
||||||
}
|
}
|
||||||
@ -127,13 +127,13 @@ void Foam::SHA1::processBytes(const void *data, size_t len)
|
|||||||
unsigned char* bufp = reinterpret_cast<unsigned char*>(buffer_);
|
unsigned char* bufp = reinterpret_cast<unsigned char*>(buffer_);
|
||||||
size_t remaining = bufLen_;
|
size_t remaining = bufLen_;
|
||||||
|
|
||||||
memcpy(&bufp[remaining], data, len);
|
std::memcpy(&bufp[remaining], data, len);
|
||||||
remaining += len;
|
remaining += len;
|
||||||
if (remaining >= 64)
|
if (remaining >= 64)
|
||||||
{
|
{
|
||||||
processBlock(buffer_, 64);
|
processBlock(buffer_, 64);
|
||||||
remaining -= 64;
|
remaining -= 64;
|
||||||
memcpy(buffer_, &buffer_[16], remaining);
|
std::memcpy(buffer_, &buffer_[16], remaining);
|
||||||
}
|
}
|
||||||
bufLen_ = remaining;
|
bufLen_ = remaining;
|
||||||
}
|
}
|
||||||
@ -356,7 +356,7 @@ bool Foam::SHA1::finalize()
|
|||||||
|
|
||||||
unsigned char* bufp = reinterpret_cast<unsigned char *>(buffer_);
|
unsigned char* bufp = reinterpret_cast<unsigned char *>(buffer_);
|
||||||
|
|
||||||
memcpy(&bufp[bytes], fillbuf, (size-2) * sizeof(uint32_t) - bytes);
|
std::memcpy(&bufp[bytes], fillbuf, (size-2) * sizeof(uint32_t) - bytes);
|
||||||
|
|
||||||
// Process remaining bytes
|
// Process remaining bytes
|
||||||
processBlock(buffer_, size * sizeof(uint32_t));
|
processBlock(buffer_, size * sizeof(uint32_t));
|
||||||
|
|||||||
@ -128,10 +128,19 @@ public:
|
|||||||
static const quaternion I;
|
static const quaternion I;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
inline quaternion();
|
quaternion() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
quaternion(const quaternion&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
quaternion& operator=(const quaternion&) = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct zero initialized
|
//- Construct zero initialized
|
||||||
inline quaternion(const Foam::zero);
|
inline quaternion(const Foam::zero);
|
||||||
@ -223,7 +232,6 @@ public:
|
|||||||
|
|
||||||
// Member Operators
|
// Member Operators
|
||||||
|
|
||||||
inline void operator=(const quaternion& q);
|
|
||||||
inline void operator+=(const quaternion& q);
|
inline void operator+=(const quaternion& q);
|
||||||
inline void operator-=(const quaternion& q);
|
inline void operator-=(const quaternion& q);
|
||||||
inline void operator*=(const quaternion& q);
|
inline void operator*=(const quaternion& q);
|
||||||
|
|||||||
@ -28,10 +28,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline Foam::quaternion::quaternion()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::quaternion::quaternion(const Foam::zero)
|
inline Foam::quaternion::quaternion(const Foam::zero)
|
||||||
:
|
:
|
||||||
w_(Zero),
|
w_(Zero),
|
||||||
@ -585,12 +581,6 @@ inline Foam::vector Foam::quaternion::eulerAngles
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline void Foam::quaternion::operator=(const quaternion& q)
|
|
||||||
{
|
|
||||||
w_ = q.w_;
|
|
||||||
v_ = q.v_;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void Foam::quaternion::operator+=(const quaternion& q)
|
inline void Foam::quaternion::operator+=(const quaternion& q)
|
||||||
{
|
{
|
||||||
w_ += q.w_;
|
w_ += q.w_;
|
||||||
|
|||||||
@ -40,13 +40,9 @@ Foam::Random::Random(const label seedValue)
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
Foam::Random::Random(const Random& r, const bool reset)
|
Foam::Random::Random(const Random& rnd, const bool reset)
|
||||||
:
|
:
|
||||||
seed_(r.seed_),
|
Random(rnd)
|
||||||
generator_(r.generator_),
|
|
||||||
uniform01_(),
|
|
||||||
hasGaussSample_(r.hasGaussSample_),
|
|
||||||
gaussSample_(r.gaussSample_)
|
|
||||||
{
|
{
|
||||||
if (reset)
|
if (reset)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -90,12 +90,8 @@ public:
|
|||||||
//- Construct with seed value
|
//- Construct with seed value
|
||||||
Random(const label seedValue = 123456);
|
Random(const label seedValue = 123456);
|
||||||
|
|
||||||
//- Copy construct with optional reset of seed
|
//- Copy construct with possible reset of seed
|
||||||
Random(const Random& r, const bool reset = false);
|
Random(const Random& rnd, const bool reset);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
~Random() = default;
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -86,10 +86,22 @@ public:
|
|||||||
static const septernion I;
|
static const septernion I;
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Default construct
|
||||||
|
septernion() = default;
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
septernion(const septernion&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
septernion& operator=(const septernion&) = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
//- Construct zero initialized
|
||||||
inline septernion();
|
inline septernion(const Foam::zero);
|
||||||
|
|
||||||
//- Construct given a translation vector and rotation quaternion
|
//- Construct given a translation vector and rotation quaternion
|
||||||
inline septernion(const vector& t, const quaternion& r);
|
inline septernion(const vector& t, const quaternion& r);
|
||||||
@ -130,9 +142,8 @@ public:
|
|||||||
inline vector invTransformPoint(const vector& v) const;
|
inline vector invTransformPoint(const vector& v) const;
|
||||||
|
|
||||||
|
|
||||||
// Member operators
|
// Member Operators
|
||||||
|
|
||||||
inline void operator=(const septernion&);
|
|
||||||
inline void operator*=(const septernion&);
|
inline void operator*=(const septernion&);
|
||||||
|
|
||||||
inline void operator=(const vector&);
|
inline void operator=(const vector&);
|
||||||
|
|||||||
@ -27,7 +27,10 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline Foam::septernion::septernion()
|
inline Foam::septernion::septernion(const Foam::zero)
|
||||||
|
:
|
||||||
|
t_(Zero),
|
||||||
|
r_(Zero)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
inline Foam::septernion::septernion(const vector& t, const quaternion& r)
|
inline Foam::septernion::septernion(const vector& t, const quaternion& r)
|
||||||
@ -95,12 +98,6 @@ inline Foam::vector Foam::septernion::invTransformPoint(const vector& v) const
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline void Foam::septernion::operator=(const septernion& tr)
|
|
||||||
{
|
|
||||||
t_ = tr.t_;
|
|
||||||
r_ = tr.r_;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void Foam::septernion::operator*=(const septernion& tr)
|
inline void Foam::septernion::operator*=(const septernion& tr)
|
||||||
{
|
{
|
||||||
t_ = tr.t() + tr.r().invTransform(t_);
|
t_ = tr.t() + tr.r().invTransform(t_);
|
||||||
|
|||||||
@ -574,7 +574,7 @@ void Foam::UPstream::allToAll
|
|||||||
<< " does not equal bytes to receive " << recvSizes[0]
|
<< " does not equal bytes to receive " << recvSizes[0]
|
||||||
<< Foam::abort(FatalError);
|
<< Foam::abort(FatalError);
|
||||||
}
|
}
|
||||||
memmove(recvData, &sendData[sendOffsets[0]], recvSizes[0]);
|
std::memmove(recvData, &sendData[sendOffsets[0]], recvSizes[0]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -640,7 +640,7 @@ void Foam::UPstream::gather
|
|||||||
|
|
||||||
if (!UPstream::parRun())
|
if (!UPstream::parRun())
|
||||||
{
|
{
|
||||||
memmove(recvData, sendData, sendSize);
|
std::memmove(recvData, sendData, sendSize);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -703,7 +703,7 @@ void Foam::UPstream::scatter
|
|||||||
|
|
||||||
if (!UPstream::parRun())
|
if (!UPstream::parRun())
|
||||||
{
|
{
|
||||||
memmove(recvData, sendData, recvSize);
|
std::memmove(recvData, sendData, recvSize);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -59,34 +59,14 @@ Foam::boundaryPatch::boundaryPatch
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
Foam::boundaryPatch::boundaryPatch(const boundaryPatch& p)
|
|
||||||
:
|
|
||||||
patchIdentifier(p.name(), p.index(), p.physicalType()),
|
|
||||||
size_(p.size()),
|
|
||||||
start_(p.start())
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::boundaryPatch::boundaryPatch(const boundaryPatch& p, const label index)
|
Foam::boundaryPatch::boundaryPatch(const boundaryPatch& p, const label index)
|
||||||
:
|
:
|
||||||
patchIdentifier(p.name(), index, p.physicalType()),
|
boundaryPatch(p)
|
||||||
size_(p.size()),
|
|
||||||
start_(p.start())
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::boundaryPatch> Foam::boundaryPatch::clone() const
|
|
||||||
{
|
{
|
||||||
return autoPtr<boundaryPatch>::New(*this);
|
patchIdentifier::index() = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::boundaryPatch::~boundaryPatch()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::boundaryPatch::write(Ostream& os) const
|
void Foam::boundaryPatch::write(Ostream& os) const
|
||||||
|
|||||||
@ -88,18 +88,15 @@ public:
|
|||||||
const label index
|
const label index
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct as copy
|
//- Copy construct, resetting the index
|
||||||
boundaryPatch(const boundaryPatch&);
|
boundaryPatch(const boundaryPatch& p, const label index);
|
||||||
|
|
||||||
//- Construct as copy, resetting the index
|
|
||||||
boundaryPatch(const boundaryPatch&, const label index);
|
|
||||||
|
|
||||||
//- Clone
|
//- Clone
|
||||||
autoPtr<boundaryPatch> clone() const;
|
autoPtr<boundaryPatch> clone() const
|
||||||
|
{
|
||||||
|
return autoPtr<boundaryPatch>::New(*this);
|
||||||
//- Destructor
|
}
|
||||||
~boundaryPatch();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -141,9 +141,6 @@ public:
|
|||||||
const vector& n
|
const vector& n
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct as copy
|
|
||||||
inline directionInfo(const directionInfo&);
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -51,14 +51,6 @@ inline Foam::directionInfo::directionInfo
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct as copy
|
|
||||||
inline Foam::directionInfo::directionInfo(const directionInfo& w2)
|
|
||||||
:
|
|
||||||
index_(w2.index()),
|
|
||||||
n_(w2.n())
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class TrackingData>
|
template<class TrackingData>
|
||||||
|
|||||||
@ -89,8 +89,7 @@ public:
|
|||||||
//- Construct from normal
|
//- Construct from normal
|
||||||
inline wallNormalInfo(const vector& normal);
|
inline wallNormalInfo(const vector& normal);
|
||||||
|
|
||||||
//- Construct as copy
|
|
||||||
inline wallNormalInfo(const wallNormalInfo&);
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -74,13 +74,6 @@ inline Foam::wallNormalInfo::wallNormalInfo(const vector& normal)
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct as copy
|
|
||||||
inline Foam::wallNormalInfo::wallNormalInfo(const wallNormalInfo& wpt)
|
|
||||||
:
|
|
||||||
normal_(wpt.normal())
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline const Foam::vector& Foam::wallNormalInfo::normal() const
|
inline const Foam::vector& Foam::wallNormalInfo::normal() const
|
||||||
|
|||||||
@ -124,9 +124,6 @@ public:
|
|||||||
//- Construct from origin, distance
|
//- Construct from origin, distance
|
||||||
inline externalPointEdgePoint(const point&, const scalar);
|
inline externalPointEdgePoint(const point&, const scalar);
|
||||||
|
|
||||||
//- Construct as copy
|
|
||||||
inline externalPointEdgePoint(const externalPointEdgePoint&);
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -135,16 +135,6 @@ inline Foam::externalPointEdgePoint::externalPointEdgePoint
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
inline Foam::externalPointEdgePoint::externalPointEdgePoint
|
|
||||||
(
|
|
||||||
const externalPointEdgePoint& wpt
|
|
||||||
)
|
|
||||||
:
|
|
||||||
origin_(wpt.origin()),
|
|
||||||
distSqr_(wpt.distSqr())
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline const Foam::point& Foam::externalPointEdgePoint::origin() const
|
inline const Foam::point& Foam::externalPointEdgePoint::origin() const
|
||||||
|
|||||||
@ -112,6 +112,12 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
ignitionSite(const ignitionSite&) = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from Istream and database
|
//- Construct from Istream and database
|
||||||
|
|||||||
@ -166,19 +166,15 @@ Foam::Ostream& Foam::ensightFile::write
|
|||||||
|
|
||||||
Foam::Ostream& Foam::ensightFile::write(const char* value)
|
Foam::Ostream& Foam::ensightFile::write(const char* value)
|
||||||
{
|
{
|
||||||
// Parentheses around strncpy to silence the GCC -Wstringop-truncation
|
// Output 80 chars, but allocate for trailing nul character
|
||||||
// warning, which is spurious here.
|
// to avoid -Wstringop-truncation warnings/errors.
|
||||||
// The max-size and buffer-size *are* identical, which means the buffer
|
|
||||||
// may not have a nul terminator. However, this is properly handled in
|
|
||||||
// the subsequent binary write and the ASCII write explicitly adds
|
|
||||||
// a nul terminator.
|
|
||||||
|
|
||||||
char buf[80];
|
char buf[80+1];
|
||||||
(strncpy(buf, value, 80)); // max 80 chars or padded with nul if smaller
|
strncpy(buf, value, 80); // max 80 chars or padded with nul if smaller
|
||||||
|
|
||||||
if (format() == IOstream::BINARY)
|
if (format() == IOstream::BINARY)
|
||||||
{
|
{
|
||||||
write(buf, sizeof(buf));
|
write(buf, 80);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -111,10 +111,7 @@ Foam::zeroGradientFaPatchField<Type>::valueInternalCoeffs
|
|||||||
const tmp<scalarField>&
|
const tmp<scalarField>&
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return tmp<Field<Type>>
|
return tmp<Field<Type>>::New(this->size(), pTraits<Type>::one);
|
||||||
(
|
|
||||||
new Field<Type>(this->size(), Zero)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -125,10 +122,7 @@ Foam::zeroGradientFaPatchField<Type>::valueBoundaryCoeffs
|
|||||||
const tmp<scalarField>&
|
const tmp<scalarField>&
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return tmp<Field<Type>>
|
return tmp<Field<Type>>::New(this->size(), Zero);
|
||||||
(
|
|
||||||
new Field<Type>(this->size(), Zero)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -136,10 +130,7 @@ template<class Type>
|
|||||||
Foam::tmp<Foam::Field<Type>>
|
Foam::tmp<Foam::Field<Type>>
|
||||||
Foam::zeroGradientFaPatchField<Type>::gradientInternalCoeffs() const
|
Foam::zeroGradientFaPatchField<Type>::gradientInternalCoeffs() const
|
||||||
{
|
{
|
||||||
return tmp<Field<Type>>
|
return tmp<Field<Type>>::New(this->size(), Zero);
|
||||||
(
|
|
||||||
new Field<Type>(this->size(), Zero)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -147,10 +138,7 @@ template<class Type>
|
|||||||
Foam::tmp<Foam::Field<Type>>
|
Foam::tmp<Foam::Field<Type>>
|
||||||
Foam::zeroGradientFaPatchField<Type>::gradientBoundaryCoeffs() const
|
Foam::zeroGradientFaPatchField<Type>::gradientBoundaryCoeffs() const
|
||||||
{
|
{
|
||||||
return tmp<Field<Type>>
|
return tmp<Field<Type>>::New(this->size(), Zero);
|
||||||
(
|
|
||||||
new Field<Type>(this->size(), Zero)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2019 OpenCFD Ltd.
|
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -96,11 +96,11 @@ Foam::turbulentDigitalFilterInletFvPatchVectorField::patchIndexPairs()
|
|||||||
const vector nf(computePatchNormal());
|
const vector nf(computePatchNormal());
|
||||||
|
|
||||||
// Find the second local coordinate direction
|
// Find the second local coordinate direction
|
||||||
direction minCmpt = -1;
|
direction minCmpt = 0;
|
||||||
scalar minMag = VGREAT;
|
scalar minMag = mag(nf[minCmpt]);
|
||||||
for (direction cmpt = 0; cmpt < pTraits<vector>::nComponents; ++cmpt)
|
for (direction cmpt = 1; cmpt < pTraits<vector>::nComponents; ++cmpt)
|
||||||
{
|
{
|
||||||
scalar s = mag(nf[cmpt]);
|
const scalar s = mag(nf[cmpt]);
|
||||||
if (s < minMag)
|
if (s < minMag)
|
||||||
{
|
{
|
||||||
minMag = s;
|
minMag = s;
|
||||||
@ -110,7 +110,7 @@ Foam::turbulentDigitalFilterInletFvPatchVectorField::patchIndexPairs()
|
|||||||
|
|
||||||
// Create the second local coordinate direction
|
// Create the second local coordinate direction
|
||||||
vector e2(Zero);
|
vector e2(Zero);
|
||||||
e2[minCmpt] = 1.0;
|
e2[minCmpt] = 1;
|
||||||
|
|
||||||
// Remove normal component
|
// Remove normal component
|
||||||
e2 -= (nf&e2)*nf;
|
e2 -= (nf&e2)*nf;
|
||||||
@ -147,17 +147,14 @@ Foam::turbulentDigitalFilterInletFvPatchVectorField::patchIndexPairs()
|
|||||||
// Compute virtual-actual patch index pairs
|
// Compute virtual-actual patch index pairs
|
||||||
List<Pair<label>> indexPairs(this->size(), Pair<label>(Zero, Zero));
|
List<Pair<label>> indexPairs(this->size(), Pair<label>(Zero, Zero));
|
||||||
|
|
||||||
// Virtual turbulence plane indices
|
|
||||||
label j = 0;
|
|
||||||
label k = 0;
|
|
||||||
|
|
||||||
forAll(*this, facei)
|
forAll(*this, facei)
|
||||||
{
|
{
|
||||||
const scalar& centre0 = localPos[facei][0];
|
const scalar& centre0 = localPos[facei][0];
|
||||||
const scalar& centre1 = localPos[facei][1];
|
const scalar& centre1 = localPos[facei][1];
|
||||||
|
|
||||||
j = label((centre0 - localMinPt[0])*invDelta_[0]);
|
// Virtual turbulence plane indices
|
||||||
k = label((centre1 - localMinPt[1])*invDelta_[1]);
|
const label j = label((centre0 - localMinPt[0])*invDelta_[0]);
|
||||||
|
const label k = label((centre1 - localMinPt[1])*invDelta_[1]);
|
||||||
|
|
||||||
indexPairs[facei] = Pair<label>(facei, k*n[0] + j);
|
indexPairs[facei] = Pair<label>(facei, k*n[0] + j);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,6 +83,15 @@ private:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
smoothData(const smoothData&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
smoothData& operator=(const smoothData&) = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
//- Construct null
|
||||||
|
|||||||
@ -68,6 +68,15 @@ class sweepData
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Generated Methods
|
||||||
|
|
||||||
|
//- Copy construct
|
||||||
|
sweepData(const sweepData&) = default;
|
||||||
|
|
||||||
|
//- Copy assignment
|
||||||
|
sweepData& operator=(const sweepData&) = default;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
//- Construct null
|
||||||
|
|||||||
@ -29,9 +29,9 @@ inline Foam::HashSet<Foam::wordRe>
|
|||||||
Foam::functionObjects::fieldSelection::filters() const
|
Foam::functionObjects::fieldSelection::filters() const
|
||||||
{
|
{
|
||||||
HashSet<wordRe> f;
|
HashSet<wordRe> f;
|
||||||
for (const auto fieldInfo : *this)
|
for (const fieldInfo& fi : *this)
|
||||||
{
|
{
|
||||||
f.insert(fieldInfo.name());
|
f.insert(fi.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
return f;
|
return f;
|
||||||
|
|||||||
@ -29,14 +29,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::referredWallFace::referredWallFace()
|
|
||||||
:
|
|
||||||
face(),
|
|
||||||
pts_(),
|
|
||||||
patchi_()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::referredWallFace::referredWallFace
|
Foam::referredWallFace::referredWallFace
|
||||||
(
|
(
|
||||||
const face& f,
|
const face& f,
|
||||||
@ -57,27 +49,6 @@ Foam::referredWallFace::referredWallFace
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::referredWallFace::referredWallFace(const referredWallFace& rWF)
|
|
||||||
:
|
|
||||||
face(rWF),
|
|
||||||
pts_(rWF.pts_),
|
|
||||||
patchi_(rWF.patchi_)
|
|
||||||
{
|
|
||||||
if (this->size() != pts_.size())
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Face and pointField are not the same size. " << nl << (*this)
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::referredWallFace::~referredWallFace()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool Foam::referredWallFace::operator==(const referredWallFace& rhs) const
|
bool Foam::referredWallFace::operator==(const referredWallFace& rhs) const
|
||||||
|
|||||||
@ -76,10 +76,13 @@ class referredWallFace
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
referredWallFace();
|
referredWallFace() = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
referredWallFace
|
referredWallFace
|
||||||
@ -89,13 +92,6 @@ public:
|
|||||||
label patchi
|
label patchi
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct as copy
|
|
||||||
referredWallFace(const referredWallFace&);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
~referredWallFace();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -76,7 +76,7 @@ bool Foam::ensightOutput::writeCloudField
|
|||||||
IPstream fromSlave(comm, slave);
|
IPstream fromSlave(comm, slave);
|
||||||
Field<Type> recv(fromSlave);
|
Field<Type> recv(fromSlave);
|
||||||
|
|
||||||
for (Type val : field) // <-- working on a copy
|
for (Type val : recv) // <-- working on a copy
|
||||||
{
|
{
|
||||||
if (mag(val) < 1e-90) // approximately root(ROOTVSMALL)
|
if (mag(val) < 1e-90) // approximately root(ROOTVSMALL)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -30,14 +30,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class PairType, class WallType>
|
|
||||||
Foam::CollisionRecordList<PairType, WallType>::CollisionRecordList()
|
|
||||||
:
|
|
||||||
pairRecords_(),
|
|
||||||
wallRecords_()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class PairType, class WallType>
|
template<class PairType, class WallType>
|
||||||
Foam::CollisionRecordList<PairType, WallType>::CollisionRecordList(Istream& is)
|
Foam::CollisionRecordList<PairType, WallType>::CollisionRecordList(Istream& is)
|
||||||
:
|
:
|
||||||
@ -122,13 +114,6 @@ Foam::CollisionRecordList<PairType, WallType>::CollisionRecordList
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * /
|
|
||||||
|
|
||||||
template<class PairType, class WallType>
|
|
||||||
Foam::CollisionRecordList<PairType, WallType>::~CollisionRecordList()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class PairType, class WallType>
|
template<class PairType, class WallType>
|
||||||
@ -385,27 +370,6 @@ void Foam::CollisionRecordList<PairType, WallType>::update()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class PairType, class WallType>
|
|
||||||
void Foam::CollisionRecordList<PairType, WallType>::operator=
|
|
||||||
(
|
|
||||||
const CollisionRecordList<PairType, WallType>& rhs
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// Check for assignment to self
|
|
||||||
if (this == &rhs)
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Attempted assignment to self"
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
pairRecords_ = rhs.pairRecords_;
|
|
||||||
wallRecords_ = rhs.wallRecords_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class PairType, class WallType>
|
template<class PairType, class WallType>
|
||||||
|
|||||||
@ -90,10 +90,13 @@ class CollisionRecordList
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Generated Methods
|
||||||
|
|
||||||
//- Construct null
|
//- Default construct
|
||||||
CollisionRecordList();
|
CollisionRecordList() = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
CollisionRecordList(Istream&);
|
CollisionRecordList(Istream&);
|
||||||
@ -110,9 +113,6 @@ public:
|
|||||||
const Field<WallType>& wallData
|
const Field<WallType>& wallData
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
~CollisionRecordList();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
@ -196,11 +196,6 @@ public:
|
|||||||
void update();
|
void update();
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
void operator=(const CollisionRecordList&);
|
|
||||||
|
|
||||||
|
|
||||||
// Friend Operators
|
// Friend Operators
|
||||||
|
|
||||||
friend bool operator== <PairType, WallType>
|
friend bool operator== <PairType, WallType>
|
||||||
|
|||||||
@ -188,16 +188,6 @@ Foam::phaseProperties::phaseProperties()
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
Foam::phaseProperties::phaseProperties(const phaseProperties& pp)
|
|
||||||
:
|
|
||||||
phase_(pp.phase_),
|
|
||||||
stateLabel_(pp.stateLabel_),
|
|
||||||
names_(pp.names_),
|
|
||||||
Y_(pp.Y_),
|
|
||||||
carrierIds_(pp.carrierIds_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::phaseProperties::reorder
|
void Foam::phaseProperties::reorder
|
||||||
|
|||||||
@ -124,13 +124,6 @@ public:
|
|||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
phaseProperties(Istream& is);
|
phaseProperties(Istream& is);
|
||||||
|
|
||||||
//- Construct as copy
|
|
||||||
phaseProperties(const phaseProperties& pp);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
~phaseProperties() = default;
|
|
||||||
|
|
||||||
|
|
||||||
// Public Member Functions
|
// Public Member Functions
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user