Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
Henry
2010-07-23 10:55:08 +01:00
162 changed files with 1706 additions and 1091 deletions

View File

@ -12,7 +12,12 @@ wmakeCheckPwd "$WM_PROJECT_DIR" || {
( cd wmake/src && make )
# build ThirdParty sources
$WM_THIRD_PARTY_DIR/Allwmake
if [ -d "$WM_THIRD_PARTY_DIR" ]
then
$WM_THIRD_PARTY_DIR/Allwmake
else
echo "no ThirdParty sources found - skipping"
fi
# build OpenFOAM libraries and applications
src/Allwmake

View File

@ -20,6 +20,7 @@ EXE_INC = \
EXE_LIBS = \
-lengine \
-lmeshTools \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lbasicThermophysicalModels \
-lreactionThermophysicalModels \

View File

@ -10,6 +10,7 @@ EXE_INC = \
EXE_LIBS = \
-lengine \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lbasicThermophysicalModels \

View File

@ -10,6 +10,7 @@ EXE_INC = \
EXE_LIBS = \
-lengine \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lbasicThermophysicalModels \

View File

@ -18,6 +18,7 @@ EXE_INC = \
EXE_LIBS = \
-lengine \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lreactionThermophysicalModels \

View File

@ -16,6 +16,7 @@ EXE_INC = \
-I$(LIB_SRC)/ODE/lnInclude
EXE_LIBS = \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lreactionThermophysicalModels \

View File

@ -10,6 +10,7 @@ EXE_INC = \
EXE_LIBS = \
-lengine \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lbasicThermophysicalModels \

View File

@ -14,6 +14,7 @@ EXE_LIBS = \
-lreactionThermophysicalModels \
-lbasicThermophysicalModels \
-lfiniteVolume \
-lcompressibleTurbulenceModel \
-lcompressibleLESModels \
-lcompressibleRASModels \
-lradiation

View File

@ -8,6 +8,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lreactionThermophysicalModels \

View File

@ -8,6 +8,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lreactionThermophysicalModels \

View File

@ -7,6 +7,7 @@ EXE_INC = \
EXE_LIBS = \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lfiniteVolume \

View File

@ -9,6 +9,7 @@ EXE_INC = \
EXE_LIBS = \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lfiniteVolume \

View File

@ -11,6 +11,7 @@ EXE_LIBS = \
-lbasicThermophysicalModels \
-lthermalPorousZone \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lfiniteVolume \
-lmeshTools

View File

@ -8,6 +8,7 @@ EXE_INC = \
EXE_LIBS = \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lfiniteVolume \
-lmeshTools

View File

@ -9,6 +9,7 @@ EXE_INC = \
EXE_LIBS = \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lfiniteVolume \

View File

@ -6,6 +6,7 @@ EXE_INC = \
EXE_LIBS = \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lfiniteVolume \

View File

@ -9,5 +9,6 @@ EXE_INC = \
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleTransportModels

View File

@ -8,5 +8,6 @@ EXE_INC = \
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleTransportModels

View File

@ -7,6 +7,7 @@ EXE_LIBS = \
-lmeshTools \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lfiniteVolume

View File

@ -9,5 +9,6 @@ EXE_LIBS = \
-lmeshTools \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lfiniteVolume

View File

@ -12,6 +12,7 @@ EXE_LIBS = \
-lbasicThermophysicalModels \
-lspecie \
-lradiation \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lfiniteVolume \
-lmeshTools

View File

@ -13,6 +13,8 @@ EXE_LIBS = \
-lbasicThermophysicalModels \
-lbasicSolidThermo \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lmeshTools \
-lfiniteVolume

View File

@ -17,4 +17,6 @@ EXE_LIBS = \
-lbasicThermophysicalModels \
-lbasicSolidThermo \
-lspecie \
-lcompressibleRASModels
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels

View File

@ -33,13 +33,12 @@ if (adjustTimeStep)
{
if ((runTime.timeIndex() == 0) && ((CoNum > SMALL) || (DiNum > SMALL)))
{
if (CoNum == -GREAT)
if (CoNum < SMALL)
{
CoNum = SMALL;
}
if (DiNum == -GREAT)
if (DiNum < SMALL)
{
DiNum = SMALL;
}

View File

@ -7,6 +7,7 @@ EXE_INC = \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleTransportModels \
-lfiniteVolume \

View File

@ -6,6 +6,7 @@ EXE_INC = \
EXE_LIBS = \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lfiniteVolume \

View File

@ -5,6 +5,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lincompressibleTransportModels \

View File

@ -8,6 +8,7 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleTransportModels \
-lfiniteVolume \

View File

@ -6,6 +6,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleTransportModels \
-lfiniteVolume

View File

@ -22,6 +22,7 @@ EXE_INC = \
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-llagrangian \

View File

@ -22,6 +22,7 @@ EXE_INC = \
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-llagrangian \

View File

@ -21,6 +21,7 @@ EXE_INC = \
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-llagrangian \

View File

@ -17,6 +17,7 @@ EXE_LIBS = \
-lbasicThermophysicalModels \
-lspecie \
-lradiation \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lfiniteVolume \

View File

@ -7,6 +7,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/barotropicCompressibilityModel/lnInclude
EXE_LIBS = \
-lincompressibleTurbulenceModel \
-lincompressibleTransportModels \
-lincompressibleRASModels \
-lincompressibleLESModels \

View File

@ -11,6 +11,7 @@ EXE_INC = \
EXE_LIBS = \
-linterfaceProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lfiniteVolume \

View File

@ -1,4 +1,4 @@
EXE_INC = -ggdb3 \
EXE_INC = \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
@ -8,6 +8,7 @@ EXE_INC = -ggdb3 \
EXE_LIBS = \
-linterfaceProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lfiniteVolume

View File

@ -12,6 +12,7 @@ EXE_INC = \
EXE_LIBS = \
-linterfaceProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lfiniteVolume \

View File

@ -8,6 +8,7 @@ EXE_INC = \
EXE_LIBS = \
-linterfaceProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lfiniteVolume

View File

@ -12,6 +12,7 @@ EXE_INC = \
EXE_LIBS = \
-linterfaceProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lfiniteVolume

View File

@ -9,6 +9,7 @@ EXE_INC = \
EXE_LIBS = \
-linterfaceProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lfiniteVolume

View File

@ -11,6 +11,7 @@ EXE_INC = \
EXE_LIBS = \
-linterfaceProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lfiniteVolume

View File

@ -8,6 +8,7 @@ EXE_INC = \
EXE_LIBS = \
-linterfaceProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lfiniteVolume

View File

@ -3,7 +3,6 @@ EXE_INC = \
-I$(LIB_SRC)/errorEstimation/lnInclude
EXE_LIBS = \
-lerrorEstimation \
-lmeshTools \
-ldynamicMesh \
-lfiniteVolume

View File

@ -430,6 +430,59 @@ int main(int argc, char *argv[])
<< "Band before renumbering: "
<< returnReduce(band, maxOp<label>()) << nl << endl;
// Read parallel reconstruct maps
labelIOList cellProcAddressing
(
IOobject
(
"cellProcAddressing",
mesh.facesInstance(),
polyMesh::meshSubDir,
mesh,
IOobject::READ_IF_PRESENT
),
labelList(0)
);
labelIOList faceProcAddressing
(
IOobject
(
"faceProcAddressing",
mesh.facesInstance(),
polyMesh::meshSubDir,
mesh,
IOobject::READ_IF_PRESENT
),
labelList(0)
);
labelIOList pointProcAddressing
(
IOobject
(
"pointProcAddressing",
mesh.pointsInstance(),
polyMesh::meshSubDir,
mesh,
IOobject::READ_IF_PRESENT
),
labelList(0)
);
labelIOList boundaryProcAddressing
(
IOobject
(
"boundaryProcAddressing",
mesh.pointsInstance(),
polyMesh::meshSubDir,
mesh,
IOobject::READ_IF_PRESENT
),
labelList(0)
);
// Read objects in time directory
IOobjectList objects(mesh, runTime.timeName());
@ -579,6 +632,39 @@ int main(int argc, char *argv[])
// Update fields
mesh.updateMesh(map);
// Update proc maps
if (cellProcAddressing.headerOk())
{
Info<< "Renumbering processor cell decomposition map "
<< cellProcAddressing.name() << endl;
cellProcAddressing = labelList
(
UIndirectList<label>(cellProcAddressing, map().cellMap())
);
}
if (faceProcAddressing.headerOk())
{
Info<< "Renumbering processor face decomposition map "
<< faceProcAddressing.name() << endl;
faceProcAddressing = labelList
(
UIndirectList<label>(faceProcAddressing, map().faceMap())
);
}
if (pointProcAddressing.headerOk())
{
Info<< "Renumbering processor point decomposition map "
<< pointProcAddressing.name() << endl;
pointProcAddressing = labelList
(
UIndirectList<label>(pointProcAddressing, map().pointMap())
);
}
// Move mesh (since morphing might not do this)
if (map().hasMotionPoints())
{
@ -652,9 +738,31 @@ int main(int argc, char *argv[])
{
mesh.setInstance(oldInstance);
}
Info<< "Writing mesh to " << runTime.timeName() << endl;
Info<< "Writing mesh to " << mesh.facesInstance() << endl;
mesh.write();
if (cellProcAddressing.headerOk())
{
cellProcAddressing.instance() = mesh.facesInstance();
cellProcAddressing.write();
}
if (faceProcAddressing.headerOk())
{
faceProcAddressing.instance() = mesh.facesInstance();
faceProcAddressing.write();
}
if (pointProcAddressing.headerOk())
{
pointProcAddressing.instance() = mesh.facesInstance();
pointProcAddressing.write();
}
if (boundaryProcAddressing.headerOk())
{
boundaryProcAddressing.instance() = mesh.facesInstance();
boundaryProcAddressing.write();
}
if (writeMaps)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -42,6 +42,9 @@ Usage
@param -copyUniform \n
Copy any @a uniform directories too.
@param -constant \n
Override controlDict settings and use constant directory.
@param -fields \n
Use existing geometry decomposition and convert fields only.
@ -119,6 +122,11 @@ int main(int argc, char *argv[])
"ifRequired",
"only decompose geometry if the number of domains has changed"
);
argList::addBoolOption
(
"constant",
"include the 'constant/' dir in the times list"
);
#include "setRootCase.H"
@ -139,6 +147,20 @@ int main(int argc, char *argv[])
#include "createTime.H"
// Allow -constant to override controlDict settings.
if (args.optionFound("constant"))
{
instantList timeDirs = timeSelector::select0(runTime, args);
if (runTime.timeName() != runTime.constant())
{
FatalErrorIn(args.executable())
<< "No '" << runTime.constant() << "' time present." << endl
<< "Valid times are " << runTime.times()
<< exit(FatalError);
}
}
Info<< "Time = " << runTime.timeName() << endl;
// determine the existing processor count directly

View File

@ -31,6 +31,7 @@ License
#include "cellModeller.H"
#include "vtkOpenFOAMPoints.H"
#include "Swap.H"
#include "longLong.H"
// VTK includes
#include "vtkCellArray.h"

View File

@ -195,7 +195,15 @@ void Foam::vtkPV3Foam::convertPointField
// Note: using the name of the original volField
// not the name generated by the interpolation "volPointInterpolate(<name>)"
pointData->SetName(tf.name().c_str());
if (&tf != &GeometricField<Type, fvPatchField, volMesh>::null())
{
pointData->SetName(tf.name().c_str());
}
else
{
pointData->SetName(ptf.name().c_str());
}
if (debug)
{

View File

@ -360,7 +360,7 @@ int main(int argc, char *argv[])
if (m < 0)
{
WarningIn(args.executable() + "::main")
<< "Negative mass detected" << endl;
<< "Negative mass detected, the surface may be inside-out." << endl;
}
vector eVal = eigenValues(J);

View File

@ -1,11 +1,11 @@
#!/bin/sh
#------------------------------------------------------------------------------
#---------------------------------*- sh -*-------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation |
#-------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
@ -23,47 +23,38 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# foamPackGeneral [outputDir]
# foamBinDirs <packDir> <arch>
#
# Description
# Packs and compresses the OpenFOAM directory for release
# Returns all directories containing binary files of OpenFOAM
#
#------------------------------------------------------------------------------
timeStamp=$(date +%Y-%m-%d)
packDir=$WM_PROJECT-$WM_PROJECT_VERSION
packFile=${packDir}.General_${timeStamp}.gtgz
if [ ! -d $packDir ]
if [ $# -ne 2 ]
then
echo "Error: directory $packDir does not exist"
echo "Error: architecture type expected, exiting"
echo
echo "Usage : ${0##*/} <packDir> <arch>"
echo
exit 1
fi
packDir=$1
arch=$2
# add optional output directory
if [ -d "$1" ]
then
packFile="$1/$packFile"
fi
# base arch (w/o precision, optimization, etc)
baseArch=$(echo "$arch" | sed -e 's@[DS]P.*$@@')
if [ -f $packFile ]
then
echo "Error: $packFile already exists"
exit 1
fi
# Create time stamp file
# ~~~~~~~~~~~~~~~~~~~~~~
echo $timeStamp 2>/dev/null > $packDir/.timeStamp
# Pack and compress the packFile
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo
echo "Packing $packDir source files into $packFile"
echo
foamPackSource $packDir $packFile
# get list of directories
(
for dir in \
$packDir/lib/$arch \
$packDir/applications/bin/$arch \
$packDir/wmake/rules \
$packDir/wmake/bin/$baseArch \
;
do
[ -d $dir ] && echo $dir
done
)
#------------------------------------------------------------------------------

View File

@ -39,8 +39,6 @@
# @endverbatim
#
#-------------------------------------------------------------------------------
unset listOpt quietOpt
usage() {
[ "$quietOpt" = true ] && exit 1
@ -53,7 +51,10 @@ Usage: ${0##*/} [OPTION] fileName
options:
-list list the directories to be searched
-mode <mode> any combination of u(user), g(group), o(other)
-prefix <dir> specify an alternative installation prefix
-quiet suppress all normal output
-version <ver> specify an alternative OpenFOAM version
in the form Maj.Min.Rev (eg, 1.7.0)
-help print the usage
Locate user/group/shipped file with semantics similar to the
@ -71,9 +72,63 @@ USAGE
exit 1
}
#
# This script must exist in <foamInstall>/OpenFOAM-<VERSION>/bin/
# or <foamInstall>/openfoam<VERSION>/bin/ (for the debian version)
#
#-------------------------------------------------------------------------------
# the bindir:
binDir="${0%/*}"
# the project dir:
projectDir="${binDir%/bin}"
# the prefix dir (same as foamInstall):
prefixDir="${projectDir%/*}"
# the name used for the project directory
projectDirName="${projectDir##*/}"
# version number used for debian packaging
unset versionNum
#
# handle standard and debian naming convention
#
case "$projectDirName" in
OpenFOAM-*) # standard naming convention OpenFOAM-<VERSION>
version="${projectDirName##OpenFOAM-}"
;;
openfoam[0-9]*) # debian naming convention 'openfoam<VERSION>'
versionNum="${projectDirName##openfoam}"
case "$versionNum" in
??) # convert 2 digit version number to decimal delineated
version=$(echo "$versionNum" | sed -e 's@\(.\)\(.\)@\1.\2@')
;;
???) # convert 3 digit version number to decimal delineated
version=$(echo "$versionNum" | sed -e 's@\(.\)\(.\)\(.\)@\1.\2.\3@')
;;
????) # convert 4 digit version number to decimal delineated
version=$(echo "$versionNum" | sed -e 's@\(.\)\(.\)\(.\)\(.\)@\1.\2.\3.\4@')
;;
*) # failback - use current environment setting
version="$WM_PROJECT_VERSION"
;;
esac
;;
*)
echo "Error : unknown/unsupported naming convention"
exit 1
;;
esac
# default mode is 'ugo'
mode=ugo
unset listOpt quietOpt
# parse options
while [ "$#" -gt 0 ]
@ -84,7 +139,6 @@ do
;;
-l | -list)
listOpt=true
shift
;;
-m | -mode)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
@ -98,12 +152,30 @@ do
usage "'$1' option with invalid mode '$mode'"
;;
esac
shift 2
shift
;;
-p | -prefix)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
prefixDir="$2"
shift
;;
-q | -quiet)
quietOpt=true
;;
-v | -version)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
version="$2"
# convert x.y.z -> xyz version (if installation looked like debian)
if [ -n "$versionNum" ]
then
versionNum=$(echo "$version" | sed -e 's@\.@@g')
fi
shift
;;
--)
shift
break
;;
-*)
usage "unknown option: '$*'"
;;
@ -111,31 +183,49 @@ do
break
;;
esac
shift
done
# Save the essential bits of information:
# debugging:
# echo "Installed locations:"
# for i in projectDir prefixDir projectDirName version versionNum
# do
# eval echo "$i=\$$i"
# done
# Save the essential bits of information
# silently remove leading ~OpenFOAM/ (used in Foam::findEtcFile)
nArgs=$#
fileName="$1"
fileName="${1#~OpenFOAM/}"
# Define the various places to be searched:
unset dirList
case "$mode" in
*u*) # user
dirList="$dirList $HOME/.${WM_PROJECT:-OpenFOAM}/$WM_PROJECT_VERSION"
dirList="$dirList $HOME/.${WM_PROJECT:-OpenFOAM}/$version"
dirList="$dirList $HOME/.${WM_PROJECT:-OpenFOAM}"
;;
esac
case "$mode" in
*g*) # group
dirList="$dirList $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION"
dirList="$dirList $WM_PROJECT_INST_DIR/site"
dirList="$dirList $prefixDir/site/$version"
dirList="$dirList $prefixDir/site"
;;
esac
case "$mode" in
*o*) # other
dirList="$dirList $WM_PROJECT_DIR/etc"
*o*) # other (shipped)
if [ -n "$versionNum" ]
then
# debian packaging
dirList="$dirList $prefixDir/openfoam$versionNum/etc"
else
# standard packaging
dirList="$dirList $prefixDir/${WM_PROJECT:-OpenFOAM}-$version/etc"
fi
;;
esac
set -- $dirList

