Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs
2011-02-16 11:53:29 +00:00
242 changed files with 5170 additions and 1862 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -31,6 +31,7 @@ Description
#include "IStringStream.H" #include "IStringStream.H"
#include "Polynomial.H" #include "Polynomial.H"
#include "polynomialFunction.H"
#include "Random.H" #include "Random.H"
#include "cpuTime.H" #include "cpuTime.H"
@ -38,7 +39,7 @@ using namespace Foam;
const int PolySize = 8; const int PolySize = 8;
const scalar coeff[] = { 0.11, 0.45, -0.94, 1.58, -2.58, 0.08, 3.15, -4.78 }; const scalar coeff[] = { 0.11, 0.45, -0.94, 1.58, -2.58, 0.08, 3.15, -4.78 };
const char* polyDef = "testPoly (0.11 0.45 -0.94 1.58 -2.58 0.08 3.15 -4.78)"; const char* polyDef = "(0.11 0.45 -0.94 1.58 -2.58 0.08 3.15 -4.78)";
scalar polyValue(const scalar x) scalar polyValue(const scalar x)
@ -58,7 +59,7 @@ scalar polyValue(const scalar x)
scalar intPolyValue(const scalar x) scalar intPolyValue(const scalar x)
{ {
// Hard-coded integrated form of above polynomial // Hard-coded integral form of above polynomial
return return
coeff[0]*x coeff[0]*x
+ coeff[1]/2.0*sqr(x) + coeff[1]/2.0*sqr(x)
@ -109,27 +110,44 @@ int main(int argc, char *argv[])
const label nIters = 1000; const label nIters = 1000;
scalar sum = 0.0; scalar sum = 0.0;
Info<< "null poly = " << (Polynomial<8>()) << nl << endl; Info<< "null poly = " << (Polynomial<8>()) << nl
<< "null poly = " << (polynomialFunction(8)) << nl
<< endl;
// Polynomial<8> poly("testPoly", IStringStream(polyDef)());
Polynomial<8> poly(coeff); Polynomial<8> poly(coeff);
Polynomial<9> intPoly(poly.integrate(0.0)); Polynomial<9> intPoly(poly.integral(0.0));
Info<< "poly = " << poly << endl; IStringStream is(polyDef);
Info<< "intPoly = " << intPoly << nl << endl; polynomialFunction polyfunc(is);
Info<< "2*poly = " << 2*poly << endl; Info<< "poly = " << poly << nl
Info<< "poly+poly = " << poly + poly << nl << endl; << "intPoly = " << intPoly << nl
<< endl;
Info<< "3*poly = " << 3*poly << endl; Info<< "2*poly = " << 2*poly << nl
Info<< "poly+poly+poly = " << poly + poly + poly << nl << endl; << "poly+poly = " << poly + poly << nl
<< "3*poly = " << 3*poly << nl
<< "poly+poly+poly = " << poly + poly + poly << nl
<< "3*poly - 2*poly = " << 3*poly - 2*poly << nl
<< endl;
Info<< nl << "--- as polynomialFunction" << nl << endl;
Info<< "polyf = " << polyfunc << nl
<< "intPoly = " << poly.integral(0.0) << nl
<< endl;
Info<< "2*polyf = " << 2*polyfunc << nl
<< "polyf+polyf = " << polyfunc + polyfunc << nl
<< "3*polyf = " << 3*polyfunc << nl
<< "polyf+polyf+polyf = " << polyfunc + polyfunc + polyfunc << nl
<< "3*polyf - 2*polyf = " << 3*polyfunc - 2*polyfunc << nl
<< endl;
Info<< "3*poly - 2*poly = " << 3*poly - 2*poly << nl << endl;
Polynomial<8> polyCopy = poly; Polynomial<8> polyCopy = poly;
Info<< "poly, polyCopy = " << poly << ", " << polyCopy << nl << endl; Info<< "poly, polyCopy = " << poly << ", " << polyCopy << nl << endl;
polyCopy = 2.5*poly; polyCopy = 2.5*poly;
Info<< "2.5*polyCopy = " << polyCopy << nl << endl; Info<< "2.5*poly = " << polyCopy << nl << endl;
Random rnd(123456); Random rnd(123456);
for (int i=0; i<10; i++) for (int i=0; i<10; i++)
@ -139,8 +157,8 @@ int main(int argc, char *argv[])
scalar px = polyValue(x); scalar px = polyValue(x);
scalar ipx = intPolyValue(x); scalar ipx = intPolyValue(x);
scalar pxTest = poly.evaluate(x); scalar pxTest = poly.value(x);
scalar ipxTest = intPoly.evaluate(x); scalar ipxTest = intPoly.value(x);
Info<<"\nx = " << x << endl; Info<<"\nx = " << x << endl;
Info<< " px, pxTest = " << px << ", " << pxTest << endl; Info<< " px, pxTest = " << px << ", " << pxTest << endl;
@ -173,10 +191,21 @@ int main(int argc, char *argv[])
sum = 0.0; sum = 0.0;
for (label iter = 0; iter < nIters; ++iter) for (label iter = 0; iter < nIters; ++iter)
{ {
sum += poly.evaluate(loop+iter); sum += poly.value(loop+iter);
} }
} }
Info<< "evaluate: " << sum Info<< "value: " << sum
<< " in " << timer.cpuTimeIncrement() << " s\n";
for (int loop = 0; loop < n; ++loop)
{
sum = 0.0;
for (label iter = 0; iter < nIters; ++iter)
{
sum += polyfunc.value(loop+iter);
}
}
Info<< "via function: " << sum
<< " in " << timer.cpuTimeIncrement() << " s\n"; << " in " << timer.cpuTimeIncrement() << " s\n";

View File

@ -40,7 +40,7 @@ Usage
Note Note
The cellTable information available in the files The cellTable information available in the files
\c constant/cellTable and @c constant/polyMesh/cellTableId \c constant/cellTable and \c constant/polyMesh/cellTableId
will be used if available. Otherwise the cellZones are used when will be used if available. Otherwise the cellZones are used when
creating the cellTable information. creating the cellTable information.

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,8 +22,8 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description Description
Picks up cells with cell centre 'inside' of surface. Requires surface Picks up cells with cell centre 'inside' of surface.
to be closed and singly connected. Requires surface to be closed and singly connected.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -42,9 +42,16 @@ using namespace Foam;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"Create a cellSet for cells with their centres inside the defined "
"surface.\n"
"Surface must be closed and singly connected."
);
argList::noParallel(); argList::noParallel();
argList::validArgs.append("surface file"); argList::validArgs.append("surfaceFile");
argList::validArgs.append("destination cellSet"); argList::validArgs.append("cellSet");
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
@ -75,14 +82,13 @@ int main(int argc, char *argv[])
} }
Info<< "Selected " << insideCells.size() Info<< "Selected " << insideCells.size() << " of " << mesh.nCells()
<< " cells out of " << mesh.nCells() << endl << " cells" << nl << nl
<< endl
<< "Writing selected cells to cellSet " << insideCells.name() << "Writing selected cells to cellSet " << insideCells.name()
<< endl << endl << nl << nl
<< "Use this cellSet e.g. with subsetMesh : " << endl << endl << "Use this cellSet e.g. with subsetMesh : " << nl << nl
<< " subsetMesh <root> <case> " << insideCells.name() << " subsetMesh " << insideCells.name()
<< endl << endl; << nl << endl;
insideCells.write(); insideCells.write();

View File

@ -21,7 +21,6 @@ EXE_LIBS = \
-ledgeMesh \ -ledgeMesh \
-lengine \ -lengine \
-lerrorEstimation \ -lerrorEstimation \
-lEulerianInterfacialModels \
-lextrudeModel \ -lextrudeModel \
-lfieldFunctionObjects \ -lfieldFunctionObjects \
-lfileFormats \ -lfileFormats \

View File

