Commit 9b73aba1 authored by Henry's avatar Henry
Browse files
parents 8490014b f53538b8
......@@ -35,6 +35,7 @@ core
lnInclude
# build folders - anywhere
linux*Clang*/
linux*Gcc*/
linux*Icc*/
linuxming*/
......
......@@ -11,7 +11,7 @@
if (turbulentReaction)
{
volScalarField tk =
Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon());
Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon());
volScalarField tc = chemistry.tc();
// Chalmers PaSR model
......
......@@ -325,8 +325,8 @@ void Foam::MULES::limiter
const fvMesh& mesh = psi.mesh();
const unallocLabelList& owner = mesh.owner();
const unallocLabelList& neighb = mesh.neighbour();
const labelUList& owner = mesh.owner();
const labelUList& neighb = mesh.neighbour();
tmp<volScalarField::DimensionedInternalField> tVsc = mesh.Vsc();
const scalarField& V = tVsc();
......
......@@ -96,7 +96,7 @@ int main(int argc, char *argv[])
(list3 |= list2).printBits(Info);
}
Info<< "\noperator|= with UList<label>\n";
Info<< "\noperator|= with labelUList\n";
{
PackedBoolList list3 = list1;
(list3 |= list2Labels).printBits(Info);
......@@ -114,7 +114,7 @@ int main(int argc, char *argv[])
(list3 += list2).printBits(Info);
}
Info<< "\noperator+= with UList<label>\n";
Info<< "\noperator+= with labelUList\n";
{
PackedBoolList list3 = list1;
(list3 += list2Labels).printBits(Info);
......@@ -126,7 +126,7 @@ int main(int argc, char *argv[])
(list3 -= list2).printBits(Info);
}
Info<< "\noperator-= with UList<label>\n";
Info<< "\noperator-= with labelUList\n";
{
PackedBoolList list3 = list1;
(list3 -= list2Labels).printBits(Info);
......
......@@ -27,7 +27,11 @@ int main()
Info<< magSqr(d) << endl;
vector d2(0.5, 0.51, -0.5);
Info<< cmptMax(d2) << " " << cmptSum(d2) << " " << cmptMag(d2) << endl;
Info<< cmptMax(d2) << " "
<< cmptSum(d2) << " "
<< cmptProduct(d2) << " "
<< cmptMag(d2)
<< endl;
Info<< min(d, d2) << endl;
return 0;
}
......@@ -124,8 +124,8 @@ void Foam::fluentFvMesh::writeFluentMesh() const
fluentMeshFile
<< "))" << std::endl << std::endl;
const unallocLabelList& own = owner();
const unallocLabelList& nei = neighbour();
const labelUList& own = owner();
const labelUList& nei = neighbour();
const faceList& fcs = faces();
......
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: 1.7.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
......@@ -106,7 +106,8 @@ castellatedMeshControls
// Explicit feature edge refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Specifies a level for any cell intersected by its edges.
// Specifies a level for any cell intersected by explicitly provided
// edges.
// This is a featureEdgeMesh, read from constant/triSurface for now.
features
(
......
......@@ -138,7 +138,7 @@ Foam::label Foam::checkTopology
{
if (patches[patchI].coupled())
{
const unallocLabelList& owners = patches[patchI].faceCells();
const labelUList& owners = patches[patchI].faceCells();
forAll(owners, i)
{
......
......@@ -128,7 +128,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
// Distribute internal faces
labelListList newCellFaces(oldCells.size());
const unallocLabelList& oldOwnerStart = lduAddr().ownerStartAddr();
const labelUList& oldOwnerStart = lduAddr().ownerStartAddr();
forAll(newCellFaces, cellI)
{
......@@ -168,7 +168,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
curInsBouFace = false;
// Get faceCells for face insertion
const unallocLabelList& curFaceCells = curPatch.faceCells();
const labelUList& curFaceCells = curPatch.faceCells();
const label curStart = curPatch.start();
forAll(curPatch, faceI)
......
......@@ -164,7 +164,7 @@ void Foam::domainDecomposition::decomposeMesh()
// Normal patch. Add faces to processor where the cell
// next to the face lives
const unallocLabelList& patchFaceCells =
const labelUList& patchFaceCells =
patches[patchi].faceCells();
forAll(patchFaceCells, facei)
......@@ -185,9 +185,9 @@ void Foam::domainDecomposition::decomposeMesh()
patches[patchi]
);
// cyclic: check opposite side on this processor
const unallocLabelList& patchFaceCells = pp.faceCells();
const labelUList& patchFaceCells = pp.faceCells();
const unallocLabelList& nbrPatchFaceCells =
const labelUList& nbrPatchFaceCells =
pp.neighbPatch().faceCells();
forAll(patchFaceCells, facei)
......@@ -259,8 +259,8 @@ void Foam::domainDecomposition::decomposeMesh()
);
// cyclic: check opposite side on this processor
const unallocLabelList& patchFaceCells = pp.faceCells();
const unallocLabelList& nbrPatchFaceCells =
const labelUList& patchFaceCells = pp.faceCells();
const labelUList& nbrPatchFaceCells =
pp.neighbPatch().faceCells();
// Store old sizes. Used to detect which inter-proc patches
......
......@@ -30,7 +30,7 @@ License
Foam::fvFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
(
const unallocLabelList& addressingSlice,
const labelUList& addressingSlice,
const label addressingOffset
)
:
......@@ -48,7 +48,7 @@ Foam::fvFieldDecomposer::processorVolPatchFieldDecomposer::
processorVolPatchFieldDecomposer
(
const fvMesh& mesh,
const unallocLabelList& addressingSlice
const labelUList& addressingSlice
)
:
directAddressing_(addressingSlice.size())
......@@ -95,7 +95,7 @@ processorVolPatchFieldDecomposer
Foam::fvFieldDecomposer::processorSurfacePatchFieldDecomposer::
processorSurfacePatchFieldDecomposer
(
const unallocLabelList& addressingSlice
const labelUList& addressingSlice
)
:
addressing_(addressingSlice.size()),
......@@ -171,7 +171,7 @@ Foam::fvFieldDecomposer::fvFieldDecomposer
processorSurfacePatchFieldDecomposerPtrs_[patchi] =
new processorSurfacePatchFieldDecomposer
(
static_cast<const unallocLabelList&>
static_cast<const labelUList&>
(
procMesh_.boundary()[patchi].patchSlice
(
......
......@@ -71,7 +71,7 @@ public:
//- Construct given addressing
patchFieldDecomposer
(
const unallocLabelList& addressingSlice,
const labelUList& addressingSlice,
const label addressingOffset
);
......@@ -88,7 +88,7 @@ public:
return true;
}
const unallocLabelList& directAddressing() const
const labelUList& directAddressing() const
{
return directAddressing_;
}
......@@ -112,7 +112,7 @@ public:
processorVolPatchFieldDecomposer
(
const fvMesh& mesh,
const unallocLabelList& addressingSlice
const labelUList& addressingSlice
);
......@@ -128,7 +128,7 @@ public:
return true;
}
const unallocLabelList& directAddressing() const
const labelUList& directAddressing() const
{
return directAddressing_;
}
......@@ -149,7 +149,7 @@ public:
//- Construct given addressing
processorSurfacePatchFieldDecomposer
(
const unallocLabelList& addressingSlice
const labelUList& addressingSlice
);
......
......@@ -88,7 +88,7 @@ public:
return true;
}
const unallocLabelList& directAddressing() const
const labelUList& directAddressing() const
{
return directAddressing_;
}
......
......@@ -27,6 +27,7 @@ setFormat raw;
// Surface output format. Choice of
// null : suppress output
// ensight : Ensight Gold format, one field per case file
// foamFile : separate points, faces and values file
// dx : DX scalar or vector format
// vtk : VTK ascii format
......
......@@ -161,7 +161,7 @@ for ((proc=0; proc<$nProcs; proc++))
do
procCmdFile="$PWD/processor${proc}.sh"
procLog="processor${proc}.log"
geom="-geometry 120x20+$xpos+$ypos"
geom="-geometry 120x15+$xpos+$ypos"
case "$WM_MPLIB" in
*OPENMPI)
......@@ -183,11 +183,11 @@ do
echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $PWD/mpirun.schema
;;
2)
echo "$sourceFoam; cd $PWD; gdb -command $PWD/gdbCommands >& $procLog" >> $procCmdFile
echo "$sourceFoam; cd $PWD; gdb -command $PWD/gdbCommands $exec > $procLog 2>&1" >> $procCmdFile
echo "${node}$procCmdFile" >> $PWD/mpirun.schema
;;
3)
echo "$sourceFoam; cd $PWD; $exec $args >& $procLog" >> $procCmdFile
echo "$sourceFoam; cd $PWD; $exec $args > $procLog 2>&1" >> $procCmdFile
echo "${node}$procCmdFile" >> $PWD/mpirun.schema
;;
4)
......
......@@ -53,7 +53,8 @@ _inlineSed()
backup=`tempfile`
cp $1 $backup
sed -i -e "$2" $1
cmp $1 $backup || usage "Failed : $3"
cmp --quiet $1 $backup && usage "Failed : $3"
return 0
}
......@@ -70,9 +71,7 @@ do
;;
--foamInstall)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
foamInstall="$2"
echo "** foamInstall:$foamInstall"
foamInstall="$2"
_inlineSed \
etc/bashrc \
'/^[^#]/s@foamInstall=.*@foamInstall='"$foamInstall@" \
......@@ -81,7 +80,7 @@ do
;;
--projectName)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
projectName="$2"
projectName="$2"
_inlineSed \
etc/bashrc \
'/^[^#]/s@WM_PROJECT_DIR=.*@WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/'"$projectName@" \
......@@ -90,7 +89,7 @@ do
;;
--archOption)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
archOption="$2"
archOption="$2"
_inlineSed \
etc/bashrc \
'/^[^#]/s@: ${WM_ARCH_OPTION:=64}@WM_ARCH_OPTION='"$archOption@" \
......@@ -99,7 +98,7 @@ do
;;
--paraviewInstall)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
paraviewInstall="$2"
paraviewInstall="$2"
_inlineSed \
etc/apps/paraview3/bashrc \
'/^[^#]/s@ParaView_DIR=.*@ParaView_DIR='"$paraviewInstall@" \
......
......@@ -49,9 +49,10 @@
# test the specified files/directories for standards conformance.
#
#------------------------------------------------------------------------------
hookName="pre-commit"
die()
{
echo 'pre-commit hook failure' 1>&2
echo '$hookName hook failure' 1>&2
echo '-----------------------' 1>&2
echo '' 1>&2
echo "$@" 1>&2
......@@ -104,7 +105,7 @@ dieOnBadFiles()
{
if [ -n "$badFiles" ]
then
echo 'pre-commit hook failure' 1>&2
echo '$hookName hook failure' 1>&2
echo '-----------------------' 1>&2
echo "$@" 1>&2
echo '' 1>&2
......@@ -116,22 +117,38 @@ dieOnBadFiles()
}
#
# qualify 'git grep' to check cached value or from a specific commit
#
gitScope()
{
if [ "$#" -gt 0 ]
then
echo "$1:"
else
echo "--cached -- "
fi
}
#
# check for bad strings, characters, etc
#
checkIllegalCode()
{
echo "pre-commit: check bad strings/characters etc ..." 1>&2
echo "$hookName: check bad strings/characters etc ..." 1>&2
reBad="(N""abla|"$'\t'")"
msgBad="N""abla or <TAB>"
scope=$(gitScope $@)
badFiles=$(
for f in $fileList
do
# parse line numbers from grep output:
# <lineNr>: contents
lines=$(git grep --cached -E -hn -e "$reBad" -- "$f" |
lines=$(git grep -E -hn -e "$reBad" $scope"$f" |
sed -e 's@:.*@@' |
tr '\n' ' '
)
......@@ -149,7 +166,9 @@ checkIllegalCode()
checkCopyright()
{
year=$(date +%Y)
echo "pre-commit: check copyright ..." 1>&2
echo "$hookName: check copyright ..." 1>&2
scope=$(gitScope $@)
badFiles=$(
for f in $fileList
......@@ -160,10 +179,10 @@ checkCopyright()
# parse line numbers from grep output:
# <lineNr>: contents
#
lines=$(git grep --cached -F -hn -e Copyright \
lines=$(git grep -F -hn -e Copyright \
--and -e OpenCFD \
--and --not -e "$year" \
-- "$f" |
$scope"$f" |
sed -e 's@:.*@@' |
tr '\n' ' '
)
......@@ -180,7 +199,9 @@ checkCopyright()
#
checkLineLength()
{
echo "pre-commit: check line lengths ..." 1>&2
echo "$hookName: check line lengths ..." 1>&2
scope=$(gitScope $@)
badFiles=$(
for f in $fileList
......@@ -190,7 +211,7 @@ checkLineLength()
(*.[CH])
# parse line numbers from grep output:
# <lineNr>: contents
lines=$(git grep --cached -hn -e '^.\{81,\}' -- "$f" |
lines=$(git grep -hn -e '^.\{81,\}' $scope"$f" |
sed -e 's@:.*@@' |
tr '\n' ' '
)
......@@ -209,7 +230,9 @@ checkLineLength()
#
checkLineLengthNonComments()
{
echo "pre-commit: check line lengths ..." 1>&2
echo "$hookName: check line lengths ..." 1>&2
scope=$(gitScope $@)
badFiles=$(
for f in $fileList
......@@ -219,9 +242,9 @@ checkLineLengthNonComments()
(*.[CH])
# parse line numbers from grep output:
# <lineNr>: contents
lines=$(git grep --cached -hn -e '^.\{81,\}' \
lines=$(git grep -hn -e '^.\{81,\}' \
--and --not -e "^ *//" \
-- "$f" |
$scope"$f" |
sed -e 's@:.*@@' |
tr '\n' ' '
)
......@@ -234,12 +257,15 @@ checkLineLengthNonComments()
dieOnBadFiles "Limit code to 80 columns before pushing"
}
#
# limit line length to 80-columns, except #directive lines
#
checkLineLengthNonDirective()
{
echo "pre-commit: check line lengths ..." 1>&2
echo "$hookName: check line lengths ..." 1>&2
scope=$(gitScope $@)
badFiles=$(
for f in $fileList
......@@ -249,9 +275,9 @@ checkLineLengthNonDirective()
(*.[CH])
# parse line numbers from grep output:
# <lineNr>: contents
lines=$(git grep --cached -hn -e '^.\{81,\}' \
lines=$(git grep -hn -e '^.\{81,\}' \
--and --not -e "^ *#" \
-- "$f" |
$scope"$f" |
sed -e 's@:.*@@' |
tr '\n' ' '
)
......@@ -265,9 +291,9 @@ checkLineLengthNonDirective()
}
# do all checks
# ~~~~~~~~~~~~~
#------------------------------------------------------------------------------
# Main code : do all checks
#
# builtin whitespace check to avoid trailing space, including CR-LF endings
bad=$(git diff-index --cached --check $against --) || die "$bad"
......
#!/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-receive-hook
#
# Description
# pre-receive hook for git.
# Copy or link this file as ".git/hooks/pre-receive"
#
# Eg,
# (
# cd $WM_PROJECT_DIR/.git/hooks &&
# ln -sf ../../bin/tools/pre-receive-hook pre-receive
# )
#
# Hook receives: <old-sha1> <new-sha1> <ref-name>
#
# 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
#
#------------------------------------------------------------------------------
hookName="pre-receive"
die()
{
echo '$hookName hook failure' 1>&2
echo '-----------------------' 1>&2
echo '' 1>&2
echo "$@" 1>&2
echo '' 1>&2
exit 1
}
#-----------------------------------------------------------------------------
unset fileList
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 '$hookName 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
}
#
# qualify 'git grep' to check cached value or from a specific commit
#
gitScope()
{
if [ "$#" -gt 0 ]
then
echo "$1:"
else
echo "--cached -- "
fi
}
#
# check for bad strings, characters, etc
#
checkIllegalCode()
{
echo "$hookName: check bad strings/characters etc ..." 1>&2
reBad="(N""abla|"$'\t'"|"$'\r\n'")"
msgBad="N""abla, <TAB> or DOS-line-endings"
scope=$(gitScope $@)
badFiles=$(
for f in $fileList
do
# parse line numbers from grep output:
# <lineNr>: contents
lines=$(git grep -E -hn -e "$reBad" $scope"$f" |
sed -e 's@:.*@@' |
tr '\n' ' '
)
[ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
done
)
dieOnBadFiles "Remove/correct bad '$msgBad' references"