View File

@ -35,6 +35,8 @@
# mpirun -np <nProcs> \
# foamExec -v <foamVersion> <foamCommand> ... -parallel
#
# SeeAlso
# foamEtcFile
#------------------------------------------------------------------------------
usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
@ -43,8 +45,9 @@ usage() {
Usage: ${0##*/} [OPTION] <application> ...
options:
-v ver specify OpenFOAM version
-help this usage
-version <ver> specify an alternative OpenFOAM version
pass through to foamEtcFile
-help this usage
* run a particular OpenFOAM version of <application>
@ -52,18 +55,14 @@ USAGE
exit 1
}
#
# This script must exist in <foamInstall>/OpenFOAM-<VERSION>/bin/
# or <foamInstall>/openfoam<VERSION>/bin/ (for the debian version)
#
# foamEtcFile is found in the same directory
#-------------------------------------------------------------------------------
# This script should exist in <foamInstall>/OpenFOAM-<VERSION>/bin/
# extract the <foamInstall> and <version> elements
# using a function preserves the command args
getDefaults() {
set -- $(echo $0 | sed -e 's@/OpenFOAM-\([^/]*\)/bin/[^/]*$@ \1@')
foamInstall=$1
version=$2
}
getDefaults
unset etcOpts
# parse options
while [ "$#" -gt 0 ]
do
@ -71,9 +70,9 @@ do
-h | -help)
usage
;;
-v)
shift
version=$1
-v | -version)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
etcOpts="-version $2"
shift
;;
--)
@ -87,43 +86,22 @@ do
break
;;
esac
shift
done
if [ "$#" -lt 1 ]
then
usage "no application specified"
fi
[ "$#" -ge 1 ] || usage "no application specified"
unset foamDotFile
# Check user-specific OpenFOAM bashrc file
foamDotFile="$HOME/.OpenFOAM/$version/bashrc"
if [ -f $foamDotFile ]
then
. $foamDotFile
foamDotFile=okay
else
# Use the FOAM_INST_DIR variable for locating the installed version
for FOAM_INST_DIR in $foamInstall $WM_PROJECT_INST_DIR
do
foamDotFile="$FOAM_INST_DIR/OpenFOAM-$version/etc/bashrc"
if [ -f $foamDotFile ]
then
. $foamDotFile
foamDotFile=okay
break
fi
done
fi
if [ "$foamDotFile" != okay ]
then
# find OpenFOAM settings (bashrc)
foamDotFile="$(${0%/*}/foamEtcFile $etcOpts bashrc)" || {
echo "Error : bashrc file could not be found for OpenFOAM-$version" 1>&2
exit 1
fi
}
# Pass on the rest of the arguments
exec $*
# preserve arguments (can otherwise get lost when sourcing the foamDotFile)
args="$*"
. $foamDotFile
# execute
exec $args
#------------------------------------------------------------------------------