@ -18,6 +18,7 @@ LINK_DIRECTORIES(
) )
INCLUDE_DIRECTORIES( INCLUDE_DIRECTORIES(
$ENV{WM_PROJECT_DIR}/src/OSspecific/$ENV{WM_OSTYPE}
$ENV{WM_PROJECT_DIR}/src/OpenFOAM/lnInclude $ENV{WM_PROJECT_DIR}/src/OpenFOAM/lnInclude
$ENV{WM_PROJECT_DIR}/src/finiteVolume/lnInclude $ENV{WM_PROJECT_DIR}/src/finiteVolume/lnInclude
${PROJECT_SOURCE_DIR}/../vtkPV3Foam ${PROJECT_SOURCE_DIR}/../vtkPV3Foam

View File

@ -29,7 +29,7 @@ Description
type in the field and polyMesh/boundary files. type in the field and polyMesh/boundary files.
Reads dictionaries (fields) and entries to change from a dictionary. Reads dictionaries (fields) and entries to change from a dictionary.
E.g. to make the \em movingWall a \em fixedValue for @em p but all other E.g. to make the \em movingWall a \em fixedValue for \em p but all other
\em Walls a zeroGradient boundary condition, the \em Walls a zeroGradient boundary condition, the
\c system/changeDictionaryDict would contain the following: \c system/changeDictionaryDict would contain the following:
\verbatim \verbatim

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -30,6 +30,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
usage() { usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE cat<<USAGE

82
bin/findEmptyMake Executable file
View File

@ -0,0 +1,82 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# 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/>.
#
# Script
# findEmptyMake
#
# Description
# Usage: findEmptyMake [dir1 .. dirN]
#
# Find Make/ directories without a 'files' or 'options' file.
# This can occur when a directory has been moved.
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
Usage: ${0##*/} [OPTION] [dir1 .. dirN]
Find Make/ directories without a 'files' or 'options' file.
This can occur when a directory has been moved.
USAGE
exit 1
}
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-*)
usage "unknown option: '$*'"
;;
*)
break
;;
esac
done
# default is the current directory
[ "$#" -gt 0 ] || set -- .
for checkDir
do
if [ -d "$checkDir" ]
then
echo "searching: $checkDir" 1>&2
else
echo "skipping non-dir: $checkDir" 1>&2
continue
fi
find $checkDir -depth -name Make -type d -print | while read makeDir
do
[ -r "$makeDir/files" -a -r "$makeDir/options" ] || echo "$makeDir"
done
done
# -----------------------------------------------------------------------------

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -30,9 +30,9 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
usage() { usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE cat<<USAGE
Usage: ${0##*/} <file1> ... <fileN> Usage: ${0##*/} <file1> ... <fileN>
* find all .dep files referring to any of <file1> ... <fileN> * find all .dep files referring to any of <file1> ... <fileN>

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -31,8 +31,9 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
usage() { usage() {
while [ "$#" -ge 1 ]; do echo "$1" 1>&2; shift; done exec 1>&2
cat <<USAGE 1>&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat <<USAGE
Usage: ${0##*/} [OPTION] Usage: ${0##*/} [OPTION]
options: options:

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -40,8 +40,9 @@ Script=${0##*/}
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
usage() { usage() {
while [ "$#" -ge 1 ]; do echo "$1" 1>&2; shift; done exec 1>&2
cat <<USAGE 1>&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat <<USAGE
Usage: $Script srcDir dstDir Usage: $Script srcDir dstDir

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -38,6 +38,7 @@
Script=${0##*/} Script=${0##*/}
usage() { usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE cat<<USAGE
Usage: $Script [OPTION] <pid> Usage: $Script [OPTION] <pid>

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -33,10 +33,10 @@
# personal settings to site-wide settings. # personal settings to site-wide settings.
# #
# For example, within the user ~/.OpenFOAM/<VER>/prefs.sh: # For example, within the user ~/.OpenFOAM/<VER>/prefs.sh:
# @verbatim # \code
# foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile -m go prefs.sh` \ # foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile -m go prefs.sh` \
# && _foamSource $foamPrefs # && _foamSource $foamPrefs
# @endverbatim # \endcode
# #
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
usage() { usage() {

View File

@ -39,6 +39,7 @@
# foamEtcFile # foamEtcFile
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
usage() { usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE cat<<USAGE

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -29,6 +29,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
usage() { usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE cat<<USAGE

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -35,6 +35,7 @@ Script=${0##*/}
toolsDir=${0%/*}/tools toolsDir=${0%/*}/tools
usage() { usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat <<USAGE cat <<USAGE

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -30,6 +30,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
usage() { usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE cat<<USAGE
Usage: ${0##*/} <type> {args} Usage: ${0##*/} <type> {args}

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -37,6 +37,7 @@ templateDir="appTemplates"
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
usage() { usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE cat<<USAGE

View File

@ -33,11 +33,12 @@ packDir=$WM_PROJECT-$WM_PROJECT_VERSION
toolsDir="${0%/*}/tools" # this script is located in the tools/ parent dir toolsDir="${0%/*}/tools" # this script is located in the tools/ parent dir
usage() { usage() {
while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done exec 1>&2
cat <<USAGE 1>&2 while [ "$#" -gt 0 ]; do echo "$1"; shift; done
cat <<USAGE
Usage: ${0##*/} [OPTION] Usage: ${0##*/} [OPTION]
options: options:
-o <dir> specify alternative output directory -o, -output <dir> specify alternative output directory
-nogit bypass using 'git archive' -nogit bypass using 'git archive'
* Pack and compress OpenFOAM directory for release * Pack and compress OpenFOAM directory for release
@ -46,7 +47,7 @@ USAGE
exit 1 exit 1
} }
unset prefix outputDir nogit unset outputDir nogit
# parse options # parse options
while [ "$#" -gt 0 ] while [ "$#" -gt 0 ]
do do

View File

@ -46,7 +46,7 @@ case "${0##*/}" in
;; ;;
*) *)
# regular # regular
codeBase="OpenFOAM ThirdParty" codeBase="OpenFOAM"
packDir=$WM_PROJECT-$WM_PROJECT_VERSION packDir=$WM_PROJECT-$WM_PROJECT_VERSION
listBinDirs=$toolsDir/foamListBinDirs listBinDirs=$toolsDir/foamListBinDirs
;; ;;
@ -54,11 +54,15 @@ esac
usage() { usage() {
while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done exec 1>&2
cat <<USAGE 1>&2 while [ "$#" -gt 0 ]; do echo "$1"; shift; done
cat <<USAGE
Usage: ${0##*/} [OPTION] <archOptions> Usage: ${0##*/} [OPTION] <archOptions>
${0##*/} [OPTION] -current
options: options:
-o <dir> specify alternative output directory -b, -bzip2 use bzip2 instead of gzip compression
-c, -current use current value of \$WM_OPTIONS
-o, -output <dir> specify alternative output directory
* Pack and compress binary version of $codeBase for release * Pack and compress binary version of $codeBase for release
@ -70,7 +74,9 @@ USAGE
} }
unset prefix outputDir unset archOptions outputDir
packExt=tgz
# parse options # parse options
while [ "$#" -gt 0 ] while [ "$#" -gt 0 ]
do do
@ -78,6 +84,14 @@ do
-h | -help) -h | -help)
usage usage
;; ;;
-b | -bzip2)
packExt=tbz
shift
;;
-c | -current) # use $WM_OPTIONS - eg, 'linux64GccDPOpt'
archOptions="$WM_OPTIONS"
shift
;;
-o | -output) -o | -output)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument" [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
outputDir=${2%%/} outputDir=${2%%/}
@ -92,14 +106,17 @@ do
esac esac
done done
[ $# -eq 1 ] || usage "Error: specify architecture" if [ -n "$archOptions" ]
then
[ $# -eq 0 ] || usage "Error: cannot specify both -current and architecture"
else
archOptions="$1"
[ $# -eq 1 ] || usage "Error: specify architecture"
fi
# same as $WM_OPTIONS - eg, 'linux64GccDPOpt'
archOptions="$1"
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
timeStamp=$(date +%Y-%m-%d) timeStamp=$(date +%Y-%m-%d)
packExt=tgz
packBase=${packDir}.${archOptions}_${timeStamp} packBase=${packDir}.${archOptions}_${timeStamp}
# add optional output directory # add optional output directory
@ -126,11 +143,20 @@ else
exit 1 exit 1
fi fi
# bzip2 or gzip compression
case "$packFile" in
*tbz)
tarOpt=cpjf
;;
*)
tarOpt=cpzf
;;
esac
# Clean up on Ctrl-C # Clean up on Ctrl-C
trap 'rm -f $packFile 2>/dev/null' INT trap 'rm -f $packFile 2>/dev/null' INT
tar cpzf $packFile $dirList tar $tarOpt $packFile $dirList
if [ $? -eq 0 ] if [ $? -eq 0 ]
then then
echo "Finished packing file $packFile" 1>&2 echo "Finished packing file $packFile" 1>&2

156
bin/foamPackDeps Executable file
View File

@ -0,0 +1,156 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# 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/>.
#
# Script
# foamPackDeps [OPTION]
#
# Description
# Pack and compress *.dep files from OpenFOAM
#
# Script
# foamPackDeps [OPTION]
#
# Description
# Pack and compress *.dep files from OpenFOAM ThirdParty
#
#------------------------------------------------------------------------------
toolsDir="${0%/*}/tools" # this script is located in the tools/ parent dir
case "${0##*/}" in
*ThirdParty*)
# for ThirdParty
codeBase="OpenFOAM ThirdParty"
packDir=ThirdParty-$WM_PROJECT_VERSION
;;
*)
# regular
codeBase="OpenFOAM"
packDir=$WM_PROJECT-$WM_PROJECT_VERSION
;;
esac
usage() {
exec 1>&2
while [ "$#" -gt 0 ]; do echo "$1"; shift; done
cat <<USAGE
Usage: ${0##*/} [OPTION]
options:
-b, -bzip2 use bzip2 instead of gzip compression
-c, -current for compatibility - currently ignored
-o, -output <dir> specify alternative output directory
* Pack and compress *.dep files from $codeBase
USAGE
exit 1
}
unset archOptions outputDir
packExt=tgz
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-b | -bzip2)
packExt=tbz
shift
;;
-c | -current) # use $WM_OPTIONS - eg, 'linux64GccDPOpt'
archOptions="$WM_OPTIONS"
shift
;;
-o | -output)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
outputDir=${2%%/}
shift 2
;;
-*)
usage "unknown option: '$*'"
;;
*)
break
;;
esac
done
# check for essential directories
[ -d $packDir ] || {
echo "Error: directory $packDir does not exist" 1>&2
exit 1
}
#------------------------------------------------------------------------------
timeStamp=$(date +%Y-%m-%d)
packBase=${packDir}.deps_${timeStamp}
# add optional output directory
[ -d "$outputDir" ] && packBase="$outputDir/$packBase"
packFile=$packBase.$packExt
# avoid overwriting old pack file
if [ -f $packFile ]
then
echo "Error: $packFile already exists" 1>&2
exit 1
fi
cat <<INFO 1>&2
-------------------------------------------------------------------------------
Packing *.dep files into $packFile
INFO
# bzip2 or gzip compression
case "$packFile" in
*tbz)
tarOpt=cpjf
;;
*)
tarOpt=cpzf
;;
esac
# Clean up on Ctrl-C
trap 'rm -f $packFile 2>/dev/null' INT
find -H $packDir -name '*.dep' -type f -print | tar $tarOpt $packFile -T -
if [ $? -eq 0 ]
then
echo "Finished packing *.dep files into $packFile" 1>&2
else
echo "Error: failure packing *.dep files into $packFile" 1>&2
rm -f $packFile 2>/dev/null
fi
#------------------------------------------------------------------------------

View File

@ -33,12 +33,14 @@ packDir=$WM_PROJECT-$WM_PROJECT_VERSION
htmlDir=doc/Doxygen/html htmlDir=doc/Doxygen/html
usage() { usage() {
while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done exec 1>&2
cat <<USAGE 1>&2 while [ "$#" -gt 0 ]; do echo "$1"; shift; done
cat <<USAGE
Usage: ${0##*/} [OPTION] Usage: ${0##*/} [OPTION]
options: options:
-b, -bzip2 use bzip2 instead of gzip compression
-o, -output <dir> specify alternative output directory
-prefix <dir> use alternative prefix -prefix <dir> use alternative prefix
-o <dir> specify alternative output directory
* Pack and compress the OpenFOAM doxygen html for release * Pack and compress the OpenFOAM doxygen html for release
@ -46,7 +48,10 @@ USAGE
exit 1 exit 1
} }
unset prefix outputDir unset prefix outputDir
packExt=tgz
# parse options # parse options
while [ "$#" -gt 0 ] while [ "$#" -gt 0 ]
do do
@ -54,16 +59,20 @@ do
-h | -help) -h | -help)
usage usage
;; ;;
-prefix | --prefix) -b | -bzip2)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument" packExt=tbz
prefix=${2%%/} shift
shift 2
;; ;;
-o | -output) -o | -output)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument" [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
outputDir=${2%%/} outputDir=${2%%/}
shift 2 shift 2
;; ;;
-prefix | --prefix)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
prefix=${2%%/}
shift 2
;;
-*) -*)
usage "unknown option: '$*'" usage "unknown option: '$*'"
;; ;;
@ -87,7 +96,6 @@ then
fi fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
packExt=tgz
packName=${packDir}_Doxygen packName=${packDir}_Doxygen
# add optional output directory # add optional output directory
@ -107,22 +115,32 @@ Packing doxygen html into $packFile
INFO INFO
# bzip2 or gzip compression
case "$packFile" in
*tbz)
tarOpt=cpjf
;;
*)
tarOpt=cpzf
;;
esac
# Clean up on Ctrl-C # Clean up on Ctrl-C
trap 'rm -f $packFile 2>/dev/null' INT trap 'rm -f $packFile 2>/dev/null' INT
if [ -n "$prefix" ] if [ -n "$prefix" ]
then then
# requires GNU tar # requires GNU tar
tar cpzf $packFile --transform="s@^@$prefix/@" $htmlDir tar $tarOpt $packFile --transform="s@^@$prefix/@" $htmlDir
else else
tar cpzf $packFile $packDir/$htmlDir tar $tarOpt $packFile $packDir/$htmlDir
fi fi
if [ $? -eq 0 ] if [ $? -eq 0 ]
then then
echo "Finished packing doxygen html into file $packFile" 1>&2 echo "Finished packing doxygen html into $packFile" 1>&2
else else
echo "Error: failure packing doxygen html file $packFile" 1>&2 echo "Error: failure packing doxygen html into $packFile" 1>&2
rm -f $packFile 2>/dev/null rm -f $packFile 2>/dev/null
fi fi

