Standardized cell, patch and face loop index names

This commit is contained in:
Henry Weller
2016-04-25 10:28:32 +01:00
parent 6a27f7af46
commit 8c4f6b8fcb
849 changed files with 13266 additions and 13266 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -37,7 +37,7 @@ defineTypeNameAndDebug(treeDataCell, 0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::treeBoundBox Foam::treeDataCell::calcCellBb(const label cellI) const
Foam::treeBoundBox Foam::treeDataCell::calcCellBb(const label celli) const
{
const cellList& cells = mesh_.cells();
const faceList& faces = mesh_.faces();
@ -49,7 +49,7 @@ Foam::treeBoundBox Foam::treeDataCell::calcCellBb(const label cellI) const
vector(-GREAT, -GREAT, -GREAT)
);
const cell& cFaces = cells[cellI];
const cell& cFaces = cells[celli];
forAll(cFaces, cFaceI)
{
@ -208,14 +208,14 @@ void Foam::treeDataCell::findNearestOp::operator()
forAll(indices, i)
{
label index = indices[i];
label cellI = shape.cellLabels()[index];
scalar distSqr = magSqr(sample - shape.mesh().cellCentres()[cellI]);
label celli = shape.cellLabels()[index];
scalar distSqr = magSqr(sample - shape.mesh().cellCentres()[celli]);
if (distSqr < nearestDistSqr)
{
nearestDistSqr = distSqr;
minIndex = index;
nearestPoint = shape.mesh().cellCentres()[cellI];
nearestPoint = shape.mesh().cellCentres()[celli];
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -74,7 +74,7 @@ class treeDataCell
// Private Member Functions
//- Calculate cell bounding box
treeBoundBox calcCellBb(const label cellI) const;
treeBoundBox calcCellBb(const label celli) const;
//- Initialise all member data
void update();

View File

@ -634,9 +634,9 @@ operator==
GeometricBoundaryField& bf
)
{
forAll((*this), patchI)
forAll((*this), patchi)
{
this->operator[](patchI) == bf[patchI];
this->operator[](patchi) == bf[patchi];
}
}
@ -648,9 +648,9 @@ operator==
const FieldField<PatchField, Type>& ptff
)
{
forAll((*this), patchI)
forAll((*this), patchi)
{
this->operator[](patchI) == ptff[patchI];
this->operator[](patchi) == ptff[patchi];
}
}
@ -662,9 +662,9 @@ operator==
const Type& t
)
{
forAll((*this), patchI)
forAll((*this), patchi)
{
this->operator[](patchI) == t;
this->operator[](patchi) == t;
}
}

View File

@ -252,10 +252,10 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcFaceAddressing() const
vectorField fromPatchFaceCentres(fromPatchFaces.size());
forAll(fromPatchFaceCentres, faceI)
forAll(fromPatchFaceCentres, facei)
{
fromPatchFaceCentres[faceI] =
fromPatchFaces[faceI].centre(fromPatchPoints);
fromPatchFaceCentres[facei] =
fromPatchFaces[facei].centre(fromPatchPoints);
}
const pointField& toPatchPoints = toPatch_.points();
@ -275,36 +275,36 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcFaceAddressing() const
faceAddressingPtr_ = new labelList(proj.size(), -1);
labelList& faceAddressing = *faceAddressingPtr_;
forAll(faceAddressing, faceI)
forAll(faceAddressing, facei)
{
if (proj[faceI].hit())
if (proj[facei].hit())
{
// A hit exists
faceAddressing[faceI] = proj[faceI].hitObject();
faceAddressing[facei] = proj[facei].hitObject();
const typename FromPatch::FaceType& hitFace =
fromPatchFaces[faceAddressing[faceI]];
fromPatchFaces[faceAddressing[facei]];
pointHit curHit =
hitFace.ray
(
toPatchFaces[faceI].centre(toPatchPoints),
projectionDirection[faceI],
toPatchFaces[facei].centre(toPatchPoints),
projectionDirection[facei],
fromPatchPoints,
alg_,
dir_
);
// grab distance to target
faceDistance[faceI] = curHit.distance();
faceDistance[facei] = curHit.distance();
// grab face centre of the hit face
const point& hitFaceCentre =
fromPatchFaceCentres[faceAddressing[faceI]];
fromPatchFaceCentres[faceAddressing[facei]];
// grab neighbours of hit face
const labelList& neighbours =
fromPatchFaceFaces[faceAddressing[faceI]];
fromPatchFaceFaces[faceAddressing[facei]];
scalar m = mag(curHit.hitPoint() - hitFaceCentre);
@ -314,8 +314,8 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcFaceAddressing() const
|| neighbours.empty()
)
{
faceWeights.set(faceI, new scalarField(1));
faceWeights[faceI][0] = 1.0;
faceWeights.set(facei, new scalarField(1));
faceWeights[facei][0] = 1.0;
}
else
{
@ -323,13 +323,13 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcFaceAddressing() const
// The first coefficient corresponds to the centre face.
// The rest is ordered in the same way as the faceFaces list.
faceWeights.set(faceI, new scalarField(neighbours.size() + 1));
faceWeights.set(facei, new scalarField(neighbours.size() + 1));
faceWeights[faceI][0] = 1.0/m;
faceWeights[facei][0] = 1.0/m;
forAll(neighbours, nI)
{
faceWeights[faceI][nI + 1] =
faceWeights[facei][nI + 1] =
1.0/
(
mag
@ -342,11 +342,11 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcFaceAddressing() const
}
}
faceWeights[faceI] /= sum(faceWeights[faceI]);
faceWeights[facei] /= sum(faceWeights[facei]);
}
else
{
faceWeights.set(faceI, new scalarField(0));
faceWeights.set(facei, new scalarField(0));
}
}
}

View File

@ -126,21 +126,21 @@ PatchToPatchInterpolation<FromPatch, ToPatch>::faceInterpolate
const labelList& addr = faceAddr();
forAll(result, faceI)
forAll(result, facei)
{
const scalarField& curWeights = weights[faceI];
const scalarField& curWeights = weights[facei];
if (addr[faceI] > -1)
if (addr[facei] > -1)
{
const labelList& hitFaceFaces =
fromPatchFaceFaces[addr[faceI]];
fromPatchFaceFaces[addr[facei]];
// first add the hit face
result[faceI] += ff[addr[faceI]]*curWeights[0];
result[facei] += ff[addr[facei]]*curWeights[0];
for (label wI = 1; wI < curWeights.size(); wI++)
{
result[faceI] += ff[hitFaceFaces[wI - 1]]*curWeights[wI];
result[facei] += ff[hitFaceFaces[wI - 1]]*curWeights[wI];
}
}
}

View File