View File

@ -1,11 +1,11 @@
#!/bin/sh
#------------------------------------------------------------------------------
#---------------------------------*- sh -*-------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation |
#-------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
@ -29,7 +29,6 @@
# Packs and compresses the OpenFOAM directory for release
#
#------------------------------------------------------------------------------
tmpFile=${TMPDIR:-/tmp}/foamPackFiles.$$
timeStamp=$(date +%Y-%m-%d)
packDir=$WM_PROJECT-$WM_PROJECT_VERSION
@ -37,7 +36,7 @@ packFile=${packDir}_${timeStamp}.gtgz
if [ ! -d $packDir ]
then
echo "Error: directory $packDir does not exist" 1>&2
echo "Error: directory $packDir does not exist"
exit 1
fi
@ -49,7 +48,7 @@ fi
if [ -f $packFile ]
then
echo "Error: $packFile already exists" 1>&2
echo "Error: $packFile already exists"
exit 1
fi
@ -58,54 +57,13 @@ fi
echo $timeStamp 2>/dev/null > $packDir/.timeStamp
# Clean up on termination and on Ctrl-C
trap 'rm -f $tmpFile 2>/dev/null; exit 0' EXIT TERM INT
# Pack and compress the packFile using GNU tar
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Pack and compress the packFile
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo
echo "Packing foam version $packDir into $packFile"
echo "Packing $packDir source files into $packFile"
echo
echo "finding and packing"
find -H $packDir \
! -type d -type f \
! -name "*~" \
-a ! -name ".*~" \
-a ! -name "*.orig" \
-a ! -name "*.dep" \
-a ! -name "*.o" \
-a ! -name "*.so" \
-a ! -name "*.a" \
-a ! -name "core" \
-a ! -name "core.[1-9]*" \
-a ! -name "pvml.[1-9]*" \
-a ! -name "log[0-9]*" \
-a ! -name "so_locations" \
| sed \
-e "\@$packDir/lib/@d" \
-e '\@/\.git/@d' \
-e '\@applications/bin/@d' \
-e '\@wmake/bin/@d' \
-e '\@/t/@d' \
-e '\@Make[.A-Za-z]*/[^/]*/@d' \
-e '\@doc/[Dd]oxygen/html@d' \
-e '\@doc/[Dd]oxygen/latex@d' \
-e '\@doc/[Dd]oxygen/man@d' \
-e '\@/lnInclude@d' \
-e '\@/ii_files@d' \
| tee $tmpFile
tar czpf $packFile --files-from $tmpFile
if [ $? -eq 0 ]
then
echo "Finished packing and compressing $packDir into file $packFile"
else
echo "Error: failure packing $packDir into file $packFile" 1>&2
rm -f $packFile 2>/dev/null
fi
foamPackSource $packDir $packFile
#------------------------------------------------------------------------------

View File

@ -70,17 +70,7 @@ do
done
# get list of directories
dirList=$(
for dir in \
$packDir/lib/$arch \
$packDir/applications/bin/$arch \
$packDir/wmake/rules \
$packDir/wmake/bin/$baseArch \
;
do
[ -d $dir ] && echo $dir
done
)
dirList=`foamBinDirs $packDir $arch`
echo
echo "Packing $arch ($baseArch) port of $packDir into $packFile"

View File

@ -61,34 +61,7 @@ fi
# Clean up on termination and on Ctrl-C
trap 'rm -f $tmpFile 2>/dev/null; exit 0' EXIT TERM INT
find -H $packDir \
! -type d \
\( -type f -o -type l \) \
! -name "*~" \
-a ! -name ".*~" \
-a ! -name "*.orig" \
-a ! -name "*.dep" \
-a ! -name "*.o" \
-a ! -name "*.so" \
-a ! -name "*.a" \
-a ! -name "*.tgz" \
-a ! -name "core" \
-a ! -name "core.[1-9]*" \
-a ! -name "libccmio*" \
| sed \
-e "\@$packDir/lib/@d" \
-e '\@/\.git/@d' \
-e '\@/\.tags/@d' \
-e '\@/\README\.org@d' \
-e '\@applications/bin/@d' \
-e '\@wmake/bin/@d' \
-e '\@/t/@d' \
-e '\@/Make[.A-Za-z]*/[^/]*/@d'\
-e '\@/platforms/@d' \
-e '\@/download/@d' \
-e '\@/libccmio-.*/@d' \
-e '\@/debian/@d'
> $tmpFile
foamSourceFiles $packDir > $tmpFile
# provide some feedback

View File