164
bin/foamPackMake Executable file
View File

@ -0,0 +1,164 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# 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/>.
#
# Script
# foamPackMake [OPTION] <archOptions>
#
# Description
# Pack and compress OpenFOAM Make/<archOptions> directories
#
# Script
# foamPackThirdPartyMake [OPTION] <archOptions>
#
# Description
# Pack and compress OpenFOAM ThirdParty Make/<archOptions> directories
#
#------------------------------------------------------------------------------
toolsDir="${0%/*}/tools" # this script is located in the tools/ parent dir
case "${0##*/}" in
*ThirdParty*)
# for ThirdParty
codeBase="OpenFOAM ThirdParty"
packDir=ThirdParty-$WM_PROJECT_VERSION
;;
*)
# regular
codeBase="OpenFOAM"
packDir=$WM_PROJECT-$WM_PROJECT_VERSION
;;
esac
usage() {
exec 1>&2
while [ "$#" -gt 0 ]; do echo "$1"; shift; done
cat <<USAGE
Usage: ${0##*/} [OPTION] <archOptions>
${0##*/} [OPTION] -current
options:
-b, -bzip2 use bzip2 instead of gzip compression
-c, -current use current value of \$WM_OPTIONS
-o, -output <dir> specify alternative output directory
* Pack and compress $codeBase Make/<archOptions> directories
The value of 'archOptions' normally corresponds to \$WM_OPTIONS
The current value of \$WM_OPTIONS = $WM_OPTIONS
USAGE
exit 1
}
unset archOptions outputDir
packExt=tgz
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-b | -bzip2)
packExt=tbz
shift
;;
-c | -current) # use $WM_OPTIONS - eg, 'linux64GccDPOpt'
archOptions="$WM_OPTIONS"
shift
;;
-o | -output)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
outputDir=${2%%/}
shift 2
;;
-*)
usage "unknown option: '$*'"
;;
*)
break
;;
esac
done
if [ -n "$archOptions" ]
then
[ $# -eq 0 ] || usage "Error: cannot specify both -current and architecture"
else
archOptions="$1"
[ $# -eq 1 ] || usage "Error: specify architecture"
fi
#------------------------------------------------------------------------------
timeStamp=$(date +%Y-%m-%d)
packBase=${packDir}.Make-${archOptions}_${timeStamp}
# add optional output directory
[ -d "$outputDir" ] && packBase="$outputDir/$packBase"
packFile=$packBase.$packExt
# avoid overwriting old pack file
if [ -f $packFile ]
then
echo "Error: $packFile already exists" 1>&2
exit 1
fi
cat <<INFO 1>&2
-------------------------------------------------------------------------------
Pack and compress Make/$archOptions* directories into $packFile
INFO
# bzip2 or gzip compression
case "$packFile" in
*tbz)
tarOpt=cpjf
;;
*)
tarOpt=cpzf
;;
esac
# Clean up on Ctrl-C
trap 'rm -f $packFile 2>/dev/null' INT
find -H $packDir -depth -name Make -type d -print | \
xargs -i find '{}' -depth -name "$archOptions*" -type d -print | \
tar $tarOpt $packFile -T -
if [ $? -eq 0 ]
then
echo "Finished packing Make/$archOptions directories into $packFile" 1>&2
else
echo "Error: failure packing Make/$archOptions directories into $packFile" 1>&2
rm -f $packFile 2>/dev/null
fi
#------------------------------------------------------------------------------

View File