@ -198,12 +198,12 @@ void Foam::LduMatrix<Type, DType, LUType>::sumA
// Add the interface internal coefficients to diagonal
// and the interface boundary coefficients to the sum-off-diagonal
forAll(interfaces_, patchI)
forAll(interfaces_, patchi)
{
if (interfaces_.set(patchI))
if (interfaces_.set(patchi))
{
const unallocLabelList& pa = lduAddr().patchAddr(patchI);
const Field<LUType>& pCoeffs = interfacesUpper_[patchI];
const unallocLabelList& pa = lduAddr().patchAddr(patchi);
const Field<LUType>& pCoeffs = interfacesUpper_[patchi];
forAll(pa, face)
{

View File

@ -42,16 +42,16 @@ void Foam::LduMatrix<Type, DType, LUType>::initMatrixInterfaces
|| Pstream::defaultCommsType == Pstream::nonBlocking
)
{
forAll(interfaces_, interfaceI)
forAll(interfaces_, interfacei)
{
if (interfaces_.set(interfaceI))
if (interfaces_.set(interfacei))
{
interfaces_[interfaceI].initInterfaceMatrixUpdate
interfaces_[interfacei].initInterfaceMatrixUpdate
(
result,
psiif,
interfaceCoeffs[interfaceI],
//Amultiplier<Type, LUType>(interfaceCoeffs[interfaceI]),
interfaceCoeffs[interfacei],
//Amultiplier<Type, LUType>(interfaceCoeffs[interfacei]),
Pstream::defaultCommsType
);
}
@ -65,19 +65,19 @@ void Foam::LduMatrix<Type, DType, LUType>::initMatrixInterfaces
// beyond the end of the schedule which only handles "normal" patches
for
(
label interfaceI=patchSchedule.size()/2;
interfaceI<interfaces_.size();
interfaceI++
label interfacei=patchSchedule.size()/2;
interfacei<interfaces_.size();
interfacei++
)
{
if (interfaces_.set(interfaceI))
if (interfaces_.set(interfacei))
{
interfaces_[interfaceI].initInterfaceMatrixUpdate
interfaces_[interfacei].initInterfaceMatrixUpdate
(
result,
psiif,
interfaceCoeffs[interfaceI],
//Amultiplier<Type, LUType>(interfaceCoeffs[interfaceI]),
interfaceCoeffs[interfacei],
//Amultiplier<Type, LUType>(interfaceCoeffs[interfacei]),
Pstream::blocking
);
}
@ -114,16 +114,16 @@ void Foam::LduMatrix<Type, DType, LUType>::updateMatrixInterfaces
OPstream::waitRequests();
}
forAll(interfaces_, interfaceI)
forAll(interfaces_, interfacei)
{
if (interfaces_.set(interfaceI))
if (interfaces_.set(interfacei))
{
interfaces_[interfaceI].updateInterfaceMatrix
interfaces_[interfacei].updateInterfaceMatrix
(
result,
psiif,
interfaceCoeffs[interfaceI],
//Amultiplier<Type, LUType>(interfaceCoeffs[interfaceI]),
interfaceCoeffs[interfacei],
//Amultiplier<Type, LUType>(interfaceCoeffs[interfacei]),
Pstream::defaultCommsType
);
}
@ -136,29 +136,29 @@ void Foam::LduMatrix<Type, DType, LUType>::updateMatrixInterfaces
// Loop over all the "normal" interfaces relating to standard patches
forAll(patchSchedule, i)
{
label interfaceI = patchSchedule[i].patch;
label interfacei = patchSchedule[i].patch;
if (interfaces_.set(interfaceI))
if (interfaces_.set(interfacei))
{
if (patchSchedule[i].init)
{
interfaces_[interfaceI].initInterfaceMatrixUpdate
interfaces_[interfacei].initInterfaceMatrixUpdate
(
result,
psiif,
interfaceCoeffs[interfaceI],
//Amultiplier<Type, LUType>(interfaceCoeffs[interfaceI]),
interfaceCoeffs[interfacei],
//Amultiplier<Type, LUType>(interfaceCoeffs[interfacei]),
Pstream::scheduled
);
}
else
{
interfaces_[interfaceI].updateInterfaceMatrix
interfaces_[interfacei].updateInterfaceMatrix
(
result,
psiif,
interfaceCoeffs[interfaceI],
//Amultiplier<Type, LUType>(interfaceCoeffs[interfaceI]),
interfaceCoeffs[interfacei],
//Amultiplier<Type, LUType>(interfaceCoeffs[interfacei]),
Pstream::scheduled
);
}
@ -169,19 +169,19 @@ void Foam::LduMatrix<Type, DType, LUType>::updateMatrixInterfaces
// beyond the end of the schedule which only handles "normal" patches
for
(
label interfaceI=patchSchedule.size()/2;
interfaceI<interfaces_.size();
interfaceI++
label interfacei=patchSchedule.size()/2;
interfacei<interfaces_.size();
interfacei++
)
{
if (interfaces_.set(interfaceI))
if (interfaces_.set(interfacei))
{
interfaces_[interfaceI].updateInterfaceMatrix
interfaces_[interfacei].updateInterfaceMatrix
(
result,
psiif,
interfaceCoeffs[interfaceI],
//Amultiplier<Type, LUType>(interfaceCoeffs[interfaceI]),
interfaceCoeffs[interfacei],
//Amultiplier<Type, LUType>(interfaceCoeffs[interfacei]),
Pstream::blocking
);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -45,9 +45,9 @@ Foam::TGaussSeidelSmoother<Type, DType, LUType>::TGaussSeidelSmoother
const DType* const __restrict__ diagPtr = matrix.diag().begin();
DType* __restrict__ rDPtr = rD_.begin();
for (label cellI=0; cellI<nCells; cellI++)
for (label celli=0; celli<nCells; celli++)
{
rDPtr[cellI] = inv(diagPtr[cellI]);
rDPtr[celli] = inv(diagPtr[celli]);
}
}
@ -123,14 +123,14 @@ void Foam::TGaussSeidelSmoother<Type, DType, LUType>::smooth
label fStart;
label fEnd = ownStartPtr[0];
for (label cellI=0; cellI<nCells; cellI++)
for (label celli=0; celli<nCells; celli++)
{
// Start and end of this row
fStart = fEnd;
fEnd = ownStartPtr[cellI + 1];
fEnd = ownStartPtr[celli + 1];
// Get the accumulated neighbour side
curPsi = bPrimePtr[cellI];
curPsi = bPrimePtr[celli];
// Accumulate the owner product side
for (label curFace=fStart; curFace<fEnd; curFace++)
@ -139,7 +139,7 @@ void Foam::TGaussSeidelSmoother<Type, DType, LUType>::smooth
}
// Finish current psi
curPsi = dot(rDPtr[cellI], curPsi);
curPsi = dot(rDPtr[celli], curPsi);
// Distribute the neighbour side using current psi
for (label curFace=fStart; curFace<fEnd; curFace++)
@ -147,7 +147,7 @@ void Foam::TGaussSeidelSmoother<Type, DType, LUType>::smooth
bPrimePtr[uPtr[curFace]] -= dot(lowerPtr[curFace], curPsi);
}
psiPtr[cellI] = curPsi;
psiPtr[celli] = curPsi;
}
}
}

View File

@ -53,9 +53,9 @@ void Foam::lduAddressing::calcLosort() const
// Create temporary neighbour addressing
labelListList cellNbrFaces(size());
forAll(cellNbrFaces, cellI)
forAll(cellNbrFaces, celli)
{
cellNbrFaces[cellI].setSize(nNbrOfFace[cellI]);
cellNbrFaces[celli].setSize(nNbrOfFace[celli]);
}
// Reset the list of number of neighbours to zero
@ -77,9 +77,9 @@ void Foam::lduAddressing::calcLosort() const
// Set counter for losort
label lstI = 0;
forAll(cellNbrFaces, cellI)
forAll(cellNbrFaces, celli)
{
const labelList& curNbr = cellNbrFaces[cellI];
const labelList& curNbr = cellNbrFaces[celli];
forAll(curNbr, curNbrI)
{
@ -110,15 +110,15 @@ void Foam::lduAddressing::calcOwnerStart() const
label nOwnStart = 0;
label i = 1;
forAll(own, faceI)
forAll(own, facei)
{
label curOwn = own[faceI];
label curOwn = own[facei];
if (curOwn > nOwnStart)
{
while (i <= curOwn)
{
ownStart[i++] = faceI;
ownStart[i++] = facei;
}
nOwnStart = curOwn;
@ -149,16 +149,16 @@ void Foam::lduAddressing::calcLosortStart() const
label nLsrtStart = 0;
label i = 0;
forAll(lsrt, faceI)
forAll(lsrt, facei)
{
// Get neighbour
const label curNbr = nbr[lsrt[faceI]];
const label curNbr = nbr[lsrt[facei]];
if (curNbr > nLsrtStart)
{
while (i <= curNbr)
{
lsrtStart[i++] = faceI;
lsrtStart[i++] = facei;
}
nLsrtStart = curNbr;
@ -253,10 +253,10 @@ Foam::Tuple2<Foam::label, Foam::scalar> Foam::lduAddressing::band() const
labelList cellBandwidth(size(), 0);
forAll(neighbour, faceI)
forAll(neighbour, facei)
{
label own = owner[faceI];
label nei = neighbour[faceI];
label own = owner[facei];
label nei = neighbour[facei];
// Note: mag not necessary for correct (upper-triangular) ordering.
label diff = nei-own;
@ -267,9 +267,9 @@ Foam::Tuple2<Foam::label, Foam::scalar> Foam::lduAddressing::band() const
// Do not use field algebra because of conversion label to scalar
scalar profile = 0.0;
forAll(cellBandwidth, cellI)
forAll(cellBandwidth, celli)
{
profile += 1.0*cellBandwidth[cellI];
profile += 1.0*cellBandwidth[celli];
}
return Tuple2<label, scalar>(bandwidth, profile);

View File

@ -184,12 +184,12 @@ void Foam::lduMatrix::sumA
// Add the interface internal coefficients to diagonal
// and the interface boundary coefficients to the sum-off-diagonal
forAll(interfaces, patchI)
forAll(interfaces, patchi)
{
if (interfaces.set(patchI))
if (interfaces.set(patchi))
{
const labelUList& pa = lduAddr().patchAddr(patchI);
const scalarField& pCoeffs = interfaceBouCoeffs[patchI];
const labelUList& pa = lduAddr().patchAddr(patchi);
const scalarField& pCoeffs = interfaceBouCoeffs[patchi];
forAll(pa, face)
{

View File

@ -42,15 +42,15 @@ void Foam::lduMatrix::initMatrixInterfaces
|| Pstream::defaultCommsType == Pstream::nonBlocking
)
{
forAll(interfaces, interfaceI)
forAll(interfaces, interfacei)
{
if (interfaces.set(interfaceI))
if (interfaces.set(interfacei))
{
interfaces[interfaceI].initInterfaceMatrixUpdate
interfaces[interfacei].initInterfaceMatrixUpdate
(
result,
psiif,
coupleCoeffs[interfaceI],
coupleCoeffs[interfacei],
cmpt,
Pstream::defaultCommsType
);
@ -65,18 +65,18 @@ void Foam::lduMatrix::initMatrixInterfaces
// beyond the end of the schedule which only handles "normal" patches
for
(
label interfaceI=patchSchedule.size()/2;
interfaceI<interfaces.size();
interfaceI++
label interfacei=patchSchedule.size()/2;
interfacei<interfaces.size();
interfacei++
)
{
if (interfaces.set(interfaceI))
if (interfaces.set(interfacei))
{
interfaces[interfaceI].initInterfaceMatrixUpdate
interfaces[interfacei].initInterfaceMatrixUpdate
(
result,
psiif,
coupleCoeffs[interfaceI],
coupleCoeffs[interfacei],
cmpt,
Pstream::blocking
);
@ -104,15 +104,15 @@ void Foam::lduMatrix::updateMatrixInterfaces
{
if (Pstream::defaultCommsType == Pstream::blocking)
{
forAll(interfaces, interfaceI)
forAll(interfaces, interfacei)
{
if (interfaces.set(interfaceI))
if (interfaces.set(interfacei))
{
interfaces[interfaceI].updateInterfaceMatrix
interfaces[interfacei].updateInterfaceMatrix
(
result,
psiif,
coupleCoeffs[interfaceI],
coupleCoeffs[interfacei],
cmpt,
Pstream::defaultCommsType
);
@ -128,19 +128,19 @@ void Foam::lduMatrix::updateMatrixInterfaces
{
allUpdated = true;
forAll(interfaces, interfaceI)
forAll(interfaces, interfacei)
{
if (interfaces.set(interfaceI))
if (interfaces.set(interfacei))
{
if (!interfaces[interfaceI].updatedMatrix())
if (!interfaces[interfacei].updatedMatrix())
{
if (interfaces[interfaceI].ready())
if (interfaces[interfacei].ready())
{
interfaces[interfaceI].updateInterfaceMatrix
interfaces[interfacei].updateInterfaceMatrix
(
result,
psiif,
coupleCoeffs[interfaceI],
coupleCoeffs[interfacei],
cmpt,
Pstream::defaultCommsType
);
@ -179,19 +179,19 @@ void Foam::lduMatrix::updateMatrixInterfaces
}
// Consume
forAll(interfaces, interfaceI)
forAll(interfaces, interfacei)
{
if
(
interfaces.set(interfaceI)
&& !interfaces[interfaceI].updatedMatrix()
interfaces.set(interfacei)
&& !interfaces[interfacei].updatedMatrix()
)
{
interfaces[interfaceI].updateInterfaceMatrix
interfaces[interfacei].updateInterfaceMatrix
(
result,
psiif,
coupleCoeffs[interfaceI],
coupleCoeffs[interfacei],
cmpt,
Pstream::defaultCommsType
);
@ -205,28 +205,28 @@ void Foam::lduMatrix::updateMatrixInterfaces
// Loop over all the "normal" interfaces relating to standard patches
forAll(patchSchedule, i)
{
label interfaceI = patchSchedule[i].patch;
label interfacei = patchSchedule[i].patch;
if (interfaces.set(interfaceI))
if (interfaces.set(interfacei))
{
if (patchSchedule[i].init)
{
interfaces[interfaceI].initInterfaceMatrixUpdate
interfaces[interfacei].initInterfaceMatrixUpdate
(
result,
psiif,
coupleCoeffs[interfaceI],
coupleCoeffs[interfacei],
cmpt,
Pstream::scheduled
);
}
else
{
interfaces[interfaceI].updateInterfaceMatrix
interfaces[interfacei].updateInterfaceMatrix
(
result,
psiif,
coupleCoeffs[interfaceI],
coupleCoeffs[interfacei],
cmpt,
Pstream::scheduled
);
@ -238,18 +238,18 @@ void Foam::lduMatrix::updateMatrixInterfaces
// beyond the end of the schedule which only handles "normal" patches
for
(
label interfaceI=patchSchedule.size()/2;
interfaceI<interfaces.size();
interfaceI++
label interfacei=patchSchedule.size()/2;
interfacei<interfaces.size();
interfacei++
)
{
if (interfaces.set(interfaceI))
if (interfaces.set(interfacei))
{
interfaces[interfaceI].updateInterfaceMatrix
interfaces[interfacei].updateInterfaceMatrix
(
result,
psiif,
coupleCoeffs[interfaceI],
coupleCoeffs[interfacei],
cmpt,
Pstream::blocking
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -164,14 +164,14 @@ void Foam::nonBlockingGaussSeidelSmoother::smooth
label fStart;
label fEnd = ownStartPtr[0];
for (label cellI=0; cellI<blockStart; cellI++)
for (label celli=0; celli<blockStart; celli++)
{
// Start and end of this row
fStart = fEnd;
fEnd = ownStartPtr[cellI + 1];
fEnd = ownStartPtr[celli + 1];
// Get the accumulated neighbour side
curPsi = bPrimePtr[cellI];
curPsi = bPrimePtr[celli];
// Accumulate the owner product side
for (label curFace=fStart; curFace<fEnd; curFace++)
@ -180,7 +180,7 @@ void Foam::nonBlockingGaussSeidelSmoother::smooth
}
// Finish current psi
curPsi /= diagPtr[cellI];
curPsi /= diagPtr[celli];
// Distribute the neighbour side using current psi
for (label curFace=fStart; curFace<fEnd; curFace++)
@ -188,7 +188,7 @@ void Foam::nonBlockingGaussSeidelSmoother::smooth
bPrimePtr[uPtr[curFace]] -= lowerPtr[curFace]*curPsi;
}
psiPtr[cellI] = curPsi;
psiPtr[celli] = curPsi;
}
matrix_.updateMatrixInterfaces
@ -201,14 +201,14 @@ void Foam::nonBlockingGaussSeidelSmoother::smooth
);
// Update rest of the cells
for (label cellI=blockStart; cellI < nCells; cellI++)
for (label celli=blockStart; celli < nCells; celli++)
{
// Start and end of this row
fStart = fEnd;
fEnd = ownStartPtr[cellI + 1];
fEnd = ownStartPtr[celli + 1];
// Get the accumulated neighbour side
curPsi = bPrimePtr[cellI];
curPsi = bPrimePtr[celli];
// Accumulate the owner product side
for (label curFace=fStart; curFace<fEnd; curFace++)
@ -217,7 +217,7 @@ void Foam::nonBlockingGaussSeidelSmoother::smooth
}
// Finish current psi
curPsi /= diagPtr[cellI];
curPsi /= diagPtr[celli];
// Distribute the neighbour side using current psi
for (label curFace=fStart; curFace<fEnd; curFace++)
@ -225,7 +225,7 @@ void Foam::nonBlockingGaussSeidelSmoother::smooth
bPrimePtr[uPtr[curFace]] -= lowerPtr[curFace]*curPsi;
}
psiPtr[cellI] = curPsi;
psiPtr[celli] = curPsi;
}
}

View File

@ -591,10 +591,10 @@ bool Foam::GAMGAgglomeration::checkRestriction
{
label nChanged = 0;
forAll(lower, faceI)
forAll(lower, facei)
{
label own = lower[faceI];
label nei = upper[faceI];
label own = lower[facei];
label nei = upper[facei];
if (restrict[own] == restrict[nei])
{
@ -625,13 +625,13 @@ bool Foam::GAMGAgglomeration::checkRestriction
// Count number of regions/masters per coarse cell
labelListList coarseToMasters(nCoarse);
nNewCoarse = 0;
forAll(restrict, cellI)
forAll(restrict, celli)
{
labelList& masters = coarseToMasters[restrict[cellI]];
labelList& masters = coarseToMasters[restrict[celli]];
if (findIndex(masters, master[cellI]) == -1)
if (findIndex(masters, master[celli]) == -1)
{
masters.append(master[cellI]);
masters.append(master[celli]);
nNewCoarse++;
}
}
@ -663,12 +663,12 @@ bool Foam::GAMGAgglomeration::checkRestriction
}
newRestrict.setSize(fineAddressing.size());
forAll(restrict, cellI)
forAll(restrict, celli)
{
label coarseI = restrict[cellI];
label coarseI = restrict[celli];
label index = findIndex(coarseToMasters[coarseI], master[cellI]);
newRestrict[cellI] = coarseToNewCoarse[coarseI][index];
label index = findIndex(coarseToMasters[coarseI], master[celli]);
newRestrict[celli] = coarseToNewCoarse[coarseI][index];
}
return false;

View File

@ -134,9 +134,9 @@ Foam::labelListList Foam::GAMGProcAgglomeration::globalCellCells
);
labelList globalIndices(addr.size());
forAll(globalIndices, cellI)
forAll(globalIndices, celli)
{
globalIndices[cellI] = globalNumbering.toGlobal(myProcID, cellI);
globalIndices[celli] = globalNumbering.toGlobal(myProcID, celli);
}
@ -191,10 +191,10 @@ Foam::labelListList Foam::GAMGProcAgglomeration::globalCellCells
const labelUList& own = addr.lowerAddr();
{
forAll(nbr, faceI)
forAll(nbr, facei)
{
nNbrs[nbr[faceI]]++;
nNbrs[own[faceI]]++;
nNbrs[nbr[facei]]++;
nNbrs[own[facei]]++;
}
forAll(interfaces, inti)
@ -215,19 +215,19 @@ Foam::labelListList Foam::GAMGProcAgglomeration::globalCellCells
// Create cell-cells addressing
labelListList cellCells(addr.size());
forAll(cellCells, cellI)
forAll(cellCells, celli)
{
cellCells[cellI].setSize(nNbrs[cellI], -1);
cellCells[celli].setSize(nNbrs[celli], -1);
}
// Reset the list of number of neighbours to zero
nNbrs = 0;
// Scatter the neighbour faces
forAll(nbr, faceI)
forAll(nbr, facei)
{
label c0 = own[faceI];
label c1 = nbr[faceI];
label c0 = own[facei];
label c1 = nbr[facei];
cellCells[c0][nNbrs[c0]++] = globalIndices[c1];
cellCells[c1][nNbrs[c1]++] = globalIndices[c0];
@ -246,15 +246,15 @@ Foam::labelListList Foam::GAMGProcAgglomeration::globalCellCells
}
}
forAll(cellCells, cellI)
forAll(cellCells, celli)
{
Foam::stableSort(cellCells[cellI]);
Foam::stableSort(cellCells[celli]);
}
// Replace the initial element (always -1) with the local cell
forAll(cellCells, cellI)
forAll(cellCells, celli)
{
cellCells[cellI][0] = globalIndices[cellI];
cellCells[celli][0] = globalIndices[celli];
}
return cellCells;

View File

@ -181,10 +181,10 @@ Foam::procFacesGAMGProcAgglomeration::processorAgglomeration
);
labelList coarseToMaster(nCoarseProcs, labelMax);
forAll(fineToCoarse, cellI)
forAll(fineToCoarse, celli)
{
label coarseI = fineToCoarse[cellI];
coarseToMaster[coarseI] = min(coarseToMaster[coarseI], cellI);
label coarseI = fineToCoarse[celli];
coarseToMaster[coarseI] = min(coarseToMaster[coarseI], celli);
}
// Sort according to master and redo restriction

View File

@ -721,11 +721,11 @@ void Foam::GAMGSolver::procAgglomerateMatrix
//
// //const scalarField& bouCoeffs = allInterfaceBouCoeffs[intI];
// //const scalarField& intCoeffs = allInterfaceIntCoeffs[intI];
// //forAll(bouCoeffs, faceI)
// //forAll(bouCoeffs, facei)
// //{
// // Pout<< " " << faceI
// // << "\tbou:" << bouCoeffs[faceI]
// // << "\tint:" << intCoeffs[faceI]
// // Pout<< " " << facei
// // << "\tbou:" << bouCoeffs[facei]
// // << "\tint:" << intCoeffs[facei]
// // << endl;
// //}
// }

View File

@ -68,15 +68,15 @@ Foam::labelList Foam::bandCompression(const labelListList& cellCellAddressing)
label currentCell = -1;
label minWeight = labelMax;
forAll(visited, cellI)
forAll(visited, celli)
{
// find the lowest connected cell that has not been visited yet
if (!visited[cellI])
if (!visited[celli])
{
if (cellCellAddressing[cellI].size() < minWeight)
if (cellCellAddressing[celli].size() < minWeight)
{
minWeight = cellCellAddressing[cellI].size();
currentCell = cellI;
minWeight = cellCellAddressing[celli].size();
currentCell = celli;
}
}
}
@ -153,15 +153,15 @@ Foam::labelList Foam::bandCompression
{
// Count number of neighbours
labelList numNbrs(offsets.size()-1, 0);
forAll(numNbrs, cellI)
forAll(numNbrs, celli)
{
label start = offsets[cellI];
label end = offsets[cellI+1];
label start = offsets[celli];
label end = offsets[celli+1];
for (label faceI = start; faceI < end; faceI++)
for (label facei = start; facei < end; facei++)
{
numNbrs[cellI]++;
numNbrs[cellCells[faceI]]++;
numNbrs[celli]++;
numNbrs[cellCells[facei]]++;
}
}
@ -193,15 +193,15 @@ Foam::labelList Foam::bandCompression
label currentCell = -1;
label minWeight = labelMax;
forAll(visited, cellI)
forAll(visited, celli)
{
// find the lowest connected cell that has not been visited yet
if (!visited[cellI])
if (!visited[celli])
{
if (numNbrs[cellI] < minWeight)
if (numNbrs[celli] < minWeight)
{
minWeight = numNbrs[cellI];
currentCell = cellI;
minWeight = numNbrs[celli];
currentCell = celli;
}
}
}
@ -245,9 +245,9 @@ Foam::labelList Foam::bandCompression
label start = offsets[currentCell];
label end = offsets[currentCell+1];
for (label faceI = start; faceI < end; faceI++)
for (label facei = start; facei < end; facei++)
{
label nbr = cellCells[faceI];
label nbr = cellCells[facei];
if (!visited[nbr])
{
// not visited, add to the list

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -101,10 +101,10 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const InfoProxy<lduMesh>& ip)
{
const labelList& l = addr.lowerAddr();
const labelList& u = addr.upperAddr();
forAll(l, faceI)
forAll(l, facei)
{
os << " face:" << faceI << " l:" << l[faceI]
<< " u:" << u[faceI] << endl;
os << " face:" << facei << " l:" << l[facei]
<< " u:" << u[facei] << endl;
}
forAll(interfaces, i)
{

View File

@ -64,45 +64,45 @@ void Foam::lduPrimitiveMesh::checkUpperTriangular
const labelUList& u
)
{
forAll(l, faceI)
forAll(l, facei)
{
if (u[faceI] < l[faceI])
if (u[facei] < l[facei])
{
FatalErrorInFunction
<< "Reversed face. Problem at face " << faceI
<< " l:" << l[faceI] << " u:" << u[faceI]
<< "Reversed face. Problem at face " << facei
<< " l:" << l[facei] << " u:" << u[facei]
<< abort(FatalError);
}
if (l[faceI] < 0 || u[faceI] < 0 || u[faceI] >= size)
if (l[facei] < 0 || u[facei] < 0 || u[facei] >= size)
{
FatalErrorInFunction
<< "Illegal cell label. Problem at face " << faceI
<< " l:" << l[faceI] << " u:" << u[faceI]
<< "Illegal cell label. Problem at face " << facei
<< " l:" << l[facei] << " u:" << u[facei]
<< abort(FatalError);
}
}
for (label faceI=1; faceI < l.size(); faceI++)
for (label facei=1; facei < l.size(); facei++)
{
if (l[faceI-1] > l[faceI])
if (l[facei-1] > l[facei])
{
FatalErrorInFunction
<< "Lower not in incremental cell order."
<< " Problem at face " << faceI
<< " l:" << l[faceI] << " u:" << u[faceI]
<< " previous l:" << l[faceI-1]
<< " Problem at face " << facei
<< " l:" << l[facei] << " u:" << u[facei]
<< " previous l:" << l[facei-1]
<< abort(FatalError);
}
else if (l[faceI-1] == l[faceI])
else if (l[facei-1] == l[facei])
{
// Same cell.
if (u[faceI-1] > u[faceI])
if (u[facei-1] > u[facei])
{
FatalErrorInFunction
<< "Upper not in incremental cell order."
<< " Problem at face " << faceI
<< " l:" << l[faceI] << " u:" << u[faceI]
<< " previous u:" << u[faceI-1]
<< " Problem at face " << facei
<< " l:" << l[facei] << " u:" << u[facei]
<< " previous u:" << u[facei-1]
<< abort(FatalError);
}
}
@ -135,34 +135,34 @@ Foam::labelList Foam::lduPrimitiveMesh::upperTriOrder
labelList nNbrs(nCells, 0);
// Count number of upper neighbours
forAll(lower, faceI)
forAll(lower, facei)
{
if (upper[faceI] < lower[faceI])
if (upper[facei] < lower[facei])
{
FatalErrorInFunction
<< "Problem at face:" << faceI
<< " lower:" << lower[faceI]
<< " upper:" << upper[faceI]
<< "Problem at face:" << facei
<< " lower:" << lower[facei]
<< " upper:" << upper[facei]
<< exit(FatalError);
}
nNbrs[lower[faceI]]++;
nNbrs[lower[facei]]++;
}
// Construct cell-upper cell addressing
labelList offsets(nCells+1);
offsets[0] = 0;
forAll(nNbrs, cellI)
forAll(nNbrs, celli)
{
offsets[cellI+1] = offsets[cellI]+nNbrs[cellI];
offsets[celli+1] = offsets[celli]+nNbrs[celli];
}
nNbrs = offsets;
labelList cellToFaces(offsets.last());
forAll(upper, faceI)
forAll(upper, facei)
{
label cellI = lower[faceI];
cellToFaces[nNbrs[cellI]++] = faceI;
label celli = lower[facei];
cellToFaces[nNbrs[celli]++] = facei;
}
// Sort
@ -174,16 +174,16 @@ Foam::labelList Foam::lduPrimitiveMesh::upperTriOrder
label newFaceI = 0;
for (label cellI = 0; cellI < nCells; cellI++)
for (label celli = 0; celli < nCells; celli++)
{
label startOfCell = offsets[cellI];
label nNbr = offsets[cellI+1] - startOfCell;
label startOfCell = offsets[celli];
label nNbr = offsets[celli+1] - startOfCell;
nbr.setSize(nNbr);
order.setSize(nNbr);
forAll(order, i)
{
nbr[i] = upper[cellToFaces[offsets[cellI]+i]];
nbr[i] = upper[cellToFaces[offsets[celli]+i]];
}
sortedOrder(nbr, order);
@ -509,18 +509,18 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
forAll(elems, i)
{
label procMeshI = elems[i][0];
label interfaceI = elems[i][1];
label interfacei = elems[i][1];
const lduInterfacePtrsList interfaces =
mesh(myMesh, otherMeshes, procMeshI).interfaces();
const processorLduInterface& pldui =
refCast<const processorLduInterface>
(
interfaces[interfaceI]
interfaces[interfacei]
);
Pout<< " proc:" << procIDs[procMeshI]
<< " interfaceI:" << interfaceI
<< " interfacei:" << interfacei
<< " between:" << pldui.myProcNo()
<< " and:" << pldui.neighbProcNo()
<< endl;
@ -539,17 +539,17 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
forAll(elems, i)
{
label procMeshI = elems[i][0];
label interfaceI = elems[i][1];
label interfacei = elems[i][1];
const lduInterfacePtrsList interfaces =
mesh(myMesh, otherMeshes, procMeshI).interfaces();
const processorLduInterface& pldui =
refCast<const processorLduInterface>
(
interfaces[interfaceI]
interfaces[interfacei]
);
Pout<< " proc:" << procIDs[procMeshI]
<< " interfaceI:" << interfaceI
<< " interfacei:" << interfacei
<< " between:" << pldui.myProcNo()
<< " and:" << pldui.neighbProcNo()
<< endl;
@ -600,10 +600,10 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
// Add internal faces
label allFaceI = faceOffsets[procMeshI];
forAll(l, faceI)
forAll(l, facei)
{
lowerAddr_[allFaceI] = cellOffsets[procMeshI]+l[faceI];
upperAddr_[allFaceI] = cellOffsets[procMeshI]+u[faceI];
lowerAddr_[allFaceI] = cellOffsets[procMeshI]+l[facei];
upperAddr_[allFaceI] = cellOffsets[procMeshI]+u[facei];
allFaceI++;
}
@ -647,7 +647,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
forAll(elems, i)
{
label procI = elems[i][0];
label interfaceI = elems[i][1];
label interfacei = elems[i][1];
const lduInterfacePtrsList interfaces =
mesh
(
@ -658,7 +658,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
const processorLduInterface& pldui =
refCast<const processorLduInterface>
(
interfaces[interfaceI]
interfaces[interfacei]
);
if
@ -795,7 +795,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
interfaces_.setSize(unmergedMap.size() + nOtherInterfaces);
primitiveInterfaces_.setSize(interfaces_.size());
label allInterfaceI = 0;
label allInterfacei = 0;
forAllConstIter(EdgeMap<labelPairList>, unmergedMap, iter)
{
@ -808,7 +808,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
{
const labelPair& elem = elems[i];
label procMeshI = elem[0];
label interfaceI = elem[1];
label interfacei = elem[1];
const lduInterfacePtrsList interfaces = mesh
(
myMesh,
@ -819,7 +819,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
const processorLduInterface& pldui =
refCast<const processorLduInterface>
(
interfaces[interfaceI]
interfaces[interfacei]
);
label myProcNo = pldui.myProcNo();
label nbrProcNo = pldui.neighbProcNo();
@ -840,7 +840,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
{
const labelPair& elem = elems[order[i]];
label procMeshI = elem[0];
label interfaceI = elem[1];
label interfacei = elem[1];
const lduInterfacePtrsList interfaces = mesh
(
myMesh,
@ -848,7 +848,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
procMeshI
).interfaces();
n += interfaces[interfaceI].faceCells().size();
n += interfaces[interfacei].faceCells().size();
}
// Size
@ -861,7 +861,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
{
const labelPair& elem = elems[order[i]];
label procMeshI = elem[0];
label interfaceI = elem[1];
label interfacei = elem[1];
const lduInterfacePtrsList interfaces = mesh
(
myMesh,
@ -869,17 +869,17 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
procMeshI
).interfaces();
boundaryMap[procMeshI][interfaceI] = allInterfaceI;
labelList& bfMap = boundaryFaceMap[procMeshI][interfaceI];
boundaryMap[procMeshI][interfacei] = allInterfacei;
labelList& bfMap = boundaryFaceMap[procMeshI][interfacei];
const labelUList& l = interfaces[interfaceI].faceCells();
const labelUList& l = interfaces[interfacei].faceCells();
bfMap.setSize(l.size());
forAll(l, faceI)
forAll(l, facei)
{
allFaceCells[n] = cellOffsets[procMeshI]+l[faceI];
allFaceCells[n] = cellOffsets[procMeshI]+l[facei];
allFaceRestrictAddressing[n] = n;
bfMap[faceI] = n;
bfMap[facei] = n;
n++;
}
}
@ -916,10 +916,10 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
primitiveInterfaces_.set
(
allInterfaceI,
allInterfacei,
new processorGAMGInterface
(
allInterfaceI,
allInterfacei,
interfaces_,
allFaceCells,
allFaceRestrictAddressing,
@ -930,12 +930,12 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
Pstream::msgType() // tag
)
);
interfaces_.set(allInterfaceI, &primitiveInterfaces_[allInterfaceI]);
interfaces_.set(allInterfacei, &primitiveInterfaces_[allInterfacei]);
if (debug)
{
Pout<< "Created " << interfaces_[allInterfaceI].type()
<< " interface at " << allInterfaceI
Pout<< "Created " << interfaces_[allInterfacei].type()
<< " interface at " << allInterfacei
<< " comm:" << comm_
<< " myProcNo:" << myAgglom
<< " neighbProcNo:" << neighbProcNo
@ -944,7 +944,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
}
allInterfaceI++;
allInterfacei++;
}

View File

@ -41,9 +41,9 @@ Foam::labelList Foam::cell::labels(const faceUList& f) const
const labelList& faces = *this;
forAll(faces, faceI)
forAll(faces, facei)
{
maxVert += f[faces[faceI]].size();
maxVert += f[faces[facei]].size();
}
// set the fill-in list
@ -63,9 +63,9 @@ Foam::labelList Foam::cell::labels(const faceUList& f) const
// go through the rest of the faces. For each vertex, check if the point is
// already inserted (up to maxVert, which now carries the number of real
// points. If not, add it at the end of the list.
for (label faceI = 1; faceI < faces.size(); faceI++)
for (label facei = 1; facei < faces.size(); facei++)
{
const labelList& curFace = f[faces[faceI]];
const labelList& curFace = f[faces[facei]];
forAll(curFace, pointI)
{
@ -126,17 +126,17 @@ Foam::edgeList Foam::cell::edges(const faceUList& f) const
// create a list of edges
label maxNoEdges = 0;
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
maxNoEdges += f[curFaces[faceI]].nEdges();
maxNoEdges += f[curFaces[facei]].nEdges();
}
edgeList allEdges(maxNoEdges);
label nEdges = 0;
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
const edgeList curFaceEdges = f[curFaces[faceI]].edges();
const edgeList curFaceEdges = f[curFaces[facei]].edges();
forAll(curFaceEdges, faceEdgeI)
{
@ -197,10 +197,10 @@ Foam::point Foam::cell::centre
const labelList& faces = *this;
forAll(faces, faceI)
forAll(faces, facei)
{
scalar a = f[faces[faceI]].mag(p);
cEst += f[faces[faceI]].centre(p)*a;
scalar a = f[faces[facei]].mag(p);
cEst += f[faces[facei]].centre(p)*a;
sumArea += a;
}
@ -212,13 +212,13 @@ Foam::point Foam::cell::centre
scalar sumV = 0;
forAll(faces, faceI)
forAll(faces, facei)
{
// calculate pyramid volume. If it is greater than zero, OK.
// If not, the pyramid is inside-out. Create a face with the opposite
// order and recalculate pyramid centre!
scalar pyrVol = pyramidPointFaceRef(f[faces[faceI]], cEst).mag(p);
vector pyrCentre = pyramidPointFaceRef(f[faces[faceI]], cEst).centre(p);
scalar pyrVol = pyramidPointFaceRef(f[faces[facei]], cEst).mag(p);
vector pyrCentre = pyramidPointFaceRef(f[faces[facei]], cEst).centre(p);
// if pyramid inside-out because face points inwards invert
// N.B. pyramid remains unchanged
@ -256,9 +256,9 @@ Foam::scalar Foam::cell::mag
const labelList& faces = *this;
forAll(faces, faceI)
forAll(faces, facei)
{
cEst += f[faces[faceI]].centre(p);
cEst += f[faces[facei]].centre(p);
nCellFaces += 1;
}
@ -267,9 +267,9 @@ Foam::scalar Foam::cell::mag
// Calculate the magnitude by summing the mags of the pyramids
scalar v = 0;
forAll(faces, faceI)
forAll(faces, facei)
{
v += ::Foam::mag(pyramidPointFaceRef(f[faces[faceI]], cEst).mag(p));
v += ::Foam::mag(pyramidPointFaceRef(f[faces[facei]], cEst).mag(p));
}
return v;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -54,15 +54,15 @@ Foam::label Foam::cell::opposingFaceLabel
label oppositeFaceLabel = -1;
forAll(curFaceLabels, faceI)
forAll(curFaceLabels, facei)
{
// Compare the face with the master
const face& curFace = meshFaces[curFaceLabels[faceI]];
const face& curFace = meshFaces[curFaceLabels[facei]];
// Skip the master face
if
(
curFaceLabels[faceI] != masterFaceLabel
curFaceLabels[facei] != masterFaceLabel
&& curFace.size() == masterFace.size()
)
{
@ -92,7 +92,7 @@ Foam::label Foam::cell::opposingFaceLabel
if (oppositeFaceLabel == -1)
{
// Found opposite face
oppositeFaceLabel = curFaceLabels[faceI];
oppositeFaceLabel = curFaceLabels[facei];
}
else
{
@ -100,7 +100,7 @@ Foam::label Foam::cell::opposingFaceLabel
// Non-prismatic cell
Info<< "Multiple faces not sharing vertex: "
<< oppositeFaceLabel << " and "
<< curFaceLabels[faceI] << endl;
<< curFaceLabels[facei] << endl;
return -1;
}
}

View File

@ -54,9 +54,9 @@ Foam::cellMatcher::cellMatcher
cellModelName_(cellModelName),
cellModelPtr_(NULL)
{
forAll(localFaces_, faceI)
forAll(localFaces_, facei)
{
face& f = localFaces_[faceI];
face& f = localFaces_[facei];
f.setSize(maxVertPerFace);
}
@ -83,9 +83,9 @@ Foam::label Foam::cellMatcher::calcLocalFaces
label newVertI = 0;
forAll(myFaces, myFaceI)
{
label faceI = myFaces[myFaceI];
label facei = myFaces[myFaceI];
const face& f = faces[faceI];
const face& f = faces[facei];
face& localFace = localFaces_[myFaceI];
// Size of localFace
@ -118,7 +118,7 @@ Foam::label Foam::cellMatcher::calcLocalFaces
}
// Create face from localvertex labels
faceMap_[myFaceI] = faceI;
faceMap_[myFaceI] = facei;
}
// Create local to global vertex mapping
@ -248,13 +248,13 @@ void Foam::cellMatcher::write(Foam::Ostream& os) const
{
os << "Faces:" << endl;
forAll(localFaces_, faceI)
forAll(localFaces_, facei)
{
os << " ";
for (label fp = 0; fp < faceSize_[faceI]; fp++)
for (label fp = 0; fp < faceSize_[facei]; fp++)
{
os << ' ' << localFaces_[faceI][fp];
os << ' ' << localFaces_[facei][fp];
}
os << endl;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -35,7 +35,7 @@ Description
hexMatcher hex(mesh);
cellShape shape;
..
bool isHex = hex.match(cellI, shape);
bool isHex = hex.match(celli, shape);
\endverbatim
Now shape is set to the correct Hex cellShape (if \a isHex is true)
@ -242,20 +242,20 @@ public:
// matching. Returns true and sets vertLabels_.
// Needs faces, faceOwner of all faces in 'mesh' and cell number
// and labels of faces for this cell.
// cellI only used in combination with faceOwner to detect owner
// celli only used in combination with faceOwner to detect owner
// status.
virtual bool matchShape
(
const bool checkOnly,
const faceList& faces,
const labelList& faceOwner,
const label cellI,
const label celli,
const labelList& myFaces
) = 0;
//- Exact match. Uses faceSizeMatch.
// Returns true if cell matches shape exactly.
virtual bool isA(const primitiveMesh& mesh, const label cellI) = 0;
virtual bool isA(const primitiveMesh& mesh, const label celli) = 0;
//- Exact match given all the faces forming a cell. No checks
// on whether faces match up and form a closed shape.
@ -265,7 +265,7 @@ public:
virtual bool matches
(
const primitiveMesh& mesh,
const label cellI,
const label celli,
cellShape& shape
) = 0;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -40,33 +40,33 @@ Foam::cellShape Foam::degenerateMatcher::match
(
const faceList& faces,
const labelList& owner,
const label cellI,
const label celli,
const labelList& cellFaces
)
{
// Recognize in order of assumed occurrence.
if (hex.matchShape(false, faces, owner, cellI, cellFaces))
if (hex.matchShape(false, faces, owner, celli, cellFaces))
{
return cellShape(hex.model(), hex.vertLabels());
}
else if (tet.matchShape(false, faces, owner, cellI, cellFaces))
else if (tet.matchShape(false, faces, owner, celli, cellFaces))
{
return cellShape(tet.model(), tet.vertLabels());
}
else if (prism.matchShape(false, faces, owner, cellI, cellFaces))
else if (prism.matchShape(false, faces, owner, celli, cellFaces))
{
return cellShape(prism.model(), prism.vertLabels());
}
else if (pyr.matchShape(false, faces, owner, cellI, cellFaces))
else if (pyr.matchShape(false, faces, owner, celli, cellFaces))
{
return cellShape(pyr.model(), pyr.vertLabels());
}
else if (wedge.matchShape(false, faces, owner, cellI, cellFaces))
else if (wedge.matchShape(false, faces, owner, celli, cellFaces))
{
return cellShape(wedge.model(), wedge.vertLabels());
}
else if (tetWedge.matchShape(false, faces, owner, cellI, cellFaces))
else if (tetWedge.matchShape(false, faces, owner, celli, cellFaces))
{
return cellShape(tetWedge.model(), tetWedge.vertLabels());
}
@ -100,15 +100,15 @@ Foam::cellShape Foam::degenerateMatcher::match(const cellShape& shape)
Foam::cellShape Foam::degenerateMatcher::match
(
const primitiveMesh& mesh,
const label cellI
const label celli
)
{
return match
(
mesh.faces(),
mesh.faceOwner(),
cellI,
mesh.cells()[cellI]
celli,
mesh.cells()[celli]
);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -75,7 +75,7 @@ class degenerateMatcher
(
const faceList& faces,
const labelList& faceOwner,
const label cellI,
const label celli,
const labelList& cellFaces
);
@ -90,8 +90,8 @@ public:
// vertices. cellShape just used to extract faces.
static cellShape match(const cellShape& shape);
//- Recognize shape given mesh and cellI
static cellShape match(const primitiveMesh& mesh, const label cellI);
//- Recognize shape given mesh and celli
static cellShape match(const primitiveMesh& mesh, const label celli);
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -61,7 +61,7 @@ bool Foam::hexMatcher::matchShape
const bool checkOnly,
const faceList& faces,
const labelList& owner,
const label cellI,
const label celli,
const labelList& myFaces
)
{
@ -115,7 +115,7 @@ bool Foam::hexMatcher::matchShape
(
face4vert0,
faceSize_[face4I],
!(owner[faceMap_[face4I]] == cellI)
!(owner[faceMap_[face4I]] == celli)
);
vertLabels_[1] = pointMap_[face4[face4vert1]];
@ -125,7 +125,7 @@ bool Foam::hexMatcher::matchShape
(
face4vert1,
faceSize_[face4I],
!(owner[faceMap_[face4I]] == cellI)
!(owner[faceMap_[face4I]] == celli)
);
vertLabels_[2] = pointMap_[face4[face4vert2]];
@ -135,7 +135,7 @@ bool Foam::hexMatcher::matchShape
(
face4vert2,
faceSize_[face4I],
!(owner[faceMap_[face4I]] == cellI)
!(owner[faceMap_[face4I]] == celli)
);
vertLabels_[3] = pointMap_[face4[face4vert3]];
@ -159,7 +159,7 @@ bool Foam::hexMatcher::matchShape
(
face0vert0,
faceSize_[face0I],
(owner[faceMap_[face0I]] == cellI)
(owner[faceMap_[face0I]] == celli)
);
vertLabels_[4] = pointMap_[face0[face0vert4]];
@ -169,7 +169,7 @@ bool Foam::hexMatcher::matchShape
(
face0vert4,
faceSize_[face0I],
(owner[faceMap_[face0I]] == cellI)
(owner[faceMap_[face0I]] == celli)
);
vertLabels_[7] = pointMap_[face0[face0vert7]];
@ -193,7 +193,7 @@ bool Foam::hexMatcher::matchShape
(
face5vert4,
faceSize_[face5I],
(owner[faceMap_[face5I]] == cellI)
(owner[faceMap_[face5I]] == celli)
);
vertLabels_[5] = pointMap_[face5[face5vert5]];
@ -203,7 +203,7 @@ bool Foam::hexMatcher::matchShape
(
face5vert5,
faceSize_[face5I],
(owner[faceMap_[face5I]] == cellI)
(owner[faceMap_[face5I]] == celli)
);
vertLabels_[6] = pointMap_[face5[face5vert6]];
@ -275,15 +275,15 @@ bool Foam::hexMatcher::faceSizeMatch
}
bool Foam::hexMatcher::isA(const primitiveMesh& mesh, const label cellI)
bool Foam::hexMatcher::isA(const primitiveMesh& mesh, const label celli)
{
return matchShape
(
true,
mesh.faces(),
mesh.faceOwner(),
cellI,
mesh.cells()[cellI]
celli,
mesh.cells()[celli]
);
}
@ -305,7 +305,7 @@ bool Foam::hexMatcher::isA(const faceList& faces)
bool Foam::hexMatcher::matches
(
const primitiveMesh& mesh,
const label cellI,
const label celli,
cellShape& shape
)
{
@ -316,8 +316,8 @@ bool Foam::hexMatcher::matches
false,
mesh.faces(),
mesh.faceOwner(),
cellI,
mesh.cells()[cellI]
celli,
mesh.cells()[celli]
)
)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -107,18 +107,18 @@ public:
const bool checkOnly,
const faceList& faces,
const labelList& faceOwner,
const label cellI,
const label celli,
const labelList& myFaces
);
virtual bool isA(const primitiveMesh& mesh, const label cellI);
virtual bool isA(const primitiveMesh& mesh, const label celli);
virtual bool isA(const faceList&);
virtual bool matches
(
const primitiveMesh& mesh,
const label cellI,
const label celli,
cellShape& shape
);
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -59,7 +59,7 @@ bool Foam::prismMatcher::matchShape
const bool checkOnly,
const faceList& faces,
const labelList& owner,
const label cellI,
const label celli,
const labelList& myFaces
)
{
@ -93,11 +93,11 @@ bool Foam::prismMatcher::matchShape
//
label face0I = -1;
forAll(faceSize_, faceI)
forAll(faceSize_, facei)
{
if (faceSize_[faceI] == 3)
if (faceSize_[facei] == 3)
{
face0I = faceI;
face0I = facei;
break;
}
}
@ -122,7 +122,7 @@ bool Foam::prismMatcher::matchShape
(
face0vert0,
faceSize_[face0I],
!(owner[faceMap_[face0I]] == cellI)
!(owner[faceMap_[face0I]] == celli)
);
vertLabels_[1] = pointMap_[face0[face0vert1]];
//Info<< "Prism vertex 1: vertex " << face0[face0vert1]
@ -164,7 +164,7 @@ bool Foam::prismMatcher::matchShape
(
face4vert1,
faceSize_[face4I],
(owner[faceMap_[face4I]] == cellI)
(owner[faceMap_[face4I]] == celli)
);
vertLabels_[4] = pointMap_[face4[face4vert4]];
//Info<< "Prism vertex 4: vertex " << face4[face4vert4]
@ -177,7 +177,7 @@ bool Foam::prismMatcher::matchShape
(
face4vert4,
faceSize_[face4I],
(owner[faceMap_[face4I]] == cellI)
(owner[faceMap_[face4I]] == celli)
);
vertLabels_[3] = pointMap_[face4[face4vert3]];
//Info<< "Prism vertex 3: vertex " << face4[face4vert3]
@ -226,7 +226,7 @@ bool Foam::prismMatcher::matchShape
(
face0vert1,
faceSize_[face0I],
!(owner[faceMap_[face0I]] == cellI)
!(owner[faceMap_[face0I]] == celli)
);
vertLabels_[2] = pointMap_[face0[face0vert2]];
//Info<< "Prism vertex 2: vertex " << face0[face0vert2]
@ -260,7 +260,7 @@ bool Foam::prismMatcher::matchShape
(
face3vert2,
faceSize_[face3I],
(owner[faceMap_[face3I]] == cellI)
(owner[faceMap_[face3I]] == celli)
);
vertLabels_[5] = pointMap_[face3[face3vert5]];
//Info<< "Prism vertex 5: vertex " << face3[face3vert5]
@ -340,15 +340,15 @@ bool Foam::prismMatcher::faceSizeMatch
}
bool Foam::prismMatcher::isA(const primitiveMesh& mesh, const label cellI)
bool Foam::prismMatcher::isA(const primitiveMesh& mesh, const label celli)
{
return matchShape
(
true,
mesh.faces(),
mesh.faceOwner(),
cellI,
mesh.cells()[cellI]
celli,
mesh.cells()[celli]
);
}
@ -370,7 +370,7 @@ bool Foam::prismMatcher::isA(const faceList& faces)
bool Foam::prismMatcher::matches
(
const primitiveMesh& mesh,
const label cellI,
const label celli,
cellShape& shape
)
{
@ -381,8 +381,8 @@ bool Foam::prismMatcher::matches
false,
mesh.faces(),
mesh.faceOwner(),
cellI,
mesh.cells()[cellI]
celli,
mesh.cells()[celli]
)
)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -107,18 +107,18 @@ public:
const bool checkOnly,
const faceList& faces,
const labelList& faceOwner,
const label cellI,
const label celli,
const labelList& myFaces
);
virtual bool isA(const primitiveMesh& mesh, const label cellI);
virtual bool isA(const primitiveMesh& mesh, const label celli);
virtual bool isA(const faceList&);
virtual bool matches
(
const primitiveMesh& mesh,
const label cellI,
const label celli,
cellShape& shape
);
};

View File

@ -64,7 +64,7 @@ bool Foam::pyrMatcher::matchShape
const bool checkOnly,
const faceList& faces,
const labelList& owner,
const label cellI,
const label celli,
const labelList& myFaces
)
{
@ -102,11 +102,11 @@ bool Foam::pyrMatcher::matchShape
//
label face0I = -1;
forAll(faceSize_, faceI)
forAll(faceSize_, facei)
{
if (faceSize_[faceI] == 4)
if (faceSize_[facei] == 4)
{
face0I = faceI;
face0I = facei;
break;
}
}
@ -128,7 +128,7 @@ bool Foam::pyrMatcher::matchShape
(
face0vert0,
faceSize_[face0I],
!(owner[faceMap_[face0I]] == cellI)
!(owner[faceMap_[face0I]] == celli)
);
vertLabels_[1] = pointMap_[face0[face0vert1]];
@ -138,7 +138,7 @@ bool Foam::pyrMatcher::matchShape
(
face0vert1,
faceSize_[face0I],
!(owner[faceMap_[face0I]] == cellI)
!(owner[faceMap_[face0I]] == celli)
);
vertLabels_[2] = pointMap_[face0[face0vert2]];
@ -148,7 +148,7 @@ bool Foam::pyrMatcher::matchShape
(
face0vert2,
faceSize_[face0I],
!(owner[faceMap_[face0I]] == cellI)
!(owner[faceMap_[face0I]] == celli)
);
vertLabels_[3] = pointMap_[face0[face0vert3]];
@ -207,7 +207,7 @@ bool Foam::pyrMatcher::matchShape
(
face4vert0,
faceSize_[face4I],
!(owner[faceMap_[face4I]] == cellI)
!(owner[faceMap_[face4I]] == celli)
);
vertLabels_[4] = pointMap_[face4[face4vert4]];
@ -264,15 +264,15 @@ bool Foam::pyrMatcher::faceSizeMatch
}
bool Foam::pyrMatcher::isA(const primitiveMesh& mesh, const label cellI)
bool Foam::pyrMatcher::isA(const primitiveMesh& mesh, const label celli)
{
return matchShape
(
true,
mesh.faces(),
mesh.faceOwner(),
cellI,
mesh.cells()[cellI]
celli,
mesh.cells()[celli]
);
}
@ -294,7 +294,7 @@ bool Foam::pyrMatcher::isA(const faceList& faces)
bool Foam::pyrMatcher::matches
(
const primitiveMesh& mesh,
const label cellI,
const label celli,
cellShape& shape
)
{
@ -305,8 +305,8 @@ bool Foam::pyrMatcher::matches
false,
mesh.faces(),
mesh.faceOwner(),
cellI,
mesh.cells()[cellI]
celli,
mesh.cells()[celli]
)
)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -107,18 +107,18 @@ public:
const bool checkOnly,
const faceList& faces,
const labelList& faceOwner,
const label cellI,
const label celli,
const labelList& myFaces
);
virtual bool isA(const primitiveMesh& mesh, const label cellI);
virtual bool isA(const primitiveMesh& mesh, const label celli);
virtual bool isA(const faceList&);
virtual bool matches
(
const primitiveMesh& mesh,
const label cellI,
const label celli,
cellShape& shape
);
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -65,7 +65,7 @@ bool Foam::tetMatcher::matchShape
const bool checkOnly,
const faceList& faces,
const labelList& owner,
const label cellI,
const label celli,
const labelList& myFaces
)
{
@ -120,7 +120,7 @@ bool Foam::tetMatcher::matchShape
(
face3vert0,
faceSize_[face3I],
!(owner[faceMap_[face3I]] == cellI)
!(owner[faceMap_[face3I]] == celli)
);
vertLabels_[1] = pointMap_[face3[face3vert1]];
@ -130,7 +130,7 @@ bool Foam::tetMatcher::matchShape
(
face3vert1,
faceSize_[face3I],
!(owner[faceMap_[face3I]] == cellI)
!(owner[faceMap_[face3I]] == celli)
);
vertLabels_[2] = pointMap_[face3[face3vert2]];
@ -177,7 +177,7 @@ bool Foam::tetMatcher::matchShape
(
face1vert0,
faceSize_[face1I],
(owner[faceMap_[face1I]] == cellI)
(owner[faceMap_[face1I]] == celli)
);
vertLabels_[3] = pointMap_[face1[face1vert3]];
@ -215,15 +215,15 @@ bool Foam::tetMatcher::faceSizeMatch
}
bool Foam::tetMatcher::isA(const primitiveMesh& mesh, const label cellI)
bool Foam::tetMatcher::isA(const primitiveMesh& mesh, const label celli)
{
return matchShape
(
true,
mesh.faces(),
mesh.faceOwner(),
cellI,
mesh.cells()[cellI]
celli,
mesh.cells()[celli]
);
}
@ -245,7 +245,7 @@ bool Foam::tetMatcher::isA(const faceList& faces)
bool Foam::tetMatcher::matches
(
const primitiveMesh& mesh,
const label cellI,
const label celli,
cellShape& shape
)
{
@ -256,8 +256,8 @@ bool Foam::tetMatcher::matches
false,
mesh.faces(),
mesh.faceOwner(),
cellI,
mesh.cells()[cellI]
celli,
mesh.cells()[celli]
)
)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -107,18 +107,18 @@ public:
const bool checkOnly,
const faceList& faces,
const labelList& faceOwner,
const label cellI,
const label celli,
const labelList& myFaces
);
virtual bool isA(const primitiveMesh& mesh, const label cellI);
virtual bool isA(const primitiveMesh& mesh, const label celli);
virtual bool isA(const faceList&);
virtual bool matches
(
const primitiveMesh& mesh,
const label cellI,
const label celli,
cellShape& shape
);
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -64,7 +64,7 @@ bool Foam::tetWedgeMatcher::matchShape
const bool checkOnly,
const faceList& faces,
const labelList& owner,
const label cellI,
const label celli,
const labelList& myFaces
)
{
@ -103,11 +103,11 @@ bool Foam::tetWedgeMatcher::matchShape
//
label face0I = -1;
forAll(faceSize_, faceI)
forAll(faceSize_, facei)
{
if (faceSize_[faceI] == 3)
if (faceSize_[facei] == 3)
{
face0I = faceI;
face0I = facei;
break;
}
}
@ -131,7 +131,7 @@ bool Foam::tetWedgeMatcher::matchShape
(
face0vert0,
faceSize_[face0I],
!(owner[faceMap_[face0I]] == cellI)
!(owner[faceMap_[face0I]] == celli)
);
vertLabels_[1] = pointMap_[face0[face0vert1]];
@ -160,7 +160,7 @@ bool Foam::tetWedgeMatcher::matchShape
(
face0vert1,
faceSize_[face0I],
!(owner[faceMap_[face0I]] == cellI)
!(owner[faceMap_[face0I]] == celli)
);
vertLabels_[2] = pointMap_[face0[face0vert2]];
@ -195,7 +195,7 @@ bool Foam::tetWedgeMatcher::matchShape
(
face3vert2,
faceSize_[face3I],
(owner[faceMap_[face3I]] == cellI)
(owner[faceMap_[face3I]] == celli)
);
const face& face3 = localFaces_[face3I];
@ -208,7 +208,7 @@ bool Foam::tetWedgeMatcher::matchShape
(
face3vert4,
faceSize_[face3I],
(owner[faceMap_[face3I]] == cellI)
(owner[faceMap_[face3I]] == celli)
);
vertLabels_[3] = pointMap_[face3[face3vert3]];
@ -268,15 +268,15 @@ bool Foam::tetWedgeMatcher::faceSizeMatch
}
bool Foam::tetWedgeMatcher::isA(const primitiveMesh& mesh, const label cellI)
bool Foam::tetWedgeMatcher::isA(const primitiveMesh& mesh, const label celli)
{
return matchShape
(
true,
mesh.faces(),
mesh.faceOwner(),
cellI,
mesh.cells()[cellI]
celli,
mesh.cells()[celli]
);
}
@ -298,7 +298,7 @@ bool Foam::tetWedgeMatcher::isA(const faceList& faces)
bool Foam::tetWedgeMatcher::matches
(
const primitiveMesh& mesh,
const label cellI,
const label celli,
cellShape& shape
)
{
@ -309,8 +309,8 @@ bool Foam::tetWedgeMatcher::matches
false,
mesh.faces(),
mesh.faceOwner(),
cellI,
mesh.cells()[cellI]
celli,
mesh.cells()[celli]
)
)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -107,18 +107,18 @@ public:
const bool checkOnly,
const faceList& faces,
const labelList& faceOwner,
const label cellI,
const label celli,
const labelList& myFaces
);
virtual bool isA(const primitiveMesh& mesh, const label cellI);
virtual bool isA(const primitiveMesh& mesh, const label celli);
virtual bool isA(const faceList&);
virtual bool matches
(
const primitiveMesh& mesh,
const label cellI,
const label celli,
cellShape& shape
);
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -61,7 +61,7 @@ bool Foam::wedgeMatcher::matchShape
const bool checkOnly,
const faceList& faces,
const labelList& owner,
const label cellI,
const label celli,
const labelList& myFaces
)
{
@ -94,11 +94,11 @@ bool Foam::wedgeMatcher::matchShape
//
label face0I = -1;
forAll(faceSize_, faceI)
forAll(faceSize_, facei)
{
if (faceSize_[faceI] == 3)
if (faceSize_[facei] == 3)
{
face0I = faceI;
face0I = facei;
break;
}
}
@ -125,7 +125,7 @@ bool Foam::wedgeMatcher::matchShape
(
face0vert0,
faceSize_[face0I],
!(owner[faceMap_[face0I]] == cellI)
!(owner[faceMap_[face0I]] == celli)
);
vertLabels_[1] = pointMap_[face0[face0vert1]];
//Info<< "Wedge vertex 1: vertex " << face0[face0vert1]
@ -175,7 +175,7 @@ bool Foam::wedgeMatcher::matchShape
(
face4vert0,
faceSize_[face4I],
!(owner[faceMap_[face4I]] == cellI)
!(owner[faceMap_[face4I]] == celli)
);
vertLabels_[3] = pointMap_[face4[face4vert3]];
//Info<< "Wedge vertex 3: vertex " << face4[face4vert3]
@ -223,7 +223,7 @@ bool Foam::wedgeMatcher::matchShape
(
face2vert3,
faceSize_[face2I],
(owner[faceMap_[face2I]] == cellI)
(owner[faceMap_[face2I]] == celli)
);
vertLabels_[6] = pointMap_[face2[face2vert6]];
@ -251,7 +251,7 @@ bool Foam::wedgeMatcher::matchShape
(
face1vert6,
faceSize_[face1I],
!(owner[faceMap_[face1I]] == cellI)
!(owner[faceMap_[face1I]] == celli)
);
vertLabels_[5] = pointMap_[face1[face1vert5]];
@ -261,7 +261,7 @@ bool Foam::wedgeMatcher::matchShape
(
face1vert5,
faceSize_[face1I],
!(owner[faceMap_[face1I]] == cellI)
!(owner[faceMap_[face1I]] == celli)
);
vertLabels_[4] = pointMap_[face1[face1vert4]];
@ -271,7 +271,7 @@ bool Foam::wedgeMatcher::matchShape
(
face0vert1,
faceSize_[face0I],
!(owner[faceMap_[face0I]] == cellI)
!(owner[faceMap_[face0I]] == celli)
);
vertLabels_[2] = pointMap_[face0[face0vert2]];
//Info<< "Wedge vertex 2: vertex " << face0[face0vert2]
@ -367,15 +367,15 @@ bool Foam::wedgeMatcher::faceSizeMatch
}
bool Foam::wedgeMatcher::isA(const primitiveMesh& mesh, const label cellI)
bool Foam::wedgeMatcher::isA(const primitiveMesh& mesh, const label celli)
{
return matchShape
(
true,
mesh.faces(),
mesh.faceOwner(),
cellI,
mesh.cells()[cellI]
celli,
mesh.cells()[celli]
);
}
@ -397,7 +397,7 @@ bool Foam::wedgeMatcher::isA(const faceList& faces)
bool Foam::wedgeMatcher::matches
(
const primitiveMesh& mesh,
const label cellI,
const label celli,
cellShape& shape
)
{
@ -408,8 +408,8 @@ bool Foam::wedgeMatcher::matches
false,
mesh.faces(),
mesh.faceOwner(),
cellI,
mesh.cells()[cellI]
celli,
mesh.cells()[celli]
)
)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -107,18 +107,18 @@ public:
const bool checkOnly,
const faceList& faces,
const labelList& faceOwner,
const label cellI,
const label celli,
const labelList& myFaces
);
virtual bool isA(const primitiveMesh& mesh, const label cellI);
virtual bool isA(const primitiveMesh& mesh, const label celli);
virtual bool isA(const faceList&);
virtual bool matches
(
const primitiveMesh& mesh,
const label cellI,
const label celli,
cellShape& shape
);
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -99,11 +99,11 @@ inline faceList cellModel::faces(const labelList& pointLabels) const
faceList f(faces_.size());
// Translate model lebels into global labels
forAll(faces_, faceI)
forAll(faces_, facei)
{
const labelList& curModelLabels = faces_[faceI];
const labelList& curModelLabels = faces_[facei];
face& curFace = f[faceI];
face& curFace = f[facei];
curFace.setSize(curModelLabels.size());

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -89,7 +89,7 @@ public:
// Access
//- Return i-th face
inline triFace face(const label faceI) const;
inline triFace face(const label facei) const;
//- Return first face adjacent to the given edge
inline label edgeFace(const label edgeI) const;
@ -98,7 +98,7 @@ public:
inline label edgeAdjacentFace
(
const label edgeI,
const label faceI
const label facei
) const;
//- Return i-th edge

View File

@ -62,7 +62,7 @@ inline Foam::tetCell::tetCell(Istream& is)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline Foam::triFace Foam::tetCell::face(const label faceI) const
inline Foam::triFace Foam::tetCell::face(const label facei) const
{
// Warning. Ordering of faces needs to be the same for a tetrahedron
// class, a tetrahedron cell shape model and a tetCell
@ -71,19 +71,19 @@ inline Foam::triFace Foam::tetCell::face(const label faceI) const
static const label c[] = {3, 2, 3, 1};
#ifdef FULLDEBUG
if (faceI >= 4)
if (facei >= 4)
{
FatalErrorInFunction
<< "index out of range 0 -> 3. faceI = " << faceI
<< "index out of range 0 -> 3. facei = " << facei
<< abort(FatalError);
}
#endif
return triFace
(
operator[](a[faceI]),
operator[](b[faceI]),
operator[](c[faceI])
operator[](a[facei]),
operator[](b[facei]),
operator[](c[facei])
);
}
@ -111,7 +111,7 @@ inline Foam::label Foam::tetCell::edgeFace(const label edgeI) const
inline Foam::label Foam::tetCell::edgeAdjacentFace
(
const label edgeI,
const label faceI
const label facei
) const
{
// Warning. Ordering of faces needs to be the same for a tetrahedron
@ -127,10 +127,10 @@ inline Foam::label Foam::tetCell::edgeAdjacentFace
};
#ifdef FULLDEBUG
if (faceI >= 4)
if (facei >= 4)
{
FatalErrorInFunction
<< "face index out of range 0 -> 3. faceI = " << faceI
<< "face index out of range 0 -> 3. facei = " << facei
<< abort(FatalError);
}
@ -142,7 +142,7 @@ inline Foam::label Foam::tetCell::edgeAdjacentFace
}
#endif
return adjacentFace[edgeI][faceI];
return adjacentFace[edgeI][facei];
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -88,14 +88,14 @@ bool Foam::matchPoints
j++
)
{
label faceI = pts1MagSqr.indices()[j];
label facei = pts1MagSqr.indices()[j];
// Compare actual vectors
scalar distSqr = magSqr(pts0[face0I] - pts1[faceI]);
scalar distSqr = magSqr(pts0[face0I] - pts1[facei]);
if (distSqr <= sqr(matchDist) && distSqr < minDistSqr)
{
minDistSqr = distSqr;
minFaceI = faceI;
minFaceI = facei;
}
}
@ -122,12 +122,12 @@ bool Foam::matchPoints
j++
)
{
label faceI = pts1MagSqr.indices()[j];
label facei = pts1MagSqr.indices()[j];
Pout<< " Compared coord: " << pts1[faceI]
Pout<< " Compared coord: " << pts1[facei]
<< " at index " << j
<< " with difference to point "
<< mag(pts1[faceI] - pts0[face0I]) << endl;
<< mag(pts1[facei] - pts0[face0I]) << endl;
}
}
}
@ -200,16 +200,16 @@ bool Foam::matchPoints
j++
)
{
label faceI = pts1MagSqr.indices()[j];
label facei = pts1MagSqr.indices()[j];
// Compare actual vectors
scalar distSqr = magSqr(pts0[face0I] - pts1[faceI]);
scalar distSqr = magSqr(pts0[face0I] - pts1[facei]);
scalar distNorm = (pts0Dir[face0I] & pts1Dir[faceI]);
scalar distNorm = (pts0Dir[face0I] & pts1Dir[facei]);
if
(
magSqr(pts0Dir[face0I]) < sqr(SMALL)
&& magSqr(pts1Dir[faceI]) < sqr(SMALL)
&& magSqr(pts1Dir[facei]) < sqr(SMALL)
)
{
distNorm = -1;
@ -222,7 +222,7 @@ bool Foam::matchPoints
{
minDistNorm = distNorm;
minDistSqr = distSqr;
minFaceI = faceI;
minFaceI = facei;
}
}
}
@ -250,12 +250,12 @@ bool Foam::matchPoints
j++
)
{
label faceI = pts1MagSqr.indices()[j];
label facei = pts1MagSqr.indices()[j];
Pout<< " Compared coord: " << pts1[faceI]
Pout<< " Compared coord: " << pts1[facei]
<< " at index " << j
<< " with difference to point "
<< mag(pts1[faceI] - pts0[face0I]) << endl;
<< mag(pts1[facei] - pts0[face0I]) << endl;
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -45,12 +45,12 @@ Foam::pointBoundaryMesh::pointBoundaryMesh
// Set boundary patches
pointPatchList& Patches = *this;
forAll(Patches, patchI)
forAll(Patches, patchi)
{
Patches.set
(
patchI,
facePointPatch::New(basicBdry[patchI], *this).ptr()
patchi,
facePointPatch::New(basicBdry[patchi], *this).ptr()
);
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -73,14 +73,14 @@ public:
{
const pointBoundaryMesh& patches = mesh.boundary();
forAll(patches, patchI)
forAll(patches, patchi)
{
set
(
patchI,
patchi,
new pointPatchMapper
(
patches[patchI],
patches[patchi],
pointMap,
mpm
)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -127,8 +127,8 @@ public:
//- Return neighbour point patch
const cyclicPointPatch& neighbPatch() const
{
label patchI = cyclicPolyPatch_.neighbPatchID();
const pointPatch& pp = this->boundaryMesh()[patchI];
label patchi = cyclicPolyPatch_.neighbPatchID();
const pointPatch& pp = this->boundaryMesh()[patchi];
return refCast<const cyclicPointPatch>(pp);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -59,9 +59,9 @@ void Foam::processorPointPatch::initGeometry(PstreamBuffers& pBufs)
faceList masterFaces(pp.size());
forAll(pp, faceI)
forAll(pp, facei)
{
masterFaces[faceI] = pp[faceI].reverseFace();
masterFaces[facei] = pp[facei].reverseFace();
}
reverseMeshPoints_ = primitiveFacePatch

View File

@ -29,7 +29,7 @@ Description
for processor + local index. E.g.
globalIndex globalFaces(mesh.nFaces());
label globalFaceI = globalFaces.toGlobal(faceI);
label globalFaceI = globalFaces.toGlobal(facei);
SourceFiles

View File

@ -1207,9 +1207,9 @@ void Foam::globalMeshData::calcPointBoundaryFaces
labelList nPointFaces(coupledPatch().nPoints(), 0);
forAll(bMesh, patchI)
forAll(bMesh, patchi)
{
const polyPatch& pp = bMesh[patchI];
const polyPatch& pp = bMesh[patchi];
if (!pp.coupled())
{
@ -1245,9 +1245,9 @@ void Foam::globalMeshData::calcPointBoundaryFaces
// 3. Fill
forAll(bMesh, patchI)
forAll(bMesh, patchi)
{
const polyPatch& pp = bMesh[patchI];
const polyPatch& pp = bMesh[patchi];
if (!pp.coupled())
{
@ -1407,12 +1407,12 @@ void Foam::globalMeshData::calcGlobalPointBoundaryFaces() const
if (findIndex(untrafoFaces, slave)== -1)
{
label procI = globalIndices.whichProcID(slave);
label faceI = globalIndices.toLocal(procI, slave);
label facei = globalIndices.toLocal(procI, slave);
myBFaces[n++] = globalIndexAndTransform::encode
(
procI,
faceI,
facei,
transformI
);
}
@ -1495,8 +1495,8 @@ void Foam::globalMeshData::calcGlobalPointBoundaryCells() const
forAll(pCells, i)
{
label cellI = pCells[i];
Map<label>::iterator fnd = meshCellMap.find(cellI);
label celli = pCells[i];
Map<label>::iterator fnd = meshCellMap.find(celli);
if (fnd != meshCellMap.end())
{
@ -1504,8 +1504,8 @@ void Foam::globalMeshData::calcGlobalPointBoundaryCells() const
}
else
{
meshCellMap.insert(cellI, bCellI);
cellMap.append(cellI);
meshCellMap.insert(celli, bCellI);
cellMap.append(celli);
bCells[i] = bCellI;
bCellI++;
}
@ -1636,11 +1636,11 @@ void Foam::globalMeshData::calcGlobalPointBoundaryCells() const
if (findIndex(untrafoCells, slave)== -1)
{
label procI = globalIndices.whichProcID(slave);
label cellI = globalIndices.toLocal(procI, slave);
label celli = globalIndices.toLocal(procI, slave);
myBCells[n++] = globalIndexAndTransform::encode
(
procI,
cellI,
celli,
transformI
);
}
@ -2041,9 +2041,9 @@ const Foam::indirectPrimitivePatch& Foam::globalMeshData::coupledPatch() const
label nCoupled = 0;
forAll(bMesh, patchI)
forAll(bMesh, patchi)
{
const polyPatch& pp = bMesh[patchI];
const polyPatch& pp = bMesh[patchi];
if (pp.coupled())
{
@ -2053,17 +2053,17 @@ const Foam::indirectPrimitivePatch& Foam::globalMeshData::coupledPatch() const
labelList coupledFaces(nCoupled);
nCoupled = 0;
forAll(bMesh, patchI)
forAll(bMesh, patchi)
{
const polyPatch& pp = bMesh[patchI];
const polyPatch& pp = bMesh[patchi];
if (pp.coupled())
{
label faceI = pp.start();
label facei = pp.start();
forAll(pp, i)
{
coupledFaces[nCoupled++] = faceI++;
coupledFaces[nCoupled++] = facei++;
}
}
}

View File

@ -46,9 +46,9 @@ Foam::label Foam::globalPoints::countPatchPoints
{
label nTotPoints = 0;
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if (pp.coupled())
{
nTotPoints += pp.nPoints();
@ -84,13 +84,13 @@ Foam::label Foam::globalPoints::findSamePoint
Foam::labelPairList Foam::globalPoints::addSendTransform
(
const label patchI,
const label patchi,
const labelPairList& info
) const
{
scalar tol = refCast<const coupledPolyPatch>
(
mesh_.boundaryMesh()[patchI]
mesh_.boundaryMesh()[patchi]
).matchTolerance();
labelPairList sendInfo(info.size());
@ -113,8 +113,8 @@ Foam::labelPairList Foam::globalPoints::addSendTransform
globalTransforms_.addToTransformIndex
(
globalIndexAndTransform::transformIndex(info[i]),
patchI,
true, // patchI is sending side
patchi,
true, // patchi is sending side
tol // tolerance for comparison
)
);
@ -398,9 +398,9 @@ void Foam::globalPoints::initOwnPoints
{
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if (pp.coupled())
{
@ -487,9 +487,9 @@ void Foam::globalPoints::sendPatchPoints
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
const labelPairList& patchInfo = globalTransforms_.patchTransformSign();
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
// mergeSeparated=true : send from all processor patches
// =false: send from ones without transform
@ -497,7 +497,7 @@ void Foam::globalPoints::sendPatchPoints
if
(
(Pstream::parRun() && isA<processorPolyPatch>(pp))
&& (mergeSeparated || patchInfo[patchI].first() == -1)
&& (mergeSeparated || patchInfo[patchi].first() == -1)
)
{
const processorPolyPatch& procPatch =
@ -584,14 +584,14 @@ void Foam::globalPoints::receivePatchPoints
// Reset changed points
changedPoints.clear();
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if
(
(Pstream::parRun() && isA<processorPolyPatch>(pp))
&& (mergeSeparated || patchInfo[patchI].first() == -1)
&& (mergeSeparated || patchInfo[patchi].first() == -1)
)
{
const processorPolyPatch& procPatch =
@ -642,7 +642,7 @@ void Foam::globalPoints::receivePatchPoints
isA<cyclicPolyPatch>(pp)
&& refCast<const cyclicPolyPatch>(pp).owner()
)
&& (mergeSeparated || patchInfo[patchI].first() == -1)
&& (mergeSeparated || patchInfo[patchi].first() == -1)
)
{
// Handle cyclics: send lower half to upper half and vice versa.
@ -651,7 +651,7 @@ void Foam::globalPoints::receivePatchPoints
const cyclicPolyPatch& cycPatch =
refCast<const cyclicPolyPatch>(pp);
//Pout<< "Patch:" << patchI << " name:" << pp.name() << endl;
//Pout<< "Patch:" << patchi << " name:" << pp.name() << endl;
const labelList& meshPoints = pp.meshPoints();
const labelList coupledMeshPoints(reverseMeshPoints(cycPatch));
@ -845,9 +845,9 @@ Foam::labelList Foam::globalPoints::reverseMeshPoints
faceList masterFaces(nbrPatch.size());
forAll(nbrPatch, faceI)
forAll(nbrPatch, facei)
{
masterFaces[faceI] = nbrPatch[faceI].reverseFace();
masterFaces[facei] = nbrPatch[facei].reverseFace();
}
return primitiveFacePatch

View File

@ -60,13 +60,13 @@ void Foam::cellMapper::calcAddressing() const
label nInsertedCells = 0;
forAll(directAddr, cellI)
forAll(directAddr, celli)
{
if (directAddr[cellI] < 0)
if (directAddr[celli] < 0)
{
// Found inserted cell
directAddr[cellI] = 0;
insertedCells[nInsertedCells] = cellI;
directAddr[celli] = 0;
insertedCells[nInsertedCells] = celli;
nInsertedCells++;
}
}
@ -90,19 +90,19 @@ void Foam::cellMapper::calcAddressing() const
// Get addressing
const labelList& mo = cfp[cfpI].masterObjects();
label cellI = cfp[cfpI].index();
label celli = cfp[cfpI].index();
if (addr[cellI].size())
if (addr[celli].size())
{
FatalErrorInFunction
<< "Master cell " << cellI
<< "Master cell " << celli
<< " mapped from point cells " << mo
<< " already destination of mapping." << abort(FatalError);
}
// Map from masters, uniform weights
addr[cellI] = mo;
w[cellI] = scalarList(mo.size(), 1.0/mo.size());
addr[celli] = mo;
w[celli] = scalarList(mo.size(), 1.0/mo.size());
}
const List<objectMap>& cfe = mpm_.cellsFromEdgesMap();
@ -112,19 +112,19 @@ void Foam::cellMapper::calcAddressing() const
// Get addressing
const labelList& mo = cfe[cfeI].masterObjects();
label cellI = cfe[cfeI].index();
label celli = cfe[cfeI].index();
if (addr[cellI].size())
if (addr[celli].size())
{
FatalErrorInFunction
<< "Master cell " << cellI
<< "Master cell " << celli
<< " mapped from edge cells " << mo
<< " already destination of mapping." << abort(FatalError);
}
// Map from masters, uniform weights
addr[cellI] = mo;
w[cellI] = scalarList(mo.size(), 1.0/mo.size());
addr[celli] = mo;
w[celli] = scalarList(mo.size(), 1.0/mo.size());
}
const List<objectMap>& cff = mpm_.cellsFromFacesMap();
@ -134,19 +134,19 @@ void Foam::cellMapper::calcAddressing() const
// Get addressing
const labelList& mo = cff[cffI].masterObjects();
label cellI = cff[cffI].index();
label celli = cff[cffI].index();
if (addr[cellI].size())
if (addr[celli].size())
{
FatalErrorInFunction
<< "Master cell " << cellI
<< "Master cell " << celli
<< " mapped from face cells " << mo
<< " already destination of mapping." << abort(FatalError);
}
// Map from masters, uniform weights
addr[cellI] = mo;
w[cellI] = scalarList(mo.size(), 1.0/mo.size());
addr[celli] = mo;
w[celli] = scalarList(mo.size(), 1.0/mo.size());
}
// Volume conservative mapping if possible
@ -158,19 +158,19 @@ void Foam::cellMapper::calcAddressing() const
// Get addressing
const labelList& mo = cfc[cfcI].masterObjects();
label cellI = cfc[cfcI].index();
label celli = cfc[cfcI].index();
if (addr[cellI].size())
if (addr[celli].size())
{
FatalErrorInFunction
<< "Master cell " << cellI
<< "Master cell " << celli
<< " mapped from cell cells " << mo
<< " already destination of mapping."
<< abort(FatalError);
}
// Map from masters
addr[cellI] = mo;
addr[celli] = mo;
}
if (mpm_.hasOldCellVolumes())
@ -193,29 +193,29 @@ void Foam::cellMapper::calcAddressing() const
{
const labelList& mo = cfc[cfcI].masterObjects();
label cellI = cfc[cfcI].index();
label celli = cfc[cfcI].index();
w[cellI].setSize(mo.size());
w[celli].setSize(mo.size());
if (mo.size())
{
scalar sumV = 0;
forAll(mo, ci)
{
w[cellI][ci] = V[mo[ci]];
w[celli][ci] = V[mo[ci]];
sumV += V[mo[ci]];
}
if (sumV > VSMALL)
{
forAll(mo, ci)
{
w[cellI][ci] /= sumV;
w[celli][ci] /= sumV;
}
}
else
{
// Exception: zero volume. Use uniform mapping
w[cellI] = scalarList(mo.size(), 1.0/mo.size());
w[celli] = scalarList(mo.size(), 1.0/mo.size());
}
}
}
@ -228,9 +228,9 @@ void Foam::cellMapper::calcAddressing() const
{
const labelList& mo = cfc[cfcI].masterObjects();
label cellI = cfc[cfcI].index();
label celli = cfc[cfcI].index();
w[cellI] = scalarList(mo.size(), 1.0/mo.size());
w[celli] = scalarList(mo.size(), 1.0/mo.size());
}
}
@ -240,13 +240,13 @@ void Foam::cellMapper::calcAddressing() const
const labelList& cm = mpm_.cellMap();
forAll(cm, cellI)
forAll(cm, celli)
{
if (cm[cellI] > -1 && addr[cellI].empty())
if (cm[celli] > -1 && addr[celli].empty())
{
// Mapped from a single cell
addr[cellI] = labelList(1, cm[cellI]);
w[cellI] = scalarList(1, 1.0);
addr[celli] = labelList(1, cm[celli]);
w[celli] = scalarList(1, 1.0);
}
}
@ -257,15 +257,15 @@ void Foam::cellMapper::calcAddressing() const
label nInsertedCells = 0;
forAll(addr, cellI)
forAll(addr, celli)
{
if (addr[cellI].empty())
if (addr[celli].empty())
{
// Mapped from a dummy cell
addr[cellI] = labelList(1, label(0));
w[cellI] = scalarList(1, 1.0);
addr[celli] = labelList(1, label(0));
w[celli] = scalarList(1, 1.0);
insertedCells[nInsertedCells] = cellI;
insertedCells[nInsertedCells] = celli;
nInsertedCells++;
}
}

View File

@ -60,13 +60,13 @@ void Foam::faceMapper::calcAddressing() const
label nInsertedFaces = 0;
forAll(directAddr, faceI)
forAll(directAddr, facei)
{
if (directAddr[faceI] < 0)
if (directAddr[facei] < 0)
{
// Found inserted face
directAddr[faceI] = 0;
insertedFaces[nInsertedFaces] = faceI;
directAddr[facei] = 0;
insertedFaces[nInsertedFaces] = facei;
nInsertedFaces++;
}
}
@ -90,19 +90,19 @@ void Foam::faceMapper::calcAddressing() const
// Get addressing
const labelList& mo = ffp[ffpI].masterObjects();
label faceI = ffp[ffpI].index();
label facei = ffp[ffpI].index();
if (addr[faceI].size())
if (addr[facei].size())
{
FatalErrorInFunction
<< "Master face " << faceI
<< "Master face " << facei
<< " mapped from point faces " << mo
<< " already destination of mapping." << abort(FatalError);
}
// Map from masters, uniform weights
addr[faceI] = mo;
w[faceI] = scalarList(mo.size(), 1.0/mo.size());
addr[facei] = mo;
w[facei] = scalarList(mo.size(), 1.0/mo.size());
}
const List<objectMap>& ffe = mpm_.facesFromEdgesMap();
@ -112,19 +112,19 @@ void Foam::faceMapper::calcAddressing() const
// Get addressing
const labelList& mo = ffe[ffeI].masterObjects();
label faceI = ffe[ffeI].index();
label facei = ffe[ffeI].index();
if (addr[faceI].size())
if (addr[facei].size())
{
FatalErrorInFunction
<< "Master face " << faceI
<< "Master face " << facei
<< " mapped from edge faces " << mo
<< " already destination of mapping." << abort(FatalError);
}
// Map from masters, uniform weights
addr[faceI] = mo;
w[faceI] = scalarList(mo.size(), 1.0/mo.size());
addr[facei] = mo;
w[facei] = scalarList(mo.size(), 1.0/mo.size());
}
const List<objectMap>& fff = mpm_.facesFromFacesMap();
@ -134,19 +134,19 @@ void Foam::faceMapper::calcAddressing() const
// Get addressing
const labelList& mo = fff[fffI].masterObjects();
label faceI = fff[fffI].index();
label facei = fff[fffI].index();
if (addr[faceI].size())
if (addr[facei].size())
{
FatalErrorInFunction
<< "Master face " << faceI
<< "Master face " << facei
<< " mapped from face faces " << mo
<< " already destination of mapping." << abort(FatalError);
}
// Map from masters, uniform weights
addr[faceI] = mo;
w[faceI] = scalarList(mo.size(), 1.0/mo.size());
addr[facei] = mo;
w[facei] = scalarList(mo.size(), 1.0/mo.size());
}
@ -154,13 +154,13 @@ void Foam::faceMapper::calcAddressing() const
// so check if addressing size still zero.
const labelList& fm = mpm_.faceMap();
forAll(fm, faceI)
forAll(fm, facei)
{
if (fm[faceI] > -1 && addr[faceI].empty())
if (fm[facei] > -1 && addr[facei].empty())
{
// Mapped from a single face
addr[faceI] = labelList(1, fm[faceI]);
w[faceI] = scalarList(1, 1.0);
addr[facei] = labelList(1, fm[facei]);
w[facei] = scalarList(1, 1.0);
}
}
@ -172,15 +172,15 @@ void Foam::faceMapper::calcAddressing() const
label nInsertedFaces = 0;
forAll(addr, faceI)
forAll(addr, facei)
{
if (addr[faceI].empty())
if (addr[facei].empty())
{
// Mapped from a dummy face
addr[faceI] = labelList(1, label(0));
w[faceI] = scalarList(1, 1.0);
addr[facei] = labelList(1, label(0));
w[facei] = scalarList(1, 1.0);
insertedFaces[nInsertedFaces] = faceI;
insertedFaces[nInsertedFaces] = facei;
nInsertedFaces++;
}
}

View File

@ -419,9 +419,9 @@ void Foam::mapDistribute::calcCompactAddressing
// Count all (non-local) elements needed. Just for presizing map.
labelList nNonLocal(Pstream::nProcs(), 0);
forAll(cellCells, cellI)
forAll(cellCells, celli)
{
const labelList& cCells = cellCells[cellI];
const labelList& cCells = cellCells[celli];
forAll(cCells, i)
{
@ -446,9 +446,9 @@ void Foam::mapDistribute::calcCompactAddressing
// Collect all (non-local) elements needed.
forAll(cellCells, cellI)
forAll(cellCells, celli)
{
const labelList& cCells = cellCells[cellI];
const labelList& cCells = cellCells[celli];
forAll(cCells, i)
{
@ -615,9 +615,9 @@ void Foam::mapDistribute::exchangeAddressing
);
// Renumber elements
forAll(cellCells, cellI)
forAll(cellCells, celli)
{
labelList& cCells = cellCells[cellI];
labelList& cCells = cellCells[celli];
forAll(cCells, i)
{
@ -987,9 +987,9 @@ Foam::mapDistribute::mapDistribute
);
// Add all (non-local) transformed elements needed.
forAll(transformedElements, cellI)
forAll(transformedElements, celli)
{
const labelPairList& elems = transformedElements[cellI];
const labelPairList& elems = transformedElements[celli];
forAll(elems, i)
{
@ -1022,9 +1022,9 @@ Foam::mapDistribute::mapDistribute
// Count per transformIndex
label nTrafo = globalTransforms.transformPermutations().size();
labelList nPerTransform(nTrafo, 0);
forAll(transformedElements, cellI)
forAll(transformedElements, celli)
{
const labelPairList& elems = transformedElements[cellI];
const labelPairList& elems = transformedElements[celli];
forAll(elems, i)
{
@ -1046,10 +1046,10 @@ Foam::mapDistribute::mapDistribute
nPerTransform = 0;
transformedIndices.setSize(transformedElements.size());
forAll(transformedElements, cellI)
forAll(transformedElements, celli)
{
const labelPairList& elems = transformedElements[cellI];
transformedIndices[cellI].setSize(elems.size());
const labelPairList& elems = transformedElements[celli];
transformedIndices[celli].setSize(elems.size());
forAll(elems, i)
{
@ -1069,7 +1069,7 @@ Foam::mapDistribute::mapDistribute
// index of element to transform
transformElements_[trafoI][n] = rawElemI;
// destination of transformed element
transformedIndices[cellI][i] = transformStart_[trafoI]+n;
transformedIndices[celli][i] = transformStart_[trafoI]+n;
n++;
}
}

View File

@ -34,10 +34,10 @@ void Foam::mapDistributePolyMesh::calcPatchSizes()
oldPatchSizes_.setSize(oldPatchStarts_.size());
// Calculate old patch sizes
for (label patchI = 0; patchI < oldPatchStarts_.size() - 1; patchI++)
for (label patchi = 0; patchi < oldPatchStarts_.size() - 1; patchi++)
{
oldPatchSizes_[patchI] =
oldPatchStarts_[patchI + 1] - oldPatchStarts_[patchI];
oldPatchSizes_[patchi] =
oldPatchStarts_[patchi + 1] - oldPatchStarts_[patchi];
}
// Set the last one by hand

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -97,11 +97,11 @@ public:
label addedI = 0;
forAll(patchMap_, patchI)
forAll(patchMap_, patchi)
{
if (patchMap_[patchI] == -1)
if (patchMap_[patchi] == -1)
{
added[addedI++] = patchI;
added[addedI++] = patchi;
}
}
added.setSize(addedI);
@ -114,11 +114,11 @@ public:
labelList oldToNew(nOldPatches_, -1);
// Mark all preserved patches
forAll(patchMap_, patchI)
forAll(patchMap_, patchi)
{
if (patchMap_[patchI] != -1)
if (patchMap_[patchi] != -1)
{
oldToNew[patchMap_[patchI]] = patchI;
oldToNew[patchMap_[patchi]] = patchi;
}
}

View File

@ -91,10 +91,10 @@ Foam::mapPolyMesh::mapPolyMesh
oldCellVolumesPtr_(oldCellVolumesPtr)
{
// Calculate old patch sizes
for (label patchI = 0; patchI < oldPatchStarts_.size() - 1; patchI++)
for (label patchi = 0; patchi < oldPatchStarts_.size() - 1; patchi++)
{
oldPatchSizes_[patchI] =
oldPatchStarts_[patchI + 1] - oldPatchStarts_[patchI];
oldPatchSizes_[patchi] =
oldPatchStarts_[patchi + 1] - oldPatchStarts_[patchi];
}
// Set the last one by hand
@ -179,10 +179,10 @@ Foam::mapPolyMesh::mapPolyMesh
if (oldPatchStarts_.size() > 0)
{
// Calculate old patch sizes
for (label patchI = 0; patchI < oldPatchStarts_.size() - 1; patchI++)
for (label patchi = 0; patchi < oldPatchStarts_.size() - 1; patchi++)
{
oldPatchSizes_[patchI] =
oldPatchStarts_[patchI + 1] - oldPatchStarts_[patchI];
oldPatchSizes_[patchi] =
oldPatchStarts_[patchi + 1] - oldPatchStarts_[patchi];
}
// Set the last one by hand

View File

@ -69,29 +69,29 @@ Description
\par faces
- unchanged:
- faceMap[faceI] contains old face label
- faceMap[facei] contains old face label
- reverseFaceMap[oldFaceI] contains new face label
- removed:
- reverseFaceMap[oldFaceI] contains -1
- merged into face:
- reverseFaceMap[oldFaceI] contains <-1 : -newFaceI-2
- faceMap[faceI] contains the old master face label
- facesFromFaces gives for faceI all the old face labels
- faceMap[facei] contains the old master face label
- facesFromFaces gives for facei all the old face labels
(including the old master face!)
- added-from-same:
- faceMap[faceI] contains the old master face label
- faceMap[facei] contains the old master face label
- inflated-from-edge:
- faceMap[faceI] contains -1
- faceMap[facei] contains -1
- facesFromEdges contains an entry with
- faceI
- facei
- list of faces(*) on old mesh that connected to the old edge
- inflated-from-point:
- faceMap[faceI] contains -1
- faceMap[facei] contains -1
- facesFromPoints contains an entry with
- faceI
- facei
- list of faces(*) on old mesh that connected to the old point
- appended:
- faceMap[faceI] contains -1
- faceMap[facei] contains -1
Note (*) \n
if the newly inflated face is a boundary face the list of faces will
@ -101,34 +101,34 @@ Description
\par cells
- unchanged:
- cellMap[cellI] contains old cell label
- cellMap[celli] contains old cell label
- reverseCellMap[oldCellI] contains new cell label
- removed:
- reverseCellMap[oldCellI] contains -1
- merged into cell:
- reverseCellMap[oldCellI] contains <-1 : -newCellI-2
- cellMap[cellI] contains the old master cell label
- cellsFromCells gives for cellI all the old cell labels
- cellMap[celli] contains the old master cell label
- cellsFromCells gives for celli all the old cell labels
(including the old master cell!)
- added-from-same:
- cellMap[cellI] contains the old master cell label
- cellMap[celli] contains the old master cell label
- inflated-from-face:
- cellMap[cellI] contains -1
- cellMap[celli] contains -1
- cellsFromFaces contains an entry with
- cellI
- celli
- list of cells on old mesh that connected to the old face
- inflated-from-edge:
- cellMap[cellI] contains -1
- cellMap[celli] contains -1
- cellsFromEdges contains an entry with
- cellI
- celli
- list of cells on old mesh that connected to the old edge
- inflated-from-point:
- cellMap[cellI] contains -1
- cellMap[celli] contains -1
- cellsFromPoints contains an entry with
- cellI
- celli
- list of cells on old mesh that connected to the old point
- appended:
- cellMap[cellI] contains -1
- cellMap[celli] contains -1
SourceFiles

View File

@ -76,16 +76,16 @@ Foam::polyBoundaryMesh::polyBoundaryMesh
PtrList<entry> patchEntries(is);
patches.setSize(patchEntries.size());
forAll(patches, patchI)
forAll(patches, patchi)
{
patches.set
(
patchI,
patchi,
polyPatch::New
(
patchEntries[patchI].keyword(),
patchEntries[patchI].dict(),
patchI,
patchEntries[patchi].keyword(),
patchEntries[patchi].dict(),
patchi,
*this
)
);
@ -151,16 +151,16 @@ Foam::polyBoundaryMesh::polyBoundaryMesh
PtrList<entry> patchEntries(is);
patches.setSize(patchEntries.size());
forAll(patches, patchI)
forAll(patches, patchi)
{
patches.set
(
patchI,
patchi,
polyPatch::New
(
patchEntries[patchI].keyword(),
patchEntries[patchI].dict(),
patchI,
patchEntries[patchi].keyword(),
patchEntries[patchi].dict(),
patchi,
*this
)
);
@ -179,9 +179,9 @@ Foam::polyBoundaryMesh::polyBoundaryMesh
{
polyPatchList& patches = *this;
patches.setSize(ppl.size());
forAll(patches, patchI)
forAll(patches, patchi)
{
patches.set(patchI, ppl[patchI].clone(*this).ptr());
patches.set(patchi, ppl[patchi].clone(*this).ptr());
}
}
}
@ -195,9 +195,9 @@ Foam::polyBoundaryMesh::~polyBoundaryMesh()
void Foam::polyBoundaryMesh::clearGeom()
{
forAll(*this, patchI)
forAll(*this, patchi)
{
operator[](patchI).clearGeom();
operator[](patchi).clearGeom();
}
}
@ -208,9 +208,9 @@ void Foam::polyBoundaryMesh::clearAddressing()
patchIDPtr_.clear();
groupPatchIDsPtr_.clear();
forAll(*this, patchI)
forAll(*this, patchi)
{
operator[](patchI).clearAddressing();
operator[](patchi).clearAddressing();
}
}
@ -227,16 +227,16 @@ void Foam::polyBoundaryMesh::calcGeometry()
|| Pstream::defaultCommsType == Pstream::nonBlocking
)
{
forAll(*this, patchI)
forAll(*this, patchi)
{
operator[](patchI).initGeometry(pBufs);
operator[](patchi).initGeometry(pBufs);
}
pBufs.finishedSends();
forAll(*this, patchI)
forAll(*this, patchi)
{
operator[](patchI).calcGeometry(pBufs);
operator[](patchi).calcGeometry(pBufs);
}
}
else if (Pstream::defaultCommsType == Pstream::scheduled)
@ -248,15 +248,15 @@ void Foam::polyBoundaryMesh::calcGeometry()
forAll(patchSchedule, patchEvali)
{
const label patchI = patchSchedule[patchEvali].patch;
const label patchi = patchSchedule[patchEvali].patch;
if (patchSchedule[patchEvali].init)
{
operator[](patchI).initGeometry(pBufs);
operator[](patchi).initGeometry(pBufs);
}
else
{
operator[](patchI).calcGeometry(pBufs);
operator[](patchi).calcGeometry(pBufs);
}
}
}
@ -280,15 +280,15 @@ Foam::polyBoundaryMesh::neighbourEdges() const
// Initialize.
label nEdgePairs = 0;
forAll(*this, patchI)
forAll(*this, patchi)
{
const polyPatch& pp = operator[](patchI);
const polyPatch& pp = operator[](patchi);
neighbourEdges[patchI].setSize(pp.nEdges() - pp.nInternalEdges());
neighbourEdges[patchi].setSize(pp.nEdges() - pp.nInternalEdges());
forAll(neighbourEdges[patchI], i)
forAll(neighbourEdges[patchi], i)
{
labelPair& edgeInfo = neighbourEdges[patchI][i];
labelPair& edgeInfo = neighbourEdges[patchi][i];
edgeInfo[0] = -1;
edgeInfo[1] = -1;
@ -301,9 +301,9 @@ Foam::polyBoundaryMesh::neighbourEdges() const
// point addressing) to patch + relative edge index.
HashTable<labelPair, edge, Hash<edge>> pointsToEdge(nEdgePairs);
forAll(*this, patchI)
forAll(*this, patchi)
{
const polyPatch& pp = operator[](patchI);
const polyPatch& pp = operator[](patchi);
const edgeList& edges = pp.edges();
@ -332,7 +332,7 @@ Foam::polyBoundaryMesh::neighbourEdges() const
meshEdge,
labelPair
(
patchI,
patchi,
edgei - pp.nInternalEdges()
)
);
@ -342,11 +342,11 @@ Foam::polyBoundaryMesh::neighbourEdges() const
// Second occurrence. Store.
const labelPair& edgeInfo = fnd();
neighbourEdges[patchI][edgei - pp.nInternalEdges()] =
neighbourEdges[patchi][edgei - pp.nInternalEdges()] =
edgeInfo;
neighbourEdges[edgeInfo[0]][edgeInfo[1]]
= labelPair(patchI, edgei - pp.nInternalEdges());
= labelPair(patchi, edgei - pp.nInternalEdges());
// Found all two occurrences of this edge so remove from
// hash to save space. Note that this will give lots of
@ -364,11 +364,11 @@ Foam::polyBoundaryMesh::neighbourEdges() const
<< abort(FatalError);
}
forAll(*this, patchI)
forAll(*this, patchi)
{
const polyPatch& pp = operator[](patchI);
const polyPatch& pp = operator[](patchi);
const labelPairList& nbrEdges = neighbourEdges[patchI];
const labelPairList& nbrEdges = neighbourEdges[patchi];
forAll(nbrEdges, i)
{
@ -412,12 +412,12 @@ const Foam::labelList& Foam::polyBoundaryMesh::patchID() const
const polyBoundaryMesh& bm = *this;
forAll(bm, patchI)
forAll(bm, patchi)
{
label bFaceI = bm[patchI].start() - mesh_.nInternalFaces();
forAll(bm[patchI], i)
label bFaceI = bm[patchi].start() - mesh_.nInternalFaces();
forAll(bm[patchi], i)
{
patchID[bFaceI++] = patchI;
patchID[bFaceI++] = patchi;
}
}
}
@ -435,9 +435,9 @@ Foam::polyBoundaryMesh::groupPatchIDs() const
const polyBoundaryMesh& bm = *this;
forAll(bm, patchI)
forAll(bm, patchi)
{
const wordList& groups = bm[patchI].inGroups();
const wordList& groups = bm[patchi].inGroups();
forAll(groups, i)
{
@ -446,7 +446,7 @@ Foam::polyBoundaryMesh::groupPatchIDs() const
if (findPatchID(name) != -1)
{
WarningInFunction
<< "Patch " << bm[patchI].name()
<< "Patch " << bm[patchi].name()
<< " specifies a group " << name
<< " which is also a patch name."
<< " This might give problems later on." << endl;
@ -460,11 +460,11 @@ Foam::polyBoundaryMesh::groupPatchIDs() const
if (iter != groupPatchIDs.end())
{
iter().append(patchI);
iter().append(patchi);
}
else
{
groupPatchIDs.insert(name, labelList(1, patchI));
groupPatchIDs.insert(name, labelList(1, patchi));
}
}
}
@ -488,22 +488,22 @@ void Foam::polyBoundaryMesh::setGroup
// Add to specified patches
forAll(patchIDs, i)
{
label patchI = patchIDs[i];
polyPatch& pp = patches[patchI];
label patchi = patchIDs[i];
polyPatch& pp = patches[patchi];
if (!pp.inGroup(groupName))
{
pp.inGroups().append(groupName);
}
donePatch[patchI] = true;
donePatch[patchi] = true;
}
// Remove from other patches
forAll(patches, patchI)
forAll(patches, patchi)
{
if (!donePatch[patchI])
if (!donePatch[patchi])
{
polyPatch& pp = patches[patchI];
polyPatch& pp = patches[patchi];
label newI = 0;
if (pp.inGroup(groupName))
@ -530,9 +530,9 @@ Foam::wordList Foam::polyBoundaryMesh::names() const
wordList t(patches.size());
forAll(patches, patchI)
forAll(patches, patchi)
{
t[patchI] = patches[patchI].name();
t[patchi] = patches[patchi].name();
}
return t;
@ -545,9 +545,9 @@ Foam::wordList Foam::polyBoundaryMesh::types() const
wordList t(patches.size());
forAll(patches, patchI)
forAll(patches, patchi)
{
t[patchI] = patches[patchI].type();
t[patchi] = patches[patchi].type();
}
return t;
@ -560,9 +560,9 @@ Foam::wordList Foam::polyBoundaryMesh::physicalTypes() const
wordList t(patches.size());
forAll(patches, patchI)
forAll(patches, patchi)
{
t[patchI] = patches[patchI].physicalType();
t[patchi] = patches[patchi].physicalType();
}
return t;
@ -679,11 +679,11 @@ Foam::label Foam::polyBoundaryMesh::findPatchID(const word& patchName) const
{
const polyPatchList& patches = *this;
forAll(patches, patchI)
forAll(patches, patchi)
{
if (patches[patchI].name() == patchName)
if (patches[patchi].name() == patchName)
{
return patchI;
return patchi;
}
}
@ -719,9 +719,9 @@ Foam::label Foam::polyBoundaryMesh::whichPatch(const label faceIndex) const
}
forAll(*this, patchI)
forAll(*this, patchi)
{
const polyPatch& bp = operator[](patchI);
const polyPatch& bp = operator[](patchi);
if
(
@ -729,7 +729,7 @@ Foam::label Foam::polyBoundaryMesh::whichPatch(const label faceIndex) const
&& faceIndex < bp.start() + bp.size()
)
{
return patchI;
return patchi;
}
}
@ -874,20 +874,20 @@ bool Foam::polyBoundaryMesh::checkParallelSync(const bool report) const
label nonProcI = 0;
forAll(bm, patchI)
forAll(bm, patchi)
{
if (!isA<processorPolyPatch>(bm[patchI]))
if (!isA<processorPolyPatch>(bm[patchi]))
{
if (nonProcI != patchI)
if (nonProcI != patchi)
{
// There is processor patch in between normal patches.
hasError = true;
if (debug || report)
{
Pout<< " ***Problem with boundary patch " << patchI
<< " named " << bm[patchI].name()
<< " of type " << bm[patchI].type()
Pout<< " ***Problem with boundary patch " << patchi
<< " named " << bm[patchi].name()
<< " of type " << bm[patchi].type()
<< ". The patch seems to be preceeded by processor"
<< " patches. This is can give problems."
<< endl;
@ -895,8 +895,8 @@ bool Foam::polyBoundaryMesh::checkParallelSync(const bool report) const
}
else
{
names[nonProcI] = bm[patchI].name();
types[nonProcI] = bm[patchI].type();
names[nonProcI] = bm[patchi].name();
types[nonProcI] = bm[patchi].type();
nonProcI++;
}
}
@ -952,34 +952,34 @@ bool Foam::polyBoundaryMesh::checkDefinition(const bool report) const
HashSet<word> patchNames(2*size());
forAll(bm, patchI)
forAll(bm, patchi)
{
if (bm[patchI].start() != nextPatchStart && !hasError)
if (bm[patchi].start() != nextPatchStart && !hasError)
{
hasError = true;
Info<< " ****Problem with boundary patch " << patchI
<< " named " << bm[patchI].name()
<< " of type " << bm[patchI].type()
Info<< " ****Problem with boundary patch " << patchi
<< " named " << bm[patchi].name()
<< " of type " << bm[patchi].type()
<< ". The patch should start on face no " << nextPatchStart
<< " and the patch specifies " << bm[patchI].start()
<< " and the patch specifies " << bm[patchi].start()
<< "." << endl
<< "Possibly consecutive patches have this same problem."
<< " Suppressing future warnings." << endl;
}
if (!patchNames.insert(bm[patchI].name()) && !hasError)
if (!patchNames.insert(bm[patchi].name()) && !hasError)
{
hasError = true;
Info<< " ****Duplicate boundary patch " << patchI
<< " named " << bm[patchI].name()
<< " of type " << bm[patchI].type()
Info<< " ****Duplicate boundary patch " << patchi
<< " named " << bm[patchi].name()
<< " of type " << bm[patchi].type()
<< "." << endl
<< "Suppressing future warnings." << endl;
}
nextPatchStart += bm[patchI].size();
nextPatchStart += bm[patchi].size();
}
reduce(hasError, orOp<bool>());
@ -1010,16 +1010,16 @@ void Foam::polyBoundaryMesh::movePoints(const pointField& p)
|| Pstream::defaultCommsType == Pstream::nonBlocking
)
{
forAll(*this, patchI)
forAll(*this, patchi)
{
operator[](patchI).initMovePoints(pBufs, p);
operator[](patchi).initMovePoints(pBufs, p);
}
pBufs.finishedSends();
forAll(*this, patchI)
forAll(*this, patchi)
{
operator[](patchI).movePoints(pBufs, p);
operator[](patchi).movePoints(pBufs, p);
}
}
else if (Pstream::defaultCommsType == Pstream::scheduled)
@ -1031,15 +1031,15 @@ void Foam::polyBoundaryMesh::movePoints(const pointField& p)
forAll(patchSchedule, patchEvali)
{
const label patchI = patchSchedule[patchEvali].patch;
const label patchi = patchSchedule[patchEvali].patch;
if (patchSchedule[patchEvali].init)
{
operator[](patchI).initMovePoints(pBufs, p);
operator[](patchi).initMovePoints(pBufs, p);
}
else
{
operator[](patchI).movePoints(pBufs, p);
operator[](patchi).movePoints(pBufs, p);
}
}
}
@ -1060,16 +1060,16 @@ void Foam::polyBoundaryMesh::updateMesh()
|| Pstream::defaultCommsType == Pstream::nonBlocking
)
{
forAll(*this, patchI)
forAll(*this, patchi)
{
operator[](patchI).initUpdateMesh(pBufs);
operator[](patchi).initUpdateMesh(pBufs);
}
pBufs.finishedSends();
forAll(*this, patchI)
forAll(*this, patchi)
{
operator[](patchI).updateMesh(pBufs);
operator[](patchi).updateMesh(pBufs);
}
}
else if (Pstream::defaultCommsType == Pstream::scheduled)
@ -1081,15 +1081,15 @@ void Foam::polyBoundaryMesh::updateMesh()
forAll(patchSchedule, patchEvali)
{
const label patchI = patchSchedule[patchEvali].patch;
const label patchi = patchSchedule[patchEvali].patch;
if (patchSchedule[patchEvali].init)
{
operator[](patchI).initUpdateMesh(pBufs);
operator[](patchi).initUpdateMesh(pBufs);
}
else
{
operator[](patchI).updateMesh(pBufs);
operator[](patchi).updateMesh(pBufs);
}
}
}
@ -1108,9 +1108,9 @@ void Foam::polyBoundaryMesh::reorder
// Adapt indices
polyPatchList& patches = *this;
forAll(patches, patchI)
forAll(patches, patchi)
{
patches[patchI].index() = patchI;
patches[patchi].index() = patchi;
}
if (validBoundary)
@ -1126,11 +1126,11 @@ bool Foam::polyBoundaryMesh::writeData(Ostream& os) const
os << patches.size() << nl << token::BEGIN_LIST << incrIndent << nl;
forAll(patches, patchI)
forAll(patches, patchi)
{
os << indent << patches[patchI].name() << nl
os << indent << patches[patchi].name() << nl
<< indent << token::BEGIN_BLOCK << nl
<< incrIndent << patches[patchI] << decrIndent
<< incrIndent << patches[patchi] << decrIndent
<< indent << token::END_BLOCK << endl;
}
@ -1160,9 +1160,9 @@ const Foam::polyPatch& Foam::polyBoundaryMesh::operator[]
const word& patchName
) const
{
const label patchI = findPatchID(patchName);
const label patchi = findPatchID(patchName);
if (patchI < 0)
if (patchi < 0)
{
FatalErrorInFunction
<< "Patch named " << patchName << " not found." << nl
@ -1170,7 +1170,7 @@ const Foam::polyPatch& Foam::polyBoundaryMesh::operator[]
<< abort(FatalError);
}
return operator[](patchI);
return operator[](patchi);
}
@ -1179,9 +1179,9 @@ Foam::polyPatch& Foam::polyBoundaryMesh::operator[]
const word& patchName
)
{
const label patchI = findPatchID(patchName);
const label patchi = findPatchID(patchName);
if (patchI < 0)
if (patchi < 0)
{
FatalErrorInFunction
<< "Patch named " << patchName << " not found." << nl
@ -1189,7 +1189,7 @@ Foam::polyPatch& Foam::polyBoundaryMesh::operator[]
<< abort(FatalError);
}
return operator[](patchI);
return operator[](patchi);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,11 +32,11 @@ Foam::labelHashSet Foam::polyBoundaryMesh::findPatchIDs() const
labelHashSet patchIDs(bm.size());
forAll(bm, patchI)
forAll(bm, patchi)
{
if (isA<Type>(bm[patchI]))
if (isA<Type>(bm[patchi]))
{
patchIDs.insert(patchI);
patchIDs.insert(patchi);
}
}
return patchIDs;

View File

@ -677,15 +677,15 @@ void Foam::polyMesh::resetPrimitives
// Reset patch sizes and starts
forAll(boundary_, patchI)
forAll(boundary_, patchi)
{
boundary_[patchI] = polyPatch
boundary_[patchi] = polyPatch
(
boundary_[patchI],
boundary_[patchi],
boundary_,
patchI,
patchSizes[patchI],
patchStarts[patchI]
patchi,
patchSizes[patchi],
patchStarts[patchi]
);
}

View File

@ -72,15 +72,15 @@ bool Foam::polyMesh::checkFaceOrthogonality
// Statistics only for internal and masters of coupled faces
PackedBoolList isMasterFace(syncTools::getInternalOrMasterFaces(*this));
forAll(ortho, faceI)
forAll(ortho, facei)
{
if (ortho[faceI] < severeNonorthogonalityThreshold)
if (ortho[facei] < severeNonorthogonalityThreshold)
{
if (ortho[faceI] > SMALL)
if (ortho[facei] > SMALL)
{
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
severeNonOrth++;
@ -90,18 +90,18 @@ bool Foam::polyMesh::checkFaceOrthogonality
// Error : non-ortho too large
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
if (detailedReport && errorNonOrth == 0)
{
// Non-orthogonality greater than 90 deg
WarningInFunction
<< "Severe non-orthogonality for face "
<< faceI
<< " between cells " << own[faceI]
<< " and " << nei[faceI]
<< facei
<< " between cells " << own[facei]
<< " and " << nei[facei]
<< ": Angle = "
<< radToDeg(::acos(min(1.0, max(-1.0, ortho[faceI]))))
<< radToDeg(::acos(min(1.0, max(-1.0, ortho[facei]))))
<< " deg." << endl;
}
@ -109,10 +109,10 @@ bool Foam::polyMesh::checkFaceOrthogonality
}
}
if (isMasterFace[faceI])
if (isMasterFace[facei])
{
minDDotS = min(minDDotS, ortho[faceI]);
sumDDotS += ortho[faceI];
minDDotS = min(minDDotS, ortho[facei]);
sumDDotS += ortho[facei];
nSummed++;
}
}
@ -205,37 +205,37 @@ bool Foam::polyMesh::checkFaceSkewness
// Statistics only for all faces except slave coupled faces
PackedBoolList isMasterFace(syncTools::getMasterFaces(*this));
forAll(skew, faceI)
forAll(skew, facei)
{
// Check if the skewness vector is greater than the PN vector.
// This does not cause trouble but is a good indication of a poor mesh.
if (skew[faceI] > skewThreshold_)
if (skew[facei] > skewThreshold_)
{
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
if (detailedReport && nWarnSkew == 0)
{
// Non-orthogonality greater than 90 deg
if (isInternalFace(faceI))
if (isInternalFace(facei))
{
WarningInFunction
<< "Severe skewness " << skew[faceI]
<< " for face " << faceI
<< " between cells " << own[faceI]
<< " and " << nei[faceI];
<< "Severe skewness " << skew[facei]
<< " for face " << facei
<< " between cells " << own[facei]
<< " and " << nei[facei];
}
else
{
WarningInFunction
<< "Severe skewness " << skew[faceI]
<< " for boundary face " << faceI
<< " on cell " << own[faceI];
<< "Severe skewness " << skew[facei]
<< " for boundary face " << facei
<< " on cell " << own[facei];
}
}
if (isMasterFace[faceI])
if (isMasterFace[facei])
{
nWarnSkew++;
}
@ -314,9 +314,9 @@ bool Foam::polyMesh::checkEdgeAlignment
EdgeMap<label> edgesInError;
forAll(fcs, faceI)
forAll(fcs, facei)
{
const face& f = fcs[faceI];
const face& f = fcs[facei];
forAll(f, fp)
{
@ -358,13 +358,13 @@ bool Foam::polyMesh::checkEdgeAlignment
// Ok if purely in empty directions.
if (nNonEmptyDirs > 0)
{
edgesInError.insert(edge(p0, p1), faceI);
edgesInError.insert(edge(p0, p1), facei);
}
}
else if (nEmptyDirs > 1)
{
// Always an error
edgesInError.insert(edge(p0, p1), faceI);
edgesInError.insert(edge(p0, p1), facei);
}
}
}
@ -434,13 +434,13 @@ bool Foam::polyMesh::checkCellDeterminant
scalar minDet = min(cellDeterminant);
scalar sumDet = sum(cellDeterminant);
forAll(cellDeterminant, cellI)
forAll(cellDeterminant, celli)
{
if (cellDeterminant[cellI] < warnDet)
if (cellDeterminant[celli] < warnDet)
{
if (setPtr)
{
setPtr->insert(cellI);
setPtr->insert(celli);
}
nErrorCells++;
@ -520,24 +520,24 @@ bool Foam::polyMesh::checkFaceWeight
// Statistics only for internal and masters of coupled faces
PackedBoolList isMasterFace(syncTools::getInternalOrMasterFaces(*this));
forAll(faceWght, faceI)
forAll(faceWght, facei)
{
if (faceWght[faceI] < minWeight)
if (faceWght[facei] < minWeight)
{
// Note: insert both sides of coupled faces
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
nErrorFaces++;
}
// Note: statistics only on master of coupled faces
if (isMasterFace[faceI])
if (isMasterFace[facei])
{
minDet = min(minDet, faceWght[faceI]);
sumDet += faceWght[faceI];
minDet = min(minDet, faceWght[facei]);
sumDet += faceWght[facei];
nSummed++;
}
}
@ -607,24 +607,24 @@ bool Foam::polyMesh::checkVolRatio
// Statistics only for internal and masters of coupled faces
PackedBoolList isMasterFace(syncTools::getInternalOrMasterFaces(*this));
forAll(volRatio, faceI)
forAll(volRatio, facei)
{
if (volRatio[faceI] < minRatio)
if (volRatio[facei] < minRatio)
{
// Note: insert both sides of coupled faces
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
nErrorFaces++;
}
// Note: statistics only on master of coupled faces
if (isMasterFace[faceI])
if (isMasterFace[facei])
{
minDet = min(minDet, volRatio[faceI]);
sumDet += volRatio[faceI];
minDet = min(minDet, volRatio[facei]);
sumDet += volRatio[facei];
nSummed++;
}
}

View File

@ -46,13 +46,13 @@ Foam::tmp<Foam::scalarField> Foam::polyMeshTools::faceOrthogonality
scalarField& ortho = tortho.ref();
// Internal faces
forAll(nei, faceI)
forAll(nei, facei)
{
ortho[faceI] = primitiveMeshTools::faceOrthogonality
ortho[facei] = primitiveMeshTools::faceOrthogonality
(
cc[own[faceI]],
cc[nei[faceI]],
areas[faceI]
cc[own[facei]],
cc[nei[facei]],
areas[facei]
);
}
@ -62,21 +62,21 @@ Foam::tmp<Foam::scalarField> Foam::polyMeshTools::faceOrthogonality
pointField neighbourCc;
syncTools::swapBoundaryCellPositions(mesh, cc, neighbourCc);
forAll(pbm, patchI)
forAll(pbm, patchi)
{
const polyPatch& pp = pbm[patchI];
const polyPatch& pp = pbm[patchi];
if (pp.coupled())
{
forAll(pp, i)
{
label faceI = pp.start() + i;
label bFaceI = faceI - mesh.nInternalFaces();
label facei = pp.start() + i;
label bFaceI = facei - mesh.nInternalFaces();
ortho[faceI] = primitiveMeshTools::faceOrthogonality
ortho[facei] = primitiveMeshTools::faceOrthogonality
(
cc[own[faceI]],
cc[own[facei]],
neighbourCc[bFaceI],
areas[faceI]
areas[facei]
);
}
}
@ -102,18 +102,18 @@ Foam::tmp<Foam::scalarField> Foam::polyMeshTools::faceSkewness
tmp<scalarField> tskew(new scalarField(mesh.nFaces()));
scalarField& skew = tskew.ref();
forAll(nei, faceI)
forAll(nei, facei)
{
skew[faceI] = primitiveMeshTools::faceSkewness
skew[facei] = primitiveMeshTools::faceSkewness
(
mesh,
p,
fCtrs,
fAreas,
faceI,
cellCtrs[own[faceI]],
cellCtrs[nei[faceI]]
facei,
cellCtrs[own[facei]],
cellCtrs[nei[facei]]
);
}
@ -124,25 +124,25 @@ Foam::tmp<Foam::scalarField> Foam::polyMeshTools::faceSkewness
pointField neighbourCc;
syncTools::swapBoundaryCellPositions(mesh, cellCtrs, neighbourCc);
forAll(pbm, patchI)
forAll(pbm, patchi)
{
const polyPatch& pp = pbm[patchI];
const polyPatch& pp = pbm[patchi];
if (pp.coupled())
{
forAll(pp, i)
{
label faceI = pp.start() + i;
label bFaceI = faceI - mesh.nInternalFaces();
label facei = pp.start() + i;
label bFaceI = facei - mesh.nInternalFaces();
skew[faceI] = primitiveMeshTools::faceSkewness
skew[facei] = primitiveMeshTools::faceSkewness
(
mesh,
p,
fCtrs,
fAreas,
faceI,
cellCtrs[own[faceI]],
facei,
cellCtrs[own[facei]],
neighbourCc[bFaceI]
);
}
@ -151,17 +151,17 @@ Foam::tmp<Foam::scalarField> Foam::polyMeshTools::faceSkewness
{
forAll(pp, i)
{
label faceI = pp.start() + i;
label facei = pp.start() + i;
skew[faceI] = primitiveMeshTools::boundaryFaceSkewness
skew[facei] = primitiveMeshTools::boundaryFaceSkewness
(
mesh,
p,
fCtrs,
fAreas,
faceI,
cellCtrs[own[faceI]]
facei,
cellCtrs[own[facei]]
);
}
}
@ -187,15 +187,15 @@ Foam::tmp<Foam::scalarField> Foam::polyMeshTools::faceWeights
scalarField& weight = tweight.ref();
// Internal faces
forAll(nei, faceI)
forAll(nei, facei)
{
const point& fc = fCtrs[faceI];
const vector& fa = fAreas[faceI];
const point& fc = fCtrs[facei];
const vector& fa = fAreas[facei];
scalar dOwn = mag(fa & (fc-cellCtrs[own[faceI]]));
scalar dNei = mag(fa & (cellCtrs[nei[faceI]]-fc));
scalar dOwn = mag(fa & (fc-cellCtrs[own[facei]]));
scalar dNei = mag(fa & (cellCtrs[nei[facei]]-fc));
weight[faceI] = min(dNei,dOwn)/(dNei+dOwn+VSMALL);
weight[facei] = min(dNei,dOwn)/(dNei+dOwn+VSMALL);
}
@ -204,23 +204,23 @@ Foam::tmp<Foam::scalarField> Foam::polyMeshTools::faceWeights
pointField neiCc;
syncTools::swapBoundaryCellPositions(mesh, cellCtrs, neiCc);
forAll(pbm, patchI)
forAll(pbm, patchi)
{
const polyPatch& pp = pbm[patchI];
const polyPatch& pp = pbm[patchi];
if (pp.coupled())
{
forAll(pp, i)
{
label faceI = pp.start() + i;
label bFaceI = faceI - mesh.nInternalFaces();
label facei = pp.start() + i;
label bFaceI = facei - mesh.nInternalFaces();
const point& fc = fCtrs[faceI];
const vector& fa = fAreas[faceI];
const point& fc = fCtrs[facei];
const vector& fa = fAreas[facei];
scalar dOwn = mag(fa & (fc-cellCtrs[own[faceI]]));
scalar dOwn = mag(fa & (fc-cellCtrs[own[facei]]));
scalar dNei = mag(fa & (neiCc[bFaceI]-fc));
weight[faceI] = min(dNei,dOwn)/(dNei+dOwn+VSMALL);
weight[facei] = min(dNei,dOwn)/(dNei+dOwn+VSMALL);
}
}
}
@ -243,12 +243,12 @@ Foam::tmp<Foam::scalarField> Foam::polyMeshTools::volRatio
scalarField& ratio = tratio.ref();
// Internal faces
forAll(nei, faceI)
forAll(nei, facei)
{
scalar volOwn = vol[own[faceI]];
scalar volNei = vol[nei[faceI]];
scalar volOwn = vol[own[facei]];
scalar volNei = vol[nei[facei]];
ratio[faceI] = min(volOwn,volNei)/(max(volOwn, volNei)+VSMALL);
ratio[facei] = min(volOwn,volNei)/(max(volOwn, volNei)+VSMALL);
}
@ -257,20 +257,20 @@ Foam::tmp<Foam::scalarField> Foam::polyMeshTools::volRatio
scalarField neiVol;
syncTools::swapBoundaryCellList(mesh, vol, neiVol);
forAll(pbm, patchI)
forAll(pbm, patchi)
{
const polyPatch& pp = pbm[patchI];
const polyPatch& pp = pbm[patchi];
if (pp.coupled())
{
forAll(pp, i)
{
label faceI = pp.start() + i;
label bFaceI = faceI - mesh.nInternalFaces();
label facei = pp.start() + i;
label bFaceI = facei - mesh.nInternalFaces();
scalar volOwn = vol[own[faceI]];
scalar volOwn = vol[own[facei]];
scalar volNei = neiVol[bFaceI];
ratio[faceI] = min(volOwn,volNei)/(max(volOwn, volNei)+VSMALL);
ratio[facei] = min(volOwn,volNei)/(max(volOwn, volNei)+VSMALL);
}
}
}

View File

@ -93,16 +93,16 @@ Foam::labelList Foam::polyMesh::facePatchFaceCells
{
const labelList& facePointCells = pointCells[facePoints[pointI]];
forAll(facePointCells, cellI)
forAll(facePointCells, celli)
{
faceList cellFaces = cellsFaceShapes[facePointCells[cellI]];
faceList cellFaces = cellsFaceShapes[facePointCells[celli]];
forAll(cellFaces, cellFace)
{
if (face::sameVertices(cellFaces[cellFace], curFace))
{
// Found the cell corresponding to this face
FaceCells[fI] = facePointCells[cellI];
FaceCells[fI] = facePointCells[celli];
found = true;
}
@ -147,17 +147,17 @@ void Foam::polyMesh::setTopology
faceListList cellsFaceShapes(cellsAsShapes.size());
cells.setSize(cellsAsShapes.size());
forAll(cellsFaceShapes, cellI)
forAll(cellsFaceShapes, celli)
{
cellsFaceShapes[cellI] = cellsAsShapes[cellI].faces();
cellsFaceShapes[celli] = cellsAsShapes[celli].faces();
cells[cellI].setSize(cellsFaceShapes[cellI].size());
cells[celli].setSize(cellsFaceShapes[celli].size());
// Initialise cells to -1 to flag undefined faces
static_cast<labelList&>(cells[cellI]) = -1;
static_cast<labelList&>(cells[celli]) = -1;
// Count maximum possible numer of mesh faces
maxFaces += cellsFaceShapes[cellI].size();
maxFaces += cellsFaceShapes[celli].size();
}
// Set size of faces array to maximum possible number of mesh faces
@ -171,7 +171,7 @@ void Foam::polyMesh::setTopology
bool found = false;
forAll(cells, cellI)
forAll(cells, celli)
{
// Note:
// Insertion cannot be done in one go as the faces need to be
@ -179,7 +179,7 @@ void Foam::polyMesh::setTopology
// cells. Therefore, all neighbours will be detected first
// and then added in the correct order.
const faceList& curFaces = cellsFaceShapes[cellI];
const faceList& curFaces = cellsFaceShapes[celli];
// Record the neighbour cell
labelList neiCells(curFaces.size(), -1);
@ -190,14 +190,14 @@ void Foam::polyMesh::setTopology
label nNeighbours = 0;
// For all faces ...
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
// Skip faces that have already been matched
if (cells[cellI][faceI] >= 0) continue;
if (cells[celli][facei] >= 0) continue;
found = false;
const face& curFace = curFaces[faceI];
const face& curFace = curFaces[facei];
// Get the list of labels
const labelList& curPoints = curFace;
@ -215,7 +215,7 @@ void Foam::polyMesh::setTopology
label curNei = curNeighbours[neiI];
// Reject neighbours with the lower label
if (curNei > cellI)
if (curNei > celli)
{
// Get the list of search faces
const faceList& searchFaces = cellsFaceShapes[curNei];
@ -228,8 +228,8 @@ void Foam::polyMesh::setTopology
found = true;
// Record the neighbour cell and face
neiCells[faceI] = curNei;
faceOfNeiCell[faceI] = neiFaceI;
neiCells[facei] = curNei;
faceOfNeiCell[facei] = neiFaceI;
nNeighbours++;
break;
@ -265,7 +265,7 @@ void Foam::polyMesh::setTopology
faces_[nFaces] = curFaces[nextNei];
// Set cell-face and cell-neighbour-face to current face label
cells[cellI][nextNei] = nFaces;
cells[celli][nextNei] = nFaces;
cells[neiCells[nextNei]][faceOfNeiCell[nextNei]] = nFaces;
// Stop the neighbour from being used again
@ -288,9 +288,9 @@ void Foam::polyMesh::setTopology
patchSizes.setSize(boundaryFaces.size(), -1);
patchStarts.setSize(boundaryFaces.size(), -1);
forAll(boundaryFaces, patchI)
forAll(boundaryFaces, patchi)
{
const faceList& patchFaces = boundaryFaces[patchI];
const faceList& patchFaces = boundaryFaces[patchi];
labelList curPatchFaceCells =
facePatchFaceCells
@ -298,17 +298,17 @@ void Foam::polyMesh::setTopology
patchFaces,
PointCells,
cellsFaceShapes,
patchI
patchi
);
// Grab the start label
label curPatchStart = nFaces;
forAll(patchFaces, faceI)
forAll(patchFaces, facei)
{
const face& curFace = patchFaces[faceI];
const face& curFace = patchFaces[facei];
const label cellInside = curPatchFaceCells[faceI];
const label cellInside = curPatchFaceCells[facei];
// Get faces of the cell inside
const faceList& facesOfCellInside = cellsFaceShapes[cellInside];
@ -326,9 +326,9 @@ void Foam::polyMesh::setTopology
<< " on the face on cell " << cellInside
<< " which is either an internal face or already "
<< "belongs to some other patch. This is face "
<< faceI << " of patch "
<< patchI << " named "
<< boundaryPatchNames[patchI] << "."
<< facei << " of patch "
<< patchi << " named "
<< boundaryPatchNames[patchi] << "."
<< abort(FatalError);
}
@ -346,7 +346,7 @@ void Foam::polyMesh::setTopology
if (!found)
{
FatalErrorInFunction
<< "face " << faceI << " of patch " << patchI
<< "face " << facei << " of patch " << patchi
<< " does not seem to belong to cell " << cellInside
<< " which, according to the addressing, "
<< "should be next to it."
@ -357,24 +357,24 @@ void Foam::polyMesh::setTopology
nFaces++;
}
patchSizes[patchI] = nFaces - curPatchStart;
patchStarts[patchI] = curPatchStart;
patchSizes[patchi] = nFaces - curPatchStart;
patchStarts[patchi] = curPatchStart;
}
// Grab "non-existing" faces and put them into a default patch
defaultPatchStart = nFaces;
forAll(cells, cellI)
forAll(cells, celli)
{
labelList& curCellFaces = cells[cellI];
labelList& curCellFaces = cells[celli];
forAll(curCellFaces, faceI)
forAll(curCellFaces, facei)
{
if (curCellFaces[faceI] == -1) // "non-existent" face
if (curCellFaces[facei] == -1) // "non-existent" face
{
curCellFaces[faceI] = nFaces;
faces_[nFaces] = cellsFaceShapes[cellI][faceI];
curCellFaces[facei] = nFaces;
faces_[nFaces] = cellsFaceShapes[celli][facei];
nFaces++;
}
@ -553,19 +553,19 @@ Foam::polyMesh::polyMesh
// Warning: Patches can only be added once the face list is
// completed, as they hold a subList of the face list
forAll(boundaryFaces, patchI)
forAll(boundaryFaces, patchi)
{
// Add the patch to the list
boundary_.set
(
patchI,
patchi,
polyPatch::New
(
boundaryPatchTypes[patchI],
boundaryPatchNames[patchI],
patchSizes[patchI],
patchStarts[patchI],
patchI,
boundaryPatchTypes[patchi],
boundaryPatchNames[patchi],
patchSizes[patchi],
patchStarts[patchi],
patchi,
boundary_
)
);
@ -573,11 +573,11 @@ Foam::polyMesh::polyMesh
if
(
boundaryPatchPhysicalTypes.size()
&& boundaryPatchPhysicalTypes[patchI].size()
&& boundaryPatchPhysicalTypes[patchi].size()
)
{
boundary_[patchI].physicalType() =
boundaryPatchPhysicalTypes[patchI];
boundary_[patchi].physicalType() =
boundaryPatchPhysicalTypes[patchi];
}
}
@ -598,32 +598,32 @@ Foam::polyMesh::polyMesh
// Check if there already exists a defaultFaces patch as last patch
// and reuse it.
label patchI = findIndex(boundaryPatchNames, defaultBoundaryPatchName);
label patchi = findIndex(boundaryPatchNames, defaultBoundaryPatchName);
if (patchI != -1)
if (patchi != -1)
{
if (patchI != boundaryFaces.size()-1 || boundary_[patchI].size())
if (patchi != boundaryFaces.size()-1 || boundary_[patchi].size())
{
FatalErrorInFunction
<< "Default patch " << boundary_[patchI].name()
<< "Default patch " << boundary_[patchi].name()
<< " already has faces in it or is not"
<< " last in list of patches." << exit(FatalError);
}
WarningInFunction
<< "Reusing existing patch " << patchI
<< "Reusing existing patch " << patchi
<< " for undefined faces." << endl;
boundary_.set
(
patchI,
patchi,
polyPatch::New
(
boundaryPatchTypes[patchI],
boundaryPatchNames[patchI],
boundaryPatchTypes[patchi],
boundaryPatchNames[patchi],
nFaces - defaultPatchStart,
defaultPatchStart,
patchI,
patchi,
boundary_
)
);
@ -837,22 +837,22 @@ Foam::polyMesh::polyMesh
// Warning: Patches can only be added once the face list is
// completed, as they hold a subList of the face list
forAll(boundaryDicts, patchI)
forAll(boundaryDicts, patchi)
{
dictionary patchDict(boundaryDicts[patchI]);
dictionary patchDict(boundaryDicts[patchi]);
patchDict.set("nFaces", patchSizes[patchI]);
patchDict.set("startFace", patchStarts[patchI]);
patchDict.set("nFaces", patchSizes[patchi]);
patchDict.set("startFace", patchStarts[patchi]);
// Add the patch to the list
boundary_.set
(
patchI,
patchi,
polyPatch::New
(
boundaryPatchNames[patchI],
boundaryPatchNames[patchi],
patchDict,
patchI,
patchi,
boundary_
)
);
@ -874,32 +874,32 @@ Foam::polyMesh::polyMesh
// Check if there already exists a defaultFaces patch as last patch
// and reuse it.
label patchI = findIndex(boundaryPatchNames, defaultBoundaryPatchName);
label patchi = findIndex(boundaryPatchNames, defaultBoundaryPatchName);
if (patchI != -1)
if (patchi != -1)
{
if (patchI != boundaryFaces.size()-1 || boundary_[patchI].size())
if (patchi != boundaryFaces.size()-1 || boundary_[patchi].size())
{
FatalErrorInFunction
<< "Default patch " << boundary_[patchI].name()
<< "Default patch " << boundary_[patchi].name()
<< " already has faces in it or is not"
<< " last in list of patches." << exit(FatalError);
}
WarningInFunction
<< "Reusing existing patch " << patchI
<< "Reusing existing patch " << patchi
<< " for undefined faces." << endl;
boundary_.set
(
patchI,
patchi,
polyPatch::New
(
boundary_[patchI].type(),
boundary_[patchI].name(),
boundary_[patchi].type(),
boundary_[patchi].name(),
nFaces - defaultPatchStart,
defaultPatchStart,
patchI,
patchi,
boundary_
)
);

View File

@ -184,12 +184,12 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
wordList oldTypes = boundary_.types();
wordList oldNames = boundary_.names();
forAll(oldTypes, patchI)
forAll(oldTypes, patchi)
{
if
(
oldTypes[patchI] != newTypes[patchI]
|| oldNames[patchI] != newNames[patchI]
oldTypes[patchi] != newTypes[patchi]
|| oldNames[patchi] != newNames[patchi]
)
{
boundaryChanged = true;
@ -206,23 +206,23 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
boundary_.clear();
boundary_.setSize(newBoundary.size());
forAll(newBoundary, patchI)
forAll(newBoundary, patchi)
{
boundary_.set(patchI, newBoundary[patchI].clone(boundary_));
boundary_.set(patchi, newBoundary[patchi].clone(boundary_));
}
}
else
{
forAll(boundary_, patchI)
forAll(boundary_, patchi)
{
boundary_[patchI] = polyPatch
boundary_[patchi] = polyPatch
(
newBoundary[patchI].name(),
newBoundary[patchI].size(),
newBoundary[patchI].start(),
patchI,
newBoundary[patchi].name(),
newBoundary[patchi].size(),
newBoundary[patchi].start(),
patchi,
boundary_,
newBoundary[patchI].type()
newBoundary[patchi].type()
);
}
}

View File

@ -40,9 +40,9 @@ void Foam::polyMesh::initMesh()
{
label nInternalFaces = 0;
forAll(neighbour_, faceI)
forAll(neighbour_, facei)
{
if (neighbour_[faceI] == -1)
if (neighbour_[facei] == -1)
{
break;
}
@ -118,31 +118,31 @@ void Foam::polyMesh::initMesh(cellList& c)
label nInternalFaces = 0;
forAll(c, cellI)
forAll(c, celli)
{
// get reference to face labels for current cell
const labelList& cellfaces = c[cellI];
const labelList& cellfaces = c[celli];
forAll(cellfaces, faceI)
forAll(cellfaces, facei)
{
if (cellfaces[faceI] < 0)
if (cellfaces[facei] < 0)
{
FatalErrorInFunction
<< "Illegal face label " << cellfaces[faceI]
<< " in cell " << cellI
<< "Illegal face label " << cellfaces[facei]
<< " in cell " << celli
<< exit(FatalError);
}
if (!markedFaces[cellfaces[faceI]])
if (!markedFaces[cellfaces[facei]])
{
// First visit: owner
owner_[cellfaces[faceI]] = cellI;
markedFaces[cellfaces[faceI]] = true;
owner_[cellfaces[facei]] = celli;
markedFaces[cellfaces[facei]] = true;
}
else
{
// Second visit: neighbour
neighbour_[cellfaces[faceI]] = cellI;
neighbour_[cellfaces[facei]] = celli;
nInternalFaces++;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -226,10 +226,10 @@ Foam::labelList Foam::polyMeshTetDecomposition::findFaceBasePts
pointField neighbourCellCentres(mesh.nFaces() - nInternalFaces);
for(label faceI = nInternalFaces; faceI < mesh.nFaces(); faceI++)
for(label facei = nInternalFaces; facei < mesh.nFaces(); facei++)
{
neighbourCellCentres[faceI - nInternalFaces] =
pC[pOwner[faceI]];
neighbourCellCentres[facei - nInternalFaces] =
pC[pOwner[facei]];
}
syncTools::swapBoundaryFacePositions(mesh, neighbourCellCentres);
@ -250,13 +250,13 @@ Foam::labelList Foam::polyMeshTetDecomposition::findFaceBasePts
fI++, bFI++
)
{
label patchI =
label patchi =
mesh.boundaryMesh().patchID()[bFI];
if (patches[patchI].coupled())
if (patches[patchi].coupled())
{
const coupledPolyPatch& pp =
refCast<const coupledPolyPatch>(patches[patchI]);
refCast<const coupledPolyPatch>(patches[patchi]);
if (pp.owner())
{
@ -323,12 +323,12 @@ Foam::labelList Foam::polyMeshTetDecomposition::findFaceBasePts
continue;
}
label patchI = mesh.boundaryMesh().patchID()[bFI];
label patchi = mesh.boundaryMesh().patchID()[bFI];
if (patches[patchI].coupled())
if (patches[patchi].coupled())
{
const coupledPolyPatch& pp =
refCast<const coupledPolyPatch>(patches[patchI]);
refCast<const coupledPolyPatch>(patches[patchi]);
// Calculated base points on coupled faces are those of
// the owner patch face. They need to be reindexed to for
@ -381,9 +381,9 @@ bool Foam::polyMeshTetDecomposition::checkFaceTets
// Calculate coupled cell centre
pointField neiCc(mesh.nFaces() - mesh.nInternalFaces());
for (label faceI = mesh.nInternalFaces(); faceI < mesh.nFaces(); faceI++)
for (label facei = mesh.nInternalFaces(); facei < mesh.nFaces(); facei++)
{
neiCc[faceI - mesh.nInternalFaces()] = cc[own[faceI]];
neiCc[facei - mesh.nInternalFaces()] = cc[own[facei]];
}
syncTools::swapBoundaryFacePositions(mesh, neiCc);
@ -394,9 +394,9 @@ bool Foam::polyMeshTetDecomposition::checkFaceTets
label nErrorTets = 0;
forAll(fcs, faceI)
forAll(fcs, facei)
{
const face& f = fcs[faceI];
const face& f = fcs[facei];
forAll(f, fPtI)
{
@ -404,15 +404,15 @@ bool Foam::polyMeshTetDecomposition::checkFaceTets
(
p[f[fPtI]],
p[f.nextLabel(fPtI)],
fc[faceI],
cc[own[faceI]]
fc[facei],
cc[own[facei]]
).quality();
if (tetQual > -tol)
{
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
nErrorTets++;
@ -420,10 +420,10 @@ bool Foam::polyMeshTetDecomposition::checkFaceTets
}
}
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
// Create the neighbour tet - it will have positive volume
const face& f = fcs[faceI];
const face& f = fcs[facei];
forAll(f, fPtI)
{
@ -431,15 +431,15 @@ bool Foam::polyMeshTetDecomposition::checkFaceTets
(
p[f[fPtI]],
p[f.nextLabel(fPtI)],
fc[faceI],
cc[nei[faceI]]
fc[facei],
cc[nei[facei]]
).quality();
if (tetQual < tol)
{
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
nErrorTets++;
@ -447,11 +447,11 @@ bool Foam::polyMeshTetDecomposition::checkFaceTets
}
}
if (findSharedBasePoint(mesh, faceI, tol, report) == -1)
if (findSharedBasePoint(mesh, facei, tol, report) == -1)
{
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
nErrorTets++;
@ -459,17 +459,17 @@ bool Foam::polyMeshTetDecomposition::checkFaceTets
}
else
{
label patchI = patches.patchID()[faceI - mesh.nInternalFaces()];
label patchi = patches.patchID()[facei - mesh.nInternalFaces()];
if (patches[patchI].coupled())
if (patches[patchi].coupled())
{
if
(
findSharedBasePoint
(
mesh,
faceI,
neiCc[faceI - mesh.nInternalFaces()],
facei,
neiCc[facei - mesh.nInternalFaces()],
tol,
report
) == -1
@ -477,7 +477,7 @@ bool Foam::polyMeshTetDecomposition::checkFaceTets
{
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
nErrorTets++;
@ -485,11 +485,11 @@ bool Foam::polyMeshTetDecomposition::checkFaceTets
}
else
{
if (findBasePoint(mesh, faceI, tol, report) == -1)
if (findBasePoint(mesh, facei, tol, report) == -1)
{
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
nErrorTets++;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,8 +29,8 @@ License
Foam::tetIndices::tetIndices()
:
cellI_(-1),
faceI_(-1),
celli_(-1),
facei_(-1),
faceBasePtI_(-1),
facePtAI_(-1),
facePtBI_(-1),
@ -40,16 +40,16 @@ Foam::tetIndices::tetIndices()
Foam::tetIndices::tetIndices
(
label cellI,
label faceI,
label celli,
label facei,
label faceBasePtI,
label facePtAI,
label facePtBI,
label tetPtI
)
:
cellI_(cellI),
faceI_(faceI),
celli_(celli),
facei_(facei),
faceBasePtI_(faceBasePtI),
facePtAI_(facePtAI),
facePtBI_(facePtBI),
@ -59,14 +59,14 @@ Foam::tetIndices::tetIndices
Foam::tetIndices::tetIndices
(
label cellI,
label faceI,
label celli,
label facei,
label tetPtI,
const polyMesh& mesh
)
:
cellI_(cellI),
faceI_(faceI),
celli_(celli),
facei_(facei),
faceBasePtI_(-1),
facePtAI_(-1),
facePtBI_(-1),
@ -75,11 +75,11 @@ Foam::tetIndices::tetIndices
const faceList& pFaces = mesh.faces();
const labelList& pOwner = mesh.faceOwner();
const Foam::face& f = pFaces[faceI_];
const Foam::face& f = pFaces[facei_];
bool own = (pOwner[faceI_] == cellI_);
bool own = (pOwner[facei_] == celli_);
faceBasePtI_ = mesh.tetBasePtIs()[faceI_];
faceBasePtI_ = mesh.tetBasePtIs()[facei_];
label facePtI = (tetPtI_ + faceBasePtI_) % f.size();
label otherFacePtI = f.fcIndex(facePtI);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -76,10 +76,10 @@ class tetIndices
// Private data
//- Cell that this is a decomposed tet of
label cellI_;
label celli_;
//- Face that holds this decomposed tet
label faceI_;
label facei_;
//- Base point on the face
label faceBasePtI_;
@ -109,8 +109,8 @@ public:
//- Construct from components
tetIndices
(
label cellI,
label faceI,
label celli,
label facei,
label faceBasePtI,
label facePtAI,
label facePtBI,
@ -120,8 +120,8 @@ public:
//- Construct from cell, face, pt description of tet
tetIndices
(
label cellI,
label faceI,
label celli,
label facei,
label tetPtI,
const polyMesh& mesh
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,13 +29,13 @@ License
Foam::label Foam::tetIndices::cell() const
{
return cellI_;
return celli_;
}
Foam::label Foam::tetIndices::face() const
{
return faceI_;
return facei_;
}
@ -69,11 +69,11 @@ Foam::tetPointRef Foam::tetIndices::tet(const polyMesh& mesh) const
const faceList& pFaces = mesh.faces();
const vectorField& pC = mesh.cellCentres();
const Foam::face& f = pFaces[faceI_];
const Foam::face& f = pFaces[facei_];
return tetPointRef
(
pC[cellI_],
pC[celli_],
pPts[f[faceBasePtI_]],
pPts[f[facePtAI_]],
pPts[f[facePtBI_]]
@ -88,13 +88,13 @@ Foam::tetPointRef Foam::tetIndices::oldTet(const polyMesh& mesh) const
// We need to reconstruct the old Cc from oldPoints (it isn't
// stored)
point oldC = mesh.cells()[cellI_].centre
point oldC = mesh.cells()[celli_].centre
(
oldPPts,
pFaces
);
const Foam::face& f = pFaces[faceI_];
const Foam::face& f = pFaces[facei_];
return tetPointRef
(
@ -111,7 +111,7 @@ Foam::triPointRef Foam::tetIndices::faceTri(const polyMesh& mesh) const
const pointField& pPts = mesh.points();
const faceList& pFaces = mesh.faces();
const Foam::face& f = pFaces[faceI_];
const Foam::face& f = pFaces[facei_];
return triPointRef
(
@ -126,7 +126,7 @@ Foam::triFace Foam::tetIndices::faceTriIs(const polyMesh& mesh) const
{
const faceList& pFaces = mesh.faces();
const Foam::face& f = pFaces[faceI_];
const Foam::face& f = pFaces[facei_];
return triFace
(
@ -142,7 +142,7 @@ Foam::triPointRef Foam::tetIndices::oldFaceTri(const polyMesh& mesh) const
const pointField& oldPPts = mesh.oldPoints();
const faceList& pFaces = mesh.faces();
const Foam::face& f = pFaces[faceI_];
const Foam::face& f = pFaces[facei_];
return triPointRef
(
@ -155,13 +155,13 @@ Foam::triPointRef Foam::tetIndices::oldFaceTri(const polyMesh& mesh) const
Foam::label& Foam::tetIndices::cell()
{
return cellI_;
return celli_;
}
Foam::label& Foam::tetIndices::face()
{
return faceI_;
return facei_;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -139,17 +139,17 @@ Foam::pointField Foam::coupledPolyPatch::getAnchorPoints
if (transform != COINCIDENTFULLMATCH)
{
// Return the first point
forAll(faces, faceI)
forAll(faces, facei)
{
anchors[faceI] = points[faces[faceI][0]];
anchors[facei] = points[faces[facei][0]];
}
}
else
{
// Make anchor point unique
forAll(faces, faceI)
forAll(faces, facei)
{
const face& f = faces[faceI];
const face& f = faces[facei];
bool unique = true;
@ -179,14 +179,14 @@ Foam::pointField Foam::coupledPolyPatch::getAnchorPoints
if (unique)
{
anchors[faceI] = p1;
anchors[facei] = p1;
break;
}
}
if (!unique)
{
anchors[faceI] = points[faces[faceI][0]];
anchors[facei] = points[faces[facei][0]];
}
}
}
@ -205,11 +205,11 @@ Foam::scalarField Foam::coupledPolyPatch::calcFaceTol
// Calculate typical distance per face
scalarField tols(faces.size());
forAll(faces, faceI)
forAll(faces, facei)
{
const point& cc = faceCentres[faceI];
const point& cc = faceCentres[facei];
const face& f = faces[faceI];
const face& f = faces[facei];
// 1. calculate a typical size of the face. Use maximum distance
// to face centre
@ -225,7 +225,7 @@ Foam::scalarField Foam::coupledPolyPatch::calcFaceTol
maxCmpt = max(maxCmpt, cmptMax(cmptMag(pt)));
}
tols[faceI] = max
tols[facei] = max
(
SMALL,
max(SMALL*maxCmpt, Foam::sqrt(maxLenSqr))

View File

@ -60,14 +60,14 @@ Foam::label Foam::cyclicPolyPatch::findMaxArea
label maxI = -1;
scalar maxAreaSqr = -GREAT;
forAll(faces, faceI)
forAll(faces, facei)
{
scalar areaSqr = magSqr(faces[faceI].normal(points));
scalar areaSqr = magSqr(faces[facei].normal(points));
if (areaSqr > maxAreaSqr)
{
maxAreaSqr = areaSqr;
maxI = faceI;
maxI = facei;
}
}
return maxI;
@ -454,20 +454,20 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors
const tensor revT(E1.T() & E0);
// Rotation
forAll(half0Ctrs, faceI)
forAll(half0Ctrs, facei)
{
half0Ctrs[faceI] =
half0Ctrs[facei] =
Foam::transform
(
revT,
half0Ctrs[faceI] - rotationCentre_
half0Ctrs[facei] - rotationCentre_
)
+ rotationCentre_;
anchors0[faceI] =
anchors0[facei] =
Foam::transform
(
revT,
anchors0[faceI] - rotationCentre_
anchors0[facei] - rotationCentre_
)
+ rotationCentre_;
}
@ -522,17 +522,17 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors
const tensor revT(rotationTensor(n0, -n1));
// Rotation
forAll(half0Ctrs, faceI)
forAll(half0Ctrs, facei)
{
half0Ctrs[faceI] = Foam::transform
half0Ctrs[facei] = Foam::transform
(
revT,
half0Ctrs[faceI]
half0Ctrs[facei]
);
anchors0[faceI] = Foam::transform
anchors0[facei] = Foam::transform
(
revT,
anchors0[faceI]
anchors0[facei]
);
}
}
@ -576,18 +576,18 @@ Foam::vector Foam::cyclicPolyPatch::findFaceMaxRadius
const scalarField magRadSqr(magSqr(n));
label faceI = findMax(magRadSqr);
label facei = findMax(magRadSqr);
if (debug)
{
Info<< "findFaceMaxRadius(const pointField&) : patch: " << name() << nl
<< " rotFace = " << faceI << nl
<< " point = " << faceCentres[faceI] << nl
<< " distance = " << Foam::sqrt(magRadSqr[faceI])
<< " rotFace = " << facei << nl
<< " point = " << faceCentres[facei] << nl
<< " distance = " << Foam::sqrt(magRadSqr[facei])
<< endl;
}
return n[faceI];
return n[facei];
}
@ -1431,9 +1431,9 @@ bool Foam::cyclicPolyPatch::order
// Return false if no change neccesary, true otherwise.
forAll(faceMap, faceI)
forAll(faceMap, facei)
{
if (faceMap[faceI] != faceI || rotation[faceI] != 0)
if (faceMap[facei] != facei || rotation[facei] != 0)
{
return true;
}

View File

@ -55,9 +55,9 @@ Foam::pointField Foam::oldCyclicPolyPatch::calcFaceCentres
{
pointField ctrs(faces.size());
forAll(faces, faceI)
forAll(faces, facei)
{
ctrs[faceI] = faces[faceI].centre(points);
ctrs[facei] = faces[facei].centre(points);
}
return ctrs;
@ -72,9 +72,9 @@ Foam::pointField Foam::oldCyclicPolyPatch::getAnchorPoints
{
pointField anchors(faces.size());
forAll(faces, faceI)
forAll(faces, facei)
{
anchors[faceI] = points[faces[faceI][0]];
anchors[facei] = points[faces[facei][0]];
}
return anchors;
@ -90,14 +90,14 @@ Foam::label Foam::oldCyclicPolyPatch::findMaxArea
label maxI = -1;
scalar maxAreaSqr = -GREAT;
forAll(faces, faceI)
forAll(faces, facei)
{
scalar areaSqr = magSqr(faces[faceI].normal(points));
scalar areaSqr = magSqr(faces[facei].normal(points));
if (areaSqr > maxAreaSqr)
{
maxAreaSqr = areaSqr;
maxI = faceI;
maxI = facei;
}
}
return maxI;
@ -205,15 +205,15 @@ bool Foam::oldCyclicPolyPatch::getGeometricHalves
half1ToPatch.setSize(pp.size());
// Compare to face 0 normal.
forAll(faceNormals, faceI)
forAll(faceNormals, facei)
{
if ((faceNormals[faceI] & faceNormals[0]) > 0)
if ((faceNormals[facei] & faceNormals[0]) > 0)
{
half0ToPatch[n0Faces++] = faceI;
half0ToPatch[n0Faces++] = facei;
}
else
{
half1ToPatch[n1Faces++] = faceI;
half1ToPatch[n1Faces++] = facei;
}
}
half0ToPatch.setSize(n0Faces);
@ -324,10 +324,10 @@ void Foam::oldCyclicPolyPatch::getCentresAndAnchors
const tensor reverseT(rotationTensor(n0, -n1));
// Rotation
forAll(half0Ctrs, faceI)
forAll(half0Ctrs, facei)
{
half0Ctrs[faceI] = Foam::transform(reverseT, half0Ctrs[faceI]);
anchors0[faceI] = Foam::transform(reverseT, anchors0[faceI]);
half0Ctrs[facei] = Foam::transform(reverseT, half0Ctrs[facei]);
anchors0[facei] = Foam::transform(reverseT, anchors0[facei]);
}
ppPoints = Foam::transform(reverseT, pp.points());
@ -379,17 +379,17 @@ void Foam::oldCyclicPolyPatch::getCentresAndAnchors
const tensor reverseT(rotationTensor(n0, -n1));
// Rotation
forAll(half0Ctrs, faceI)
forAll(half0Ctrs, facei)
{
half0Ctrs[faceI] = Foam::transform
half0Ctrs[facei] = Foam::transform
(
reverseT,
half0Ctrs[faceI]
half0Ctrs[facei]
);
anchors0[faceI] = Foam::transform
anchors0[facei] = Foam::transform
(
reverseT,
anchors0[faceI]
anchors0[facei]
);
}
ppPoints = Foam::transform(reverseT, pp.points());
@ -862,11 +862,11 @@ bool Foam::oldCyclicPolyPatch::order
if (!matchedAll)
{
label faceI = 0;
label facei = 0;
for (label i = 0; i < halfSize; i++)
{
half0ToPatch[i] = faceI++;
half1ToPatch[i] = faceI++;
half0ToPatch[i] = facei++;
half1ToPatch[i] = facei++;
}
// And redo all matching
@ -945,9 +945,9 @@ bool Foam::oldCyclicPolyPatch::order
{
label baffleI = 0;
forAll(pp, faceI)
forAll(pp, facei)
{
const face& f = pp.localFaces()[faceI];
const face& f = pp.localFaces()[facei];
const labelList& pFaces = pp.pointFaces()[f[0]];
label matchedFaceI = -1;
@ -956,7 +956,7 @@ bool Foam::oldCyclicPolyPatch::order
{
label otherFaceI = pFaces[i];
if (otherFaceI > faceI)
if (otherFaceI > facei)
{
const face& otherF = pp.localFaces()[otherFaceI];
@ -972,7 +972,7 @@ bool Foam::oldCyclicPolyPatch::order
if (matchedFaceI != -1)
{
half0ToPatch[baffleI] = faceI;
half0ToPatch[baffleI] = facei;
half1ToPatch[baffleI] = matchedFaceI;
baffleI++;
}
@ -1206,9 +1206,9 @@ bool Foam::oldCyclicPolyPatch::order
// Return false if no change neccesary, true otherwise.
forAll(faceMap, faceI)
forAll(faceMap, facei)
{
if (faceMap[faceI] != faceI || rotation[faceI] != 0)
if (faceMap[facei] != facei || rotation[facei] != 0)
{
return true;
}

View File

@ -273,10 +273,10 @@ void Foam::processorPolyPatch::calcGeometry(PstreamBuffers& pBufs)
label vertI = 0;
forAll(faceCentres(), faceI)
forAll(faceCentres(), facei)
{
const point& c0 = neighbFaceCentres_[faceI];
const point& c1 = faceCentres()[faceI];
const point& c0 = neighbFaceCentres_[facei];
const point& c1 = faceCentres()[facei];
writeOBJ(ccStr, c0, c1, vertI);
}
@ -356,11 +356,11 @@ void Foam::processorPolyPatch::initUpdateMesh(PstreamBuffers& pBufs)
for (label patchPointI = 0; patchPointI < nPoints(); patchPointI++)
{
label faceI = pointFaces()[patchPointI][0];
label facei = pointFaces()[patchPointI][0];
pointFace[patchPointI] = faceI;
pointFace[patchPointI] = facei;
const face& f = localFaces()[faceI];
const face& f = localFaces()[facei];
pointIndex[patchPointI] = findIndex(f, patchPointI);
}
@ -371,11 +371,11 @@ void Foam::processorPolyPatch::initUpdateMesh(PstreamBuffers& pBufs)
for (label patchEdgeI = 0; patchEdgeI < nEdges(); patchEdgeI++)
{
label faceI = edgeFaces()[patchEdgeI][0];
label facei = edgeFaces()[patchEdgeI][0];
edgeFace[patchEdgeI] = faceI;
edgeFace[patchEdgeI] = facei;
const labelList& fEdges = faceEdges()[faceI];
const labelList& fEdges = faceEdges()[facei];
edgeIndex[patchEdgeI] = findIndex(fEdges, patchEdgeI);
}
@ -565,9 +565,9 @@ void Foam::processorPolyPatch::initOrder
<< "Dumping " << fc.size()
<< " local faceCentres to " << localStr.name() << endl;
forAll(fc, faceI)
forAll(fc, facei)
{
writeOBJ(localStr, fc[faceI]);
writeOBJ(localStr, fc[facei]);
}
}
@ -911,9 +911,9 @@ bool Foam::processorPolyPatch::order
Pout<< "processorPolyPatch::order : "
<< "Dumping neighbour faceCentres to " << nbrStr.name()
<< endl;
forAll(masterCtrs, faceI)
forAll(masterCtrs, facei)
{
writeOBJ(nbrStr, masterCtrs[faceI]);
writeOBJ(nbrStr, masterCtrs[facei]);
}
}
@ -1024,14 +1024,14 @@ bool Foam::processorPolyPatch::order
label vertI = 0;
forAll(pp.faceCentres(), faceI)
forAll(pp.faceCentres(), facei)
{
label masterFaceI = faceMap[faceI];
label masterFaceI = faceMap[facei];
if (masterFaceI != -1)
{
const point& c0 = masterCtrs[masterFaceI];
const point& c1 = pp.faceCentres()[faceI];
const point& c1 = pp.faceCentres()[facei];
writeOBJ(ccStr, c0, c1, vertI);
}
}
@ -1091,9 +1091,9 @@ bool Foam::processorPolyPatch::order
}
}
forAll(faceMap, faceI)
forAll(faceMap, facei)
{
if (faceMap[faceI] != faceI || rotation[faceI] != 0)
if (faceMap[facei] != facei || rotation[facei] != 0)
{
return true;
}

View File

@ -60,19 +60,19 @@ void Foam::wedgePolyPatch::calcGeometry(PstreamBuffers&)
// Check the wedge is planar
forAll(nf, faceI)
forAll(nf, facei)
{
if (magSqr(n_ - nf[faceI]) > SMALL)
if (magSqr(n_ - nf[facei]) > SMALL)
{
// only issue warning instead of error so that the case can
// still be read for post-processing
WarningInFunction
<< "Wedge patch '" << name() << "' is not planar." << nl
<< "At local face at "
<< primitivePatch::faceCentres()[faceI]
<< " the normal " << nf[faceI]
<< primitivePatch::faceCentres()[facei]
<< " the normal " << nf[facei]
<< " differs from the average normal " << n_
<< " by " << magSqr(n_ - nf[faceI]) << nl
<< " by " << magSqr(n_ - nf[facei]) << nl
<< "Either correct the patch or split it into planar parts"
<< endl;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -48,9 +48,9 @@ void Foam::syncTools::swapBoundaryCellPositions
neighbourCellData.setSize(nBnd);
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
const labelUList& faceCells = pp.faceCells();
forAll(faceCells, i)
{
@ -156,12 +156,12 @@ Foam::PackedBoolList Foam::syncTools::getMasterFaces(const polyMesh& mesh)
const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(patches, patchI)
forAll(patches, patchi)
{
if (patches[patchI].coupled())
if (patches[patchi].coupled())
{
const coupledPolyPatch& pp =
refCast<const coupledPolyPatch>(patches[patchI]);
refCast<const coupledPolyPatch>(patches[patchi]);
if (!pp.owner())
{
@ -186,9 +186,9 @@ Foam::PackedBoolList Foam::syncTools::getInternalOrMasterFaces
const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if (pp.coupled())
{
@ -222,9 +222,9 @@ Foam::PackedBoolList Foam::syncTools::getInternalOrCoupledFaces
const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if (!pp.coupled())
{

View File

@ -133,16 +133,16 @@ void Foam::syncTools::syncPointMap
// Send
forAll(patches, patchI)
forAll(patches, patchi)
{
if
(
isA<processorPolyPatch>(patches[patchI])
&& patches[patchI].nPoints() > 0
isA<processorPolyPatch>(patches[patchi])
&& patches[patchi].nPoints() > 0
)
{
const processorPolyPatch& procPatch =
refCast<const processorPolyPatch>(patches[patchI]);
refCast<const processorPolyPatch>(patches[patchi]);
// Get data per patchPoint in neighbouring point numbers.
@ -173,16 +173,16 @@ void Foam::syncTools::syncPointMap
// Receive and combine.
forAll(patches, patchI)
forAll(patches, patchi)
{
if
(
isA<processorPolyPatch>(patches[patchI])
&& patches[patchI].nPoints() > 0
isA<processorPolyPatch>(patches[patchi])
&& patches[patchi].nPoints() > 0
)
{
const processorPolyPatch& procPatch =
refCast<const processorPolyPatch>(patches[patchI]);
refCast<const processorPolyPatch>(patches[patchi]);
UIPstream fromNb(procPatch.neighbProcNo(), pBufs);
Map<T> nbrPatchInfo(fromNb);
@ -208,12 +208,12 @@ void Foam::syncTools::syncPointMap
}
// Do the cyclics.
forAll(patches, patchI)
forAll(patches, patchi)
{
if (isA<cyclicPolyPatch>(patches[patchI]))
if (isA<cyclicPolyPatch>(patches[patchi]))
{
const cyclicPolyPatch& cycPatch =
refCast<const cyclicPolyPatch>(patches[patchI]);
refCast<const cyclicPolyPatch>(patches[patchi]);
if (cycPatch.owner())
{
@ -409,16 +409,16 @@ void Foam::syncTools::syncEdgeMap
// Send
forAll(patches, patchI)
forAll(patches, patchi)
{
if
(
isA<processorPolyPatch>(patches[patchI])
&& patches[patchI].nEdges() > 0
isA<processorPolyPatch>(patches[patchi])
&& patches[patchi].nEdges() > 0
)
{
const processorPolyPatch& procPatch =
refCast<const processorPolyPatch>(patches[patchI]);
refCast<const processorPolyPatch>(patches[patchi]);
// Get data per patch edge in neighbouring edge.
@ -453,16 +453,16 @@ void Foam::syncTools::syncEdgeMap
// Receive and combine.
forAll(patches, patchI)
forAll(patches, patchi)
{
if
(
isA<processorPolyPatch>(patches[patchI])
&& patches[patchI].nEdges() > 0
isA<processorPolyPatch>(patches[patchi])
&& patches[patchi].nEdges() > 0
)
{
const processorPolyPatch& procPatch =
refCast<const processorPolyPatch>(patches[patchI]);
refCast<const processorPolyPatch>(patches[patchi]);
EdgeMap<T> nbrPatchInfo;
{
@ -498,12 +498,12 @@ void Foam::syncTools::syncEdgeMap
// Swap cyclic info
// ~~~~~~~~~~~~~~~~
forAll(patches, patchI)
forAll(patches, patchi)
{
if (isA<cyclicPolyPatch>(patches[patchI]))
if (isA<cyclicPolyPatch>(patches[patchi]))
{
const cyclicPolyPatch& cycPatch =
refCast<const cyclicPolyPatch>(patches[patchI]);
refCast<const cyclicPolyPatch>(patches[patchi]);
if (cycPatch.owner())
{
@ -624,9 +624,9 @@ void Foam::syncTools::syncEdgeMap
// on the outside of the mesh. (though might not be on coupled patch
// if is single edge and not on coupled face)
// Store value (if any) on sharedEdgeValues
for (label faceI = mesh.nInternalFaces(); faceI < mesh.nFaces(); faceI++)
for (label facei = mesh.nInternalFaces(); facei < mesh.nFaces(); facei++)
{
const face& f = mesh.faces()[faceI];
const face& f = mesh.faces()[facei];
forAll(f, fp)
{
@ -803,16 +803,16 @@ void Foam::syncTools::syncEdgeMap
//
// // Send
//
// forAll(patches, patchI)
// forAll(patches, patchi)
// {
// if
// (
// isA<processorPolyPatch>(patches[patchI])
// && patches[patchI].nPoints() > 0
// isA<processorPolyPatch>(patches[patchi])
// && patches[patchi].nPoints() > 0
// )
// {
// const processorPolyPatch& procPatch =
// refCast<const processorPolyPatch>(patches[patchI]);
// refCast<const processorPolyPatch>(patches[patchi]);
//
// // Get data per patchPoint in neighbouring point numbers.
// Field<T> patchInfo(procPatch.nPoints());
@ -835,16 +835,16 @@ void Foam::syncTools::syncEdgeMap
//
// // Receive and combine.
//
// forAll(patches, patchI)
// forAll(patches, patchi)
// {
// if
// (
// isA<processorPolyPatch>(patches[patchI])
// && patches[patchI].nPoints() > 0
// isA<processorPolyPatch>(patches[patchi])
// && patches[patchi].nPoints() > 0
// )
// {
// const processorPolyPatch& procPatch =
// refCast<const processorPolyPatch>(patches[patchI]);
// refCast<const processorPolyPatch>(patches[patchi]);
//
// Field<T> nbrPatchInfo(procPatch.nPoints());
// {
@ -867,12 +867,12 @@ void Foam::syncTools::syncEdgeMap
// }
//
// // Do the cyclics.
// forAll(patches, patchI)
// forAll(patches, patchi)
// {
// if (isA<cyclicPolyPatch>(patches[patchI]))
// if (isA<cyclicPolyPatch>(patches[patchi]))
// {
// const cyclicPolyPatch& cycPatch =
// refCast<const cyclicPolyPatch>(patches[patchI]);
// refCast<const cyclicPolyPatch>(patches[patchi]);
//
// if (cycPatch.owner())
// {
@ -1305,16 +1305,16 @@ void Foam::syncTools::syncBoundaryFaceList
// Send
forAll(patches, patchI)
forAll(patches, patchi)
{
if
(
isA<processorPolyPatch>(patches[patchI])
&& patches[patchI].size() > 0
isA<processorPolyPatch>(patches[patchi])
&& patches[patchi].size() > 0
)
{
const processorPolyPatch& procPatch =
refCast<const processorPolyPatch>(patches[patchI]);
refCast<const processorPolyPatch>(patches[patchi]);
label patchStart = procPatch.start()-mesh.nInternalFaces();
@ -1329,16 +1329,16 @@ void Foam::syncTools::syncBoundaryFaceList
// Receive and combine.
forAll(patches, patchI)
forAll(patches, patchi)
{
if
(
isA<processorPolyPatch>(patches[patchI])
&& patches[patchI].size() > 0
isA<processorPolyPatch>(patches[patchi])
&& patches[patchi].size() > 0
)
{
const processorPolyPatch& procPatch =
refCast<const processorPolyPatch>(patches[patchI]);
refCast<const processorPolyPatch>(patches[patchi]);
Field<T> nbrPatchInfo(procPatch.size());
@ -1358,12 +1358,12 @@ void Foam::syncTools::syncBoundaryFaceList
}
// Do the cyclics.
forAll(patches, patchI)
forAll(patches, patchi)
{
if (isA<cyclicPolyPatch>(patches[patchI]))
if (isA<cyclicPolyPatch>(patches[patchi]))
{
const cyclicPolyPatch& cycPatch =
refCast<const cyclicPolyPatch>(patches[patchI]);
refCast<const cyclicPolyPatch>(patches[patchi]);
if (cycPatch.owner())
{
@ -1424,16 +1424,16 @@ void Foam::syncTools::syncFaceList
// Send
forAll(patches, patchI)
forAll(patches, patchi)
{
if
(
isA<processorPolyPatch>(patches[patchI])
&& patches[patchI].size() > 0
isA<processorPolyPatch>(patches[patchi])
&& patches[patchi].size() > 0
)
{
const processorPolyPatch& procPatch =
refCast<const processorPolyPatch>(patches[patchI]);
refCast<const processorPolyPatch>(patches[patchi]);
List<unsigned int> patchInfo(procPatch.size());
forAll(procPatch, i)
@ -1451,16 +1451,16 @@ void Foam::syncTools::syncFaceList
// Receive and combine.
forAll(patches, patchI)
forAll(patches, patchi)
{
if
(
isA<processorPolyPatch>(patches[patchI])
&& patches[patchI].size() > 0
isA<processorPolyPatch>(patches[patchi])
&& patches[patchi].size() > 0
)
{
const processorPolyPatch& procPatch =
refCast<const processorPolyPatch>(patches[patchI]);
refCast<const processorPolyPatch>(patches[patchi]);
List<unsigned int> patchInfo(procPatch.size());
{
@ -1482,12 +1482,12 @@ void Foam::syncTools::syncFaceList
}
// Do the cyclics.
forAll(patches, patchI)
forAll(patches, patchi)
{
if (isA<cyclicPolyPatch>(patches[patchI]))
if (isA<cyclicPolyPatch>(patches[patchi]))
{
const cyclicPolyPatch& cycPatch =
refCast<const cyclicPolyPatch>(patches[patchI]);
refCast<const cyclicPolyPatch>(patches[patchi]);
if (cycPatch.owner())
{
@ -1536,9 +1536,9 @@ void Foam::syncTools::swapBoundaryCellList
neighbourCellData.setSize(nBnd);
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
const labelUList& faceCells = pp.faceCells();
forAll(faceCells, i)
{

View File

@ -73,15 +73,15 @@ void Foam::faceZone::calcFaceZonePatch() const
const labelList& addr = *this;
const boolList& flip = flipMap();
forAll(addr, faceI)
forAll(addr, facei)
{
if (flip[faceI])
if (flip[facei])
{
patch[faceI] = f[addr[faceI]].reverseFace();
patch[facei] = f[addr[facei]].reverseFace();
}
else
{
patch[faceI] = f[addr[faceI]];
patch[facei] = f[addr[facei]];
}
}
@ -125,26 +125,26 @@ void Foam::faceZone::calcCellLayers() const
slaveCellsPtr_ = new labelList(mf.size());
labelList& sc = *slaveCellsPtr_;
forAll(mf, faceI)
forAll(mf, facei)
{
label ownCellI = own[mf[faceI]];
label ownCellI = own[mf[facei]];
label neiCellI =
(
zoneMesh().mesh().isInternalFace(mf[faceI])
? nei[mf[faceI]]
zoneMesh().mesh().isInternalFace(mf[facei])
? nei[mf[facei]]
: -1
);
if (!faceFlip[faceI])
if (!faceFlip[facei])
{
// Face is oriented correctly, no flip needed
mc[faceI] = neiCellI;
sc[faceI] = ownCellI;
mc[facei] = neiCellI;
sc[facei] = ownCellI;
}
else
{
mc[faceI] = ownCellI;
sc[faceI] = neiCellI;
mc[facei] = ownCellI;
sc[facei] = neiCellI;
}
}
}
@ -397,11 +397,11 @@ void Foam::faceZone::updateMesh(const mapPolyMesh& mpm)
forAll(*this, i)
{
const label faceI = operator[](i);
const label facei = operator[](i);
if (faceMap[faceI] >= 0)
if (faceMap[facei] >= 0)
{
newAddressing[nFaces] = faceMap[faceI];
newAddressing[nFaces] = faceMap[facei];
newFlipMap[nFaces] = flipMap_[i]; // Keep flip map.
nFaces++;
}
@ -437,12 +437,12 @@ bool Foam::faceZone::checkParallelSync(const bool report) const
boolList neiZoneFlip(mesh.nFaces()-mesh.nInternalFaces(), false);
forAll(*this, i)
{
const label faceI = operator[](i);
const label facei = operator[](i);
if (!mesh.isInternalFace(faceI))
if (!mesh.isInternalFace(facei))
{
neiZoneFace[faceI-mesh.nInternalFaces()] = true;
neiZoneFlip[faceI-mesh.nInternalFaces()] = flipMap()[i];
neiZoneFace[facei-mesh.nInternalFaces()] = true;
neiZoneFlip[facei-mesh.nInternalFaces()] = flipMap()[i];
}
}
boolList myZoneFace(neiZoneFace);
@ -452,12 +452,12 @@ bool Foam::faceZone::checkParallelSync(const bool report) const
forAll(*this, i)
{
const label faceI = operator[](i);
const label patchI = bm.whichPatch(faceI);
const label facei = operator[](i);
const label patchi = bm.whichPatch(facei);
if (patchI != -1 && bm[patchI].coupled())
if (patchi != -1 && bm[patchi].coupled())
{
const label bFaceI = faceI-mesh.nInternalFaces();
const label bFaceI = facei-mesh.nInternalFaces();
// Check face in zone on both sides
if (myZoneFace[bFaceI] != neiZoneFace[bFaceI])
@ -468,9 +468,9 @@ bool Foam::faceZone::checkParallelSync(const bool report) const
{
Pout<< " ***Problem with faceZone " << index()
<< " named " << name()
<< ". Face " << faceI
<< ". Face " << facei
<< " on coupled patch "
<< bm[patchI].name()
<< bm[patchi].name()
<< " is not consistent with its coupled neighbour."
<< endl;
}
@ -489,9 +489,9 @@ bool Foam::faceZone::checkParallelSync(const bool report) const
{
Pout<< " ***Problem with faceZone " << index()
<< " named " << name()
<< ". Face " << faceI
<< ". Face " << facei
<< " on coupled patch "
<< bm[patchI].name()
<< bm[patchi].name()
<< " does not have consistent flipMap"
<< " across coupled faces."
<< endl;

View File

@ -84,7 +84,7 @@ public:
//- Fill faceZone with currentZone for every face reachable
// from faceI without crossing edge marked in borderEdge.
// from facei without crossing edge marked in borderEdge.
// Note: faceZone has to be sized nFaces before calling.
template
<
@ -98,7 +98,7 @@ public:
(
const PrimitivePatch<Face, FaceList, PointField, PointType>&,
const BoolListType& borderEdge,
const label faceI,
const label facei,
const label currentZone,
labelList& faceZone
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -46,16 +46,16 @@ Foam::PatchTools::checkOrientation
bool foundError = false;
// Check edge normals, face normals, point normals.
forAll(p.faceEdges(), faceI)
forAll(p.faceEdges(), facei)
{
const labelList& edgeLabels = p.faceEdges()[faceI];
const labelList& edgeLabels = p.faceEdges()[facei];
bool valid = true;
if (edgeLabels.size() < 3)
{
if (report)
{
Info<< "Face[" << faceI << "] " << p[faceI]
Info<< "Face[" << facei << "] " << p[facei]
<< " has fewer than 3 edges. Edges: " << edgeLabels
<< endl;
}
@ -70,7 +70,7 @@ Foam::PatchTools::checkOrientation
if (report)
{
Info<< "edge number " << edgeLabels[i]
<< " on face " << faceI
<< " on face " << facei
<< " out-of-range\n"
<< "This usually means the input surface has "
<< "edges with more than 2 faces connected."
@ -91,13 +91,13 @@ Foam::PatchTools::checkOrientation
//
//- Compute normal from 3 points, use the first as the origin
// minor warpage should not be a problem
const Face& f = p[faceI];
const Face& f = p[facei];
const point& p0 = p.points()[f[0]];
const point& p1 = p.points()[f[1]];
const point& p2 = p.points()[f.last()];
const vector pointNormal((p1 - p0) ^ (p2 - p0));
if ((pointNormal & p.faceNormals()[faceI]) < 0)
if ((pointNormal & p.faceNormals()[facei]) < 0)
{
foundError = false;
@ -109,7 +109,7 @@ Foam::PatchTools::checkOrientation
<< "face: " << f << nl
<< "points: " << p0 << ' ' << p1 << ' ' << p2 << nl
<< "pointNormal:" << pointNormal << nl
<< "faceNormal:" << p.faceNormals()[faceI] << endl;
<< "faceNormal:" << p.faceNormals()[facei] << endl;
}
}
}

View File

@ -119,9 +119,9 @@ void Foam::PatchTools::gatherAndMerge
// Relabel faces
List<Face>& faces = mergedFaces;
forAll(faces, faceI)
forAll(faces, facei)
{
inplaceRenumber(pointMergeMap, faces[faceI]);
inplaceRenumber(pointMergeMap, faces[facei]);
}
}
}

View File

@ -164,10 +164,10 @@ Foam::PatchTools::pointNormals
const faceList& localFaces = p.localFaces();
const vectorField& faceNormals = p.faceNormals();
forAll(localFaces, faceI)
forAll(localFaces, facei)
{
const face& f = localFaces[faceI];
const vector& n = faceNormals[faceI];
const face& f = localFaces[facei];
const vector& n = faceNormals[facei];
forAll(f, fp)
{
extrudeN[f[fp]] += n;

View File

@ -44,7 +44,7 @@ void Foam::PatchTools::markZone
(
const PrimitivePatch<Face, FaceList, PointField, PointType>& p,
const BoolListType& borderEdge,
const label faceI,
const label facei,
const label currentZone,
labelList& faceZone
)
@ -53,7 +53,7 @@ void Foam::PatchTools::markZone
const labelListList& edgeFaces = p.edgeFaces();
// List of faces whose faceZone has been set.
labelList changedFaces(1, faceI);
labelList changedFaces(1, facei);
while (true)
{
@ -62,9 +62,9 @@ void Foam::PatchTools::markZone
forAll(changedFaces, i)
{
label faceI = changedFaces[i];
label facei = changedFaces[i];
const labelList& fEdges = faceEdges[faceI];
const labelList& fEdges = faceEdges[facei];
forAll(fEdges, fEdgeI)
{
@ -89,7 +89,7 @@ void Foam::PatchTools::markZone
<< "Zones " << faceZone[nbrFaceI]
<< " at face " << nbrFaceI
<< " connects to zone " << currentZone
<< " at face " << faceI
<< " at face " << facei
<< abort(FatalError);
}
}
@ -166,7 +166,7 @@ Foam::PatchTools::subsetMap
labelList& faceMap
)
{
label faceI = 0;
label facei = 0;
label pointI = 0;
const List<Face>& localFaces = p.localFaces();
@ -181,7 +181,7 @@ Foam::PatchTools::subsetMap
if (includeFaces[oldFaceI])
{
// Store new faces compact
faceMap[faceI++] = oldFaceI;
faceMap[facei++] = oldFaceI;
// Renumber labels for face
const Face& f = localFaces[oldFaceI];
@ -199,7 +199,7 @@ Foam::PatchTools::subsetMap
}
// Trim
faceMap.setSize(faceI);
faceMap.setSize(facei);
pointMap.setSize(pointI);
}
@ -227,9 +227,9 @@ void Foam::PatchTools::calcBounds
nPoints = 0;
bb = boundBox::invertedBox;
forAll(p, faceI)
forAll(p, facei)
{
const Face& f = p[faceI];
const Face& f = p[facei];
forAll(f, fp)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -80,14 +80,14 @@ Foam::PatchTools::sortedPointEdges
break;
}
label faceI = eFaces[0];
if (faceI == prevFaceI)
label facei = eFaces[0];
if (facei == prevFaceI)
{
faceI = eFaces[1];
facei = eFaces[1];
}
// Cross face to next edge
const labelList& fEdges = faceEdges[faceI];
const labelList& fEdges = faceEdges[facei];
forAll(fEdges, feI)
{
@ -105,7 +105,7 @@ Foam::PatchTools::sortedPointEdges
}
}
prevFaceI = faceI;
prevFaceI = facei;
nVisitedEdges++;
if (nVisitedEdges > nPointEdges)

View File

@ -75,9 +75,9 @@ calcAddressing() const
// Guess the max number of edges and neighbours for a face
label maxEdges = 0;
forAll(locFcs, faceI)
forAll(locFcs, facei)
{
maxEdges += locFcs[faceI].size();
maxEdges += locFcs[facei].size();
}
// create the lists for the various results. (resized on completion)
@ -100,12 +100,12 @@ calcAddressing() const
// initialise the lists of subshapes for each face to avoid duplication
edgeListList faceIntoEdges(locFcs.size());
forAll(locFcs, faceI)
forAll(locFcs, facei)
{
faceIntoEdges[faceI] = locFcs[faceI].edges();
faceIntoEdges[facei] = locFcs[facei].edges();
labelList& curFaceEdges = faceEdges[faceI];
curFaceEdges.setSize(faceIntoEdges[faceI].size());
labelList& curFaceEdges = faceEdges[facei];
curFaceEdges.setSize(faceIntoEdges[facei].size());
forAll(curFaceEdges, faceEdgeI)
{
@ -125,11 +125,11 @@ calcAddressing() const
// in face (i.e. curEdges[0] is edge between f[0] and f[1])
// For all local faces ...
forAll(locFcs, faceI)
forAll(locFcs, facei)
{
// Get reference to vertices of current face and corresponding edges.
const Face& curF = locFcs[faceI];
const edgeList& curEdges = faceIntoEdges[faceI];
const Face& curF = locFcs[facei];
const edgeList& curEdges = faceIntoEdges[facei];
// Record the neighbour face. Multiple connectivity allowed
List<DynamicList<label>> neiFaces(curF.size());
@ -141,7 +141,7 @@ calcAddressing() const
forAll(curEdges, edgeI)
{
// If the edge is already detected, skip
if (faceEdges[faceI][edgeI] >= 0) continue;
if (faceEdges[facei][edgeI] >= 0) continue;
found = false;
@ -158,7 +158,7 @@ calcAddressing() const
label curNei = nbrFaces[nbrFaceI];
// Reject neighbours with the lower label
if (curNei > faceI)
if (curNei > facei)
{
// get the reference to subshapes of the neighbour
const edgeList& searchEdges = faceIntoEdges[curNei];
@ -174,8 +174,8 @@ calcAddressing() const
edgeOfNeiFace[edgeI].append(neiEdgeI);
// Record faceFaces both ways
ff[faceI].append(curNei);
ff[curNei].append(faceI);
ff[facei].append(curNei);
ff[curNei].append(facei);
// Keep searching due to multiple connectivity
}
@ -216,7 +216,7 @@ calcAddressing() const
edges[nEdges] = curEdges[nextNei];
// Set face-edge and face-neighbour-edge to current face label
faceEdges[faceI][nextNei] = nEdges;
faceEdges[facei][nextNei] = nEdges;
DynamicList<label>& cnf = neiFaces[nextNei];
DynamicList<label>& eonf = edgeOfNeiFace[nextNei];
@ -224,7 +224,7 @@ calcAddressing() const
// Set edge-face addressing
labelList& curEf = edgeFaces[nEdges];
curEf.setSize(cnf.size() + 1);
curEf[0] = faceI;
curEf[0] = facei;
forAll(cnf, cnfI)
{
@ -253,22 +253,22 @@ calcAddressing() const
// Do boundary faces
forAll(faceEdges, faceI)
forAll(faceEdges, facei)
{
labelList& curEdges = faceEdges[faceI];
labelList& curEdges = faceEdges[facei];
forAll(curEdges, edgeI)
{
if (curEdges[edgeI] < 0)
{
// Grab edge and faceEdge
edges[nEdges] = faceIntoEdges[faceI][edgeI];
edges[nEdges] = faceIntoEdges[facei][edgeI];
curEdges[edgeI] = nEdges;
// Add edgeFace
labelList& curEf = edgeFaces[nEdges];
curEf.setSize(1);
curEf[0] = faceI;
curEf[0] = facei;
nEdges++;
}
@ -285,9 +285,9 @@ calcAddressing() const
faceFacesPtr_ = new labelListList(locFcs.size());
labelListList& faceFaces = *faceFacesPtr_;
forAll(faceFaces, faceI)
forAll(faceFaces, facei)
{
faceFaces[faceI].transfer(ff[faceI]);
faceFaces[facei].transfer(ff[facei]);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -77,11 +77,11 @@ calcLocalPointOrder() const
label nPoints = 0;
forAll(lf, faceI)
forAll(lf, facei)
{
if (!visitedFace[faceI])
if (!visitedFace[facei])
{
SLList<label> faceOrder(faceI);
SLList<label> faceOrder(facei);
do
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -77,10 +77,10 @@ meshEdges
// get the patch faces sharing the edge
const labelList& curFaces = EdgeFaces[edgeI];
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
// get the cell next to the face
label curCell = faceCells[curFaces[faceI]];
label curCell = faceCells[curFaces[facei]];
// get reference to edges on the cell
const labelList& ce = cellEdges[curCell];

View File

@ -101,13 +101,13 @@ calcPointFaces() const
// set up storage for pointFaces
List<SLList<label>> pointFcs(meshPoints().size());
forAll(f, faceI)
forAll(f, facei)
{
const Face& curPoints = f[faceI];
const Face& curPoints = f[facei];
forAll(curPoints, pointI)
{
pointFcs[curPoints[pointI]].append(faceI);
pointFcs[curPoints[pointI]].append(facei);
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -80,10 +80,10 @@ projectPoints
// Estimate face centre of target side
Field<PointType> masterFaceCentres(targetPatch.size());
forAll(masterFaceCentres, faceI)
forAll(masterFaceCentres, facei)
{
masterFaceCentres[faceI] =
average(masterFaces[faceI].points(masterPoints));
masterFaceCentres[facei] =
average(masterFaces[facei].points(masterPoints));
}
// Algorithm:
@ -220,10 +220,10 @@ projectPoints
result[curLocalPointLabel] = objectHit(false, -1);
scalar minDistance = GREAT;
forAll(masterFaces, faceI)
forAll(masterFaces, facei)
{
PointHit<PointType> curHit =
masterFaces[faceI].ray
masterFaces[facei].ray
(
curPoint,
curProjectionDir,
@ -234,8 +234,8 @@ projectPoints
if (curHit.hit())
{
result[curLocalPointLabel] = objectHit(true, faceI);
curFace = faceI;
result[curLocalPointLabel] = objectHit(true, facei);
curFace = facei;
break;
}
@ -249,8 +249,8 @@ projectPoints
{
minDistance = missDist;
result[curLocalPointLabel] = objectHit(false, faceI);
curFace = faceI;
result[curLocalPointLabel] = objectHit(false, facei);
curFace = facei;
}
}
}
@ -317,10 +317,10 @@ projectFaceCentres
const typename ToPatch::PointFieldType& masterPoints = targetPatch.points();
forAll(masterFaceCentres, faceI)
forAll(masterFaceCentres, facei)
{
masterFaceCentres[faceI] =
masterFaces[faceI].centre(masterPoints);
masterFaceCentres[facei] =
masterFaces[facei].centre(masterPoints);
}
// Result
@ -342,10 +342,10 @@ projectFaceCentres
label curFace = 0;
label nNSquaredSearches = 0;
forAll(slaveFaceOrder, faceI)
forAll(slaveFaceOrder, facei)
{
// pick up slave point and direction
const label curLocalFaceLabel = slaveFaceOrder[faceI];
const label curLocalFaceLabel = slaveFaceOrder[facei];
const point& curFaceCentre =
slaveFaces[curLocalFaceLabel].centre(slaveGlobalPoints);
@ -364,7 +364,7 @@ projectFaceCentres
// Force the full search for the first point to ensure good
// starting face
if (faceI == 0)
if (facei == 0)
{
doNSquaredSearch = true;
}
@ -461,10 +461,10 @@ projectFaceCentres
result[curLocalFaceLabel] = objectHit(false, -1);
scalar minDistance = GREAT;
forAll(masterFaces, faceI)
forAll(masterFaces, facei)
{
PointHit<PointType> curHit =
masterFaces[faceI].ray
masterFaces[facei].ray
(
curFaceCentre,
curProjectionDir,
@ -475,8 +475,8 @@ projectFaceCentres
if (curHit.hit())
{
result[curLocalFaceLabel] = objectHit(true, faceI);
curFace = faceI;
result[curLocalFaceLabel] = objectHit(true, facei);
curFace = facei;
break;
}
@ -490,8 +490,8 @@ projectFaceCentres
{
minDistance = missDist;
result[curLocalFaceLabel] = objectHit(false, faceI);
curFace = faceI;
result[curLocalFaceLabel] = objectHit(false, facei);
curFace = facei;
}
}
}

View File

@ -143,9 +143,9 @@ bool Foam::primitiveMesh::calcPointOrder
// from 0 inside oldToNew. (shifted up later on)
label nBoundaryPoints = 0;
for (label faceI = nInternalFaces; faceI < faces.size(); faceI++)
for (label facei = nInternalFaces; facei < faces.size(); facei++)
{
const face& f = faces[faceI];
const face& f = faces[facei];
forAll(f, fp)
{
@ -179,9 +179,9 @@ bool Foam::primitiveMesh::calcPointOrder
bool ordered = true;
for (label faceI = 0; faceI < nInternalFaces; faceI++)
for (label facei = 0; facei < nInternalFaces; facei++)
{
const face& f = faces[faceI];
const face& f = faces[facei];
forAll(f, fp)
{
@ -320,9 +320,9 @@ Foam::tmp<Foam::scalarField> Foam::primitiveMesh::movePoints
tmp<scalarField> tsweptVols(new scalarField(f.size()));
scalarField& sweptVols = tsweptVols.ref();
forAll(f, faceI)
forAll(f, facei)
{
sweptVols[faceI] = f[faceI].sweptVol(oldPoints, newPoints);
sweptVols[facei] = f[facei].sweptVol(oldPoints, newPoints);
}
// Force recalculation of all geometric data with new points

View File

@ -812,20 +812,20 @@ public:
//- cellCells using cells.
const labelList& cellCells
(
const label cellI,
const label celli,
DynamicList<label>&
) const;
const labelList& cellCells(const label cellI) const;
const labelList& cellCells(const label celli) const;
//- cellPoints using cells
const labelList& cellPoints
(
const label cellI,
const label celli,
DynamicList<label>&
) const;
const labelList& cellPoints(const label cellI) const;
const labelList& cellPoints(const label celli) const;
//- pointCells using pointFaces
const labelList& pointCells
@ -848,11 +848,11 @@ public:
//- faceEdges using pointFaces, edges, pointEdges
const labelList& faceEdges
(
const label faceI,
const label facei,
DynamicList<label>&
) const;
const labelList& faceEdges(const label faceI) const;
const labelList& faceEdges(const label facei) const;
//- edgeFaces using pointFaces, edges, pointEdges
const labelList& edgeFaces
@ -875,11 +875,11 @@ public:
//- cellEdges using cells, pointFaces, edges, pointEdges
const labelList& cellEdges
(
const label cellI,
const label celli,
DynamicList<label>&
) const;
const labelList& cellEdges(const label cellI) const;
const labelList& cellEdges(const label celli) const;
//- Clear geometry

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -63,10 +63,10 @@ void Foam::primitiveMesh::calcCellCells() const
const labelList& own = faceOwner();
const labelList& nei = faceNeighbour();
forAll(nei, faceI)
forAll(nei, facei)
{
ncc[own[faceI]]++;
ncc[nei[faceI]]++;
ncc[own[facei]]++;
ncc[nei[facei]]++;
}
// Create the storage
@ -77,16 +77,16 @@ void Foam::primitiveMesh::calcCellCells() const
// 2. Size and fill cellFaceAddr
forAll(cellCellAddr, cellI)
forAll(cellCellAddr, celli)
{
cellCellAddr[cellI].setSize(ncc[cellI]);
cellCellAddr[celli].setSize(ncc[celli]);
}
ncc = 0;
forAll(nei, faceI)
forAll(nei, facei)
{
label ownCellI = own[faceI];
label neiCellI = nei[faceI];
label ownCellI = own[facei];
label neiCellI = nei[facei];
cellCellAddr[ownCellI][ncc[ownCellI]++] = neiCellI;
cellCellAddr[neiCellI][ncc[neiCellI]++] = ownCellI;
@ -110,35 +110,35 @@ const Foam::labelListList& Foam::primitiveMesh::cellCells() const
const Foam::labelList& Foam::primitiveMesh::cellCells
(
const label cellI,
const label celli,
DynamicList<label>& storage
) const
{
if (hasCellCells())
{
return cellCells()[cellI];
return cellCells()[celli];
}
else
{
const labelList& own = faceOwner();
const labelList& nei = faceNeighbour();
const cell& cFaces = cells()[cellI];
const cell& cFaces = cells()[celli];
storage.clear();
forAll(cFaces, i)
{
label faceI = cFaces[i];
label facei = cFaces[i];
if (faceI < nInternalFaces())
if (facei < nInternalFaces())
{
if (own[faceI] == cellI)
if (own[facei] == celli)
{
storage.append(nei[faceI]);
storage.append(nei[facei]);
}
else
{
storage.append(own[faceI]);
storage.append(own[facei]);
}
}
}
@ -148,9 +148,9 @@ const Foam::labelList& Foam::primitiveMesh::cellCells
}
const Foam::labelList& Foam::primitiveMesh::cellCells(const label cellI) const
const Foam::labelList& Foam::primitiveMesh::cellCells(const label celli) const
{
return cellCells(cellI, labels_);
return cellCells(celli, labels_);
}

View File

@ -69,11 +69,11 @@ void Foam::primitiveMesh::calcCellEdges() const
const labelListList& fe = faceEdges();
// loop through the list again and add edges; checking for duplicates
forAll(own, faceI)
forAll(own, facei)
{
DynamicList<label, edgesPerCell_>& curCellEdges = ce[own[faceI]];
DynamicList<label, edgesPerCell_>& curCellEdges = ce[own[facei]];
const labelList& curEdges = fe[faceI];
const labelList& curEdges = fe[facei];
forAll(curEdges, edgeI)
{
@ -85,11 +85,11 @@ void Foam::primitiveMesh::calcCellEdges() const
}
}
forAll(nei, faceI)
forAll(nei, facei)
{
DynamicList<label, edgesPerCell_>& curCellEdges = ce[nei[faceI]];
DynamicList<label, edgesPerCell_>& curCellEdges = ce[nei[facei]];
const labelList& curEdges = fe[faceI];
const labelList& curEdges = fe[facei];
forAll(curEdges, edgeI)
{
@ -105,9 +105,9 @@ void Foam::primitiveMesh::calcCellEdges() const
labelListList& cellEdgeAddr = *cePtr_;
// reset the size
forAll(ce, cellI)
forAll(ce, celli)
{
cellEdgeAddr[cellI].transfer(ce[cellI]);
cellEdgeAddr[celli].transfer(ce[celli]);
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -57,18 +57,18 @@ const Foam::labelListList& Foam::primitiveMesh::cellPoints() const
const Foam::labelList& Foam::primitiveMesh::cellPoints
(
const label cellI,
const label celli,
DynamicList<label>& storage
) const
{
if (hasCellPoints())
{
return cellPoints()[cellI];
return cellPoints()[celli];
}
else
{
const faceList& fcs = faces();
const labelList& cFaces = cells()[cellI];
const labelList& cFaces = cells()[celli];
labelSet_.clear();
@ -98,9 +98,9 @@ const Foam::labelList& Foam::primitiveMesh::cellPoints
}
const Foam::labelList& Foam::primitiveMesh::cellPoints(const label cellI) const
const Foam::labelList& Foam::primitiveMesh::cellPoints(const label celli) const
{
return cellPoints(cellI, labels_);
return cellPoints(celli, labels_);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -41,9 +41,9 @@ void Foam::primitiveMesh::calcCells
{
nCells = -1;
forAll(own, faceI)
forAll(own, facei)
{
nCells = max(nCells, own[faceI]);
nCells = max(nCells, own[facei]);
}
nCells++;
}
@ -52,16 +52,16 @@ void Foam::primitiveMesh::calcCells
labelList ncf(nCells, 0);
forAll(own, faceI)
forAll(own, facei)
{
ncf[own[faceI]]++;
ncf[own[facei]]++;
}
forAll(nei, faceI)
forAll(nei, facei)
{
if (nei[faceI] >= 0)
if (nei[facei] >= 0)
{
ncf[nei[faceI]]++;
ncf[nei[facei]]++;
}
}
@ -71,26 +71,26 @@ void Foam::primitiveMesh::calcCells
// 2. Size and fill cellFaceAddr
forAll(cellFaceAddr, cellI)
forAll(cellFaceAddr, celli)
{
cellFaceAddr[cellI].setSize(ncf[cellI]);
cellFaceAddr[celli].setSize(ncf[celli]);
}
ncf = 0;
forAll(own, faceI)
forAll(own, facei)
{
label cellI = own[faceI];
label celli = own[facei];
cellFaceAddr[cellI][ncf[cellI]++] = faceI;
cellFaceAddr[celli][ncf[celli]++] = facei;
}
forAll(nei, faceI)
forAll(nei, facei)
{
label cellI = nei[faceI];
label celli = nei[facei];
if (cellI >= 0)
if (celli >= 0)
{
cellFaceAddr[cellI][ncf[cellI]++] = faceI;
cellFaceAddr[celli][ncf[celli]++] = facei;
}
}
}

View File

@ -61,12 +61,12 @@ bool Foam::primitiveMesh::checkClosedBoundary
vector sumClosed(Zero);
scalar sumMagClosedBoundary = 0;
for (label faceI = nInternalFaces(); faceI < areas.size(); faceI++)
for (label facei = nInternalFaces(); facei < areas.size(); facei++)
{
if (!internalOrCoupledFaces.size() || !internalOrCoupledFaces[faceI])
if (!internalOrCoupledFaces.size() || !internalOrCoupledFaces[facei])
{
sumClosed += areas[faceI];
sumMagClosedBoundary += mag(areas[faceI]);
sumClosed += areas[facei];
sumMagClosedBoundary += mag(areas[facei]);
}
}
@ -165,23 +165,23 @@ bool Foam::primitiveMesh::checkClosedCells
scalar maxAspectRatio = max(aspectRatio);
// Check the sums
forAll(openness, cellI)
forAll(openness, celli)
{
if (openness[cellI] > closedThreshold_)
if (openness[celli] > closedThreshold_)
{
if (setPtr)
{
setPtr->insert(cellI);
setPtr->insert(celli);
}
nOpen++;
}
if (aspectRatio[cellI] > aspectThreshold_)
if (aspectRatio[celli] > aspectThreshold_)
{
if (aspectSetPtr)
{
aspectSetPtr->insert(cellI);
aspectSetPtr->insert(celli);
}
nAspect++;
@ -249,37 +249,37 @@ bool Foam::primitiveMesh::checkFaceAreas
scalar minArea = GREAT;
scalar maxArea = -GREAT;
forAll(magFaceAreas, faceI)
forAll(magFaceAreas, facei)
{
if (magFaceAreas[faceI] < VSMALL)
if (magFaceAreas[facei] < VSMALL)
{
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
if (detailedReport)
{
if (isInternalFace(faceI))
if (isInternalFace(facei))
{
Pout<< "Zero or negative face area detected for "
<< "internal face "<< faceI << " between cells "
<< faceOwner()[faceI] << " and "
<< faceNeighbour()[faceI]
<< ". Face area magnitude = " << magFaceAreas[faceI]
<< "internal face "<< facei << " between cells "
<< faceOwner()[facei] << " and "
<< faceNeighbour()[facei]
<< ". Face area magnitude = " << magFaceAreas[facei]
<< endl;
}
else
{
Pout<< "Zero or negative face area detected for "
<< "boundary face " << faceI << " next to cell "
<< faceOwner()[faceI] << ". Face area magnitude = "
<< magFaceAreas[faceI] << endl;
<< "boundary face " << facei << " next to cell "
<< faceOwner()[facei] << ". Face area magnitude = "
<< magFaceAreas[facei] << endl;
}
}
}
minArea = min(minArea, magFaceAreas[faceI]);
maxArea = max(maxArea, magFaceAreas[faceI]);
minArea = min(minArea, magFaceAreas[facei]);
maxArea = max(maxArea, magFaceAreas[facei]);
}
reduce(minArea, minOp<scalar>());
@ -327,25 +327,25 @@ bool Foam::primitiveMesh::checkCellVolumes
label nNegVolCells = 0;
forAll(vols, cellI)
forAll(vols, celli)
{
if (vols[cellI] < VSMALL)
if (vols[celli] < VSMALL)
{
if (setPtr)
{
setPtr->insert(cellI);
setPtr->insert(celli);
}
if (detailedReport)
{
Pout<< "Zero or negative cell volume detected for cell "
<< cellI << ". Volume = " << vols[cellI] << endl;
<< celli << ". Volume = " << vols[celli] << endl;
}
nNegVolCells++;
}
minVolume = min(minVolume, vols[cellI]);
maxVolume = max(maxVolume, vols[cellI]);
minVolume = min(minVolume, vols[celli]);
maxVolume = max(maxVolume, vols[celli]);
}
reduce(minVolume, minOp<scalar>());
@ -414,15 +414,15 @@ bool Foam::primitiveMesh::checkFaceOrthogonality
label errorNonOrth = 0;
forAll(ortho, faceI)
forAll(ortho, facei)
{
if (ortho[faceI] < severeNonorthogonalityThreshold)
if (ortho[facei] < severeNonorthogonalityThreshold)
{
if (ortho[faceI] > SMALL)
if (ortho[facei] > SMALL)
{
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
severeNonOrth++;
@ -431,7 +431,7 @@ bool Foam::primitiveMesh::checkFaceOrthogonality
{
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
errorNonOrth++;
@ -523,42 +523,42 @@ bool Foam::primitiveMesh::checkFacePyramids
label nErrorPyrs = 0;
forAll(ownPyrVol, faceI)
forAll(ownPyrVol, facei)
{
if (ownPyrVol[faceI] < minPyrVol)
if (ownPyrVol[facei] < minPyrVol)
{
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
if (detailedReport)
{
Pout<< "Negative pyramid volume: " << ownPyrVol[faceI]
<< " for face " << faceI << " " << f[faceI]
<< " and owner cell: " << own[faceI] << endl
Pout<< "Negative pyramid volume: " << ownPyrVol[facei]
<< " for face " << facei << " " << f[facei]
<< " and owner cell: " << own[facei] << endl
<< "Owner cell vertex labels: "
<< cells()[own[faceI]].labels(faces())
<< cells()[own[facei]].labels(faces())
<< endl;
}
nErrorPyrs++;
}
if (isInternalFace(faceI))
if (isInternalFace(facei))
{
if (neiPyrVol[faceI] < minPyrVol)
if (neiPyrVol[facei] < minPyrVol)
{
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
if (detailedReport)
{
Pout<< "Negative pyramid volume: " << neiPyrVol[faceI]
<< " for face " << faceI << " " << f[faceI]
<< " and neighbour cell: " << nei[faceI] << nl
Pout<< "Negative pyramid volume: " << neiPyrVol[facei]
<< " for face " << facei << " " << f[facei]
<< " and neighbour cell: " << nei[facei] << nl
<< "Neighbour cell vertex labels: "
<< cells()[nei[faceI]].labels(faces())
<< cells()[nei[facei]].labels(faces())
<< endl;
}
nErrorPyrs++;
@ -622,15 +622,15 @@ bool Foam::primitiveMesh::checkFaceSkewness
scalar maxSkew = max(skewness);
label nWarnSkew = 0;
forAll(skewness, faceI)
forAll(skewness, facei)
{
// Check if the skewness vector is greater than the PN vector.
// This does not cause trouble but is a good indication of a poor mesh.
if (skewness[faceI] > skewThreshold_)
if (skewness[facei] > skewThreshold_)
{
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
nWarnSkew++;
@ -701,15 +701,15 @@ bool Foam::primitiveMesh::checkFaceAngles
label nConcave = 0;
forAll(faceAngles, faceI)
forAll(faceAngles, facei)
{
if (faceAngles[faceI] > SMALL)
if (faceAngles[facei] > SMALL)
{
nConcave++;
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
}
}
@ -784,22 +784,22 @@ bool Foam::primitiveMesh::checkFaceFlatness
label nSummed = 0;
label nWarped = 0;
forAll(faceFlatness, faceI)
forAll(faceFlatness, facei)
{
if (fcs[faceI].size() > 3 && magAreas[faceI] > VSMALL)
if (fcs[facei].size() > 3 && magAreas[facei] > VSMALL)
{
sumFlatness += faceFlatness[faceI];
sumFlatness += faceFlatness[facei];
nSummed++;
minFlatness = min(minFlatness, faceFlatness[faceI]);
minFlatness = min(minFlatness, faceFlatness[facei]);
if (faceFlatness[faceI] < warnFlatness)
if (faceFlatness[facei] < warnFlatness)
{
nWarped++;
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
}
}
@ -867,9 +867,9 @@ bool Foam::primitiveMesh::checkConcaveCells
label nConcaveCells = 0;
forAll(c, cellI)
forAll(c, celli)
{
const cell& cFaces = c[cellI];
const cell& cFaces = c[celli];
bool concave = false;
@ -890,7 +890,7 @@ bool Foam::primitiveMesh::checkConcaveCells
// Flip normal if required so that it is always pointing out of
// the cell
if (fOwner[fI] != cellI)
if (fOwner[fI] != celli)
{
fN *= -1;
}
@ -924,7 +924,7 @@ bool Foam::primitiveMesh::checkConcaveCells
if (setPtr)
{
setPtr->insert(cellI);
setPtr->insert(celli);
}
nConcaveCells++;
@ -988,15 +988,15 @@ bool Foam::primitiveMesh::checkUpperTriangular
// Loop through faceCells once more and make sure that for internal cell
// the first label is smaller
for (label faceI = 0; faceI < internal; faceI++)
for (label facei = 0; facei < internal; facei++)
{
if (own[faceI] >= nei[faceI])
if (own[facei] >= nei[facei])
{
error = true;
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
}
}
@ -1005,34 +1005,34 @@ bool Foam::primitiveMesh::checkUpperTriangular
// and add it to the check list (upper triangular order).
// Once the list is completed, check it against the faceCell list
forAll(c, cellI)
forAll(c, celli)
{
const labelList& curFaces = c[cellI];
const labelList& curFaces = c[celli];
// Neighbouring cells
SortableList<label> nbr(curFaces.size());
forAll(curFaces, i)
{
label faceI = curFaces[i];
label facei = curFaces[i];
if (faceI >= nInternalFaces())
if (facei >= nInternalFaces())
{
// Sort last
nbr[i] = labelMax;
}
else
{
label nbrCellI = nei[faceI];
label nbrCellI = nei[facei];
if (nbrCellI == cellI)
if (nbrCellI == celli)
{
nbrCellI = own[faceI];
nbrCellI = own[facei];
}
if (cellI < nbrCellI)
if (celli < nbrCellI)
{
// cellI is master
// celli is master
nbr[i] = nbrCellI;
}
else
@ -1141,17 +1141,17 @@ bool Foam::primitiveMesh::checkCellsZipUp
const faceList& f = faces();
const cellList& c = cells();
forAll(c, cellI)
forAll(c, celli)
{
const labelList& curFaces = c[cellI];
const labelList& curFaces = c[celli];
const edgeList cellEdges = c[cellI].edges(f);
const edgeList cellEdges = c[celli].edges(f);
labelList edgeUsage(cellEdges.size(), 0);
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
edgeList curFaceEdges = f[curFaces[faceI]].edges();
edgeList curFaceEdges = f[curFaces[facei]].edges();
forAll(curFaceEdges, faceEdgeI)
{
@ -1182,7 +1182,7 @@ bool Foam::primitiveMesh::checkCellsZipUp
{
if (setPtr)
{
setPtr->insert(cellI);
setPtr->insert(celli);
}
}
}
@ -1191,7 +1191,7 @@ bool Foam::primitiveMesh::checkCellsZipUp
{
if (setPtr)
{
setPtr->insert(cellI);
setPtr->insert(celli);
}
nOpenCells++;
@ -1370,7 +1370,7 @@ bool Foam::primitiveMesh::checkPoints
bool Foam::primitiveMesh::checkDuplicateFaces
(
const label faceI,
const label facei,
const Map<label>& nCommonPoints,
label& nBaffleFaces,
labelHashSet* setPtr
@ -1383,7 +1383,7 @@ bool Foam::primitiveMesh::checkDuplicateFaces
label nbFaceI = iter.key();
label nCommon = iter();
const face& curFace = faces()[faceI];
const face& curFace = faces()[facei];
const face& nbFace = faces()[nbFaceI];
if (nCommon == nbFace.size() || nCommon == curFace.size())
@ -1399,7 +1399,7 @@ bool Foam::primitiveMesh::checkDuplicateFaces
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
setPtr->insert(nbFaceI);
}
}
@ -1411,7 +1411,7 @@ bool Foam::primitiveMesh::checkDuplicateFaces
bool Foam::primitiveMesh::checkCommonOrder
(
const label faceI,
const label facei,
const Map<label>& nCommonPoints,
labelHashSet* setPtr
) const
@ -1423,7 +1423,7 @@ bool Foam::primitiveMesh::checkCommonOrder
label nbFaceI = iter.key();
label nCommon = iter();
const face& curFace = faces()[faceI];
const face& curFace = faces()[facei];
const face& nbFace = faces()[nbFaceI];
if
@ -1548,7 +1548,7 @@ bool Foam::primitiveMesh::checkCommonOrder
{
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
setPtr->insert(nbFaceI);
}
@ -1588,11 +1588,11 @@ bool Foam::primitiveMesh::checkFaceFaces
label nErrorOrder = 0;
Map<label> nCommonPoints(100);
for (label faceI = 0; faceI < nFaces(); faceI++)
for (label facei = 0; facei < nFaces(); facei++)
{
const face& curFace = faces()[faceI];
const face& curFace = faces()[facei];
// Calculate number of common points between current faceI and
// Calculate number of common points between current facei and
// neighbouring face. Store on map.
nCommonPoints.clear();
@ -1606,7 +1606,7 @@ bool Foam::primitiveMesh::checkFaceFaces
{
label nbFaceI = nbs[nbI];
if (faceI < nbFaceI)
if (facei < nbFaceI)
{
// Only check once for each combination of two faces.
@ -1628,13 +1628,13 @@ bool Foam::primitiveMesh::checkFaceFaces
// Perform various checks on common points
// Check all vertices shared (duplicate point)
if (checkDuplicateFaces(faceI, nCommonPoints, nBaffleFaces, setPtr))
if (checkDuplicateFaces(facei, nCommonPoints, nBaffleFaces, setPtr))
{
nErrorDuplicate++;
}
// Check common vertices are consecutive on both faces
if (checkCommonOrder(faceI, nCommonPoints, setPtr))
if (checkCommonOrder(facei, nCommonPoints, setPtr))
{
nErrorOrder++;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -42,9 +42,9 @@ bool Foam::primitiveMesh::checkEdgeLength
labelHashSet smallEdgeSet(nPoints()/100);
forAll(faces, faceI)
forAll(faces, facei)
{
const face& f = faces[faceI];
const face& f = faces[facei];
forAll(f, fp)
{

View File

@ -36,28 +36,28 @@ Foam::scalar Foam::primitiveMeshTools::faceSkewness
const vectorField& fCtrs,
const vectorField& fAreas,
const label faceI,
const label facei,
const point& ownCc,
const point& neiCc
)
{
vector Cpf = fCtrs[faceI] - ownCc;
vector Cpf = fCtrs[facei] - ownCc;
vector d = neiCc - ownCc;
// Skewness vector
vector sv =
Cpf
- ((fAreas[faceI] & Cpf)/((fAreas[faceI] & d) + ROOTVSMALL))*d;
- ((fAreas[facei] & Cpf)/((fAreas[facei] & d) + ROOTVSMALL))*d;
vector svHat = sv/(mag(sv) + ROOTVSMALL);
// Normalisation distance calculated as the approximate distance
// from the face centre to the edge of the face in the direction
// of the skewness
scalar fd = 0.2*mag(d) + ROOTVSMALL;
const face& f = mesh.faces()[faceI];
const face& f = mesh.faces()[facei];
forAll(f, pi)
{
fd = max(fd, mag(svHat & (p[f[pi]] - fCtrs[faceI])));
fd = max(fd, mag(svHat & (p[f[pi]] - fCtrs[facei])));
}
// Normalised skewness
@ -72,13 +72,13 @@ Foam::scalar Foam::primitiveMeshTools::boundaryFaceSkewness
const vectorField& fCtrs,
const vectorField& fAreas,
const label faceI,
const label facei,
const point& ownCc
)
{
vector Cpf = fCtrs[faceI] - ownCc;
vector Cpf = fCtrs[facei] - ownCc;
vector normal = fAreas[faceI];
vector normal = fAreas[facei];
normal /= mag(normal) + ROOTVSMALL;
vector d = normal*(normal & Cpf);
@ -86,17 +86,17 @@ Foam::scalar Foam::primitiveMeshTools::boundaryFaceSkewness
// Skewness vector
vector sv =
Cpf
- ((fAreas[faceI] & Cpf)/((fAreas[faceI] & d) + ROOTVSMALL))*d;
- ((fAreas[facei] & Cpf)/((fAreas[facei] & d) + ROOTVSMALL))*d;
vector svHat = sv/(mag(sv) + ROOTVSMALL);
// Normalisation distance calculated as the approximate distance
// from the face centre to the edge of the face in the direction
// of the skewness
scalar fd = 0.4*mag(d) + ROOTVSMALL;
const face& f = mesh.faces()[faceI];
const face& f = mesh.faces()[facei];
forAll(f, pi)
{
fd = max(fd, mag(svHat & (p[f[pi]] - fCtrs[faceI])));
fd = max(fd, mag(svHat & (p[f[pi]] - fCtrs[facei])));
}
// Normalised skewness
@ -133,13 +133,13 @@ Foam::tmp<Foam::scalarField> Foam::primitiveMeshTools::faceOrthogonality
scalarField& ortho = tortho.ref();
// Internal faces
forAll(nei, faceI)
forAll(nei, facei)
{
ortho[faceI] = faceOrthogonality
ortho[facei] = faceOrthogonality
(
cc[own[faceI]],
cc[nei[faceI]],
areas[faceI]
cc[own[facei]],
cc[nei[facei]],
areas[facei]
);
}
@ -162,18 +162,18 @@ Foam::tmp<Foam::scalarField> Foam::primitiveMeshTools::faceSkewness
tmp<scalarField> tskew(new scalarField(mesh.nFaces()));
scalarField& skew = tskew.ref();
forAll(nei, faceI)
forAll(nei, facei)
{
skew[faceI] = faceSkewness
skew[facei] = faceSkewness
(
mesh,
p,
fCtrs,
fAreas,
faceI,
cellCtrs[own[faceI]],
cellCtrs[nei[faceI]]
facei,
cellCtrs[own[facei]],
cellCtrs[nei[facei]]
);
}
@ -181,16 +181,16 @@ Foam::tmp<Foam::scalarField> Foam::primitiveMeshTools::faceSkewness
// Boundary faces: consider them to have only skewness error.
// (i.e. treat as if mirror cell on other side)
for (label faceI = mesh.nInternalFaces(); faceI < mesh.nFaces(); faceI++)
for (label facei = mesh.nInternalFaces(); facei < mesh.nFaces(); facei++)
{
skew[faceI] = boundaryFaceSkewness
skew[facei] = boundaryFaceSkewness
(
mesh,
p,
fCtrs,
fAreas,
faceI,
cellCtrs[own[faceI]]
facei,
cellCtrs[own[facei]]
);
}
@ -215,22 +215,22 @@ void Foam::primitiveMeshTools::facePyramidVolume
ownPyrVol.setSize(mesh.nFaces());
neiPyrVol.setSize(mesh.nInternalFaces());
forAll(f, faceI)
forAll(f, facei)
{
// Create the owner pyramid
ownPyrVol[faceI] = -pyramidPointFaceRef
ownPyrVol[facei] = -pyramidPointFaceRef
(
f[faceI],
ctrs[own[faceI]]
f[facei],
ctrs[own[facei]]
).mag(points);
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
// Create the neighbour pyramid - it will have positive volume
neiPyrVol[faceI] = pyramidPointFaceRef
neiPyrVol[facei] = pyramidPointFaceRef
(
f[faceI],
ctrs[nei[faceI]]
f[facei],
ctrs[nei[facei]]
).mag(points);
}
}
@ -257,18 +257,18 @@ void Foam::primitiveMeshTools::cellClosedness
vectorField sumClosed(mesh.nCells(), Zero);
vectorField sumMagClosed(mesh.nCells(), Zero);
forAll(own, faceI)
forAll(own, facei)
{
// Add to owner
sumClosed[own[faceI]] += areas[faceI];
sumMagClosed[own[faceI]] += cmptMag(areas[faceI]);
sumClosed[own[facei]] += areas[facei];
sumMagClosed[own[facei]] += cmptMag(areas[facei]);
}
forAll(nei, faceI)
forAll(nei, facei)
{
// Subtract from neighbour
sumClosed[nei[faceI]] -= areas[faceI];
sumMagClosed[nei[faceI]] += cmptMag(areas[faceI]);
sumClosed[nei[facei]] -= areas[facei];
sumMagClosed[nei[facei]] += cmptMag(areas[facei]);
}
@ -286,7 +286,7 @@ void Foam::primitiveMeshTools::cellClosedness
openness.setSize(mesh.nCells());
aratio.setSize(mesh.nCells());
forAll(sumClosed, cellI)
forAll(sumClosed, celli)
{
scalar maxOpenness = 0;
@ -295,11 +295,11 @@ void Foam::primitiveMeshTools::cellClosedness
maxOpenness = max
(
maxOpenness,
mag(sumClosed[cellI][cmpt])
/(sumMagClosed[cellI][cmpt] + ROOTVSMALL)
mag(sumClosed[celli][cmpt])
/(sumMagClosed[celli][cmpt] + ROOTVSMALL)
);
}
openness[cellI] = maxOpenness;
openness[celli] = maxOpenness;
// Calculate the aspect ration as the maximum of Cartesian component
// aspect ratio to the total area hydraulic area aspect ratio
@ -309,24 +309,24 @@ void Foam::primitiveMeshTools::cellClosedness
{
if (meshD[dir] == 1)
{
minCmpt = min(minCmpt, sumMagClosed[cellI][dir]);
maxCmpt = max(maxCmpt, sumMagClosed[cellI][dir]);
minCmpt = min(minCmpt, sumMagClosed[celli][dir]);
maxCmpt = max(maxCmpt, sumMagClosed[celli][dir]);
}
}
scalar aspectRatio = maxCmpt/(minCmpt + ROOTVSMALL);
if (nDims == 3)
{
scalar v = max(ROOTVSMALL, vols[cellI]);
scalar v = max(ROOTVSMALL, vols[celli]);
aspectRatio = max
(
aspectRatio,
1.0/6.0*cmptSum(sumMagClosed[cellI])/pow(v, 2.0/3.0)
1.0/6.0*cmptSum(sumMagClosed[celli])/pow(v, 2.0/3.0)
);
}
aratio[cellI] = aspectRatio;
aratio[celli] = aspectRatio;
}
}
@ -348,9 +348,9 @@ Foam::tmp<Foam::scalarField> Foam::primitiveMeshTools::faceConcavity
scalarField& faceAngles = tfaceAngles.ref();
forAll(fcs, faceI)
forAll(fcs, facei)
{
const face& f = fcs[faceI];
const face& f = fcs[facei];
// Get edge from f[0] to f[size-1];
vector ePrev(p[f.first()] - p[f.last()]);
@ -383,7 +383,7 @@ Foam::tmp<Foam::scalarField> Foam::primitiveMeshTools::faceConcavity
// Check normal
edgeNormal /= magEdgeNormal;
if ((edgeNormal & faceNormals[faceI]) < SMALL)
if ((edgeNormal & faceNormals[facei]) < SMALL)
{
maxEdgeSin = max(maxEdgeSin, magEdgeNormal);
}
@ -394,7 +394,7 @@ Foam::tmp<Foam::scalarField> Foam::primitiveMeshTools::faceConcavity
magEPrev = magE10;
}
faceAngles[faceI] = maxEdgeSin;
faceAngles[facei] = maxEdgeSin;
}
return tfaceAngles;
@ -419,13 +419,13 @@ Foam::tmp<Foam::scalarField> Foam::primitiveMeshTools::faceFlatness
scalarField& faceFlatness = tfaceFlatness.ref();
forAll(fcs, faceI)
forAll(fcs, facei)
{
const face& f = fcs[faceI];
const face& f = fcs[facei];
if (f.size() > 3 && magAreas[faceI] > ROOTVSMALL)
if (f.size() > 3 && magAreas[facei] > ROOTVSMALL)
{
const point& fc = fCtrs[faceI];
const point& fc = fCtrs[facei];
// Calculate the sum of magnitude of areas and compare to magnitude
// of sum of areas.
@ -442,7 +442,7 @@ Foam::tmp<Foam::scalarField> Foam::primitiveMeshTools::faceFlatness
sumA += mag(n);
}
faceFlatness[faceI] = magAreas[faceI]/(sumA + ROOTVSMALL);
faceFlatness[facei] = magAreas[facei]/(sumA + ROOTVSMALL);
}
}
@ -484,9 +484,9 @@ Foam::tmp<Foam::scalarField> Foam::primitiveMeshTools::cellDeterminant
}
else
{
forAll(c, cellI)
forAll(c, celli)
{
const labelList& curFaces = c[cellI];
const labelList& curFaces = c[celli];
// Calculate local normalization factor
scalar avgArea = 0;
@ -505,7 +505,7 @@ Foam::tmp<Foam::scalarField> Foam::primitiveMeshTools::cellDeterminant
if (nInternalFaces == 0)
{
cellDeterminant[cellI] = 0;
cellDeterminant[celli] = 0;
}
else
{
@ -539,7 +539,7 @@ Foam::tmp<Foam::scalarField> Foam::primitiveMeshTools::cellDeterminant
}
}
cellDeterminant[cellI] = mag(det(areaTensor));
cellDeterminant[celli] = mag(det(areaTensor));
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -139,7 +139,7 @@ public:
const vectorField& fCtrs,
const vectorField& fAreas,
const label faceI,
const label facei,
const point& ownCc,
const point& neiCc
);
@ -152,7 +152,7 @@ public:
const vectorField& fCtrs,
const vectorField& fAreas,
const label faceI,
const label facei,
const point& ownCc
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -78,10 +78,10 @@ const Foam::labelList& Foam::primitiveMesh::edgeCells
// Do quadratic insertion.
forAll(eFaces, i)
{
label faceI = eFaces[i];
label facei = eFaces[i];
{
label ownCellI = own[faceI];
label ownCellI = own[facei];
// Check if not already in storage
forAll(storage, j)
@ -99,9 +99,9 @@ const Foam::labelList& Foam::primitiveMesh::edgeCells
}
}
if (isInternalFace(faceI))
if (isInternalFace(facei))
{
label neiCellI = nei[faceI];
label neiCellI = nei[facei];
forAll(storage, j)
{

View File

@ -117,9 +117,9 @@ void Foam::primitiveMesh::calcEdges(const bool doFaceEdges) const
{
fePtr_ = new labelListList(fcs.size());
labelListList& faceEdges = *fePtr_;
forAll(fcs, faceI)
forAll(fcs, facei)
{
faceEdges[faceI].setSize(fcs[faceI].size());
faceEdges[facei].setSize(fcs[facei].size());
}
}
@ -140,9 +140,9 @@ void Foam::primitiveMesh::calcEdges(const bool doFaceEdges) const
if (nInternalPoints_ == -1)
{
// No ordering. No distinction between types.
forAll(fcs, faceI)
forAll(fcs, facei)
{
const face& f = fcs[faceI];
const face& f = fcs[facei];
forAll(f, fp)
{
@ -153,7 +153,7 @@ void Foam::primitiveMesh::calcEdges(const bool doFaceEdges) const
if (doFaceEdges)
{
(*fePtr_)[faceI][fp] = edgeI;
(*fePtr_)[facei][fp] = edgeI;
}
}
}
@ -165,9 +165,9 @@ void Foam::primitiveMesh::calcEdges(const bool doFaceEdges) const
else
{
// 1. Do external faces first. This creates external edges.
for (label faceI = nInternalFaces_; faceI < fcs.size(); faceI++)
for (label facei = nInternalFaces_; facei < fcs.size(); facei++)
{
const face& f = fcs[faceI];
const face& f = fcs[facei];
forAll(f, fp)
{
@ -183,15 +183,15 @@ void Foam::primitiveMesh::calcEdges(const bool doFaceEdges) const
}
if (doFaceEdges)
{
(*fePtr_)[faceI][fp] = edgeI;
(*fePtr_)[facei][fp] = edgeI;
}
}
}
// 2. Do internal faces. This creates internal edges.
for (label faceI = 0; faceI < nInternalFaces_; faceI++)
for (label facei = 0; facei < nInternalFaces_; facei++)
{
const face& f = fcs[faceI];
const face& f = fcs[facei];
forAll(f, fp)
{
@ -228,7 +228,7 @@ void Foam::primitiveMesh::calcEdges(const bool doFaceEdges) const
}
if (doFaceEdges)
{
(*fePtr_)[faceI][fp] = edgeI;
(*fePtr_)[facei][fp] = edgeI;
}
}
}
@ -444,9 +444,9 @@ void Foam::primitiveMesh::calcEdges(const bool doFaceEdges) const
if (doFaceEdges)
{
labelListList& faceEdges = *fePtr_;
forAll(faceEdges, faceI)
forAll(faceEdges, facei)
{
inplaceRenumber(oldToNew, faceEdges[faceI]);
inplaceRenumber(oldToNew, faceEdges[facei]);
}
}
}
@ -533,11 +533,11 @@ const Foam::labelListList& Foam::primitiveMesh::faceEdges() const
fePtr_ = new labelListList(fcs.size());
labelListList& faceEdges = *fePtr_;
forAll(fcs, faceI)
forAll(fcs, facei)
{
const face& f = fcs[faceI];
const face& f = fcs[facei];
labelList& fEdges = faceEdges[faceI];
labelList& fEdges = faceEdges[facei];
fEdges.setSize(f.size());
forAll(f, fp)
@ -578,18 +578,18 @@ void Foam::primitiveMesh::clearOutEdges()
const Foam::labelList& Foam::primitiveMesh::faceEdges
(
const label faceI,
const label facei,
DynamicList<label>& storage
) const
{
if (hasFaceEdges())
{
return faceEdges()[faceI];
return faceEdges()[facei];
}
else
{
const labelListList& pointEs = pointEdges();
const face& f = faces()[faceI];
const face& f = faces()[facei];
storage.clear();
if (f.size() > storage.capacity())
@ -614,25 +614,25 @@ const Foam::labelList& Foam::primitiveMesh::faceEdges
}
const Foam::labelList& Foam::primitiveMesh::faceEdges(const label faceI) const
const Foam::labelList& Foam::primitiveMesh::faceEdges(const label facei) const
{
return faceEdges(faceI, labels_);
return faceEdges(facei, labels_);
}
const Foam::labelList& Foam::primitiveMesh::cellEdges
(
const label cellI,
const label celli,
DynamicList<label>& storage
) const
{
if (hasCellEdges())
{
return cellEdges()[cellI];
return cellEdges()[celli];
}
else
{
const labelList& cFaces = cells()[cellI];
const labelList& cFaces = cells()[celli];
labelSet_.clear();
@ -663,9 +663,9 @@ const Foam::labelList& Foam::primitiveMesh::cellEdges
}
const Foam::labelList& Foam::primitiveMesh::cellEdges(const label cellI) const
const Foam::labelList& Foam::primitiveMesh::cellEdges(const label celli) const
{
return cellEdges(cellI, labels_);
return cellEdges(celli, labels_);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -63,9 +63,9 @@ void Foam::primitiveMesh::calcPointCells() const
labelList npc(nPoints(), 0);
forAll(cf, cellI)
forAll(cf, celli)
{
const labelList curPoints = cf[cellI].labels(faces());
const labelList curPoints = cf[celli].labels(faces());
forAll(curPoints, pointI)
{
@ -88,15 +88,15 @@ void Foam::primitiveMesh::calcPointCells() const
npc = 0;
forAll(cf, cellI)
forAll(cf, celli)
{
const labelList curPoints = cf[cellI].labels(faces());
const labelList curPoints = cf[celli].labels(faces());
forAll(curPoints, pointI)
{
label ptI = curPoints[pointI];
pointCellAddr[ptI][npc[ptI]++] = cellI;
pointCellAddr[ptI][npc[ptI]++] = celli;
}
}
}
@ -136,15 +136,15 @@ const Foam::labelList& Foam::primitiveMesh::pointCells
forAll(pFaces, i)
{
const label faceI = pFaces[i];
const label facei = pFaces[i];
// Append owner
storage.append(own[faceI]);
storage.append(own[facei]);
// Append neighbour
if (faceI < nInternalFaces())
if (facei < nInternalFaces())
{
storage.append(nei[faceI]);
storage.append(nei[facei]);
}
}

View File

@ -46,9 +46,9 @@ Foam::labelList Foam::patchZones::faceToEdge
forAll(changedFaces, i)
{
label faceI = changedFaces[i];
label facei = changedFaces[i];
const labelList& fEdges = pp_.faceEdges()[faceI];
const labelList& fEdges = pp_.faceEdges()[facei];
forAll(fEdges, fEdgeI)
{
@ -82,13 +82,13 @@ Foam::labelList Foam::patchZones::edgeToFace(const labelList& changedEdges)
forAll(eFaces, eFaceI)
{
label faceI = eFaces[eFaceI];
label facei = eFaces[eFaceI];
if (operator[](faceI) == -1)
if (operator[](facei) == -1)
{
operator[](faceI) = nZones_;
operator[](facei) = nZones_;
changedFaces[changedI++] = faceI;
changedFaces[changedI++] = facei;
}
}
}
@ -99,10 +99,10 @@ Foam::labelList Foam::patchZones::edgeToFace(const labelList& changedEdges)
}
void Foam::patchZones::markZone(label faceI)
void Foam::patchZones::markZone(label facei)
{
// List of faces whose faceZone has been set.
labelList changedFaces(1, faceI);
labelList changedFaces(1, facei);
// List of edges whose faceZone has been set.
labelList changedEdges;
@ -167,24 +167,24 @@ Foam::patchZones::patchZones
<< abort(FatalError);
}
label faceI = 0;
label facei = 0;
while (true)
{
// Find first non-visited face
for (; faceI < pp_.size(); faceI++)
for (; facei < pp_.size(); facei++)
{
if (operator[](faceI) == -1)
if (operator[](facei) == -1)
{
operator[](faceI) = nZones_;
operator[](facei) = nZones_;
markZone(faceI);
markZone(facei);
break;
}
}
if (faceI == pp_.size())
if (facei == pp_.size())
{
// Finished.
break;

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