@ -1,11 +1,11 @@
#!/bin/sh
#------------------------------------------------------------------------------
#---------------------------------*- sh -*-------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\/ M anipulation |
#-------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
@ -23,7 +23,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# foamPackThirdPartyGeneral [outputDir]
# foamPackThirdParty [outputDir]
#
# Description
# Packs and compresses the OpenFOAM ThirdParty directory for release
@ -33,7 +33,7 @@
timeStamp=$(date +%Y-%m-%d)
packDir=${WM_THIRD_PARTY_DIR:-ThirdParty}
packDir=${packDir##*/}
packFile=${packDir}.General_${timeStamp}.gtgz
packFile=${packDir}_${timeStamp}.gtgz
if [ ! -d $packDir ]
then

81
bin/foamSourceFiles Executable file
View File

@ -0,0 +1,81 @@
#!/bin/sh
#---------------------------------*- sh -*-------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2010 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
# foamSourceFiles <directory>
#
# Description
# Returns all the .C and .H files and Make/options
# and Make/files in a given directory.
#
#------------------------------------------------------------------------------
if [ $# -ne 1 ]
then
echo "Usage : ${0##*/} directory"
echo ""
echo "Returns all .C and .H files and Make/options and Make/files."
echo ""
exit 1
fi
# canonical form (no double and no trailing dashes)
packDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@')
if [ ! -d $packDir ]
then
echo "Error: directory $packDir does not exist"
exit 1
fi
find -H $packDir \
! -type d \
\( -type f -o -type l \) \
! -name "*~" \
-a ! -name ".*~" \
-a ! -name "*.orig" \
-a ! -name "*.dep" \
-a ! -name "*.o" \
-a ! -name "*.so" \
-a ! -name "*.a" \
-a ! -name "*.tgz" \
-a ! -name "core" \
-a ! -name "core.[1-9]*" \
-a ! -name "libccmio*" \
| sed \
-e "\@$packDir/lib/@d" \
-e '\@/\.git/@d' \
-e '\@/\.gitignore@d' \
-e '\@/\.tags/@d' \
-e '\@/\README\.org@d' \
-e '\@applications/bin/@d' \
-e '\@wmake/bin/@d' \
-e '\@/t/@d' \
-e '\@/Make[.A-Za-z]*/[^/]*/@d'\
-e '\@/platforms/@d' \
-e '\@/download/@d' \
-e '\@/libccmio-.*/@d' \
-e '\@/debian/@d'
#------------------------------------------------------------------------------

View File

@ -1,288 +0,0 @@
#! /bin/sh
#
# Giuseppe Ciaccio 15 November 2000
# This script is derived from the mpirun.args original script of MPICH .
#
hasprinthelp=1
progname=
cmdLineArgs=
machineFile=
machineFileArg=
fake_progname=
np=1
mpirun_verbose=0
just_testing=0
machineFileArg=
machineFile=
Show=eval
#
PrintHelp() {
#
# If you change this, make the corresponding changes in README so that
# the man pages are updated.
#
cat <<EOF
mpirun [mpirun_options...] <progname> [options...]
mpirun_options:
-h This help
-machinefile <machine-file name>
The file is a list of machines to be involved in the job run.
Local machine is always involved (and hosts instance #0).
Default machine file is /etc/gamma.conf
-np <np>
specify the number of process instances to be generated.
-t Testing - do not actually run, just print what would be
executed
-v Verbose - throw in some comments
Multiple architectures as well as multiple pathnames for the executables
cannot be handled yet.
EOF
}
while [ 1 -le $# ] ; do
arg=$1
#echo $arg
#echo $#
shift
case $arg in
-arch)
shift
;;
-np)
np="$1"
nodigits=`echo $np | sed 's/^[0-9]*$//'`
if [ "$nodigits" != "" -o $np -lt 1 ] ; then
echo np: $np is an invalid number of processors. Exiting.
exit 1
fi
shift
;;
-machine)
shift
;;
-machinefile)
machineFileArg="-machinefile"
machineFile="$1"
shift
;;
-device)
shift
;;
-stdin)
shift
;;
-stdout)
shift
;;
-stderr)
shift
;;
-nolocal)
;;
-h)
if [ "$hasprinthelp" = 1 ] ; then
PrintHelp
fi
exit 1
;;
-e)
;;
-pg)
;;
-leave_pg|-keep_pg)
;;
-batch)
;;
-jid)
shift
;;
-globusrsl)
shift
;;
-globusdb)
shift
;;
-globusargs)
shift
;;
-p4pg)
shift
;;
-p4wd)
shift
;;
-tcppg)
shift
;;
-p4ssport)
shift
;;
-paragontype)
shift
;;
-paragonname)
shift
;;
-paragonpn)
shift
;;
-v)
mpirun_verbose=1
;;
-t)
just_testing=1
Show=echo
;;
-tv|-totalview)
;;
-ksq)
;;
-dbx)
;;
-gdb)
;;
-xxgdb)
;;
-ddd)
;;
-pedb)
;;
-nopoll)
;;
-maxtime|-cpu)
shift
;;
-mem)
shift
;;
-mvhome)
;;
-mvback)
shift
;;
-cac)
shift
;;
-echo)
;;
-usage|-help|-\?)
# Accept these for help until the program name is provided.
if [ "$progname" = "" ] ; then
if [ "$hasprinthelp" = "1" ] ; then
PrintHelp
fi
exit 1
fi
;;
*)
# The first unrecognized argument is assumed to be the name of
# the program, but only if it is executable
proginstance=`echo $arg | sed "s/%a/$arch/g"`
if [ "$progname" = "" -a "$fake_progname" = "" -a \
! -x "$proginstance" ] ; then
fake_progname="$arg"
elif [ "$progname" = "" -a -x "$proginstance" ] ; then
progname="$arg"
# any following unrecognized arguments are assumed to be arguments
# to be passed to the program, as well as all future args
while [ 1 -le $# ] ; do
cmdLineArgs="$cmdLineArgs $1"
shift
done
else
echo "Warning: Command line arguments for program should be given"
echo "after the program name. Assuming that $arg is a"
echo "command line argument for the program."
cmdLineArgsExecer="$cmdLineArgsExecer -arg=$arg"
cmdLineArgs="$cmdLineArgs $arg"
fi
;;
esac
done
# We need at least the program name
if [ "$progname" = "" ] ; then
echo "Missing: program name"
if [ "$fake_progname" != "" ] ; then
echo "Program $fake_progname either does not exist, is not "
echo "executable, or is an erroneous argument to mpirun."
fi
exit 1
fi
#
# Fill out relative program pathnames
#
# Get the current directory
# Note that PWD may NOT be `pwd` if an explicit "cd", outside of the csh
# shell, is used. A downside of this is that PWD may have a more reasonable
# version of the path. To try and fix this, we create a test file and see
# if it is accessible from PWD and pwd; if so, we take the PWD value
#
# Why can't automounters work!???!!
#
# For those unfamiliar with the problem, the automounter creates
# paths like /tmp_mnt/.... . But if you try to open a file with that path,
# and the ACTUAL path has not been accessed before, the automounter fails
# to mount the partition. In otherwords, the automounter is so mind-bogglingly
# stupid as to not recognize its OWN MOUNTS. Network computing indeed.
#
# Note that PWD may ALSO be damaged, so we need to sed PWD as well...
#
# We should move this to the point in the code where it needs to know a
# particular filename, since this will fail if the directory is not
# writable by the user.
#
if [ -n "sed -e s@/tmp_mnt/@/@g" ] ; then
PWDtest=`pwd | sed -e s@/tmp_mnt/@/@g`
if [ ! -d $PWDtest ] ; then
PWDtest=`pwd`
fi
if [ -n "$PWD" ] ; then
# Use a process-specific filename
PWDtest2=`echo $PWD | sed -e s@/tmp_mnt/@/@g`
/bin/rm -f $PWDtest/.mpirtmp$$ $PWDtest2/.mpirtmp$$
if `eval "echo test > $PWDtest2/.mpirtmp$$" 2>/dev/null` ; then
if [ ! -s $PWDtest/.mpirtmp$$ ] ; then
/bin/rm -f $PWDtest2/.mpirtmp$$
PWD=$PWDtest
else
PWD=$PWDtest2
fi
else
# Current directory is not writable. Hope for the best
PWD=$PWDtest
fi
/bin/rm -f $PWDtest/.mpirtmp$$ $PWDtest2/.mpirtmp$$
else
PWD=$PWDtest
fi
else
PWD=`pwd`
fi
#
if [ -n "$PWD" ] ; then
PWD_TRIAL=$PWD
else
PWD_TRIAL=$PWDtest
fi
# The test for PWD_TRIAL usable is within the p4/execer/tcp test (since that
# is where it matters)
#
tail=`echo $progname | sed 's/\/.*//'`
if [ "$tail" = "" ] ; then
#echo Absolute path, don't need to change anything
true
else
#echo Relative path
progname="$PWD_TRIAL/$progname"
fi
if [ $mpirun_verbose = 1 ] ; then
echo "running $progname on $np $arch $machine processors"
fi
$Show $progname $cmdLineArgs $machineFileArg $machineFile -GAMMANP $np

107
bin/tools/foamConfigurePaths Executable file
View File

@ -0,0 +1,107 @@
#!/bin/sh
#---------------------------------*- sh -*-------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2010 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
# foamConfigurePaths
#
# Description
# hardcode installation directory
#
#------------------------------------------------------------------------------
usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/}
--foamInstall dir specify installation directory (e.g. /opt)
--projectName name specify project name (e.g. openfoam170)
--archOption arch specify architecture option (only 32 or 64 applicable)
--paraviewInstall dir specify ParaView_DIR (e.g. /opt/paraviewopenfoam380)
* hardcode paths to installation
USAGE
exit 1
}
[ -f etc/bashrc -a -f etc/settings.sh ] || usage "Please run from top-level directory of installation"
unset foamInstall projectName archOption paraviewInstall
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | --help)
usage
;;
--foamInstall)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
foamInstall="$2"
echo "Replacing foamInstall setting by $foamInstall"
sed -i -e '/^[^#]/s@foamInstall=.*@foamInstall='"$foamInstall@" etc/bashrc
shift 2
;;
--projectName)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
projectName="$2"
echo "Replacing WM_PROJECT_DIR setting by $projectName"
sed -i -e '/^[^#]/s@WM_PROJECT_DIR=.*@WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/'"$projectName@" etc/bashrc
shift 2
;;
--archOption)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
archOption="$2"
echo "Replacing WM_ARCH_OPTION setting by $archOption"
sed -i -e '/^[^#]/s@: ${WM_ARCH_OPTION:=64}@WM_ARCH_OPTION='"$archOption@" etc/bashrc
shift 2
;;
--paraviewInstall)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
paraviewInstall="$2"
echo "Replacing ParaView_DIR setting by $paraviewInstall"
sed -i -e '/^[^#]/s@ParaView_DIR=.*@ParaView_DIR='"$paraviewInstall@" etc/apps/paraview3/bashrc
shift 2
;;
*)
usage "unknown option/argument: '$*'"
;;
esac
done
[ -n "$foamInstall" -o -n "$projectName" -o -n "$archOption" -o -n "$paraviewInstall" ] || usage "Please specify at least one configure option"
#echo "Replacing WM_PROJECT setting by $projectName"
#sed -i -e 's@WM_PROJECT=.*@WM_PROJECT='"$projectName@" etc/bashrc
# Replace the WM_MPLIB always
echo "Replacing WM_MPLIB setting by SYSTEMOPENMPI"
sed -i -e '/^[^#]/s@: ${WM_MPLIB:=.*}@WM_MPLIB=SYSTEMOPENMPI@' etc/bashrc
# Replace the compilerInstall always
echo "Replacing compilerInstall setting by system"
sed -i -e '/^[^#]/s@: ${compilerInstall:=.*}@compilerInstall=system@' etc/settings.sh
#------------------------------------------------------------------------------

223
bin/tools/pre-commit-hook Executable file
View File

