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
|
||||
@ -56,20 +56,20 @@ void Foam::cuttingPlane::calcCutCells
|
||||
}
|
||||
|
||||
cutCells_.setSize(listSize);
|
||||
label cutcellI(0);
|
||||
label cutcelli(0);
|
||||
|
||||
// Find the cut cells by detecting any cell that uses points with
|
||||
// opposing dotProducts.
|
||||
for (label listI = 0; listI < listSize; ++listI)
|
||||
{
|
||||
label cellI = listI;
|
||||
label celli = listI;
|
||||
|
||||
if (notNull(cellIdLabels))
|
||||
{
|
||||
cellI = cellIdLabels[listI];
|
||||
celli = cellIdLabels[listI];
|
||||
}
|
||||
|
||||
const labelList& cEdges = cellEdges[cellI];
|
||||
const labelList& cEdges = cellEdges[celli];
|
||||
|
||||
label nCutEdges = 0;
|
||||
|
||||
@ -87,7 +87,7 @@ void Foam::cuttingPlane::calcCutCells
|
||||
|
||||
if (nCutEdges > 2)
|
||||
{
|
||||
cutCells_[cutcellI++] = cellI;
|
||||
cutCells_[cutcelli++] = celli;
|
||||
|
||||
break;
|
||||
}
|
||||
@ -96,7 +96,7 @@ void Foam::cuttingPlane::calcCutCells
|
||||
}
|
||||
|
||||
// Set correct list size
|
||||
cutCells_.setSize(cutcellI);
|
||||
cutCells_.setSize(cutcelli);
|
||||
}
|
||||
|
||||
|
||||
@ -161,12 +161,12 @@ bool Foam::cuttingPlane::walkCell
|
||||
(
|
||||
const primitiveMesh& mesh,
|
||||
const labelUList& edgePoint,
|
||||
const label cellI,
|
||||
const label celli,
|
||||
const label startEdgeI,
|
||||
DynamicList<label>& faceVerts
|
||||
)
|
||||
{
|
||||
label faceI = -1;
|
||||
label facei = -1;
|
||||
label edgeI = startEdgeI;
|
||||
|
||||
label nIter = 0;
|
||||
@ -177,10 +177,10 @@ bool Foam::cuttingPlane::walkCell
|
||||
faceVerts.append(edgePoint[edgeI]);
|
||||
|
||||
// Cross edge to other face
|
||||
faceI = meshTools::otherFace(mesh, cellI, faceI, edgeI);
|
||||
facei = meshTools::otherFace(mesh, celli, facei, edgeI);
|
||||
|
||||
// Find next cut edge on face.
|
||||
const labelList& fEdges = mesh.faceEdges()[faceI];
|
||||
const labelList& fEdges = mesh.faceEdges()[facei];
|
||||
|
||||
label nextEdgeI = -1;
|
||||
|
||||
@ -202,9 +202,9 @@ bool Foam::cuttingPlane::walkCell
|
||||
|
||||
if (nextEdgeI == -1)
|
||||
{
|
||||
// Did not find another cut edge on faceI. Do what?
|
||||
// Did not find another cut edge on facei. Do what?
|
||||
WarningInFunction
|
||||
<< "Did not find closed walk along surface of cell " << cellI
|
||||
<< "Did not find closed walk along surface of cell " << celli
|
||||
<< " starting from edge " << startEdgeI
|
||||
<< " in " << nIter << " iterations." << nl
|
||||
<< "Collected cutPoints so far:" << faceVerts
|
||||
@ -220,7 +220,7 @@ bool Foam::cuttingPlane::walkCell
|
||||
if (nIter > 1000)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Did not find closed walk along surface of cell " << cellI
|
||||
<< "Did not find closed walk along surface of cell " << celli
|
||||
<< " starting from edge " << startEdgeI
|
||||
<< " in " << nIter << " iterations." << nl
|
||||
<< "Collected cutPoints so far:" << faceVerts
|
||||
@ -238,7 +238,7 @@ bool Foam::cuttingPlane::walkCell
|
||||
else
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Did not find closed walk along surface of cell " << cellI
|
||||
<< "Did not find closed walk along surface of cell " << celli
|
||||
<< " starting from edge " << startEdgeI << nl
|
||||
<< "Collected cutPoints so far:" << faceVerts
|
||||
<< endl;
|
||||
@ -266,10 +266,10 @@ void Foam::cuttingPlane::walkCellCuts
|
||||
|
||||
forAll(cutCells_, i)
|
||||
{
|
||||
label cellI = cutCells_[i];
|
||||
label celli = cutCells_[i];
|
||||
|
||||
// Find the starting edge to walk from.
|
||||
const labelList& cEdges = mesh.cellEdges()[cellI];
|
||||
const labelList& cEdges = mesh.cellEdges()[celli];
|
||||
|
||||
label startEdgeI = -1;
|
||||
|
||||
@ -288,7 +288,7 @@ void Foam::cuttingPlane::walkCellCuts
|
||||
if (startEdgeI == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cannot find cut edge for cut cell " << cellI
|
||||
<< "Cannot find cut edge for cut cell " << celli
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
@ -297,7 +297,7 @@ void Foam::cuttingPlane::walkCellCuts
|
||||
(
|
||||
mesh,
|
||||
edgePoint,
|
||||
cellI,
|
||||
celli,
|
||||
startEdgeI,
|
||||
faceVerts
|
||||
);
|
||||
@ -318,13 +318,13 @@ void Foam::cuttingPlane::walkCellCuts
|
||||
label nTri = f.triangles(cutPoints, dynCutFaces);
|
||||
while (nTri--)
|
||||
{
|
||||
dynCutCells.append(cellI);
|
||||
dynCutCells.append(celli);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dynCutFaces.append(f);
|
||||
dynCutCells.append(cellI);
|
||||
dynCutCells.append(celli);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -397,9 +397,9 @@ void Foam::cuttingPlane::remapFaces
|
||||
MeshStorage::remapFaces(faceMap);
|
||||
|
||||
List<label> newCutCells(faceMap.size());
|
||||
forAll(faceMap, faceI)
|
||||
forAll(faceMap, facei)
|
||||
{
|
||||
newCutCells[faceI] = cutCells_[faceMap[faceI]];
|
||||
newCutCells[facei] = cutCells_[faceMap[facei]];
|
||||
}
|
||||
cutCells_.transfer(newCutCells);
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ class cuttingPlane
|
||||
(
|
||||
const primitiveMesh&,
|
||||
const labelUList& edgePoint,
|
||||
const label cellI,
|
||||
const label celli,
|
||||
const label startEdgeI,
|
||||
DynamicList<label>& faceVerts
|
||||
);
|
||||
|
||||
@ -252,18 +252,18 @@ void Foam::mapNearestMethod::setNextNearestCells
|
||||
srcCellI = -1;
|
||||
forAll(srcNbr, i)
|
||||
{
|
||||
label cellI = srcNbr[i];
|
||||
if (mapFlag[cellI])
|
||||
label celli = srcNbr[i];
|
||||
if (mapFlag[celli])
|
||||
{
|
||||
srcCellI = cellI;
|
||||
srcCellI = celli;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (label i = startSeedI; i < srcCellIDs.size(); i++)
|
||||
{
|
||||
label cellI = srcCellIDs[i];
|
||||
if (mapFlag[cellI])
|
||||
label celli = srcCellIDs[i];
|
||||
if (mapFlag[celli])
|
||||
{
|
||||
startSeedI = i;
|
||||
break;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -123,13 +123,13 @@ Foam::scalar Foam::meshToMeshMethod::interVol
|
||||
|
||||
void Foam::meshToMeshMethod::appendNbrCells
|
||||
(
|
||||
const label cellI,
|
||||
const label celli,
|
||||
const polyMesh& mesh,
|
||||
const DynamicList<label>& visitedCells,
|
||||
DynamicList<label>& nbrCellIDs
|
||||
) const
|
||||
{
|
||||
const labelList& nbrCells = mesh.cellCells()[cellI];
|
||||
const labelList& nbrCells = mesh.cellCells()[celli];
|
||||
|
||||
// filter out cells already visited from cell neighbours
|
||||
forAll(nbrCells, i)
|
||||
@ -237,10 +237,10 @@ void Foam::meshToMeshMethod::writeConnectivity
|
||||
const labelList& addr = mesh1ToMesh2Addr[i];
|
||||
forAll(addr, j)
|
||||
{
|
||||
label cellI = addr[j];
|
||||
label celli = addr[j];
|
||||
const vector& c0 = mesh1.cellCentres()[i];
|
||||
|
||||
const cell& c = mesh2.cells()[cellI];
|
||||
const cell& c = mesh2.cells()[celli];
|
||||
const pointField pts(c.points(mesh2.faces(), mesh2.points()));
|
||||
forAll(pts, j)
|
||||
{
|
||||
|
||||
@ -101,9 +101,9 @@ void Foam::meshToMesh::normaliseWeights
|
||||
|
||||
if (nCell > 0)
|
||||
{
|
||||
forAll(wght, cellI)
|
||||
forAll(wght, celli)
|
||||
{
|
||||
scalarList& w = wght[cellI];
|
||||
scalarList& w = wght[celli];
|
||||
scalar s = sum(w);
|
||||
|
||||
forAll(w, i)
|
||||
@ -434,9 +434,9 @@ void Foam::meshToMesh::constructNoCuttingPatches
|
||||
|
||||
DynamicList<label> srcPatchID(srcBM.size());
|
||||
DynamicList<label> tgtPatchID(tgtBM.size());
|
||||
forAll(srcBM, patchI)
|
||||
forAll(srcBM, patchi)
|
||||
{
|
||||
const polyPatch& pp = srcBM[patchI];
|
||||
const polyPatch& pp = srcBM[patchi];
|
||||
if (!polyPatch::constraintType(pp.type()))
|
||||
{
|
||||
srcPatchID.append(pp.index());
|
||||
|
||||
@ -167,15 +167,15 @@ Foam::autoPtr<Foam::mapDistribute> Foam::meshToMesh::calcProcMap
|
||||
|
||||
// work array - whether src processor bb overlaps the tgt cell bounds
|
||||
boolList procBbOverlaps(Pstream::nProcs());
|
||||
forAll(cells, cellI)
|
||||
forAll(cells, celli)
|
||||
{
|
||||
const cell& c = cells[cellI];
|
||||
const cell& c = cells[celli];
|
||||
|
||||
// determine bounding box of tgt cell
|
||||
boundBox cellBb(point::max, point::min);
|
||||
forAll(c, faceI)
|
||||
forAll(c, facei)
|
||||
{
|
||||
const face& f = faces[c[faceI]];
|
||||
const face& f = faces[c[facei]];
|
||||
forAll(f, fp)
|
||||
{
|
||||
cellBb.min() = min(cellBb.min(), points[f[fp]]);
|
||||
@ -190,7 +190,7 @@ Foam::autoPtr<Foam::mapDistribute> Foam::meshToMesh::calcProcMap
|
||||
{
|
||||
if (procBbOverlaps[procI])
|
||||
{
|
||||
dynSendMap[procI].append(cellI);
|
||||
dynSendMap[procI].append(celli);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -307,10 +307,10 @@ void Foam::meshToMesh::distributeCells
|
||||
label nInternal = 0;
|
||||
|
||||
// internal faces
|
||||
forAll(tgtMesh.faceNeighbour(), faceI)
|
||||
forAll(tgtMesh.faceNeighbour(), facei)
|
||||
{
|
||||
label own = tgtMesh.faceOwner()[faceI];
|
||||
label nbr = tgtMesh.faceNeighbour()[faceI];
|
||||
label own = tgtMesh.faceOwner()[facei];
|
||||
label nbr = tgtMesh.faceNeighbour()[facei];
|
||||
label subOwn = reverseCellMap[own];
|
||||
label subNbr = reverseCellMap[nbr];
|
||||
|
||||
@ -320,7 +320,7 @@ void Foam::meshToMesh::distributeCells
|
||||
|
||||
if (subOwn < subNbr)
|
||||
{
|
||||
subFaces.append(tgtMesh.faces()[faceI]);
|
||||
subFaces.append(tgtMesh.faces()[facei]);
|
||||
subFaceOwner.append(subOwn);
|
||||
subFaceNeighbour.append(subNbr);
|
||||
subNbrProcIDs.append(-1);
|
||||
@ -328,7 +328,7 @@ void Foam::meshToMesh::distributeCells
|
||||
}
|
||||
else
|
||||
{
|
||||
subFaces.append(tgtMesh.faces()[faceI].reverseFace());
|
||||
subFaces.append(tgtMesh.faces()[facei].reverseFace());
|
||||
subFaceOwner.append(subNbr);
|
||||
subFaceNeighbour.append(subOwn);
|
||||
subNbrProcIDs.append(-1);
|
||||
@ -338,16 +338,16 @@ void Foam::meshToMesh::distributeCells
|
||||
}
|
||||
|
||||
// boundary faces for new region
|
||||
forAll(tgtMesh.faceNeighbour(), faceI)
|
||||
forAll(tgtMesh.faceNeighbour(), facei)
|
||||
{
|
||||
label own = tgtMesh.faceOwner()[faceI];
|
||||
label nbr = tgtMesh.faceNeighbour()[faceI];
|
||||
label own = tgtMesh.faceOwner()[facei];
|
||||
label nbr = tgtMesh.faceNeighbour()[facei];
|
||||
label subOwn = reverseCellMap[own];
|
||||
label subNbr = reverseCellMap[nbr];
|
||||
|
||||
if (subOwn != -1 && subNbr == -1)
|
||||
{
|
||||
subFaces.append(tgtMesh.faces()[faceI]);
|
||||
subFaces.append(tgtMesh.faces()[facei]);
|
||||
subFaceOwner.append(subOwn);
|
||||
subFaceNeighbour.append(subNbr);
|
||||
subNbrProcIDs.append(-1);
|
||||
@ -355,7 +355,7 @@ void Foam::meshToMesh::distributeCells
|
||||
}
|
||||
else if (subOwn == -1 && subNbr != -1)
|
||||
{
|
||||
subFaces.append(tgtMesh.faces()[faceI].reverseFace());
|
||||
subFaces.append(tgtMesh.faces()[facei].reverseFace());
|
||||
subFaceOwner.append(subNbr);
|
||||
subFaceNeighbour.append(subOwn);
|
||||
subNbrProcIDs.append(-1);
|
||||
@ -364,9 +364,9 @@ void Foam::meshToMesh::distributeCells
|
||||
}
|
||||
|
||||
// boundary faces of existing region
|
||||
forAll(tgtMesh.boundaryMesh(), patchI)
|
||||
forAll(tgtMesh.boundaryMesh(), patchi)
|
||||
{
|
||||
const polyPatch& pp = tgtMesh.boundaryMesh()[patchI];
|
||||
const polyPatch& pp = tgtMesh.boundaryMesh()[patchi];
|
||||
|
||||
label nbrProcI = -1;
|
||||
|
||||
@ -381,12 +381,12 @@ void Foam::meshToMesh::distributeCells
|
||||
|
||||
forAll(pp, i)
|
||||
{
|
||||
label faceI = pp.start() + i;
|
||||
label own = tgtMesh.faceOwner()[faceI];
|
||||
label facei = pp.start() + i;
|
||||
label own = tgtMesh.faceOwner()[facei];
|
||||
|
||||
if (reverseCellMap[own] != -1)
|
||||
{
|
||||
subFaces.append(tgtMesh.faces()[faceI]);
|
||||
subFaces.append(tgtMesh.faces()[facei]);
|
||||
subFaceOwner.append(reverseCellMap[own]);
|
||||
subFaceNeighbour.append(-1);
|
||||
subNbrProcIDs.append(nbrProcI);
|
||||
|
||||
@ -104,40 +104,40 @@ void Foam::meshToMesh::mapSrcToTgt
|
||||
List<Type> work(srcField);
|
||||
map.distribute(work);
|
||||
|
||||
forAll(result, cellI)
|
||||
forAll(result, celli)
|
||||
{
|
||||
const labelList& srcAddress = tgtToSrcCellAddr_[cellI];
|
||||
const scalarList& srcWeight = tgtToSrcCellWght_[cellI];
|
||||
const labelList& srcAddress = tgtToSrcCellAddr_[celli];
|
||||
const scalarList& srcWeight = tgtToSrcCellWght_[celli];
|
||||
|
||||
if (srcAddress.size())
|
||||
{
|
||||
// result[cellI] = Zero;
|
||||
result[cellI] *= (1.0 - sum(srcWeight));
|
||||
// result[celli] = Zero;
|
||||
result[celli] *= (1.0 - sum(srcWeight));
|
||||
forAll(srcAddress, i)
|
||||
{
|
||||
label srcI = srcAddress[i];
|
||||
scalar w = srcWeight[i];
|
||||
cbop(result[cellI], cellI, work[srcI], w);
|
||||
cbop(result[celli], celli, work[srcI], w);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(result, cellI)
|
||||
forAll(result, celli)
|
||||
{
|
||||
const labelList& srcAddress = tgtToSrcCellAddr_[cellI];
|
||||
const scalarList& srcWeight = tgtToSrcCellWght_[cellI];
|
||||
const labelList& srcAddress = tgtToSrcCellAddr_[celli];
|
||||
const scalarList& srcWeight = tgtToSrcCellWght_[celli];
|
||||
|
||||
if (srcAddress.size())
|
||||
{
|
||||
// result[cellI] = Zero;
|
||||
result[cellI] *= (1.0 - sum(srcWeight));
|
||||
// result[celli] = Zero;
|
||||
result[celli] *= (1.0 - sum(srcWeight));
|
||||
forAll(srcAddress, i)
|
||||
{
|
||||
label srcI = srcAddress[i];
|
||||
scalar w = srcWeight[i];
|
||||
cbop(result[cellI], cellI, srcField[srcI], w);
|
||||
cbop(result[celli], celli, srcField[srcI], w);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -225,38 +225,38 @@ void Foam::meshToMesh::mapTgtToSrc
|
||||
List<Type> work(tgtField);
|
||||
map.distribute(work);
|
||||
|
||||
forAll(result, cellI)
|
||||
forAll(result, celli)
|
||||
{
|
||||
const labelList& tgtAddress = srcToTgtCellAddr_[cellI];
|
||||
const scalarList& tgtWeight = srcToTgtCellWght_[cellI];
|
||||
const labelList& tgtAddress = srcToTgtCellAddr_[celli];
|
||||
const scalarList& tgtWeight = srcToTgtCellWght_[celli];
|
||||
|
||||
if (tgtAddress.size())
|
||||
{
|
||||
result[cellI] *= (1.0 - sum(tgtWeight));
|
||||
result[celli] *= (1.0 - sum(tgtWeight));
|
||||
forAll(tgtAddress, i)
|
||||
{
|
||||
label tgtI = tgtAddress[i];
|
||||
scalar w = tgtWeight[i];
|
||||
cbop(result[cellI], cellI, work[tgtI], w);
|
||||
cbop(result[celli], celli, work[tgtI], w);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(result, cellI)
|
||||
forAll(result, celli)
|
||||
{
|
||||
const labelList& tgtAddress = srcToTgtCellAddr_[cellI];
|
||||
const scalarList& tgtWeight = srcToTgtCellWght_[cellI];
|
||||
const labelList& tgtAddress = srcToTgtCellAddr_[celli];
|
||||
const scalarList& tgtWeight = srcToTgtCellWght_[celli];
|
||||
|
||||
if (tgtAddress.size())
|
||||
{
|
||||
result[cellI] *= (1.0 - sum(tgtWeight));
|
||||
result[celli] *= (1.0 - sum(tgtWeight));
|
||||
forAll(tgtAddress, i)
|
||||
{
|
||||
label tgtI = tgtAddress[i];
|
||||
scalar w = tgtWeight[i];
|
||||
cbop(result[cellI], cellI, tgtField[tgtI], w);
|
||||
cbop(result[celli], celli, tgtField[tgtI], w);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,14 +70,14 @@ void Foam::meshToMesh0::calcAddressing()
|
||||
// set reference to boundary
|
||||
const polyPatchList& patchesFrom = fromMesh_.boundaryMesh();
|
||||
|
||||
forAll(patchesFrom, patchI)
|
||||
forAll(patchesFrom, patchi)
|
||||
{
|
||||
// get reference to cells next to the boundary
|
||||
const labelUList& bCells = patchesFrom[patchI].faceCells();
|
||||
const labelUList& bCells = patchesFrom[patchi].faceCells();
|
||||
|
||||
forAll(bCells, faceI)
|
||||
forAll(bCells, facei)
|
||||
{
|
||||
boundaryCell[bCells[faceI]] = true;
|
||||
boundaryCell[bCells[facei]] = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -385,19 +385,19 @@ Foam::meshToMesh0::interpolate
|
||||
boundaryAddressing_.size()
|
||||
);
|
||||
|
||||
forAll(boundaryAddressing_, patchI)
|
||||
forAll(boundaryAddressing_, patchi)
|
||||
{
|
||||
patchFields.set
|
||||
(
|
||||
patchI,
|
||||
patchi,
|
||||
fvPatchField<Type>::New
|
||||
(
|
||||
fromVf.boundaryField()[patchI],
|
||||
toMesh_.boundary()[patchI],
|
||||
fromVf.boundaryField()[patchi],
|
||||
toMesh_.boundary()[patchi],
|
||||
DimensionedField<Type, volMesh>::null(),
|
||||
patchFieldInterpolator
|
||||
(
|
||||
boundaryAddressing_[patchI]
|
||||
boundaryAddressing_[patchi]
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@ -45,9 +45,9 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
|
||||
|
||||
const polyBoundaryMesh& bm = mesh.boundaryMesh();
|
||||
|
||||
label patchI = bm.findPatchID(patchName_);
|
||||
label patchi = bm.findPatchID(patchName_);
|
||||
|
||||
if (patchI == -1)
|
||||
if (patchi == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< " Unknown patch name "
|
||||
@ -58,7 +58,7 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
|
||||
// All the info for nearest. Construct to miss
|
||||
List<mappedPatchBase::nearInfo> nearest(this->size());
|
||||
|
||||
const polyPatch& pp = bm[patchI];
|
||||
const polyPatch& pp = bm[patchi];
|
||||
|
||||
if (pp.size() > 0)
|
||||
{
|
||||
@ -110,9 +110,9 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
|
||||
);
|
||||
}
|
||||
|
||||
label faceI = boundaryTree.shapes().faceLabels()[info.index()];
|
||||
label facei = boundaryTree.shapes().faceLabels()[info.index()];
|
||||
|
||||
const label patchi = bm.whichPatch(faceI);
|
||||
const label patchi = bm.whichPatch(facei);
|
||||
|
||||
if (isA<emptyPolyPatch>(bm[patchi]))
|
||||
{
|
||||
@ -125,7 +125,7 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
|
||||
}
|
||||
else
|
||||
{
|
||||
const point& fc = mesh.faceCentres()[faceI];
|
||||
const point& fc = mesh.faceCentres()[facei];
|
||||
|
||||
mappedPatchBase::nearInfo sampleInfo;
|
||||
|
||||
@ -133,7 +133,7 @@ void Foam::patchProbes::findElements(const fvMesh& mesh)
|
||||
(
|
||||
true,
|
||||
fc,
|
||||
faceI
|
||||
facei
|
||||
);
|
||||
|
||||
sampleInfo.second().first() = magSqr(fc-sample);
|
||||
|
||||
@ -208,13 +208,13 @@ Foam::patchProbes::sample
|
||||
|
||||
forAll(*this, probeI)
|
||||
{
|
||||
label faceI = elementList_[probeI];
|
||||
label facei = elementList_[probeI];
|
||||
|
||||
if (faceI >= 0)
|
||||
if (facei >= 0)
|
||||
{
|
||||
label patchI = patches.whichPatch(faceI);
|
||||
label localFaceI = patches[patchI].whichFace(faceI);
|
||||
values[probeI] = vField.boundaryField()[patchI][localFaceI];
|
||||
label patchi = patches.whichPatch(facei);
|
||||
label localFaceI = patches[patchi].whichFace(facei);
|
||||
values[probeI] = vField.boundaryField()[patchi][localFaceI];
|
||||
}
|
||||
}
|
||||
|
||||
@ -259,13 +259,13 @@ Foam::patchProbes::sample
|
||||
|
||||
forAll(*this, probeI)
|
||||
{
|
||||
label faceI = elementList_[probeI];
|
||||
label facei = elementList_[probeI];
|
||||
|
||||
if (faceI >= 0)
|
||||
if (facei >= 0)
|
||||
{
|
||||
label patchI = patches.whichPatch(faceI);
|
||||
label localFaceI = patches[patchI].whichFace(faceI);
|
||||
values[probeI] = sField.boundaryField()[patchI][localFaceI];
|
||||
label patchi = patches.whichPatch(facei);
|
||||
label localFaceI = patches[patchi].whichFace(facei);
|
||||
values[probeI] = sField.boundaryField()[patchi][localFaceI];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -57,24 +57,24 @@ void Foam::probes::findElements(const fvMesh& mesh)
|
||||
{
|
||||
const vector& location = operator[](probeI);
|
||||
|
||||
const label cellI = mesh.findCell(location);
|
||||
const label celli = mesh.findCell(location);
|
||||
|
||||
elementList_[probeI] = cellI;
|
||||
elementList_[probeI] = celli;
|
||||
|
||||
if (cellI != -1)
|
||||
if (celli != -1)
|
||||
{
|
||||
const labelList& cellFaces = mesh.cells()[cellI];
|
||||
const vector& cellCentre = mesh.cellCentres()[cellI];
|
||||
const labelList& cellFaces = mesh.cells()[celli];
|
||||
const vector& cellCentre = mesh.cellCentres()[celli];
|
||||
scalar minDistance = GREAT;
|
||||
label minFaceID = -1;
|
||||
forAll(cellFaces, i)
|
||||
{
|
||||
label faceI = cellFaces[i];
|
||||
vector dist = mesh.faceCentres()[faceI] - cellCentre;
|
||||
label facei = cellFaces[i];
|
||||
vector dist = mesh.faceCentres()[facei] - cellCentre;
|
||||
if (mag(dist) < minDistance)
|
||||
{
|
||||
minDistance = mag(dist);
|
||||
minFaceID = faceI;
|
||||
minFaceID = facei;
|
||||
}
|
||||
}
|
||||
faceList_[probeI] = minFaceID;
|
||||
@ -97,14 +97,14 @@ void Foam::probes::findElements(const fvMesh& mesh)
|
||||
forAll(elementList_, probeI)
|
||||
{
|
||||
const vector& location = operator[](probeI);
|
||||
label cellI = elementList_[probeI];
|
||||
label faceI = faceList_[probeI];
|
||||
label celli = elementList_[probeI];
|
||||
label facei = faceList_[probeI];
|
||||
|
||||
// Check at least one processor with cell.
|
||||
reduce(cellI, maxOp<label>());
|
||||
reduce(faceI, maxOp<label>());
|
||||
reduce(celli, maxOp<label>());
|
||||
reduce(facei, maxOp<label>());
|
||||
|
||||
if (cellI == -1)
|
||||
if (celli == -1)
|
||||
{
|
||||
if (Pstream::master())
|
||||
{
|
||||
@ -113,7 +113,7 @@ void Foam::probes::findElements(const fvMesh& mesh)
|
||||
<< " in any cell. Skipping location." << endl;
|
||||
}
|
||||
}
|
||||
else if (faceI == -1)
|
||||
else if (facei == -1)
|
||||
{
|
||||
if (Pstream::master())
|
||||
{
|
||||
@ -125,28 +125,28 @@ void Foam::probes::findElements(const fvMesh& mesh)
|
||||
else
|
||||
{
|
||||
// Make sure location not on two domains.
|
||||
if (elementList_[probeI] != -1 && elementList_[probeI] != cellI)
|
||||
if (elementList_[probeI] != -1 && elementList_[probeI] != celli)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Location " << location
|
||||
<< " seems to be on multiple domains:"
|
||||
<< " cell " << elementList_[probeI]
|
||||
<< " on my domain " << Pstream::myProcNo()
|
||||
<< " and cell " << cellI << " on some other domain."
|
||||
<< " and cell " << celli << " on some other domain."
|
||||
<< endl
|
||||
<< "This might happen if the probe location is on"
|
||||
<< " a processor patch. Change the location slightly"
|
||||
<< " to prevent this." << endl;
|
||||
}
|
||||
|
||||
if (faceList_[probeI] != -1 && faceList_[probeI] != faceI)
|
||||
if (faceList_[probeI] != -1 && faceList_[probeI] != facei)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Location " << location
|
||||
<< " seems to be on multiple domains:"
|
||||
<< " cell " << faceList_[probeI]
|
||||
<< " on my domain " << Pstream::myProcNo()
|
||||
<< " and face " << faceI << " on some other domain."
|
||||
<< " and face " << facei << " on some other domain."
|
||||
<< endl
|
||||
<< "This might happen if the probe location is on"
|
||||
<< " a processor patch. Change the location slightly"
|
||||
@ -381,8 +381,8 @@ void Foam::probes::updateMesh(const mapPolyMesh& mpm)
|
||||
const labelList& reverseMap = mpm.reverseCellMap();
|
||||
forAll(elementList_, i)
|
||||
{
|
||||
label cellI = elementList_[i];
|
||||
label newCellI = reverseMap[cellI];
|
||||
label celli = elementList_[i];
|
||||
label newCellI = reverseMap[celli];
|
||||
if (newCellI == -1)
|
||||
{
|
||||
// cell removed
|
||||
@ -409,8 +409,8 @@ void Foam::probes::updateMesh(const mapPolyMesh& mpm)
|
||||
const labelList& reverseMap = mpm.reverseFaceMap();
|
||||
forAll(faceList_, i)
|
||||
{
|
||||
label faceI = faceList_[i];
|
||||
label newFaceI = reverseMap[faceI];
|
||||
label facei = faceList_[i];
|
||||
label newFaceI = reverseMap[facei];
|
||||
if (newFaceI == -1)
|
||||
{
|
||||
// face removed
|
||||
|
||||
@ -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
|
||||
@ -88,12 +88,12 @@ void Foam::arraySet::calcSamples
|
||||
|
||||
forAll(sampleCoords, sampleI)
|
||||
{
|
||||
label cellI = queryMesh.findCell(sampleCoords[sampleI]);
|
||||
label celli = queryMesh.findCell(sampleCoords[sampleI]);
|
||||
|
||||
if (cellI != -1)
|
||||
if (celli != -1)
|
||||
{
|
||||
samplingPts.append(sampleCoords[sampleI]);
|
||||
samplingCells.append(cellI);
|
||||
samplingCells.append(celli);
|
||||
samplingFaces.append(-1);
|
||||
samplingSegments.append(0);
|
||||
samplingCurveDist.append(1.0 * sampleI);
|
||||
|
||||
@ -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
|
||||
@ -65,11 +65,11 @@ void Foam::circleSet::calcSamples
|
||||
);
|
||||
|
||||
// set start point
|
||||
label cellI = searchEngine().findCell(startPoint_);
|
||||
if (cellI != -1)
|
||||
label celli = searchEngine().findCell(startPoint_);
|
||||
if (celli != -1)
|
||||
{
|
||||
samplingPts.append(startPoint_);
|
||||
samplingCells.append(cellI);
|
||||
samplingCells.append(celli);
|
||||
samplingFaces.append(-1);
|
||||
samplingSegments.append(0);
|
||||
samplingCurveDist.append(0.0);
|
||||
@ -110,12 +110,12 @@ void Foam::circleSet::calcSamples
|
||||
axis1 /= mag(axis1);
|
||||
point pt = origin_ + radius*axis1;
|
||||
|
||||
label cellI = searchEngine().findCell(pt);
|
||||
label celli = searchEngine().findCell(pt);
|
||||
|
||||
if (cellI != -1)
|
||||
if (celli != -1)
|
||||
{
|
||||
samplingPts.append(pt);
|
||||
samplingCells.append(cellI);
|
||||
samplingCells.append(celli);
|
||||
samplingFaces.append(-1);
|
||||
samplingSegments.append(nPoint);
|
||||
samplingCurveDist.append
|
||||
|
||||
@ -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
|
||||
@ -55,12 +55,12 @@ void Foam::cloudSet::calcSamples
|
||||
|
||||
forAll(sampleCoords_, sampleI)
|
||||
{
|
||||
label cellI = queryMesh.findCell(sampleCoords_[sampleI]);
|
||||
label celli = queryMesh.findCell(sampleCoords_[sampleI]);
|
||||
|
||||
if (cellI != -1)
|
||||
if (celli != -1)
|
||||
{
|
||||
samplingPts.append(sampleCoords_[sampleI]);
|
||||
samplingCells.append(cellI);
|
||||
samplingCells.append(celli);
|
||||
samplingFaces.append(-1);
|
||||
samplingSegments.append(0);
|
||||
samplingCurveDist.append(1.0 * sampleI);
|
||||
|
||||
@ -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
|
||||
@ -201,11 +201,11 @@ void Foam::patchCloudSet::calcSamples
|
||||
{
|
||||
if (nearest[sampleI].second().second() == Pstream::myProcNo())
|
||||
{
|
||||
label faceI = nearInfo.index();
|
||||
label facei = nearInfo.index();
|
||||
|
||||
samplingPts.append(nearInfo.hitPoint());
|
||||
samplingCells.append(mesh().faceOwner()[faceI]);
|
||||
samplingFaces.append(faceI);
|
||||
samplingCells.append(mesh().faceOwner()[facei]);
|
||||
samplingFaces.append(facei);
|
||||
samplingSegments.append(0);
|
||||
samplingCurveDist.append(1.0 * sampleI);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -134,19 +134,19 @@ void Foam::patchSeedSet::calcSamples
|
||||
|
||||
forAll(patchFaces, i)
|
||||
{
|
||||
label faceI = patchFaces[i];
|
||||
label facei = patchFaces[i];
|
||||
pointIndexHit info = mappedPatchBase::facePoint
|
||||
(
|
||||
mesh(),
|
||||
faceI,
|
||||
facei,
|
||||
polyMesh::FACE_DIAG_TRIS
|
||||
);
|
||||
label cellI = mesh().faceOwner()[faceI];
|
||||
label celli = mesh().faceOwner()[facei];
|
||||
|
||||
if (info.hit())
|
||||
{
|
||||
// Move the point into the cell
|
||||
const point& cc = mesh().cellCentres()[cellI];
|
||||
const point& cc = mesh().cellCentres()[celli];
|
||||
samplingPts.append
|
||||
(
|
||||
info.hitPoint() + 1e-1*(cc-info.hitPoint())
|
||||
@ -156,8 +156,8 @@ void Foam::patchSeedSet::calcSamples
|
||||
{
|
||||
samplingPts.append(info.rawPoint());
|
||||
}
|
||||
samplingCells.append(cellI);
|
||||
samplingFaces.append(faceI);
|
||||
samplingCells.append(celli);
|
||||
samplingFaces.append(facei);
|
||||
samplingSegments.append(0);
|
||||
samplingCurveDist.append(globalSampleNumbers.toGlobal(i));
|
||||
}
|
||||
|
||||
@ -41,21 +41,21 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::sampledSet::getBoundaryCell(const label faceI) const
|
||||
Foam::label Foam::sampledSet::getBoundaryCell(const label facei) const
|
||||
{
|
||||
return mesh().faceOwner()[faceI];
|
||||
return mesh().faceOwner()[facei];
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::sampledSet::getNeighbourCell(const label faceI) const
|
||||
Foam::label Foam::sampledSet::getNeighbourCell(const label facei) const
|
||||
{
|
||||
if (faceI >= mesh().nInternalFaces())
|
||||
if (facei >= mesh().nInternalFaces())
|
||||
{
|
||||
return mesh().faceOwner()[faceI];
|
||||
return mesh().faceOwner()[facei];
|
||||
}
|
||||
else
|
||||
{
|
||||
return mesh().faceNeighbour()[faceI];
|
||||
return mesh().faceNeighbour()[facei];
|
||||
}
|
||||
}
|
||||
|
||||
@ -134,11 +134,11 @@ Foam::label Foam::sampledSet::pointInCell
|
||||
|
||||
Foam::scalar Foam::sampledSet::calcSign
|
||||
(
|
||||
const label faceI,
|
||||
const label facei,
|
||||
const point& sample
|
||||
) const
|
||||
{
|
||||
vector vec = sample - mesh().faceCentres()[faceI];
|
||||
vector vec = sample - mesh().faceCentres()[facei];
|
||||
|
||||
scalar magVec = mag(vec);
|
||||
|
||||
@ -150,7 +150,7 @@ Foam::scalar Foam::sampledSet::calcSign
|
||||
|
||||
vec /= magVec;
|
||||
|
||||
vector n = mesh().faceAreas()[faceI];
|
||||
vector n = mesh().faceAreas()[facei];
|
||||
|
||||
n /= mag(n) + VSMALL;
|
||||
|
||||
@ -160,12 +160,12 @@ Foam::scalar Foam::sampledSet::calcSign
|
||||
|
||||
Foam::label Foam::sampledSet::findNearFace
|
||||
(
|
||||
const label cellI,
|
||||
const label celli,
|
||||
const point& sample,
|
||||
const scalar smallDist
|
||||
) const
|
||||
{
|
||||
const cell& myFaces = mesh().cells()[cellI];
|
||||
const cell& myFaces = mesh().cells()[celli];
|
||||
|
||||
forAll(myFaces, myFaceI)
|
||||
{
|
||||
@ -196,18 +196,18 @@ Foam::label Foam::sampledSet::findNearFace
|
||||
Foam::point Foam::sampledSet::pushIn
|
||||
(
|
||||
const point& facePt,
|
||||
const label faceI
|
||||
const label facei
|
||||
) const
|
||||
{
|
||||
label cellI = mesh().faceOwner()[faceI];
|
||||
const point& cC = mesh().cellCentres()[cellI];
|
||||
label celli = mesh().faceOwner()[facei];
|
||||
const point& cC = mesh().cellCentres()[celli];
|
||||
|
||||
point newPosition = facePt;
|
||||
|
||||
// Taken from particle::initCellFacePt()
|
||||
label tetFaceI;
|
||||
label tetPtI;
|
||||
mesh().findTetFacePt(cellI, facePt, tetFaceI, tetPtI);
|
||||
mesh().findTetFacePt(celli, facePt, tetFaceI, tetPtI);
|
||||
|
||||
if (tetFaceI == -1 || tetPtI == -1)
|
||||
{
|
||||
@ -223,7 +223,7 @@ Foam::point Foam::sampledSet::pushIn
|
||||
|
||||
mesh().findTetFacePt
|
||||
(
|
||||
cellI,
|
||||
celli,
|
||||
newPosition,
|
||||
tetFaceI,
|
||||
tetPtI
|
||||
@ -238,9 +238,9 @@ Foam::point Foam::sampledSet::pushIn
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "After pushing " << facePt << " to " << newPosition
|
||||
<< " it is still outside face " << faceI
|
||||
<< " at " << mesh().faceCentres()[faceI]
|
||||
<< " of cell " << cellI
|
||||
<< " it is still outside face " << facei
|
||||
<< " at " << mesh().faceCentres()[facei]
|
||||
<< " of cell " << celli
|
||||
<< " at " << cC << endl
|
||||
<< "Please change your starting point"
|
||||
<< abort(FatalError);
|
||||
@ -478,7 +478,7 @@ Foam::Ostream& Foam::sampledSet::write(Ostream& os) const
|
||||
{
|
||||
coordSet::write(os);
|
||||
|
||||
os << endl << "\t(cellI)\t(faceI)" << endl;
|
||||
os << endl << "\t(celli)\t(facei)" << endl;
|
||||
|
||||
forAll(*this, sampleI)
|
||||
{
|
||||
|
||||
@ -101,21 +101,21 @@ protected:
|
||||
|
||||
//- Calculates inproduct of face normal and vector sample-face centre
|
||||
// <0 if sample inside.
|
||||
scalar calcSign(const label faceI, const point& sample) const;
|
||||
scalar calcSign(const label facei, const point& sample) const;
|
||||
|
||||
//- Returns face label (or -1) of face which is close to sample
|
||||
label findNearFace
|
||||
(
|
||||
const label cellI,
|
||||
const label celli,
|
||||
const point& sample,
|
||||
const scalar smallDist
|
||||
) const;
|
||||
|
||||
//- Moves sample in direction of -n to it is 'inside' of faceI
|
||||
//- Moves sample in direction of -n to it is 'inside' of facei
|
||||
point pushIn
|
||||
(
|
||||
const point& sample,
|
||||
const label faceI
|
||||
const label facei
|
||||
) const;
|
||||
|
||||
//- Calculates start of tracking given samplePt and first boundary
|
||||
|
||||
@ -54,10 +54,10 @@ Foam::sampledSets::volFieldSampler<Type>::volFieldSampler
|
||||
forAll(samples, sampleI)
|
||||
{
|
||||
const point& samplePt = samples[sampleI];
|
||||
label cellI = samples.cells()[sampleI];
|
||||
label faceI = samples.faces()[sampleI];
|
||||
label celli = samples.cells()[sampleI];
|
||||
label facei = samples.faces()[sampleI];
|
||||
|
||||
if (cellI == -1 && faceI == -1)
|
||||
if (celli == -1 && facei == -1)
|
||||
{
|
||||
// Special condition for illegal sampling points
|
||||
values[sampleI] = pTraits<Type>::max;
|
||||
@ -67,8 +67,8 @@ Foam::sampledSets::volFieldSampler<Type>::volFieldSampler
|
||||
values[sampleI] = interpolator().interpolate
|
||||
(
|
||||
samplePt,
|
||||
cellI,
|
||||
faceI
|
||||
celli,
|
||||
facei
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -94,15 +94,15 @@ Foam::sampledSets::volFieldSampler<Type>::volFieldSampler
|
||||
values.setSize(samples.size());
|
||||
forAll(samples, sampleI)
|
||||
{
|
||||
label cellI = samples.cells()[sampleI];
|
||||
label celli = samples.cells()[sampleI];
|
||||
|
||||
if (cellI ==-1)
|
||||
if (celli ==-1)
|
||||
{
|
||||
values[sampleI] = pTraits<Type>::max;
|
||||
}
|
||||
else
|
||||
{
|
||||
values[sampleI] = field[cellI];
|
||||
values[sampleI] = field[celli];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,12 +53,12 @@ void Foam::triSurfaceMeshPointSet::calcSamples
|
||||
{
|
||||
forAll(sampleCoords_, sampleI)
|
||||
{
|
||||
label cellI = searchEngine().findCell(sampleCoords_[sampleI]);
|
||||
label celli = searchEngine().findCell(sampleCoords_[sampleI]);
|
||||
|
||||
if (cellI != -1)
|
||||
if (celli != -1)
|
||||
{
|
||||
samplingPts.append(sampleCoords_[sampleI]);
|
||||
samplingCells.append(cellI);
|
||||
samplingCells.append(celli);
|
||||
samplingFaces.append(-1);
|
||||
samplingSegments.append(0);
|
||||
samplingCurveDist.append(1.0 * sampleI);
|
||||
|
||||
@ -116,17 +116,17 @@ void Foam::isoSurface::syncUnseparatedPoints
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
// Send
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
if
|
||||
(
|
||||
isA<processorPolyPatch>(patches[patchI])
|
||||
&& patches[patchI].nPoints() > 0
|
||||
&& collocatedPatch(patches[patchI])
|
||||
isA<processorPolyPatch>(patches[patchi])
|
||||
&& patches[patchi].nPoints() > 0
|
||||
&& collocatedPatch(patches[patchi])
|
||||
)
|
||||
{
|
||||
const processorPolyPatch& pp =
|
||||
refCast<const processorPolyPatch>(patches[patchI]);
|
||||
refCast<const processorPolyPatch>(patches[patchi]);
|
||||
|
||||
const labelList& meshPts = pp.meshPoints();
|
||||
const labelList& nbrPts = pp.neighbPoints();
|
||||
@ -146,17 +146,17 @@ void Foam::isoSurface::syncUnseparatedPoints
|
||||
|
||||
// Receive and combine.
|
||||
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
if
|
||||
(
|
||||
isA<processorPolyPatch>(patches[patchI])
|
||||
&& patches[patchI].nPoints() > 0
|
||||
&& collocatedPatch(patches[patchI])
|
||||
isA<processorPolyPatch>(patches[patchi])
|
||||
&& patches[patchi].nPoints() > 0
|
||||
&& collocatedPatch(patches[patchi])
|
||||
)
|
||||
{
|
||||
const processorPolyPatch& pp =
|
||||
refCast<const processorPolyPatch>(patches[patchI]);
|
||||
refCast<const processorPolyPatch>(patches[patchi]);
|
||||
|
||||
pointField nbrPatchInfo(pp.nPoints());
|
||||
{
|
||||
@ -182,12 +182,12 @@ void Foam::isoSurface::syncUnseparatedPoints
|
||||
}
|
||||
|
||||
// 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() && collocatedPatch(cycPatch))
|
||||
{
|
||||
@ -300,8 +300,8 @@ void Foam::isoSurface::getNeighbour
|
||||
const labelList& boundaryRegion,
|
||||
const volVectorField& meshC,
|
||||
const volScalarField& cVals,
|
||||
const label cellI,
|
||||
const label faceI,
|
||||
const label celli,
|
||||
const label facei,
|
||||
scalar& nbrValue,
|
||||
point& nbrPoint
|
||||
) const
|
||||
@ -309,21 +309,21 @@ void Foam::isoSurface::getNeighbour
|
||||
const labelList& own = mesh_.faceOwner();
|
||||
const labelList& nei = mesh_.faceNeighbour();
|
||||
|
||||
if (mesh_.isInternalFace(faceI))
|
||||
if (mesh_.isInternalFace(facei))
|
||||
{
|
||||
label nbr = (own[faceI] == cellI ? nei[faceI] : own[faceI]);
|
||||
label nbr = (own[facei] == celli ? nei[facei] : own[facei]);
|
||||
nbrValue = cVals[nbr];
|
||||
nbrPoint = meshC[nbr];
|
||||
}
|
||||
else
|
||||
{
|
||||
label bFaceI = faceI-mesh_.nInternalFaces();
|
||||
label patchI = boundaryRegion[bFaceI];
|
||||
const polyPatch& pp = mesh_.boundaryMesh()[patchI];
|
||||
label patchFaceI = faceI-pp.start();
|
||||
label bFaceI = facei-mesh_.nInternalFaces();
|
||||
label patchi = boundaryRegion[bFaceI];
|
||||
const polyPatch& pp = mesh_.boundaryMesh()[patchi];
|
||||
label patchFaceI = facei-pp.start();
|
||||
|
||||
nbrValue = cVals.boundaryField()[patchI][patchFaceI];
|
||||
nbrPoint = meshC.boundaryField()[patchI][patchFaceI];
|
||||
nbrValue = cVals.boundaryField()[patchi][patchFaceI];
|
||||
nbrPoint = meshC.boundaryField()[patchi][patchFaceI];
|
||||
}
|
||||
}
|
||||
|
||||
@ -343,10 +343,10 @@ void Foam::isoSurface::calcCutTypes
|
||||
faceCutType_.setSize(mesh_.nFaces());
|
||||
faceCutType_ = NOTCUT;
|
||||
|
||||
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
||||
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
|
||||
{
|
||||
// CC edge.
|
||||
bool ownLower = (cVals[own[faceI]] < iso_);
|
||||
bool ownLower = (cVals[own[facei]] < iso_);
|
||||
|
||||
scalar nbrValue;
|
||||
point nbrPoint;
|
||||
@ -355,8 +355,8 @@ void Foam::isoSurface::calcCutTypes
|
||||
boundaryRegion,
|
||||
meshC,
|
||||
cVals,
|
||||
own[faceI],
|
||||
faceI,
|
||||
own[facei],
|
||||
facei,
|
||||
nbrValue,
|
||||
nbrPoint
|
||||
);
|
||||
@ -365,30 +365,30 @@ void Foam::isoSurface::calcCutTypes
|
||||
|
||||
if (ownLower != neiLower)
|
||||
{
|
||||
faceCutType_[faceI] = CUT;
|
||||
faceCutType_[facei] = CUT;
|
||||
}
|
||||
else
|
||||
{
|
||||
// See if any mesh edge is cut by looping over all the edges of the
|
||||
// face.
|
||||
const face f = mesh_.faces()[faceI];
|
||||
const face f = mesh_.faces()[facei];
|
||||
|
||||
if (isEdgeOfFaceCut(pVals, f, ownLower, neiLower))
|
||||
{
|
||||
faceCutType_[faceI] = CUT;
|
||||
faceCutType_[facei] = CUT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
label faceI = pp.start();
|
||||
label facei = pp.start();
|
||||
|
||||
forAll(pp, i)
|
||||
{
|
||||
bool ownLower = (cVals[own[faceI]] < iso_);
|
||||
bool ownLower = (cVals[own[facei]] < iso_);
|
||||
|
||||
scalar nbrValue;
|
||||
point nbrPoint;
|
||||
@ -397,8 +397,8 @@ void Foam::isoSurface::calcCutTypes
|
||||
boundaryRegion,
|
||||
meshC,
|
||||
cVals,
|
||||
own[faceI],
|
||||
faceI,
|
||||
own[facei],
|
||||
facei,
|
||||
nbrValue,
|
||||
nbrPoint
|
||||
);
|
||||
@ -407,20 +407,20 @@ void Foam::isoSurface::calcCutTypes
|
||||
|
||||
if (ownLower != neiLower)
|
||||
{
|
||||
faceCutType_[faceI] = CUT;
|
||||
faceCutType_[facei] = CUT;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Mesh edge.
|
||||
const face f = mesh_.faces()[faceI];
|
||||
const face f = mesh_.faces()[facei];
|
||||
|
||||
if (isEdgeOfFaceCut(pVals, f, ownLower, neiLower))
|
||||
{
|
||||
faceCutType_[faceI] = CUT;
|
||||
faceCutType_[facei] = CUT;
|
||||
}
|
||||
}
|
||||
|
||||
faceI++;
|
||||
facei++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -430,29 +430,29 @@ void Foam::isoSurface::calcCutTypes
|
||||
cellCutType_.setSize(mesh_.nCells());
|
||||
cellCutType_ = NOTCUT;
|
||||
|
||||
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
||||
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
|
||||
{
|
||||
if (faceCutType_[faceI] != NOTCUT)
|
||||
if (faceCutType_[facei] != NOTCUT)
|
||||
{
|
||||
if (cellCutType_[own[faceI]] == NOTCUT)
|
||||
if (cellCutType_[own[facei]] == NOTCUT)
|
||||
{
|
||||
cellCutType_[own[faceI]] = CUT;
|
||||
cellCutType_[own[facei]] = CUT;
|
||||
nCutCells_++;
|
||||
}
|
||||
if (cellCutType_[nei[faceI]] == NOTCUT)
|
||||
if (cellCutType_[nei[facei]] == NOTCUT)
|
||||
{
|
||||
cellCutType_[nei[faceI]] = CUT;
|
||||
cellCutType_[nei[facei]] = CUT;
|
||||
nCutCells_++;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (label faceI = mesh_.nInternalFaces(); faceI < mesh_.nFaces(); faceI++)
|
||||
for (label facei = mesh_.nInternalFaces(); facei < mesh_.nFaces(); facei++)
|
||||
{
|
||||
if (faceCutType_[faceI] != NOTCUT)
|
||||
if (faceCutType_[facei] != NOTCUT)
|
||||
{
|
||||
if (cellCutType_[own[faceI]] == NOTCUT)
|
||||
if (cellCutType_[own[facei]] == NOTCUT)
|
||||
{
|
||||
cellCutType_[own[faceI]] = CUT;
|
||||
cellCutType_[own[facei]] = CUT;
|
||||
nCutCells_++;
|
||||
}
|
||||
}
|
||||
@ -500,13 +500,13 @@ void Foam::isoSurface::calcSnappedCc
|
||||
// Work arrays
|
||||
DynamicList<point, 64> localTriPoints(64);
|
||||
|
||||
forAll(mesh_.cells(), cellI)
|
||||
forAll(mesh_.cells(), celli)
|
||||
{
|
||||
if (cellCutType_[cellI] == CUT)
|
||||
if (cellCutType_[celli] == CUT)
|
||||
{
|
||||
scalar cVal = cVals[cellI];
|
||||
scalar cVal = cVals[celli];
|
||||
|
||||
const cell& cFaces = mesh_.cells()[cellI];
|
||||
const cell& cFaces = mesh_.cells()[celli];
|
||||
|
||||
localTriPoints.clear();
|
||||
label nOther = 0;
|
||||
@ -517,7 +517,7 @@ void Foam::isoSurface::calcSnappedCc
|
||||
|
||||
forAll(cFaces, cFaceI)
|
||||
{
|
||||
label faceI = cFaces[cFaceI];
|
||||
label facei = cFaces[cFaceI];
|
||||
|
||||
scalar nbrValue;
|
||||
point nbrPoint;
|
||||
@ -526,8 +526,8 @@ void Foam::isoSurface::calcSnappedCc
|
||||
boundaryRegion,
|
||||
meshC,
|
||||
cVals,
|
||||
cellI,
|
||||
faceI,
|
||||
celli,
|
||||
facei,
|
||||
nbrValue,
|
||||
nbrPoint
|
||||
);
|
||||
@ -538,7 +538,7 @@ void Foam::isoSurface::calcSnappedCc
|
||||
|
||||
// From cc to neighbour cc.
|
||||
s[2] = isoFraction(cVal, nbrValue);
|
||||
pt[2] = (1.0-s[2])*cc[cellI] + s[2]*nbrPoint;
|
||||
pt[2] = (1.0-s[2])*cc[celli] + s[2]*nbrPoint;
|
||||
|
||||
const face& f = mesh_.faces()[cFaces[cFaceI]];
|
||||
|
||||
@ -547,12 +547,12 @@ void Foam::isoSurface::calcSnappedCc
|
||||
// From cc to fp
|
||||
label p0 = f[fp];
|
||||
s[0] = isoFraction(cVal, pVals[p0]);
|
||||
pt[0] = (1.0-s[0])*cc[cellI] + s[0]*pts[p0];
|
||||
pt[0] = (1.0-s[0])*cc[celli] + s[0]*pts[p0];
|
||||
|
||||
// From cc to fp+1
|
||||
label p1 = f[f.fcIndex(fp)];
|
||||
s[1] = isoFraction(cVal, pVals[p1]);
|
||||
pt[1] = (1.0-s[1])*cc[cellI] + s[1]*pts[p1];
|
||||
pt[1] = (1.0-s[1])*cc[celli] + s[1]*pts[p1];
|
||||
|
||||
if
|
||||
(
|
||||
@ -586,7 +586,7 @@ void Foam::isoSurface::calcSnappedCc
|
||||
// points.
|
||||
if (nOther > 0)
|
||||
{
|
||||
snappedCc[cellI] = snappedPoints.size();
|
||||
snappedCc[celli] = snappedPoints.size();
|
||||
snappedPoints.append(otherPointSum/nOther);
|
||||
|
||||
//Pout<< " point:" << pointI
|
||||
@ -599,7 +599,7 @@ void Foam::isoSurface::calcSnappedCc
|
||||
// Single triangle. No need for any analysis. Average points.
|
||||
pointField points;
|
||||
points.transfer(localTriPoints);
|
||||
snappedCc[cellI] = snappedPoints.size();
|
||||
snappedCc[celli] = snappedPoints.size();
|
||||
snappedPoints.append(sum(points)/points.size());
|
||||
|
||||
//Pout<< " point:" << pointI
|
||||
@ -633,7 +633,7 @@ void Foam::isoSurface::calcSnappedCc
|
||||
|
||||
if (nZones == 1)
|
||||
{
|
||||
snappedCc[cellI] = snappedPoints.size();
|
||||
snappedCc[celli] = snappedPoints.size();
|
||||
snappedPoints.append(calcCentre(surf));
|
||||
//Pout<< " point:" << pointI << " nZones:" << nZones
|
||||
// << " replacing coord:" << mesh_.points()[pointI]
|
||||
@ -679,9 +679,9 @@ void Foam::isoSurface::calcSnappedPoint
|
||||
|
||||
forAll(pFaces, i)
|
||||
{
|
||||
label faceI = pFaces[i];
|
||||
label facei = pFaces[i];
|
||||
|
||||
if (faceCutType_[faceI] == CUT)
|
||||
if (faceCutType_[facei] == CUT)
|
||||
{
|
||||
anyCut = true;
|
||||
break;
|
||||
@ -703,9 +703,9 @@ void Foam::isoSurface::calcSnappedPoint
|
||||
// Create points for all intersections close to point
|
||||
// (i.e. from pyramid edges)
|
||||
|
||||
label faceI = pFaces[pFaceI];
|
||||
const face& f = mesh_.faces()[faceI];
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label facei = pFaces[pFaceI];
|
||||
const face& f = mesh_.faces()[facei];
|
||||
label own = mesh_.faceOwner()[facei];
|
||||
|
||||
// Get neighbour value
|
||||
scalar nbrValue;
|
||||
@ -716,7 +716,7 @@ void Foam::isoSurface::calcSnappedPoint
|
||||
meshC,
|
||||
cVals,
|
||||
own,
|
||||
faceI,
|
||||
facei,
|
||||
nbrValue,
|
||||
nbrPoint
|
||||
);
|
||||
@ -982,16 +982,16 @@ Foam::triSurface Foam::isoSurface::stitchTriPoints
|
||||
{
|
||||
triSurface surf(tris, geometricSurfacePatchList(0), newPoints);
|
||||
|
||||
forAll(surf, faceI)
|
||||
forAll(surf, facei)
|
||||
{
|
||||
const labelledTri& f = surf[faceI];
|
||||
const labelList& fFaces = surf.faceFaces()[faceI];
|
||||
const labelledTri& f = surf[facei];
|
||||
const labelList& fFaces = surf.faceFaces()[facei];
|
||||
|
||||
forAll(fFaces, i)
|
||||
{
|
||||
label nbrFaceI = fFaces[i];
|
||||
|
||||
if (nbrFaceI <= faceI)
|
||||
if (nbrFaceI <= facei)
|
||||
{
|
||||
// lower numbered faces already checked
|
||||
continue;
|
||||
@ -1003,7 +1003,7 @@ Foam::triSurface Foam::isoSurface::stitchTriPoints
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Check : "
|
||||
<< " triangle " << faceI << " vertices " << f
|
||||
<< " triangle " << facei << " vertices " << f
|
||||
<< " fc:" << f.centre(surf.points())
|
||||
<< " has the same vertices as triangle " << nbrFaceI
|
||||
<< " vertices " << nbrF
|
||||
@ -1019,11 +1019,11 @@ Foam::triSurface Foam::isoSurface::stitchTriPoints
|
||||
}
|
||||
|
||||
|
||||
bool Foam::isoSurface::validTri(const triSurface& surf, const label faceI)
|
||||
bool Foam::isoSurface::validTri(const triSurface& surf, const label facei)
|
||||
{
|
||||
// Simple check on indices ok.
|
||||
|
||||
const labelledTri& f = surf[faceI];
|
||||
const labelledTri& f = surf[facei];
|
||||
|
||||
if
|
||||
(
|
||||
@ -1033,7 +1033,7 @@ bool Foam::isoSurface::validTri(const triSurface& surf, const label faceI)
|
||||
)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "triangle " << faceI << " vertices " << f
|
||||
<< "triangle " << facei << " vertices " << f
|
||||
<< " uses point indices outside point range 0.."
|
||||
<< surf.points().size()-1 << endl;
|
||||
|
||||
@ -1043,7 +1043,7 @@ bool Foam::isoSurface::validTri(const triSurface& surf, const label faceI)
|
||||
if ((f[0] == f[1]) || (f[0] == f[2]) || (f[1] == f[2]))
|
||||
{
|
||||
WarningInFunction
|
||||
<< "triangle " << faceI
|
||||
<< "triangle " << facei
|
||||
<< " uses non-unique vertices " << f
|
||||
<< endl;
|
||||
return false;
|
||||
@ -1051,7 +1051,7 @@ bool Foam::isoSurface::validTri(const triSurface& surf, const label faceI)
|
||||
|
||||
// duplicate triangle check
|
||||
|
||||
const labelList& fFaces = surf.faceFaces()[faceI];
|
||||
const labelList& fFaces = surf.faceFaces()[facei];
|
||||
|
||||
// Check if faceNeighbours use same points as this face.
|
||||
// Note: discards normal information - sides of baffle are merged.
|
||||
@ -1059,7 +1059,7 @@ bool Foam::isoSurface::validTri(const triSurface& surf, const label faceI)
|
||||
{
|
||||
label nbrFaceI = fFaces[i];
|
||||
|
||||
if (nbrFaceI <= faceI)
|
||||
if (nbrFaceI <= facei)
|
||||
{
|
||||
// lower numbered faces already checked
|
||||
continue;
|
||||
@ -1075,7 +1075,7 @@ bool Foam::isoSurface::validTri(const triSurface& surf, const label faceI)
|
||||
)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "triangle " << faceI << " vertices " << f
|
||||
<< "triangle " << facei << " vertices " << f
|
||||
<< " fc:" << f.centre(surf.points())
|
||||
<< " has the same vertices as triangle " << nbrFaceI
|
||||
<< " vertices " << nbrF
|
||||
@ -1227,16 +1227,16 @@ Foam::isoSurface::isoSurface
|
||||
mesh_.cellCentres(),
|
||||
mesh_.faceCentres()
|
||||
);
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
// Adapt separated coupled (proc and cyclic) patches
|
||||
if (pp.coupled())
|
||||
{
|
||||
fvPatchVectorField& pfld = const_cast<fvPatchVectorField&>
|
||||
(
|
||||
meshC.boundaryField()[patchI]
|
||||
meshC.boundaryField()[patchi]
|
||||
);
|
||||
|
||||
PackedBoolList isCollocated
|
||||
@ -1259,21 +1259,21 @@ Foam::isoSurface::isoSurface
|
||||
bType& bfld = const_cast<bType&>(meshC.boundaryField());
|
||||
|
||||
// Clear old value. Cannot resize it since is a slice.
|
||||
bfld.set(patchI, NULL);
|
||||
bfld.set(patchi, NULL);
|
||||
|
||||
// Set new value we can change
|
||||
bfld.set
|
||||
(
|
||||
patchI,
|
||||
patchi,
|
||||
new calculatedFvPatchField<vector>
|
||||
(
|
||||
mesh_.boundary()[patchI],
|
||||
mesh_.boundary()[patchi],
|
||||
meshC
|
||||
)
|
||||
);
|
||||
|
||||
// Change to face centres
|
||||
bfld[patchI] = pp.patchSlice(mesh_.faceCentres());
|
||||
bfld[patchi] = pp.patchSlice(mesh_.faceCentres());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1282,16 +1282,16 @@ Foam::isoSurface::isoSurface
|
||||
// Pre-calculate patch-per-face to avoid whichPatch call.
|
||||
labelList boundaryRegion(mesh_.nFaces()-mesh_.nInternalFaces());
|
||||
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
label faceI = pp.start();
|
||||
label facei = pp.start();
|
||||
|
||||
forAll(pp, i)
|
||||
{
|
||||
boundaryRegion[faceI-mesh_.nInternalFaces()] = patchI;
|
||||
faceI++;
|
||||
boundaryRegion[facei-mesh_.nInternalFaces()] = patchi;
|
||||
facei++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1342,17 +1342,17 @@ Foam::isoSurface::isoSurface
|
||||
// Determine if point is on boundary.
|
||||
PackedBoolList isBoundaryPoint(mesh_.nPoints());
|
||||
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
// Mark all boundary points that are not physically coupled
|
||||
// (so anything but collocated coupled patches)
|
||||
|
||||
if (patches[patchI].coupled())
|
||||
if (patches[patchi].coupled())
|
||||
{
|
||||
const coupledPolyPatch& cpp =
|
||||
refCast<const coupledPolyPatch>
|
||||
(
|
||||
patches[patchI]
|
||||
patches[patchi]
|
||||
);
|
||||
|
||||
PackedBoolList isCollocated(collocatedFaces(cpp));
|
||||
@ -1372,7 +1372,7 @@ Foam::isoSurface::isoSurface
|
||||
}
|
||||
else
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
forAll(pp, i)
|
||||
{
|
||||
|
||||
@ -179,8 +179,8 @@ class isoSurface
|
||||
const labelList& boundaryRegion,
|
||||
const volVectorField& meshC,
|
||||
const volScalarField& cVals,
|
||||
const label cellI,
|
||||
const label faceI,
|
||||
const label celli,
|
||||
const label facei,
|
||||
scalar& nbrValue,
|
||||
point& nbrPoint
|
||||
) const;
|
||||
@ -288,7 +288,7 @@ class isoSurface
|
||||
const DynamicList<Type>& snappedPoints,
|
||||
const labelList& snappedCc,
|
||||
const labelList& snappedPoint,
|
||||
const label faceI,
|
||||
const label facei,
|
||||
|
||||
const scalar neiVal,
|
||||
const Type& neiPt,
|
||||
|
||||
@ -79,12 +79,12 @@ Foam::isoSurfaceCell::cellCutType Foam::isoSurfaceCell::calcCutType
|
||||
const PackedBoolList& isTet,
|
||||
const scalarField& cellValues,
|
||||
const scalarField& pointValues,
|
||||
const label cellI
|
||||
const label celli
|
||||
) const
|
||||
{
|
||||
const cell& cFaces = mesh_.cells()[cellI];
|
||||
const cell& cFaces = mesh_.cells()[celli];
|
||||
|
||||
if (isTet.get(cellI) == 1)
|
||||
if (isTet.get(celli) == 1)
|
||||
{
|
||||
forAll(cFaces, cFaceI)
|
||||
{
|
||||
@ -104,15 +104,15 @@ Foam::isoSurfaceCell::cellCutType Foam::isoSurfaceCell::calcCutType
|
||||
}
|
||||
else
|
||||
{
|
||||
bool cellLower = (cellValues[cellI] < iso_);
|
||||
bool cellLower = (cellValues[celli] < iso_);
|
||||
|
||||
// First check if there is any cut in cell
|
||||
bool edgeCut = false;
|
||||
|
||||
forAll(cFaces, cFaceI)
|
||||
{
|
||||
label faceI = cFaces[cFaceI];
|
||||
const face& f = mesh_.faces()[faceI];
|
||||
label facei = cFaces[cFaceI];
|
||||
const face& f = mesh_.faces()[facei];
|
||||
|
||||
// Check pyramids cut
|
||||
forAll(f, fp)
|
||||
@ -129,7 +129,7 @@ Foam::isoSurfaceCell::cellCutType Foam::isoSurfaceCell::calcCutType
|
||||
break;
|
||||
}
|
||||
|
||||
const label fp0 = mesh_.tetBasePtIs()[faceI];
|
||||
const label fp0 = mesh_.tetBasePtIs()[facei];
|
||||
label fp = f.fcIndex(fp0);
|
||||
for (label i = 2; i < f.size(); i++)
|
||||
{
|
||||
@ -156,7 +156,7 @@ Foam::isoSurfaceCell::cellCutType Foam::isoSurfaceCell::calcCutType
|
||||
// Note: not needed if you don't want to preserve maxima/minima
|
||||
// centred around cellcentre. In that case just always return CUT
|
||||
|
||||
const labelList& cPoints = mesh_.cellPoints(cellI);
|
||||
const labelList& cPoints = mesh_.cellPoints(celli);
|
||||
|
||||
label nPyrCuts = 0;
|
||||
|
||||
@ -194,11 +194,11 @@ void Foam::isoSurfaceCell::calcCutTypes
|
||||
{
|
||||
cellCutType_.setSize(mesh_.nCells());
|
||||
nCutCells_ = 0;
|
||||
forAll(mesh_.cells(), cellI)
|
||||
forAll(mesh_.cells(), celli)
|
||||
{
|
||||
cellCutType_[cellI] = calcCutType(isTet, cVals, pVals, cellI);
|
||||
cellCutType_[celli] = calcCutType(isTet, cVals, pVals, celli);
|
||||
|
||||
if (cellCutType_[cellI] == CUT)
|
||||
if (cellCutType_[celli] == CUT)
|
||||
{
|
||||
nCutCells_++;
|
||||
}
|
||||
@ -262,7 +262,7 @@ Foam::point Foam::isoSurfaceCell::calcCentre(const triSurface& s)
|
||||
|
||||
Foam::pointIndexHit Foam::isoSurfaceCell::collapseSurface
|
||||
(
|
||||
const label cellI,
|
||||
const label celli,
|
||||
pointField& localPoints,
|
||||
DynamicList<labelledTri, 64>& localTris
|
||||
) const
|
||||
@ -374,13 +374,13 @@ void Foam::isoSurfaceCell::calcSnappedCc
|
||||
DynamicList<labelledTri, 64> localTris(64);
|
||||
Map<label> pointToLocal(64);
|
||||
|
||||
forAll(mesh_.cells(), cellI)
|
||||
forAll(mesh_.cells(), celli)
|
||||
{
|
||||
if (cellCutType_[cellI] == CUT && isTet.get(cellI) == 0)
|
||||
if (cellCutType_[celli] == CUT && isTet.get(celli) == 0)
|
||||
{
|
||||
scalar cVal = cVals[cellI];
|
||||
scalar cVal = cVals[celli];
|
||||
|
||||
const cell& cFaces = mesh_.cells()[cellI];
|
||||
const cell& cFaces = mesh_.cells()[celli];
|
||||
|
||||
localPoints.clear();
|
||||
localTris.clear();
|
||||
@ -403,7 +403,7 @@ void Foam::isoSurfaceCell::calcSnappedCc
|
||||
{
|
||||
if (pointToLocal.insert(pointI, localPoints.size()))
|
||||
{
|
||||
localPoints.append((1.0-s)*cc[cellI]+s*pts[pointI]);
|
||||
localPoints.append((1.0-s)*cc[celli]+s*pts[pointI]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -412,40 +412,40 @@ void Foam::isoSurfaceCell::calcSnappedCc
|
||||
if (localPoints.size() == 1)
|
||||
{
|
||||
// No need for any analysis.
|
||||
snappedCc[cellI] = snappedPoints.size();
|
||||
snappedCc[celli] = snappedPoints.size();
|
||||
snappedPoints.append(localPoints[0]);
|
||||
|
||||
//Pout<< "cell:" << cellI
|
||||
// << " at " << mesh_.cellCentres()[cellI]
|
||||
//Pout<< "cell:" << celli
|
||||
// << " at " << mesh_.cellCentres()[celli]
|
||||
// << " collapsing " << localPoints
|
||||
// << " intersections down to "
|
||||
// << snappedPoints[snappedCc[cellI]] << endl;
|
||||
// << snappedPoints[snappedCc[celli]] << endl;
|
||||
}
|
||||
else if (localPoints.size() == 2)
|
||||
{
|
||||
//? No need for any analysis.???
|
||||
snappedCc[cellI] = snappedPoints.size();
|
||||
snappedCc[celli] = snappedPoints.size();
|
||||
snappedPoints.append(0.5*(localPoints[0]+localPoints[1]));
|
||||
|
||||
//Pout<< "cell:" << cellI
|
||||
// << " at " << mesh_.cellCentres()[cellI]
|
||||
//Pout<< "cell:" << celli
|
||||
// << " at " << mesh_.cellCentres()[celli]
|
||||
// << " collapsing " << localPoints
|
||||
// << " intersections down to "
|
||||
// << snappedPoints[snappedCc[cellI]] << endl;
|
||||
// << snappedPoints[snappedCc[celli]] << endl;
|
||||
}
|
||||
else if (localPoints.size())
|
||||
{
|
||||
// Need to analyse
|
||||
forAll(cFaces, cFaceI)
|
||||
{
|
||||
label faceI = cFaces[cFaceI];
|
||||
const face& f = mesh_.faces()[faceI];
|
||||
label facei = cFaces[cFaceI];
|
||||
const face& f = mesh_.faces()[facei];
|
||||
|
||||
// Do a tetrahedralisation. Each face to cc becomes pyr.
|
||||
// Each pyr gets split into tets by diagonalisation
|
||||
// of face.
|
||||
|
||||
const label fp0 = mesh_.tetBasePtIs()[faceI];
|
||||
const label fp0 = mesh_.tetBasePtIs()[facei];
|
||||
label fp = f.fcIndex(fp0);
|
||||
for (label i = 2; i < f.size(); i++)
|
||||
{
|
||||
@ -467,7 +467,7 @@ void Foam::isoSurfaceCell::calcSnappedCc
|
||||
{
|
||||
if
|
||||
(
|
||||
(mesh_.faceOwner()[faceI] == cellI)
|
||||
(mesh_.faceOwner()[facei] == celli)
|
||||
== (cVal >= pVals[tri[0]])
|
||||
)
|
||||
{
|
||||
@ -505,21 +505,21 @@ void Foam::isoSurfaceCell::calcSnappedCc
|
||||
surfPoints.transfer(localPoints);
|
||||
pointIndexHit info = collapseSurface
|
||||
(
|
||||
cellI,
|
||||
celli,
|
||||
surfPoints,
|
||||
localTris
|
||||
);
|
||||
|
||||
if (info.hit())
|
||||
{
|
||||
snappedCc[cellI] = snappedPoints.size();
|
||||
snappedCc[celli] = snappedPoints.size();
|
||||
snappedPoints.append(info.hitPoint());
|
||||
|
||||
//Pout<< "cell:" << cellI
|
||||
// << " at " << mesh_.cellCentres()[cellI]
|
||||
//Pout<< "cell:" << celli
|
||||
// << " at " << mesh_.cellCentres()[celli]
|
||||
// << " collapsing " << surfPoints
|
||||
// << " intersections down to "
|
||||
// << snappedPoints[snappedCc[cellI]] << endl;
|
||||
// << snappedPoints[snappedCc[celli]] << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -532,16 +532,16 @@ void Foam::isoSurfaceCell::genPointTris
|
||||
const scalarField& cellValues,
|
||||
const scalarField& pointValues,
|
||||
const label pointI,
|
||||
const label faceI,
|
||||
const label cellI,
|
||||
const label facei,
|
||||
const label celli,
|
||||
DynamicList<point, 64>& localTriPoints
|
||||
) const
|
||||
{
|
||||
const pointField& cc = mesh_.cellCentres();
|
||||
const pointField& pts = mesh_.points();
|
||||
const face& f = mesh_.faces()[faceI];
|
||||
const face& f = mesh_.faces()[facei];
|
||||
|
||||
const label fp0 = mesh_.tetBasePtIs()[faceI];
|
||||
const label fp0 = mesh_.tetBasePtIs()[facei];
|
||||
label fp = f.fcIndex(fp0);
|
||||
for (label i = 2; i < f.size(); i++)
|
||||
{
|
||||
@ -563,7 +563,7 @@ void Foam::isoSurfaceCell::genPointTris
|
||||
FixedList<scalar, 3> s(3);
|
||||
s[0] = isoFraction(pointValues[pointI], pointValues[b]);
|
||||
s[1] = isoFraction(pointValues[pointI], pointValues[c]);
|
||||
s[2] = isoFraction(pointValues[pointI], cellValues[cellI]);
|
||||
s[2] = isoFraction(pointValues[pointI], cellValues[celli]);
|
||||
|
||||
if
|
||||
(
|
||||
@ -574,12 +574,12 @@ void Foam::isoSurfaceCell::genPointTris
|
||||
{
|
||||
point p0 = (1.0-s[0])*pts[pointI] + s[0]*pts[b];
|
||||
point p1 = (1.0-s[1])*pts[pointI] + s[1]*pts[c];
|
||||
point p2 = (1.0-s[2])*pts[pointI] + s[2]*cc[cellI];
|
||||
point p2 = (1.0-s[2])*pts[pointI] + s[2]*cc[celli];
|
||||
|
||||
if
|
||||
(
|
||||
(mesh_.faceOwner()[faceI] == cellI)
|
||||
== (pointValues[pointI] > cellValues[cellI])
|
||||
(mesh_.faceOwner()[facei] == celli)
|
||||
== (pointValues[pointI] > cellValues[celli])
|
||||
)
|
||||
{
|
||||
localTriPoints.append(p0);
|
||||
@ -603,19 +603,19 @@ void Foam::isoSurfaceCell::genPointTris
|
||||
(
|
||||
const scalarField& pointValues,
|
||||
const label pointI,
|
||||
const label faceI,
|
||||
const label cellI,
|
||||
const label facei,
|
||||
const label celli,
|
||||
DynamicList<point, 64>& localTriPoints
|
||||
) const
|
||||
{
|
||||
const pointField& pts = mesh_.points();
|
||||
const cell& cFaces = mesh_.cells()[cellI];
|
||||
const cell& cFaces = mesh_.cells()[celli];
|
||||
|
||||
FixedList<label, 4> tet;
|
||||
|
||||
// Make tet from this face to the 4th point (same as cellcentre in
|
||||
// non-tet cells)
|
||||
const face& f = mesh_.faces()[faceI];
|
||||
const face& f = mesh_.faces()[facei];
|
||||
|
||||
// Find 4th point
|
||||
label ccPointI = -1;
|
||||
@ -664,7 +664,7 @@ void Foam::isoSurfaceCell::genPointTris
|
||||
point p1 = (1.0-s[1])*pts[pointI] + s[1]*pts[c];
|
||||
point p2 = (1.0-s[2])*pts[pointI] + s[2]*pts[ccPointI];
|
||||
|
||||
if (mesh_.faceOwner()[faceI] != cellI)
|
||||
if (mesh_.faceOwner()[facei] != celli)
|
||||
{
|
||||
localTriPoints.append(p0);
|
||||
localTriPoints.append(p1);
|
||||
@ -694,16 +694,16 @@ void Foam::isoSurfaceCell::calcSnappedPoint
|
||||
// snapped. Coupled boundaries are handled explicitly so not marked here.
|
||||
PackedBoolList isBoundaryPoint(mesh_.nPoints());
|
||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
if (!pp.coupled())
|
||||
{
|
||||
label faceI = pp.start();
|
||||
label facei = pp.start();
|
||||
forAll(pp, i)
|
||||
{
|
||||
const face& f = mesh_.faces()[faceI++];
|
||||
const face& f = mesh_.faces()[facei++];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
@ -736,14 +736,14 @@ void Foam::isoSurfaceCell::calcSnappedPoint
|
||||
|
||||
forAll(pFaces, i)
|
||||
{
|
||||
label faceI = pFaces[i];
|
||||
label facei = pFaces[i];
|
||||
|
||||
if
|
||||
(
|
||||
cellCutType_[mesh_.faceOwner()[faceI]] == CUT
|
||||
cellCutType_[mesh_.faceOwner()[facei]] == CUT
|
||||
|| (
|
||||
mesh_.isInternalFace(faceI)
|
||||
&& cellCutType_[mesh_.faceNeighbour()[faceI]] == CUT
|
||||
mesh_.isInternalFace(facei)
|
||||
&& cellCutType_[mesh_.faceNeighbour()[facei]] == CUT
|
||||
)
|
||||
)
|
||||
{
|
||||
@ -765,8 +765,8 @@ void Foam::isoSurfaceCell::calcSnappedPoint
|
||||
|
||||
forAll(pFaces, pFaceI)
|
||||
{
|
||||
label faceI = pFaces[pFaceI];
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label facei = pFaces[pFaceI];
|
||||
label own = mesh_.faceOwner()[facei];
|
||||
|
||||
if (isTet.get(own) == 1)
|
||||
{
|
||||
@ -774,7 +774,7 @@ void Foam::isoSurfaceCell::calcSnappedPoint
|
||||
// we only generate a triangle once per point.
|
||||
if (localPointCells.insert(own))
|
||||
{
|
||||
genPointTris(pVals, pointI, faceI, own, localTriPoints);
|
||||
genPointTris(pVals, pointI, facei, own, localTriPoints);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -784,21 +784,21 @@ void Foam::isoSurfaceCell::calcSnappedPoint
|
||||
cVals,
|
||||
pVals,
|
||||
pointI,
|
||||
faceI,
|
||||
facei,
|
||||
own,
|
||||
localTriPoints
|
||||
);
|
||||
}
|
||||
|
||||
if (mesh_.isInternalFace(faceI))
|
||||
if (mesh_.isInternalFace(facei))
|
||||
{
|
||||
label nei = mesh_.faceNeighbour()[faceI];
|
||||
label nei = mesh_.faceNeighbour()[facei];
|
||||
|
||||
if (isTet.get(nei) == 1)
|
||||
{
|
||||
if (localPointCells.insert(nei))
|
||||
{
|
||||
genPointTris(pVals, pointI, faceI, nei, localTriPoints);
|
||||
genPointTris(pVals, pointI, facei, nei, localTriPoints);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -808,7 +808,7 @@ void Foam::isoSurfaceCell::calcSnappedPoint
|
||||
cVals,
|
||||
pVals,
|
||||
pointI,
|
||||
faceI,
|
||||
facei,
|
||||
nei,
|
||||
localTriPoints
|
||||
);
|
||||
@ -1046,18 +1046,18 @@ Foam::triSurface Foam::isoSurfaceCell::stitchTriPoints
|
||||
}
|
||||
|
||||
|
||||
bool Foam::isoSurfaceCell::validTri(const triSurface& surf, const label faceI)
|
||||
bool Foam::isoSurfaceCell::validTri(const triSurface& surf, const label facei)
|
||||
{
|
||||
// Simple check on indices ok.
|
||||
|
||||
const labelledTri& f = surf[faceI];
|
||||
const labelledTri& f = surf[facei];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
if (f[fp] < 0 || f[fp] >= surf.points().size())
|
||||
{
|
||||
WarningInFunction
|
||||
<< "triangle " << faceI << " vertices " << f
|
||||
<< "triangle " << facei << " vertices " << f
|
||||
<< " uses point indices outside point range 0.."
|
||||
<< surf.points().size()-1 << endl;
|
||||
|
||||
@ -1068,7 +1068,7 @@ bool Foam::isoSurfaceCell::validTri(const triSurface& surf, const label faceI)
|
||||
if ((f[0] == f[1]) || (f[0] == f[2]) || (f[1] == f[2]))
|
||||
{
|
||||
WarningInFunction
|
||||
<< "triangle " << faceI
|
||||
<< "triangle " << facei
|
||||
<< " uses non-unique vertices " << f
|
||||
<< endl;
|
||||
return false;
|
||||
@ -1076,7 +1076,7 @@ bool Foam::isoSurfaceCell::validTri(const triSurface& surf, const label faceI)
|
||||
|
||||
// duplicate triangle check
|
||||
|
||||
const labelList& fFaces = surf.faceFaces()[faceI];
|
||||
const labelList& fFaces = surf.faceFaces()[facei];
|
||||
|
||||
// Check if faceNeighbours use same points as this face.
|
||||
// Note: discards normal information - sides of baffle are merged.
|
||||
@ -1084,7 +1084,7 @@ bool Foam::isoSurfaceCell::validTri(const triSurface& surf, const label faceI)
|
||||
{
|
||||
label nbrFaceI = fFaces[i];
|
||||
|
||||
if (nbrFaceI <= faceI)
|
||||
if (nbrFaceI <= facei)
|
||||
{
|
||||
// lower numbered faces already checked
|
||||
continue;
|
||||
@ -1100,7 +1100,7 @@ bool Foam::isoSurfaceCell::validTri(const triSurface& surf, const label faceI)
|
||||
)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "triangle " << faceI << " vertices " << f
|
||||
<< "triangle " << facei << " vertices " << f
|
||||
<< " coords:" << f.points(surf.points())
|
||||
<< " has the same vertices as triangle " << nbrFaceI
|
||||
<< " vertices " << nbrF
|
||||
@ -1390,11 +1390,11 @@ Foam::isoSurfaceCell::isoSurfaceCell
|
||||
{
|
||||
tetMatcher tet;
|
||||
|
||||
forAll(isTet, cellI)
|
||||
forAll(isTet, celli)
|
||||
{
|
||||
if (tet.isA(mesh_, cellI))
|
||||
if (tet.isA(mesh_, celli))
|
||||
{
|
||||
isTet.set(cellI, 1);
|
||||
isTet.set(celli, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -153,7 +153,7 @@ class isoSurfaceCell
|
||||
// Returns point. Destroys arguments.
|
||||
pointIndexHit collapseSurface
|
||||
(
|
||||
const label cellI,
|
||||
const label celli,
|
||||
pointField& localPoints,
|
||||
DynamicList<labelledTri, 64>& localTris
|
||||
) const;
|
||||
@ -175,8 +175,8 @@ class isoSurfaceCell
|
||||
const scalarField& cellValues,
|
||||
const scalarField& pointValues,
|
||||
const label pointI,
|
||||
const label faceI,
|
||||
const label cellI,
|
||||
const label facei,
|
||||
const label celli,
|
||||
DynamicList<point, 64>& localTriPoints
|
||||
) const;
|
||||
|
||||
@ -185,8 +185,8 @@ class isoSurfaceCell
|
||||
(
|
||||
const scalarField& pointValues,
|
||||
const label pointI,
|
||||
const label faceI,
|
||||
const label cellI,
|
||||
const label facei,
|
||||
const label celli,
|
||||
DynamicList<point, 64>& localTriPoints
|
||||
) const;
|
||||
|
||||
|
||||
@ -338,15 +338,15 @@ void Foam::isoSurfaceCell::generateTriPoints
|
||||
tetMatcher tet;
|
||||
label countNotFoundTets = 0;
|
||||
|
||||
forAll(mesh_.cells(), cellI)
|
||||
forAll(mesh_.cells(), celli)
|
||||
{
|
||||
if (cellCutType_[cellI] != NOTCUT)
|
||||
if (cellCutType_[celli] != NOTCUT)
|
||||
{
|
||||
label oldNPoints = triPoints.size();
|
||||
|
||||
const cell& cFaces = mesh_.cells()[cellI];
|
||||
const cell& cFaces = mesh_.cells()[celli];
|
||||
|
||||
if (tet.isA(mesh_, cellI))
|
||||
if (tet.isA(mesh_, celli))
|
||||
{
|
||||
// For tets don't do cell-centre decomposition, just use the
|
||||
// tet points and values
|
||||
@ -368,7 +368,7 @@ void Foam::isoSurfaceCell::generateTriPoints
|
||||
|
||||
// Start off from positive volume tet to make sure we
|
||||
// generate outwards pointing tets
|
||||
if (mesh_.faceOwner()[cFaces[0]] == cellI)
|
||||
if (mesh_.faceOwner()[cFaces[0]] == celli)
|
||||
{
|
||||
generateTriPoints
|
||||
(
|
||||
@ -423,10 +423,10 @@ void Foam::isoSurfaceCell::generateTriPoints
|
||||
{
|
||||
forAll(cFaces, cFaceI)
|
||||
{
|
||||
label faceI = cFaces[cFaceI];
|
||||
const face& f = mesh_.faces()[faceI];
|
||||
label facei = cFaces[cFaceI];
|
||||
const face& f = mesh_.faces()[facei];
|
||||
|
||||
label fp0 = mesh_.tetBasePtIs()[faceI];
|
||||
label fp0 = mesh_.tetBasePtIs()[facei];
|
||||
|
||||
// Skip undefined tets
|
||||
if (fp0 < 0)
|
||||
@ -443,7 +443,7 @@ void Foam::isoSurfaceCell::generateTriPoints
|
||||
|
||||
// Start off from positive volume tet to make sure we
|
||||
// generate outwards pointing tets
|
||||
if (mesh_.faceOwner()[faceI] == cellI)
|
||||
if (mesh_.faceOwner()[facei] == celli)
|
||||
{
|
||||
generateTriPoints
|
||||
(
|
||||
@ -461,9 +461,9 @@ void Foam::isoSurfaceCell::generateTriPoints
|
||||
pCoords[tri[2]],
|
||||
snappedPoint[tri[2]],
|
||||
|
||||
cVals[cellI],
|
||||
cCoords[cellI],
|
||||
snappedCc[cellI],
|
||||
cVals[celli],
|
||||
cCoords[celli],
|
||||
snappedCc[celli],
|
||||
|
||||
triPoints
|
||||
);
|
||||
@ -486,9 +486,9 @@ void Foam::isoSurfaceCell::generateTriPoints
|
||||
pCoords[tri[2]],
|
||||
snappedPoint[tri[2]],
|
||||
|
||||
cVals[cellI],
|
||||
cCoords[cellI],
|
||||
snappedCc[cellI],
|
||||
cVals[celli],
|
||||
cCoords[celli],
|
||||
snappedCc[celli],
|
||||
|
||||
triPoints
|
||||
);
|
||||
@ -504,7 +504,7 @@ void Foam::isoSurfaceCell::generateTriPoints
|
||||
label nCells = (triPoints.size()-oldNPoints)/3;
|
||||
for (label i = 0; i < nCells; i++)
|
||||
{
|
||||
triMeshCells.append(cellI);
|
||||
triMeshCells.append(celli);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -441,7 +441,7 @@ Foam::label Foam::isoSurface::generateFaceTriPoints
|
||||
const DynamicList<Type>& snappedPoints,
|
||||
const labelList& snappedCc,
|
||||
const labelList& snappedPoint,
|
||||
const label faceI,
|
||||
const label facei,
|
||||
|
||||
const scalar neiVal,
|
||||
const Type& neiPt,
|
||||
@ -452,11 +452,11 @@ Foam::label Foam::isoSurface::generateFaceTriPoints
|
||||
DynamicList<label>& triMeshCells
|
||||
) const
|
||||
{
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label own = mesh_.faceOwner()[facei];
|
||||
|
||||
label oldNPoints = triPoints.size();
|
||||
|
||||
const face& f = mesh_.faces()[faceI];
|
||||
const face& f = mesh_.faces()[facei];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
@ -562,9 +562,9 @@ void Foam::isoSurface::generateTriPoints
|
||||
triPoints.clear();
|
||||
triMeshCells.clear();
|
||||
|
||||
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
||||
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
|
||||
{
|
||||
if (faceCutType_[faceI] != NOTCUT)
|
||||
if (faceCutType_[facei] != NOTCUT)
|
||||
{
|
||||
generateFaceTriPoints
|
||||
(
|
||||
@ -577,14 +577,14 @@ void Foam::isoSurface::generateTriPoints
|
||||
snappedPoints,
|
||||
snappedCc,
|
||||
snappedPoint,
|
||||
faceI,
|
||||
facei,
|
||||
|
||||
cVals[nei[faceI]],
|
||||
cCoords[nei[faceI]],
|
||||
snappedCc[nei[faceI]] != -1,
|
||||
cVals[nei[facei]],
|
||||
cCoords[nei[facei]],
|
||||
snappedCc[nei[facei]] != -1,
|
||||
(
|
||||
snappedCc[nei[faceI]] != -1
|
||||
? snappedPoints[snappedCc[nei[faceI]]]
|
||||
snappedCc[nei[facei]] != -1
|
||||
? snappedPoints[snappedCc[nei[facei]]]
|
||||
: Type(Zero)
|
||||
),
|
||||
|
||||
@ -604,18 +604,18 @@ void Foam::isoSurface::generateTriPoints
|
||||
|
||||
if (pp.coupled())
|
||||
{
|
||||
label faceI = pp.start();
|
||||
label facei = pp.start();
|
||||
forAll(pp, i)
|
||||
{
|
||||
label bFaceI = faceI-mesh_.nInternalFaces();
|
||||
label snappedIndex = snappedCc[own[faceI]];
|
||||
label bFaceI = facei-mesh_.nInternalFaces();
|
||||
label snappedIndex = snappedCc[own[facei]];
|
||||
|
||||
if (snappedIndex != -1)
|
||||
{
|
||||
neiSnapped[bFaceI] = true;
|
||||
neiSnappedPoint[bFaceI] = snappedPoints[snappedIndex];
|
||||
}
|
||||
faceI++;
|
||||
facei++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -637,9 +637,9 @@ void Foam::isoSurface::generateTriPoints
|
||||
|
||||
forAll(isCollocated, i)
|
||||
{
|
||||
label faceI = pp.start()+i;
|
||||
label facei = pp.start()+i;
|
||||
|
||||
if (faceCutType_[faceI] != NOTCUT)
|
||||
if (faceCutType_[facei] != NOTCUT)
|
||||
{
|
||||
if (isCollocated[i])
|
||||
{
|
||||
@ -654,12 +654,12 @@ void Foam::isoSurface::generateTriPoints
|
||||
snappedPoints,
|
||||
snappedCc,
|
||||
snappedPoint,
|
||||
faceI,
|
||||
facei,
|
||||
|
||||
cVals.boundaryField()[patchi][i],
|
||||
cCoords.boundaryField()[patchi][i],
|
||||
neiSnapped[faceI-mesh_.nInternalFaces()],
|
||||
neiSnappedPoint[faceI-mesh_.nInternalFaces()],
|
||||
neiSnapped[facei-mesh_.nInternalFaces()],
|
||||
neiSnappedPoint[facei-mesh_.nInternalFaces()],
|
||||
|
||||
triPoints,
|
||||
triMeshCells
|
||||
@ -678,7 +678,7 @@ void Foam::isoSurface::generateTriPoints
|
||||
snappedPoints,
|
||||
snappedCc,
|
||||
snappedPoint,
|
||||
faceI,
|
||||
facei,
|
||||
|
||||
cVals.boundaryField()[patchi][i],
|
||||
cCoords.boundaryField()[patchi][i],
|
||||
@ -694,11 +694,11 @@ void Foam::isoSurface::generateTriPoints
|
||||
}
|
||||
else
|
||||
{
|
||||
label faceI = pp.start();
|
||||
label facei = pp.start();
|
||||
|
||||
forAll(pp, i)
|
||||
{
|
||||
if (faceCutType_[faceI] != NOTCUT)
|
||||
if (faceCutType_[facei] != NOTCUT)
|
||||
{
|
||||
generateFaceTriPoints
|
||||
(
|
||||
@ -711,7 +711,7 @@ void Foam::isoSurface::generateTriPoints
|
||||
snappedPoints,
|
||||
snappedCc,
|
||||
snappedPoint,
|
||||
faceI,
|
||||
facei,
|
||||
|
||||
cVals.boundaryField()[patchi][i],
|
||||
cCoords.boundaryField()[patchi][i],
|
||||
@ -722,7 +722,7 @@ void Foam::isoSurface::generateTriPoints
|
||||
triMeshCells
|
||||
);
|
||||
}
|
||||
faceI++;
|
||||
facei++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -130,16 +130,16 @@ bool Foam::sampledIsoSurfaceCell::updateGeometry() const
|
||||
|
||||
forAll(pCells, i)
|
||||
{
|
||||
label cellI = pCells[i];
|
||||
label celli = pCells[i];
|
||||
|
||||
cellAvg[cellI] += pointFld().internalField()[pointI];
|
||||
nPointCells[cellI]++;
|
||||
cellAvg[celli] += pointFld().internalField()[pointI];
|
||||
nPointCells[celli]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
forAll(cellAvg, cellI)
|
||||
forAll(cellAvg, celli)
|
||||
{
|
||||
cellAvg[cellI] /= nPointCells[cellI];
|
||||
cellAvg[celli] /= nPointCells[celli];
|
||||
}
|
||||
|
||||
const isoSurfaceCell iso
|
||||
|
||||
@ -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
|
||||
@ -130,8 +130,8 @@ bool Foam::sampledPatch::update()
|
||||
label sz = 0;
|
||||
forAll(patchIDs(), i)
|
||||
{
|
||||
label patchI = patchIDs()[i];
|
||||
const polyPatch& pp = mesh().boundaryMesh()[patchI];
|
||||
label patchi = patchIDs()[i];
|
||||
const polyPatch& pp = mesh().boundaryMesh()[patchi];
|
||||
|
||||
if (isA<emptyPolyPatch>(pp))
|
||||
{
|
||||
@ -154,11 +154,11 @@ bool Foam::sampledPatch::update()
|
||||
|
||||
forAll(patchIDs(), i)
|
||||
{
|
||||
label patchI = patchIDs()[i];
|
||||
label patchi = patchIDs()[i];
|
||||
|
||||
patchStart_[i] = sz;
|
||||
|
||||
const polyPatch& pp = mesh().boundaryMesh()[patchI];
|
||||
const polyPatch& pp = mesh().boundaryMesh()[patchi];
|
||||
|
||||
forAll(pp, j)
|
||||
{
|
||||
|
||||
@ -39,8 +39,8 @@ Foam::sampledPatch::sampleField
|
||||
Field<Type>& values = tvalues.ref();
|
||||
forAll(patchFaceLabels_, i)
|
||||
{
|
||||
label patchI = patchIDs_[patchIndex_[i]];
|
||||
const Field<Type>& bField = vField.boundaryField()[patchI];
|
||||
label patchi = patchIDs_[patchIndex_[i]];
|
||||
const Field<Type>& bField = vField.boundaryField()[patchi];
|
||||
values[i] = bField[patchFaceLabels_[i]];
|
||||
}
|
||||
|
||||
@ -61,8 +61,8 @@ Foam::sampledPatch::sampleField
|
||||
|
||||
forAll(patchFaceLabels_, i)
|
||||
{
|
||||
label patchI = patchIDs_[patchIndex_[i]];
|
||||
values[i] = sField.boundaryField()[patchI][patchFaceLabels_[i]];
|
||||
label patchi = patchIDs_[patchIndex_[i]];
|
||||
values[i] = sField.boundaryField()[patchi][patchFaceLabels_[i]];
|
||||
}
|
||||
|
||||
return tvalues;
|
||||
@ -86,8 +86,8 @@ Foam::sampledPatch::interpolateField
|
||||
|
||||
forAll(faces(), cutFaceI)
|
||||
{
|
||||
label patchI = patchIDs_[patchIndex_[cutFaceI]];
|
||||
const polyPatch& pp = mesh().boundaryMesh()[patchI];
|
||||
label patchi = patchIDs_[patchIndex_[cutFaceI]];
|
||||
const polyPatch& pp = mesh().boundaryMesh()[patchi];
|
||||
label patchFaceI = patchFaceLabels()[cutFaceI];
|
||||
const face& f = faces()[cutFaceI];
|
||||
|
||||
@ -97,14 +97,14 @@ Foam::sampledPatch::interpolateField
|
||||
|
||||
if (!pointDone[pointI])
|
||||
{
|
||||
label faceI = patchFaceI + pp.start();
|
||||
label cellI = own[faceI];
|
||||
label facei = patchFaceI + pp.start();
|
||||
label celli = own[facei];
|
||||
|
||||
values[pointI] = interpolator.interpolate
|
||||
(
|
||||
points()[pointI],
|
||||
cellI,
|
||||
faceI
|
||||
celli,
|
||||
facei
|
||||
);
|
||||
pointDone[pointI] = true;
|
||||
}
|
||||
|
||||
@ -93,14 +93,14 @@ Foam::sampledPatchInternalField::interpolateField
|
||||
|
||||
Field<Type> patchVals(mesh().nCells());
|
||||
|
||||
forAll(samples, cellI)
|
||||
forAll(samples, celli)
|
||||
{
|
||||
if (samples[cellI] != point::max)
|
||||
if (samples[celli] != point::max)
|
||||
{
|
||||
patchVals[cellI] = interpolator.interpolate
|
||||
patchVals[celli] = interpolator.interpolate
|
||||
(
|
||||
samples[cellI],
|
||||
cellI
|
||||
samples[celli],
|
||||
celli
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,9 +62,9 @@ void Foam::sampledSurface::makeSf() const
|
||||
SfPtr_ = new vectorField(theFaces.size());
|
||||
|
||||
vectorField& values = *SfPtr_;
|
||||
forAll(theFaces, faceI)
|
||||
forAll(theFaces, facei)
|
||||
{
|
||||
values[faceI] = theFaces[faceI].normal(points());
|
||||
values[facei] = theFaces[facei].normal(points());
|
||||
}
|
||||
}
|
||||
|
||||
@ -83,9 +83,9 @@ void Foam::sampledSurface::makeMagSf() const
|
||||
magSfPtr_ = new scalarField(theFaces.size());
|
||||
|
||||
scalarField& values = *magSfPtr_;
|
||||
forAll(theFaces, faceI)
|
||||
forAll(theFaces, facei)
|
||||
{
|
||||
values[faceI] = theFaces[faceI].mag(points());
|
||||
values[facei] = theFaces[facei].mag(points());
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,9 +104,9 @@ void Foam::sampledSurface::makeCf() const
|
||||
CfPtr_ = new vectorField(theFaces.size());
|
||||
|
||||
vectorField& values = *CfPtr_;
|
||||
forAll(theFaces, faceI)
|
||||
forAll(theFaces, facei)
|
||||
{
|
||||
values[faceI] = theFaces[faceI].centre(points());
|
||||
values[facei] = theFaces[facei].centre(points());
|
||||
}
|
||||
}
|
||||
|
||||
@ -293,9 +293,9 @@ Foam::sampledSurface::project(const Field<scalar>& field) const
|
||||
tmp<Field<scalar>> tRes(new Field<scalar>(faces().size()));
|
||||
Field<scalar>& res = tRes.ref();
|
||||
|
||||
forAll(faces(), faceI)
|
||||
forAll(faces(), facei)
|
||||
{
|
||||
res[faceI] = field[faceI];
|
||||
res[facei] = field[facei];
|
||||
}
|
||||
|
||||
return tRes;
|
||||
|
||||
@ -114,9 +114,9 @@ void Foam::sampledSurface::project
|
||||
{
|
||||
const vectorField& norm = Sf();
|
||||
|
||||
forAll(norm, faceI)
|
||||
forAll(norm, facei)
|
||||
{
|
||||
res[faceI] = field[faceI] & (norm[faceI]/mag(norm[faceI]));
|
||||
res[facei] = field[facei] & (norm[facei]/mag(norm[facei]));
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -187,16 +187,16 @@ Foam::sampledSurface::pointAverage
|
||||
|
||||
forAll(pCells, i)
|
||||
{
|
||||
label cellI = pCells[i];
|
||||
label celli = pCells[i];
|
||||
|
||||
cellAvg[cellI] += pfld[pointI];
|
||||
nPointCells[cellI]++;
|
||||
cellAvg[celli] += pfld[pointI];
|
||||
nPointCells[celli]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
forAll(cellAvg, cellI)
|
||||
forAll(cellAvg, celli)
|
||||
{
|
||||
cellAvg[cellI] /= nPointCells[cellI];
|
||||
cellAvg[celli] /= nPointCells[celli];
|
||||
}
|
||||
// Give value to calculatedFvPatchFields
|
||||
cellAvg.correctBoundaryConditions();
|
||||
|
||||
@ -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
|
||||
@ -94,9 +94,9 @@ Foam::sampledTriSurfaceMesh::nonCoupledboundaryTree() const
|
||||
|
||||
labelList bndFaces(mesh().nFaces()-mesh().nInternalFaces());
|
||||
label bndI = 0;
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const polyPatch& pp = patches[patchi];
|
||||
if (!pp.coupled())
|
||||
{
|
||||
forAll(pp, i)
|
||||
@ -274,13 +274,13 @@ bool Foam::sampledTriSurfaceMesh::update(const meshSearch& meshSearcher)
|
||||
label newPointI = 0;
|
||||
label newFaceI = 0;
|
||||
|
||||
forAll(s, faceI)
|
||||
forAll(s, facei)
|
||||
{
|
||||
if (cellOrFaceLabels[faceI] != -1)
|
||||
if (cellOrFaceLabels[facei] != -1)
|
||||
{
|
||||
faceMap[newFaceI++] = faceI;
|
||||
faceMap[newFaceI++] = facei;
|
||||
|
||||
const triSurface::FaceType& f = s[faceI];
|
||||
const triSurface::FaceType& f = s[facei];
|
||||
forAll(f, fp)
|
||||
{
|
||||
if (reversePointMap[f[fp]] == -1)
|
||||
@ -348,8 +348,8 @@ bool Foam::sampledTriSurfaceMesh::update(const meshSearch& meshSearcher)
|
||||
forAll(points(), pointI)
|
||||
{
|
||||
const point& pt = points()[pointI];
|
||||
label cellI = cellOrFaceLabels[pointToFace[pointI]];
|
||||
sampleElements_[pointI] = cellI;
|
||||
label celli = cellOrFaceLabels[pointToFace[pointI]];
|
||||
sampleElements_[pointI] = celli;
|
||||
|
||||
// Check if point inside cell
|
||||
if
|
||||
@ -367,7 +367,7 @@ bool Foam::sampledTriSurfaceMesh::update(const meshSearch& meshSearcher)
|
||||
else
|
||||
{
|
||||
// Find nearest point on faces of cell
|
||||
const cell& cFaces = mesh().cells()[cellI];
|
||||
const cell& cFaces = mesh().cells()[celli];
|
||||
|
||||
scalar minDistSqr = VGREAT;
|
||||
|
||||
@ -392,8 +392,8 @@ bool Foam::sampledTriSurfaceMesh::update(const meshSearch& meshSearcher)
|
||||
forAll(points(), pointI)
|
||||
{
|
||||
const point& pt = points()[pointI];
|
||||
label cellI = cellOrFaceLabels[pointToFace[pointI]];
|
||||
sampleElements_[pointI] = cellI;
|
||||
label celli = cellOrFaceLabels[pointToFace[pointI]];
|
||||
sampleElements_[pointI] = celli;
|
||||
samplePoints_[pointI] = pt;
|
||||
}
|
||||
}
|
||||
@ -406,9 +406,9 @@ bool Foam::sampledTriSurfaceMesh::update(const meshSearch& meshSearcher)
|
||||
forAll(points(), pointI)
|
||||
{
|
||||
const point& pt = points()[pointI];
|
||||
label faceI = cellOrFaceLabels[pointToFace[pointI]];
|
||||
sampleElements_[pointI] = faceI;
|
||||
samplePoints_[pointI] = mesh().faces()[faceI].nearestPoint
|
||||
label facei = cellOrFaceLabels[pointToFace[pointI]];
|
||||
sampleElements_[pointI] = facei;
|
||||
samplePoints_[pointI] = mesh().faces()[facei].nearestPoint
|
||||
(
|
||||
pt,
|
||||
mesh().points()
|
||||
@ -452,8 +452,8 @@ bool Foam::sampledTriSurfaceMesh::update(const meshSearch& meshSearcher)
|
||||
meshTools::writeOBJ(str, samplePoints_[pointI]);
|
||||
vertI++;
|
||||
|
||||
label cellI = sampleElements_[pointI];
|
||||
meshTools::writeOBJ(str, mesh().cellCentres()[cellI]);
|
||||
label celli = sampleElements_[pointI];
|
||||
meshTools::writeOBJ(str, mesh().cellCentres()[celli]);
|
||||
vertI++;
|
||||
str << "l " << vertI-2 << ' ' << vertI-1 << ' ' << vertI
|
||||
<< nl;
|
||||
@ -469,8 +469,8 @@ bool Foam::sampledTriSurfaceMesh::update(const meshSearch& meshSearcher)
|
||||
meshTools::writeOBJ(str, samplePoints_[pointI]);
|
||||
vertI++;
|
||||
|
||||
label faceI = sampleElements_[pointI];
|
||||
meshTools::writeOBJ(str, mesh().faceCentres()[faceI]);
|
||||
label facei = sampleElements_[pointI];
|
||||
meshTools::writeOBJ(str, mesh().faceCentres()[facei]);
|
||||
vertI++;
|
||||
str << "l " << vertI-2 << ' ' << vertI-1 << ' ' << vertI
|
||||
<< nl;
|
||||
@ -486,8 +486,8 @@ bool Foam::sampledTriSurfaceMesh::update(const meshSearch& meshSearcher)
|
||||
meshTools::writeOBJ(str, faceCentres()[triI]);
|
||||
vertI++;
|
||||
|
||||
label cellI = sampleElements_[triI];
|
||||
meshTools::writeOBJ(str, mesh().cellCentres()[cellI]);
|
||||
label celli = sampleElements_[triI];
|
||||
meshTools::writeOBJ(str, mesh().cellCentres()[celli]);
|
||||
vertI++;
|
||||
str << "l " << vertI-1 << ' ' << vertI << nl;
|
||||
}
|
||||
@ -499,8 +499,8 @@ bool Foam::sampledTriSurfaceMesh::update(const meshSearch& meshSearcher)
|
||||
meshTools::writeOBJ(str, faceCentres()[triI]);
|
||||
vertI++;
|
||||
|
||||
label faceI = sampleElements_[triI];
|
||||
meshTools::writeOBJ(str, mesh().faceCentres()[faceI]);
|
||||
label facei = sampleElements_[triI];
|
||||
meshTools::writeOBJ(str, mesh().faceCentres()[facei]);
|
||||
vertI++;
|
||||
str << "l " << vertI-1 << ' ' << vertI << nl;
|
||||
}
|
||||
|
||||
@ -58,24 +58,24 @@ Foam::sampledTriSurfaceMesh::sampleField
|
||||
|
||||
Field<Type> bVals(nBnd, Zero);
|
||||
|
||||
forAll(vField.boundaryField(), patchI)
|
||||
forAll(vField.boundaryField(), patchi)
|
||||
{
|
||||
label bFaceI = pbm[patchI].start() - mesh().nInternalFaces();
|
||||
label bFaceI = pbm[patchi].start() - mesh().nInternalFaces();
|
||||
|
||||
SubList<Type>
|
||||
(
|
||||
bVals,
|
||||
vField.boundaryField()[patchI].size(),
|
||||
vField.boundaryField()[patchi].size(),
|
||||
bFaceI
|
||||
) = vField.boundaryField()[patchI];
|
||||
) = vField.boundaryField()[patchi];
|
||||
}
|
||||
|
||||
// Sample in flat boundary field
|
||||
|
||||
forAll(sampleElements_, triI)
|
||||
{
|
||||
label faceI = sampleElements_[triI];
|
||||
values[triI] = bVals[faceI-mesh().nInternalFaces()];
|
||||
label facei = sampleElements_[triI];
|
||||
values[triI] = bVals[facei-mesh().nInternalFaces()];
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,13 +113,13 @@ Foam::sampledTriSurfaceMesh::interpolateField
|
||||
|
||||
forAll(samplePoints_, pointI)
|
||||
{
|
||||
label faceI = sampleElements_[pointI];
|
||||
label facei = sampleElements_[pointI];
|
||||
|
||||
values[pointI] = interpolator.interpolate
|
||||
(
|
||||
samplePoints_[pointI],
|
||||
mesh().faceOwner()[faceI],
|
||||
faceI
|
||||
mesh().faceOwner()[facei],
|
||||
facei
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -69,14 +69,14 @@ void Foam::thresholdCellFaces::calculate
|
||||
0 // index
|
||||
);
|
||||
|
||||
forAll(bMesh, patchI)
|
||||
forAll(bMesh, patchi)
|
||||
{
|
||||
surfZones[patchI+1] = surfZone
|
||||
surfZones[patchi+1] = surfZone
|
||||
(
|
||||
bMesh[patchI].name(),
|
||||
bMesh[patchi].name(),
|
||||
0, // size
|
||||
0, // start
|
||||
patchI+1 // index
|
||||
patchi+1 // index
|
||||
);
|
||||
}
|
||||
|
||||
@ -94,32 +94,32 @@ void Foam::thresholdCellFaces::calculate
|
||||
|
||||
|
||||
// internal faces only
|
||||
for (label faceI = 0; faceI < mesh_.nInternalFaces(); ++faceI)
|
||||
for (label facei = 0; facei < mesh_.nInternalFaces(); ++facei)
|
||||
{
|
||||
int side = 0;
|
||||
|
||||
// check lowerThreshold
|
||||
if (field[own[faceI]] > lowerThreshold)
|
||||
if (field[own[facei]] > lowerThreshold)
|
||||
{
|
||||
if (field[nei[faceI]] < lowerThreshold)
|
||||
if (field[nei[facei]] < lowerThreshold)
|
||||
{
|
||||
side = +1;
|
||||
}
|
||||
}
|
||||
else if (field[nei[faceI]] > lowerThreshold)
|
||||
else if (field[nei[facei]] > lowerThreshold)
|
||||
{
|
||||
side = -1;
|
||||
}
|
||||
|
||||
// check upperThreshold
|
||||
if (field[own[faceI]] < upperThreshold)
|
||||
if (field[own[facei]] < upperThreshold)
|
||||
{
|
||||
if (field[nei[faceI]] > upperThreshold)
|
||||
if (field[nei[facei]] > upperThreshold)
|
||||
{
|
||||
side = +1;
|
||||
}
|
||||
}
|
||||
else if (field[nei[faceI]] < upperThreshold)
|
||||
else if (field[nei[facei]] < upperThreshold)
|
||||
{
|
||||
side = -1;
|
||||
}
|
||||
@ -127,7 +127,7 @@ void Foam::thresholdCellFaces::calculate
|
||||
|
||||
if (side)
|
||||
{
|
||||
const face& f = origFaces[faceI];
|
||||
const face& f = origFaces[facei];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
@ -144,12 +144,12 @@ void Foam::thresholdCellFaces::calculate
|
||||
if (side > 0)
|
||||
{
|
||||
surfFace = f;
|
||||
cellId = own[faceI];
|
||||
cellId = own[facei];
|
||||
}
|
||||
else
|
||||
{
|
||||
surfFace = f.reverseFace();
|
||||
cellId = nei[faceI];
|
||||
cellId = nei[facei];
|
||||
}
|
||||
|
||||
|
||||
@ -173,10 +173,10 @@ void Foam::thresholdCellFaces::calculate
|
||||
|
||||
|
||||
// nothing special for processor patches?
|
||||
forAll(bMesh, patchI)
|
||||
forAll(bMesh, patchi)
|
||||
{
|
||||
const polyPatch& p = bMesh[patchI];
|
||||
surfZone& zone = surfZones[patchI+1];
|
||||
const polyPatch& p = bMesh[patchi];
|
||||
surfZone& zone = surfZones[patchi+1];
|
||||
|
||||
zone.start() = nFaces;
|
||||
|
||||
@ -189,18 +189,18 @@ void Foam::thresholdCellFaces::calculate
|
||||
continue;
|
||||
}
|
||||
|
||||
label faceI = p.start();
|
||||
label facei = p.start();
|
||||
|
||||
// patch faces
|
||||
forAll(p, localFaceI)
|
||||
{
|
||||
if
|
||||
(
|
||||
field[own[faceI]] > lowerThreshold
|
||||
&& field[own[faceI]] < upperThreshold
|
||||
field[own[facei]] > lowerThreshold
|
||||
&& field[own[facei]] < upperThreshold
|
||||
)
|
||||
{
|
||||
const face& f = origFaces[faceI];
|
||||
const face& f = origFaces[facei];
|
||||
forAll(f, fp)
|
||||
{
|
||||
if (oldToNewPoints[f[fp]] == -1)
|
||||
@ -209,7 +209,7 @@ void Foam::thresholdCellFaces::calculate
|
||||
}
|
||||
}
|
||||
|
||||
label cellId = own[faceI];
|
||||
label cellId = own[facei];
|
||||
|
||||
if (triangulate)
|
||||
{
|
||||
@ -226,7 +226,7 @@ void Foam::thresholdCellFaces::calculate
|
||||
}
|
||||
}
|
||||
|
||||
++faceI;
|
||||
++facei;
|
||||
}
|
||||
|
||||
zone.size() = surfFaces.size() - zone.start();
|
||||
@ -237,9 +237,9 @@ void Foam::thresholdCellFaces::calculate
|
||||
surfCells.shrink();
|
||||
|
||||
// renumber
|
||||
forAll(surfFaces, faceI)
|
||||
forAll(surfFaces, facei)
|
||||
{
|
||||
inplaceRenumber(oldToNewPoints, surfFaces[faceI]);
|
||||
inplaceRenumber(oldToNewPoints, surfFaces[facei]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
@ -67,14 +67,14 @@ void Foam::dxSurfaceWriter::writeGeometry
|
||||
<< "object 2 class array type int rank 1 shape 3 items "
|
||||
<< faces.size() << " data follows" << nl;
|
||||
|
||||
forAll(faces, faceI)
|
||||
forAll(faces, facei)
|
||||
{
|
||||
const face& f = faces[faceI];
|
||||
const face& f = faces[facei];
|
||||
|
||||
if (f.size() != 3)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Face " << faceI << " vertices " << f
|
||||
<< "Face " << facei << " vertices " << f
|
||||
<< " is not a triangle."
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -129,9 +129,9 @@ void Foam::foamFileSurfaceWriter::write
|
||||
// for e.g. timeVaryingMapped bc.
|
||||
pointField faceCentres(faces.size(),point::zero);
|
||||
|
||||
forAll(faces, faceI)
|
||||
forAll(faces, facei)
|
||||
{
|
||||
faceCentres[faceI] = faces[faceI].centre(points);
|
||||
faceCentres[facei] = faces[facei].centre(points);
|
||||
}
|
||||
|
||||
OFstream(surfaceDir/"faceCentres")() << faceCentres;
|
||||
|
||||
@ -285,19 +285,19 @@ void Foam::nastranSurfaceWriter::writeGeometry
|
||||
|
||||
label nFace = 1;
|
||||
|
||||
forAll(faces, faceI)
|
||||
forAll(faces, facei)
|
||||
{
|
||||
const face& f = faces[faceI];
|
||||
const face& f = faces[facei];
|
||||
|
||||
if (f.size() == 3)
|
||||
{
|
||||
writeFace("CTRIA3", faces[faceI], nFace, os);
|
||||
decomposedFaces[faceI].append(faces[faceI]);
|
||||
writeFace("CTRIA3", faces[facei], nFace, os);
|
||||
decomposedFaces[facei].append(faces[facei]);
|
||||
}
|
||||
else if (f.size() == 4)
|
||||
{
|
||||
writeFace("CQUAD4", faces[faceI], nFace, os);
|
||||
decomposedFaces[faceI].append(faces[faceI]);
|
||||
writeFace("CQUAD4", faces[facei], nFace, os);
|
||||
decomposedFaces[facei].append(faces[facei]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -309,7 +309,7 @@ void Foam::nastranSurfaceWriter::writeGeometry
|
||||
forAll(triFaces, triI)
|
||||
{
|
||||
writeFace("CTRIA3", triFaces[triI], nFace, os);
|
||||
decomposedFaces[faceI].append(triFaces[triI]);
|
||||
decomposedFaces[facei].append(triFaces[triI]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -179,10 +179,10 @@ void Foam::nastranSurfaceWriter::writeTemplate
|
||||
forAll(decomposedFaces, i)
|
||||
{
|
||||
const DynamicList<face>& dFaces = decomposedFaces[i];
|
||||
forAll(dFaces, faceI)
|
||||
forAll(dFaces, facei)
|
||||
{
|
||||
Type v = Zero;
|
||||
const face& f = dFaces[faceI];
|
||||
const face& f = dFaces[facei];
|
||||
|
||||
forAll(f, fptI)
|
||||
{
|
||||
@ -202,9 +202,9 @@ void Foam::nastranSurfaceWriter::writeTemplate
|
||||
{
|
||||
const DynamicList<face>& dFaces = decomposedFaces[i];
|
||||
|
||||
forAll(dFaces, faceI)
|
||||
forAll(dFaces, facei)
|
||||
{
|
||||
writeFaceValue(nasFieldName, values[faceI], ++n, os);
|
||||
writeFaceValue(nasFieldName, values[facei], ++n, os);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,10 +59,10 @@ inline void Foam::rawSurfaceWriter::writeLocation
|
||||
Ostream& os,
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
const label faceI
|
||||
const label facei
|
||||
)
|
||||
{
|
||||
const point& ct = faces[faceI].centre(points);
|
||||
const point& ct = faces[facei].centre(points);
|
||||
os << ct.x() << ' ' << ct.y() << ' ' << ct.z() << ' ';
|
||||
}
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@ class rawSurfaceWriter
|
||||
Ostream&,
|
||||
const pointField&,
|
||||
const faceList&,
|
||||
const label faceI
|
||||
const label facei
|
||||
);
|
||||
|
||||
template<class Type>
|
||||
|
||||
@ -68,17 +68,17 @@ void Foam::vtkSurfaceWriter::writeGeometry
|
||||
|
||||
// Write faces
|
||||
label nNodes = 0;
|
||||
forAll(faces, faceI)
|
||||
forAll(faces, facei)
|
||||
{
|
||||
nNodes += faces[faceI].size();
|
||||
nNodes += faces[facei].size();
|
||||
}
|
||||
|
||||
os << "POLYGONS " << faces.size() << ' '
|
||||
<< faces.size() + nNodes << nl;
|
||||
|
||||
forAll(faces, faceI)
|
||||
forAll(faces, facei)
|
||||
{
|
||||
const face& f = faces[faceI];
|
||||
const face& f = faces[facei];
|
||||
|
||||
os << f.size();
|
||||
forAll(f, fp)
|
||||
|
||||
Reference in New Issue
Block a user