Compare commits
31 Commits
wip-primit
...
issue-2966
| Author | SHA1 | Date | |
|---|---|---|---|
| d9f3dd00ff | |||
| 81475e3be1 | |||
| cc6bdb7ce5 | |||
| 77cb50ae97 | |||
| d189f95c7d | |||
| bc7053dbf9 | |||
| b087bc52de | |||
| 69f2c34e5f | |||
| 4dda01f161 | |||
| a7e464a70a | |||
| f40d60aa78 | |||
| 12e7bba017 | |||
| ee66a09a72 | |||
| f1ac837448 | |||
| 7dcab65ffd | |||
| ff8cdfa7de | |||
| da5048fd70 | |||
| 555d76bb7b | |||
| 546e2c0243 | |||
| b4324b1297 | |||
| b12839ffc3 | |||
| 3f5c240cdb | |||
| 50420f755c | |||
| 2d8870a878 | |||
| 8221721d44 | |||
| f4ccdec894 | |||
| 0f7277fd5e | |||
| 2f5da5af4b | |||
| e95f8b1a8d | |||
| 5d8e43e86e | |||
| f53c9dd6da |
4
Allwmake
4
Allwmake
@ -73,10 +73,10 @@ echo
|
||||
applications/Allwmake $targetType $*
|
||||
|
||||
# Additional components/modules
|
||||
if [ "$FOAM_MODULE_PREFIX" = false ]
|
||||
if [ "$FOAM_MODULE_PREFIX" = false ] || [ "$FOAM_MODULE_PREFIX" = none ]
|
||||
then
|
||||
echo "========================================"
|
||||
echo "OpenFOAM modules disabled (prefix=false)"
|
||||
echo "OpenFOAM modules disabled (prefix=${FOAM_MODULE_PREFIX})"
|
||||
echo
|
||||
elif [ -d "$WM_PROJECT_DIR/modules" ]
|
||||
then
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
api=2012
|
||||
patch=210618
|
||||
patch=220610
|
||||
|
||||
@ -53,8 +53,8 @@ Usage
|
||||
-rotate-angle (vector angle)
|
||||
Rotate angle degrees about vector axis.
|
||||
|
||||
or -yawPitchRoll (yawdegrees pitchdegrees rolldegrees)
|
||||
or -rollPitchYaw (rolldegrees pitchdegrees yawdegrees)
|
||||
or -yawPitchRoll : (yaw pitch roll) degrees
|
||||
or -rollPitchYaw : (roll pitch yaw) degrees
|
||||
|
||||
-scale scalar|vector
|
||||
Scale the points by the given scalar or vector on output.
|
||||
@ -251,15 +251,18 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
"auto-origin",
|
||||
"Use bounding box centre as origin for rotations"
|
||||
"auto-centre",
|
||||
"Use bounding box centre as centre for rotations"
|
||||
);
|
||||
argList::addOption
|
||||
(
|
||||
"origin",
|
||||
"centre",
|
||||
"point",
|
||||
"Use specified <point> as origin for rotations"
|
||||
"Use specified <point> as centre for rotations"
|
||||
);
|
||||
argList::addOptionCompat("auto-centre", {"auto-origin", 2206});
|
||||
argList::addOptionCompat("centre", {"origin", 2206});
|
||||
|
||||
argList::addOption
|
||||
(
|
||||
"rotate",
|
||||
@ -390,18 +393,18 @@ int main(int argc, char *argv[])
|
||||
points += v;
|
||||
}
|
||||
|
||||
vector origin;
|
||||
bool useOrigin = args.readIfPresent("origin", origin);
|
||||
if (args.found("auto-origin") && !useOrigin)
|
||||
vector rotationCentre;
|
||||
bool useRotationCentre = args.readIfPresent("centre", rotationCentre);
|
||||
if (args.found("auto-centre") && !useRotationCentre)
|
||||
{
|
||||
useOrigin = true;
|
||||
origin = boundBox(points).centre();
|
||||
useRotationCentre = true;
|
||||
rotationCentre = boundBox(points).centre();
|
||||
}
|
||||
|
||||
if (useOrigin)
|
||||
if (useRotationCentre)
|
||||
{
|
||||
Info<< "Set origin for rotations to " << origin << endl;
|
||||
points -= origin;
|
||||
Info<< "Set centre of rotation to " << rotationCentre << endl;
|
||||
points -= rotationCentre;
|
||||
}
|
||||
|
||||
if (args.found("rotate"))
|
||||
@ -482,15 +485,15 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
if (useRotationCentre)
|
||||
{
|
||||
Info<< "Unset centre of rotation from " << rotationCentre << endl;
|
||||
points += rotationCentre;
|
||||
}
|
||||
|
||||
// Output scaling
|
||||
applyScaling(points, getScalingOpt("scale", args));
|
||||
|
||||
if (useOrigin)
|
||||
{
|
||||
Info<< "Unset origin for rotations from " << origin << endl;
|
||||
points += origin;
|
||||
}
|
||||
|
||||
|
||||
// Set the precision of the points data to 10
|
||||
IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));
|
||||
|
||||
@ -675,7 +675,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
for
|
||||
(
|
||||
const word& opt
|
||||
const char * const opt
|
||||
: { "cellSet", "cellZone", "faceSet", "pointSet" }
|
||||
)
|
||||
{
|
||||
|
||||
@ -92,7 +92,7 @@ bool setCellFieldType
|
||||
|
||||
fieldType field(fieldHeader, mesh, false);
|
||||
|
||||
const Type& value = pTraits<Type>(fieldValueStream);
|
||||
const Type value = pTraits<Type>(fieldValueStream);
|
||||
|
||||
if (selectedCells.size() == field.size())
|
||||
{
|
||||
@ -244,7 +244,7 @@ bool setFaceFieldType
|
||||
|
||||
fieldType field(fieldHeader, mesh);
|
||||
|
||||
const Type& value = pTraits<Type>(fieldValueStream);
|
||||
const Type value = pTraits<Type>(fieldValueStream);
|
||||
|
||||
// Create flat list of selected faces and their value.
|
||||
Field<Type> allBoundaryValues(mesh.nBoundaryFaces());
|
||||
|
||||
@ -188,15 +188,18 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
"auto-origin",
|
||||
"Use bounding box centre as origin for rotations"
|
||||
"auto-centre",
|
||||
"Use bounding box centre as centre for rotations"
|
||||
);
|
||||
argList::addOption
|
||||
(
|
||||
"origin",
|
||||
"centre",
|
||||
"point",
|
||||
"Use specified <point> as origin for rotations"
|
||||
"Use specified <point> as centre for rotations"
|
||||
);
|
||||
argList::addOptionCompat("auto-centre", {"auto-origin", 2206});
|
||||
argList::addOptionCompat("centre", {"origin", 2206});
|
||||
|
||||
argList::addOption
|
||||
(
|
||||
"rotate",
|
||||
@ -334,18 +337,18 @@ int main(int argc, char *argv[])
|
||||
points += v;
|
||||
}
|
||||
|
||||
vector origin;
|
||||
bool useOrigin = args.readIfPresent("origin", origin);
|
||||
if (args.found("auto-origin") && !useOrigin)
|
||||
vector rotationCentre;
|
||||
bool useRotationCentre = args.readIfPresent("centre", rotationCentre);
|
||||
if (args.found("auto-centre") && !useRotationCentre)
|
||||
{
|
||||
useOrigin = true;
|
||||
origin = boundBox(points).centre();
|
||||
useRotationCentre = true;
|
||||
rotationCentre = boundBox(points).centre();
|
||||
}
|
||||
|
||||
if (useOrigin)
|
||||
if (useRotationCentre)
|
||||
{
|
||||
Info<< "Set origin for rotations to " << origin << endl;
|
||||
points -= origin;
|
||||
Info<< "Set centre of rotation to " << rotationCentre << endl;
|
||||
points -= rotationCentre;
|
||||
}
|
||||
|
||||
if (args.found("rotate"))
|
||||
@ -406,15 +409,15 @@ int main(int argc, char *argv[])
|
||||
points = transform(rot, points);
|
||||
}
|
||||
|
||||
if (useRotationCentre)
|
||||
{
|
||||
Info<< "Unset centre of rotation from " << rotationCentre << endl;
|
||||
points += rotationCentre;
|
||||
}
|
||||
|
||||
// Output scaling
|
||||
applyScaling(points, getScalingOpt("write-scale", args));
|
||||
|
||||
if (useOrigin)
|
||||
{
|
||||
Info<< "Unset origin for rotations from " << origin << endl;
|
||||
points += origin;
|
||||
}
|
||||
|
||||
surf1.movePoints(points);
|
||||
surf1.write(exportName, writeFileType);
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -55,6 +55,8 @@ Equivalent options:
|
||||
-scotch-path --scotchArchPath | -scotchArchPath
|
||||
-system-compiler -system
|
||||
-third-compiler -third
|
||||
-openmpi-system -sys-openmpi
|
||||
-openmpi-third -openmpi
|
||||
|
||||
HELP_COMPAT
|
||||
exit 0 # A clean exit
|
||||
@ -89,10 +91,9 @@ Compiler
|
||||
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)
|
||||
-mpi=NAME Specify 'WM_MPLIB' type (eg, INTELMPI, etc)
|
||||
-openmpi[=VER] Use ThirdParty openmpi, with version for 'FOAM_MPI'
|
||||
-sys-openmpi[=MAJ] Use system openmpi, with specified major version
|
||||
|
||||
Components versions (ThirdParty)
|
||||
-adios VER specify 'adios2_version'
|
||||
@ -212,12 +213,13 @@ _inlineSed()
|
||||
# Local filename (for reporting)
|
||||
localFile="$(echo "$file" | sed -e "s#^$projectDir/##")"
|
||||
|
||||
grep -q "$regexp" "$file" && sed -i -e "$cmd" "$file" || { \
|
||||
if grep -q "$regexp" "$file" && sed -i -e "$cmd" "$file"
|
||||
then
|
||||
[ -n "$msg" ] && echo " $msg ($localFile)"
|
||||
else
|
||||
echo "Failed: ${msg:-replacement} in $localFile"
|
||||
return 1
|
||||
}
|
||||
|
||||
[ -n "$msg" ] && echo " $msg ($localFile)"
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
@ -278,8 +280,8 @@ replaceEtc()
|
||||
local file="$1"
|
||||
shift
|
||||
|
||||
file=$(_foamEtc "$file")
|
||||
replace $file "$@"
|
||||
file="$(_foamEtc "$file")"
|
||||
replace "$file" "$@"
|
||||
}
|
||||
|
||||
|
||||
@ -289,24 +291,36 @@ replaceEtcCsh()
|
||||
local file="$1"
|
||||
shift
|
||||
|
||||
file=$(_foamEtc "$file")
|
||||
replaceCsh $file "$@"
|
||||
file="$(_foamEtc "$file")"
|
||||
replaceCsh "$file" "$@"
|
||||
}
|
||||
|
||||
|
||||
# Get the option's value (argument), or die on missing or empty argument
|
||||
# $1 option
|
||||
# $2 value
|
||||
|
||||
# Returns values via optValue, nOptArgs variables!!
|
||||
optValue=""
|
||||
nOptArgs=0 # The number of args to shift
|
||||
|
||||
getOptionValue()
|
||||
{
|
||||
local value="$2"
|
||||
[ -n "$value" ] || die "'$1' option requires an argument"
|
||||
optValue="${1#*=}"
|
||||
if [ "$optValue" = "$1" ]
|
||||
then
|
||||
# Eg, -option value
|
||||
optValue="$2"
|
||||
[ -n "$optValue" ] || die "'$1' option requires an argument"
|
||||
nOptArgs=1
|
||||
else
|
||||
# Eg, -option=value
|
||||
nOptArgs=0
|
||||
fi
|
||||
|
||||
# Remove any surrounding double quotes
|
||||
value="${value%\"}"
|
||||
value="${value#\"}"
|
||||
|
||||
echo "$value"
|
||||
optValue="${optValue%\"}"
|
||||
optValue="${optValue#\"}"
|
||||
}
|
||||
|
||||
|
||||
@ -366,7 +380,7 @@ removeCshMagic()
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
unset adjusted optMpi
|
||||
unset adjusted
|
||||
# Parse options
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
@ -421,26 +435,37 @@ CONFIG_CSH
|
||||
[ -n "$FOAM_CONFIG_ETC" ] || unset FOAM_CONFIG_ETC
|
||||
;;
|
||||
|
||||
-project-path)
|
||||
-project-path=* | -project-path)
|
||||
# Replace WM_PROJECT_DIR=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc bashrc WM_PROJECT_DIR "\"$optionValue\""
|
||||
replaceEtcCsh cshrc WM_PROJECT_DIR "\"$optionValue\""
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
removeBashMagic $(_foamEtc bashrc)
|
||||
removeCshMagic $(_foamEtc cshrc)
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc bashrc WM_PROJECT_DIR "\"$optValue\""
|
||||
replaceEtcCsh cshrc WM_PROJECT_DIR "\"$optValue\""
|
||||
|
||||
adjusted=true
|
||||
shift
|
||||
removeBashMagic "$(_foamEtc bashrc)"
|
||||
removeCshMagic "$(_foamEtc cshrc)"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-version | -foamVersion | --projectVersion)
|
||||
-version=* | -version | -foamVersion | --projectVersion)
|
||||
# Replace WM_PROJECT_VERSION=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc bashrc WM_PROJECT_VERSION "$optionValue"
|
||||
replaceEtcCsh cshrc WM_PROJECT_VERSION "$optionValue"
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc bashrc WM_PROJECT_VERSION "$optValue"
|
||||
replaceEtcCsh cshrc WM_PROJECT_VERSION "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-sp | -SP | -float32)
|
||||
@ -466,131 +491,168 @@ CONFIG_CSH
|
||||
|
||||
-int32 | -int64)
|
||||
# Replace WM_LABEL_SIZE=...
|
||||
optionValue="${1#-int}"
|
||||
replaceEtc bashrc WM_LABEL_SIZE "$optionValue"
|
||||
replaceEtcCsh cshrc WM_LABEL_SIZE "$optionValue"
|
||||
optValue="${1#-int}"
|
||||
replaceEtc bashrc WM_LABEL_SIZE "$optValue"
|
||||
replaceEtcCsh cshrc WM_LABEL_SIZE "$optValue"
|
||||
adjusted=true
|
||||
;;
|
||||
|
||||
|
||||
## Compiler ##
|
||||
|
||||
-clang)
|
||||
-clang=* | -clang)
|
||||
# Replace default_clang_version=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc config.sh/compiler default_clang_version "$optionValue"
|
||||
replaceEtc config.csh/compiler default_clang_version "$optionValue"
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/compiler default_clang_version "$optValue"
|
||||
replaceEtc config.csh/compiler default_clang_version "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-gcc)
|
||||
-gcc=* | -gcc)
|
||||
# Replace default_gcc_version=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc config.sh/compiler default_gcc_version "$optionValue"
|
||||
replaceEtc config.csh/compiler default_gcc_version "$optionValue"
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/compiler default_gcc_version "$optValue"
|
||||
replaceEtc config.csh/compiler default_gcc_version "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-system-compiler | -system)
|
||||
# Replace WM_COMPILER_TYPE=... and WM_COMPILER=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc bashrc \
|
||||
WM_COMPILER_TYPE system \
|
||||
WM_COMPILER "$optionValue"
|
||||
replaceEtcCsh cshrc \
|
||||
WM_COMPILER_TYPE system \
|
||||
WM_COMPILER "$optionValue"
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc bashrc \
|
||||
WM_COMPILER_TYPE system \
|
||||
WM_COMPILER "$optValue"
|
||||
replaceEtcCsh cshrc \
|
||||
WM_COMPILER_TYPE system \
|
||||
WM_COMPILER "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-third-compiler | -third | -ThirdParty)
|
||||
# Replace WM_COMPILER_TYPE=... and WM_COMPILER=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc bashrc \
|
||||
WM_COMPILER_TYPE ThirdParty \
|
||||
WM_COMPILER "$optionValue"
|
||||
replaceEtcCsh cshrc \
|
||||
WM_COMPILER_TYPE ThirdParty \
|
||||
WM_COMPILER "$optionValue"
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc bashrc \
|
||||
WM_COMPILER_TYPE ThirdParty \
|
||||
WM_COMPILER "$optValue"
|
||||
replaceEtcCsh cshrc \
|
||||
WM_COMPILER_TYPE ThirdParty \
|
||||
WM_COMPILER "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
gmp-[4-9]* | gmp-system)
|
||||
# gcc-related package
|
||||
replaceEtc config.sh/compiler default_gmp_version "$1"
|
||||
replaceEtc config.csh/compiler default_gmp_version "$1"
|
||||
optValue="${1#-}"
|
||||
replaceEtc config.sh/compiler default_gmp_version "$optValue"
|
||||
replaceEtc config.csh/compiler default_gmp_version "$optValue"
|
||||
adjusted=true
|
||||
;;
|
||||
|
||||
mpfr-[2-9]* | mpfr-system)
|
||||
# gcc-related package
|
||||
replaceEtc config.sh/compiler default_mpfr_version "$1"
|
||||
replaceEtc config.csh/compiler default_mpfr_version "$1"
|
||||
optValue="${1#-}"
|
||||
replaceEtc config.sh/compiler default_mpfr_version "$optValue"
|
||||
replaceEtc config.csh/compiler default_mpfr_version "$optValue"
|
||||
adjusted=true
|
||||
;;
|
||||
|
||||
mpc-[0-9]* | mpc-system)
|
||||
# gcc-related package
|
||||
replaceEtc config.sh/compiler default_mpc_version "$1"
|
||||
replaceEtc config.csh/compiler default_mpc_version "$1"
|
||||
optValue="${1#-}"
|
||||
replaceEtc config.sh/compiler default_mpc_version "$optValue"
|
||||
replaceEtc config.csh/compiler default_mpc_version "$optValue"
|
||||
adjusted=true
|
||||
;;
|
||||
|
||||
|
||||
## MPI ##
|
||||
|
||||
-mpi)
|
||||
-mpi=* | -mpi)
|
||||
# Explicitly set WM_MPLIB=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc bashrc WM_MPLIB "$optionValue"
|
||||
replaceEtcCsh cshrc WM_MPLIB "$optionValue"
|
||||
optMpi=system
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc bashrc WM_MPLIB "$optValue"
|
||||
replaceEtcCsh cshrc WM_MPLIB "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-openmpi)
|
||||
# Replace FOAM_MPI=openmpi-<digits>.. and set to use third-party
|
||||
# The edit is slightly fragile, but works
|
||||
expected="openmpi-[1-9][.0-9]*"
|
||||
optMpi=$(getOptionValue "$@")
|
||||
|
||||
_matches "$optMpi" "$expected" || \
|
||||
die "'$1' has bad value: '$optMpi'"
|
||||
|
||||
_inlineSed $(_foamEtc config.sh/mpi) \
|
||||
"FOAM_MPI=$expected" \
|
||||
"FOAM_MPI=$optMpi" \
|
||||
"Replaced 'FOAM_MPI=$expected' by 'FOAM_MPI=$optMpi'"
|
||||
|
||||
_inlineSed $(_foamEtc config.csh/mpi) \
|
||||
"FOAM_MPI $expected" \
|
||||
"FOAM_MPI $optMpi" \
|
||||
"Replaced 'FOAM_MPI $expected' by 'FOAM_MPI $optMpi'"
|
||||
|
||||
replaceEtc bashrc WM_MPLIB OPENMPI
|
||||
replaceEtcCsh cshrc WM_MPLIB OPENMPI
|
||||
adjusted=true
|
||||
shift
|
||||
;;
|
||||
|
||||
-openmpi-system)
|
||||
-sys-openmpi=* | -sys-openmpi | -openmpi-system)
|
||||
optValue="$(echo "$1" | sed -ne 's/^.*mpi=\([1-9][0-9]*\).*/\1/p')"
|
||||
# Explicitly set WM_MPLIB=SYSTEMOPENMPI
|
||||
replaceEtc bashrc WM_MPLIB SYSTEMOPENMPI
|
||||
replaceEtcCsh cshrc WM_MPLIB SYSTEMOPENMPI
|
||||
optMpi=system
|
||||
adjusted=true
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc bashrc WM_MPLIB SYSTEMOPENMPI"$optValue"
|
||||
replaceEtcCsh cshrc WM_MPLIB SYSTEMOPENMPI"$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-openmpi-third)
|
||||
# Explicitly set WM_MPLIB=OPENMPI, using default setting for openmpi
|
||||
-openmpi=* | -openmpi | -openmpi-third)
|
||||
# Explicitly set WM_MPLIB=OPENMPI
|
||||
# - use default setting for openmpi, or
|
||||
# replace FOAM_MPI=openmpi-<digits>..
|
||||
# The edit is slightly fragile, but works
|
||||
|
||||
expected="openmpi-[1-9][.0-9]*"
|
||||
optValue="$(echo "$1" | sed -ne 's/^.*mpi=//p')"
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
if [ "${optValue#openmpi-}" = "$optValue" ]
|
||||
then
|
||||
optValue="openmpi-$optValue"
|
||||
fi
|
||||
|
||||
_matches "$optValue" "$expected" || \
|
||||
die "'${1%=*}' has bad value: '$optValue'"
|
||||
|
||||
_inlineSed "$(_foamEtc config.sh/mpi)" \
|
||||
"FOAM_MPI=$expected" \
|
||||
"FOAM_MPI=$optValue" \
|
||||
"Replaced 'FOAM_MPI=$expected' by 'FOAM_MPI=$optValue'"
|
||||
|
||||
_inlineSed "$(_foamEtc config.csh/mpi)" \
|
||||
"FOAM_MPI=$expected" \
|
||||
"FOAM_MPI=$optValue" \
|
||||
"Replaced 'FOAM_MPI $expected' by 'FOAM_MPI $optValue'"
|
||||
fi
|
||||
replaceEtc bashrc WM_MPLIB OPENMPI
|
||||
replaceEtcCsh cshrc WM_MPLIB OPENMPI
|
||||
optMpi=third
|
||||
adjusted=true
|
||||
;;
|
||||
|
||||
@ -599,146 +661,242 @@ CONFIG_CSH
|
||||
|
||||
-adios | -adios2)
|
||||
# Replace adios2_version=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc config.sh/adios2 adios2_version "$optionValue"
|
||||
replaceEtc config.csh/adios2 adios2_version "$optionValue"
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/adios2 adios2_version "$optValue"
|
||||
replaceEtc config.csh/adios2 adios2_version "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-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
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/adios2 ADIOS2_ARCH_PATH "\"$optValue\""
|
||||
replaceEtcCsh config.csh/adios2 ADIOS2_ARCH_PATH "\"$optValue\""
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-boost)
|
||||
# Replace boost_version=... (config is cgal or CGAL)
|
||||
optionValue=$(getOptionValue "$@")
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
cfgName=cgal; _foamEtc -q config.sh/"$cfgName" || cfgName=CGAL
|
||||
replaceEtc config.sh/"$cfgName" boost_version "$optionValue"
|
||||
replaceEtc config.csh/"$cfgName" boost_version "$optionValue"
|
||||
adjusted=true
|
||||
shift
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/"$cfgName" boost_version "$optValue"
|
||||
replaceEtc config.csh/"$cfgName" boost_version "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-boost-path)
|
||||
# Replace BOOST_ARCH_PATH=... (config is cgal or CGAL)
|
||||
optionValue=$(getOptionValue "$@")
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
cfgName=cgal; _foamEtc -q config.sh/"$cfgName" || cfgName=CGAL
|
||||
replaceEtc config.sh/"$cfgName" BOOST_ARCH_PATH "\"$optionValue\""
|
||||
replaceEtc config.csh/"$cfgName" BOOST_ARCH_PATH "\"$optionValue\""
|
||||
adjusted=true
|
||||
shift
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/"$cfgName" BOOST_ARCH_PATH "\"$optValue\""
|
||||
replaceEtc config.csh/"$cfgName" BOOST_ARCH_PATH "\"$optValue\""
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-cgal)
|
||||
# Replace cgal_version=... (config is cgal or CGAL)
|
||||
optionValue=$(getOptionValue "$@")
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
cfgName=cgal; _foamEtc -q config.sh/"$cfgName" || cfgName=CGAL
|
||||
replaceEtc config.sh/"$cfgName" cgal_version "$optionValue"
|
||||
replaceEtc config.csh/"$cfgName" cgal_version "$optionValue"
|
||||
adjusted=true
|
||||
shift
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/"$cfgName" cgal_version "$optValue"
|
||||
replaceEtc config.csh/"$cfgName" cgal_version "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-cgal-path)
|
||||
# Replace CGAL_ARCH_PATH=... (config is cgal or CGAL)
|
||||
optionValue=$(getOptionValue "$@")
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
cfgName=cgal; _foamEtc -q config.sh/"$cfgName" || cfgName=CGAL
|
||||
replaceEtc config.sh/"$cfgName" CGAL_ARCH_PATH "$optionValue"
|
||||
replaceEtcCsh config.csh/"$cfgName" CGAL_ARCH_PATH "$optionValue"
|
||||
adjusted=true
|
||||
shift
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/"$cfgName" CGAL_ARCH_PATH "$optValue"
|
||||
replaceEtcCsh config.csh/"$cfgName" CGAL_ARCH_PATH "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-fftw)
|
||||
# Replace fftw_version=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
# config.sh/fftw or config.sh/FFTW
|
||||
cfgName=fftw; _foamEtc -q config.sh/"$cfgName" || cfgName=FFTW
|
||||
replaceEtc config.sh/"$cfgName" fftw_version "$optionValue"
|
||||
replaceEtc config.csh/"$cfgName" fftw_version "$optionValue"
|
||||
adjusted=true
|
||||
shift
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/"$cfgName" fftw_version "$optValue"
|
||||
replaceEtc config.csh/"$cfgName" fftw_version "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-fftw-path)
|
||||
# Replace FFTW_ARCH_PATH=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
# config.sh/fftw or config.sh/FFTW
|
||||
cfgName=fftw; _foamEtc -q config.sh/"$cfgName" || cfgName=FFTW
|
||||
replaceEtc config.sh/"$cfgName" FFTW_ARCH_PATH "\"$optionValue\""
|
||||
replaceEtcCsh config.csh/"$cfgName" FFTW_ARCH_PATH "\"$optionValue\""
|
||||
adjusted=true
|
||||
shift
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/"$cfgName" FFTW_ARCH_PATH "\"$optValue\""
|
||||
replaceEtcCsh config.csh/"$cfgName" FFTW_ARCH_PATH "\"$optValue\""
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-cmake)
|
||||
# Replace cmake_version=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc config.sh/cmake cmake_version "$optionValue"
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/cmake cmake_version "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-cmake-path)
|
||||
# Replace CMAKE_ARCH_PATH=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc config.sh/cmake CMAKE_ARCH_PATH "$optionValue"
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/cmake CMAKE_ARCH_PATH "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-kahip)
|
||||
# Replace KAHIP_VERSION=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc config.sh/kahip KAHIP_VERSION "$optionValue"
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/kahip KAHIP_VERSION "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-kahip-path)
|
||||
# Replace KAHIP_ARCH_PATH=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc config.sh/kahip KAHIP_ARCH_PATH "\"$optionValue\""
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/kahip KAHIP_ARCH_PATH "\"$optValue\""
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-metis)
|
||||
# Replace METIS_VERSION=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc config.sh/metis METIS_VERSION "$optionValue"
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/metis METIS_VERSION "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-metis-path)
|
||||
# Replace METIS_ARCH_PATH=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc config.sh/metis METIS_ARCH_PATH "\"$optionValue\""
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/metis METIS_ARCH_PATH "\"$optValue\""
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-scotch | -scotchVersion | --scotchVersion)
|
||||
# Replace SCOTCH_VERSION=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc config.sh/scotch SCOTCH_VERSION "$optionValue"
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/scotch SCOTCH_VERSION "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-scotch-path | -scotchArchPath | --scotchArchPath)
|
||||
# Replace SCOTCH_ARCH_PATH=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc config.sh/scotch SCOTCH_ARCH_PATH "\"$optionValue\""
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/scotch SCOTCH_ARCH_PATH "\"$optValue\""
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
|
||||
@ -747,107 +905,156 @@ CONFIG_CSH
|
||||
-paraview | -paraviewVersion | --paraviewVersion)
|
||||
# Replace ParaView_VERSION=...
|
||||
expected="[5-9][.0-9]*" # but also accept system
|
||||
optionValue=$(getOptionValue "$@")
|
||||
_matches "$optionValue" "$expected" || \
|
||||
[ "$optionValue" != "${optionValue%system}" ] || \
|
||||
die "'$1' has bad value: '$optionValue'"
|
||||
replaceEtc config.sh/paraview ParaView_VERSION "$optionValue"
|
||||
replaceEtc config.csh/paraview ParaView_VERSION "$optionValue"
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
_matches "$optValue" "$expected" || \
|
||||
[ "$optValue" != "${optValue%system}" ] || \
|
||||
die "'${1%=*}' has bad value: '$optValue'"
|
||||
|
||||
shift "${nOptArgs:-0}"
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/paraview ParaView_VERSION "$optValue"
|
||||
replaceEtc config.csh/paraview ParaView_VERSION "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-paraview-qt)
|
||||
# Replace ParaView_QT=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc config.sh/paraview ParaView_QT "$optionValue"
|
||||
replaceEtc config.csh/paraview ParaView_QT "$optionValue"
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/paraview ParaView_QT "$optValue"
|
||||
replaceEtc config.csh/paraview ParaView_QT "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-paraview-path | -paraviewInstall | --paraviewInstall)
|
||||
# Replace ParaView_DIR=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc config.sh/paraview ParaView_DIR \""$optionValue\""
|
||||
replaceEtcCsh config.csh/paraview ParaView_DIR \""$optionValue\""
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/paraview ParaView_DIR \""$optValue\""
|
||||
replaceEtcCsh config.csh/paraview ParaView_DIR \""$optValue\""
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-llvm)
|
||||
# Replace mesa_llvm=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc config.sh/vtk mesa_llvm "$optionValue"
|
||||
replaceEtc config.csh/vtk mesa_llvm "$optionValue"
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/vtk mesa_llvm "$optValue"
|
||||
replaceEtc config.csh/vtk mesa_llvm "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-mesa)
|
||||
# Replace mesa_version=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc config.sh/vtk mesa_version "$optionValue"
|
||||
replaceEtc config.csh/vtk mesa_version "$optionValue"
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/vtk mesa_version "$optValue"
|
||||
replaceEtc config.csh/vtk mesa_version "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-vtk)
|
||||
# Replace vtk_version=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc config.sh/vtk vtk_version "$optionValue"
|
||||
replaceEtc config.csh/vtk vtk_version "$optionValue"
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/vtk vtk_version "$optValue"
|
||||
replaceEtc config.csh/vtk vtk_version "$optValue"
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-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
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/vtk LLVM_ARCH_PATH \""$optValue\""
|
||||
replaceEtcCsh config.csh/vtk LLVM_ARCH_PATH \""$optValue\""
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-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
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/vtk MESA_ARCH_PATH \""$optValue\""
|
||||
replaceEtcCsh config.csh/vtk MESA_ARCH_PATH \""$optValue\""
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-vtk-path)
|
||||
# Replace VTK_DIR...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
replaceEtc config.sh/vtk VTK_DIR \""$optionValue\""
|
||||
replaceEtcCsh config.csh/vtk VTK_DIR \""$optionValue\""
|
||||
adjusted=true
|
||||
shift
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
|
||||
if [ -n "$optValue" ]
|
||||
then
|
||||
replaceEtc config.sh/vtk VTK_DIR \""$optValue\""
|
||||
replaceEtcCsh config.csh/vtk VTK_DIR \""$optValue\""
|
||||
adjusted=true
|
||||
else
|
||||
: "${adjusted:=empty}"
|
||||
fi
|
||||
;;
|
||||
|
||||
|
||||
## Misc ##
|
||||
|
||||
# Obsolete flags
|
||||
-sigfpe | -no-sigfpe)
|
||||
echo "Enable/disable FOAM_SIGFPE now via controlDict" 1>&2
|
||||
;;
|
||||
|
||||
-archOption | --archOption)
|
||||
# Replace WM_ARCH_OPTION=...
|
||||
optionValue=$(getOptionValue "$@")
|
||||
echo "Ignoring $1 option: no longer supported" 1>&2
|
||||
shift
|
||||
;;
|
||||
|
||||
# Obsolete options
|
||||
-archOption | --archOption | \
|
||||
-foamInstall | --foamInstall | -projectName | --projectName)
|
||||
# Removed for 1812
|
||||
optionValue=$(getOptionValue "$@")
|
||||
echo "Ignoring $1 option: obsolete" 1>&2
|
||||
shift
|
||||
echo "Ignoring obsolete option: $1" 1>&2
|
||||
getOptionValue "$@"
|
||||
shift "${nOptArgs:-0}"
|
||||
;;
|
||||
|
||||
*)
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -174,12 +174,13 @@ _foamAddPath "${FOAM_USER_APPBIN}:${FOAM_SITE_APPBIN}:${FOAM_APPBIN}"
|
||||
# Dummy versions of external libraries. To be found last in library path
|
||||
_foamAddLib "$FOAM_LIBBIN/dummy"
|
||||
|
||||
# External (ThirdParty) libraries. Also allowed to be unset
|
||||
if ( -d "$WM_THIRD_PARTY_DIR" ) then
|
||||
# External (ThirdParty) libraries:
|
||||
# - check if already compiled, or will be compiled.
|
||||
# can also be unset
|
||||
unsetenv FOAM_EXT_LIBBIN
|
||||
if ( -d "$WM_THIRD_PARTY_DIR/platforms" || -f "$WM_THIRD_PARTY_DIR/Allwmake" ) then
|
||||
setenv FOAM_EXT_LIBBIN "$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/lib"
|
||||
_foamAddLib "$FOAM_EXT_LIBBIN"
|
||||
else
|
||||
unsetenv FOAM_EXT_LIBBIN
|
||||
endif
|
||||
|
||||
# OpenFOAM libraries (user, group, standard)
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -174,13 +174,14 @@ _foamAddPath "$FOAM_USER_APPBIN:$FOAM_SITE_APPBIN:$FOAM_APPBIN"
|
||||
# Dummy versions of external libraries. To be found last in library path
|
||||
_foamAddLib "$FOAM_LIBBIN/dummy"
|
||||
|
||||
# External (ThirdParty) libraries. Also allowed to be unset
|
||||
if [ -d "$WM_THIRD_PARTY_DIR" ]
|
||||
# External (ThirdParty) libraries:
|
||||
# - check if already compiled, or will be compiled.
|
||||
# can also be unset
|
||||
unset FOAM_EXT_LIBBIN
|
||||
if [ -d "$WM_THIRD_PARTY_DIR/platforms" ] || [ -f "$WM_THIRD_PARTY_DIR/Allwmake" ]
|
||||
then
|
||||
export FOAM_EXT_LIBBIN="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/lib"
|
||||
_foamAddLib "$FOAM_EXT_LIBBIN"
|
||||
else
|
||||
unset FOAM_EXT_LIBBIN
|
||||
fi
|
||||
|
||||
# OpenFOAM libraries (user, group, standard)
|
||||
|
||||
@ -12,7 +12,13 @@ targetType=libso
|
||||
export FOAM_MODULE_PREFIX
|
||||
|
||||
echo "========================================"
|
||||
echo "Compile OpenFOAM modules"
|
||||
if [ "$FOAM_MODULE_PREFIX" = false ] || [ "$FOAM_MODULE_PREFIX" = none ]
|
||||
then
|
||||
echo "OpenFOAM modules disabled (prefix=${FOAM_MODULE_PREFIX})"
|
||||
echo
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "prefix = $FOAM_MODULE_PREFIX"
|
||||
echo
|
||||
echo " ignoring possible compilation errors"
|
||||
|
||||
@ -32,8 +32,8 @@ Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef OSHA1stream_H
|
||||
#define OSHA1stream_H
|
||||
#ifndef Foam_OSHA1stream_H
|
||||
#define Foam_OSHA1stream_H
|
||||
|
||||
#include "OSstream.H"
|
||||
#include "SHA1.H"
|
||||
@ -63,10 +63,17 @@ class osha1stream
|
||||
|
||||
protected:
|
||||
|
||||
//- Handle overflow
|
||||
virtual int overflow(int c = EOF)
|
||||
{
|
||||
if (c != EOF) sha1_.append(c);
|
||||
return c;
|
||||
}
|
||||
|
||||
//- Put sequence of characters
|
||||
virtual std::streamsize xsputn(const char* s, std::streamsize n)
|
||||
{
|
||||
sha1_.append(s, n);
|
||||
if (n) sha1_.append(s, n);
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
@ -158,7 +158,7 @@ Foam::tokenList Foam::functionEntries::evalEntry::evaluate
|
||||
OTstream toks;
|
||||
result.writeValue(toks);
|
||||
|
||||
return std::move(toks);
|
||||
return tokenList(std::move(toks.tokens()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
Copyright (C) 2015-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -34,8 +34,24 @@ License
|
||||
#include "Pstream.H"
|
||||
#include "foamVersion.H"
|
||||
#include "OSspecific.H"
|
||||
#include "Enum.H"
|
||||
#include "Switch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::error::handlerTypes
|
||||
>
|
||||
Foam::error::handlerNames
|
||||
({
|
||||
{ handlerTypes::DEFAULT, "default" },
|
||||
{ handlerTypes::IGNORE, "ignore" },
|
||||
{ handlerTypes::WARN, "warn" },
|
||||
{ handlerTypes::STRICT, "strict" },
|
||||
});
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||
|
||||
void Foam::error::warnAboutAge(const char* what, const int version)
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2015-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -53,8 +53,8 @@ SeeAlso
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef error_H
|
||||
#define error_H
|
||||
#ifndef Foam_error_H
|
||||
#define Foam_error_H
|
||||
|
||||
#include "messageStream.H"
|
||||
#include <memory>
|
||||
@ -64,6 +64,10 @@ SeeAlso
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward Declarations
|
||||
class OStringStream;
|
||||
template<class EnumType> class Enum;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class error Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -92,6 +96,21 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
// Data Types
|
||||
|
||||
//- Handling of errors. The exact handling depends on the local context.
|
||||
enum class handlerTypes : char
|
||||
{
|
||||
DEFAULT = 0, //!< Default behaviour (local meaning)
|
||||
IGNORE, //!< Ignore on errors/problems
|
||||
WARN, //!< Warn on errors/problems
|
||||
STRICT //!< Fatal on errors/problems
|
||||
};
|
||||
|
||||
//- Names of the error handler types
|
||||
static const Enum<handlerTypes> handlerNames;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from title string
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2015-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -43,7 +43,7 @@ License
|
||||
/* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */
|
||||
|
||||
//- Max number of warnings (per functionObject)
|
||||
static constexpr const uint32_t maxWarnings = 10u;
|
||||
static constexpr const unsigned maxWarnings = 10u;
|
||||
|
||||
Foam::fileName Foam::functionObjectList::functionObjectDictPath
|
||||
(
|
||||
@ -51,19 +51,6 @@ Foam::fileName Foam::functionObjectList::functionObjectDictPath
|
||||
);
|
||||
|
||||
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::functionObjectList::errorHandlingType
|
||||
>
|
||||
Foam::functionObjectList::errorHandlingNames_
|
||||
({
|
||||
{ errorHandlingType::DEFAULT, "default" },
|
||||
{ errorHandlingType::WARN, "warn" },
|
||||
{ errorHandlingType::IGNORE, "ignore" },
|
||||
{ errorHandlingType::STRICT, "strict" },
|
||||
});
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
@ -396,12 +383,12 @@ bool Foam::functionObjectList::readFunctionObject
|
||||
}
|
||||
|
||||
|
||||
Foam::functionObjectList::errorHandlingType
|
||||
Foam::error::handlerTypes
|
||||
Foam::functionObjectList::getOrDefaultErrorHandling
|
||||
(
|
||||
const word& key,
|
||||
const dictionary& dict,
|
||||
const errorHandlingType deflt
|
||||
const error::handlerTypes deflt
|
||||
) const
|
||||
{
|
||||
const entry* eptr = dict.findEntry(key, keyType::LITERAL);
|
||||
@ -418,16 +405,16 @@ Foam::functionObjectList::getOrDefaultErrorHandling
|
||||
{
|
||||
const word enumName(eptr->get<word>());
|
||||
|
||||
if (!errorHandlingNames_.found(enumName))
|
||||
if (!error::handlerNames.found(enumName))
|
||||
{
|
||||
// Failed the name lookup
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< enumName << " is not in enumeration: "
|
||||
<< errorHandlingNames_ << nl
|
||||
<< error::handlerNames << nl
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
return errorHandlingNames_.get(enumName);
|
||||
return error::handlerNames.get(enumName);
|
||||
}
|
||||
}
|
||||
|
||||
@ -683,15 +670,15 @@ bool Foam::functionObjectList::execute()
|
||||
|
||||
for (functionObject& funcObj : functions())
|
||||
{
|
||||
const errorHandlingType errorHandling = *errIter;
|
||||
const auto errorHandling = *errIter;
|
||||
++errIter;
|
||||
|
||||
const word& objName = funcObj.name();
|
||||
|
||||
if
|
||||
(
|
||||
errorHandling == errorHandlingType::WARN
|
||||
|| errorHandling == errorHandlingType::IGNORE
|
||||
errorHandling == error::handlerTypes::WARN
|
||||
|| errorHandling == error::handlerTypes::IGNORE
|
||||
)
|
||||
{
|
||||
// Throw FatalError, FatalIOError as exceptions
|
||||
@ -715,12 +702,12 @@ bool Foam::functionObjectList::execute()
|
||||
catch (const Foam::error& err)
|
||||
{
|
||||
// Treat IOerror and error identically
|
||||
uint32_t nWarnings;
|
||||
unsigned nWarnings;
|
||||
hadError = true;
|
||||
|
||||
if
|
||||
(
|
||||
errorHandling != errorHandlingType::IGNORE
|
||||
(errorHandling != error::handlerTypes::IGNORE)
|
||||
&& (nWarnings = ++warnings_(objName)) <= maxWarnings
|
||||
)
|
||||
{
|
||||
@ -761,11 +748,11 @@ bool Foam::functionObjectList::execute()
|
||||
catch (const Foam::error& err)
|
||||
{
|
||||
// Treat IOerror and error identically
|
||||
uint32_t nWarnings;
|
||||
unsigned nWarnings;
|
||||
|
||||
if
|
||||
(
|
||||
errorHandling != errorHandlingType::IGNORE
|
||||
(errorHandling != error::handlerTypes::IGNORE)
|
||||
&& (nWarnings = ++warnings_(objName)) <= maxWarnings
|
||||
)
|
||||
{
|
||||
@ -894,7 +881,7 @@ bool Foam::functionObjectList::end()
|
||||
|
||||
for (functionObject& funcObj : functions())
|
||||
{
|
||||
const errorHandlingType errorHandling = *errIter;
|
||||
const auto errorHandling = *errIter;
|
||||
++errIter;
|
||||
|
||||
const word& objName = funcObj.name();
|
||||
@ -913,11 +900,11 @@ bool Foam::functionObjectList::end()
|
||||
catch (const Foam::error& err)
|
||||
{
|
||||
// Treat IOerror and error identically
|
||||
uint32_t nWarnings;
|
||||
unsigned nWarnings;
|
||||
|
||||
if
|
||||
(
|
||||
errorHandling != errorHandlingType::IGNORE
|
||||
(errorHandling != error::handlerTypes::IGNORE)
|
||||
&& (nWarnings = ++warnings_(objName)) <= maxWarnings
|
||||
)
|
||||
{
|
||||
@ -1025,7 +1012,7 @@ bool Foam::functionObjectList::read()
|
||||
errorHandling_.resize
|
||||
(
|
||||
functionsDict.size(),
|
||||
errorHandlingType::DEFAULT
|
||||
error::handlerTypes::DEFAULT
|
||||
);
|
||||
|
||||
HashTable<label> newIndices;
|
||||
@ -1041,12 +1028,12 @@ bool Foam::functionObjectList::read()
|
||||
);
|
||||
|
||||
// Top-level "errors" specification (optional)
|
||||
const errorHandlingType errorHandlingFallback =
|
||||
const error::handlerTypes errorHandlingFallback =
|
||||
getOrDefaultErrorHandling
|
||||
(
|
||||
"errors",
|
||||
functionsDict,
|
||||
errorHandlingType::DEFAULT
|
||||
error::handlerTypes::DEFAULT
|
||||
);
|
||||
|
||||
label nFunc = 0;
|
||||
@ -1071,7 +1058,7 @@ bool Foam::functionObjectList::read()
|
||||
bool enabled = dict.getOrDefault("enabled", true);
|
||||
|
||||
// Per-function "errors" specification
|
||||
const errorHandlingType errorHandling =
|
||||
const error::handlerTypes errorHandling =
|
||||
getOrDefaultErrorHandling
|
||||
(
|
||||
"errors",
|
||||
@ -1161,16 +1148,16 @@ bool Foam::functionObjectList::read()
|
||||
|
||||
switch (errorHandling)
|
||||
{
|
||||
case errorHandlingType::IGNORE:
|
||||
case error::handlerTypes::IGNORE:
|
||||
break;
|
||||
|
||||
case errorHandlingType::STRICT:
|
||||
case error::handlerTypes::STRICT:
|
||||
{
|
||||
exitNow(err);
|
||||
break;
|
||||
}
|
||||
|
||||
case errorHandlingType::DEFAULT:
|
||||
case error::handlerTypes::DEFAULT:
|
||||
{
|
||||
if (isA<Foam::IOerror>(err))
|
||||
{
|
||||
@ -1183,7 +1170,7 @@ bool Foam::functionObjectList::read()
|
||||
[[fallthrough]];
|
||||
}
|
||||
|
||||
case errorHandlingType::WARN:
|
||||
case error::handlerTypes::WARN:
|
||||
{
|
||||
// Trickery to get original message
|
||||
err.write(Warning, false);
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2015-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -77,11 +77,10 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef functionObjectList_H
|
||||
#define functionObjectList_H
|
||||
#ifndef Foam_functionObjectList_H
|
||||
#define Foam_functionObjectList_H
|
||||
|
||||
#include "PtrList.H"
|
||||
#include "Enum.H"
|
||||
#include "functionObject.H"
|
||||
#include "SHA1Digest.H"
|
||||
#include "HashTable.H"
|
||||
@ -106,25 +105,10 @@ class functionObjectList
|
||||
:
|
||||
private PtrList<functionObject>
|
||||
{
|
||||
// Data Types
|
||||
|
||||
//- Handling of construction or execution errors
|
||||
enum class errorHandlingType : uint8_t
|
||||
{
|
||||
DEFAULT = 0, //!< Warn on construct, Fatal on runtime
|
||||
WARN, //!< Warn on construct, Warn on runtime
|
||||
IGNORE, //!< Ignore on construct, Ignore on runtime
|
||||
STRICT, //!< Fatal on construct, Fatal on runtime
|
||||
};
|
||||
|
||||
//- Names for error handling types
|
||||
static const Enum<errorHandlingType> errorHandlingNames_;
|
||||
|
||||
|
||||
// Private Data
|
||||
|
||||
//- A list of error/warning handling
|
||||
List<errorHandlingType> errorHandling_;
|
||||
List<error::handlerTypes> errorHandling_;
|
||||
|
||||
//- A list of SHA1 digests for the function object dictionaries
|
||||
List<SHA1Digest> digests_;
|
||||
@ -135,7 +119,7 @@ class functionObjectList
|
||||
//- Track the number of warnings per function object and limit
|
||||
// to a predefined number to avoid flooding the display.
|
||||
// Clear on re-read of functions.
|
||||
HashTable<uint32_t> warnings_;
|
||||
HashTable<unsigned> warnings_;
|
||||
|
||||
//- Reference to Time
|
||||
const Time& time_;
|
||||
@ -185,11 +169,11 @@ class functionObjectList
|
||||
//
|
||||
// This additional treatment is to ensure that potentially existing
|
||||
// code with an "errors" functionObject will continue to run.
|
||||
errorHandlingType getOrDefaultErrorHandling
|
||||
error::handlerTypes getOrDefaultErrorHandling
|
||||
(
|
||||
const word& key,
|
||||
const dictionary& dict,
|
||||
const errorHandlingType deflt
|
||||
const error::handlerTypes deflt
|
||||
) const;
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2015-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -1205,7 +1205,7 @@ void Foam::argList::parse
|
||||
{
|
||||
parRunControl_.distributed(true);
|
||||
source = "-roots";
|
||||
if (roots.size() != 1)
|
||||
if (roots.size() > 1)
|
||||
{
|
||||
dictNProcs = roots.size()+1;
|
||||
}
|
||||
@ -1214,6 +1214,7 @@ void Foam::argList::parse
|
||||
{
|
||||
roots.resize(Pstream::nProcs()-1, fileName::null);
|
||||
|
||||
parRunControl_.distributed(true);
|
||||
source = "-hostRoots";
|
||||
ITstream is(source, options_["hostRoots"]);
|
||||
|
||||
@ -1252,7 +1253,7 @@ void Foam::argList::parse
|
||||
}
|
||||
}
|
||||
|
||||
if (roots.size() != 1)
|
||||
if (roots.size() > 1)
|
||||
{
|
||||
dictNProcs = roots.size()+1;
|
||||
}
|
||||
@ -1296,6 +1297,12 @@ void Foam::argList::parse
|
||||
{
|
||||
parRunControl_.distributed(true);
|
||||
decompDict.readEntry("roots", roots);
|
||||
if (roots.empty())
|
||||
{
|
||||
DetailInfo
|
||||
<< "WARNING: running distributed"
|
||||
<< " but did not specify roots!" << nl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1363,8 +1370,8 @@ void Foam::argList::parse
|
||||
{
|
||||
options_.set("case", roots[slave-1]/globalCase_);
|
||||
|
||||
OPstream toSlave(Pstream::commsTypes::scheduled, slave);
|
||||
toSlave << args_ << options_ << roots.size();
|
||||
OPstream toProc(Pstream::commsTypes::scheduled, slave);
|
||||
toProc << args_ << options_ << parRunControl_.distributed();
|
||||
}
|
||||
options_.erase("case");
|
||||
|
||||
@ -1410,24 +1417,24 @@ void Foam::argList::parse
|
||||
// Distribute the master's argument list (unaltered)
|
||||
for (const int slave : Pstream::subProcs())
|
||||
{
|
||||
OPstream toSlave(Pstream::commsTypes::scheduled, slave);
|
||||
toSlave << args_ << options_ << roots.size();
|
||||
OPstream toProc(Pstream::commsTypes::scheduled, slave);
|
||||
toProc << args_ << options_ << parRunControl_.distributed();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Collect the master's argument list
|
||||
label nroots;
|
||||
bool isDistributed;
|
||||
|
||||
IPstream fromMaster
|
||||
(
|
||||
Pstream::commsTypes::scheduled,
|
||||
Pstream::masterNo()
|
||||
);
|
||||
fromMaster >> args_ >> options_ >> nroots;
|
||||
fromMaster >> args_ >> options_ >> isDistributed;
|
||||
|
||||
parRunControl_.distributed(nroots);
|
||||
parRunControl_.distributed(isDistributed);
|
||||
|
||||
// Establish rootPath_/globalCase_/case_ for slave
|
||||
setCasePaths();
|
||||
|
||||
@ -202,7 +202,8 @@ inline Foam::Matrix<Form, Type>::Matrix
|
||||
)
|
||||
:
|
||||
mRows_(Mb.m()),
|
||||
nCols_(Mb.n())
|
||||
nCols_(Mb.n()),
|
||||
v_(nullptr)
|
||||
{
|
||||
doAlloc();
|
||||
|
||||
@ -224,7 +225,8 @@ inline Foam::Matrix<Form, Type>::Matrix
|
||||
)
|
||||
:
|
||||
mRows_(Mb.m()),
|
||||
nCols_(Mb.n())
|
||||
nCols_(Mb.n()),
|
||||
v_(nullptr)
|
||||
{
|
||||
doAlloc();
|
||||
|
||||
|
||||
@ -45,6 +45,9 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "mathematicalConstants.H"
|
||||
#include "error.H"
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
|
||||
using namespace Foam::constant::mathematical;
|
||||
|
||||
|
||||
@ -43,6 +43,10 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "mathematicalConstants.H"
|
||||
#include "error.H"
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
|
||||
using namespace Foam::constant::mathematical;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -1042,6 +1042,10 @@ operator&(const Tensor<Cmpt>& t1, const SymmTensor<Cmpt>& st2)
|
||||
|
||||
//- Inner-product of a Tensor and a Vector
|
||||
template<class Cmpt>
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
// Workaround for gcc (11+) that fails to handle tensor dot vector
|
||||
__attribute__((optimize("no-tree-vectorize")))
|
||||
#endif
|
||||
inline typename innerProduct<Tensor<Cmpt>, Vector<Cmpt>>::type
|
||||
operator&(const Tensor<Cmpt>& t, const Vector<Cmpt>& v)
|
||||
{
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -42,8 +42,8 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef SHA1_H
|
||||
#define SHA1_H
|
||||
#ifndef Foam_SHA1_H
|
||||
#define Foam_SHA1_H
|
||||
|
||||
#include <string>
|
||||
#include <cstdint>
|
||||
@ -113,6 +113,9 @@ public:
|
||||
//- Reset the hashed data before appending more
|
||||
void clear();
|
||||
|
||||
//- Append single character
|
||||
inline void append(char c);
|
||||
|
||||
//- Append data for processing
|
||||
inline SHA1& append(const char* str);
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -53,6 +53,12 @@ inline Foam::SHA1::SHA1(const std::string& str)
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
inline void Foam::SHA1::append(char c)
|
||||
{
|
||||
processBytes(&c, 1);
|
||||
}
|
||||
|
||||
|
||||
inline Foam::SHA1& Foam::SHA1::append(const char* data, size_t len)
|
||||
{
|
||||
processBytes(data, len);
|
||||
|
||||
@ -29,6 +29,7 @@ License
|
||||
#include "word.H"
|
||||
#include "debug.H"
|
||||
#include <cctype>
|
||||
#include <cstdint>
|
||||
#include <sstream>
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -1132,7 +1132,17 @@ void Foam::UPstream::allocatePstreamCommunicator
|
||||
|
||||
void Foam::UPstream::freePstreamCommunicator(const label communicator)
|
||||
{
|
||||
if (communicator != 0)
|
||||
// Not touching the first communicator (WORLD)
|
||||
// or anything out-of bounds.
|
||||
//
|
||||
// No UPstream communicator indices when MPI is initialized outside
|
||||
// of OpenFOAM - thus needs a bounds check too!
|
||||
|
||||
if
|
||||
(
|
||||
communicator > 0
|
||||
&& (communicator < PstreamGlobals::MPICommunicators_.size())
|
||||
)
|
||||
{
|
||||
if (PstreamGlobals::MPICommunicators_[communicator] != MPI_COMM_NULL)
|
||||
{
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2020,2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -135,7 +135,7 @@ void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::autoMap
|
||||
const fvPatchFieldMapper& m
|
||||
)
|
||||
{
|
||||
scalarField::autoMap(m);
|
||||
mixedFvPatchField<scalar>::autoMap(m);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -161,38 +161,38 @@ Foam::turbulentDigitalFilterInletFvPatchVectorField::indexPairs()
|
||||
|
||||
void Foam::turbulentDigitalFilterInletFvPatchVectorField::checkR() const
|
||||
{
|
||||
const vectorField& faceCentres = this->patch().patch().faceCentres();
|
||||
label badFacei = -1;
|
||||
|
||||
forAll(R_, facei)
|
||||
{
|
||||
if (R_[facei].xx() <= 0)
|
||||
{
|
||||
badFacei = facei;
|
||||
FatalErrorInFunction
|
||||
<< "Reynolds stress tensor component Rxx cannot be negative"
|
||||
<< " or zero, where Rxx = " << R_[facei].xx()
|
||||
<< " at the face centre = " << faceCentres[facei]
|
||||
<< exit(FatalError);
|
||||
<< " or zero, where Rxx = " << R_[facei].xx();
|
||||
break;
|
||||
}
|
||||
|
||||
if (R_[facei].yy() < 0 || R_[facei].zz() < 0)
|
||||
{
|
||||
badFacei = facei;
|
||||
FatalErrorInFunction
|
||||
<< "Reynolds stress tensor components Ryy or Rzz cannot be"
|
||||
<< " negative where Ryy = " << R_[facei].yy()
|
||||
<< ", and Rzz = " << R_[facei].zz()
|
||||
<< " at the face centre = " << faceCentres[facei]
|
||||
<< exit(FatalError);
|
||||
<< ", and Rzz = " << R_[facei].zz();
|
||||
break;
|
||||
}
|
||||
|
||||
const scalar x0 = R_[facei].xx()*R_[facei].yy() - sqr(R_[facei].xy());
|
||||
|
||||
if (x0 <= 0)
|
||||
{
|
||||
badFacei = facei;
|
||||
FatalErrorInFunction
|
||||
<< "Reynolds stress tensor component group, Rxx*Ryy - Rxy^2"
|
||||
<< " cannot be negative or zero"
|
||||
<< " at the face centre = " << faceCentres[facei]
|
||||
<< exit(FatalError);
|
||||
<< " cannot be negative or zero";
|
||||
break;
|
||||
}
|
||||
|
||||
const scalar x1 = R_[facei].zz() - sqr(R_[facei].xz())/R_[facei].xx();
|
||||
@ -202,15 +202,23 @@ void Foam::turbulentDigitalFilterInletFvPatchVectorField::checkR() const
|
||||
|
||||
if (x3 < 0)
|
||||
{
|
||||
badFacei = facei;
|
||||
FatalErrorInFunction
|
||||
<< "Reynolds stress tensor component group, "
|
||||
<< "Rzz - Rxz^2/Rxx - (Ryz - Rxy*Rxz/(Rxx*(Rxx*Ryy - Rxy^2)))^2"
|
||||
<< " cannot be negative at the face centre = "
|
||||
<< faceCentres[facei]
|
||||
<< exit(FatalError);
|
||||
<< " cannot be negative";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (badFacei >= 0)
|
||||
{
|
||||
FatalError
|
||||
<< " at the face centre = "
|
||||
<< this->patch().patch().faceCentres()[badFacei]
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
Info<< " # Reynolds stress tensor on patch is consistent #" << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -213,11 +213,11 @@ bool Foam::functionObjects::Curle::execute()
|
||||
|
||||
forAll(observerPositions_, pointi)
|
||||
{
|
||||
const vectorField r(Cfp - observerPositions_[pointi]);
|
||||
const vectorField r(observerPositions_[pointi] - Cfp);
|
||||
const scalarField invMagR(1/(mag(r) + ROOTVSMALL));
|
||||
|
||||
pDash[pointi] +=
|
||||
sum((pp*sqr(invMagR) + invMagR/c0_*dpdtp)*(Sfp & r));
|
||||
sum((pp*sqr(invMagR) + invMagR/c0_*dpdtp)*(Sfp & (r*invMagR)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -38,6 +38,9 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
// Max number of warnings
|
||||
static constexpr const unsigned maxWarnings = 10u;
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace functionObjects
|
||||
@ -136,39 +139,13 @@ void Foam::functionObjects::fieldValues::surfaceFieldValue::setFaceZoneFaces()
|
||||
mesh_.faceZones().indices(selectionNames_)
|
||||
);
|
||||
|
||||
// Total number of faces selected
|
||||
// Total number of faces that could be selected (before patch filtering)
|
||||
label numFaces = 0;
|
||||
for (const label zoneId : zoneIds)
|
||||
{
|
||||
numFaces += mesh_.faceZones()[zoneId].size();
|
||||
}
|
||||
|
||||
if (zoneIds.empty())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< type() << ' ' << name() << ": "
|
||||
<< regionTypeNames_[regionType_] << '(' << regionName_ << "):" << nl
|
||||
<< " No matching face zone(s): "
|
||||
<< flatOutput(selectionNames_) << nl
|
||||
<< " Known face zones: "
|
||||
<< flatOutput(mesh_.faceZones().names()) << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
// Could also check this
|
||||
#if 0
|
||||
if (!returnReduce(bool(numFaces), orOp<bool>()))
|
||||
{
|
||||
WarningInFunction
|
||||
<< type() << ' ' << name() << ": "
|
||||
<< regionTypeNames_[regionType_] << '(' << regionName_ << "):" << nl
|
||||
<< " The faceZone specification: "
|
||||
<< flatOutput(selectionNames_) << nl
|
||||
<< " resulted in 0 faces" << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
#endif
|
||||
|
||||
faceId_.resize(numFaces);
|
||||
facePatchId_.resize(numFaces);
|
||||
faceFlip_.resize(numFaces);
|
||||
@ -231,7 +208,75 @@ void Foam::functionObjects::fieldValues::surfaceFieldValue::setFaceZoneFaces()
|
||||
faceId_.resize(numFaces);
|
||||
facePatchId_.resize(numFaces);
|
||||
faceFlip_.resize(numFaces);
|
||||
nFaces_ = returnReduce(faceId_.size(), sumOp<label>());
|
||||
nFaces_ = returnReduce(numFaces, sumOp<label>());
|
||||
|
||||
if (!nFaces_)
|
||||
{
|
||||
// Raise warning or error
|
||||
refPtr<OSstream> os;
|
||||
bool fatal = false;
|
||||
|
||||
++nWarnings_; // Always increment (even if ignore etc)
|
||||
|
||||
switch (emptySurfaceError_)
|
||||
{
|
||||
case error::handlerTypes::IGNORE:
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
case error::handlerTypes::WARN:
|
||||
{
|
||||
if (nWarnings_ <= maxWarnings)
|
||||
{
|
||||
os.ref(WarningInFunction);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// STRICT / DEFAULT
|
||||
default:
|
||||
{
|
||||
os.ref(FatalErrorInFunction);
|
||||
fatal = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (os)
|
||||
{
|
||||
os.ref()
|
||||
<< type() << ' ' << name() << ": "
|
||||
<< regionTypeNames_[regionType_]
|
||||
<< '(' << regionName_ << "):" << nl;
|
||||
|
||||
if (zoneIds.empty())
|
||||
{
|
||||
os.ref()
|
||||
<< " No matching face zones: "
|
||||
<< flatOutput(selectionNames_) << nl
|
||||
<< " Known face zones: "
|
||||
<< flatOutput(mesh_.faceZones().names()) << nl;
|
||||
}
|
||||
else
|
||||
{
|
||||
os.ref()
|
||||
<< " The face zones: "
|
||||
<< flatOutput(selectionNames_) << nl
|
||||
<< " resulted in 0 faces" << nl;
|
||||
}
|
||||
|
||||
if (fatal)
|
||||
{
|
||||
FatalError<< exit(FatalError);
|
||||
}
|
||||
else if (nWarnings_ == maxWarnings)
|
||||
{
|
||||
os.ref()
|
||||
<< "... suppressing further warnings." << nl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -307,36 +352,10 @@ void Foam::functionObjects::fieldValues::surfaceFieldValue::setPatchFaces()
|
||||
patchIds = std::move(selected);
|
||||
}
|
||||
|
||||
if (patchIds.empty())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< type() << ' ' << name() << ": "
|
||||
<< regionTypeNames_[regionType_] << '(' << regionName_ << "):" << nl
|
||||
<< " No matching patch name(s): "
|
||||
<< flatOutput(selectionNames_) << nl
|
||||
<< " Known patch names:" << nl
|
||||
<< mesh_.boundaryMesh().names() << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
// Could also check this
|
||||
#if 0
|
||||
if (!returnReduce(bool(numFaces), orOp<bool>()))
|
||||
{
|
||||
WarningInFunction
|
||||
<< type() << ' ' << name() << ": "
|
||||
<< regionTypeNames_[regionType_] << '(' << regionName_ << "):" << nl
|
||||
<< " The patch specification: "
|
||||
<< flatOutput(selectionNames_) << nl
|
||||
<< " resulted in 0 faces" << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
#endif
|
||||
|
||||
faceId_.resize(numFaces);
|
||||
facePatchId_.resize(numFaces);
|
||||
faceFlip_.resize(numFaces);
|
||||
nFaces_ = returnReduce(faceId_.size(), sumOp<label>());
|
||||
nFaces_ = returnReduce(numFaces, sumOp<label>());
|
||||
|
||||
numFaces = 0;
|
||||
for (const label patchi : patchIds)
|
||||
@ -350,6 +369,74 @@ void Foam::functionObjects::fieldValues::surfaceFieldValue::setPatchFaces()
|
||||
|
||||
numFaces += len;
|
||||
}
|
||||
|
||||
if (!nFaces_)
|
||||
{
|
||||
// Raise warning or error
|
||||
refPtr<OSstream> os;
|
||||
bool fatal = false;
|
||||
|
||||
++nWarnings_; // Always increment (even if ignore etc)
|
||||
|
||||
switch (emptySurfaceError_)
|
||||
{
|
||||
case error::handlerTypes::IGNORE:
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
case error::handlerTypes::WARN:
|
||||
{
|
||||
if (nWarnings_ <= maxWarnings)
|
||||
{
|
||||
os.ref(WarningInFunction);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// STRICT / DEFAULT
|
||||
default:
|
||||
{
|
||||
os.ref(FatalErrorInFunction);
|
||||
fatal = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (os)
|
||||
{
|
||||
os.ref()
|
||||
<< type() << ' ' << name() << ": "
|
||||
<< regionTypeNames_[regionType_]
|
||||
<< '(' << regionName_ << "):" << nl;
|
||||
|
||||
if (patchIds.empty())
|
||||
{
|
||||
os.ref()
|
||||
<< " No matching patches: "
|
||||
<< flatOutput(selectionNames_) << nl
|
||||
<< " Known patch names:" << nl
|
||||
<< mesh_.boundaryMesh().names() << nl;
|
||||
}
|
||||
else
|
||||
{
|
||||
os.ref()
|
||||
<< " The patches: "
|
||||
<< flatOutput(selectionNames_) << nl
|
||||
<< " resulted in 0 faces" << nl;
|
||||
}
|
||||
|
||||
if (fatal)
|
||||
{
|
||||
FatalError<< exit(FatalError);
|
||||
}
|
||||
else if (nWarnings_ == maxWarnings)
|
||||
{
|
||||
os.ref()
|
||||
<< "... suppressing further warnings." << nl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -583,20 +670,30 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::update()
|
||||
return false;
|
||||
}
|
||||
|
||||
// Reset some values
|
||||
totalArea_ = 0;
|
||||
nFaces_ = 0;
|
||||
bool checkEmptyFaces = true;
|
||||
|
||||
switch (regionType_)
|
||||
{
|
||||
case stFaceZone:
|
||||
{
|
||||
// Raises warning or error internally, don't check again
|
||||
setFaceZoneFaces();
|
||||
checkEmptyFaces = false;
|
||||
break;
|
||||
}
|
||||
case stPatch:
|
||||
{
|
||||
// Raises warning or error internally, don't check again
|
||||
setPatchFaces();
|
||||
checkEmptyFaces = false;
|
||||
break;
|
||||
}
|
||||
case stObject:
|
||||
{
|
||||
// TBD: special handling of cast errors?
|
||||
const polySurface& s = dynamicCast<const polySurface>(obr());
|
||||
nFaces_ = returnReduce(s.size(), sumOp<label>());
|
||||
break;
|
||||
@ -610,23 +707,76 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::update()
|
||||
// Compiler warning if we forgot an enumeration
|
||||
}
|
||||
|
||||
if (nFaces_ == 0)
|
||||
if (nFaces_)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< type() << ' ' << name() << ": "
|
||||
<< regionTypeNames_[regionType_] << '(' << regionName_ << "):" << nl
|
||||
<< " Region has no faces" << exit(FatalError);
|
||||
// Appears to be successful
|
||||
needsUpdate_ = false;
|
||||
totalArea_ = totalArea(); // Update the area
|
||||
nWarnings_ = 0u; // Reset the warnings counter
|
||||
}
|
||||
else if (checkEmptyFaces)
|
||||
{
|
||||
// Raise warning or error
|
||||
refPtr<OSstream> os;
|
||||
bool fatal = false;
|
||||
|
||||
totalArea_ = totalArea();
|
||||
++nWarnings_; // Always increment (even if ignore etc)
|
||||
|
||||
switch (emptySurfaceError_)
|
||||
{
|
||||
case error::handlerTypes::IGNORE:
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
case error::handlerTypes::WARN:
|
||||
{
|
||||
if (nWarnings_ <= maxWarnings)
|
||||
{
|
||||
os.ref(WarningInFunction);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// STRICT / DEFAULT
|
||||
default:
|
||||
{
|
||||
os.ref(FatalErrorInFunction);
|
||||
fatal = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (os)
|
||||
{
|
||||
os.ref()
|
||||
<< type() << ' ' << name() << ": "
|
||||
<< regionTypeNames_[regionType_]
|
||||
<< '(' << regionName_ << "):" << nl
|
||||
<< " Region has no faces" << endl;
|
||||
|
||||
if (fatal)
|
||||
{
|
||||
FatalError<< exit(FatalError);
|
||||
}
|
||||
else if (nWarnings_ == maxWarnings)
|
||||
{
|
||||
os.ref()
|
||||
<< "... suppressing further warnings." << nl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Log << " total faces = " << nFaces_ << nl
|
||||
<< " total area = " << totalArea_ << nl
|
||||
<< endl;
|
||||
|
||||
writeFileHeader(file());
|
||||
// Emit file header on success or change of state
|
||||
if (nWarnings_ <= 1)
|
||||
{
|
||||
writeFileHeader(file());
|
||||
}
|
||||
|
||||
needsUpdate_ = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -919,10 +1069,12 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
|
||||
),
|
||||
needsUpdate_(true),
|
||||
writeArea_(false),
|
||||
emptySurfaceError_(error::handlerTypes::DEFAULT),
|
||||
selectionNames_(),
|
||||
weightFieldNames_(),
|
||||
totalArea_(0),
|
||||
nFaces_(0),
|
||||
nWarnings_(0),
|
||||
faceId_(),
|
||||
facePatchId_(),
|
||||
faceFlip_()
|
||||
@ -953,10 +1105,12 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
|
||||
),
|
||||
needsUpdate_(true),
|
||||
writeArea_(false),
|
||||
emptySurfaceError_(error::handlerTypes::DEFAULT),
|
||||
selectionNames_(),
|
||||
weightFieldNames_(),
|
||||
totalArea_(0),
|
||||
nFaces_(0),
|
||||
nWarnings_(0),
|
||||
faceId_(),
|
||||
facePatchId_(),
|
||||
faceFlip_()
|
||||
@ -976,10 +1130,19 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::read
|
||||
|
||||
needsUpdate_ = true;
|
||||
writeArea_ = dict.getOrDefault("writeArea", false);
|
||||
emptySurfaceError_ = error::handlerNames.getOrDefault
|
||||
(
|
||||
"empty-surface",
|
||||
dict,
|
||||
error::handlerTypes::DEFAULT,
|
||||
true // Failsafe behaviour
|
||||
);
|
||||
|
||||
weightFieldNames_.clear();
|
||||
|
||||
totalArea_ = 0;
|
||||
nFaces_ = 0;
|
||||
nWarnings_ = 0;
|
||||
faceId_.clear();
|
||||
facePatchId_.clear();
|
||||
faceFlip_.clear();
|
||||
@ -1161,7 +1324,15 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::write()
|
||||
|
||||
if (writeArea_)
|
||||
{
|
||||
totalArea_ = totalArea();
|
||||
// Update the area
|
||||
if (!nFaces_)
|
||||
{
|
||||
totalArea_ = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
totalArea_ = totalArea();
|
||||
}
|
||||
Log << " total area = " << totalArea_ << endl;
|
||||
|
||||
if (operation_ != opNone && Pstream::master())
|
||||
@ -1170,6 +1341,18 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::write()
|
||||
}
|
||||
}
|
||||
|
||||
if (!nFaces_)
|
||||
{
|
||||
// Early exit on error
|
||||
if (operation_ != opNone)
|
||||
{
|
||||
file() << endl;
|
||||
Log << endl;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Many operations use the Sf field
|
||||
vectorField Sf;
|
||||
if (usesSf())
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2015-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -88,6 +88,7 @@ Usage
|
||||
scaleFactor 1.0;
|
||||
writeArea false;
|
||||
surfaceFormat none;
|
||||
empty-surface warn; // default | warn | ignore | strict
|
||||
|
||||
// Optional (inherited) entries
|
||||
...
|
||||
@ -111,6 +112,7 @@ Usage
|
||||
writeArea | Write the surface area | bool | no | false
|
||||
surfaceFormat | Output value format | word <!--
|
||||
--> | conditional on writeFields | none
|
||||
empty-surface | Error handling for empty surfaces | enum | no | default
|
||||
\endtable
|
||||
|
||||
The inherited entries are elaborated in:
|
||||
@ -401,6 +403,9 @@ protected:
|
||||
//- Optionally write the area of the surfaceFieldValue
|
||||
bool writeArea_;
|
||||
|
||||
//- Handling of empty surfaces (nFaces = 0). Default is Fatal.
|
||||
error::handlerTypes emptySurfaceError_;
|
||||
|
||||
//- Extended selections
|
||||
wordRes selectionNames_;
|
||||
|
||||
@ -413,6 +418,9 @@ protected:
|
||||
//- Global number of faces
|
||||
label nFaces_;
|
||||
|
||||
//- Number of warnings emitted since the last valid update
|
||||
unsigned nWarnings_;
|
||||
|
||||
|
||||
// If operating on mesh faces (faceZone, patch)
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ void Foam::functionObjects::nearWallFields::calcAddressing()
|
||||
const vectorField nf(patch.nf());
|
||||
const vectorField faceCellCentres(patch.patch().faceCellCentres());
|
||||
const labelUList& faceCells = patch.patch().faceCells();
|
||||
const vectorField::subField& faceCentres = patch.patch().faceCentres();
|
||||
const vectorField::subField faceCentres = patch.patch().faceCentres();
|
||||
|
||||
forAll(patch, patchFacei)
|
||||
{
|
||||
|
||||
@ -419,8 +419,6 @@ void Foam::ParticleCollector<CloudType>::write()
|
||||
massTotal_[facei] += mass_[facei];
|
||||
}
|
||||
|
||||
const label proci = Pstream::myProcNo();
|
||||
|
||||
Info<< type() << " output:" << nl;
|
||||
|
||||
Field<scalar> faceMassTotal(mass_.size(), Zero);
|
||||
@ -434,15 +432,11 @@ void Foam::ParticleCollector<CloudType>::write()
|
||||
scalar sumAverageMFR = 0.0;
|
||||
forAll(faces_, facei)
|
||||
{
|
||||
scalarList allProcMass(Pstream::nProcs());
|
||||
allProcMass[proci] = massTotal_[facei];
|
||||
Pstream::gatherList(allProcMass);
|
||||
faceMassTotal[facei] += sum(allProcMass);
|
||||
faceMassTotal[facei] +=
|
||||
returnReduce(massTotal_[facei], sumOp<scalar>());
|
||||
|
||||
scalarList allProcMassFlowRate(Pstream::nProcs());
|
||||
allProcMassFlowRate[proci] = massFlowRate_[facei];
|
||||
Pstream::gatherList(allProcMassFlowRate);
|
||||
faceMassFlowRate[facei] += sum(allProcMassFlowRate);
|
||||
faceMassFlowRate[facei] +=
|
||||
returnReduce(massFlowRate_[facei], sumOp<scalar>());
|
||||
|
||||
sumTotalMass += faceMassTotal[facei];
|
||||
sumAverageMFR += faceMassFlowRate[facei];
|
||||
|
||||
@ -37,7 +37,7 @@ Description
|
||||
Typical use might be to e.g. average face centres to points on a patch
|
||||
|
||||
const labelListList& pointFaces = pp.pointFaces();
|
||||
const pointField& faceCentres = pp.faceCentres();
|
||||
const vectorField::subField faceCentres = pp.faceCentres();
|
||||
|
||||
Field<weightedPosition> avgBoundary(pointFaces.size());
|
||||
|
||||
|
||||
@ -1058,6 +1058,8 @@ void Foam::mappedPatchBase::calcMapping() const
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateTime_.setUpToDate();
|
||||
}
|
||||
|
||||
|
||||
@ -1223,7 +1225,20 @@ Foam::mappedPatchBase::mappedPatchBase(const polyPatch& pp)
|
||||
AMIReverse_(false),
|
||||
AMIPtr_(new faceAreaWeightAMI(true, AMIReverse_)),
|
||||
surfPtr_(nullptr),
|
||||
surfDict_(fileName("surface"))
|
||||
surfDict_(fileName("surface")),
|
||||
updateTime_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"updateTime",
|
||||
patch_.boundaryMesh().mesh().pointsInstance(),
|
||||
patch_.boundaryMesh().mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
dimensionedScalar("time", dimTime, -GREAT)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
@ -1257,7 +1272,20 @@ Foam::mappedPatchBase::mappedPatchBase
|
||||
AMIReverse_(false),
|
||||
AMIPtr_(new faceAreaWeightAMI(true, AMIReverse_)),
|
||||
surfPtr_(nullptr),
|
||||
surfDict_(fileName("surface"))
|
||||
surfDict_(fileName("surface")),
|
||||
updateTime_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"updateTime",
|
||||
patch_.boundaryMesh().mesh().pointsInstance(),
|
||||
patch_.boundaryMesh().mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
dimensionedScalar("time", dimTime, -GREAT)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
@ -1291,7 +1319,20 @@ Foam::mappedPatchBase::mappedPatchBase
|
||||
AMIReverse_(false),
|
||||
AMIPtr_(new faceAreaWeightAMI(true, AMIReverse_)),
|
||||
surfPtr_(nullptr),
|
||||
surfDict_(fileName("surface"))
|
||||
surfDict_(fileName("surface")),
|
||||
updateTime_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"updateTime",
|
||||
patch_.boundaryMesh().mesh().pointsInstance(),
|
||||
patch_.boundaryMesh().mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
dimensionedScalar("time", dimTime, -GREAT)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
@ -1325,7 +1366,20 @@ Foam::mappedPatchBase::mappedPatchBase
|
||||
AMIReverse_(false),
|
||||
AMIPtr_(new faceAreaWeightAMI(true, AMIReverse_)),
|
||||
surfPtr_(nullptr),
|
||||
surfDict_(fileName("surface"))
|
||||
surfDict_(fileName("surface")),
|
||||
updateTime_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"updateTime",
|
||||
patch_.boundaryMesh().mesh().pointsInstance(),
|
||||
patch_.boundaryMesh().mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
dimensionedScalar("time", dimTime, -GREAT)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
@ -1364,7 +1418,20 @@ Foam::mappedPatchBase::mappedPatchBase
|
||||
)
|
||||
),
|
||||
surfPtr_(nullptr),
|
||||
surfDict_(dict.subOrEmptyDict("surface"))
|
||||
surfDict_(dict.subOrEmptyDict("surface")),
|
||||
updateTime_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"updateTime",
|
||||
patch_.boundaryMesh().mesh().pointsInstance(),
|
||||
patch_.boundaryMesh().mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
dimensionedScalar("time", dimTime, -GREAT)
|
||||
)
|
||||
{
|
||||
if (!coupleGroup_.valid())
|
||||
{
|
||||
@ -1454,7 +1521,20 @@ Foam::mappedPatchBase::mappedPatchBase
|
||||
)
|
||||
),
|
||||
surfPtr_(nullptr),
|
||||
surfDict_(dict.subOrEmptyDict("surface"))
|
||||
surfDict_(dict.subOrEmptyDict("surface")),
|
||||
updateTime_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"updateTime",
|
||||
patch_.boundaryMesh().mesh().pointsInstance(),
|
||||
patch_.boundaryMesh().mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
dimensionedScalar("time", dimTime, -GREAT)
|
||||
)
|
||||
{
|
||||
if (mode != NEARESTPATCHFACE && mode != NEARESTPATCHFACEAMI)
|
||||
{
|
||||
@ -1507,7 +1587,20 @@ Foam::mappedPatchBase::mappedPatchBase
|
||||
AMIReverse_(mpb.AMIReverse_),
|
||||
AMIPtr_(mpb.AMIPtr_->clone()),
|
||||
surfPtr_(nullptr),
|
||||
surfDict_(mpb.surfDict_)
|
||||
surfDict_(mpb.surfDict_),
|
||||
updateTime_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"updateTime",
|
||||
patch_.boundaryMesh().mesh().pointsInstance(),
|
||||
patch_.boundaryMesh().mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
dimensionedScalar("time", dimTime, -GREAT)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
@ -1545,7 +1638,20 @@ Foam::mappedPatchBase::mappedPatchBase
|
||||
AMIReverse_(mpb.AMIReverse_),
|
||||
AMIPtr_(mpb.AMIPtr_->clone()),
|
||||
surfPtr_(nullptr),
|
||||
surfDict_(mpb.surfDict_)
|
||||
surfDict_(mpb.surfDict_),
|
||||
updateTime_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"updateTime",
|
||||
patch_.boundaryMesh().mesh().pointsInstance(),
|
||||
patch_.boundaryMesh().mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
dimensionedScalar("time", dimTime, -GREAT)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020, 2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -96,6 +96,7 @@ SourceFiles
|
||||
#include "pointIndexHit.H"
|
||||
#include "AMIPatchToPatchInterpolation.H"
|
||||
#include "coupleGroupIdentifier.H"
|
||||
#include "uniformDimensionedFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -291,6 +292,9 @@ protected:
|
||||
//- Dictionary storing projection surface description
|
||||
dictionary surfDict_;
|
||||
|
||||
//- Update time, e.g. for topo-changes
|
||||
mutable uniformDimensionedScalarField updateTime_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020, 2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -167,13 +167,15 @@ inline bool Foam::mappedPatchBase::sameRegion() const
|
||||
inline const Foam::mapDistribute& Foam::mappedPatchBase::map() const
|
||||
{
|
||||
const polyMesh& thisMesh = patch_.boundaryMesh().mesh();
|
||||
bool topoChange =
|
||||
(sameWorld() && sampleMesh().topoChanging())
|
||||
|| thisMesh.topoChanging();
|
||||
|
||||
if (topoChange)
|
||||
if (!thisMesh.upToDatePoints(updateTime_))
|
||||
{
|
||||
mapPtr_.reset(nullptr);
|
||||
|
||||
if (AMIPtr_)
|
||||
{
|
||||
AMIPtr_->upToDate() = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!mapPtr_)
|
||||
@ -191,15 +193,19 @@ inline const Foam::AMIPatchToPatchInterpolation& Foam::mappedPatchBase::AMI
|
||||
) const
|
||||
{
|
||||
const polyMesh& thisMesh = patch_.boundaryMesh().mesh();
|
||||
bool topoChange =
|
||||
(sameWorld() && sampleMesh().topoChanging())
|
||||
|| thisMesh.topoChanging();
|
||||
|
||||
if (topoChange || forceUpdate)
|
||||
if (forceUpdate)
|
||||
{
|
||||
AMIPtr_->upToDate() = false;
|
||||
}
|
||||
|
||||
if (!thisMesh.upToDatePoints(updateTime_))
|
||||
{
|
||||
mapPtr_.reset(nullptr);
|
||||
|
||||
AMIPtr_->upToDate() = false;
|
||||
}
|
||||
|
||||
calcAMI();
|
||||
|
||||
return *AMIPtr_;
|
||||
|
||||
@ -70,14 +70,15 @@ void Foam::mappedPatchBase::distribute
|
||||
}
|
||||
default:
|
||||
{
|
||||
const auto& map = this->map();
|
||||
mapDistributeBase::distribute
|
||||
(
|
||||
Pstream::defaultCommsType,
|
||||
map().schedule(),
|
||||
map().constructSize(),
|
||||
map().subMap(),
|
||||
map.schedule(),
|
||||
map.constructSize(),
|
||||
map.subMap(),
|
||||
false,
|
||||
map().constructMap(),
|
||||
map.constructMap(),
|
||||
false,
|
||||
lst,
|
||||
Type(Zero),
|
||||
@ -139,14 +140,15 @@ void Foam::mappedPatchBase::reverseDistribute
|
||||
default:
|
||||
{
|
||||
label cSize = sampleSize();
|
||||
const auto& map = this->map();
|
||||
mapDistributeBase::distribute
|
||||
(
|
||||
Pstream::defaultCommsType,
|
||||
map().schedule(),
|
||||
map.schedule(),
|
||||
cSize,
|
||||
map().constructMap(),
|
||||
map.constructMap(),
|
||||
false,
|
||||
map().subMap(),
|
||||
map.subMap(),
|
||||
false,
|
||||
lst,
|
||||
Type(Zero),
|
||||
|
||||
@ -155,7 +155,7 @@ bool Foam::vtk::writePointSet
|
||||
|
||||
if (parallel)
|
||||
{
|
||||
vtk::writeListParallel(format(), mesh.points(), pointLabels);
|
||||
vtk::writeListParallel(format.ref(), mesh.points(), pointLabels);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -39,6 +39,7 @@ https://www.geometrictools.com/Documentation/DistancePointEllipseEllipsoid.pdf
|
||||
|
||||
#include "searchableSphere.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include <array>
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -304,6 +304,7 @@ scalar surfaceNoise::writeSurfaceData
|
||||
false // serial - already merged
|
||||
);
|
||||
|
||||
writerPtr_->nFields() = 1; // Legacy VTK
|
||||
writerPtr_->write(title, allData);
|
||||
|
||||
writerPtr_->endTime();
|
||||
@ -336,6 +337,7 @@ scalar surfaceNoise::writeSurfaceData
|
||||
false // serial - already merged
|
||||
);
|
||||
|
||||
writerPtr_->nFields() = 1; // Legacy VTK
|
||||
writerPtr_->write(title, data);
|
||||
|
||||
writerPtr_->endTime();
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -249,27 +249,41 @@ Foam::tmp<Foam::labelField> Foam::regionModels::regionModel1D::moveMesh
|
||||
vectorField newDelta(cells.size() + 1, Zero);
|
||||
|
||||
label j = 0;
|
||||
forAllReverse(cells, i)
|
||||
forAll(cells, i)
|
||||
{
|
||||
const label celli = cells[i];
|
||||
newDelta[j+1] = (deltaV[celli]/mag(sf))*n + newDelta[j];
|
||||
j++;
|
||||
}
|
||||
|
||||
forAll(faces, i)
|
||||
// Move the back face first
|
||||
const face of = regionMesh().faces()[oFace];
|
||||
{
|
||||
scalar omagV = mag(newDelta[newDelta.size()-1]);
|
||||
|
||||
if (!frozen[cells.size()-1] && (omagV > ROOTVSMALL))
|
||||
{
|
||||
forAll(of, pti)
|
||||
{
|
||||
const label pointi = of[pti];
|
||||
newPoints[pointi] =
|
||||
oldPoints[pointi] - newDelta[newDelta.size()-1];
|
||||
}
|
||||
}
|
||||
}
|
||||
// Do internal faces
|
||||
for (label i=0; i < faces.size(); i++)
|
||||
{
|
||||
const label facei = faces[i];
|
||||
const face f = regionMesh().faces()[facei];
|
||||
|
||||
if (!frozen[i])
|
||||
scalar magV = mag(newDelta[i]);
|
||||
if (!frozen[i] && magV > 0)
|
||||
{
|
||||
forAll(f, pti)
|
||||
{
|
||||
const label pointi = f[pti];
|
||||
|
||||
newPoints[pointi] =
|
||||
oldPoints[pointi]
|
||||
+ newDelta[newDelta.size() - 1 - i];
|
||||
newPoints[pointi] = oldPoints[pointi] - newDelta[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -107,7 +107,7 @@ void Foam::polySurface::storeField
|
||||
|
||||
if (dimfield)
|
||||
{
|
||||
dimfield->dimensions() = dims;
|
||||
dimfield->dimensions().reset(dims); // Dimensions may have changed
|
||||
dimfield->field() = values;
|
||||
}
|
||||
else
|
||||
@ -148,7 +148,7 @@ void Foam::polySurface::storeField
|
||||
|
||||
if (dimfield)
|
||||
{
|
||||
dimfield->dimensions() = dims;
|
||||
dimfield->dimensions().reset(dims); // Dimensions may have changed
|
||||
dimfield->field() = std::move(values);
|
||||
}
|
||||
else
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -45,7 +45,7 @@ void Foam::surfMesh::storeField
|
||||
|
||||
if (dimfield)
|
||||
{
|
||||
dimfield->dimensions() = dims;
|
||||
dimfield->dimensions().reset(dims); // Dimensions may have changed
|
||||
dimfield->field() = values;
|
||||
}
|
||||
else
|
||||
@ -85,7 +85,7 @@ void Foam::surfMesh::storeField
|
||||
|
||||
if (dimfield)
|
||||
{
|
||||
dimfield->dimensions() = dims;
|
||||
dimfield->dimensions().reset(dims); // Dimensions may have changed
|
||||
dimfield->field() = std::move(values);
|
||||
}
|
||||
else
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2015 OpenFOAM Foundation
|
||||
Copyright (C) 2015-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -108,6 +108,57 @@ Foam::surfaceWriters::boundaryDataWriter::boundaryDataWriter
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::surfaceWriters::boundaryDataWriter::serialWriteGeometry
|
||||
(
|
||||
const regIOobject& iopts,
|
||||
const meshedSurf& surf
|
||||
)
|
||||
{
|
||||
const pointField& points = surf.points();
|
||||
const faceList& faces = surf.faces();
|
||||
|
||||
if (verbose_)
|
||||
{
|
||||
if (this->isPointData())
|
||||
{
|
||||
Info<< "Writing points: " << iopts.objectPath() << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Writing face centres: " << iopts.objectPath() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Like regIOobject::writeObject without instance() adaptation
|
||||
// since this would write to e.g. 0/ instead of postProcessing/
|
||||
|
||||
OFstream osGeom(iopts.objectPath(), streamOpt_);
|
||||
|
||||
if (header_)
|
||||
{
|
||||
iopts.writeHeader(osGeom);
|
||||
}
|
||||
|
||||
if (this->isPointData())
|
||||
{
|
||||
// Just like writeData, but without copying beforehand
|
||||
osGeom << points;
|
||||
}
|
||||
else
|
||||
{
|
||||
primitivePatch pp(SubList<face>(faces), points);
|
||||
|
||||
// Just like writeData, but without copying beforehand
|
||||
osGeom << pp.faceCentres();
|
||||
}
|
||||
|
||||
if (header_)
|
||||
{
|
||||
iopts.writeEndDivider(osGeom);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::fileName Foam::surfaceWriters::boundaryDataWriter::write()
|
||||
{
|
||||
checkOpen();
|
||||
@ -129,6 +180,7 @@ Foam::fileName Foam::surfaceWriters::boundaryDataWriter::write()
|
||||
mkDir(surfaceDir);
|
||||
}
|
||||
|
||||
// Write sample locations
|
||||
pointIOField iopts
|
||||
(
|
||||
IOobject
|
||||
@ -140,30 +192,9 @@ Foam::fileName Foam::surfaceWriters::boundaryDataWriter::write()
|
||||
false
|
||||
)
|
||||
);
|
||||
iopts.note() = (this->isPointData() ? "point data" : "face data");
|
||||
|
||||
if (verbose_)
|
||||
{
|
||||
Info<< "Writing points: " << iopts.objectPath() << endl;
|
||||
}
|
||||
|
||||
|
||||
// Like regIOobject::writeObject without instance() adaptation
|
||||
// since this would write to e.g. 0/ instead of postProcessing/
|
||||
|
||||
OFstream osGeom(iopts.objectPath(), streamOpt_);
|
||||
|
||||
if (header_)
|
||||
{
|
||||
iopts.writeHeader(osGeom);
|
||||
}
|
||||
|
||||
// Just like writeData, but without copying beforehand
|
||||
osGeom << surf.points();
|
||||
|
||||
if (header_)
|
||||
{
|
||||
iopts.writeEndDivider(osGeom);
|
||||
}
|
||||
serialWriteGeometry(iopts, surf);
|
||||
}
|
||||
|
||||
wroteGeom_ = true;
|
||||
@ -212,67 +243,29 @@ Foam::fileName Foam::surfaceWriters::boundaryDataWriter::writeTemplate
|
||||
|
||||
if (Pstream::master() || !parallel_)
|
||||
{
|
||||
const pointField& points = surf.points();
|
||||
const faceList& faces = surf.faces();
|
||||
|
||||
if (!isDir(outputFile.path()))
|
||||
{
|
||||
mkDir(outputFile.path());
|
||||
}
|
||||
|
||||
pointIOField iopts
|
||||
(
|
||||
IOobject
|
||||
// Write sample locations
|
||||
{
|
||||
pointIOField iopts
|
||||
(
|
||||
surfaceDir/"points",
|
||||
*dummyTimePtr,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
IOobject
|
||||
(
|
||||
surfaceDir/"points",
|
||||
*dummyTimePtr,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
iopts.note() = (this->isPointData() ? "point data" : "face data");
|
||||
|
||||
if (verbose_)
|
||||
{
|
||||
if (this->isPointData())
|
||||
{
|
||||
Info<< "Writing points: " << iopts.objectPath() << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Writing face centres: " << iopts.objectPath() << endl;
|
||||
}
|
||||
serialWriteGeometry(iopts, surf);
|
||||
}
|
||||
|
||||
// Like regIOobject::writeObject without instance() adaptation
|
||||
// since this would write to e.g. 0/ instead of postProcessing/
|
||||
|
||||
OFstream osGeom(iopts.objectPath(), streamOpt_);
|
||||
|
||||
if (header_)
|
||||
{
|
||||
iopts.writeHeader(osGeom);
|
||||
}
|
||||
|
||||
if (this->isPointData())
|
||||
{
|
||||
// Just like writeData, but without copying beforehand
|
||||
osGeom << points;
|
||||
}
|
||||
else
|
||||
{
|
||||
primitivePatch pp(SubList<face>(faces), points);
|
||||
|
||||
// Just like writeData, but without copying beforehand
|
||||
osGeom << pp.faceCentres();
|
||||
}
|
||||
|
||||
if (header_)
|
||||
{
|
||||
iopts.writeEndDivider(osGeom);
|
||||
}
|
||||
|
||||
|
||||
// Write field
|
||||
{
|
||||
IOField<Type> iofld
|
||||
@ -286,6 +279,7 @@ Foam::fileName Foam::surfaceWriters::boundaryDataWriter::writeTemplate
|
||||
false
|
||||
)
|
||||
);
|
||||
iofld.note() = (this->isPointData() ? "point data" : "face data");
|
||||
|
||||
OFstream osField(iofld.objectPath(), streamOpt_);
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2015-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -134,6 +134,10 @@ SourceFiles
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward Declarations
|
||||
class regIOobject;
|
||||
|
||||
namespace surfaceWriters
|
||||
{
|
||||
|
||||
@ -159,6 +163,9 @@ class boundaryDataWriter
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Write serial surface geometry to "points" file.
|
||||
void serialWriteGeometry(const regIOobject&, const meshedSurf& surf);
|
||||
|
||||
//- Templated write field operation
|
||||
template<class Type>
|
||||
fileName writeTemplate
|
||||
|
||||
@ -140,17 +140,6 @@ Foam::radiation::radiativeIntensityRay::radiativeIntensityRay
|
||||
|
||||
if (mesh_.nSolutionD() == 2)
|
||||
{
|
||||
// Omega for 2D
|
||||
omega_ = deltaPhi;
|
||||
|
||||
// dAve for 2D
|
||||
dAve_ = vector
|
||||
(
|
||||
2*sinPhi*Foam::sin(0.5*deltaPhi),
|
||||
2*cosPhi*Foam::sin(0.5*deltaPhi),
|
||||
0
|
||||
);
|
||||
|
||||
vector meshDir(Zero);
|
||||
if (dom_.meshOrientation() != vector::zero)
|
||||
{
|
||||
@ -172,7 +161,6 @@ Foam::radiation::radiativeIntensityRay::radiativeIntensityRay
|
||||
|
||||
dAve_ = coordRot & dAve_;
|
||||
d_ = coordRot & d_;
|
||||
|
||||
}
|
||||
else if (mesh_.nSolutionD() == 1)
|
||||
{
|
||||
@ -195,9 +183,6 @@ Foam::radiation::radiativeIntensityRay::radiativeIntensityRay
|
||||
|
||||
dAve_ = (dAve_ & normal)*meshDir;
|
||||
d_ = (d_ & normal)*meshDir;
|
||||
|
||||
// Omega normalization for 1D
|
||||
omega_ /= 2;
|
||||
}
|
||||
|
||||
autoPtr<volScalarField> IDefaultPtr;
|
||||
|
||||
@ -136,7 +136,7 @@ void Foam::faceReflecting::initialise(const dictionary& coeffs)
|
||||
forAll(patches, patchI)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const pointField& cf = pp.faceCentres();
|
||||
const vectorField::subField cf = pp.faceCentres();
|
||||
|
||||
if (!pp.coupled() && !isA<cyclicAMIPolyPatch>(pp))
|
||||
{
|
||||
|
||||
@ -155,7 +155,7 @@ void Foam::faceShading::calculate()
|
||||
forAll(patches, patchI)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const pointField& cf = pp.faceCentres();
|
||||
const vectorField::subField cf = pp.faceCentres();
|
||||
|
||||
if (!pp.coupled() && !isA<cyclicAMIPolyPatch>(pp))
|
||||
{
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -35,8 +35,8 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef solidArrheniusReactionRate_H
|
||||
#define solidArrheniusReactionRate_H
|
||||
#ifndef Foam_solidArrheniusReactionRate_H
|
||||
#define Foam_solidArrheniusReactionRate_H
|
||||
|
||||
#include "scalarField.H"
|
||||
#include "typeInfo.H"
|
||||
@ -46,23 +46,27 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
|
||||
// Forward Declarations
|
||||
class solidArrheniusReactionRate;
|
||||
|
||||
Ostream& operator<<(Ostream&, const solidArrheniusReactionRate&);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class solidArrheniusReactionRate Declaration
|
||||
Class solidArrheniusReactionRate Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class solidArrheniusReactionRate
|
||||
{
|
||||
// Private data
|
||||
// Private Data
|
||||
|
||||
//- Pre-exponential factor
|
||||
scalar A_;
|
||||
|
||||
//- Activation temperature
|
||||
scalar Ta_;
|
||||
|
||||
//- Critical temperature
|
||||
scalar Tcrit_;
|
||||
|
||||
|
||||
@ -99,6 +103,8 @@ public:
|
||||
return "Arrhenius";
|
||||
}
|
||||
|
||||
//- Return reaction rate constant
|
||||
// frequency of collisions resulting in a reaction
|
||||
inline scalar operator()
|
||||
(
|
||||
const scalar p,
|
||||
@ -107,7 +113,7 @@ public:
|
||||
) const;
|
||||
|
||||
|
||||
//- Write to stream
|
||||
//- Write to stream
|
||||
inline void write(Ostream& os) const;
|
||||
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -32,7 +33,6 @@ inline Foam::solidArrheniusReactionRate::solidArrheniusReactionRate
|
||||
const scalar A,
|
||||
const scalar Ta,
|
||||
const scalar Tcrit
|
||||
//const scalar nReact
|
||||
)
|
||||
:
|
||||
A_(A),
|
||||
@ -62,18 +62,12 @@ inline Foam::scalar Foam::solidArrheniusReactionRate::operator()
|
||||
const scalarField&
|
||||
) const
|
||||
{
|
||||
scalar ak = A_;
|
||||
|
||||
if (T < Tcrit_)
|
||||
{
|
||||
ak *= 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ak *= exp(-Ta_/T);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ak;
|
||||
return A_*exp(-Ta_/T);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,170 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::solidIsothermalReactionRate
|
||||
|
||||
Description
|
||||
Isothermal reaction rate for solids
|
||||
|
||||
Usage
|
||||
Minimal example:
|
||||
\verbatim
|
||||
{
|
||||
// Mandatory entries
|
||||
C <scalar>;
|
||||
Cp <scalar>;
|
||||
Tpc <scalar>;
|
||||
Elat <scalar>;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
where the entries mean:
|
||||
\table
|
||||
Property | Description | Type | Reqd | Deflt
|
||||
C | Model constant | scalar | yes | -
|
||||
Cp | Specific heat of solid material (assumed constant) | scalar | yes | -
|
||||
Tpc | Phase change temperature | scalar | yes | -
|
||||
Elat | Latent heat of phase change | scalar | yes | -
|
||||
\endtable
|
||||
|
||||
Note
|
||||
- \c Elat, the latent energy is defined in the present
|
||||
implementation as a negative value (using the convention
|
||||
endothermic process has negative enthalpy.)
|
||||
|
||||
SourceFiles
|
||||
solidIsothermalReactionRateI.H
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Foam_solidIsothermalReactionRate_H
|
||||
#define Foam_solidIsothermalReactionRate_H
|
||||
|
||||
#include "scalarField.H"
|
||||
#include "typeInfo.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward Declarations
|
||||
class solidIsothermalReactionRate;
|
||||
|
||||
Ostream& operator<<(Ostream&, const solidIsothermalReactionRate&);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class solidIsothermalReactionRate Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class solidIsothermalReactionRate
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Model constant
|
||||
scalar C_;
|
||||
|
||||
//- Specific heat of solid material (assumed constant)
|
||||
scalar Cp_;
|
||||
|
||||
//- Phase change temperature
|
||||
scalar Tpc_;
|
||||
|
||||
//- Latent heat of phase change
|
||||
scalar Elat_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
inline solidIsothermalReactionRate
|
||||
(
|
||||
const scalar C,
|
||||
const scalar Cp,
|
||||
const scalar Tpc,
|
||||
const scalar Elat
|
||||
);
|
||||
|
||||
|
||||
//- Construct from dictionary
|
||||
inline solidIsothermalReactionRate
|
||||
(
|
||||
const speciesTable& species,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~solidIsothermalReactionRate() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the type name
|
||||
static word type()
|
||||
{
|
||||
return "Isothermal";
|
||||
}
|
||||
|
||||
//- Return reaction rate constant
|
||||
// frequency of collisions resulting in a reaction
|
||||
inline scalar operator()
|
||||
(
|
||||
const scalar p,
|
||||
const scalar T,
|
||||
const scalarField& c
|
||||
) const;
|
||||
|
||||
//- Write to stream
|
||||
inline void write(Ostream& os) const;
|
||||
|
||||
|
||||
// Ostream Operator
|
||||
|
||||
inline friend Ostream& operator<<
|
||||
(
|
||||
Ostream&,
|
||||
const solidIsothermalReactionRate&
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "solidIsothermalReactionRateI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,96 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
inline Foam::solidIsothermalReactionRate::solidIsothermalReactionRate
|
||||
(
|
||||
const scalar C,
|
||||
const scalar Cp,
|
||||
const scalar Tpc,
|
||||
const scalar Elat
|
||||
)
|
||||
:
|
||||
C_(C),
|
||||
Cp_(Cp),
|
||||
Tpc_(Tpc),
|
||||
Elat_(Elat)
|
||||
{}
|
||||
|
||||
|
||||
inline Foam::solidIsothermalReactionRate::solidIsothermalReactionRate
|
||||
(
|
||||
const speciesTable&,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
C_(dict.get<scalar>("C")),
|
||||
Cp_(dict.get<scalar>("Cp")),
|
||||
Tpc_(dict.get<scalar>("Tpc")),
|
||||
Elat_(dict.get<scalar>("Elat"))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
inline Foam::scalar Foam::solidIsothermalReactionRate::operator()
|
||||
(
|
||||
const scalar,
|
||||
const scalar T,
|
||||
const scalarField&
|
||||
) const
|
||||
{
|
||||
if (T < Tpc_)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -C_*Cp_*(T - Tpc_)/Elat_;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::solidIsothermalReactionRate::write(Ostream& os) const
|
||||
{
|
||||
os.writeEntry("C", C_);
|
||||
os.writeEntry("Cp", Cp_);
|
||||
os.writeEntry("Tpc", Tpc_);
|
||||
os.writeEntry("Elat", Elat_);
|
||||
}
|
||||
|
||||
|
||||
inline Foam::Ostream& Foam::operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const solidIsothermalReactionRate& iso
|
||||
)
|
||||
{
|
||||
iso.write(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -56,11 +57,6 @@ namespace Foam
|
||||
typedef ReactionType<solidReaction, Thermo, ReactionRate> \
|
||||
ReactionType##Thermo##ReactionRate; \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable(Reaction##Thermo, dictionary); \
|
||||
\
|
||||
defineTemplateTypeNameAndDebug(solidReaction##Thermo, 0); \
|
||||
defineTemplateTypeNameAndDebug(Reaction##Thermo, 0); \
|
||||
\
|
||||
template<> \
|
||||
const word ReactionType##Thermo##ReactionRate::typeName \
|
||||
( \
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -26,9 +27,29 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "makeSolidReaction.H"
|
||||
|
||||
#include "solidArrheniusReactionRate.H"
|
||||
#include "solidIsothermalReactionRate.H"
|
||||
|
||||
#include "solidThermoPhysicsTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define makeSolidReactions(Thermo) \
|
||||
\
|
||||
typedef solidReaction<Thermo> solidReaction##Thermo; \
|
||||
\
|
||||
typedef Reaction<Thermo> Reaction##Thermo; \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable(Reaction##Thermo, dictionary); \
|
||||
\
|
||||
defineTemplateTypeNameAndDebug(solidReaction##Thermo, 0); \
|
||||
defineTemplateTypeNameAndDebug(Reaction##Thermo, 0); \
|
||||
\
|
||||
makeSolidIRReactions(Thermo, solidArrheniusReactionRate) \
|
||||
makeSolidIRReactions(Thermo, solidIsothermalReactionRate)
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
@ -36,19 +57,11 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * Make Solid reactions * * * * * * * * * * * * //
|
||||
|
||||
makeSolidIRReactions(hConstSolidThermoPhysics, solidArrheniusReactionRate)
|
||||
makeSolidReactions(hConstSolidThermoPhysics)
|
||||
|
||||
makeSolidIRReactions
|
||||
(
|
||||
hPowerSolidThermoPhysics,
|
||||
solidArrheniusReactionRate
|
||||
)
|
||||
makeSolidReactions(hPowerSolidThermoPhysics)
|
||||
|
||||
makeSolidIRReactions
|
||||
(
|
||||
hExpKappaConstSolidThermoPhysics,
|
||||
solidArrheniusReactionRate
|
||||
)
|
||||
makeSolidReactions(hExpKappaConstSolidThermoPhysics)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -72,16 +72,16 @@ Foam::liquidProperties::liquidProperties
|
||||
Foam::liquidProperties::liquidProperties(const dictionary& dict)
|
||||
:
|
||||
thermophysicalProperties(dict),
|
||||
Tc_(dict.get<label>("Tc")),
|
||||
Pc_(dict.get<label>("Pc")),
|
||||
Vc_(dict.get<label>("Vc")),
|
||||
Zc_(dict.get<label>("Zc")),
|
||||
Tt_(dict.get<label>("Tt")),
|
||||
Pt_(dict.get<label>("Pt")),
|
||||
Tb_(dict.get<label>("Tb")),
|
||||
dipm_(dict.get<label>("dipm")),
|
||||
omega_(dict.get<label>("omega")),
|
||||
delta_(dict.get<label>("delta"))
|
||||
Tc_(dict.get<scalar>("Tc")),
|
||||
Pc_(dict.get<scalar>("Pc")),
|
||||
Vc_(dict.get<scalar>("Vc")),
|
||||
Zc_(dict.get<scalar>("Zc")),
|
||||
Tt_(dict.get<scalar>("Tt")),
|
||||
Pt_(dict.get<scalar>("Pt")),
|
||||
Tb_(dict.get<scalar>("Tb")),
|
||||
dipm_(dict.get<scalar>("dipm")),
|
||||
omega_(dict.get<scalar>("omega")),
|
||||
delta_(dict.get<scalar>("delta"))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -120,8 +120,8 @@ do
|
||||
# Prefix: openfoam (other)
|
||||
(o | openfoam) FOAM_MODULE_PREFIX="${FOAM_LIBBIN%/*}" ;;
|
||||
|
||||
# Prefix: false (ie, 'disabled')
|
||||
(false) FOAM_MODULE_PREFIX=false ;;
|
||||
# Prefix: false | none (ie, 'disabled')
|
||||
(false | none) FOAM_MODULE_PREFIX=false ;;
|
||||
|
||||
# Prefix: directory (absolute or relative)
|
||||
(*)
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||
# Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
# Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -71,8 +71,8 @@ setModulePrefix()
|
||||
# Prefix: openfoam (other)
|
||||
(o | openfoam) FOAM_MODULE_PREFIX="${FOAM_LIBBIN%/*}" ;;
|
||||
|
||||
# Prefix: false (ie, 'disabled')
|
||||
(false) FOAM_MODULE_PREFIX=false ;;
|
||||
# Prefix: false | none (ie, 'disabled')
|
||||
(false | none) FOAM_MODULE_PREFIX=false ;;
|
||||
|
||||
# Prefix: directory (absolute or relative)
|
||||
(*)
|
||||
|
||||
Reference in New Issue
Block a user