@ -0,0 +1,223 @@
#!/bin/bash
#---------------------------------*- sh -*-------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2010-2010 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
# pre-commit-hook
#
# Description
# pre-commit hook for git.
# Copy or link this file as ".git/hooks/pre-commit"
#
# Eg,
# (
# cd $WM_PROJECT_DIR/.git/hooks &&
# ln -sf ../../bin/tools/pre-commit-hook pre-commit
# )
#
# Hook receives: empty
#
# Checks for
# - illegal code, e.g. <TAB>
# - copyright is current, e.g. if present, contains XXX-<current-year>
# - columns greater than 80 for *.[CH] files
#
# Note
# Using "git commit --no-verify" it is possible to override the hook.
#
#------------------------------------------------------------------------------
die()
{
echo 'pre-commit hook failure' 1>&2
echo '-----------------------' 1>&2
echo '' 1>&2
echo "$@" 1>&2
exit 1
}
#-----------------------------------------------------------------------------
# Check content that will be added by this commit.
if git rev-parse --verify -q HEAD > /dev/null
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
# list of all files
fileList=$(git diff-index --name-only $against --)
unset badFiles
# join list of files with this amount of space
Indent=" "
#
# report bad files and die if there are any
#
dieOnBadFiles()
{
if [ -n "$badFiles" ]
then
echo 'pre-commit hook failure' 1>&2
echo '-----------------------' 1>&2
echo "$@" 1>&2
echo '' 1>&2
echo "File(s):" 1>&2
echo "$badFiles" 1>&2
echo '' 1>&2
exit 1
fi
}
#
# check for bad strings, characters, etc
#
checkIllegalCode()
{
reBad="(N""abla|"$'\t'"|"$'\r\n'")"
msgBad="N""abla, <TAB>, or DOS-style line ending"
badFiles=$(
for f in $fileList
do
# parse line numbers from this:
# path/fileName:<lineNr>: contents
lines=$(git grep --cached -n -E -e "$reBad" -- "$f" |
sed -e 's@^[^:]*:\([0-9]*\):.*@\1@' |
tr '\n' ' '
)
[ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
done
)
dieOnBadFiles "Remove/correct bad '$msgBad' references"
}
#
# check that OpenCFD copyright is current
#
checkCopyright()
{
year=$(date +%Y)
badFiles=$(
for f in $fileList
do
# parse line numbers from this:
# path/fileName:<lineNr>: contents
# for Copyright lines without the current year
lines=$(git grep --cached -n -e Copyright -- "$f" |
sed -n \
-e '/OpenCFD/{ ' \
-e "/$year/b" \
-e 's@^[^:]*:\([0-9]*\):.*@\1@p }' |
tr '\n' ' '
)
[ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
done
)
dieOnBadFiles "Update copyright year, e.g. XXXX-$year"
}
#
# limit line length to 80-columns
#
checkLineLength()
{
badFiles=$(
for f in $fileList
do
# limit to *.[CH] files
case "$f" in
(*.[CH])
# parse line numbers from this:
# path/fileName:<lineNr>: contents
lines=$(git grep --cached -n -e ".\{81,\}" -- "$f" |
sed -e 's@^[^:]*:\([0-9]*\):.*@\1@' |
tr '\n' ' '
)
[ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
;;
esac
done
)
dieOnBadFiles "Limit code to 80 columns before pushing"
}
#
# limit line length to 80-columns, except C++ comment lines
#
checkLineLengthNonComments()
{
badFiles=$(
for f in $fileList
do
# limit to *.[CH] files
case "$f" in
(*.[CH])
# parse line numbers from this (strip comment lines):
# path/fileName:<lineNr>: contents
lines=$(git grep --cached -n -e ".\{81,\}" -- "$f" |
sed -n \
-e '\@^[^:]*:[^:]*: *//.*@b' \
-e 's@^[^:]*:\([0-9]*\):.*@\1@p' |
tr '\n' ' '
)
[ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
;;
esac
done
)
dieOnBadFiles "Limit code to 80 columns before pushing"
}
# do all checks
# ~~~~~~~~~~~~~
# builtin whitespace check to avoid trailing space, including CR-LF endings
bad=$(git diff-index --cached --check $against --) || die "$bad"
# check for illegal code, e.g. <TAB>, etc
checkIllegalCode
# ensure OpenCFD copyright contains correct year
checkCopyright
# ensure code conforms to 80 columns max
checkLineLength
exit 0
#------------------------------------------------------------------------------

5
debian/changelog vendored Normal file
View File

@ -0,0 +1,5 @@
openfoamdev (0-1) unstable; urgency=low
* Initial release
-- OpenCFD Ltd. <patches@opencfd.co.uk> Mon, 14 Jun 2010 16:50:46 +0100

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
7

19
debian/control vendored Normal file
View File

@ -0,0 +1,19 @@
Source: openfoamdev
Section: optional
Priority: optional
Maintainer: OpenCFD Ltd. <patches@opencfd.co.uk>
Build-Depends: debhelper (>= 7), quilt
Standards-Version: 3.8.4
Homepage: http://www.openfoam.com
Package: openfoamdev
Architecture: any
Depends: csh,g++,${shlibs:Depends}, ${misc:Depends},binutils-dev,flex,libscotch-dev,libopenmpi-dev,libxt-dev,openmpi-bin
Description: OpenFOAM
OpenFOAM is a free, open source CFD software package produced by a
commercial company, OpenCFD Ltd. It has a large user base across
most areas of engineering and science, from both commercial and academic
organisations. OpenFOAM has an extensive range of features to solve
anything from complex fluid flows involving chemical reactions, turbulence
and heat transfer, to solid dynamics and electromagnetics.

30
debian/copyright vendored Normal file
View File

@ -0,0 +1,30 @@
This work was packaged for Debian by:
OpenCFD Ltd. <patches@opencfd.co.uk> on Mon, 14 Jun 2010 16:50:46 +0100
Copyright:
Copyright (C) 1991-2010 OpenCFD Ltd.
License:
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
The Debian packaging is:
Copyright (C) 2010 OpenCFD Ltd. <patches@opencfd.co.uk>
and is licensed under the GPL version 3

0
debian/docs vendored Normal file
View File

48
debian/postinst vendored Executable file
View File

@ -0,0 +1,48 @@
#!/bin/sh
# postinst script for OpenFOAM
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
configure)
#echo "** postinst called with $*"
echo ""
echo "** To use OpenFOAM please add"
echo "**"
echo "** . /opt/openfoamdev/etc/bashrc"
echo "**"
echo "** To your ~/.bashrc"
echo ""
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

109
debian/rules vendored Executable file
View File

@ -0,0 +1,109 @@
#!/usr/bin/make -f
#-*- makefile -*-
# After debian/rules from less package
include /usr/share/quilt/quilt.make
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
# This is the debhelper compatibility version to use.
#DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
#DEB_HOST_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
#ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
#CONFARGS= --host=$(DEB_HOST_GNU_TYPE)
#endif
#
#CFLAGS = -Wall -g #-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
#
#ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
#CFLAGS += -O0
#else
#CFLAGS += -O2
#endif
DEB_BUILD_ARCH_BITS = $(shell dpkg-architecture -qDEB_BUILD_ARCH_BITS)
foamArch=
ifeq ($(DEB_BUILD_ARCH_BITS),64)
foamArch=linux64GccDPOpt
else
foamArch=linuxGccDPOpt
endif
packageName = $(shell dh_listpackages)
installDir = debian/$(packageName)/opt/$(packageName)
paraviewInstallDir = /opt/paraviewopenfoam380
DEB_DH_SHLIBDEPS_ARGS=-L$(installDir)/lib/$(foamArch)
build: patch build-stamp
build-stamp:
dh_testdir
# Add here commands to compile the package.
#./Allwmake
touch build-stamp
clean: unpatch
dh_testdir
dh_testroot
rm -f build-stamp
# Add here commands to clean up after the build process.
#./Allwclean
#set
dh_clean
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
# Install source files into debian/.
install -d $(installDir)
tar cf - `bin/foamSourceFiles .` | (cd $(installDir); tar xfp -)
(cd $(installDir); bin/tools/foamConfigurePaths --foamInstall /opt --projectName $(packageName) --paraviewInstall $(paraviewInstallDir) )
# Install binary files into debian/.
tar cf - `bin/foamBinDirs . $(foamArch)` | (cd $(installDir); tar xfp -)
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_installdebconf
dh_installdocs
dh_installexamples
dh_installmenu
# dh_installemacsen
# dh_installinit
dh_installmime
dh_installcron
#dh_installman debian/lesspipe.1
#dh_undocumented
dh_installchangelogs
#dh_link
#dh_strip
dh_compress
dh_fixperms
dh_makeshlibs
dh_installdeb
# dh_perl
dh_shlibdeps -- --ignore-missing-info #We depend on vtk libs without info
dh_gencontrol
dh_md5sums
dh_builddeb
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary

View File

@ -51,7 +51,7 @@ done
# set VERSION and MAJOR (version) variables if not already set
[ -n "$ParaView_VERSION" ] || ParaView_VERSION=3.6.1
[ -n "$ParaView_VERSION" ] || ParaView_VERSION=3.8.0
[ -n "$ParaView_MAJOR" ] || ParaView_MAJOR=unknown
# if needed, set MAJOR version to correspond to VERSION
@ -75,6 +75,7 @@ export ParaView_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-
if [ -r $ParaView_DIR -o -r $paraviewInstDir ]
then
export PATH=$ParaView_DIR/bin:$PATH
export LD_LIBRARY_PATH=$ParaView_DIR/lib/paraview-$ParaView_MAJOR:$LD_LIBRARY_PATH
export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-$ParaView_MAJOR
# add in python libraries if required

View File

@ -49,7 +49,7 @@ foreach cmake ( cmake-2.8.1 cmake-2.8.0 cmake-2.6.4 )
end
# set VERSION and MAJOR (version) variables if not already set
if ( ! $?ParaView_VERSION ) setenv ParaView_VERSION 3.6.1
if ( ! $?ParaView_VERSION ) setenv ParaView_VERSION 3.8.0
if ( ! $?ParaView_MAJOR ) setenv ParaView_MAJOR unknown
# if needed, set MAJOR version to correspond to VERSION
@ -73,6 +73,7 @@ setenv ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-
# set paths if binaries or source are present
if ( -r $ParaView_DIR || -r $paraviewInstDir ) then
setenv PATH ${ParaView_DIR}/bin:${PATH}
setenv LD_LIBRARY_PATH "${ParaView_DIR}/lib/paraview-${ParaView_MAJOR}:${LD_LIBRARY_PATH}"
setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-${ParaView_MAJOR}
# add in python libraries if required

View File

@ -32,7 +32,7 @@
#------------------------------------------------------------------------------
export WM_PROJECT=OpenFOAM
[ -z "$WM_PROJECT_VERSION" ] && export WM_PROJECT_VERSION=1.6
[ -z "$WM_PROJECT_VERSION" ] && export WM_PROJECT_VERSION=dev
################################################################################
# USER EDITABLE PART. Note changes made here may be lost with the next upgrade
@ -131,7 +131,7 @@ unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH
# WM_COMPILE_OPTION = Opt | Debug | Prof
: ${WM_COMPILE_OPTION:=Opt}; export WM_COMPILE_OPTION
# WM_MPLIB = | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI
# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI
: ${WM_MPLIB:=OPENMPI}; export WM_MPLIB

View File

@ -31,7 +31,7 @@
#------------------------------------------------------------------------------
setenv WM_PROJECT OpenFOAM
if ( ! $?WM_PROJECT_VERSION ) setenv WM_PROJECT_VERSION 1.6
if ( ! $?WM_PROJECT_VERSION ) setenv WM_PROJECT_VERSION dev
################################################################################
# USER EDITABLE PART. Note changes made here may be lost with the next upgrade
@ -119,7 +119,7 @@ if ( ! $?WM_PRECISION_OPTION ) setenv WM_PRECISION_OPTION DP
# WM_COMPILE_OPTION = Opt | Debug | Prof
if ( ! $?WM_COMPILE_OPTION ) setenv WM_COMPILE_OPTION Opt
# WM_MPLIB = | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI
# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI
if ( ! $?WM_MPLIB ) setenv WM_MPLIB OPENMPI

View File

@ -82,7 +82,7 @@ unsetenv MPFR_ARCH_PATH
# Select compiler installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# compilerInstall = OpenFOAM | system
if ( ! $?compilerInstall ) set compilerInstall=OpenFOAM
if ( ! $?compilerInstall ) set compilerInstall=system
switch ("$compilerInstall")
case OpenFOAM:
@ -209,14 +209,20 @@ case OPENMPI:
breaksw
case SYSTEMOPENMPI:
# use the system installed openmpi, get library directory via mpicc
# This uses the installed openmpi. It needs mpicc installed!
set mpi_version=openmpi-system
set libDir=`mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'`
# Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI
setenv PINC "`mpicc --showme:compile`"
setenv PLIBS "`mpicc --showme:link`"
set libDir=`echo "$PLIBS" | sed -e 's/.*-L\([^ ]*\).*/\1/'`
if ($?FOAM_VERBOSE && $?prompt) then
echo "Using system installed OpenMPI:"
echo " compile flags : `mpicc --showme:compile`"
echo " link flags : `mpicc --showme:link`"
echo "Using system installed MPI:"
echo " compile flags : $PINC"
echo " link flags : $PLIBS"
echo " libmpi dir : $libDir"
endif

View File

@ -105,7 +105,7 @@ unset MPFR_ARCH_PATH
# Select compiler installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# compilerInstall = OpenFOAM | system
: ${compilerInstall:=OpenFOAM}
: ${compilerInstall:=system}
case "${compilerInstall:-OpenFOAM}" in
OpenFOAM)
@ -237,13 +237,17 @@ OPENMPI)
SYSTEMOPENMPI)
# use the system installed openmpi, get library directory via mpicc
mpi_version=openmpi-system
libDir=`mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'`
# Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI
export PINC="`mpicc --showme:compile`"
export PLIBS="`mpicc --showme:link`"
libDir=`echo "$PLIBS" | sed -e 's/.*-L\([^ ]*\).*/\1/'`
if [ "$FOAM_VERBOSE" -a "$PS1" ]
then
echo "Using system installed OpenMPI:"
echo " compile flags : `mpicc --showme:compile`"
echo " link flags : `mpicc --showme:link`"
echo "Using system installed MPI:"
echo " compile flags : $PINC"
echo " link flags : $PLIBS"
echo " libmpi dir : $libDir"
fi

