mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Standardized cell, patch and face loop index names
This commit is contained in:
@ -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
|
||||
@ -73,7 +73,7 @@ namespace Foam
|
||||
void operator()
|
||||
(
|
||||
Type& x,
|
||||
const label faceI,
|
||||
const label facei,
|
||||
const Type& y,
|
||||
const scalar weight
|
||||
) const
|
||||
@ -83,11 +83,11 @@ namespace Foam
|
||||
label meshFaceI = -1;
|
||||
if (patch_.owner())
|
||||
{
|
||||
meshFaceI = patch_.start() + faceI;
|
||||
meshFaceI = patch_.start() + facei;
|
||||
}
|
||||
else
|
||||
{
|
||||
meshFaceI = patch_.neighbPatch().start() + faceI;
|
||||
meshFaceI = patch_.neighbPatch().start() + facei;
|
||||
}
|
||||
x.updateFace
|
||||
(
|
||||
@ -106,7 +106,7 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
// Update info for cellI, at position pt, with information from
|
||||
// Update info for celli, at position pt, with information from
|
||||
// neighbouring face/cell.
|
||||
// Updates:
|
||||
// - changedCell_, changedCells_, nChangedCells_,
|
||||
@ -114,7 +114,7 @@ namespace Foam
|
||||
template<class Type, class TrackingData>
|
||||
bool Foam::FaceCellWave<Type, TrackingData>::updateCell
|
||||
(
|
||||
const label cellI,
|
||||
const label celli,
|
||||
const label neighbourFaceI,
|
||||
const Type& neighbourInfo,
|
||||
const scalar tol,
|
||||
@ -129,7 +129,7 @@ bool Foam::FaceCellWave<Type, TrackingData>::updateCell
|
||||
cellInfo.updateCell
|
||||
(
|
||||
mesh_,
|
||||
cellI,
|
||||
celli,
|
||||
neighbourFaceI,
|
||||
neighbourInfo,
|
||||
tol,
|
||||
@ -138,10 +138,10 @@ bool Foam::FaceCellWave<Type, TrackingData>::updateCell
|
||||
|
||||
if (propagate)
|
||||
{
|
||||
if (!changedCell_[cellI])
|
||||
if (!changedCell_[celli])
|
||||
{
|
||||
changedCell_[cellI] = true;
|
||||
changedCells_[nChangedCells_++] = cellI;
|
||||
changedCell_[celli] = true;
|
||||
changedCells_[nChangedCells_++] = celli;
|
||||
}
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ bool Foam::FaceCellWave<Type, TrackingData>::updateCell
|
||||
}
|
||||
|
||||
|
||||
// Update info for faceI, at position pt, with information from
|
||||
// Update info for facei, at position pt, with information from
|
||||
// neighbouring face/cell.
|
||||
// Updates:
|
||||
// - changedFace_, changedFaces_, nChangedFaces_,
|
||||
@ -162,7 +162,7 @@ bool Foam::FaceCellWave<Type, TrackingData>::updateCell
|
||||
template<class Type, class TrackingData>
|
||||
bool Foam::FaceCellWave<Type, TrackingData>::updateFace
|
||||
(
|
||||
const label faceI,
|
||||
const label facei,
|
||||
const label neighbourCellI,
|
||||
const Type& neighbourInfo,
|
||||
const scalar tol,
|
||||
@ -177,7 +177,7 @@ bool Foam::FaceCellWave<Type, TrackingData>::updateFace
|
||||
faceInfo.updateFace
|
||||
(
|
||||
mesh_,
|
||||
faceI,
|
||||
facei,
|
||||
neighbourCellI,
|
||||
neighbourInfo,
|
||||
tol,
|
||||
@ -186,10 +186,10 @@ bool Foam::FaceCellWave<Type, TrackingData>::updateFace
|
||||
|
||||
if (propagate)
|
||||
{
|
||||
if (!changedFace_[faceI])
|
||||
if (!changedFace_[facei])
|
||||
{
|
||||
changedFace_[faceI] = true;
|
||||
changedFaces_[nChangedFaces_++] = faceI;
|
||||
changedFace_[facei] = true;
|
||||
changedFaces_[nChangedFaces_++] = facei;
|
||||
}
|
||||
}
|
||||
|
||||
@ -202,7 +202,7 @@ bool Foam::FaceCellWave<Type, TrackingData>::updateFace
|
||||
}
|
||||
|
||||
|
||||
// Update info for faceI, at position pt, with information from
|
||||
// Update info for facei, at position pt, with information from
|
||||
// same face.
|
||||
// Updates:
|
||||
// - changedFace_, changedFaces_, nChangedFaces_,
|
||||
@ -210,7 +210,7 @@ bool Foam::FaceCellWave<Type, TrackingData>::updateFace
|
||||
template<class Type, class TrackingData>
|
||||
bool Foam::FaceCellWave<Type, TrackingData>::updateFace
|
||||
(
|
||||
const label faceI,
|
||||
const label facei,
|
||||
const Type& neighbourInfo,
|
||||
const scalar tol,
|
||||
Type& faceInfo
|
||||
@ -224,7 +224,7 @@ bool Foam::FaceCellWave<Type, TrackingData>::updateFace
|
||||
faceInfo.updateFace
|
||||
(
|
||||
mesh_,
|
||||
faceI,
|
||||
facei,
|
||||
neighbourInfo,
|
||||
tol,
|
||||
td_
|
||||
@ -232,10 +232,10 @@ bool Foam::FaceCellWave<Type, TrackingData>::updateFace
|
||||
|
||||
if (propagate)
|
||||
{
|
||||
if (!changedFace_[faceI])
|
||||
if (!changedFace_[facei])
|
||||
{
|
||||
changedFace_[faceI] = true;
|
||||
changedFaces_[nChangedFaces_++] = faceI;
|
||||
changedFace_[facei] = true;
|
||||
changedFaces_[nChangedFaces_++] = facei;
|
||||
}
|
||||
}
|
||||
|
||||
@ -298,9 +298,9 @@ template<class Type, class TrackingData>
|
||||
template<class PatchType>
|
||||
bool Foam::FaceCellWave<Type, TrackingData>::hasPatch() const
|
||||
{
|
||||
forAll(mesh_.boundaryMesh(), patchI)
|
||||
forAll(mesh_.boundaryMesh(), patchi)
|
||||
{
|
||||
if (isA<PatchType>(mesh_.boundaryMesh()[patchI]))
|
||||
if (isA<PatchType>(mesh_.boundaryMesh()[patchi]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -319,23 +319,23 @@ void Foam::FaceCellWave<Type, TrackingData>::setFaceInfo
|
||||
{
|
||||
forAll(changedFaces, changedFaceI)
|
||||
{
|
||||
label faceI = changedFaces[changedFaceI];
|
||||
label facei = changedFaces[changedFaceI];
|
||||
|
||||
bool wasValid = allFaceInfo_[faceI].valid(td_);
|
||||
bool wasValid = allFaceInfo_[facei].valid(td_);
|
||||
|
||||
// Copy info for faceI
|
||||
allFaceInfo_[faceI] = changedFacesInfo[changedFaceI];
|
||||
// Copy info for facei
|
||||
allFaceInfo_[facei] = changedFacesInfo[changedFaceI];
|
||||
|
||||
// Maintain count of unset faces
|
||||
if (!wasValid && allFaceInfo_[faceI].valid(td_))
|
||||
if (!wasValid && allFaceInfo_[facei].valid(td_))
|
||||
{
|
||||
--nUnvisitedFaces_;
|
||||
}
|
||||
|
||||
// Mark faceI as changed, both on list and on face itself.
|
||||
// Mark facei as changed, both on list and on face itself.
|
||||
|
||||
changedFace_[faceI] = true;
|
||||
changedFaces_[nChangedFaces_++] = faceI;
|
||||
changedFace_[facei] = true;
|
||||
changedFaces_[nChangedFaces_++] = facei;
|
||||
}
|
||||
}
|
||||
|
||||
@ -462,16 +462,16 @@ void Foam::FaceCellWave<Type, TrackingData>::transform
|
||||
{
|
||||
const tensor& T = rotTensor[0];
|
||||
|
||||
for (label faceI = 0; faceI < nFaces; faceI++)
|
||||
for (label facei = 0; facei < nFaces; facei++)
|
||||
{
|
||||
faceInfo[faceI].transform(mesh_, T, td_);
|
||||
faceInfo[facei].transform(mesh_, T, td_);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (label faceI = 0; faceI < nFaces; faceI++)
|
||||
for (label facei = 0; facei < nFaces; facei++)
|
||||
{
|
||||
faceInfo[faceI].transform(mesh_, rotTensor[faceI], td_);
|
||||
faceInfo[facei].transform(mesh_, rotTensor[facei], td_);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -487,9 +487,9 @@ void Foam::FaceCellWave<Type, TrackingData>::offset
|
||||
labelList& faces
|
||||
)
|
||||
{
|
||||
for (label faceI = 0; faceI < nFaces; faceI++)
|
||||
for (label facei = 0; facei < nFaces; facei++)
|
||||
{
|
||||
faces[faceI] += cycOffset;
|
||||
faces[facei] += cycOffset;
|
||||
}
|
||||
}
|
||||
|
||||
@ -509,10 +509,10 @@ void Foam::FaceCellWave<Type, TrackingData>::handleProcPatches()
|
||||
|
||||
forAll(procPatches, i)
|
||||
{
|
||||
label patchI = procPatches[i];
|
||||
label patchi = procPatches[i];
|
||||
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(mesh_.boundaryMesh()[patchI]);
|
||||
refCast<const processorPolyPatch>(mesh_.boundaryMesh()[patchi]);
|
||||
|
||||
// Allocate buffers
|
||||
label nSendFaces;
|
||||
@ -540,7 +540,7 @@ void Foam::FaceCellWave<Type, TrackingData>::handleProcPatches()
|
||||
|
||||
if (debug & 2)
|
||||
{
|
||||
Pout<< " Processor patch " << patchI << ' ' << procPatch.name()
|
||||
Pout<< " Processor patch " << patchi << ' ' << procPatch.name()
|
||||
<< " communicating with " << procPatch.neighbProcNo()
|
||||
<< " Sending:" << nSendFaces
|
||||
<< endl;
|
||||
@ -559,10 +559,10 @@ void Foam::FaceCellWave<Type, TrackingData>::handleProcPatches()
|
||||
|
||||
forAll(procPatches, i)
|
||||
{
|
||||
label patchI = procPatches[i];
|
||||
label patchi = procPatches[i];
|
||||
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(mesh_.boundaryMesh()[patchI]);
|
||||
refCast<const processorPolyPatch>(mesh_.boundaryMesh()[patchi]);
|
||||
|
||||
// Allocate buffers
|
||||
labelList receiveFaces;
|
||||
@ -575,7 +575,7 @@ void Foam::FaceCellWave<Type, TrackingData>::handleProcPatches()
|
||||
|
||||
if (debug & 2)
|
||||
{
|
||||
Pout<< " Processor patch " << patchI << ' ' << procPatch.name()
|
||||
Pout<< " Processor patch " << patchi << ' ' << procPatch.name()
|
||||
<< " communicating with " << procPatch.neighbProcNo()
|
||||
<< " Receiving:" << receiveFaces.size()
|
||||
<< endl;
|
||||
@ -617,9 +617,9 @@ void Foam::FaceCellWave<Type, TrackingData>::handleProcPatches()
|
||||
template<class Type, class TrackingData>
|
||||
void Foam::FaceCellWave<Type, TrackingData>::handleCyclicPatches()
|
||||
{
|
||||
forAll(mesh_.boundaryMesh(), patchI)
|
||||
forAll(mesh_.boundaryMesh(), patchi)
|
||||
{
|
||||
const polyPatch& patch = mesh_.boundaryMesh()[patchI];
|
||||
const polyPatch& patch = mesh_.boundaryMesh()[patchi];
|
||||
|
||||
if (isA<cyclicPolyPatch>(patch))
|
||||
{
|
||||
@ -666,7 +666,7 @@ void Foam::FaceCellWave<Type, TrackingData>::handleCyclicPatches()
|
||||
|
||||
if (debug & 2)
|
||||
{
|
||||
Pout<< " Cyclic patch " << patchI << ' ' << cycPatch.name()
|
||||
Pout<< " Cyclic patch " << patchi << ' ' << cycPatch.name()
|
||||
<< " Changed : " << nReceiveFaces
|
||||
<< endl;
|
||||
}
|
||||
@ -702,9 +702,9 @@ void Foam::FaceCellWave<Type, TrackingData>::handleCyclicPatches()
|
||||
template<class Type, class TrackingData>
|
||||
void Foam::FaceCellWave<Type, TrackingData>::handleAMICyclicPatches()
|
||||
{
|
||||
forAll(mesh_.boundaryMesh(), patchI)
|
||||
forAll(mesh_.boundaryMesh(), patchi)
|
||||
{
|
||||
const polyPatch& patch = mesh_.boundaryMesh()[patchI];
|
||||
const polyPatch& patch = mesh_.boundaryMesh()[patchi];
|
||||
|
||||
if (isA<cyclicAMIPolyPatch>(patch))
|
||||
{
|
||||
@ -951,30 +951,30 @@ Foam::label Foam::FaceCellWave<Type, TrackingData>::faceToCell()
|
||||
changedFaceI++
|
||||
)
|
||||
{
|
||||
label faceI = changedFaces_[changedFaceI];
|
||||
if (!changedFace_[faceI])
|
||||
label facei = changedFaces_[changedFaceI];
|
||||
if (!changedFace_[facei])
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Face " << faceI
|
||||
<< "Face " << facei
|
||||
<< " not marked as having been changed"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
|
||||
const Type& neighbourWallInfo = allFaceInfo_[faceI];
|
||||
const Type& neighbourWallInfo = allFaceInfo_[facei];
|
||||
|
||||
// Evaluate all connected cells
|
||||
|
||||
// Owner
|
||||
label cellI = owner[faceI];
|
||||
Type& currentWallInfo = allCellInfo_[cellI];
|
||||
label celli = owner[facei];
|
||||
Type& currentWallInfo = allCellInfo_[celli];
|
||||
|
||||
if (!currentWallInfo.equal(neighbourWallInfo, td_))
|
||||
{
|
||||
updateCell
|
||||
(
|
||||
cellI,
|
||||
faceI,
|
||||
celli,
|
||||
facei,
|
||||
neighbourWallInfo,
|
||||
propagationTol_,
|
||||
currentWallInfo
|
||||
@ -982,17 +982,17 @@ Foam::label Foam::FaceCellWave<Type, TrackingData>::faceToCell()
|
||||
}
|
||||
|
||||
// Neighbour.
|
||||
if (faceI < nInternalFaces)
|
||||
if (facei < nInternalFaces)
|
||||
{
|
||||
cellI = neighbour[faceI];
|
||||
Type& currentWallInfo2 = allCellInfo_[cellI];
|
||||
celli = neighbour[facei];
|
||||
Type& currentWallInfo2 = allCellInfo_[celli];
|
||||
|
||||
if (!currentWallInfo2.equal(neighbourWallInfo, td_))
|
||||
{
|
||||
updateCell
|
||||
(
|
||||
cellI,
|
||||
faceI,
|
||||
celli,
|
||||
facei,
|
||||
neighbourWallInfo,
|
||||
propagationTol_,
|
||||
currentWallInfo2
|
||||
@ -1001,7 +1001,7 @@ Foam::label Foam::FaceCellWave<Type, TrackingData>::faceToCell()
|
||||
}
|
||||
|
||||
// Reset status of face
|
||||
changedFace_[faceI] = false;
|
||||
changedFace_[facei] = false;
|
||||
}
|
||||
|
||||
// Handled all changed faces by now
|
||||
@ -1034,30 +1034,30 @@ Foam::label Foam::FaceCellWave<Type, TrackingData>::cellToFace()
|
||||
changedCellI++
|
||||
)
|
||||
{
|
||||
label cellI = changedCells_[changedCellI];
|
||||
if (!changedCell_[cellI])
|
||||
label celli = changedCells_[changedCellI];
|
||||
if (!changedCell_[celli])
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cell " << cellI << " not marked as having been changed"
|
||||
<< "Cell " << celli << " not marked as having been changed"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
const Type& neighbourWallInfo = allCellInfo_[cellI];
|
||||
const Type& neighbourWallInfo = allCellInfo_[celli];
|
||||
|
||||
// Evaluate all connected faces
|
||||
|
||||
const labelList& faceLabels = cells[cellI];
|
||||
const labelList& faceLabels = cells[celli];
|
||||
forAll(faceLabels, faceLabelI)
|
||||
{
|
||||
label faceI = faceLabels[faceLabelI];
|
||||
Type& currentWallInfo = allFaceInfo_[faceI];
|
||||
label facei = faceLabels[faceLabelI];
|
||||
Type& currentWallInfo = allFaceInfo_[facei];
|
||||
|
||||
if (!currentWallInfo.equal(neighbourWallInfo, td_))
|
||||
{
|
||||
updateFace
|
||||
(
|
||||
faceI,
|
||||
cellI,
|
||||
facei,
|
||||
celli,
|
||||
neighbourWallInfo,
|
||||
propagationTol_,
|
||||
currentWallInfo
|
||||
@ -1066,7 +1066,7 @@ Foam::label Foam::FaceCellWave<Type, TrackingData>::cellToFace()
|
||||
}
|
||||
|
||||
// Reset status of cell
|
||||
changedCell_[cellI] = false;
|
||||
changedCell_[celli] = false;
|
||||
}
|
||||
|
||||
// Handled all changed cells by now
|
||||
|
||||
Reference in New Issue
Block a user