@ -33,8 +33,9 @@ packDir=ThirdParty-$WM_PROJECT_VERSION
toolsDir="${0%/*}/tools" # this script is located in the tools/ parent dir toolsDir="${0%/*}/tools" # this script is located in the tools/ parent dir
usage() { usage() {
while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done exec 1>&2
cat <<USAGE 1>&2 while [ "$#" -gt 0 ]; do echo "$1"; shift; done
cat <<USAGE
Usage: ${0##*/} [OPTION] Usage: ${0##*/} [OPTION]
options: options:
-o <dir> specify alternative output directory -o <dir> specify alternative output directory

1
bin/foamPackThirdPartyDeps Symbolic link
View File

@ -0,0 +1 @@
foamPackDeps

1
bin/foamPackThirdPartyMake Symbolic link
View File

@ -0,0 +1 @@
foamPackMake

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -33,6 +33,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
usage() { usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE cat<<USAGE

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -33,6 +33,7 @@
# undefined behaviour # undefined behaviour
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
usage() { usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE cat<<USAGE

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -29,8 +29,9 @@
# Remove all .dep files or remove .dep files referring to <file> # Remove all .dep files or remove .dep files referring to <file>
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
usage() { usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE 1>&2 cat<<USAGE
Usage: ${0##*/} [file] Usage: ${0##*/} [file]
Remove all .dep files or remove .dep files referring to <file> Remove all .dep files or remove .dep files referring to <file>

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -34,8 +34,9 @@
# - optionally remove empty directories # - optionally remove empty directories
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
usage() { usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE 1>&2 cat<<USAGE
Usage: ${0##*/} [OPTION] [dir1 .. dirN] Usage: ${0##*/} [OPTION] [dir1 .. dirN]
options: options:
-rmdir find and remove empty directories (recursively) -rmdir find and remove empty directories (recursively)

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -30,6 +30,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
usage() { usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE cat<<USAGE

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -23,7 +23,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. # along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
# #
# Script # Script
# foamListBinDirs <directory> <archOptions> # foamListBinDirs <directory> [archOptions]
# #
# Description # Description
# Lists directories containing binary files of OpenFOAM # Lists directories containing binary files of OpenFOAM
@ -33,9 +33,9 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
toolsDir="${0%/*}" # this script is already located in the tools/ directory toolsDir="${0%/*}" # this script is already located in the tools/ directory
[ $# -eq 2 ] || { [ $# -eq 1 -o $# -eq 2 ] || {
cat <<USAGE 1>&2 cat <<USAGE 1>&2
Usage : ${0##*/} <packDir> <archOptions> Usage : ${0##*/} <packDir> [archOptions]
* Lists directories containing binary files for OpenFOAM * Lists directories containing binary files for OpenFOAM
@ -49,8 +49,13 @@ USAGE
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
packDir="$1" packDir="$1"
# same as $WM_OPTIONS - eg, 'linux64GccDPOpt' # default to same as $WM_OPTIONS - eg, 'linux64GccDPOpt'
archOptions="$2" archOptions="${2:-$WM_OPTIONS}"
[ -n "$archOptions" ] || {
echo "Error: no archOptions specified" 1>&2
exit 1
}
# base arch (w/o precision, optimization, etc) # base arch (w/o precision, optimization, etc)
# same as "$WM_ARCH$WM_COMPILER" # same as "$WM_ARCH$WM_COMPILER"
@ -65,42 +70,18 @@ arch3264=$(echo "$archOS" | sed -e 's@64@-64@')
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# check for essential directories # check for essential directories
[ -d $packDir ] || { for dir in \
echo "Error: directory $packDir does not exist" 1>&2 $packDir \
$packDir/platforms/$archOptions/bin \
$packDir/platforms/$archOptions/lib \
;
do
[ -d $dir ] || {
echo "Error: directory $dir does not exist" 1>&2
exit 1 exit 1
} }
done
#
# check places for libraries - same as $FOAM_LIBBIN
# this has moved around a bit in the recent past
#
[ -d $packDir/lib/$archOptions ] || \
[ -d $packDir/platforms/$archOptions/lib ] || {
cat <<LIB_CHECK 1>&2
Error: no directory for libraries exists:
$packDir/lib/$archOptions
$packDir/platforms/$archOptions/lib
LIB_CHECK
exit 1
}
#
# check places for executables - same as $FOAM_APPBIN
# this has moved around a bit in the recent past
#
[ -d $packDir/applications/bin/$archOptions ] || \
[ -d $packDir/platforms/$archOptions/bin ] || {
cat <<BIN_CHECK 1>&2
Error: no directory for executables exists:
$packDir/platforms/$archOptions/bin
$packDir/applications/bin/$archOptions
BIN_CHECK
exit 1
}
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# list of directories # list of directories
@ -108,13 +89,11 @@ dirList=$(
for dir in \ for dir in \
$packDir/platforms/$archOptions/bin \ $packDir/platforms/$archOptions/bin \
$packDir/platforms/$archOptions/lib \ $packDir/platforms/$archOptions/lib \
$packDir/wmake/bin/$archCompiler \ $packDir/wmake/platforms/$archCompiler \
$packDir/wmake/bin/$archOS \ $packDir/wmake/platforms/$archOS \
$packDir/wmake/rules/General \ $packDir/wmake/rules/General \
$packDir/wmake/rules/$archCompiler \ $packDir/wmake/rules/$archCompiler \
$packDir/wmake/rules/$archOS \ $packDir/wmake/rules/$archOS \
$packDir/applications/bin/$archOptions \
$packDir/lib/$archOptions \
; ;
do do
[ -d $dir ] && echo $dir [ -d $dir ] && echo $dir

View File

@ -46,7 +46,7 @@ USAGE
packDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@') packDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@')
# check for essential directories # check for essential directories
[ -d $packDir ] || { [ -d "$packDir" ] || {
echo "Error: directory $packDir does not exist" 1>&2 echo "Error: directory $packDir does not exist" 1>&2
exit 1 exit 1
} }
@ -71,16 +71,15 @@ find -H $packDir \
-a ! -name "*.tar" \ -a ! -name "*.tar" \
-a ! -name "*.tar.gz" \ -a ! -name "*.tar.gz" \
-a ! -name "*.tgz" \ -a ! -name "*.tgz" \
-a ! -name "*.tar.bz2" \
-a ! -name "*.tbz" \
-a ! -name "core" \ -a ! -name "core" \
-a ! -name "core.[1-9]*" \ -a ! -name "core.[1-9]*" \
-a ! -name "libccmio*" \ -a ! -name "libccmio*" \
| sed \ | sed \
-e "\@$packDir/lib/@d" \
-e '\@/\.git/@d' \ -e '\@/\.git/@d' \
-e '\@/\.tags/@d' \ -e '\@/\.tags/@d' \
-e '\@/README\.org@d' \ -e '\@/README\.org@d' \
-e '\@/bin/[^/]*/@{ \@/bin/tools/@!d }' \
-e '\@/lib/@d' \
-e '\@/platforms/@d' \ -e '\@/platforms/@d' \
-e '\@/t/@d' \ -e '\@/t/@d' \
-e '\@/Make[.A-Za-z]*/[^/]*/@d' \ -e '\@/Make[.A-Za-z]*/[^/]*/@d' \

View File

@ -23,7 +23,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. # along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
# #
# Script # Script
# foamListThirdPartyBinDirs <directory> <archOptions> # foamListThirdPartyBinDirs <directory> [archOptions]
# #
# Description # Description
# Lists directories containing binary files for OpenFOAM ThirdParty # Lists directories containing binary files for OpenFOAM ThirdParty
@ -33,9 +33,9 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
toolsDir="${0%/*}" # this script is already located in the tools/ directory toolsDir="${0%/*}" # this script is already located in the tools/ directory
[ $# -eq 2 ] || { [ $# -eq 1 -o $# -eq 2 ] || {
cat <<USAGE 1>&2 cat <<USAGE 1>&2
Usage : ${0##*/} <packDir> <archOptions> Usage : ${0##*/} <packDir> [archOptions]
* List directories containing binary files for OpenFOAM ThirdParty * List directories containing binary files for OpenFOAM ThirdParty
@ -49,8 +49,13 @@ USAGE
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
packDir="$1" packDir="$1"
# same as $WM_OPTIONS - eg, 'linux64GccDPOpt' # default to same as $WM_OPTIONS - eg, 'linux64GccDPOpt'
archOptions="$2" archOptions="${2:-$WM_OPTIONS}"
[ -n "$archOptions" ] || {
echo "Error: no archOptions specified" 1>&2
exit 1
}
# base arch (w/o precision, optimization, etc) # base arch (w/o precision, optimization, etc)
# same as "$WM_ARCH$WM_COMPILER" # same as "$WM_ARCH$WM_COMPILER"
@ -66,7 +71,10 @@ arch3264=$(echo "$archOS" | sed -e 's@64@-64@')
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# check for essential directories # check for essential directories
for dir in $packDir $packDir/platforms/$archOptions/lib for dir in \
$packDir \
$packDir/platforms/$archOptions/lib \
;
do do
[ -d $dir ] || { [ -d $dir ] || {
echo "Error: directory $dir does not exist" 1>&2 echo "Error: directory $dir does not exist" 1>&2

View File

@ -78,15 +78,25 @@ INFO
wc $tmpFile | awk '{print "Packing",$1,"files - this could take some time ..."}' 1>&2 wc $tmpFile | awk '{print "Packing",$1,"files - this could take some time ..."}' 1>&2
# bzip2 or gzip compression
case "$packFile" in
*tbz)
tarOpt=cpjf
;;
*)
tarOpt=cpzf
;;
esac
# Clean up on Ctrl-C # Clean up on Ctrl-C
trap 'rm -f $packFile $tmpFile 2>/dev/null' INT trap 'rm -f $packFile $tmpFile 2>/dev/null' INT
tar cpzf $packFile --files-from $tmpFile tar $tarOpt $packFile --files-from $tmpFile
if [ $? -eq 0 ] if [ $? -eq 0 ]
then then
echo "Finished packing $packDir into file $packFile" 1>&2 echo "Finished packing $packDir into $packFile" 1>&2
else else
echo "Error: failure packing $packDir into file $packFile" 1>&2 echo "Error: failure packing $packDir into $packFile" 1>&2
rm -f $packFile 2>/dev/null rm -f $packFile 2>/dev/null
fi fi

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -32,10 +32,11 @@
Script=${0##*/} Script=${0##*/}
usage() { usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE cat<<USAGE
Usage: ${0##*/} [OPTIONS] file1 [.. fileN] Usage: $Script [OPTIONS] file1 [.. fileN]
options: options:
-html create html (default) -html create html (default)
-latex create LaTeX -latex create LaTeX

View File

@ -148,7 +148,7 @@ checkIllegalCode()
do do
case "$f" in case "$f" in
# exclude potential makefiles # exclude potential makefiles
(wmake/[Mm]akefile* | wmake/rules/*) (*[Mm]akefile* | wmake/rules/*)
;; ;;
(*) (*)
# parse line numbers from grep output: # parse line numbers from grep output:

View File

@ -111,7 +111,7 @@ checkIllegalCode()
do do
case "$f" in case "$f" in
# exclude potential makefiles # exclude potential makefiles
(wmake/[Mm]akefile* | wmake/rules/*) (*[Mm]akefile* | wmake/rules/*)
;; ;;
(*) (*)
# parse line numbers from grep output: # parse line numbers from grep output:

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -28,25 +28,72 @@
# Description # Description
# touch all .dep files # touch all .dep files
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
# default is pwd Usage: ${0##*/} [OPTION] [dir1] .. [dirN]
if [ "$#" -eq 0 ] options:
then -make limit selection to 'Make/\$WM_OPTIONS*' (Make/$WM_OPTIONS*)
set -- . -help print the usage
elif [ "$1" = "-h" -o "$1" = "-help" ]
then Find and touch all .dep files in the specified directories.
echo "Usage: ${0##*/} [dir1] .. [dirN]" Uses the cwd by default if no directories are specified.
echo " touch all .dep files"
Current value of WM_OPTIONS=$WM_OPTIONS
NOTE The '-make' is a future feature.
This is currently no separation of .dep files by platforms.
USAGE
exit 1 exit 1
fi }
unset restrictOpt
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-m | -make)
[ -n "$WM_OPTIONS" ] || usage "Error: -make option only valid when \$WM_OPTIONS is set"
restrictOpt=true
shift
;;
-*)
usage "unknown option: '$*'"
;;
*)
break
;;
esac
done
# no directories specified: default is pwd
[ "$#" -gt 0 ] || set -- .
for i for i
do do
if [ -d "$i" ] if [ -d "$i" ]
then then
if [ "$restrictOpt" = true ]
then
echo "touching all .dep files under Make/$WM_OPTIONS* : $i"
find $i -depth -name Make -type d -print | \
xargs -i find '{}' -depth -name "$WM_OPTIONS*" -type d -print | \
xargs -i find '{}' -name '*.dep' -type f -print | \
xargs -t touch
else
echo "touching all .dep files: $i" echo "touching all .dep files: $i"
find $i -name '*.dep' -print | xargs -t touch find $i -name '*.dep' -type f -print | xargs -t touch
fi
else else
echo "no directory: $i" echo "no directory: $i"
fi fi

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. # \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -28,27 +28,71 @@
# Description # Description
# touch all .o files # touch all .o files
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
# default is pwd Usage: ${0##*/} [OPTION] [dir1] .. [dirN]
if [ "$#" -eq 0 ] options:
then -make limit selection to 'Make/\$WM_OPTIONS*'
set -- . -help print the usage
elif [ "$1" = "-h" -o "$1" = "-help" ]
then Find and touch all .o files in the specified directories.
echo "Usage: ${0##*/} [dir1] .. [dirN]" Uses the cwd by default if no directories are specified.
echo " touch all .o files"
Current value of WM_OPTIONS=$WM_OPTIONS
USAGE
exit 1 exit 1
fi }
unset restrictOpt
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-m | -make)
[ -n "$WM_OPTIONS" ] || usage "Error: -make option only valid when \$WM_OPTIONS is set"
restrictOpt=true
shift
;;
-*)
usage "unknown option: '$*'"
;;
*)
break
;;
esac
done
# no directories specified: default is pwd
[ "$#" -gt 0 ] || set -- .
for i for i
do do
if [ -d "$i" ] if [ -d "$i" ]
then then
if [ "$restrictOpt" = true ]
then
echo "touching all .o files under Make/$WM_OPTIONS* : $i"
find $i -depth -name Make -type d -print | \
xargs -i find '{}' -depth -name "$WM_OPTIONS*" -type d -print | \
xargs -i find '{}' -name '*.o' -type f -print | \
xargs -t touch
else
echo "touching all .o files: $i" echo "touching all .o files: $i"
find $i -name '*.o' -print | xargs -t touch find $i -name '*.o' -type f -print | xargs -t touch
fi
else else
echo "no directory: $i" echo "no directory: $i"
fi fi
done done
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -0,0 +1,46 @@
#----------------------------------*-sh-*--------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# 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/>.
#
# File
# paraview3/bashrc-EXAMPLE
#
# Description
# Example of chaining to the standard paraview3/bashrc with a
# different ParaView_VERSION
#
# Note
# This file could be copied to a user or site location, but should never
# replace the default shipped version as this will cause an infinite loop
#
#------------------------------------------------------------------------------
#
# Use other (shipped) bashrc with a different ParaView_VERSION
#
foamFile=$($WM_PROJECT_DIR/bin/foamEtcFile -mode o apps/paraview3/bashrc 2>/dev/null)
[ $? -eq 0 ] && . $foamFile ParaView_VERSION=3.9.0
unset foamFile
# -----------------------------------------------------------------------------

View File

@ -39,6 +39,7 @@ parallel/decompose/AllwmakeLnInclude
dummyThirdParty/Allwmake $* dummyThirdParty/Allwmake $*
wmake $makeOption lagrangian/basic wmake $makeOption lagrangian/basic
wmake $makeOption lagrangian/distributionModels
wmake $makeOption finiteVolume wmake $makeOption finiteVolume
wmake $makeOption genericPatchFields wmake $makeOption genericPatchFields

View File

@ -29,7 +29,7 @@ Description
SeeAlso SeeAlso
The manpage regex(7) for more information about POSIX regular expressions. The manpage regex(7) for more information about POSIX regular expressions.
These differ somewhat from \c Perl and @c sed regular expressions. These differ somewhat from \c Perl and \c sed regular expressions.
SourceFiles SourceFiles
regExp.C regExp.C

View File

@ -66,6 +66,7 @@ primitives/functions/DataEntry/makeDataEntries.C
primitives/functions/DataEntry/polynomial/polynomial.C primitives/functions/DataEntry/polynomial/polynomial.C
primitives/functions/DataEntry/polynomial/polynomialIO.C primitives/functions/DataEntry/polynomial/polynomialIO.C
primitives/functions/Polynomial/polynomialFunction.C
strings = primitives/strings strings = primitives/strings
$(strings)/string/string.C $(strings)/string/string.C
@ -164,11 +165,16 @@ $(functionEntries)/includeIfPresentEntry/includeIfPresentEntry.C
$(functionEntries)/inputModeEntry/inputModeEntry.C $(functionEntries)/inputModeEntry/inputModeEntry.C
$(functionEntries)/removeEntry/removeEntry.C $(functionEntries)/removeEntry/removeEntry.C
calcEntry = $(functionEntries)/calcEntry /*
$(calcEntry)/calcEntryParser.atg * Requires customized coco-cpp
$(calcEntry)/calcEntryInternal.C * could be dropped or activated in the future
$(calcEntry)/calcEntry.C */
/*
calcEntry = $(functionEntries)/calcEntry
$(calcEntry)/calcEntryParser.atg
$(calcEntry)/calcEntryInternal.C
$(calcEntry)/calcEntry.C
*/
IOdictionary = db/IOobjects/IOdictionary IOdictionary = db/IOobjects/IOdictionary
$(IOdictionary)/IOdictionary.C $(IOdictionary)/IOdictionary.C

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -239,6 +239,15 @@ Foam::IOdictionary::IOdictionary(const IOobject& io, const dictionary& dict)
} }
Foam::IOdictionary::IOdictionary(const IOobject& io, Istream& is)
:
regIOobject(io),
dictionary(is)
{
dictionary::name() = IOobject::objectPath();
}
// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
Foam::IOdictionary::~IOdictionary() Foam::IOdictionary::~IOdictionary()

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -75,6 +75,9 @@ public:
//- Construct given an IOobject and dictionary //- Construct given an IOobject and dictionary
IOdictionary(const IOobject&, const dictionary&); IOdictionary(const IOobject&, const dictionary&);
//- Construct given an IOobject and Istream
IOdictionary(const IOobject&, Istream&);
//- Destructor //- Destructor
virtual ~IOdictionary(); virtual ~IOdictionary();

View File

@ -486,15 +486,30 @@ Foam::dictionary& Foam::dictionary::subDict(const word& keyword)
Foam::dictionary Foam::dictionary::subOrEmptyDict Foam::dictionary Foam::dictionary::subOrEmptyDict
( (
const word& keyword const word& keyword,
const bool mustRead
) const ) const
{ {
const entry* entryPtr = lookupEntryPtr(keyword, false, true); const entry* entryPtr = lookupEntryPtr(keyword, false, true);
if (entryPtr == NULL) if (entryPtr == NULL)
{
if (mustRead)
{
FatalIOErrorIn
(
"dictionary::subOrEmptyDict(const word& keyword, const bool)",
*this
) << "keyword " << keyword << " is undefined in dictionary "
<< name()
<< exit(FatalIOError);
return entryPtr->dict();
}
else
{ {
return dictionary(*this, dictionary(name() + "::" + keyword)); return dictionary(*this, dictionary(name() + "::" + keyword));
} }
}
else else
{ {
return entryPtr->dict(); return entryPtr->dict();

View File

@ -368,7 +368,11 @@ public:
//- Find and return a sub-dictionary as a copy, or //- Find and return a sub-dictionary as a copy, or
// return an empty dictionary if the sub-dictionary does not exist // return an empty dictionary if the sub-dictionary does not exist
dictionary subOrEmptyDict(const word&) const; dictionary subOrEmptyDict
(
const word&,
const bool mustRead = false
) const;
//- Return the table of contents //- Return the table of contents
wordList toc() const; wordList toc() const;

View File

@ -27,7 +27,7 @@ Class
Description Description
Specify a file to include if it exists. Expects a single string to follow. Specify a file to include if it exists. Expects a single string to follow.
The \c \#includeIfPresent directive is similar to the @c \#include The \c \#includeIfPresent directive is similar to the \c \#include
directive, but does not generate an error if the file does not exist. directive, but does not generate an error if the file does not exist.
See Also See Also

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -95,17 +95,22 @@ Foam::tmp
> >
Foam::GeometricField<Type, PatchField, GeoMesh>::readField(Istream& is) Foam::GeometricField<Type, PatchField, GeoMesh>::readField(Istream& is)
{ {
if (is.version() < 2.0) return readField
{
FatalIOErrorIn
( (
"GeometricField<Type, PatchField, GeoMesh>::readField(Istream&)", IOdictionary
(
IOobject
(
this->name(),
this->time().timeName(),
this->db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
is is
) << "IO versions < 2.0 are not supported." )
<< exit(FatalIOError); );
}
return readField(dictionary(is));
} }
@ -384,45 +389,6 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
} }
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
(
const IOobject& io,
const Mesh& mesh,
Istream& is
)
:
DimensionedField<Type, GeoMesh>(io, mesh, dimless, false),
timeIndex_(this->time().timeIndex()),
field0Ptr_(NULL),
fieldPrevIterPtr_(NULL),
boundaryField_(*this, readField(is))
{
// Check compatibility between field and mesh
if (this->size() != GeoMesh::size(this->mesh()))
{
FatalIOErrorIn
(
"GeometricField<Type, PatchField, GeoMesh>::GeometricField"
"(const IOobject&, const Mesh&, Istream&)",
is
) << " number of field elements = " << this->size()
<< " number of mesh elements = " << GeoMesh::size(this->mesh())
<< exit(FatalIOError);
}
readOldTimeIfPresent();
if (debug)
{
Info<< "Finishing read-construct of "
"GeometricField<Type, PatchField, GeoMesh>"
<< endl << this->info() << endl;
}
}
template<class Type, template<class> class PatchField, class GeoMesh> template<class Type, template<class> class PatchField, class GeoMesh>
Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
( (

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -325,14 +325,6 @@ public:
const Mesh& const Mesh&
); );
//- Construct and read from given stream
GeometricField
(
const IOobject&,
const Mesh&,
Istream&
);
//- Construct from dictionary //- Construct from dictionary
GeometricField GeometricField
( (

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -21,9 +21,9 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
@mainpage OpenFOAM&reg;: open source CFD \mainpage OpenFOAM&reg;: open source CFD
@section about About OpenFOAM \section about About OpenFOAM
OpenFOAM is a free, open source CFD software package produced by OpenFOAM is a free, open source CFD software package produced by
a commercial company, a commercial company,
@ -35,7 +35,7 @@ License
heat transfer, to solid dynamics and electromagnetics. heat transfer, to solid dynamics and electromagnetics.
<a href="http://www.openfoam.com/features">More ...</a> <a href="http://www.openfoam.com/features">More ...</a>
@section users Our commitment to the users \section users Our commitment to the users
OpenFOAM comes with full commercial support from OpenCFD, including OpenFOAM comes with full commercial support from OpenCFD, including
<a href="http://www.openfoam.com/support/software.php"> <a href="http://www.openfoam.com/support/software.php">
@ -48,7 +48,7 @@ License
These activities fund the development, maintenance and release of These activities fund the development, maintenance and release of
OpenFOAM to make it an extremely viable commercial open source product. OpenFOAM to make it an extremely viable commercial open source product.
@section opensource Our commitment to open source \section opensource Our commitment to open source
OpenCFD is committed to open source software, continually developing and OpenCFD is committed to open source software, continually developing and
maintaining OpenFOAM under the maintaining OpenFOAM under the

View File

@ -550,11 +550,12 @@ Foam::label Foam::polyBoundaryMesh::whichPatch(const label faceIndex) const
Foam::labelHashSet Foam::polyBoundaryMesh::patchSet Foam::labelHashSet Foam::polyBoundaryMesh::patchSet
( (
const wordList& patchNames const wordReList& patchNames,
const bool warnNotFound
) const ) const
{ {
wordList allPatchNames = names(); const wordList allPatchNames(this->names());
labelHashSet ps(size()); labelHashSet ids(size());
forAll(patchNames, i) forAll(patchNames, i)
{ {
@ -562,20 +563,23 @@ Foam::labelHashSet Foam::polyBoundaryMesh::patchSet
// of all patch names for matches // of all patch names for matches
labelList patchIDs = findStrings(patchNames[i], allPatchNames); labelList patchIDs = findStrings(patchNames[i], allPatchNames);
if (patchIDs.empty()) if (patchIDs.empty() && warnNotFound)
{ {
WarningIn("polyBoundaryMesh::patchSet(const wordList&)") WarningIn
<< "Cannot find any patch names matching " << patchNames[i] (
"polyBoundaryMesh::patchSet"
"(const wordReList&, const bool) const"
) << "Cannot find any patch names matching " << patchNames[i]
<< endl; << endl;
} }
forAll(patchIDs, j) forAll(patchIDs, j)
{ {
ps.insert(patchIDs[j]); ids.insert(patchIDs[j]);
} }
} }
return ps; return ids;
} }

View File

@ -38,6 +38,7 @@ SourceFiles
#include "polyPatchList.H" #include "polyPatchList.H"
#include "regIOobject.H" #include "regIOobject.H"
#include "labelPair.H" #include "labelPair.H"
#include "wordReList.H"
#include "HashSet.H" #include "HashSet.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -166,9 +167,13 @@ public:
//- Per boundary face label the patch index //- Per boundary face label the patch index
const labelList& patchID() const; const labelList& patchID() const;
//- Return the set of patch IDs corresponding to the given list of names //- Return the set of patch IDs corresponding to the given names
// Wild cards are expanded. // By default warns if given names are not found.
labelHashSet patchSet(const wordList&) const; labelHashSet patchSet
(
const wordReList& patchNames,
const bool warnNotFound = true
) const;
//- Check whether all procs have all patches and in same order. Return //- Check whether all procs have all patches and in same order. Return
// true if in error. // true if in error.

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -41,6 +41,18 @@ Foam::Polynomial<PolySize>::Polynomial()
} }
template<int PolySize>
Foam::Polynomial<PolySize>::Polynomial
(
const Polynomial<PolySize>& poly
)
:
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(poly),
logActive_(poly.logActive_),
logCoeff_(poly.logCoeff_)
{}
template<int PolySize> template<int PolySize>
Foam::Polynomial<PolySize>::Polynomial(const scalar coeffs[PolySize]) Foam::Polynomial<PolySize>::Polynomial(const scalar coeffs[PolySize])
: :
@ -68,7 +80,7 @@ Foam::Polynomial<PolySize>::Polynomial(const UList<scalar>& coeffs)
( (
"Polynomial<PolySize>::Polynomial(const UList<scalar>&)" "Polynomial<PolySize>::Polynomial(const UList<scalar>&)"
) << "Size mismatch: Needed " << PolySize ) << "Size mismatch: Needed " << PolySize
<< " but got " << coeffs.size() << " but given " << coeffs.size()
<< nl << exit(FatalError); << nl << exit(FatalError);
} }
@ -79,6 +91,39 @@ Foam::Polynomial<PolySize>::Polynomial(const UList<scalar>& coeffs)
} }
// template<int PolySize>
// Foam::Polynomial<PolySize>::Polynomial(const polynomialFunction& poly)
// :
// VectorSpace<Polynomial<PolySize>, scalar, PolySize>(),
// logActive_(poly.logActive()),
// logCoeff_(poly.logCoeff())
// {
// if (poly.size() != PolySize)
// {
// FatalErrorIn
// (
// "Polynomial<PolySize>::Polynomial(const polynomialFunction&)"
// ) << "Size mismatch: Needed " << PolySize
// << " but given " << poly.size()
// << nl << exit(FatalError);
// }
//
// for (int i = 0; i < PolySize; ++i)
// {
// this->v_[i] = poly[i];
// }
// }
template<int PolySize>
Foam::Polynomial<PolySize>::Polynomial(Istream& is)
:
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(is),
logActive_(false),
logCoeff_(0.0)
{}
template<int PolySize> template<int PolySize>
Foam::Polynomial<PolySize>::Polynomial(const word& name, Istream& is) Foam::Polynomial<PolySize>::Polynomial(const word& name, Istream& is)
: :
@ -111,38 +156,17 @@ Foam::Polynomial<PolySize>::Polynomial(const word& name, Istream& is)
} }
template<int PolySize>
Foam::Polynomial<PolySize>::Polynomial(Istream& is)
:
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(is),
logActive_(false),
logCoeff_(0.0)
{}
template<int PolySize>
Foam::Polynomial<PolySize>::Polynomial
(
const Polynomial<PolySize>& poly
)
:
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(poly),
logActive_(poly.logActive_),
logCoeff_(poly.logCoeff_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<int PolySize> template<int PolySize>
bool& Foam::Polynomial<PolySize>::logActive() bool Foam::Polynomial<PolySize>::logActive() const
{ {
return logActive_; return logActive_;
} }
template<int PolySize> template<int PolySize>
Foam::scalar& Foam::Polynomial<PolySize>::logCoeff() Foam::scalar Foam::Polynomial<PolySize>::logCoeff() const
{ {
return logCoeff_; return logCoeff_;
} }
@ -151,27 +175,27 @@ Foam::scalar& Foam::Polynomial<PolySize>::logCoeff()
template<int PolySize> template<int PolySize>
Foam::scalar Foam::Polynomial<PolySize>::value(const scalar x) const Foam::scalar Foam::Polynomial<PolySize>::value(const scalar x) const
{ {
scalar y = this->v_[0]; scalar val = this->v_[0];
// avoid costly pow() in calculation // avoid costly pow() in calculation
scalar powX = x; scalar powX = x;
for (label i=1; i<PolySize; ++i) for (label i=1; i<PolySize; ++i)
{ {
y += this->v_[i]*powX; val += this->v_[i]*powX;
powX *= x; powX *= x;
} }
if (logActive_) if (logActive_)
{ {
y += logCoeff_*log(x); val += logCoeff_*log(x);
} }
return y; return val;
} }
template<int PolySize> template<int PolySize>
Foam::scalar Foam::Polynomial<PolySize>::integrateLimits Foam::scalar Foam::Polynomial<PolySize>::integrate
( (
const scalar x1, const scalar x1,
const scalar x2 const scalar x2
@ -181,7 +205,7 @@ Foam::scalar Foam::Polynomial<PolySize>::integrateLimits
{ {
FatalErrorIn FatalErrorIn
( (
"scalar Polynomial<PolySize>::integrateLimits" "scalar Polynomial<PolySize>::integrate"
"(" "("
"const scalar, " "const scalar, "
"const scalar" "const scalar"
@ -190,22 +214,33 @@ Foam::scalar Foam::Polynomial<PolySize>::integrateLimits
<< nl << abort(FatalError); << nl << abort(FatalError);
} }
intPolyType poly = this->integrate();
return poly.value(x2) - poly.value(x1); // avoid costly pow() in calculation
scalar powX1 = x1;
scalar powX2 = x2;
scalar val = this->v_[0]*(powX2 - powX1);
for (label i=1; i<PolySize; ++i)
{
val += this->v_[i]/(i + 1) * (powX2 - powX1);
powX1 *= x1;
powX2 *= x2;
}
return val;
} }
template<int PolySize> template<int PolySize>
typename Foam::Polynomial<PolySize>::intPolyType typename Foam::Polynomial<PolySize>::intPolyType
Foam::Polynomial<PolySize>::integrate(const scalar intConstant) Foam::Polynomial<PolySize>::integral(const scalar intConstant) const
{ {
intPolyType newCoeffs; intPolyType newCoeffs;
newCoeffs[0] = intConstant; newCoeffs[0] = intConstant;
forAll(*this, i) forAll(*this, i)
{ {
newCoeffs[i + 1] = this->v_[i]/(i + 1); newCoeffs[i+1] = this->v_[i]/(i + 1);
} }
return newCoeffs; return newCoeffs;
@ -214,14 +249,14 @@ Foam::Polynomial<PolySize>::integrate(const scalar intConstant)
template<int PolySize> template<int PolySize>
typename Foam::Polynomial<PolySize>::polyType typename Foam::Polynomial<PolySize>::polyType
Foam::Polynomial<PolySize>::integrateMinus1(const scalar intConstant) Foam::Polynomial<PolySize>::integralMinus1(const scalar intConstant) const
{ {
polyType newCoeffs; polyType newCoeffs;
if (this->v_[0] > VSMALL) if (this->v_[0] > VSMALL)
{ {
newCoeffs.logActive() = true; newCoeffs.logActive_ = true;
newCoeffs.logCoeff() = this->v_[0]; newCoeffs.logCoeff_ = this->v_[0];
} }
newCoeffs[0] = intConstant; newCoeffs[0] = intConstant;

View File

@ -29,14 +29,14 @@ Description
poly = logCoeff*log(x) + sum(coeff_[i]*x^i) poly = logCoeff*log(x) + sum(coeff_[i]*x^i)
where 0 \<= i \<= n where 0 \<= i \<= N
- integer powers, starting at zero - integer powers, starting at zero
- value(x) to evaluate the poly for a given value - value(x) to evaluate the poly for a given value
- integrate(x1, x2) between two scalar values - integrate(x1, x2) between two scalar values
- integrate() to return a new, intergated coeff polynomial - integral() to return a new, integral coeff polynomial
- increases the size (order) - increases the size (order)
- integrateMinus1() to return a new, integrated coeff polynomial where - integralMinus1() to return a new, integral coeff polynomial where
the base poly starts at order -1 the base poly starts at order -1
SourceFiles SourceFiles
@ -85,10 +85,10 @@ class Polynomial
// Private data // Private data
//- Include the log term? - only activated using integrateMinus1() //- Include the log term? - only activated using integralMinus1()
bool logActive_; bool logActive_;
//- Log coefficient - only activated using integrateMinus1() //- Log coefficient - only activated using integralMinus1()
scalar logCoeff_; scalar logCoeff_;
@ -104,6 +104,9 @@ public:
//- Construct null, with all coefficients = 0.0 //- Construct null, with all coefficients = 0.0
Polynomial(); Polynomial();
//- Copy constructor
Polynomial(const Polynomial&);
//- Construct from C-array of coefficients //- Construct from C-array of coefficients
explicit Polynomial(const scalar coeffs[PolySize]); explicit Polynomial(const scalar coeffs[PolySize]);
@ -111,24 +114,21 @@ public:
explicit Polynomial(const UList<scalar>& coeffs); explicit Polynomial(const UList<scalar>& coeffs);
//- Construct from Istream //- Construct from Istream
Polynomial(Istream& is); Polynomial(Istream&);
//- Construct from name and Istream //- Construct from name and Istream
Polynomial(const word& name, Istream& is); Polynomial(const word& name, Istream&);
//- Copy constructor
Polynomial(const Polynomial& poly);
// Member Functions // Member Functions
// Access // Access
//- Return access to the log term active flag //- Return true if the log term is active
bool& logActive(); bool logActive() const;
//- Return access to the log coefficient //- Return the log coefficient
scalar& logCoeff(); scalar logCoeff() const;
// Evaluation // Evaluation
@ -136,16 +136,17 @@ public:
//- Return polynomial value //- Return polynomial value
scalar value(const scalar x) const; scalar value(const scalar x) const;
//- Return integrated polynomial coefficients
// argument becomes zeroth element (constant of integration)
intPolyType integrate(const scalar intConstant = 0.0);
//- Return integrated polynomial coefficients when lowest order
// is -1. Argument added to zeroth element
polyType integrateMinus1(const scalar intConstant = 0.0);
//- Integrate between two values //- Integrate between two values
scalar integrateLimits(const scalar x1, const scalar x2) const; scalar integrate(const scalar x1, const scalar x2) const;
//- Return integral coefficients.
// Argument becomes zeroth element (constant of integration)
intPolyType integral(const scalar intConstant = 0.0) const;
//- Return integral coefficients when lowest order is -1.
// Argument becomes zeroth element (constant of integration)
polyType integralMinus1(const scalar intConstant = 0.0) const;
//- Ostream Operator //- Ostream Operator

View File

@ -0,0 +1,415 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
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/>.
\*---------------------------------------------------------------------------*/
#include "polynomialFunction.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(polynomialFunction, 0);
}
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
Foam::polynomialFunction Foam::polynomialFunction::cloneIntegral
(
const polynomialFunction& poly,
const scalar intConstant
)
{
polynomialFunction newPoly(poly.size()+1);
newPoly[0] = intConstant;
forAll(poly, i)
{
newPoly[i+1] = poly[i]/(i + 1);
}
return newPoly;
}
Foam::polynomialFunction Foam::polynomialFunction::cloneIntegralMinus1
(
const polynomialFunction& poly,
const scalar intConstant
)
{
polynomialFunction newPoly(poly.size()+1);
if (poly[0] > VSMALL)
{
newPoly.logActive_ = true;
newPoly.logCoeff_ = poly[0];
}
newPoly[0] = intConstant;
for (label i=1; i < poly.size(); ++i)
{
newPoly[i] = poly[i]/i;
}
return newPoly;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::polynomialFunction::polynomialFunction(const label order)
:
scalarList(order, 0.0),
logActive_(false),
logCoeff_(0.0)
{
if (this->empty())
{
FatalErrorIn
(
"polynomialFunction::polynomialFunction(const label order)"
) << "polynomialFunction coefficients are invalid (empty)"
<< nl << exit(FatalError);
}
}
Foam::polynomialFunction::polynomialFunction(const polynomialFunction& poly)
:
scalarList(poly),
logActive_(poly.logActive_),
logCoeff_(poly.logCoeff_)
{}
Foam::polynomialFunction::polynomialFunction(const UList<scalar>& coeffs)
:
scalarList(coeffs),
logActive_(false),
logCoeff_(0.0)
{
if (this->empty())
{
FatalErrorIn
(
"polynomialFunction::polynomialFunction(const UList<scalar>&)"
) << "polynomialFunction coefficients are invalid (empty)"
<< nl << exit(FatalError);
}
}
Foam::polynomialFunction::polynomialFunction(Istream& is)
:
scalarList(is),
logActive_(false),
logCoeff_(0.0)
{
if (this->empty())
{
FatalErrorIn
(
"polynomialFunction::polynomialFunction(Istream&)"
) << "polynomialFunction coefficients are invalid (empty)"
<< nl << exit(FatalError);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::polynomialFunction::~polynomialFunction()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::polynomialFunction::logActive() const
{
return logActive_;
}
Foam::scalar Foam::polynomialFunction::logCoeff() const
{
return logCoeff_;
}
Foam::scalar Foam::polynomialFunction::value(const scalar x) const
{
const scalarList& coeffs = *this;
scalar val = coeffs[0];
// avoid costly pow() in calculation
scalar powX = x;
for (label i=1; i<coeffs.size(); ++i)
{
val += coeffs[i]*powX;
powX *= x;
}
if (logActive_)
{
val += this->logCoeff_*log(x);
}
return val;
}
Foam::scalar Foam::polynomialFunction::integrate
(
const scalar x1,
const scalar x2
) const
{
const scalarList& coeffs = *this;
if (logActive_)
{
FatalErrorIn
(
"scalar polynomialFunction::integrate"
"("
"const scalar, "
"const scalar"
") const"
) << "Cannot integrate polynomial with logarithmic coefficients"
<< nl << abort(FatalError);
}
// avoid costly pow() in calculation
scalar powX1 = x1;
scalar powX2 = x2;
scalar val = coeffs[0]*(powX2 - powX1);
for (label i=1; i<coeffs.size(); ++i)
{
val += coeffs[i]/(i + 1)*(powX2 - powX1);
powX1 *= x1;
powX2 *= x2;
}
return val;
}
Foam::polynomialFunction
Foam::polynomialFunction::integral(const scalar intConstant) const
{
return cloneIntegral(*this, intConstant);
}
Foam::polynomialFunction
Foam::polynomialFunction::integralMinus1(const scalar intConstant) const
{
return cloneIntegralMinus1(*this, intConstant);
}
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
Foam::polynomialFunction&
Foam::polynomialFunction::operator+=(const polynomialFunction& poly)
{
scalarList& coeffs = *this;
if (coeffs.size() > poly.size())
{
forAll(poly, i)
{
coeffs[i] += poly[i];
}
}
else
{
coeffs.setSize(poly.size(), 0.0);
forAll(coeffs, i)
{
coeffs[i] += poly[i];
}
}
return *this;
}
Foam::polynomialFunction&
Foam::polynomialFunction::operator-=(const polynomialFunction& poly)
{
scalarList& coeffs = *this;
if (coeffs.size() > poly.size())
{
forAll(poly, i)
{
coeffs[i] -= poly[i];
}
}
else
{
coeffs.setSize(poly.size(), 0.0);
forAll(coeffs, i)
{
coeffs[i] -= poly[i];
}
}
return *this;
}
Foam::polynomialFunction&
Foam::polynomialFunction::operator*=(const scalar s)
{
scalarList& coeffs = *this;
forAll(coeffs, i)
{
coeffs[i] *= s;
}
return *this;
}
Foam::polynomialFunction&
Foam::polynomialFunction::operator/=(const scalar s)
{
scalarList& coeffs = *this;
forAll(coeffs, i)
{
coeffs[i] /= s;
}
return *this;
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const polynomialFunction& poly)
{
// output like VectorSpace
os << token::BEGIN_LIST;
if (!poly.empty())
{
for (int i=0; i<poly.size()-1; i++)
{
os << poly[i] << token::SPACE;
}
os << poly.last();
}
os << token::END_LIST;
// Check state of Ostream
os.check("operator<<(Ostream&, const polynomialFunction&)");
return os;
}
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
Foam::polynomialFunction
Foam::operator+
(
const polynomialFunction& p1,
const polynomialFunction& p2
)
{
polynomialFunction poly(p1);
return poly += p2;
}
Foam::polynomialFunction
Foam::operator-
(
const polynomialFunction& p1,
const polynomialFunction& p2
)
{
polynomialFunction poly(p1);
return poly -= p2;
}
Foam::polynomialFunction
Foam::operator*
(
const scalar s,
const polynomialFunction& p
)
{
polynomialFunction poly(p);
return poly *= s;
}
Foam::polynomialFunction
Foam::operator/
(
const scalar s,
const polynomialFunction& p
)
{
polynomialFunction poly(p);
return poly /= s;
}
Foam::polynomialFunction
Foam::operator*
(
const polynomialFunction& p,
const scalar s
)
{
polynomialFunction poly(p);
return poly *= s;
}
Foam::polynomialFunction
Foam::operator/
(
const polynomialFunction& p,
const scalar s
)
{
polynomialFunction poly(p);
return poly /= s;
}
// ************************************************************************* //

View File

@ -0,0 +1,246 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
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::polynomialFunction
Description
Polynomial function representation
poly = logCoeff*log(x) + sum(coeff_[i]*x^i)
where 0 \<= i \<= N
- integer powers, starting at zero
- value(x) to evaluate the poly for a given value
- integrate(x1, x2) between two scalar values
- integral() to return a new, integral coeff polynomial
- increases the size (order)
- integralMinus1() to return a new, integral coeff polynomial where
the base poly starts at order -1
SeeAlso
Foam::Polynomial for a templated implementation
SourceFiles
polynomialFunction.C
\*---------------------------------------------------------------------------*/
#ifndef polynomialFunction_H
#define polynomialFunction_H
#include "scalarList.H"
#include "Ostream.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class polynomialFunction;
// Forward declaration of friend functions
Ostream& operator<<(Ostream&, const polynomialFunction&);
/*---------------------------------------------------------------------------*\
Class polynomialFunction Declaration
\*---------------------------------------------------------------------------*/
class polynomialFunction
:
private scalarList
{
// Private data
//- Include the log term? - only activated using integralMinus1()
bool logActive_;
//- Log coefficient - only activated using integralMinus1()
scalar logCoeff_;
// Private Member Functions
//- Return integral coefficients.
// Argument becomes zeroth element (constant of integration)
static polynomialFunction cloneIntegral
(
const polynomialFunction&,
const scalar intConstant = 0.0
);
//- Return integral coefficients when lowest order is -1.
// Argument becomes zeroth element (constant of integration)
static polynomialFunction cloneIntegralMinus1
(
const polynomialFunction&,
const scalar intConstant = 0.0
);
//- Disallow default bitwise assignment
void operator=(const polynomialFunction&);
public:
//- Runtime type information
TypeName("polynomialFunction");
// Constructors
//- Construct a particular size, with all coefficients = 0.0
explicit polynomialFunction(const label);
//- Copy constructor
polynomialFunction(const polynomialFunction&);
//- Construct from a list of coefficients
explicit polynomialFunction(const UList<scalar>& coeffs);
//- Construct from Istream
polynomialFunction(Istream&);
//- Destructor
virtual ~polynomialFunction();
// Member Functions
//- Return the number of coefficients
using scalarList::size;
//- Return coefficient
using scalarList::operator[];
// Access
//- Return true if the log term is active
bool logActive() const;
//- Return the log coefficient
scalar logCoeff() const;
// Evaluation
//- Return polynomial value
scalar value(const scalar x) const;
//- Integrate between two values
scalar integrate(const scalar x1, const scalar x2) const;
//- Return integral coefficients.
// Argument becomes zeroth element (constant of integration)
polynomialFunction integral
(
const scalar intConstant = 0.0
) const;
//- Return integral coefficients when lowest order is -1.
// Argument becomes zeroth element (constant of integration)
polynomialFunction integralMinus1
(
const scalar intConstant = 0.0
) const;
// Member Operators
polynomialFunction& operator+=(const polynomialFunction&);
polynomialFunction& operator-=(const polynomialFunction&);
polynomialFunction& operator*=(const scalar);
polynomialFunction& operator/=(const scalar);
//- Ostream Operator
friend Ostream& operator<<(Ostream&, const polynomialFunction&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
polynomialFunction operator+
(
const polynomialFunction&,
const polynomialFunction&
);
polynomialFunction operator-
(
const polynomialFunction&,
const polynomialFunction&
);
polynomialFunction operator*
(
const scalar,
const polynomialFunction&
);
polynomialFunction operator/
(
const scalar,
const polynomialFunction&
);
polynomialFunction operator*
(
const polynomialFunction&,
const scalar
);
polynomialFunction operator/
(
const polynomialFunction&,
const scalar
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -35,7 +35,7 @@ Description
write OpenFOAM meshes and/or results to another CFD format write OpenFOAM meshes and/or results to another CFD format
- currently just STAR-CD - currently just STAR-CD
@par Files \par Files
"constant/boundaryRegion" is an IOMap<dictionary> that contains "constant/boundaryRegion" is an IOMap<dictionary> that contains
the boundary type and names. eg, the boundary type and names. eg,

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -36,6 +36,7 @@ SourceFiles
#define inverseDistanceDiffusivity_H #define inverseDistanceDiffusivity_H
#include "uniformDiffusivity.H" #include "uniformDiffusivity.H"
#include "wordReList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -53,9 +54,8 @@ class inverseDistanceDiffusivity
// Private data // Private data
//- Patches selected to base the distance on //- Patches selected to base the distance on
// These can contain regular expressions and the actual patch names // These can contain patch names or regular expressions to search for.
// will be searched for. wordReList patchNames_;
wordList patchNames_;
// Private Member Functions // Private Member Functions

View File

@ -0,0 +1,40 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
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/>.
\*---------------------------------------------------------------------------*/
#include "coalParcel.H"
// Using thermodynamic variant
#include "makeThermoParcelForces.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Kinematic sub-models
makeThermoParcelForces(coalParcel);
};
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -26,8 +26,8 @@ License
#include "coalParcel.H" #include "coalParcel.H"
// Kinematic // Kinematic
#include "makeThermoParcelForces.H" // thermo variant
#include "makeParcelDispersionModels.H" #include "makeParcelDispersionModels.H"
#include "makeParcelDragModels.H"
#include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant #include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant
#include "makeParcelCollisionModels.H" #include "makeParcelCollisionModels.H"
#include "makeParcelPatchInteractionModels.H" #include "makeParcelPatchInteractionModels.H"
@ -52,8 +52,8 @@ License
namespace Foam namespace Foam
{ {
// Kinematic sub-models // Kinematic sub-models
makeThermoParcelForces(coalParcel);
makeParcelDispersionModels(coalParcel); makeParcelDispersionModels(coalParcel);
makeParcelDragModels(coalParcel);
makeReactingMultiphaseParcelInjectionModels(coalParcel); makeReactingMultiphaseParcelInjectionModels(coalParcel);
makeParcelCollisionModels(coalParcel); makeParcelCollisionModels(coalParcel);
makeParcelPatchInteractionModels(coalParcel); makeParcelPatchInteractionModels(coalParcel);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -78,10 +78,6 @@ $(REACTINGMPINJECTION)/ReactingMultiphaseLookupTableInjection/reactingMultiphase
IntegrationScheme/makeIntegrationSchemes.C IntegrationScheme/makeIntegrationSchemes.C
/* particle forces */
particleForces/particleForces.C
/* phase properties */ /* phase properties */
phaseProperties/phaseProperties/phaseProperties.C phaseProperties/phaseProperties/phaseProperties.C
phaseProperties/phaseProperties/phasePropertiesIO.C phaseProperties/phaseProperties/phasePropertiesIO.C

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,7 +30,6 @@ License
#include "CollisionModel.H" #include "CollisionModel.H"
#include "DispersionModel.H" #include "DispersionModel.H"
#include "DragModel.H"
#include "InjectionModel.H" #include "InjectionModel.H"
#include "PatchInteractionModel.H" #include "PatchInteractionModel.H"
#include "PostProcessingModel.H" #include "PostProcessingModel.H"
@ -209,15 +208,6 @@ void Foam::KinematicCloud<ParcelType>::setModels()
).ptr() ).ptr()
); );
dragModel_.reset
(
DragModel<KinematicCloud<ParcelType> >::New
(
subModelProperties_,
*this
).ptr()
);
injectionModel_.reset injectionModel_.reset
( (
InjectionModel<KinematicCloud<ParcelType> >::New InjectionModel<KinematicCloud<ParcelType> >::New
@ -306,7 +296,7 @@ void Foam::KinematicCloud<ParcelType>::preEvolve()
Info<< "\nSolving cloud " << this->name() << endl; Info<< "\nSolving cloud " << this->name() << endl;
this->dispersion().cacheFields(true); this->dispersion().cacheFields(true);
forces_.cacheFields(true, solution_.interpolationSchemes()); forces_.cacheFields(true);
updateCellOccupancy(); updateCellOccupancy();
} }
@ -390,7 +380,7 @@ void Foam::KinematicCloud<ParcelType>::evolveCloud
} }
else else
{ {
// this->surfaceFilm().injectStreadyState(td); // this->surfaceFilm().injectSteadyState(td);
this->injection().injectSteadyState(td, solution_.deltaT()); this->injection().injectSteadyState(td, solution_.deltaT());
@ -473,7 +463,7 @@ void Foam::KinematicCloud<ParcelType>::postEvolve()
} }
this->dispersion().cacheFields(false); this->dispersion().cacheFields(false);
forces_.cacheFields(false, solution_.interpolationSchemes()); forces_.cacheFields(false);
this->postProcessing().post(); this->postProcessing().post();
@ -488,14 +478,15 @@ void Foam::KinematicCloud<ParcelType>::cloudReset(KinematicCloud<ParcelType>& c)
rndGen_ = c.rndGen_; rndGen_ = c.rndGen_;
collisionModel_ = c.collisionModel_->clone(); forces_.transfer(c.forces_);
dispersionModel_= c.dispersionModel_->clone();
dragModel_ = c.dragModel_->clone();
injectionModel_ = c.injectionModel_->clone();
patchInteractionModel_ = c.patchInteractionModel_->clone();
postProcessingModel_ = c.postProcessingModel_->clone();
UIntegrator_ = c.UIntegrator_->clone(); collisionModel_.reset(c.collisionModel_.ptr());
dispersionModel_.reset(c.dispersionModel_.ptr());
injectionModel_.reset(c.injectionModel_.ptr());
patchInteractionModel_.reset(c.patchInteractionModel_.ptr());
postProcessingModel_.reset(c.postProcessingModel_.ptr());
UIntegrator_.reset(c.UIntegrator_.ptr());
} }
@ -529,7 +520,10 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
), ),
solution_(mesh_, particleProperties_.subDict("solution")), solution_(mesh_, particleProperties_.subDict("solution")),
constProps_(particleProperties_, solution_.active()), constProps_(particleProperties_, solution_.active()),
subModelProperties_(particleProperties_.subOrEmptyDict("subModels")), subModelProperties_
(
particleProperties_.subOrEmptyDict("subModels", solution_.active())
),
rndGen_ rndGen_
( (
label(0), label(0),
@ -540,10 +534,19 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
U_(U), U_(U),
mu_(mu), mu_(mu),
g_(g), g_(g),
forces_(mesh_, particleProperties_, g_.value(), solution_.active()), forces_
(
*this,
mesh_,
subModelProperties_.subOrEmptyDict
(
"particleForces",
solution_.active()
),
solution_.active()
),
collisionModel_(NULL), collisionModel_(NULL),
dispersionModel_(NULL), dispersionModel_(NULL),
dragModel_(NULL),
injectionModel_(NULL), injectionModel_(NULL),
patchInteractionModel_(NULL), patchInteractionModel_(NULL),
postProcessingModel_(NULL), postProcessingModel_(NULL),
@ -606,7 +609,7 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
const word& name const word& name
) )
: :
Cloud<ParcelType>(c.mesh(), name, c), Cloud<ParcelType>(c.mesh_, name, c),
kinematicCloud(), kinematicCloud(),
cloudCopyPtr_(NULL), cloudCopyPtr_(NULL),
mesh_(c.mesh_), mesh_(c.mesh_),
@ -623,7 +626,6 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
forces_(c.forces_), forces_(c.forces_),
collisionModel_(c.collisionModel_->clone()), collisionModel_(c.collisionModel_->clone()),
dispersionModel_(c.dispersionModel_->clone()), dispersionModel_(c.dispersionModel_->clone()),
dragModel_(c.dragModel_->clone()),
injectionModel_(c.injectionModel_->clone()), injectionModel_(c.injectionModel_->clone()),
patchInteractionModel_(c.patchInteractionModel_->clone()), patchInteractionModel_(c.patchInteractionModel_->clone()),
postProcessingModel_(c.postProcessingModel_->clone()), postProcessingModel_(c.postProcessingModel_->clone()),
@ -661,7 +663,6 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
c.UCoeff_() c.UCoeff_()
) )
) )
{} {}
@ -698,10 +699,9 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud
U_(c.U_), U_(c.U_),
mu_(c.mu_), mu_(c.mu_),
g_(c.g_), g_(c.g_),
forces_(mesh), forces_(*this, mesh),
collisionModel_(NULL), collisionModel_(NULL),
dispersionModel_(NULL), dispersionModel_(NULL),
dragModel_(NULL),
injectionModel_(NULL), injectionModel_(NULL),
patchInteractionModel_(NULL), patchInteractionModel_(NULL),
postProcessingModel_(NULL), postProcessingModel_(NULL),
@ -830,8 +830,10 @@ void Foam::KinematicCloud<ParcelType>::info() const
<< linearKineticEnergy << nl << linearKineticEnergy << nl
<< " Rotational kinetic energy = " << " Rotational kinetic energy = "
<< rotationalKineticEnergy << nl; << rotationalKineticEnergy << nl;
this->injection().info(Info); this->injection().info(Info);
this->surfaceFilm().info(Info); this->surfaceFilm().info(Info);
this->patchInteraction().info(Info);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -29,10 +29,14 @@ Description
- holds a 'cloudSolution' class that stores all relevant solution info - holds a 'cloudSolution' class that stores all relevant solution info
- particle forces
- buoyancy
- drag
- pressure gradient
- sub-models: - sub-models:
- Collision model - Collision model
- Dispersion model - Dispersion model
- Drag model
- Injection model - Injection model
- Patch interaction model - Patch interaction model
- Post-processing model - Post-processing model
@ -55,7 +59,6 @@ SourceFiles
#include "fvMesh.H" #include "fvMesh.H"
#include "volFields.H" #include "volFields.H"
#include "fvMatrices.H" #include "fvMatrices.H"
#include "particleForces.H"
#include "IntegrationSchemesFwd.H" #include "IntegrationSchemesFwd.H"
@ -72,9 +75,6 @@ class CollisionModel;
template<class CloudType> template<class CloudType>
class DispersionModel; class DispersionModel;
template<class CloudType>
class DragModel;
template<class CloudType> template<class CloudType>
class InjectionModel; class InjectionModel;
@ -98,6 +98,14 @@ class KinematicCloud
public Cloud<ParcelType>, public Cloud<ParcelType>,
public kinematicCloud public kinematicCloud
{ {
public:
//- Type of parcel the cloud was instantiated for
typedef ParcelType parcelType;
private:
// Private data // Private data
//- Cloud copy pointer //- Cloud copy pointer
@ -316,7 +324,7 @@ protected:
//- Optional particle forces //- Optional particle forces
particleForces forces_; typename ParcelType::forceType forces_;
// References to the cloud sub-models // References to the cloud sub-models
@ -329,9 +337,6 @@ protected:
autoPtr<DispersionModel<KinematicCloud<ParcelType> > > autoPtr<DispersionModel<KinematicCloud<ParcelType> > >
dispersionModel_; dispersionModel_;
//- Drag transfer model
autoPtr<DragModel<KinematicCloud<ParcelType> > > dragModel_;
//- Injector model //- Injector model
autoPtr<InjectionModel<KinematicCloud<ParcelType> > > autoPtr<InjectionModel<KinematicCloud<ParcelType> > >
injectionModel_; injectionModel_;
@ -450,10 +455,6 @@ public:
virtual ~KinematicCloud(); virtual ~KinematicCloud();
//- Type of parcel the cloud was instantiated for
typedef ParcelType parcelType;
// Member Functions // Member Functions
// Access // Access
@ -521,7 +522,7 @@ public:
//- Optional particle forces //- Optional particle forces
inline const particleForces& forces() const; inline const typename ParcelType::forceType& forces() const;
// Sub-models // Sub-models
@ -542,10 +543,6 @@ public:
inline DispersionModel<KinematicCloud<ParcelType> >& inline DispersionModel<KinematicCloud<ParcelType> >&
dispersion(); dispersion();
//- Return const-access to the drag model
inline const DragModel<KinematicCloud<ParcelType> >&
drag() const;
//- Return const access to the injection model //- Return const access to the injection model
inline const InjectionModel<KinematicCloud<ParcelType> >& inline const InjectionModel<KinematicCloud<ParcelType> >&
injection() const; injection() const;
@ -558,6 +555,10 @@ public:
inline const PatchInteractionModel<KinematicCloud<ParcelType> >& inline const PatchInteractionModel<KinematicCloud<ParcelType> >&
patchInteraction() const; patchInteraction() const;
//- Return reference to the patch interaction model
inline PatchInteractionModel<KinematicCloud<ParcelType> >&
patchInteraction();
//- Return reference to post-processing model //- Return reference to post-processing model
inline PostProcessingModel<KinematicCloud<ParcelType> >& inline PostProcessingModel<KinematicCloud<ParcelType> >&
postProcessing(); postProcessing();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -257,7 +257,7 @@ Foam::KinematicCloud<ParcelType>::g() const
template<class ParcelType> template<class ParcelType>
inline const Foam::particleForces& inline const typename ParcelType::forceType&
Foam::KinematicCloud<ParcelType>::forces() const Foam::KinematicCloud<ParcelType>::forces() const
{ {
return forces_; return forces_;
@ -296,14 +296,6 @@ Foam::KinematicCloud<ParcelType>::dispersion()
} }
template<class ParcelType>
inline const Foam::DragModel<Foam::KinematicCloud<ParcelType> >&
Foam::KinematicCloud<ParcelType>::drag() const
{
return dragModel_;
}
template<class ParcelType> template<class ParcelType>
inline const Foam::InjectionModel<Foam::KinematicCloud<ParcelType> >& inline const Foam::InjectionModel<Foam::KinematicCloud<ParcelType> >&
Foam::KinematicCloud<ParcelType>::injection() const Foam::KinematicCloud<ParcelType>::injection() const
@ -320,6 +312,14 @@ Foam::KinematicCloud<ParcelType>::patchInteraction() const
} }
template<class ParcelType>
inline Foam::PatchInteractionModel<Foam::KinematicCloud<ParcelType> >&
Foam::KinematicCloud<ParcelType>::patchInteraction()
{
return patchInteractionModel_();
}
template<class ParcelType> template<class ParcelType>
inline Foam::InjectionModel<Foam::KinematicCloud<ParcelType> >& inline Foam::InjectionModel<Foam::KinematicCloud<ParcelType> >&
Foam::KinematicCloud<ParcelType>::injection() Foam::KinematicCloud<ParcelType>::injection()

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -85,8 +85,8 @@ void Foam::ReactingCloud<ParcelType>::cloudReset(ReactingCloud<ParcelType>& c)
{ {
ThermoCloud<ParcelType>::cloudReset(c); ThermoCloud<ParcelType>::cloudReset(c);
compositionModel_ = c.compositionModel_->clone(); compositionModel_.reset(c.compositionModel_.ptr());
phaseChangeModel_ = c.phaseChangeModel_->clone(); phaseChangeModel_.reset(c.phaseChangeModel_.ptr());
dMassPhaseChange_ = c.dMassPhaseChange_; dMassPhaseChange_ = c.dMassPhaseChange_;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -61,8 +61,8 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::cloudReset
{ {
ReactingCloud<ParcelType>::cloudReset(c); ReactingCloud<ParcelType>::cloudReset(c);
devolatilisationModel_ = c.devolatilisationModel_->clone(); devolatilisationModel_.reset(c.devolatilisationModel_.ptr());
surfaceReactionModel_ = c.surfaceReactionModel_->clone(); surfaceReactionModel_.reset(c.surfaceReactionModel_.ptr());
dMassDevolatilisation_ = c.dMassDevolatilisation_; dMassDevolatilisation_ = c.dMassDevolatilisation_;
dMassSurfaceReaction_ = c.dMassSurfaceReaction_; dMassSurfaceReaction_ = c.dMassSurfaceReaction_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -60,8 +60,8 @@ void Foam::ThermoCloud<ParcelType>::cloudReset(ThermoCloud<ParcelType>& c)
{ {
KinematicCloud<ParcelType>::cloudReset(c); KinematicCloud<ParcelType>::cloudReset(c);
heatTransferModel_ = c.heatTransferModel_->clone(); heatTransferModel_.reset(c.heatTransferModel_.ptr());
TIntegrator_ = c.TIntegrator_->clone(); TIntegrator_.reset(c.TIntegrator_.ptr());
radiation_ = c.radiation_; radiation_ = c.radiation_;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

Some files were not shown because too many files have changed in this diff Show More