View File

@ -257,24 +257,21 @@ void Foam::fileMonitor::checkFiles() const
// << "watchFd:" << inotifyEvent.wd << nl
// << "watchName:" << watchFile_[inotifyEvent.wd] << endl;
switch (inotifyEvent.mask)
if (inotifyEvent.mask % IN_DELETE_SELF)
{
case IN_DELETE_SELF:
{
Map<fileState>::iterator iter =
state_.find(label(inotifyEvent.wd));
iter() = DELETED;
}
break;
case IN_MODIFY:
case IN_CLOSE_WRITE:
{
Map<fileState>::iterator iter =
state_.find(label(inotifyEvent.wd));
iter() = MODIFIED;
}
break;
Map<fileState>::iterator iter =
state_.find(label(inotifyEvent.wd));
iter() = DELETED;
}
else if
(
(inotifyEvent.mask % IN_MODIFY)
|| (inotifyEvent.mask % IN_CLOSE_WRITE)
)
{
Map<fileState>::iterator iter =
state_.find(label(inotifyEvent.wd));
iter() = MODIFIED;
}
}
else

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,6 +25,12 @@ License
#include "ListOps.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::labelList Foam::emptyLabelList = Foam::labelList(0);
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
Foam::labelList Foam::invert

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,6 +43,16 @@ SourceFiles
namespace Foam
{
extern const labelList emptyLabelList;
//- Return reference to zero-sized list. Compare to List::null() which returns
// null pointer cast as list reference.
template<class Type>
static const List<Type>& emptyList()
{
return *reinterpret_cast<const List<Type>* >(&emptyLabelList);
}
//- Renumber the values (not the indices) of a list.
// Negative ListType elements are left as is.
template<class ListType>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -42,59 +42,62 @@ namespace Foam
void Foam::wedgePolyPatch::initTransforms()
{
const pointField& points = this->points();
patchNormal_ = operator[](0).normal(points);
patchNormal_ /= mag(patchNormal_);
centreNormal_ =
vector
(
sign(patchNormal_.x())*(max(mag(patchNormal_.x()), 0.5) - 0.5),
sign(patchNormal_.y())*(max(mag(patchNormal_.y()), 0.5) - 0.5),
sign(patchNormal_.z())*(max(mag(patchNormal_.z()), 0.5) - 0.5)
);
centreNormal_ /= mag(centreNormal_);
if
(
mag(centreNormal_.x() + centreNormal_.y() + centreNormal_.z())
< (1 - SMALL)
)
if (size() > 0)
{
FatalErrorIn
const pointField& points = this->points();
patchNormal_ = operator[](0).normal(points);
patchNormal_ /= mag(patchNormal_);
centreNormal_ =
vector
(
sign(patchNormal_.x())*(max(mag(patchNormal_.x()), 0.5) - 0.5),
sign(patchNormal_.y())*(max(mag(patchNormal_.y()), 0.5) - 0.5),
sign(patchNormal_.z())*(max(mag(patchNormal_.z()), 0.5) - 0.5)
);
centreNormal_ /= mag(centreNormal_);
if
(
"wedgePolyPatch::wedgePolyPatch(const polyPatch&, "
"const fvBoundaryMesh&)"
) << "wedge " << name()
<< " centre plane does not align with a coordinate plane by "
<< 1
- mag(centreNormal_.x() + centreNormal_.y() + centreNormal_.z())
<< exit(FatalError);
mag(centreNormal_.x() + centreNormal_.y() + centreNormal_.z())
< (1 - SMALL)
)
{
FatalErrorIn
(
"wedgePolyPatch::wedgePolyPatch(const polyPatch&, "
"const fvBoundaryMesh&)"
) << "wedge " << name()
<< " centre plane does not align with a coordinate plane by "
<< 1
- mag(centreNormal_.x()+centreNormal_.y()+centreNormal_.z())
<< exit(FatalError);
}
axis_ = centreNormal_ ^ patchNormal_;
scalar magAxis = mag(axis_);
axis_ /= magAxis;
if (magAxis < SMALL)
{
FatalErrorIn
(
"wedgePolyPatch::initTransforms()"
) << "wedge " << name()
<< " plane aligns with a coordinate plane." << nl
<< " The wedge plane should make a small angle (~2.5deg)"
" with the coordinate plane" << nl
<< " and the the pair of wedge planes should be symmetric"
<< " about the coordinate plane." << nl
<< " Normal of face " << 0 << " is " << patchNormal_
<< " , implied coordinate plane direction is " << centreNormal_
<< exit(FatalError);
}
faceT_ = rotationTensor(centreNormal_, patchNormal_);
cellT_ = faceT_ & faceT_;
}
axis_ = centreNormal_ ^ patchNormal_;
scalar magAxis = mag(axis_);
axis_ /= magAxis;
if (magAxis < SMALL)
{
FatalErrorIn
(
"wedgePolyPatch::initTransforms()"
) << "wedge " << name()
<< " plane aligns with a coordinate plane." << nl
<< " The wedge plane should make a small angle (~2.5deg)"
" with the coordinate plane" << nl
<< " and the the pair of wedge planes should be symmetric"
<< " about the coordinate plane." << nl
<< " Normal of face " << 0 << " is " << patchNormal_
<< " , implied coordinate plane direction is " << centreNormal_
<< exit(FatalError);
}
faceT_ = rotationTensor(centreNormal_, patchNormal_);
cellT_ = faceT_ & faceT_;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -440,6 +440,19 @@ Foam::point Foam::plane::planePlaneIntersect
}
void Foam::plane::writeDict(Ostream& os) const
{
os.writeKeyword("planeType") << "pointAndNormal"
<< token::END_STATEMENT << nl;
os << indent << "pointAndNormalDict" << nl
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
os.writeKeyword("basePoint") << basePoint_ << token::END_STATEMENT << nl;
os.writeKeyword("normalVector") << unitVector_ << token::END_STATEMENT
<< nl;
os << decrIndent << indent << token::END_BLOCK << endl;
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
bool Foam::operator==(const plane& a, const plane& b)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -182,6 +182,9 @@ public:
//- Return the cutting point between this plane and two other planes
point planePlaneIntersect(const plane&, const plane&) const;
//- Write to dictionary
void writeDict(Ostream&) const;
// friend Operators

46
src/dummyThirdParty/metisDecomp/metis.h vendored Normal file
View File

@ -0,0 +1,46 @@
#ifndef METIS_H
#define METIS_H 1
/* *** DUMMY VERSION of metis.h - this file should not be included if you have metis
* installed in the correct position in $WM_THIRD_PARTY_DIR - see
* decompositionMethods/metisDecomp/Make/options
*/
#warning "Dummy metis.h - gets included since it cannot find metis installation."
#define IDXTYPEWIDTH 32
/*------------------------------------------------------------------------
* Undefine the following #define in order to use short idxtype as the idxtype
*-------------------------------------------------------------------------*/
#if IDXTYPEWIDTH == 32
#define SCNIDX SCNd32
#define PRIIDX PRId32
typedef int32_t idxtype;
#elif IDXTYPEWIDTH == 64
#define SCNIDX SCNd64
#define PRIIDX PRId64
typedef int64_t idxtype;
#else
#error "Incorrect user-supplied value fo IDXTYPEWIDTH"
#endif
void METIS_WPartGraphRecursive(idxtype *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt,
idxtype *adjwgt, idxtype *wgtflag, idxtype *numflag, idxtype *nparts, float *tpwgts,
idxtype *options, idxtype *edgecut, idxtype *part);
void METIS_PartGraphRecursive(idxtype *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt,
idxtype *adjwgt, idxtype *wgtflag, idxtype *numflag, idxtype *nparts, idxtype *options,
idxtype *edgecut, idxtype *part);
void METIS_WPartGraphKway(idxtype *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt,
idxtype *adjwgt, idxtype *wgtflag, idxtype *numflag, idxtype *nparts, float *tpwgts,
idxtype *options, idxtype *edgecut, idxtype *part);
void METIS_PartGraphKway(idxtype *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt,
idxtype *adjwgt, idxtype *wgtflag, idxtype *numflag, idxtype *nparts, idxtype *options,
idxtype *edgecut, idxtype *part);
#endif

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,6 +27,7 @@ License
#include "fvMesh.H"
#include "fvMatrices.H"
#include "geometricOneField.H"
#include "stringListOps.H"
// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
@ -62,15 +63,15 @@ void Foam::porousZone::adjustNegativeResistance(dimensionedVector& resist)
Foam::porousZone::porousZone
(
const word& name,
const keyType& key,
const fvMesh& mesh,
const dictionary& dict
)
:
name_(name),
key_(key),
mesh_(mesh),
dict_(dict),
cellZoneID_(mesh_.cellZones().findZoneID(name)),
cellZoneIds_(0),
coordSys_(dict, mesh),
porosity_(1),
intensity_(0),
@ -80,9 +81,27 @@ Foam::porousZone::porousZone
D_("D", dimensionSet(0, -2, 0, 0, 0), tensor::zero),
F_("F", dimensionSet(0, -1, 0, 0, 0), tensor::zero)
{
Info<< "Creating porous zone: " << name_ << endl;
Info<< "Creating porous zone: " << key_ << endl;
bool foundZone = (cellZoneID_ != -1);
if (key_.isPattern())
{
cellZoneIds_ = findStrings
(
key_,
mesh_.cellZones().names()
);
}
else
{
const label zoneId = mesh_.cellZones().findZoneID(key_);
if (zoneId != -1)
{
cellZoneIds_.setSize(1);
cellZoneIds_[0] = zoneId;
}
}
bool foundZone = !cellZoneIds_.empty();
reduce(foundZone, orOp<bool>());
if (!foundZone && Pstream::master())
@ -90,8 +109,8 @@ Foam::porousZone::porousZone
FatalErrorIn
(
"Foam::porousZone::porousZone"
"(const fvMesh&, const word&, const dictionary&)"
) << "cannot find porous cellZone " << name_
"(const keyType&, const fvMesh&, const dictionary&)"
) << "cannot find porous cellZone " << key_
<< exit(FatalError);
}
@ -106,7 +125,7 @@ Foam::porousZone::porousZone
FatalIOErrorIn
(
"Foam::porousZone::porousZone"
"(const fvMesh&, const word&, const dictionary&)",
"(const keyType&, const fvMesh&, const dictionary&)",
dict_
)
<< "out-of-range porosity value " << porosity_
@ -123,7 +142,7 @@ Foam::porousZone::porousZone
FatalIOErrorIn
(
"Foam::porousZone::porousZone"
"(const fvMesh&, const word&, const dictionary&)",
"(const keyType&, const fvMesh&, const dictionary&)",
dict_
)
<< "out-of-range turbulent intensity value " << intensity_
@ -140,7 +159,7 @@ Foam::porousZone::porousZone
FatalIOErrorIn
(
"Foam::porousZone::porousZone"
"(const fvMesh&, const word&, const dictionary&)",
"(const keyType&, const fvMesh&, const dictionary&)",
dict_
)
<< "out-of-range turbulent length scale " << mixingLength_
@ -169,7 +188,7 @@ Foam::porousZone::porousZone
FatalIOErrorIn
(
"Foam::porousZone::porousZone"
"(const fvMesh&, const word&, const dictionary&)",
"(const keyType&, const fvMesh&, const dictionary&)",
dict_
) << "incorrect dimensions for d: " << d.dimensions()
<< " should be " << D_.dimensions()
@ -192,7 +211,7 @@ Foam::porousZone::porousZone
FatalIOErrorIn
(
"Foam::porousZone::porousZone"
"(const fvMesh&, const word&, const dictionary&)",
"(const keyType&, const fvMesh&, const dictionary&)",
dict_
) << "incorrect dimensions for f: " << f.dimensions()
<< " should be " << F_.dimensions()
@ -220,7 +239,7 @@ Foam::porousZone::porousZone
FatalIOErrorIn
(
"Foam::porousZone::porousZone"
"(const fvMesh&, const word&, const dictionary&)",
"(const keyType&, const fvMesh&, const dictionary&)",
dict_
) << "neither powerLaw (C0/C1) "
"nor Darcy-Forchheimer law (d/f) specified"
@ -239,7 +258,7 @@ Foam::porousZone::porousZone
void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
{
if (cellZoneID_ == -1)
if (cellZoneIds_.empty())
{
return;
}
@ -250,7 +269,6 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
compressible = true;
}
const labelList& cells = mesh_.cellZones()[cellZoneID_];
const scalarField& V = mesh_.V();
scalarField& Udiag = UEqn.diag();
vectorField& Usource = UEqn.source();
@ -263,7 +281,6 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
addPowerLawResistance
(
Udiag,
cells,
V,
mesh_.lookupObject<volScalarField>("rho"),
U
@ -274,7 +291,6 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
addPowerLawResistance
(
Udiag,
cells,
V,
geometricOneField(),
U
@ -293,7 +309,6 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
(
Udiag,
Usource,
cells,
V,
mesh_.lookupObject<volScalarField>("rho"),
mesh_.lookupObject<volScalarField>("mu"),
@ -306,7 +321,6 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
(
Udiag,
Usource,
cells,
V,
geometricOneField(),
mesh_.lookupObject<volScalarField>("nu"),
@ -324,7 +338,7 @@ void Foam::porousZone::addResistance
bool correctAUprocBC
) const
{
if (cellZoneID_ == -1)
if (cellZoneIds_.empty())
{
return;
}
@ -335,7 +349,6 @@ void Foam::porousZone::addResistance
compressible = true;
}
const labelList& cells = mesh_.cellZones()[cellZoneID_];
const vectorField& U = UEqn.psi();
if (C0_ > VSMALL)
@ -345,7 +358,6 @@ void Foam::porousZone::addResistance
addPowerLawResistance
(
AU,
cells,
mesh_.lookupObject<volScalarField>("rho"),
U
);
@ -355,7 +367,6 @@ void Foam::porousZone::addResistance
addPowerLawResistance
(
AU,
cells,
geometricOneField(),
U
);
@ -372,7 +383,6 @@ void Foam::porousZone::addResistance
addViscousInertialResistance
(
AU,
cells,
mesh_.lookupObject<volScalarField>("rho"),
mesh_.lookupObject<volScalarField>("mu"),
U
@ -383,7 +393,6 @@ void Foam::porousZone::addResistance
addViscousInertialResistance
(
AU,
cells,
geometricOneField(),
mesh_.lookupObject<volScalarField>("nu"),
U

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -110,8 +110,8 @@ class porousZone
{
// Private data
//- Name of this zone
word name_;
//- Name of this zone, or a regular expression
keyType key_;
//- Reference to the finite volume mesh this zone is part of
const fvMesh& mesh_;
@ -119,8 +119,8 @@ class porousZone
//- Dictionary containing the parameters
dictionary dict_;
//- Cell zone ID
label cellZoneID_;
//- Cell zone Ids
labelList cellZoneIds_;
//- Coordinate system used for the zone (Cartesian)
coordinateSystem coordSys_;
@ -159,7 +159,6 @@ class porousZone
void addPowerLawResistance
(
scalarField& Udiag,
const labelList& cells,
const scalarField& V,
const RhoFieldType& rho,
const vectorField& U
@ -171,7 +170,6 @@ class porousZone
(
scalarField& Udiag,
vectorField& Usource,
const labelList& cells,
const scalarField& V,
const RhoFieldType& rho,
const scalarField& mu,
@ -184,7 +182,6 @@ class porousZone
void addPowerLawResistance
(
tensorField& AU,
const labelList& cells,
const RhoFieldType& rho,
const vectorField& U
) const;
@ -194,7 +191,6 @@ class porousZone
void addViscousInertialResistance
(
tensorField& AU,
const labelList& cells,
const RhoFieldType& rho,
const scalarField& mu,
const vectorField& U
@ -213,7 +209,7 @@ public:
// Constructors
//- Construct from components
porousZone(const word& name, const fvMesh&, const dictionary&);
porousZone(const keyType& key, const fvMesh&, const dictionary&);
//- Return clone
autoPtr<porousZone> clone() const
@ -237,10 +233,10 @@ public:
autoPtr<porousZone> operator()(Istream& is) const
{
word name(is);
keyType key(is);
dictionary dict(is);
return autoPtr<porousZone>(new porousZone(name, mesh_, dict));
return autoPtr<porousZone>(new porousZone(key, mesh_, dict));
}
};
@ -255,9 +251,9 @@ public:
// Access
//- cellZone name
const word& zoneName() const
const keyType& zoneName() const
{
return name_;
return key_;
}
//- Return mesh
@ -266,10 +262,10 @@ public:
return mesh_;
}
//- cellZone number
label zoneId() const
//- cellZone numbers
const labelList& zoneIds() const
{
return cellZoneID_;
return cellZoneIds_;
}
//- dictionary values used for the porousZone

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,12 +33,15 @@ void Foam::porousZone::modifyDdt(fvMatrix<Type>& m) const
{
if (porosity_ < 1)
{
const labelList& cells = mesh_.cellZones()[cellZoneID_];
forAll(cells, i)
forAll(cellZoneIds_, zoneI)
{
m.diag()[cells[i]] *= porosity_;
m.source()[cells[i]] *= porosity_;
const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]];
forAll(cells, i)
{
m.diag()[cells[i]] *= porosity_;
m.source()[cells[i]] *= porosity_;
}
}
}
}
@ -48,7 +51,6 @@ template<class RhoFieldType>
void Foam::porousZone::addPowerLawResistance
(
scalarField& Udiag,
const labelList& cells,
const scalarField& V,
const RhoFieldType& rho,
const vectorField& U
@ -57,10 +59,15 @@ void Foam::porousZone::addPowerLawResistance
const scalar C0 = C0_;
const scalar C1m1b2 = (C1_ - 1.0)/2.0;
forAll(cells, i)
forAll(cellZoneIds_, zoneI)
{
Udiag[cells[i]] +=
const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]];
forAll(cells, i)
{
Udiag[cells[i]] +=
V[cells[i]]*rho[cells[i]]*C0*pow(magSqr(U[cells[i]]), C1m1b2);
}
}
}
@ -70,7 +77,6 @@ void Foam::porousZone::addViscousInertialResistance
(
scalarField& Udiag,
vectorField& Usource,
const labelList& cells,
const scalarField& V,
const RhoFieldType& rho,
const scalarField& mu,
@ -80,14 +86,21 @@ void Foam::porousZone::addViscousInertialResistance
const tensor& D = D_.value();
const tensor& F = F_.value();
forAll(cells, i)
forAll(cellZoneIds_, zoneI)
{
tensor dragCoeff = mu[cells[i]]*D + (rho[cells[i]]*mag(U[cells[i]]))*F;
scalar isoDragCoeff = tr(dragCoeff);
const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]];
Udiag[cells[i]] += V[cells[i]]*isoDragCoeff;
Usource[cells[i]] -=
V[cells[i]]*((dragCoeff - I*isoDragCoeff) & U[cells[i]]);
forAll(cells, i)
{
const tensor dragCoeff = mu[cells[i]]*D
+ (rho[cells[i]]*mag(U[cells[i]]))*F;
const scalar isoDragCoeff = tr(dragCoeff);
Udiag[cells[i]] += V[cells[i]]*isoDragCoeff;
Usource[cells[i]] -=
V[cells[i]]*((dragCoeff - I*isoDragCoeff) & U[cells[i]]);
}
}
}
@ -96,7 +109,6 @@ template<class RhoFieldType>
void Foam::porousZone::addPowerLawResistance
(
tensorField& AU,
const labelList& cells,
const RhoFieldType& rho,
const vectorField& U
) const
@ -104,10 +116,15 @@ void Foam::porousZone::addPowerLawResistance
const scalar C0 = C0_;
const scalar C1m1b2 = (C1_ - 1.0)/2.0;
forAll(cells, i)
forAll(cellZoneIds_, zoneI)
{
AU[cells[i]] = AU[cells[i]]
+ I*(rho[cells[i]]*C0*pow(magSqr(U[cells[i]]), C1m1b2));
const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]];
forAll(cells, i)
{
AU[cells[i]] = AU[cells[i]]
+ I*(rho[cells[i]]*C0*pow(magSqr(U[cells[i]]), C1m1b2));
}
}
}
@ -116,7 +133,6 @@ template<class RhoFieldType>
void Foam::porousZone::addViscousInertialResistance
(
tensorField& AU,
const labelList& cells,
const RhoFieldType& rho,
const scalarField& mu,
const vectorField& U
@ -125,9 +141,14 @@ void Foam::porousZone::addViscousInertialResistance
const tensor& D = D_.value();
const tensor& F = F_.value();
forAll(cells, i)
forAll(cellZoneIds_, zoneI)
{
AU[cells[i]] += mu[cells[i]]*D + (rho[cells[i]]*mag(U[cells[i]]))*F;
const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]];
forAll(cells, i)
{
AU[cells[i]] += mu[cells[i]]*D + (rho[cells[i]]*mag(U[cells[i]]))*F;
}
}
}

