mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -35,6 +35,7 @@ core
|
|||||||
lnInclude
|
lnInclude
|
||||||
|
|
||||||
# build folders - anywhere
|
# build folders - anywhere
|
||||||
|
linux*Clang*/
|
||||||
linux*Gcc*/
|
linux*Gcc*/
|
||||||
linux*Icc*/
|
linux*Icc*/
|
||||||
linuxming*/
|
linuxming*/
|
||||||
|
|||||||
@ -325,8 +325,8 @@ void Foam::MULES::limiter
|
|||||||
|
|
||||||
const fvMesh& mesh = psi.mesh();
|
const fvMesh& mesh = psi.mesh();
|
||||||
|
|
||||||
const unallocLabelList& owner = mesh.owner();
|
const labelUList& owner = mesh.owner();
|
||||||
const unallocLabelList& neighb = mesh.neighbour();
|
const labelUList& neighb = mesh.neighbour();
|
||||||
tmp<volScalarField::DimensionedInternalField> tVsc = mesh.Vsc();
|
tmp<volScalarField::DimensionedInternalField> tVsc = mesh.Vsc();
|
||||||
const scalarField& V = tVsc();
|
const scalarField& V = tVsc();
|
||||||
|
|
||||||
|
|||||||
@ -96,7 +96,7 @@ int main(int argc, char *argv[])
|
|||||||
(list3 |= list2).printBits(Info);
|
(list3 |= list2).printBits(Info);
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "\noperator|= with UList<label>\n";
|
Info<< "\noperator|= with labelUList\n";
|
||||||
{
|
{
|
||||||
PackedBoolList list3 = list1;
|
PackedBoolList list3 = list1;
|
||||||
(list3 |= list2Labels).printBits(Info);
|
(list3 |= list2Labels).printBits(Info);
|
||||||
@ -114,7 +114,7 @@ int main(int argc, char *argv[])
|
|||||||
(list3 += list2).printBits(Info);
|
(list3 += list2).printBits(Info);
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "\noperator+= with UList<label>\n";
|
Info<< "\noperator+= with labelUList\n";
|
||||||
{
|
{
|
||||||
PackedBoolList list3 = list1;
|
PackedBoolList list3 = list1;
|
||||||
(list3 += list2Labels).printBits(Info);
|
(list3 += list2Labels).printBits(Info);
|
||||||
@ -126,7 +126,7 @@ int main(int argc, char *argv[])
|
|||||||
(list3 -= list2).printBits(Info);
|
(list3 -= list2).printBits(Info);
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "\noperator-= with UList<label>\n";
|
Info<< "\noperator-= with labelUList\n";
|
||||||
{
|
{
|
||||||
PackedBoolList list3 = list1;
|
PackedBoolList list3 = list1;
|
||||||
(list3 -= list2Labels).printBits(Info);
|
(list3 -= list2Labels).printBits(Info);
|
||||||
|
|||||||
@ -27,7 +27,11 @@ int main()
|
|||||||
Info<< magSqr(d) << endl;
|
Info<< magSqr(d) << endl;
|
||||||
|
|
||||||
vector d2(0.5, 0.51, -0.5);
|
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;
|
Info<< min(d, d2) << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -124,8 +124,8 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
fluentMeshFile
|
fluentMeshFile
|
||||||
<< "))" << std::endl << std::endl;
|
<< "))" << std::endl << std::endl;
|
||||||
|
|
||||||
const unallocLabelList& own = owner();
|
const labelUList& own = owner();
|
||||||
const unallocLabelList& nei = neighbour();
|
const labelUList& nei = neighbour();
|
||||||
|
|
||||||
const faceList& fcs = faces();
|
const faceList& fcs = faces();
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / 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 |
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
@ -106,7 +106,8 @@ castellatedMeshControls
|
|||||||
// Explicit feature edge refinement
|
// 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.
|
// This is a featureEdgeMesh, read from constant/triSurface for now.
|
||||||
features
|
features
|
||||||
(
|
(
|
||||||
|
|||||||
@ -138,7 +138,7 @@ Foam::label Foam::checkTopology
|
|||||||
{
|
{
|
||||||
if (patches[patchI].coupled())
|
if (patches[patchI].coupled())
|
||||||
{
|
{
|
||||||
const unallocLabelList& owners = patches[patchI].faceCells();
|
const labelUList& owners = patches[patchI].faceCells();
|
||||||
|
|
||||||
forAll(owners, i)
|
forAll(owners, i)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -128,7 +128,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
|||||||
// Distribute internal faces
|
// Distribute internal faces
|
||||||
labelListList newCellFaces(oldCells.size());
|
labelListList newCellFaces(oldCells.size());
|
||||||
|
|
||||||
const unallocLabelList& oldOwnerStart = lduAddr().ownerStartAddr();
|
const labelUList& oldOwnerStart = lduAddr().ownerStartAddr();
|
||||||
|
|
||||||
forAll(newCellFaces, cellI)
|
forAll(newCellFaces, cellI)
|
||||||
{
|
{
|
||||||
@ -168,7 +168,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
|||||||
curInsBouFace = false;
|
curInsBouFace = false;
|
||||||
|
|
||||||
// Get faceCells for face insertion
|
// Get faceCells for face insertion
|
||||||
const unallocLabelList& curFaceCells = curPatch.faceCells();
|
const labelUList& curFaceCells = curPatch.faceCells();
|
||||||
const label curStart = curPatch.start();
|
const label curStart = curPatch.start();
|
||||||
|
|
||||||
forAll(curPatch, faceI)
|
forAll(curPatch, faceI)
|
||||||
|
|||||||
@ -164,7 +164,7 @@ void Foam::domainDecomposition::decomposeMesh()
|
|||||||
// Normal patch. Add faces to processor where the cell
|
// Normal patch. Add faces to processor where the cell
|
||||||
// next to the face lives
|
// next to the face lives
|
||||||
|
|
||||||
const unallocLabelList& patchFaceCells =
|
const labelUList& patchFaceCells =
|
||||||
patches[patchi].faceCells();
|
patches[patchi].faceCells();
|
||||||
|
|
||||||
forAll(patchFaceCells, facei)
|
forAll(patchFaceCells, facei)
|
||||||
@ -185,9 +185,9 @@ void Foam::domainDecomposition::decomposeMesh()
|
|||||||
patches[patchi]
|
patches[patchi]
|
||||||
);
|
);
|
||||||
// cyclic: check opposite side on this processor
|
// 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();
|
pp.neighbPatch().faceCells();
|
||||||
|
|
||||||
forAll(patchFaceCells, facei)
|
forAll(patchFaceCells, facei)
|
||||||
@ -259,8 +259,8 @@ void Foam::domainDecomposition::decomposeMesh()
|
|||||||
);
|
);
|
||||||
|
|
||||||
// cyclic: check opposite side on this processor
|
// 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();
|
pp.neighbPatch().faceCells();
|
||||||
|
|
||||||
// Store old sizes. Used to detect which inter-proc patches
|
// Store old sizes. Used to detect which inter-proc patches
|
||||||
|
|||||||
@ -30,7 +30,7 @@ License
|
|||||||
|
|
||||||
Foam::fvFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
|
Foam::fvFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
|
||||||
(
|
(
|
||||||
const unallocLabelList& addressingSlice,
|
const labelUList& addressingSlice,
|
||||||
const label addressingOffset
|
const label addressingOffset
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
@ -48,7 +48,7 @@ Foam::fvFieldDecomposer::processorVolPatchFieldDecomposer::
|
|||||||
processorVolPatchFieldDecomposer
|
processorVolPatchFieldDecomposer
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const unallocLabelList& addressingSlice
|
const labelUList& addressingSlice
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
directAddressing_(addressingSlice.size())
|
directAddressing_(addressingSlice.size())
|
||||||
@ -95,7 +95,7 @@ processorVolPatchFieldDecomposer
|
|||||||
Foam::fvFieldDecomposer::processorSurfacePatchFieldDecomposer::
|
Foam::fvFieldDecomposer::processorSurfacePatchFieldDecomposer::
|
||||||
processorSurfacePatchFieldDecomposer
|
processorSurfacePatchFieldDecomposer
|
||||||
(
|
(
|
||||||
const unallocLabelList& addressingSlice
|
const labelUList& addressingSlice
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
addressing_(addressingSlice.size()),
|
addressing_(addressingSlice.size()),
|
||||||
@ -171,7 +171,7 @@ Foam::fvFieldDecomposer::fvFieldDecomposer
|
|||||||
processorSurfacePatchFieldDecomposerPtrs_[patchi] =
|
processorSurfacePatchFieldDecomposerPtrs_[patchi] =
|
||||||
new processorSurfacePatchFieldDecomposer
|
new processorSurfacePatchFieldDecomposer
|
||||||
(
|
(
|
||||||
static_cast<const unallocLabelList&>
|
static_cast<const labelUList&>
|
||||||
(
|
(
|
||||||
procMesh_.boundary()[patchi].patchSlice
|
procMesh_.boundary()[patchi].patchSlice
|
||||||
(
|
(
|
||||||
|
|||||||
@ -71,7 +71,7 @@ public:
|
|||||||
//- Construct given addressing
|
//- Construct given addressing
|
||||||
patchFieldDecomposer
|
patchFieldDecomposer
|
||||||
(
|
(
|
||||||
const unallocLabelList& addressingSlice,
|
const labelUList& addressingSlice,
|
||||||
const label addressingOffset
|
const label addressingOffset
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const unallocLabelList& directAddressing() const
|
const labelUList& directAddressing() const
|
||||||
{
|
{
|
||||||
return directAddressing_;
|
return directAddressing_;
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ public:
|
|||||||
processorVolPatchFieldDecomposer
|
processorVolPatchFieldDecomposer
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const unallocLabelList& addressingSlice
|
const labelUList& addressingSlice
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const unallocLabelList& directAddressing() const
|
const labelUList& directAddressing() const
|
||||||
{
|
{
|
||||||
return directAddressing_;
|
return directAddressing_;
|
||||||
}
|
}
|
||||||
@ -149,7 +149,7 @@ public:
|
|||||||
//- Construct given addressing
|
//- Construct given addressing
|
||||||
processorSurfacePatchFieldDecomposer
|
processorSurfacePatchFieldDecomposer
|
||||||
(
|
(
|
||||||
const unallocLabelList& addressingSlice
|
const labelUList& addressingSlice
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -88,7 +88,7 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const unallocLabelList& directAddressing() const
|
const labelUList& directAddressing() const
|
||||||
{
|
{
|
||||||
return directAddressing_;
|
return directAddressing_;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,6 +27,7 @@ setFormat raw;
|
|||||||
|
|
||||||
// Surface output format. Choice of
|
// Surface output format. Choice of
|
||||||
// null : suppress output
|
// null : suppress output
|
||||||
|
// ensight : Ensight Gold format, one field per case file
|
||||||
// foamFile : separate points, faces and values file
|
// foamFile : separate points, faces and values file
|
||||||
// dx : DX scalar or vector format
|
// dx : DX scalar or vector format
|
||||||
// vtk : VTK ascii format
|
// vtk : VTK ascii format
|
||||||
|
|||||||
@ -161,7 +161,7 @@ for ((proc=0; proc<$nProcs; proc++))
|
|||||||
do
|
do
|
||||||
procCmdFile="$PWD/processor${proc}.sh"
|
procCmdFile="$PWD/processor${proc}.sh"
|
||||||
procLog="processor${proc}.log"
|
procLog="processor${proc}.log"
|
||||||
geom="-geometry 120x20+$xpos+$ypos"
|
geom="-geometry 120x15+$xpos+$ypos"
|
||||||
|
|
||||||
case "$WM_MPLIB" in
|
case "$WM_MPLIB" in
|
||||||
*OPENMPI)
|
*OPENMPI)
|
||||||
@ -183,11 +183,11 @@ do
|
|||||||
echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $PWD/mpirun.schema
|
echo "${node}xterm -font fixed -title 'processor'$proc $geom -e $procCmdFile" >> $PWD/mpirun.schema
|
||||||
;;
|
;;
|
||||||
2)
|
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
|
echo "${node}$procCmdFile" >> $PWD/mpirun.schema
|
||||||
;;
|
;;
|
||||||
3)
|
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
|
echo "${node}$procCmdFile" >> $PWD/mpirun.schema
|
||||||
;;
|
;;
|
||||||
4)
|
4)
|
||||||
|
|||||||
@ -53,7 +53,8 @@ _inlineSed()
|
|||||||
backup=`tempfile`
|
backup=`tempfile`
|
||||||
cp $1 $backup
|
cp $1 $backup
|
||||||
sed -i -e "$2" $1
|
sed -i -e "$2" $1
|
||||||
cmp $1 $backup || usage "Failed : $3"
|
cmp --quiet $1 $backup && usage "Failed : $3"
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -71,8 +72,6 @@ do
|
|||||||
--foamInstall)
|
--foamInstall)
|
||||||
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
|
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
|
||||||
foamInstall="$2"
|
foamInstall="$2"
|
||||||
echo "** foamInstall:$foamInstall"
|
|
||||||
|
|
||||||
_inlineSed \
|
_inlineSed \
|
||||||
etc/bashrc \
|
etc/bashrc \
|
||||||
'/^[^#]/s@foamInstall=.*@foamInstall='"$foamInstall@" \
|
'/^[^#]/s@foamInstall=.*@foamInstall='"$foamInstall@" \
|
||||||
|
|||||||
@ -49,9 +49,10 @@
|
|||||||
# test the specified files/directories for standards conformance.
|
# test the specified files/directories for standards conformance.
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
hookName="pre-commit"
|
||||||
die()
|
die()
|
||||||
{
|
{
|
||||||
echo 'pre-commit hook failure' 1>&2
|
echo '$hookName hook failure' 1>&2
|
||||||
echo '-----------------------' 1>&2
|
echo '-----------------------' 1>&2
|
||||||
echo '' 1>&2
|
echo '' 1>&2
|
||||||
echo "$@" 1>&2
|
echo "$@" 1>&2
|
||||||
@ -104,7 +105,7 @@ dieOnBadFiles()
|
|||||||
{
|
{
|
||||||
if [ -n "$badFiles" ]
|
if [ -n "$badFiles" ]
|
||||||
then
|
then
|
||||||
echo 'pre-commit hook failure' 1>&2
|
echo '$hookName hook failure' 1>&2
|
||||||
echo '-----------------------' 1>&2
|
echo '-----------------------' 1>&2
|
||||||
echo "$@" 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
|
# check for bad strings, characters, etc
|
||||||
#
|
#
|
||||||
checkIllegalCode()
|
checkIllegalCode()
|
||||||
{
|
{
|
||||||
echo "pre-commit: check bad strings/characters etc ..." 1>&2
|
echo "$hookName: check bad strings/characters etc ..." 1>&2
|
||||||
|
|
||||||
reBad="(N""abla|"$'\t'")"
|
reBad="(N""abla|"$'\t'")"
|
||||||
msgBad="N""abla or <TAB>"
|
msgBad="N""abla or <TAB>"
|
||||||
|
|
||||||
|
scope=$(gitScope $@)
|
||||||
|
|
||||||
badFiles=$(
|
badFiles=$(
|
||||||
for f in $fileList
|
for f in $fileList
|
||||||
do
|
do
|
||||||
# parse line numbers from grep output:
|
# parse line numbers from grep output:
|
||||||
# <lineNr>: contents
|
# <lineNr>: contents
|
||||||
lines=$(git grep --cached -E -hn -e "$reBad" -- "$f" |
|
lines=$(git grep -E -hn -e "$reBad" $scope"$f" |
|
||||||
sed -e 's@:.*@@' |
|
sed -e 's@:.*@@' |
|
||||||
tr '\n' ' '
|
tr '\n' ' '
|
||||||
)
|
)
|
||||||
@ -149,7 +166,9 @@ checkIllegalCode()
|
|||||||
checkCopyright()
|
checkCopyright()
|
||||||
{
|
{
|
||||||
year=$(date +%Y)
|
year=$(date +%Y)
|
||||||
echo "pre-commit: check copyright ..." 1>&2
|
echo "$hookName: check copyright ..." 1>&2
|
||||||
|
|
||||||
|
scope=$(gitScope $@)
|
||||||
|
|
||||||
badFiles=$(
|
badFiles=$(
|
||||||
for f in $fileList
|
for f in $fileList
|
||||||
@ -160,10 +179,10 @@ checkCopyright()
|
|||||||
# parse line numbers from grep output:
|
# parse line numbers from grep output:
|
||||||
# <lineNr>: contents
|
# <lineNr>: contents
|
||||||
#
|
#
|
||||||
lines=$(git grep --cached -F -hn -e Copyright \
|
lines=$(git grep -F -hn -e Copyright \
|
||||||
--and -e OpenCFD \
|
--and -e OpenCFD \
|
||||||
--and --not -e "$year" \
|
--and --not -e "$year" \
|
||||||
-- "$f" |
|
$scope"$f" |
|
||||||
sed -e 's@:.*@@' |
|
sed -e 's@:.*@@' |
|
||||||
tr '\n' ' '
|
tr '\n' ' '
|
||||||
)
|
)
|
||||||
@ -180,7 +199,9 @@ checkCopyright()
|
|||||||
#
|
#
|
||||||
checkLineLength()
|
checkLineLength()
|
||||||
{
|
{
|
||||||
echo "pre-commit: check line lengths ..." 1>&2
|
echo "$hookName: check line lengths ..." 1>&2
|
||||||
|
|
||||||
|
scope=$(gitScope $@)
|
||||||
|
|
||||||
badFiles=$(
|
badFiles=$(
|
||||||
for f in $fileList
|
for f in $fileList
|
||||||
@ -190,7 +211,7 @@ checkLineLength()
|
|||||||
(*.[CH])
|
(*.[CH])
|
||||||
# parse line numbers from grep output:
|
# parse line numbers from grep output:
|
||||||
# <lineNr>: contents
|
# <lineNr>: contents
|
||||||
lines=$(git grep --cached -hn -e '^.\{81,\}' -- "$f" |
|
lines=$(git grep -hn -e '^.\{81,\}' $scope"$f" |
|
||||||
sed -e 's@:.*@@' |
|
sed -e 's@:.*@@' |
|
||||||
tr '\n' ' '
|
tr '\n' ' '
|
||||||
)
|
)
|
||||||
@ -209,7 +230,9 @@ checkLineLength()
|
|||||||
#
|
#
|
||||||
checkLineLengthNonComments()
|
checkLineLengthNonComments()
|
||||||
{
|
{
|
||||||
echo "pre-commit: check line lengths ..." 1>&2
|
echo "$hookName: check line lengths ..." 1>&2
|
||||||
|
|
||||||
|
scope=$(gitScope $@)
|
||||||
|
|
||||||
badFiles=$(
|
badFiles=$(
|
||||||
for f in $fileList
|
for f in $fileList
|
||||||
@ -219,9 +242,9 @@ checkLineLengthNonComments()
|
|||||||
(*.[CH])
|
(*.[CH])
|
||||||
# parse line numbers from grep output:
|
# parse line numbers from grep output:
|
||||||
# <lineNr>: contents
|
# <lineNr>: contents
|
||||||
lines=$(git grep --cached -hn -e '^.\{81,\}' \
|
lines=$(git grep -hn -e '^.\{81,\}' \
|
||||||
--and --not -e "^ *//" \
|
--and --not -e "^ *//" \
|
||||||
-- "$f" |
|
$scope"$f" |
|
||||||
sed -e 's@:.*@@' |
|
sed -e 's@:.*@@' |
|
||||||
tr '\n' ' '
|
tr '\n' ' '
|
||||||
)
|
)
|
||||||
@ -234,12 +257,15 @@ checkLineLengthNonComments()
|
|||||||
dieOnBadFiles "Limit code to 80 columns before pushing"
|
dieOnBadFiles "Limit code to 80 columns before pushing"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# limit line length to 80-columns, except #directive lines
|
# limit line length to 80-columns, except #directive lines
|
||||||
#
|
#
|
||||||
checkLineLengthNonDirective()
|
checkLineLengthNonDirective()
|
||||||
{
|
{
|
||||||
echo "pre-commit: check line lengths ..." 1>&2
|
echo "$hookName: check line lengths ..." 1>&2
|
||||||
|
|
||||||
|
scope=$(gitScope $@)
|
||||||
|
|
||||||
badFiles=$(
|
badFiles=$(
|
||||||
for f in $fileList
|
for f in $fileList
|
||||||
@ -249,9 +275,9 @@ checkLineLengthNonDirective()
|
|||||||
(*.[CH])
|
(*.[CH])
|
||||||
# parse line numbers from grep output:
|
# parse line numbers from grep output:
|
||||||
# <lineNr>: contents
|
# <lineNr>: contents
|
||||||
lines=$(git grep --cached -hn -e '^.\{81,\}' \
|
lines=$(git grep -hn -e '^.\{81,\}' \
|
||||||
--and --not -e "^ *#" \
|
--and --not -e "^ *#" \
|
||||||
-- "$f" |
|
$scope"$f" |
|
||||||
sed -e 's@:.*@@' |
|
sed -e 's@:.*@@' |
|
||||||
tr '\n' ' '
|
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
|
# builtin whitespace check to avoid trailing space, including CR-LF endings
|
||||||
bad=$(git diff-index --cached --check $against --) || die "$bad"
|
bad=$(git diff-index --cached --check $against --) || die "$bad"
|
||||||
|
|||||||
303
bin/tools/pre-receive-hook
Executable file
303
bin/tools/pre-receive-hook
Executable file
@ -0,0 +1,303 @@
|
|||||||
|
#!/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"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# check that OpenCFD copyright is current
|
||||||
|
#
|
||||||
|
checkCopyright()
|
||||||
|
{
|
||||||
|
year=$(date +%Y)
|
||||||
|
echo "$hookName: check copyright ..." 1>&2
|
||||||
|
|
||||||
|
scope=$(gitScope $@)
|
||||||
|
|
||||||
|
badFiles=$(
|
||||||
|
for f in $fileList
|
||||||
|
do
|
||||||
|
# NB: need to have OpenCFD on a separate line to prevent
|
||||||
|
# this check being caught by itself!
|
||||||
|
#
|
||||||
|
# parse line numbers from grep output:
|
||||||
|
# <lineNr>: contents
|
||||||
|
#
|
||||||
|
lines=$(git grep -F -hn -e Copyright \
|
||||||
|
--and -e OpenCFD \
|
||||||
|
--and --not -e "$year" \
|
||||||
|
$scope"$f" |
|
||||||
|
sed -e 's@:.*@@' |
|
||||||
|
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()
|
||||||
|
{
|
||||||
|
echo "$hookName: check line lengths ..." 1>&2
|
||||||
|
|
||||||
|
scope=$(gitScope $@)
|
||||||
|
|
||||||
|
badFiles=$(
|
||||||
|
for f in $fileList
|
||||||
|
do
|
||||||
|
# limit to *.[CH] files
|
||||||
|
case "$f" in
|
||||||
|
(*.[CH])
|
||||||
|
# parse line numbers from grep output:
|
||||||
|
# <lineNr>: contents
|
||||||
|
lines=$(git grep -hn -e '^.\{81,\}' $scope"$f" |
|
||||||
|
sed -e 's@:.*@@' |
|
||||||
|
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()
|
||||||
|
{
|
||||||
|
echo "$hookName: check line lengths ..." 1>&2
|
||||||
|
|
||||||
|
scope=$(gitScope $@)
|
||||||
|
|
||||||
|
badFiles=$(
|
||||||
|
for f in $fileList
|
||||||
|
do
|
||||||
|
# limit to *.[CH] files
|
||||||
|
case "$f" in
|
||||||
|
(*.[CH])
|
||||||
|
# parse line numbers from grep output:
|
||||||
|
# <lineNr>: contents
|
||||||
|
lines=$(git grep -hn -e '^.\{81,\}' \
|
||||||
|
--and --not -e "^ *//" \
|
||||||
|
$scope"$f" |
|
||||||
|
sed -e 's@:.*@@' |
|
||||||
|
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 #directive lines
|
||||||
|
#
|
||||||
|
checkLineLengthNonDirective()
|
||||||
|
{
|
||||||
|
echo "$hookName: check line lengths ..." 1>&2
|
||||||
|
|
||||||
|
scope=$(gitScope $@)
|
||||||
|
|
||||||
|
badFiles=$(
|
||||||
|
for f in $fileList
|
||||||
|
do
|
||||||
|
# limit to *.[CH] files
|
||||||
|
case "$f" in
|
||||||
|
(*.[CH])
|
||||||
|
# parse line numbers from grep output:
|
||||||
|
# <lineNr>: contents
|
||||||
|
lines=$(git grep -hn -e '^.\{81,\}' \
|
||||||
|
--and --not -e "^ *#" \
|
||||||
|
$scope"$f" |
|
||||||
|
sed -e 's@:.*@@' |
|
||||||
|
tr '\n' ' '
|
||||||
|
)
|
||||||
|
[ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
)
|
||||||
|
|
||||||
|
dieOnBadFiles "Limit code to 80 columns before pushing"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Main code : do all checks
|
||||||
|
#
|
||||||
|
|
||||||
|
while read oldSHA1 newSHA1 refName
|
||||||
|
do
|
||||||
|
unset fileList rawFileList
|
||||||
|
|
||||||
|
if [ "$newSHA1" = 0 ]
|
||||||
|
then
|
||||||
|
# ref to be deleted
|
||||||
|
continue
|
||||||
|
elif [ "$oldSHA1" = 0 ]
|
||||||
|
then
|
||||||
|
# ref to be created
|
||||||
|
rawFileList=$(git diff-tree --root $newSHA1)
|
||||||
|
else
|
||||||
|
# normal changes
|
||||||
|
rawFileList=$(git diff --name-only $oldSHA1..$newSHA1)
|
||||||
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# no files changed: can skip all the checks
|
||||||
|
#
|
||||||
|
[ -n "$rawFileList" ] || continue
|
||||||
|
|
||||||
|
fileList=$(
|
||||||
|
for f in $rawFileList
|
||||||
|
do
|
||||||
|
git cat-file -e $newSHA1:$f > /dev/null 2>&1 && echo "$f"
|
||||||
|
done
|
||||||
|
)
|
||||||
|
|
||||||
|
# check for illegal code, e.g. <TAB>, etc
|
||||||
|
checkIllegalCode $newSHA1
|
||||||
|
|
||||||
|
# ensure OpenCFD copyright contains correct year
|
||||||
|
checkCopyright $newSHA1
|
||||||
|
|
||||||
|
# ensure code conforms to 80 columns max
|
||||||
|
checkLineLengthNonDirective $newSHA1
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
39
etc/apps/scotch/bashrc
Normal file
39
etc/apps/scotch/bashrc
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
#----------------------------------*-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/>.
|
||||||
|
#
|
||||||
|
# File
|
||||||
|
# scotch/bashrc
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Setup file for scotch include/libraries.
|
||||||
|
# Sourced during wmake process only.
|
||||||
|
#
|
||||||
|
# Note
|
||||||
|
# A csh version is not needed, since the values here are only sourced
|
||||||
|
# during the wmake process
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
export SCOTCH_VERSION=scotch_5.1.10b
|
||||||
|
export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$SCOTCH_VERSION
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
12
etc/bashrc
12
etc/bashrc
@ -87,8 +87,7 @@ _foamSource()
|
|||||||
|
|
||||||
|
|
||||||
# Add in preset user or site preferences:
|
# Add in preset user or site preferences:
|
||||||
foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh` && _foamSource $foamPrefs
|
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh`
|
||||||
unset foamPrefs
|
|
||||||
|
|
||||||
# Evaluate command-line parameters
|
# Evaluate command-line parameters
|
||||||
while [ $# -gt 0 ]
|
while [ $# -gt 0 ]
|
||||||
@ -259,13 +258,8 @@ _foamSource $WM_PROJECT_DIR/etc/aliases.sh
|
|||||||
|
|
||||||
# Source user setup files for optional packages
|
# Source user setup files for optional packages
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
paraview3=`$WM_PROJECT_DIR/bin/foamEtcFile apps/paraview3/bashrc` \
|
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile apps/paraview3/bashrc`
|
||||||
&& _foamSource $paraview3
|
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile apps/ensight/bashrc`
|
||||||
unset paraview3
|
|
||||||
|
|
||||||
ensight=`$WM_PROJECT_DIR/bin/foamEtcFile apps/ensight/bashrc` \
|
|
||||||
&& _foamSource $ensight
|
|
||||||
unset ensight
|
|
||||||
|
|
||||||
|
|
||||||
# Clean environment paths again. Only remove duplicates
|
# Clean environment paths again. Only remove duplicates
|
||||||
|
|||||||
21
etc/cshrc
21
etc/cshrc
@ -69,14 +69,10 @@ setenv WM_THIRD_PARTY_DIR $WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION
|
|||||||
|
|
||||||
|
|
||||||
# Source files, possibly with some verbosity
|
# Source files, possibly with some verbosity
|
||||||
alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; source \!*'
|
alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; if (\!* != "") source \!*'
|
||||||
|
|
||||||
# Add in preset user or site preferences:
|
# Add in preset user or site preferences:
|
||||||
set foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh`
|
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh`
|
||||||
if ( $status == 0 ) then
|
|
||||||
_foamSource $foamPrefs
|
|
||||||
endif
|
|
||||||
unset foamPrefs
|
|
||||||
|
|
||||||
# Evaluate command-line parameters
|
# Evaluate command-line parameters
|
||||||
while ( $#argv > 0 )
|
while ( $#argv > 0 )
|
||||||
@ -255,17 +251,8 @@ _foamSource $WM_PROJECT_DIR/etc/aliases.csh
|
|||||||
|
|
||||||
# Source user setup files for optional packages
|
# Source user setup files for optional packages
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
set paraview3=`$WM_PROJECT_DIR/bin/foamEtcFile apps/paraview3/cshrc`
|
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile apps/paraview3/cshrc`
|
||||||
if ( $status == 0 ) then
|
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile apps/ensight/cshrc`
|
||||||
_foamSource $paraview3
|
|
||||||
endif
|
|
||||||
unset paraview3
|
|
||||||
|
|
||||||
set ensight=`$WM_PROJECT_DIR/bin/foamEtcFile apps/ensight/cshrc`
|
|
||||||
if ( $status == 0 ) then
|
|
||||||
_foamSource $ensight
|
|
||||||
endif
|
|
||||||
unset ensight
|
|
||||||
|
|
||||||
|
|
||||||
# Clean environment paths again. Only remove duplicates
|
# Clean environment paths again. Only remove duplicates
|
||||||
|
|||||||
@ -37,6 +37,8 @@ alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH}'
|
|||||||
# prefix to MANPATH
|
# prefix to MANPATH
|
||||||
alias _foamAddMan 'setenv MANPATH \!*\:${MANPATH}'
|
alias _foamAddMan 'setenv MANPATH \!*\:${MANPATH}'
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# location of the jobControl directory
|
# location of the jobControl directory
|
||||||
setenv FOAM_JOB_DIR $WM_PROJECT_INST_DIR/jobControl
|
setenv FOAM_JOB_DIR $WM_PROJECT_INST_DIR/jobControl
|
||||||
|
|
||||||
|
|||||||
@ -60,6 +60,7 @@ _foamAddMan()
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# location of the jobControl directory
|
# location of the jobControl directory
|
||||||
export FOAM_JOB_DIR=$WM_PROJECT_INST_DIR/jobControl
|
export FOAM_JOB_DIR=$WM_PROJECT_INST_DIR/jobControl
|
||||||
|
|||||||
@ -79,7 +79,7 @@ public:
|
|||||||
inline static List<Keyed<T> > createList
|
inline static List<Keyed<T> > createList
|
||||||
(
|
(
|
||||||
const List<T>&,
|
const List<T>&,
|
||||||
const List<label>& keys
|
const labelUList& keys
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -90,13 +90,13 @@ Foam::Keyed<T>::createList(const List<T>& lst, const label key)
|
|||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
inline Foam::List<Foam::Keyed<T> >
|
inline Foam::List<Foam::Keyed<T> >
|
||||||
Foam::Keyed<T>::createList(const List<T>& lst, const List<label>& keys)
|
Foam::Keyed<T>::createList(const List<T>& lst, const labelUList& keys)
|
||||||
{
|
{
|
||||||
if (lst.size() != keys.size())
|
if (lst.size() != keys.size())
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"Foam::Keyed<T>::createList(const List<T>&, const List<label>&)"
|
"Foam::Keyed<T>::createList(const List<T>&, const labelUList&)"
|
||||||
)
|
)
|
||||||
<< "size mismatch adding keys to a list:" << nl
|
<< "size mismatch adding keys to a list:" << nl
|
||||||
<< "List has size " << lst.size()
|
<< "List has size " << lst.size()
|
||||||
|
|||||||
@ -65,7 +65,7 @@ public:
|
|||||||
(
|
(
|
||||||
const UList<T>& posList,
|
const UList<T>& posList,
|
||||||
const UList<T>& negList,
|
const UList<T>& negList,
|
||||||
const UList<label>&
|
const labelUList&
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct given the complete list and by transferring addressing
|
//- Construct given the complete list and by transferring addressing
|
||||||
@ -100,7 +100,7 @@ public:
|
|||||||
// Edit
|
// Edit
|
||||||
|
|
||||||
//- Reset addressing
|
//- Reset addressing
|
||||||
inline void resetAddressing(const UList<label>&);
|
inline void resetAddressing(const labelUList&);
|
||||||
inline void resetAddressing(const Xfer<List<label> >&);
|
inline void resetAddressing(const Xfer<List<label> >&);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ inline Foam::BiIndirectList<T>::BiIndirectList
|
|||||||
(
|
(
|
||||||
const UList<T>& posList,
|
const UList<T>& posList,
|
||||||
const UList<T>& negList,
|
const UList<T>& negList,
|
||||||
const UList<label>& addr
|
const labelUList& addr
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
posList_(const_cast<UList<T>&>(posList)),
|
posList_(const_cast<UList<T>&>(posList)),
|
||||||
@ -94,7 +94,7 @@ inline const Foam::List<Foam::label>& Foam::BiIndirectList<T>::addressing()
|
|||||||
template<class T>
|
template<class T>
|
||||||
inline void Foam::BiIndirectList<T>::resetAddressing
|
inline void Foam::BiIndirectList<T>::resetAddressing
|
||||||
(
|
(
|
||||||
const UList<label>& addr
|
const labelUList& addr
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
addressing_ = addr;
|
addressing_ = addr;
|
||||||
|
|||||||
@ -59,7 +59,7 @@ Foam::CompactListList<T, Container>::CompactListList(const List<Container>& ll)
|
|||||||
template<class T, class Container>
|
template<class T, class Container>
|
||||||
Foam::CompactListList<T, Container>::CompactListList
|
Foam::CompactListList<T, Container>::CompactListList
|
||||||
(
|
(
|
||||||
const UList<label>& rowSizes
|
const labelUList& rowSizes
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
size_(rowSizes.size()),
|
size_(rowSizes.size()),
|
||||||
@ -80,7 +80,7 @@ Foam::CompactListList<T, Container>::CompactListList
|
|||||||
template<class T, class Container>
|
template<class T, class Container>
|
||||||
Foam::CompactListList<T, Container>::CompactListList
|
Foam::CompactListList<T, Container>::CompactListList
|
||||||
(
|
(
|
||||||
const UList<label>& rowSizes,
|
const labelUList& rowSizes,
|
||||||
const T& t
|
const T& t
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
@ -178,7 +178,7 @@ void Foam::CompactListList<T, Container>::setSize
|
|||||||
|
|
||||||
|
|
||||||
template<class T, class Container>
|
template<class T, class Container>
|
||||||
void Foam::CompactListList<T, Container>::setSize(const UList<label>& rowSizes)
|
void Foam::CompactListList<T, Container>::setSize(const labelUList& rowSizes)
|
||||||
{
|
{
|
||||||
size_ = rowSizes.size();
|
size_ = rowSizes.size();
|
||||||
offsets_.setSize(rowSizes.size()+1);
|
offsets_.setSize(rowSizes.size()+1);
|
||||||
|
|||||||
@ -114,10 +114,10 @@ public:
|
|||||||
inline CompactListList(const label nRows, const label nData, const T&);
|
inline CompactListList(const label nRows, const label nData, const T&);
|
||||||
|
|
||||||
//- Construct given list of row-sizes.
|
//- Construct given list of row-sizes.
|
||||||
explicit CompactListList(const UList<label>& rowSizes);
|
explicit CompactListList(const labelUList& rowSizes);
|
||||||
|
|
||||||
//- Construct given list of row-sizes
|
//- Construct given list of row-sizes
|
||||||
CompactListList(const UList<label>& rowSizes, const T&);
|
CompactListList(const labelUList& rowSizes, const T&);
|
||||||
|
|
||||||
//- Construct by transferring the parameter contents
|
//- Construct by transferring the parameter contents
|
||||||
explicit CompactListList(const Xfer<CompactListList<T, Container> >&);
|
explicit CompactListList(const Xfer<CompactListList<T, Container> >&);
|
||||||
@ -168,7 +168,7 @@ public:
|
|||||||
void setSize(const label nRows, const label nData, const T&);
|
void setSize(const label nRows, const label nData, const T&);
|
||||||
|
|
||||||
//- Reset size of CompactListList.
|
//- Reset size of CompactListList.
|
||||||
void setSize(const UList<label>& rowSizes);
|
void setSize(const labelUList& rowSizes);
|
||||||
|
|
||||||
//- Reset size of CompactListList.
|
//- Reset size of CompactListList.
|
||||||
// This form only allows contraction of the CompactListList.
|
// This form only allows contraction of the CompactListList.
|
||||||
@ -181,7 +181,7 @@ public:
|
|||||||
inline void resize(const label nRows, const label nData, const T&);
|
inline void resize(const label nRows, const label nData, const T&);
|
||||||
|
|
||||||
//- Reset size of CompactListList.
|
//- Reset size of CompactListList.
|
||||||
inline void resize(const UList<label>& rowSizes);
|
inline void resize(const labelUList& rowSizes);
|
||||||
|
|
||||||
//- Clear the CompactListList, i.e. set sizes to zero.
|
//- Clear the CompactListList, i.e. set sizes to zero.
|
||||||
void clear();
|
void clear();
|
||||||
|
|||||||
@ -207,7 +207,7 @@ inline void Foam::CompactListList<T, Container>::resize
|
|||||||
template<class T, class Container>
|
template<class T, class Container>
|
||||||
inline void Foam::CompactListList<T, Container>::resize
|
inline void Foam::CompactListList<T, Container>::resize
|
||||||
(
|
(
|
||||||
const UList<label>& rowSizes
|
const labelUList& rowSizes
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this->setSize(rowSizes);
|
this->setSize(rowSizes);
|
||||||
|
|||||||
@ -44,6 +44,7 @@ SourceFiles
|
|||||||
#define DynamicList_H
|
#define DynamicList_H
|
||||||
|
|
||||||
#include "List.H"
|
#include "List.H"
|
||||||
|
#include "StaticAssert.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -78,6 +79,9 @@ class DynamicList
|
|||||||
:
|
:
|
||||||
public List<T>
|
public List<T>
|
||||||
{
|
{
|
||||||
|
//- Avoid invalid sizing parameters
|
||||||
|
StaticAssert((SizeInc || SizeMult) && SizeDiv);
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- The capacity (allocated size) of the underlying list.
|
//- The capacity (allocated size) of the underlying list.
|
||||||
|
|||||||
@ -73,7 +73,7 @@ protected:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct by copying the addressing array
|
//- Construct by copying the addressing array
|
||||||
explicit inline IndirectListAddressing(const UList<label>& addr);
|
explicit inline IndirectListAddressing(const labelUList& addr);
|
||||||
|
|
||||||
//- Construct by transferring addressing array
|
//- Construct by transferring addressing array
|
||||||
explicit inline IndirectListAddressing(const Xfer<List<label> >& addr);
|
explicit inline IndirectListAddressing(const Xfer<List<label> >& addr);
|
||||||
@ -89,7 +89,7 @@ protected:
|
|||||||
// Edit
|
// Edit
|
||||||
|
|
||||||
//- Reset addressing
|
//- Reset addressing
|
||||||
inline void resetAddressing(const UList<label>&);
|
inline void resetAddressing(const labelUList&);
|
||||||
inline void resetAddressing(const Xfer<List<label> >&);
|
inline void resetAddressing(const Xfer<List<label> >&);
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -119,7 +119,7 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct given the complete list and the addressing array
|
//- Construct given the complete list and the addressing array
|
||||||
inline IndirectList(const UList<T>&, const UList<label>&);
|
inline IndirectList(const UList<T>&, const labelUList&);
|
||||||
|
|
||||||
//- Construct given the complete list and by transferring addressing
|
//- Construct given the complete list and by transferring addressing
|
||||||
inline IndirectList(const UList<T>&, const Xfer<List<label> >&);
|
inline IndirectList(const UList<T>&, const Xfer<List<label> >&);
|
||||||
|
|||||||
@ -28,7 +28,7 @@ License
|
|||||||
|
|
||||||
inline Foam::IndirectListAddressing::IndirectListAddressing
|
inline Foam::IndirectListAddressing::IndirectListAddressing
|
||||||
(
|
(
|
||||||
const UList<label>& addr
|
const labelUList& addr
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
addressing_(addr)
|
addressing_(addr)
|
||||||
@ -48,7 +48,7 @@ template<class T>
|
|||||||
inline Foam::IndirectList<T>::IndirectList
|
inline Foam::IndirectList<T>::IndirectList
|
||||||
(
|
(
|
||||||
const UList<T>& completeList,
|
const UList<T>& completeList,
|
||||||
const UList<label>& addr
|
const labelUList& addr
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
IndirectListAddressing(addr),
|
IndirectListAddressing(addr),
|
||||||
@ -117,7 +117,7 @@ Foam::IndirectListAddressing::addressing() const
|
|||||||
|
|
||||||
inline void Foam::IndirectListAddressing::resetAddressing
|
inline void Foam::IndirectListAddressing::resetAddressing
|
||||||
(
|
(
|
||||||
const UList<label>& addr
|
const labelUList& addr
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
addressing_ = addr;
|
addressing_ = addr;
|
||||||
|
|||||||
@ -155,7 +155,7 @@ Foam::List<T>::List(List<T>& a, bool reUse)
|
|||||||
|
|
||||||
// Construct as subset
|
// Construct as subset
|
||||||
template<class T>
|
template<class T>
|
||||||
Foam::List<T>::List(const UList<T>& a, const unallocLabelList& map)
|
Foam::List<T>::List(const UList<T>& a, const labelUList& map)
|
||||||
:
|
:
|
||||||
UList<T>(NULL, map.size())
|
UList<T>(NULL, map.size())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -115,7 +115,7 @@ public:
|
|||||||
List(List<T>&, bool reUse);
|
List(List<T>&, bool reUse);
|
||||||
|
|
||||||
//- Construct as subset.
|
//- Construct as subset.
|
||||||
List(const UList<T>&, const unallocLabelList& mapAddressing);
|
List(const UList<T>&, const labelUList& mapAddressing);
|
||||||
|
|
||||||
//- Construct given start and end iterators.
|
//- Construct given start and end iterators.
|
||||||
template<class InputIterator>
|
template<class InputIterator>
|
||||||
|
|||||||
@ -36,7 +36,7 @@ const Foam::labelList Foam::emptyLabelList = Foam::labelList(0);
|
|||||||
Foam::labelList Foam::invert
|
Foam::labelList Foam::invert
|
||||||
(
|
(
|
||||||
const label len,
|
const label len,
|
||||||
const UList<label>& map
|
const labelUList& map
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
labelList inverse(len, -1);
|
labelList inverse(len, -1);
|
||||||
@ -49,7 +49,7 @@ Foam::labelList Foam::invert
|
|||||||
{
|
{
|
||||||
if (inverse[newPos] >= 0)
|
if (inverse[newPos] >= 0)
|
||||||
{
|
{
|
||||||
FatalErrorIn("invert(const label, const UList<label>&)")
|
FatalErrorIn("invert(const label, const labelUList&)")
|
||||||
<< "Map is not one-to-one. At index " << i
|
<< "Map is not one-to-one. At index " << i
|
||||||
<< " element " << newPos << " has already occurred before"
|
<< " element " << newPos << " has already occurred before"
|
||||||
<< nl << "Please use invertOneToMany instead"
|
<< nl << "Please use invertOneToMany instead"
|
||||||
@ -66,7 +66,7 @@ Foam::labelList Foam::invert
|
|||||||
Foam::labelListList Foam::invertOneToMany
|
Foam::labelListList Foam::invertOneToMany
|
||||||
(
|
(
|
||||||
const label len,
|
const label len,
|
||||||
const UList<label>& map
|
const labelUList& map
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
labelList nElems(len, 0);
|
labelList nElems(len, 0);
|
||||||
|
|||||||
@ -56,23 +56,23 @@ static const List<Type>& emptyList()
|
|||||||
//- Renumber the values (not the indices) of a list.
|
//- Renumber the values (not the indices) of a list.
|
||||||
// Negative ListType elements are left as is.
|
// Negative ListType elements are left as is.
|
||||||
template<class ListType>
|
template<class ListType>
|
||||||
ListType renumber(const UList<label>& oldToNew, const ListType&);
|
ListType renumber(const labelUList& oldToNew, const ListType&);
|
||||||
|
|
||||||
//- Inplace renumber the values of a list.
|
//- Inplace renumber the values of a list.
|
||||||
// Negative ListType elements are left as is.
|
// Negative ListType elements are left as is.
|
||||||
template<class ListType>
|
template<class ListType>
|
||||||
void inplaceRenumber(const UList<label>& oldToNew, ListType&);
|
void inplaceRenumber(const labelUList& oldToNew, ListType&);
|
||||||
|
|
||||||
|
|
||||||
//- Reorder the elements (indices, not values) of a list.
|
//- Reorder the elements (indices, not values) of a list.
|
||||||
// Negative ListType elements are left as is.
|
// Negative ListType elements are left as is.
|
||||||
template<class ListType>
|
template<class ListType>
|
||||||
ListType reorder(const UList<label>& oldToNew, const ListType&);
|
ListType reorder(const labelUList& oldToNew, const ListType&);
|
||||||
|
|
||||||
//- Inplace reorder the elements of a list.
|
//- Inplace reorder the elements of a list.
|
||||||
// Negative ListType elements are left as is.
|
// Negative ListType elements are left as is.
|
||||||
template<class ListType>
|
template<class ListType>
|
||||||
void inplaceReorder(const UList<label>& oldToNew, ListType&);
|
void inplaceReorder(const labelUList& oldToNew, ListType&);
|
||||||
|
|
||||||
|
|
||||||
// Variants to work with iterators and sparse tables.
|
// Variants to work with iterators and sparse tables.
|
||||||
@ -80,11 +80,11 @@ void inplaceReorder(const UList<label>& oldToNew, ListType&);
|
|||||||
|
|
||||||
//- Map values. Do not map negative values.
|
//- Map values. Do not map negative values.
|
||||||
template<class Container>
|
template<class Container>
|
||||||
void inplaceMapValue(const UList<label>& oldToNew, Container&);
|
void inplaceMapValue(const labelUList& oldToNew, Container&);
|
||||||
|
|
||||||
//- Recreate with mapped keys. Do not map elements with negative key.
|
//- Recreate with mapped keys. Do not map elements with negative key.
|
||||||
template<class Container>
|
template<class Container>
|
||||||
void inplaceMapKey(const UList<label>& oldToNew, Container&);
|
void inplaceMapKey(const labelUList& oldToNew, Container&);
|
||||||
|
|
||||||
|
|
||||||
//- Generate the (stable) sort order for the list
|
//- Generate the (stable) sort order for the list
|
||||||
@ -126,10 +126,10 @@ template<class BoolListType, class ListType>
|
|||||||
void inplaceSubset(const BoolListType& select, ListType&);
|
void inplaceSubset(const BoolListType& select, ListType&);
|
||||||
|
|
||||||
//- Invert one-to-one map. Unmapped elements will be -1.
|
//- Invert one-to-one map. Unmapped elements will be -1.
|
||||||
labelList invert(const label len, const UList<label>&);
|
labelList invert(const label len, const labelUList&);
|
||||||
|
|
||||||
//- Invert one-to-many map. Unmapped elements will be size 0.
|
//- Invert one-to-many map. Unmapped elements will be size 0.
|
||||||
labelListList invertOneToMany(const label len, const UList<label>&);
|
labelListList invertOneToMany(const label len, const labelUList&);
|
||||||
|
|
||||||
//- Invert many-to-many.
|
//- Invert many-to-many.
|
||||||
// Input and output types need to be inherited from List.
|
// Input and output types need to be inherited from List.
|
||||||
@ -172,7 +172,7 @@ template<class ListType>
|
|||||||
void setValues
|
void setValues
|
||||||
(
|
(
|
||||||
ListType&,
|
ListType&,
|
||||||
const UList<label>& indices,
|
const labelUList& indices,
|
||||||
typename ListType::const_reference
|
typename ListType::const_reference
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ ListType createWithValues
|
|||||||
(
|
(
|
||||||
const label sz,
|
const label sz,
|
||||||
typename ListType::const_reference initValue,
|
typename ListType::const_reference initValue,
|
||||||
const UList<label>& indices,
|
const labelUList& indices,
|
||||||
typename ListType::const_reference setValue
|
typename ListType::const_reference setValue
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ License
|
|||||||
template<class ListType>
|
template<class ListType>
|
||||||
ListType Foam::renumber
|
ListType Foam::renumber
|
||||||
(
|
(
|
||||||
const UList<label>& oldToNew,
|
const labelUList& oldToNew,
|
||||||
const ListType& lst
|
const ListType& lst
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -55,7 +55,7 @@ ListType Foam::renumber
|
|||||||
template<class ListType>
|
template<class ListType>
|
||||||
void Foam::inplaceRenumber
|
void Foam::inplaceRenumber
|
||||||
(
|
(
|
||||||
const UList<label>& oldToNew,
|
const labelUList& oldToNew,
|
||||||
ListType& lst
|
ListType& lst
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -72,7 +72,7 @@ void Foam::inplaceRenumber
|
|||||||
template<class ListType>
|
template<class ListType>
|
||||||
ListType Foam::reorder
|
ListType Foam::reorder
|
||||||
(
|
(
|
||||||
const UList<label>& oldToNew,
|
const labelUList& oldToNew,
|
||||||
const ListType& lst
|
const ListType& lst
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -100,7 +100,7 @@ ListType Foam::reorder
|
|||||||
template<class ListType>
|
template<class ListType>
|
||||||
void Foam::inplaceReorder
|
void Foam::inplaceReorder
|
||||||
(
|
(
|
||||||
const UList<label>& oldToNew,
|
const labelUList& oldToNew,
|
||||||
ListType& lst
|
ListType& lst
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -129,7 +129,7 @@ void Foam::inplaceReorder
|
|||||||
template<class Container>
|
template<class Container>
|
||||||
void Foam::inplaceMapValue
|
void Foam::inplaceMapValue
|
||||||
(
|
(
|
||||||
const UList<label>& oldToNew,
|
const labelUList& oldToNew,
|
||||||
Container& lst
|
Container& lst
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -151,7 +151,7 @@ void Foam::inplaceMapValue
|
|||||||
template<class Container>
|
template<class Container>
|
||||||
void Foam::inplaceMapKey
|
void Foam::inplaceMapKey
|
||||||
(
|
(
|
||||||
const UList<label>& oldToNew,
|
const labelUList& oldToNew,
|
||||||
Container& lst
|
Container& lst
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -483,7 +483,7 @@ template<class ListType>
|
|||||||
void Foam::setValues
|
void Foam::setValues
|
||||||
(
|
(
|
||||||
ListType& l,
|
ListType& l,
|
||||||
const UList<label>& indices,
|
const labelUList& indices,
|
||||||
typename ListType::const_reference t
|
typename ListType::const_reference t
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -499,7 +499,7 @@ ListType Foam::createWithValues
|
|||||||
(
|
(
|
||||||
const label sz,
|
const label sz,
|
||||||
const typename ListType::const_reference initValue,
|
const typename ListType::const_reference initValue,
|
||||||
const UList<label>& indices,
|
const labelUList& indices,
|
||||||
typename ListType::const_reference setValue
|
typename ListType::const_reference setValue
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -188,7 +188,7 @@ void Foam::PackedBoolList::set(const PackedList<1>& lst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::PackedBoolList::set(const UList<label>& indices)
|
Foam::label Foam::PackedBoolList::set(const labelUList& indices)
|
||||||
{
|
{
|
||||||
return setIndices(indices);
|
return setIndices(indices);
|
||||||
}
|
}
|
||||||
@ -216,7 +216,7 @@ void Foam::PackedBoolList::unset(const PackedList<1>& lst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::PackedBoolList::unset(const UList<label>& indices)
|
Foam::label Foam::PackedBoolList::unset(const labelUList& indices)
|
||||||
{
|
{
|
||||||
return unsetIndices(indices);
|
return unsetIndices(indices);
|
||||||
}
|
}
|
||||||
@ -249,7 +249,7 @@ void Foam::PackedBoolList::subset(const PackedList<1>& lst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::PackedBoolList::subset(const UList<label>& indices)
|
Foam::label Foam::PackedBoolList::subset(const labelUList& indices)
|
||||||
{
|
{
|
||||||
return subsetIndices(indices);
|
return subsetIndices(indices);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -119,7 +119,7 @@ public:
|
|||||||
|
|
||||||
//- Construct from a list of labels
|
//- Construct from a list of labels
|
||||||
// using the labels as indices to indicate which bits are set
|
// using the labels as indices to indicate which bits are set
|
||||||
explicit inline PackedBoolList(const UList<label>& indices);
|
explicit inline PackedBoolList(const labelUList& indices);
|
||||||
|
|
||||||
//- Construct from a list of labels
|
//- Construct from a list of labels
|
||||||
// using the labels as indices to indicate which bits are set
|
// using the labels as indices to indicate which bits are set
|
||||||
@ -141,7 +141,7 @@ public:
|
|||||||
|
|
||||||
//- Set the listed indices. Return number of elements changed.
|
//- Set the listed indices. Return number of elements changed.
|
||||||
// Does auto-vivify for non-existent entries.
|
// Does auto-vivify for non-existent entries.
|
||||||
label set(const UList<label>& indices);
|
label set(const labelUList& indices);
|
||||||
|
|
||||||
//- Set the listed indices. Return number of elements changed.
|
//- Set the listed indices. Return number of elements changed.
|
||||||
// Does auto-vivify for non-existent entries.
|
// Does auto-vivify for non-existent entries.
|
||||||
@ -152,7 +152,7 @@ public:
|
|||||||
|
|
||||||
//- Unset the listed indices. Return number of elements changed.
|
//- Unset the listed indices. Return number of elements changed.
|
||||||
// Never auto-vivify entries.
|
// Never auto-vivify entries.
|
||||||
label unset(const UList<label>& indices);
|
label unset(const labelUList& indices);
|
||||||
|
|
||||||
//- Unset the listed indices. Return number of elements changed.
|
//- Unset the listed indices. Return number of elements changed.
|
||||||
// Never auto-vivify entries.
|
// Never auto-vivify entries.
|
||||||
@ -163,7 +163,7 @@ public:
|
|||||||
|
|
||||||
//- Subset with the listed indices.
|
//- Subset with the listed indices.
|
||||||
// Return number of elements subsetted.
|
// Return number of elements subsetted.
|
||||||
label subset(const UList<label>& indices);
|
label subset(const labelUList& indices);
|
||||||
|
|
||||||
//- Subset with the listed indices.
|
//- Subset with the listed indices.
|
||||||
// Return number of elements subsetted.
|
// Return number of elements subsetted.
|
||||||
@ -204,7 +204,7 @@ public:
|
|||||||
|
|
||||||
//- Assignment operator,
|
//- Assignment operator,
|
||||||
// using the labels as indices to indicate which bits are set
|
// using the labels as indices to indicate which bits are set
|
||||||
inline PackedBoolList& operator=(const UList<label>& indices);
|
inline PackedBoolList& operator=(const labelUList& indices);
|
||||||
|
|
||||||
//- Assignment operator,
|
//- Assignment operator,
|
||||||
// using the labels as indices to indicate which bits are set
|
// using the labels as indices to indicate which bits are set
|
||||||
@ -218,7 +218,7 @@ public:
|
|||||||
|
|
||||||
//- And operator (lists may be dissimilar sizes)
|
//- And operator (lists may be dissimilar sizes)
|
||||||
// using the labels as indices to indicate which bits are set
|
// using the labels as indices to indicate which bits are set
|
||||||
inline PackedBoolList& operator&=(const UList<label>& indices);
|
inline PackedBoolList& operator&=(const labelUList& indices);
|
||||||
|
|
||||||
//- And operator (lists may be dissimilar sizes)
|
//- And operator (lists may be dissimilar sizes)
|
||||||
// using the labels as indices to indicate which bits are set
|
// using the labels as indices to indicate which bits are set
|
||||||
@ -233,7 +233,7 @@ public:
|
|||||||
|
|
||||||
//- Or operator (lists may be dissimilar sizes),
|
//- Or operator (lists may be dissimilar sizes),
|
||||||
// using the labels as indices to indicate which bits are set
|
// using the labels as indices to indicate which bits are set
|
||||||
inline PackedBoolList& operator|=(const UList<label>& indices);
|
inline PackedBoolList& operator|=(const labelUList& indices);
|
||||||
|
|
||||||
//- Or operator (lists may be dissimilar sizes),
|
//- Or operator (lists may be dissimilar sizes),
|
||||||
// using the labels as indices to indicate which bits are set
|
// using the labels as indices to indicate which bits are set
|
||||||
@ -244,7 +244,7 @@ public:
|
|||||||
inline PackedBoolList& operator+=(const PackedList<1>&);
|
inline PackedBoolList& operator+=(const PackedList<1>&);
|
||||||
|
|
||||||
//- Add entries to this list, synonymous with the or operator
|
//- Add entries to this list, synonymous with the or operator
|
||||||
inline PackedBoolList& operator+=(const UList<label>& indices);
|
inline PackedBoolList& operator+=(const labelUList& indices);
|
||||||
|
|
||||||
//- Add entries to this list, synonymous with the or operator
|
//- Add entries to this list, synonymous with the or operator
|
||||||
inline PackedBoolList& operator+=(const UIndirectList<label>&);
|
inline PackedBoolList& operator+=(const UIndirectList<label>&);
|
||||||
@ -253,7 +253,7 @@ public:
|
|||||||
inline PackedBoolList& operator-=(const PackedList<1>&);
|
inline PackedBoolList& operator-=(const PackedList<1>&);
|
||||||
|
|
||||||
//- Remove entries from this list - unset the specified bits
|
//- Remove entries from this list - unset the specified bits
|
||||||
inline PackedBoolList& operator-=(const UList<label>& indices);
|
inline PackedBoolList& operator-=(const labelUList& indices);
|
||||||
|
|
||||||
//- Remove entries from this list - unset the specified bits
|
//- Remove entries from this list - unset the specified bits
|
||||||
inline PackedBoolList& operator-=(const UIndirectList<label>&);
|
inline PackedBoolList& operator-=(const UIndirectList<label>&);
|
||||||
|
|||||||
@ -81,7 +81,7 @@ inline Foam::PackedBoolList::PackedBoolList(const UList<bool>& lst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Foam::PackedBoolList::PackedBoolList(const UList<label>& indices)
|
inline Foam::PackedBoolList::PackedBoolList(const labelUList& indices)
|
||||||
:
|
:
|
||||||
PackedList<1>(indices.size(), 0u)
|
PackedList<1>(indices.size(), 0u)
|
||||||
{
|
{
|
||||||
@ -151,7 +151,7 @@ Foam::PackedBoolList::operator=(const PackedList<1>& lst)
|
|||||||
|
|
||||||
|
|
||||||
inline Foam::PackedBoolList&
|
inline Foam::PackedBoolList&
|
||||||
Foam::PackedBoolList::operator=(const UList<label>& indices)
|
Foam::PackedBoolList::operator=(const labelUList& indices)
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
set(indices);
|
set(indices);
|
||||||
@ -189,7 +189,7 @@ Foam::PackedBoolList::operator&=(const PackedList<1>& lst)
|
|||||||
|
|
||||||
|
|
||||||
inline Foam::PackedBoolList&
|
inline Foam::PackedBoolList&
|
||||||
Foam::PackedBoolList::operator&=(const UList<label>& indices)
|
Foam::PackedBoolList::operator&=(const labelUList& indices)
|
||||||
{
|
{
|
||||||
subset(indices);
|
subset(indices);
|
||||||
return *this;
|
return *this;
|
||||||
@ -213,7 +213,7 @@ Foam::PackedBoolList::operator|=(const PackedList<1>& lst)
|
|||||||
|
|
||||||
|
|
||||||
inline Foam::PackedBoolList&
|
inline Foam::PackedBoolList&
|
||||||
Foam::PackedBoolList::operator|=(const UList<label>& indices)
|
Foam::PackedBoolList::operator|=(const labelUList& indices)
|
||||||
{
|
{
|
||||||
set(indices);
|
set(indices);
|
||||||
return *this;
|
return *this;
|
||||||
@ -236,7 +236,7 @@ Foam::PackedBoolList::operator+=(const PackedList<1>& lst)
|
|||||||
|
|
||||||
|
|
||||||
inline Foam::PackedBoolList&
|
inline Foam::PackedBoolList&
|
||||||
Foam::PackedBoolList::operator+=(const UList<label>& indices)
|
Foam::PackedBoolList::operator+=(const labelUList& indices)
|
||||||
{
|
{
|
||||||
return operator|=(indices);
|
return operator|=(indices);
|
||||||
}
|
}
|
||||||
@ -258,7 +258,7 @@ Foam::PackedBoolList::operator-=(const PackedList<1>& lst)
|
|||||||
|
|
||||||
|
|
||||||
inline Foam::PackedBoolList&
|
inline Foam::PackedBoolList&
|
||||||
Foam::PackedBoolList::operator-=(const UList<label>& indices)
|
Foam::PackedBoolList::operator-=(const labelUList& indices)
|
||||||
{
|
{
|
||||||
unset(indices);
|
unset(indices);
|
||||||
return *this;
|
return *this;
|
||||||
|
|||||||
@ -536,7 +536,7 @@ Foam::PackedList<nBits>::operator=(const PackedList<nBits>& lst)
|
|||||||
|
|
||||||
template<unsigned nBits>
|
template<unsigned nBits>
|
||||||
Foam::PackedList<nBits>&
|
Foam::PackedList<nBits>&
|
||||||
Foam::PackedList<nBits>::operator=(const UList<label>& lst)
|
Foam::PackedList<nBits>::operator=(const labelUList& lst)
|
||||||
{
|
{
|
||||||
setCapacity(lst.size());
|
setCapacity(lst.size());
|
||||||
size_ = lst.size();
|
size_ = lst.size();
|
||||||
|
|||||||
@ -229,7 +229,7 @@ public:
|
|||||||
inline PackedList(const Xfer<PackedList<nBits> >&);
|
inline PackedList(const Xfer<PackedList<nBits> >&);
|
||||||
|
|
||||||
//- Construct from a list of labels
|
//- Construct from a list of labels
|
||||||
explicit inline PackedList(const UList<label>&);
|
explicit inline PackedList(const labelUList&);
|
||||||
|
|
||||||
//- Construct from an indirect list of labels
|
//- Construct from an indirect list of labels
|
||||||
explicit inline PackedList(const UIndirectList<label>&);
|
explicit inline PackedList(const UIndirectList<label>&);
|
||||||
@ -404,7 +404,7 @@ public:
|
|||||||
PackedList<nBits>& operator=(const PackedList<nBits>&);
|
PackedList<nBits>& operator=(const PackedList<nBits>&);
|
||||||
|
|
||||||
//- Assignment operator.
|
//- Assignment operator.
|
||||||
PackedList<nBits>& operator=(const UList<label>&);
|
PackedList<nBits>& operator=(const labelUList&);
|
||||||
|
|
||||||
//- Assignment operator.
|
//- Assignment operator.
|
||||||
PackedList<nBits>& operator=(const UIndirectList<label>&);
|
PackedList<nBits>& operator=(const UIndirectList<label>&);
|
||||||
|
|||||||
@ -237,7 +237,7 @@ inline Foam::PackedList<nBits>::PackedList(const Xfer<PackedList<nBits> >& lst)
|
|||||||
|
|
||||||
|
|
||||||
template<unsigned nBits>
|
template<unsigned nBits>
|
||||||
inline Foam::PackedList<nBits>::PackedList(const UList<label>& lst)
|
inline Foam::PackedList<nBits>::PackedList(const labelUList& lst)
|
||||||
:
|
:
|
||||||
PackedListCore(),
|
PackedListCore(),
|
||||||
StorageList(packedLength(lst.size()), 0u),
|
StorageList(packedLength(lst.size()), 0u),
|
||||||
|
|||||||
@ -204,11 +204,11 @@ void Foam::PtrList<T>::transfer(PtrList<T>& a)
|
|||||||
|
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
void Foam::PtrList<T>::reorder(const UList<label>& oldToNew)
|
void Foam::PtrList<T>::reorder(const labelUList& oldToNew)
|
||||||
{
|
{
|
||||||
if (oldToNew.size() != size())
|
if (oldToNew.size() != size())
|
||||||
{
|
{
|
||||||
FatalErrorIn("PtrList<T>::reorder(const UList<label>&)")
|
FatalErrorIn("PtrList<T>::reorder(const labelUList&)")
|
||||||
<< "Size of map (" << oldToNew.size()
|
<< "Size of map (" << oldToNew.size()
|
||||||
<< ") not equal to list size (" << size()
|
<< ") not equal to list size (" << size()
|
||||||
<< ")." << abort(FatalError);
|
<< ")." << abort(FatalError);
|
||||||
@ -222,7 +222,7 @@ void Foam::PtrList<T>::reorder(const UList<label>& oldToNew)
|
|||||||
|
|
||||||
if (newI < 0 || newI >= size())
|
if (newI < 0 || newI >= size())
|
||||||
{
|
{
|
||||||
FatalErrorIn("PtrList<T>::reorder(const UList<label>&)")
|
FatalErrorIn("PtrList<T>::reorder(const labelUList&)")
|
||||||
<< "Illegal index " << newI << nl
|
<< "Illegal index " << newI << nl
|
||||||
<< "Valid indices are 0.." << size()-1
|
<< "Valid indices are 0.." << size()-1
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
@ -230,7 +230,7 @@ void Foam::PtrList<T>::reorder(const UList<label>& oldToNew)
|
|||||||
|
|
||||||
if (newPtrs_[newI])
|
if (newPtrs_[newI])
|
||||||
{
|
{
|
||||||
FatalErrorIn("PtrList<T>::reorder(const UList<label>&)")
|
FatalErrorIn("PtrList<T>::reorder(const labelUList&)")
|
||||||
<< "reorder map is not unique; element " << newI
|
<< "reorder map is not unique; element " << newI
|
||||||
<< " already set." << abort(FatalError);
|
<< " already set." << abort(FatalError);
|
||||||
}
|
}
|
||||||
@ -241,7 +241,7 @@ void Foam::PtrList<T>::reorder(const UList<label>& oldToNew)
|
|||||||
{
|
{
|
||||||
if (!newPtrs_[i])
|
if (!newPtrs_[i])
|
||||||
{
|
{
|
||||||
FatalErrorIn("PtrList<T>::reorder(const UList<label>&)")
|
FatalErrorIn("PtrList<T>::reorder(const labelUList&)")
|
||||||
<< "Element " << i << " not set after reordering." << nl
|
<< "Element " << i << " not set after reordering." << nl
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -208,7 +208,7 @@ public:
|
|||||||
//- Reorders elements. Ordering does not have to be done in
|
//- Reorders elements. Ordering does not have to be done in
|
||||||
// ascending or descending order. Reordering has to be unique.
|
// ascending or descending order. Reordering has to be unique.
|
||||||
// (is shuffle)
|
// (is shuffle)
|
||||||
void reorder(const UList<label>&);
|
void reorder(const labelUList&);
|
||||||
|
|
||||||
|
|
||||||
// Member operators
|
// Member operators
|
||||||
|
|||||||
@ -58,7 +58,7 @@ class UIndirectList
|
|||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
UList<T>& completeList_;
|
UList<T>& completeList_;
|
||||||
const UList<label>& addressing_;
|
const labelUList& addressing_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -66,7 +66,7 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct given the complete list and the addressing array
|
//- Construct given the complete list and the addressing array
|
||||||
inline UIndirectList(const UList<T>&, const UList<label>&);
|
inline UIndirectList(const UList<T>&, const labelUList&);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -29,7 +29,7 @@ template<class T>
|
|||||||
inline Foam::UIndirectList<T>::UIndirectList
|
inline Foam::UIndirectList<T>::UIndirectList
|
||||||
(
|
(
|
||||||
const UList<T>& completeList,
|
const UList<T>& completeList,
|
||||||
const UList<label>& addr
|
const labelUList& addr
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
completeList_(const_cast<UList<T>&>(completeList)),
|
completeList_(const_cast<UList<T>&>(completeList)),
|
||||||
|
|||||||
@ -145,6 +145,13 @@ void Foam::stableSort(UList<T>& a, const Cmp& cmp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
void Foam::shuffle(UList<T>& a)
|
||||||
|
{
|
||||||
|
std::random_shuffle(a.begin(), a.end());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
|
|||||||
@ -344,6 +344,9 @@ void stableSort(UList<T>&);
|
|||||||
template<class T, class Cmp>
|
template<class T, class Cmp>
|
||||||
void stableSort(UList<T>&, const Cmp&);
|
void stableSort(UList<T>&, const Cmp&);
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
void shuffle(UList<T>&);
|
||||||
|
|
||||||
// Reverse the first n elements of the list
|
// Reverse the first n elements of the list
|
||||||
template<class T>
|
template<class T>
|
||||||
inline void reverse(UList<T>&, const label n);
|
inline void reverse(UList<T>&, const label n);
|
||||||
|
|||||||
@ -100,11 +100,11 @@ void Foam::UPtrList<T>::transfer(UPtrList<T>& a)
|
|||||||
|
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
void Foam::UPtrList<T>::reorder(const UList<label>& oldToNew)
|
void Foam::UPtrList<T>::reorder(const labelUList& oldToNew)
|
||||||
{
|
{
|
||||||
if (oldToNew.size() != size())
|
if (oldToNew.size() != size())
|
||||||
{
|
{
|
||||||
FatalErrorIn("UPtrList<T>::reorder(const UList<label>&)")
|
FatalErrorIn("UPtrList<T>::reorder(const labelUList&)")
|
||||||
<< "Size of map (" << oldToNew.size()
|
<< "Size of map (" << oldToNew.size()
|
||||||
<< ") not equal to list size (" << size()
|
<< ") not equal to list size (" << size()
|
||||||
<< ")." << abort(FatalError);
|
<< ")." << abort(FatalError);
|
||||||
@ -118,7 +118,7 @@ void Foam::UPtrList<T>::reorder(const UList<label>& oldToNew)
|
|||||||
|
|
||||||
if (newI < 0 || newI >= size())
|
if (newI < 0 || newI >= size())
|
||||||
{
|
{
|
||||||
FatalErrorIn("UPtrList<T>::reorder(const UList<label>&)")
|
FatalErrorIn("UPtrList<T>::reorder(const labelUList&)")
|
||||||
<< "Illegal index " << newI << nl
|
<< "Illegal index " << newI << nl
|
||||||
<< "Valid indices are 0.." << size()-1
|
<< "Valid indices are 0.." << size()-1
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
@ -126,7 +126,7 @@ void Foam::UPtrList<T>::reorder(const UList<label>& oldToNew)
|
|||||||
|
|
||||||
if (newPtrs_[newI])
|
if (newPtrs_[newI])
|
||||||
{
|
{
|
||||||
FatalErrorIn("UPtrList<T>::reorder(const UList<label>&)")
|
FatalErrorIn("UPtrList<T>::reorder(const labelUList&)")
|
||||||
<< "reorder map is not unique; element " << newI
|
<< "reorder map is not unique; element " << newI
|
||||||
<< " already set." << abort(FatalError);
|
<< " already set." << abort(FatalError);
|
||||||
}
|
}
|
||||||
@ -137,7 +137,7 @@ void Foam::UPtrList<T>::reorder(const UList<label>& oldToNew)
|
|||||||
{
|
{
|
||||||
if (!newPtrs_[i])
|
if (!newPtrs_[i])
|
||||||
{
|
{
|
||||||
FatalErrorIn("UPtrList<T>::reorder(const UList<label>&)")
|
FatalErrorIn("UPtrList<T>::reorder(const labelUList&)")
|
||||||
<< "Element " << i << " not set after reordering." << nl
|
<< "Element " << i << " not set after reordering." << nl
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -171,7 +171,7 @@ public:
|
|||||||
//- Reorders elements. Ordering does not have to be done in
|
//- Reorders elements. Ordering does not have to be done in
|
||||||
// ascending or descending order. Reordering has to be unique.
|
// ascending or descending order. Reordering has to be unique.
|
||||||
// (is shuffle)
|
// (is shuffle)
|
||||||
void reorder(const UList<label>&);
|
void reorder(const labelUList&);
|
||||||
|
|
||||||
|
|
||||||
// Member operators
|
// Member operators
|
||||||
|
|||||||
@ -37,6 +37,7 @@ SourceFiles
|
|||||||
#define DynamicField_H
|
#define DynamicField_H
|
||||||
|
|
||||||
#include "Field.H"
|
#include "Field.H"
|
||||||
|
#include "StaticAssert.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -71,6 +72,9 @@ class DynamicField
|
|||||||
:
|
:
|
||||||
public Field<T>
|
public Field<T>
|
||||||
{
|
{
|
||||||
|
//- Avoid invalid sizing parameters
|
||||||
|
StaticAssert((SizeInc || SizeMult) && SizeDiv);
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- The capacity (allocated size) of the underlying field.
|
//- The capacity (allocated size) of the underlying field.
|
||||||
|
|||||||
@ -66,7 +66,7 @@ template<class Type>
|
|||||||
Field<Type>::Field
|
Field<Type>::Field
|
||||||
(
|
(
|
||||||
const UList<Type>& mapF,
|
const UList<Type>& mapF,
|
||||||
const UList<label>& mapAddressing
|
const labelUList& mapAddressing
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
List<Type>(mapAddressing.size())
|
List<Type>(mapAddressing.size())
|
||||||
@ -78,7 +78,7 @@ template<class Type>
|
|||||||
Field<Type>::Field
|
Field<Type>::Field
|
||||||
(
|
(
|
||||||
const tmp<Field<Type> >& tmapF,
|
const tmp<Field<Type> >& tmapF,
|
||||||
const UList<label>& mapAddressing
|
const labelUList& mapAddressing
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
List<Type>(mapAddressing.size())
|
List<Type>(mapAddressing.size())
|
||||||
@ -297,7 +297,7 @@ template<class Type>
|
|||||||
void Field<Type>::map
|
void Field<Type>::map
|
||||||
(
|
(
|
||||||
const UList<Type>& mapF,
|
const UList<Type>& mapF,
|
||||||
const UList<label>& mapAddressing
|
const labelUList& mapAddressing
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Field<Type>& f = *this;
|
Field<Type>& f = *this;
|
||||||
@ -326,7 +326,7 @@ template<class Type>
|
|||||||
void Field<Type>::map
|
void Field<Type>::map
|
||||||
(
|
(
|
||||||
const tmp<Field<Type> >& tmapF,
|
const tmp<Field<Type> >& tmapF,
|
||||||
const UList<label>& mapAddressing
|
const labelUList& mapAddressing
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
map(tmapF(), mapAddressing);
|
map(tmapF(), mapAddressing);
|
||||||
@ -455,7 +455,7 @@ template<class Type>
|
|||||||
void Field<Type>::rmap
|
void Field<Type>::rmap
|
||||||
(
|
(
|
||||||
const UList<Type>& mapF,
|
const UList<Type>& mapF,
|
||||||
const UList<label>& mapAddressing
|
const labelUList& mapAddressing
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Field<Type>& f = *this;
|
Field<Type>& f = *this;
|
||||||
@ -475,7 +475,7 @@ template<class Type>
|
|||||||
void Field<Type>::rmap
|
void Field<Type>::rmap
|
||||||
(
|
(
|
||||||
const tmp<Field<Type> >& tmapF,
|
const tmp<Field<Type> >& tmapF,
|
||||||
const UList<label>& mapAddressing
|
const labelUList& mapAddressing
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
rmap(tmapF(), mapAddressing);
|
rmap(tmapF(), mapAddressing);
|
||||||
@ -487,7 +487,7 @@ template<class Type>
|
|||||||
void Field<Type>::rmap
|
void Field<Type>::rmap
|
||||||
(
|
(
|
||||||
const UList<Type>& mapF,
|
const UList<Type>& mapF,
|
||||||
const UList<label>& mapAddressing,
|
const labelUList& mapAddressing,
|
||||||
const UList<scalar>& mapWeights
|
const UList<scalar>& mapWeights
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -505,7 +505,7 @@ template<class Type>
|
|||||||
void Field<Type>::rmap
|
void Field<Type>::rmap
|
||||||
(
|
(
|
||||||
const tmp<Field<Type> >& tmapF,
|
const tmp<Field<Type> >& tmapF,
|
||||||
const UList<label>& mapAddressing,
|
const labelUList& mapAddressing,
|
||||||
const UList<scalar>& mapWeights
|
const UList<scalar>& mapWeights
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -127,14 +127,14 @@ public:
|
|||||||
Field
|
Field
|
||||||
(
|
(
|
||||||
const UList<Type>& mapF,
|
const UList<Type>& mapF,
|
||||||
const UList<label>& mapAddressing
|
const labelUList& mapAddressing
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct by 1 to 1 mapping from the given tmp field
|
//- Construct by 1 to 1 mapping from the given tmp field
|
||||||
Field
|
Field
|
||||||
(
|
(
|
||||||
const tmp<Field<Type> >& tmapF,
|
const tmp<Field<Type> >& tmapF,
|
||||||
const UList<label>& mapAddressing
|
const labelUList& mapAddressing
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct by interpolative mapping from the given field
|
//- Construct by interpolative mapping from the given field
|
||||||
@ -208,14 +208,14 @@ public:
|
|||||||
void map
|
void map
|
||||||
(
|
(
|
||||||
const UList<Type>& mapF,
|
const UList<Type>& mapF,
|
||||||
const UList<label>& mapAddressing
|
const labelUList& mapAddressing
|
||||||
);
|
);
|
||||||
|
|
||||||
//- 1 to 1 map from the given tmp field
|
//- 1 to 1 map from the given tmp field
|
||||||
void map
|
void map
|
||||||
(
|
(
|
||||||
const tmp<Field<Type> >& tmapF,
|
const tmp<Field<Type> >& tmapF,
|
||||||
const UList<label>& mapAddressing
|
const labelUList& mapAddressing
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Interpolative map from the given field
|
//- Interpolative map from the given field
|
||||||
@ -258,21 +258,21 @@ public:
|
|||||||
void rmap
|
void rmap
|
||||||
(
|
(
|
||||||
const UList<Type>& mapF,
|
const UList<Type>& mapF,
|
||||||
const UList<label>& mapAddressing
|
const labelUList& mapAddressing
|
||||||
);
|
);
|
||||||
|
|
||||||
//- 1 to 1 reverse-map from the given tmp field
|
//- 1 to 1 reverse-map from the given tmp field
|
||||||
void rmap
|
void rmap
|
||||||
(
|
(
|
||||||
const tmp<Field<Type> >& tmapF,
|
const tmp<Field<Type> >& tmapF,
|
||||||
const UList<label>& mapAddressing
|
const labelUList& mapAddressing
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Interpolative reverse map from the given field
|
//- Interpolative reverse map from the given field
|
||||||
void rmap
|
void rmap
|
||||||
(
|
(
|
||||||
const UList<Type>& mapF,
|
const UList<Type>& mapF,
|
||||||
const UList<label>& mapAddressing,
|
const labelUList& mapAddressing,
|
||||||
const UList<scalar>& weights
|
const UList<scalar>& weights
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -280,7 +280,7 @@ public:
|
|||||||
void rmap
|
void rmap
|
||||||
(
|
(
|
||||||
const tmp<Field<Type> >& tmapF,
|
const tmp<Field<Type> >& tmapF,
|
||||||
const UList<label>& mapAddressing,
|
const labelUList& mapAddressing,
|
||||||
const UList<scalar>& weights
|
const UList<scalar>& weights
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -64,13 +64,13 @@ public:
|
|||||||
|
|
||||||
virtual bool direct() const = 0;
|
virtual bool direct() const = 0;
|
||||||
|
|
||||||
virtual const unallocLabelList& directAddressing() const
|
virtual const labelUList& directAddressing() const
|
||||||
{
|
{
|
||||||
FatalErrorIn("FieldMapper::directAddressing() const")
|
FatalErrorIn("FieldMapper::directAddressing() const")
|
||||||
<< "attempt to access null direct addressing"
|
<< "attempt to access null direct addressing"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
|
|
||||||
return unallocLabelList::null();
|
return labelUList::null();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const labelListList& addressing() const
|
virtual const labelListList& addressing() const
|
||||||
|
|||||||
@ -52,7 +52,7 @@ template<>
|
|||||||
void component
|
void component
|
||||||
(
|
(
|
||||||
labelField& lf,
|
labelField& lf,
|
||||||
const UList<label>& f,
|
const labelUList& f,
|
||||||
const direction
|
const direction
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -60,7 +60,7 @@ void component
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
void labelField::replace(const direction, const UList<label>& lf)
|
void labelField::replace(const direction, const labelUList& lf)
|
||||||
{
|
{
|
||||||
*this = lf;
|
*this = lf;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,12 +61,12 @@ template<>
|
|||||||
void component
|
void component
|
||||||
(
|
(
|
||||||
labelField& lf,
|
labelField& lf,
|
||||||
const UList<label>& f,
|
const labelUList& f,
|
||||||
const direction
|
const direction
|
||||||
);
|
);
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
void labelField::replace(const direction, const UList<label>& lf);
|
void labelField::replace(const direction, const labelUList& lf);
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -70,7 +70,7 @@ void transformList(const tensorField&, EdgeMap<T>&);
|
|||||||
|
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
inline void transformList(const tensorField&, UList<label>&)
|
inline void transformList(const tensorField&, labelUList&)
|
||||||
{}
|
{}
|
||||||
template<>
|
template<>
|
||||||
inline void transformList(const tensorField&, Map<label>&)
|
inline void transformList(const tensorField&, Map<label>&)
|
||||||
|
|||||||
@ -42,7 +42,7 @@ void Foam::lduAddressing::calcLosort() const
|
|||||||
// and resizing list
|
// and resizing list
|
||||||
labelList nNbrOfFace(size(), 0);
|
labelList nNbrOfFace(size(), 0);
|
||||||
|
|
||||||
const unallocLabelList& nbr = upperAddr();
|
const labelUList& nbr = upperAddr();
|
||||||
|
|
||||||
forAll(nbr, nbrI)
|
forAll(nbr, nbrI)
|
||||||
{
|
{
|
||||||
@ -181,7 +181,7 @@ Foam::lduAddressing::~lduAddressing()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const Foam::unallocLabelList& Foam::lduAddressing::losortAddr() const
|
const Foam::labelUList& Foam::lduAddressing::losortAddr() const
|
||||||
{
|
{
|
||||||
if (!losortPtr_)
|
if (!losortPtr_)
|
||||||
{
|
{
|
||||||
@ -192,7 +192,7 @@ const Foam::unallocLabelList& Foam::lduAddressing::losortAddr() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const Foam::unallocLabelList& Foam::lduAddressing::ownerStartAddr() const
|
const Foam::labelUList& Foam::lduAddressing::ownerStartAddr() const
|
||||||
{
|
{
|
||||||
if (!ownerStartPtr_)
|
if (!ownerStartPtr_)
|
||||||
{
|
{
|
||||||
@ -203,7 +203,7 @@ const Foam::unallocLabelList& Foam::lduAddressing::ownerStartAddr() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const Foam::unallocLabelList& Foam::lduAddressing::losortStartAddr() const
|
const Foam::labelUList& Foam::lduAddressing::losortStartAddr() const
|
||||||
{
|
{
|
||||||
if (!losortStartPtr_)
|
if (!losortStartPtr_)
|
||||||
{
|
{
|
||||||
@ -225,7 +225,7 @@ Foam::label Foam::lduAddressing::triIndex(const label a, const label b) const
|
|||||||
|
|
||||||
label endLabel = ownerStartAddr()[own + 1];
|
label endLabel = ownerStartAddr()[own + 1];
|
||||||
|
|
||||||
const unallocLabelList& neighbour = upperAddr();
|
const labelUList& neighbour = upperAddr();
|
||||||
|
|
||||||
for (label i = startLabel; i < endLabel; i++)
|
for (label i = startLabel; i < endLabel; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -171,13 +171,13 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return lower addressing
|
//- Return lower addressing
|
||||||
virtual const unallocLabelList& lowerAddr() const = 0;
|
virtual const labelUList& lowerAddr() const = 0;
|
||||||
|
|
||||||
//- Return upper addressing
|
//- Return upper addressing
|
||||||
virtual const unallocLabelList& upperAddr() const = 0;
|
virtual const labelUList& upperAddr() const = 0;
|
||||||
|
|
||||||
//- Return patch to internal addressing given patch number
|
//- Return patch to internal addressing given patch number
|
||||||
virtual const unallocLabelList& patchAddr
|
virtual const labelUList& patchAddr
|
||||||
(
|
(
|
||||||
const label patchNo
|
const label patchNo
|
||||||
) const = 0;
|
) const = 0;
|
||||||
@ -186,13 +186,13 @@ public:
|
|||||||
virtual const lduSchedule& patchSchedule() const = 0;
|
virtual const lduSchedule& patchSchedule() const = 0;
|
||||||
|
|
||||||
//- Return losort addressing
|
//- Return losort addressing
|
||||||
const unallocLabelList& losortAddr() const;
|
const labelUList& losortAddr() const;
|
||||||
|
|
||||||
//- Return owner start addressing
|
//- Return owner start addressing
|
||||||
const unallocLabelList& ownerStartAddr() const;
|
const labelUList& ownerStartAddr() const;
|
||||||
|
|
||||||
//- Return losort start addressing
|
//- Return losort start addressing
|
||||||
const unallocLabelList& losortStartAddr() const;
|
const labelUList& losortStartAddr() const;
|
||||||
|
|
||||||
//- Return off-diagonal index given owner and neighbour label
|
//- Return off-diagonal index given owner and neighbour label
|
||||||
label triIndex(const label a, const label b) const;
|
label triIndex(const label a, const label b) const;
|
||||||
|
|||||||
@ -84,7 +84,7 @@ public:
|
|||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return faceCell addressing
|
//- Return faceCell addressing
|
||||||
virtual const unallocLabelList& faceCells() const = 0;
|
virtual const labelUList& faceCells() const = 0;
|
||||||
|
|
||||||
|
|
||||||
// Interface transfer functions
|
// Interface transfer functions
|
||||||
@ -93,14 +93,14 @@ public:
|
|||||||
// the interface as a field
|
// the interface as a field
|
||||||
virtual tmp<labelField> interfaceInternalField
|
virtual tmp<labelField> interfaceInternalField
|
||||||
(
|
(
|
||||||
const unallocLabelList& internalData
|
const labelUList& internalData
|
||||||
) const = 0;
|
) const = 0;
|
||||||
|
|
||||||
//- Initialise transfer of internal field adjacent to the interface
|
//- Initialise transfer of internal field adjacent to the interface
|
||||||
virtual void initInternalFieldTransfer
|
virtual void initInternalFieldTransfer
|
||||||
(
|
(
|
||||||
const Pstream::commsTypes commsType,
|
const Pstream::commsTypes commsType,
|
||||||
const unallocLabelList& iF
|
const labelUList& iF
|
||||||
) const
|
) const
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ public:
|
|||||||
virtual tmp<labelField> internalFieldTransfer
|
virtual tmp<labelField> internalFieldTransfer
|
||||||
(
|
(
|
||||||
const Pstream::commsTypes commsType,
|
const Pstream::commsTypes commsType,
|
||||||
const unallocLabelList& iF
|
const labelUList& iF
|
||||||
) const = 0;
|
) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -188,7 +188,7 @@ void Foam::lduMatrix::sumA
|
|||||||
{
|
{
|
||||||
if (interfaces.set(patchI))
|
if (interfaces.set(patchI))
|
||||||
{
|
{
|
||||||
const unallocLabelList& pa = lduAddr().patchAddr(patchI);
|
const labelUList& pa = lduAddr().patchAddr(patchI);
|
||||||
const scalarField& pCoeffs = interfaceBouCoeffs[patchI];
|
const scalarField& pCoeffs = interfaceBouCoeffs[patchI];
|
||||||
|
|
||||||
forAll(pa, face)
|
forAll(pa, face)
|
||||||
|
|||||||
@ -36,8 +36,8 @@ void Foam::lduMatrix::sumDiag()
|
|||||||
const scalarField& Upper = const_cast<const lduMatrix&>(*this).upper();
|
const scalarField& Upper = const_cast<const lduMatrix&>(*this).upper();
|
||||||
scalarField& Diag = diag();
|
scalarField& Diag = diag();
|
||||||
|
|
||||||
const unallocLabelList& l = lduAddr().lowerAddr();
|
const labelUList& l = lduAddr().lowerAddr();
|
||||||
const unallocLabelList& u = lduAddr().upperAddr();
|
const labelUList& u = lduAddr().upperAddr();
|
||||||
|
|
||||||
for (register label face=0; face<l.size(); face++)
|
for (register label face=0; face<l.size(); face++)
|
||||||
{
|
{
|
||||||
@ -53,8 +53,8 @@ void Foam::lduMatrix::negSumDiag()
|
|||||||
const scalarField& Upper = const_cast<const lduMatrix&>(*this).upper();
|
const scalarField& Upper = const_cast<const lduMatrix&>(*this).upper();
|
||||||
scalarField& Diag = diag();
|
scalarField& Diag = diag();
|
||||||
|
|
||||||
const unallocLabelList& l = lduAddr().lowerAddr();
|
const labelUList& l = lduAddr().lowerAddr();
|
||||||
const unallocLabelList& u = lduAddr().upperAddr();
|
const labelUList& u = lduAddr().upperAddr();
|
||||||
|
|
||||||
for (register label face=0; face<l.size(); face++)
|
for (register label face=0; face<l.size(); face++)
|
||||||
{
|
{
|
||||||
@ -72,8 +72,8 @@ void Foam::lduMatrix::sumMagOffDiag
|
|||||||
const scalarField& Lower = const_cast<const lduMatrix&>(*this).lower();
|
const scalarField& Lower = const_cast<const lduMatrix&>(*this).lower();
|
||||||
const scalarField& Upper = const_cast<const lduMatrix&>(*this).upper();
|
const scalarField& Upper = const_cast<const lduMatrix&>(*this).upper();
|
||||||
|
|
||||||
const unallocLabelList& l = lduAddr().lowerAddr();
|
const labelUList& l = lduAddr().lowerAddr();
|
||||||
const unallocLabelList& u = lduAddr().upperAddr();
|
const labelUList& u = lduAddr().upperAddr();
|
||||||
|
|
||||||
for (register label face = 0; face < l.size(); face++)
|
for (register label face = 0; face < l.size(); face++)
|
||||||
{
|
{
|
||||||
@ -294,7 +294,7 @@ void Foam::lduMatrix::operator*=(const scalarField& sf)
|
|||||||
{
|
{
|
||||||
scalarField& upper = *upperPtr_;
|
scalarField& upper = *upperPtr_;
|
||||||
|
|
||||||
const unallocLabelList& l = lduAddr().lowerAddr();
|
const labelUList& l = lduAddr().lowerAddr();
|
||||||
|
|
||||||
for (register label face=0; face<upper.size(); face++)
|
for (register label face=0; face<upper.size(); face++)
|
||||||
{
|
{
|
||||||
@ -306,7 +306,7 @@ void Foam::lduMatrix::operator*=(const scalarField& sf)
|
|||||||
{
|
{
|
||||||
scalarField& lower = *lowerPtr_;
|
scalarField& lower = *lowerPtr_;
|
||||||
|
|
||||||
const unallocLabelList& u = lduAddr().upperAddr();
|
const labelUList& u = lduAddr().upperAddr();
|
||||||
|
|
||||||
for (register label face=0; face<lower.size(); face++)
|
for (register label face=0; face<lower.size(); face++)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -83,8 +83,8 @@ Foam::lduMatrix::faceH(const Field<Type>& psi) const
|
|||||||
const scalarField& Lower = const_cast<const lduMatrix&>(*this).lower();
|
const scalarField& Lower = const_cast<const lduMatrix&>(*this).lower();
|
||||||
const scalarField& Upper = const_cast<const lduMatrix&>(*this).upper();
|
const scalarField& Upper = const_cast<const lduMatrix&>(*this).upper();
|
||||||
|
|
||||||
const unallocLabelList& l = lduAddr().lowerAddr();
|
const labelUList& l = lduAddr().lowerAddr();
|
||||||
const unallocLabelList& u = lduAddr().upperAddr();
|
const labelUList& u = lduAddr().upperAddr();
|
||||||
|
|
||||||
tmp<Field<Type> > tfaceHpsi(new Field<Type> (Lower.size()));
|
tmp<Field<Type> > tfaceHpsi(new Field<Type> (Lower.size()));
|
||||||
Field<Type> & faceHpsi = tfaceHpsi();
|
Field<Type> & faceHpsi = tfaceHpsi();
|
||||||
|
|||||||
@ -36,8 +36,8 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing
|
|||||||
const lduMesh& fineMesh = meshLevel(fineLevelIndex);
|
const lduMesh& fineMesh = meshLevel(fineLevelIndex);
|
||||||
const lduAddressing& fineMeshAddr = fineMesh.lduAddr();
|
const lduAddressing& fineMeshAddr = fineMesh.lduAddr();
|
||||||
|
|
||||||
const unallocLabelList& upperAddr = fineMeshAddr.upperAddr();
|
const labelUList& upperAddr = fineMeshAddr.upperAddr();
|
||||||
const unallocLabelList& lowerAddr = fineMeshAddr.lowerAddr();
|
const labelUList& lowerAddr = fineMeshAddr.lowerAddr();
|
||||||
|
|
||||||
label nFineFaces = upperAddr.size();
|
label nFineFaces = upperAddr.size();
|
||||||
|
|
||||||
|
|||||||
@ -37,8 +37,8 @@ Foam::tmp<Foam::labelField> Foam::pairGAMGAgglomeration::agglomerate
|
|||||||
{
|
{
|
||||||
const label nFineCells = fineMatrixAddressing.size();
|
const label nFineCells = fineMatrixAddressing.size();
|
||||||
|
|
||||||
const unallocLabelList& upperAddr = fineMatrixAddressing.upperAddr();
|
const labelUList& upperAddr = fineMatrixAddressing.upperAddr();
|
||||||
const unallocLabelList& lowerAddr = fineMatrixAddressing.lowerAddr();
|
const labelUList& lowerAddr = fineMatrixAddressing.lowerAddr();
|
||||||
|
|
||||||
// For each cell calculate faces
|
// For each cell calculate faces
|
||||||
labelList cellFaces(upperAddr.size() + lowerAddr.size());
|
labelList cellFaces(upperAddr.size() + lowerAddr.size());
|
||||||
|
|||||||
@ -141,9 +141,9 @@ void Foam::GAMGSolver::agglomerateMatrix(const label fineLevelIndex)
|
|||||||
const labelList& restrictAddr =
|
const labelList& restrictAddr =
|
||||||
agglomeration_.restrictAddressing(fineLevelIndex);
|
agglomeration_.restrictAddressing(fineLevelIndex);
|
||||||
|
|
||||||
const unallocLabelList& l = fineMatrix.lduAddr().lowerAddr();
|
const labelUList& l = fineMatrix.lduAddr().lowerAddr();
|
||||||
const unallocLabelList& cl = coarseMatrix.lduAddr().lowerAddr();
|
const labelUList& cl = coarseMatrix.lduAddr().lowerAddr();
|
||||||
const unallocLabelList& cu = coarseMatrix.lduAddr().upperAddr();
|
const labelUList& cu = coarseMatrix.lduAddr().upperAddr();
|
||||||
|
|
||||||
forAll(faceRestrictAddr, fineFacei)
|
forAll(faceRestrictAddr, fineFacei)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -88,7 +88,7 @@ void Foam::cyclicGAMGInterfaceField::updateInterfaceMatrix
|
|||||||
|
|
||||||
transformCoupleField(pnf, cmpt);
|
transformCoupleField(pnf, cmpt);
|
||||||
|
|
||||||
const unallocLabelList& faceCells = cyclicInterface_.faceCells();
|
const labelUList& faceCells = cyclicInterface_.faceCells();
|
||||||
|
|
||||||
forAll(faceCells, elemI)
|
forAll(faceCells, elemI)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -95,7 +95,7 @@ Foam::processorCyclicGAMGInterfaceField::~processorCyclicGAMGInterfaceField()
|
|||||||
// );
|
// );
|
||||||
// transformCoupleField(pnf, cmpt);
|
// transformCoupleField(pnf, cmpt);
|
||||||
//
|
//
|
||||||
// const unallocLabelList& faceCells = procInterface_.faceCells();
|
// const labelUList& faceCells = procInterface_.faceCells();
|
||||||
//
|
//
|
||||||
// forAll(faceCells, elemI)
|
// forAll(faceCells, elemI)
|
||||||
// {
|
// {
|
||||||
|
|||||||
@ -104,7 +104,7 @@ void Foam::processorGAMGInterfaceField::updateInterfaceMatrix
|
|||||||
);
|
);
|
||||||
transformCoupleField(pnf, cmpt);
|
transformCoupleField(pnf, cmpt);
|
||||||
|
|
||||||
const unallocLabelList& faceCells = procInterface_.faceCells();
|
const labelUList& faceCells = procInterface_.faceCells();
|
||||||
|
|
||||||
forAll(faceCells, elemI)
|
forAll(faceCells, elemI)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -51,7 +51,7 @@ void Foam::GAMGInterface::combine(const GAMGInterface& coarseGi)
|
|||||||
|
|
||||||
Foam::tmp<Foam::labelField> Foam::GAMGInterface::interfaceInternalField
|
Foam::tmp<Foam::labelField> Foam::GAMGInterface::interfaceInternalField
|
||||||
(
|
(
|
||||||
const unallocLabelList& internalData
|
const labelUList& internalData
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return interfaceInternalField<label>(internalData);
|
return interfaceInternalField<label>(internalData);
|
||||||
|
|||||||
@ -164,7 +164,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return faceCell addressing
|
//- Return faceCell addressing
|
||||||
virtual const unallocLabelList& faceCells() const
|
virtual const labelUList& faceCells() const
|
||||||
{
|
{
|
||||||
return faceCells_;
|
return faceCells_;
|
||||||
}
|
}
|
||||||
@ -192,7 +192,7 @@ public:
|
|||||||
// the interface as a field
|
// the interface as a field
|
||||||
virtual tmp<labelField> interfaceInternalField
|
virtual tmp<labelField> interfaceInternalField
|
||||||
(
|
(
|
||||||
const unallocLabelList& internalData
|
const labelUList& internalData
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -250,14 +250,14 @@ Foam::cyclicGAMGInterface::~cyclicGAMGInterface()
|
|||||||
Foam::tmp<Foam::labelField> Foam::cyclicGAMGInterface::internalFieldTransfer
|
Foam::tmp<Foam::labelField> Foam::cyclicGAMGInterface::internalFieldTransfer
|
||||||
(
|
(
|
||||||
const Pstream::commsTypes,
|
const Pstream::commsTypes,
|
||||||
const unallocLabelList& iF
|
const labelUList& iF
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const cyclicGAMGInterface& nbr = dynamic_cast<const cyclicGAMGInterface&>
|
const cyclicGAMGInterface& nbr = dynamic_cast<const cyclicGAMGInterface&>
|
||||||
(
|
(
|
||||||
neighbPatch()
|
neighbPatch()
|
||||||
);
|
);
|
||||||
const unallocLabelList& nbrFaceCells = nbr.faceCells();
|
const labelUList& nbrFaceCells = nbr.faceCells();
|
||||||
|
|
||||||
tmp<labelField> tpnf(new labelField(size()));
|
tmp<labelField> tpnf(new labelField(size()));
|
||||||
labelField& pnf = tpnf();
|
labelField& pnf = tpnf();
|
||||||
|
|||||||
@ -100,7 +100,7 @@ public:
|
|||||||
virtual tmp<labelField> internalFieldTransfer
|
virtual tmp<labelField> internalFieldTransfer
|
||||||
(
|
(
|
||||||
const Pstream::commsTypes commsType,
|
const Pstream::commsTypes commsType,
|
||||||
const unallocLabelList& iF
|
const labelUList& iF
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -241,7 +241,7 @@ Foam::processorGAMGInterface::~processorGAMGInterface()
|
|||||||
void Foam::processorGAMGInterface::initInternalFieldTransfer
|
void Foam::processorGAMGInterface::initInternalFieldTransfer
|
||||||
(
|
(
|
||||||
const Pstream::commsTypes commsType,
|
const Pstream::commsTypes commsType,
|
||||||
const unallocLabelList& iF
|
const labelUList& iF
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
send(commsType, interfaceInternalField(iF)());
|
send(commsType, interfaceInternalField(iF)());
|
||||||
@ -251,7 +251,7 @@ void Foam::processorGAMGInterface::initInternalFieldTransfer
|
|||||||
Foam::tmp<Foam::labelField> Foam::processorGAMGInterface::internalFieldTransfer
|
Foam::tmp<Foam::labelField> Foam::processorGAMGInterface::internalFieldTransfer
|
||||||
(
|
(
|
||||||
const Pstream::commsTypes commsType,
|
const Pstream::commsTypes commsType,
|
||||||
const unallocLabelList& iF
|
const labelUList& iF
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return receive<label>(commsType, this->size());
|
return receive<label>(commsType, this->size());
|
||||||
|
|||||||
@ -100,14 +100,14 @@ public:
|
|||||||
virtual void initInternalFieldTransfer
|
virtual void initInternalFieldTransfer
|
||||||
(
|
(
|
||||||
const Pstream::commsTypes commsType,
|
const Pstream::commsTypes commsType,
|
||||||
const unallocLabelList& iF
|
const labelUList& iF
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Transfer and return internal field adjacent to the interface
|
//- Transfer and return internal field adjacent to the interface
|
||||||
virtual tmp<labelField> internalFieldTransfer
|
virtual tmp<labelField> internalFieldTransfer
|
||||||
(
|
(
|
||||||
const Pstream::commsTypes commsType,
|
const Pstream::commsTypes commsType,
|
||||||
const unallocLabelList& iF
|
const labelUList& iF
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -152,6 +152,12 @@ public:
|
|||||||
return ::Foam::mag(max_ - min_);
|
return ::Foam::mag(max_ - min_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- The volume of the bound box
|
||||||
|
scalar volume() const
|
||||||
|
{
|
||||||
|
return cmptProduct(span());
|
||||||
|
}
|
||||||
|
|
||||||
//- Smallest length/height/width dimension
|
//- Smallest length/height/width dimension
|
||||||
scalar minDim() const
|
scalar minDim() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -86,8 +86,8 @@ public:
|
|||||||
lduPrimitiveMesh
|
lduPrimitiveMesh
|
||||||
(
|
(
|
||||||
const label nCells,
|
const label nCells,
|
||||||
const unallocLabelList& l,
|
const labelUList& l,
|
||||||
const unallocLabelList& u,
|
const labelUList& u,
|
||||||
const labelListList& pa,
|
const labelListList& pa,
|
||||||
lduInterfacePtrsList interfaces,
|
lduInterfacePtrsList interfaces,
|
||||||
const lduSchedule& ps
|
const lduSchedule& ps
|
||||||
@ -146,19 +146,19 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return Lower addressing
|
//- Return Lower addressing
|
||||||
virtual const unallocLabelList& lowerAddr() const
|
virtual const labelUList& lowerAddr() const
|
||||||
{
|
{
|
||||||
return lowerAddr_;
|
return lowerAddr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return Upper addressing
|
//- Return Upper addressing
|
||||||
virtual const unallocLabelList& upperAddr() const
|
virtual const labelUList& upperAddr() const
|
||||||
{
|
{
|
||||||
return upperAddr_;
|
return upperAddr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return patch addressing
|
//- Return patch addressing
|
||||||
virtual const unallocLabelList& patchAddr(const label i) const
|
virtual const labelUList& patchAddr(const label i) const
|
||||||
{
|
{
|
||||||
return patchAddr_[i];
|
return patchAddr_[i];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -75,7 +75,7 @@ public:
|
|||||||
explicit inline cell(label);
|
explicit inline cell(label);
|
||||||
|
|
||||||
//- Construct from list of labels
|
//- Construct from list of labels
|
||||||
explicit inline cell(const UList<label>&);
|
explicit inline cell(const labelUList&);
|
||||||
|
|
||||||
//- Construct by transferring the parameter contents
|
//- Construct by transferring the parameter contents
|
||||||
explicit inline cell(const Xfer<labelList>&);
|
explicit inline cell(const Xfer<labelList>&);
|
||||||
|
|||||||
@ -40,7 +40,7 @@ inline Foam::cell::cell(label s)
|
|||||||
|
|
||||||
|
|
||||||
// Construct from components
|
// Construct from components
|
||||||
inline Foam::cell::cell(const UList<label>& lst)
|
inline Foam::cell::cell(const labelUList& lst)
|
||||||
:
|
:
|
||||||
labelList(lst)
|
labelList(lst)
|
||||||
{}
|
{}
|
||||||
|
|||||||
@ -148,7 +148,7 @@ public:
|
|||||||
explicit inline face(label);
|
explicit inline face(label);
|
||||||
|
|
||||||
//- Construct from list of labels
|
//- Construct from list of labels
|
||||||
explicit inline face(const UList<label>&);
|
explicit inline face(const labelUList&);
|
||||||
|
|
||||||
//- Construct from list of labels
|
//- Construct from list of labels
|
||||||
explicit inline face(const labelList&);
|
explicit inline face(const labelList&);
|
||||||
|
|||||||
@ -51,7 +51,7 @@ inline Foam::face::face(label s)
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
inline Foam::face::face(const UList<label>& lst)
|
inline Foam::face::face(const labelUList& lst)
|
||||||
:
|
:
|
||||||
labelList(lst)
|
labelList(lst)
|
||||||
{}
|
{}
|
||||||
|
|||||||
@ -80,8 +80,8 @@ public:
|
|||||||
const label c
|
const label c
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from a UList<label>
|
//- Construct from a list of labels
|
||||||
explicit inline triFace(const UList<label>&);
|
explicit inline triFace(const labelUList&);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
inline triFace(Istream&);
|
inline triFace(Istream&);
|
||||||
|
|||||||
@ -77,7 +77,7 @@ inline Foam::triFace::triFace
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Foam::triFace::triFace(const UList<label>& lst)
|
inline Foam::triFace::triFace(const labelUList& lst)
|
||||||
:
|
:
|
||||||
FixedList<label, 3>(lst)
|
FixedList<label, 3>(lst)
|
||||||
{}
|
{}
|
||||||
|
|||||||
@ -233,13 +233,13 @@ Foam::label Foam::pointMapper::sizeBeforeMapping() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const Foam::unallocLabelList& Foam::pointMapper::directAddressing() const
|
const Foam::labelUList& Foam::pointMapper::directAddressing() const
|
||||||
{
|
{
|
||||||
if (!direct())
|
if (!direct())
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"const unallocLabelList& pointMapper::directAddressing() const"
|
"const labelUList& pointMapper::directAddressing() const"
|
||||||
) << "Requested direct addressing for an interpolative mapper."
|
) << "Requested direct addressing for an interpolative mapper."
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -130,7 +130,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return direct addressing
|
//- Return direct addressing
|
||||||
virtual const unallocLabelList& directAddressing() const;
|
virtual const labelUList& directAddressing() const;
|
||||||
|
|
||||||
//- Return interpolated addressing
|
//- Return interpolated addressing
|
||||||
virtual const labelListList& addressing() const;
|
virtual const labelListList& addressing() const;
|
||||||
|
|||||||
@ -140,13 +140,13 @@ Foam::pointPatchMapper::~pointPatchMapper()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const Foam::unallocLabelList& Foam::pointPatchMapper::directAddressing() const
|
const Foam::labelUList& Foam::pointPatchMapper::directAddressing() const
|
||||||
{
|
{
|
||||||
if (!direct())
|
if (!direct())
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"const unallocLabelList& pointPatchMapper::directAddressing() const"
|
"const labelUList& pointPatchMapper::directAddressing() const"
|
||||||
) << "Requested direct addressing for an interpolative mapper."
|
) << "Requested direct addressing for an interpolative mapper."
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -143,7 +143,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return direct addressing
|
//- Return direct addressing
|
||||||
virtual const unallocLabelList& directAddressing() const;
|
virtual const labelUList& directAddressing() const;
|
||||||
|
|
||||||
//- Return interpolated addressing
|
//- Return interpolated addressing
|
||||||
virtual const labelListList& addressing() const;
|
virtual const labelListList& addressing() const;
|
||||||
|
|||||||
@ -326,13 +326,13 @@ Foam::label Foam::cellMapper::sizeBeforeMapping() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const Foam::unallocLabelList& Foam::cellMapper::directAddressing() const
|
const Foam::labelUList& Foam::cellMapper::directAddressing() const
|
||||||
{
|
{
|
||||||
if (!direct())
|
if (!direct())
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"const unallocLabelList& cellMapper::directAddressing() const"
|
"const labelUList& cellMapper::directAddressing() const"
|
||||||
) << "Requested direct addressing for an interpolative mapper."
|
) << "Requested direct addressing for an interpolative mapper."
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -131,7 +131,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return direct addressing
|
//- Return direct addressing
|
||||||
virtual const unallocLabelList& directAddressing() const;
|
virtual const labelUList& directAddressing() const;
|
||||||
|
|
||||||
//- Return interpolated addressing
|
//- Return interpolated addressing
|
||||||
virtual const labelListList& addressing() const;
|
virtual const labelListList& addressing() const;
|
||||||
|
|||||||
@ -302,13 +302,13 @@ Foam::label Foam::faceMapper::internalSizeBeforeMapping() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const Foam::unallocLabelList& Foam::faceMapper::directAddressing() const
|
const Foam::labelUList& Foam::faceMapper::directAddressing() const
|
||||||
{
|
{
|
||||||
if (!direct())
|
if (!direct())
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"const unallocLabelList& faceMapper::directAddressing() const"
|
"const labelUList& faceMapper::directAddressing() const"
|
||||||
) << "Requested direct addressing for an interpolative mapper."
|
) << "Requested direct addressing for an interpolative mapper."
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -135,7 +135,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return direct addressing
|
//- Return direct addressing
|
||||||
virtual const unallocLabelList& directAddressing() const;
|
virtual const labelUList& directAddressing() const;
|
||||||
|
|
||||||
//- Return interpolated addressing
|
//- Return interpolated addressing
|
||||||
virtual const labelListList& addressing() const;
|
virtual const labelListList& addressing() const;
|
||||||
|
|||||||
@ -805,7 +805,7 @@ void Foam::polyBoundaryMesh::updateMesh()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::polyBoundaryMesh::reorder(const UList<label>& oldToNew)
|
void Foam::polyBoundaryMesh::reorder(const labelUList& oldToNew)
|
||||||
{
|
{
|
||||||
// Change order of patches
|
// Change order of patches
|
||||||
polyPatchList::reorder(oldToNew);
|
polyPatchList::reorder(oldToNew);
|
||||||
|
|||||||
@ -188,7 +188,7 @@ public:
|
|||||||
// ascending or descending order. Reordering has to be unique.
|
// ascending or descending order. Reordering has to be unique.
|
||||||
// (is shuffle) Calls updateMesh() after reordering to recalculate
|
// (is shuffle) Calls updateMesh() after reordering to recalculate
|
||||||
// data.
|
// data.
|
||||||
void reorder(const UList<label>&);
|
void reorder(const labelUList&);
|
||||||
|
|
||||||
//- writeData member function required by regIOobject
|
//- writeData member function required by regIOobject
|
||||||
bool writeData(Ostream&) const;
|
bool writeData(Ostream&) const;
|
||||||
|
|||||||
@ -421,7 +421,7 @@ Foam::coupledPolyPatch::coupledPolyPatch
|
|||||||
const coupledPolyPatch& pp,
|
const coupledPolyPatch& pp,
|
||||||
const polyBoundaryMesh& bm,
|
const polyBoundaryMesh& bm,
|
||||||
const label index,
|
const label index,
|
||||||
const unallocLabelList& mapAddressing,
|
const labelUList& mapAddressing,
|
||||||
const label newStart
|
const label newStart
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
|
|||||||
@ -208,7 +208,7 @@ public:
|
|||||||
const coupledPolyPatch& pp,
|
const coupledPolyPatch& pp,
|
||||||
const polyBoundaryMesh& bm,
|
const polyBoundaryMesh& bm,
|
||||||
const label index,
|
const label index,
|
||||||
const unallocLabelList& mapAddressing,
|
const labelUList& mapAddressing,
|
||||||
const label newStart
|
const label newStart
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -98,7 +98,7 @@ Foam::genericPolyPatch::genericPolyPatch
|
|||||||
const genericPolyPatch& pp,
|
const genericPolyPatch& pp,
|
||||||
const polyBoundaryMesh& bm,
|
const polyBoundaryMesh& bm,
|
||||||
const label index,
|
const label index,
|
||||||
const unallocLabelList& mapAddressing,
|
const labelUList& mapAddressing,
|
||||||
const label newStart
|
const label newStart
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
|
|||||||
@ -111,7 +111,7 @@ public:
|
|||||||
const genericPolyPatch& pp,
|
const genericPolyPatch& pp,
|
||||||
const polyBoundaryMesh& bm,
|
const polyBoundaryMesh& bm,
|
||||||
const label index,
|
const label index,
|
||||||
const unallocLabelList& mapAddressing,
|
const labelUList& mapAddressing,
|
||||||
const label newStart
|
const label newStart
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ public:
|
|||||||
(
|
(
|
||||||
const polyBoundaryMesh& bm,
|
const polyBoundaryMesh& bm,
|
||||||
const label index,
|
const label index,
|
||||||
const unallocLabelList& mapAddressing,
|
const labelUList& mapAddressing,
|
||||||
const label newStart
|
const label newStart
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -581,7 +581,7 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
|
|||||||
const cyclicPolyPatch& pp,
|
const cyclicPolyPatch& pp,
|
||||||
const polyBoundaryMesh& bm,
|
const polyBoundaryMesh& bm,
|
||||||
const label index,
|
const label index,
|
||||||
const unallocLabelList& mapAddressing,
|
const labelUList& mapAddressing,
|
||||||
const label newStart
|
const label newStart
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
|
|||||||
@ -243,7 +243,7 @@ public:
|
|||||||
const cyclicPolyPatch& pp,
|
const cyclicPolyPatch& pp,
|
||||||
const polyBoundaryMesh& bm,
|
const polyBoundaryMesh& bm,
|
||||||
const label index,
|
const label index,
|
||||||
const unallocLabelList& mapAddressing,
|
const labelUList& mapAddressing,
|
||||||
const label newStart
|
const label newStart
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -283,7 +283,7 @@ public:
|
|||||||
(
|
(
|
||||||
const polyBoundaryMesh& bm,
|
const polyBoundaryMesh& bm,
|
||||||
const label index,
|
const label index,
|
||||||
const unallocLabelList& mapAddressing,
|
const labelUList& mapAddressing,
|
||||||
const label newStart
|
const label newStart
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user