View File

@ -1,74 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 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 "error.H"
#include "atomizationModel.H"
#include "LISA.H"
#include "noAtomization.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
autoPtr<atomizationModel> atomizationModel::New
(
const dictionary& dict,
spray& sm
)
{
word atomizationModelType
(
dict.lookup("atomizationModel")
);
Info<< "Selecting atomizationModel "
<< atomizationModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(atomizationModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalError
<< "atomizationModel::New(const dictionary&, const spray&) : " << endl
<< " unknown atomizationModelType type "
<< atomizationModelType
<< ", constructor not in hash table" << endl << endl
<< " Valid atomizationModel types are :" << endl;
Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError);
}
return autoPtr<atomizationModel>(cstrIter()(dict, sm));
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -59,6 +59,6 @@ Foam::CollisionModel<CloudType>::~CollisionModel()
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "NewCollisionModel.C"
#include "CollisionModelNew.C"
// ************************************************************************* //

View File

@ -29,7 +29,7 @@ Description
SourceFiles
CollisionModel.C
NewCollisionModel.C
CollisionModelNew.C
\*---------------------------------------------------------------------------*/

View File

@ -75,6 +75,6 @@ Foam::PairModel<CloudType>::coeffDict() const
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "NewPairModel.C"
#include "PairModelNew.C"
// ************************************************************************* //

View File

@ -29,7 +29,7 @@ Description
SourceFiles
PairModel.C
NewPairModel.C
PairModelNew.C
\*---------------------------------------------------------------------------*/

View File

@ -83,6 +83,6 @@ Foam::WallModel<CloudType>::coeffDict() const
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "NewWallModel.C"
#include "WallModelNew.C"
// ************************************************************************* //

View File

@ -29,7 +29,7 @@ Description
SourceFiles
WallModel.C
NewWallModel.C
WallModelNew.C
\*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -208,6 +208,13 @@ bool Foam::blockMesh::readBoundary
{
const entry& patchInfo = patchesInfo[patchI];
if (!patchInfo.isDict())
{
FatalIOErrorIn("blockMesh::readBoundary(..)", meshDescription)
<< "Entry " << patchInfo << " in boundary section is not a"
<< " valid dictionary." << exit(FatalIOError);
}
// Construct dictionary and add name
patchDicts.set(patchI, new dictionary(patchInfo.dict()));
patchDicts[patchI].set("name", patchInfo.keyword());

View File

@ -125,7 +125,7 @@ class PointEdgeWave
label nChangedEdges_;
//- Number of cyclic patches
bool nCyclicPatches_;
label nCyclicPatches_;
//- For every cyclic patch two primitivePatches
PtrList<primitivePatch> cycHalves_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,6 +33,8 @@ License
#include "MeshWave.H"
#include "ListOps.H"
#include "meshTools.H"
#include "cpuTime.H"
#include "globalMeshData.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -136,37 +136,36 @@ Foam::coordinateSystem::coordinateSystem
{
const entry* entryPtr = dict.lookupEntryPtr(typeName_(), false, false);
// a simple entry is a lookup into global coordinateSystems
// non-dictionary entry is a lookup into global coordinateSystems
if (entryPtr && !entryPtr->isDict())
{
word csName;
entryPtr->stream() >> csName;
keyType key(entryPtr->stream());
const coordinateSystems& csLst = coordinateSystems::New(obr);
const coordinateSystems& lst = coordinateSystems::New(obr);
const label id = lst.find(key);
label csId = csLst.find(csName);
if (debug)
{
Info<< "coordinateSystem::coordinateSystem"
"(const dictionary&, const objectRegistry&):"
<< nl << "using global coordinate system: "
<< csName << "=" << csId << endl;
<< key << "=" << id << endl;
}
if (csId < 0)
if (id < 0)
{
FatalErrorIn
(
"coordinateSystem::coordinateSystem"
"(const dictionary&, const objectRegistry&)"
) << "could not find coordinate system: " << csName << nl
<< "available coordinate systems: " << csLst.toc() << nl << nl
) << "could not find coordinate system: " << key << nl
<< "available coordinate systems: " << lst.toc() << nl << nl
<< exit(FatalError);
}
// copy coordinateSystem, but assign the name as the typeName
// to avoid strange things in writeDict()
operator=(csLst[csId]);
operator=(lst[id]);
name_ = typeName_();
}
else

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,6 +26,7 @@ License
#include "coordinateSystems.H"
#include "IOPtrList.H"
#include "Time.H"
#include "stringListOps.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -97,13 +98,25 @@ const Foam::coordinateSystems& Foam::coordinateSystems::New
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::label Foam::coordinateSystems::find(const word& keyword) const
Foam::label Foam::coordinateSystems::find(const keyType& key) const
{
forAll(*this, i)
if (key.isPattern())
{
if (keyword == operator[](i).name())
labelList allFound = findAll(key);
// return first element
if (!allFound.empty())
{
return i;
return allFound[0];
}
}
else
{
forAll(*this, i)
{
if (key == operator[](i).name())
{
return i;
}
}
}
@ -111,9 +124,34 @@ Foam::label Foam::coordinateSystems::find(const word& keyword) const
}
bool Foam::coordinateSystems::found(const word& keyword) const
Foam::labelList Foam::coordinateSystems::findAll(const keyType& key) const
{
return find(keyword) >= 0;
labelList allFound;
if (key.isPattern())
{
allFound = findStrings(key, toc());
}
else
{
allFound.setSize(size());
label nFound = 0;
forAll(*this, i)
{
if (key == operator[](i).name())
{
allFound[nFound++] = i;
}
}
allFound.setSize(nFound);
}
return allFound;
}
bool Foam::coordinateSystems::found(const keyType& key) const
{
return find(key) >= 0;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -97,11 +97,14 @@ public:
// Member Functions
//- Find and return index for a given keyword, returns -1 if not found
label find(const word& key) const;
//- Find and return index for the first match, returns -1 if not found
label find(const keyType& key) const;
//- Search for given keyword
bool found(const word& keyword) const;
//- Find and return indices for all matches
labelList findAll(const keyType& key) const;
//- Search for given key
bool found(const keyType& key) const;
//- Return the table of contents (list of all keywords)
wordList toc() const;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,6 +32,9 @@ License
#include "Random.H"
#include "treeDataFace.H"
#include "indexedOctree.H"
#include "polyMesh.H"
#include "polyPatch.H"
#include "Time.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -362,7 +365,7 @@ void Foam::directMappedPatchBase::findSamples
"(const pointField&, labelList&"
", labelList&, pointField&)"
) << "Did not find sample " << samples[sampleI]
<< " on any processor of region" << sampleRegion_
<< " on any processor of region " << sampleRegion_
<< exit(FatalError);
}
}

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