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
|
||||
@ -139,12 +139,12 @@ void Foam::fieldMinMax::calcMinMaxFields
|
||||
maxVs[procI] = magField[maxProcI];
|
||||
maxCs[procI] = field.mesh().C()[maxProcI];
|
||||
|
||||
forAll(magFieldBoundary, patchI)
|
||||
forAll(magFieldBoundary, patchi)
|
||||
{
|
||||
const scalarField& mfp = magFieldBoundary[patchI];
|
||||
const scalarField& mfp = magFieldBoundary[patchi];
|
||||
if (mfp.size())
|
||||
{
|
||||
const vectorField& Cfp = CfBoundary[patchI];
|
||||
const vectorField& Cfp = CfBoundary[patchi];
|
||||
|
||||
label minPI = findMin(mfp);
|
||||
if (mfp[minPI] < minVs[procI])
|
||||
@ -212,12 +212,12 @@ void Foam::fieldMinMax::calcMinMaxFields
|
||||
maxVs[procI] = field[maxProcI];
|
||||
maxCs[procI] = field.mesh().C()[maxProcI];
|
||||
|
||||
forAll(fieldBoundary, patchI)
|
||||
forAll(fieldBoundary, patchi)
|
||||
{
|
||||
const Field<Type>& fp = fieldBoundary[patchI];
|
||||
const Field<Type>& fp = fieldBoundary[patchi];
|
||||
if (fp.size())
|
||||
{
|
||||
const vectorField& Cfp = CfBoundary[patchI];
|
||||
const vectorField& Cfp = CfBoundary[patchi];
|
||||
|
||||
label minPI = findMin(fp);
|
||||
if (fp[minPI] < minVs[procI])
|
||||
|
||||
@ -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
|
||||
@ -106,24 +106,24 @@ void Foam::fieldValues::faceSource::setFaceZoneFaces()
|
||||
|
||||
forAll(fZone, i)
|
||||
{
|
||||
label faceI = fZone[i];
|
||||
label facei = fZone[i];
|
||||
|
||||
label faceId = -1;
|
||||
label facePatchId = -1;
|
||||
if (mesh().isInternalFace(faceI))
|
||||
if (mesh().isInternalFace(facei))
|
||||
{
|
||||
faceId = faceI;
|
||||
faceId = facei;
|
||||
facePatchId = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
facePatchId = mesh().boundaryMesh().whichPatch(faceI);
|
||||
facePatchId = mesh().boundaryMesh().whichPatch(facei);
|
||||
const polyPatch& pp = mesh().boundaryMesh()[facePatchId];
|
||||
if (isA<coupledPolyPatch>(pp))
|
||||
{
|
||||
if (refCast<const coupledPolyPatch>(pp).owner())
|
||||
{
|
||||
faceId = pp.whichFace(faceI);
|
||||
faceId = pp.whichFace(facei);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -132,7 +132,7 @@ void Foam::fieldValues::faceSource::setFaceZoneFaces()
|
||||
}
|
||||
else if (!isA<emptyPolyPatch>(pp))
|
||||
{
|
||||
faceId = faceI - pp.start();
|
||||
faceId = facei - pp.start();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -171,9 +171,9 @@ void Foam::fieldValues::faceSource::setFaceZoneFaces()
|
||||
|
||||
void Foam::fieldValues::faceSource::setPatchFaces()
|
||||
{
|
||||
const label patchId = mesh().boundaryMesh().findPatchID(sourceName_);
|
||||
const label patchid = mesh().boundaryMesh().findPatchID(sourceName_);
|
||||
|
||||
if (patchId < 0)
|
||||
if (patchid < 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< type() << " " << name_ << ": "
|
||||
@ -184,7 +184,7 @@ void Foam::fieldValues::faceSource::setPatchFaces()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
const polyPatch& pp = mesh().boundaryMesh()[patchId];
|
||||
const polyPatch& pp = mesh().boundaryMesh()[patchid];
|
||||
|
||||
label nFaces = pp.size();
|
||||
if (isA<emptyPolyPatch>(pp))
|
||||
@ -197,11 +197,11 @@ void Foam::fieldValues::faceSource::setPatchFaces()
|
||||
faceSign_.setSize(nFaces);
|
||||
nFaces_ = returnReduce(faceId_.size(), sumOp<label>());
|
||||
|
||||
forAll(faceId_, faceI)
|
||||
forAll(faceId_, facei)
|
||||
{
|
||||
faceId_[faceI] = faceI;
|
||||
facePatchId_[faceI] = patchId;
|
||||
faceSign_[faceI] = 1;
|
||||
faceId_[facei] = facei;
|
||||
facePatchId_[facei] = patchid;
|
||||
faceSign_[facei] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,8 +233,8 @@ void Foam::fieldValues::faceSource::combineMeshGeometry
|
||||
{
|
||||
if (facePatchId_[i] != -1)
|
||||
{
|
||||
label patchI = facePatchId_[i];
|
||||
globalFacesIs[i] += mesh().boundaryMesh()[patchI].start();
|
||||
label patchi = facePatchId_[i];
|
||||
globalFacesIs[i] += mesh().boundaryMesh()[patchi].start();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -85,14 +85,14 @@ Foam::tmp<Foam::Field<Type>> Foam::fieldValues::faceSource::getFieldValues
|
||||
);
|
||||
Field<Type>& avg = tavg.ref();
|
||||
|
||||
forAll(faces, faceI)
|
||||
forAll(faces, facei)
|
||||
{
|
||||
const face& f = faces[faceI];
|
||||
const face& f = faces[facei];
|
||||
forAll(f, fp)
|
||||
{
|
||||
avg[faceI] += intFld[f[fp]];
|
||||
avg[facei] += intFld[f[fp]];
|
||||
}
|
||||
avg[faceI] /= f.size();
|
||||
avg[facei] /= f.size();
|
||||
}
|
||||
|
||||
return tavg;
|
||||
@ -359,11 +359,11 @@ Foam::tmp<Foam::Field<Type>> Foam::fieldValues::faceSource::filterField
|
||||
|
||||
forAll(values, i)
|
||||
{
|
||||
label faceI = faceId_[i];
|
||||
label patchI = facePatchId_[i];
|
||||
if (patchI >= 0)
|
||||
label facei = faceId_[i];
|
||||
label patchi = facePatchId_[i];
|
||||
if (patchi >= 0)
|
||||
{
|
||||
values[i] = field.boundaryField()[patchI][faceI];
|
||||
values[i] = field.boundaryField()[patchi][facei];
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -400,15 +400,15 @@ Foam::tmp<Foam::Field<Type>> Foam::fieldValues::faceSource::filterField
|
||||
|
||||
forAll(values, i)
|
||||
{
|
||||
label faceI = faceId_[i];
|
||||
label patchI = facePatchId_[i];
|
||||
if (patchI >= 0)
|
||||
label facei = faceId_[i];
|
||||
label patchi = facePatchId_[i];
|
||||
if (patchi >= 0)
|
||||
{
|
||||
values[i] = field.boundaryField()[patchI][faceI];
|
||||
values[i] = field.boundaryField()[patchi][facei];
|
||||
}
|
||||
else
|
||||
{
|
||||
values[i] = field[faceI];
|
||||
values[i] = field[facei];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -31,14 +31,14 @@ Foam::findCellParticle::findCellParticle
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const vector& position,
|
||||
const label cellI,
|
||||
const label celli,
|
||||
const label tetFaceI,
|
||||
const label tetPtI,
|
||||
const point& end,
|
||||
const label data
|
||||
)
|
||||
:
|
||||
particle(mesh, position, cellI, tetFaceI, tetPtI),
|
||||
particle(mesh, position, celli, tetFaceI, tetPtI),
|
||||
end_(end),
|
||||
data_(data)
|
||||
{}
|
||||
|
||||
@ -112,7 +112,7 @@ public:
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const vector& position,
|
||||
const label cellI,
|
||||
const label celli,
|
||||
const label tetFaceI,
|
||||
const label tetPtI,
|
||||
const point& end,
|
||||
|
||||
@ -47,8 +47,8 @@ void Foam::nearWallFields::calcAddressing()
|
||||
label nPatchFaces = 0;
|
||||
forAllConstIter(labelHashSet, patchSet_, iter)
|
||||
{
|
||||
label patchI = iter.key();
|
||||
nPatchFaces += mesh.boundary()[patchI].size();
|
||||
label patchi = iter.key();
|
||||
nPatchFaces += mesh.boundary()[patchi].size();
|
||||
}
|
||||
|
||||
// Global indexing
|
||||
@ -67,8 +67,8 @@ void Foam::nearWallFields::calcAddressing()
|
||||
|
||||
forAllConstIter(labelHashSet, patchSet_, iter)
|
||||
{
|
||||
label patchI = iter.key();
|
||||
const fvPatch& patch = mesh.boundary()[patchI];
|
||||
label patchi = iter.key();
|
||||
const fvPatch& patch = mesh.boundary()[patchi];
|
||||
|
||||
vectorField nf(patch.nf());
|
||||
vectorField faceCellCentres(patch.patch().faceCellCentres());
|
||||
@ -104,10 +104,10 @@ void Foam::nearWallFields::calcAddressing()
|
||||
const point end = start-distance_*nf[patchFaceI];
|
||||
|
||||
// Find tet for starting location
|
||||
label cellI = -1;
|
||||
label celli = -1;
|
||||
label tetFaceI = -1;
|
||||
label tetPtI = -1;
|
||||
mesh.findCellFacePt(start, cellI, tetFaceI, tetPtI);
|
||||
mesh.findCellFacePt(start, celli, tetFaceI, tetPtI);
|
||||
|
||||
// Add to cloud. Add originating face as passive data
|
||||
cloud.addParticle
|
||||
@ -116,7 +116,7 @@ void Foam::nearWallFields::calcAddressing()
|
||||
(
|
||||
mesh,
|
||||
start,
|
||||
cellI,
|
||||
celli,
|
||||
tetFaceI,
|
||||
tetPtI,
|
||||
end,
|
||||
@ -202,10 +202,10 @@ void Foam::nearWallFields::calcAddressing()
|
||||
);
|
||||
InfoInFunction << "Dumping obtained to " << str.name() << endl;
|
||||
|
||||
forAll(cellToWalls_, cellI)
|
||||
forAll(cellToWalls_, celli)
|
||||
{
|
||||
const List<point>& ends = cellToSamples_[cellI];
|
||||
const labelList& cData = cellToWalls_[cellI];
|
||||
const List<point>& ends = cellToSamples_[celli];
|
||||
const labelList& cData = cellToWalls_[celli];
|
||||
forAll(cData, i)
|
||||
{
|
||||
str.write(linePointRef(ends[i], start[cData[i]]));
|
||||
|
||||
@ -81,14 +81,14 @@ void Foam::nearWallFields::sampleBoundaryField
|
||||
// Construct flat fields for all patch faces to be sampled
|
||||
Field<Type> sampledValues(getPatchDataMapPtr_().constructSize());
|
||||
|
||||
forAll(cellToWalls_, cellI)
|
||||
forAll(cellToWalls_, celli)
|
||||
{
|
||||
const labelList& cData = cellToWalls_[cellI];
|
||||
const labelList& cData = cellToWalls_[celli];
|
||||
|
||||
forAll(cData, i)
|
||||
{
|
||||
const point& samplePt = cellToSamples_[cellI][i];
|
||||
sampledValues[cData[i]] = interpolator.interpolate(samplePt, cellI);
|
||||
const point& samplePt = cellToSamples_[celli][i];
|
||||
sampledValues[cData[i]] = interpolator.interpolate(samplePt, celli);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -128,21 +128,21 @@ void Foam::regionSizeDistribution::writeAlphaFields
|
||||
|
||||
|
||||
// Knock out any cell not in patchRegions
|
||||
forAll(liquidCore, cellI)
|
||||
forAll(liquidCore, celli)
|
||||
{
|
||||
label regionI = regions[cellI];
|
||||
label regionI = regions[celli];
|
||||
if (patchRegions.found(regionI))
|
||||
{
|
||||
backgroundAlpha[cellI] = 0;
|
||||
backgroundAlpha[celli] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
liquidCore[cellI] = 0;
|
||||
liquidCore[celli] = 0;
|
||||
|
||||
scalar regionVol = regionVolume[regionI];
|
||||
if (regionVol < maxDropletVol)
|
||||
{
|
||||
backgroundAlpha[cellI] = 0;
|
||||
backgroundAlpha[celli] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -456,10 +456,10 @@ void Foam::regionSizeDistribution::write()
|
||||
label nBlocked = 0;
|
||||
|
||||
{
|
||||
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
|
||||
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||
{
|
||||
scalar ownVal = alpha[mesh.faceOwner()[faceI]];
|
||||
scalar neiVal = alpha[mesh.faceNeighbour()[faceI]];
|
||||
scalar ownVal = alpha[mesh.faceOwner()[facei]];
|
||||
scalar neiVal = alpha[mesh.faceNeighbour()[facei]];
|
||||
|
||||
if
|
||||
(
|
||||
@ -467,15 +467,15 @@ void Foam::regionSizeDistribution::write()
|
||||
|| (ownVal > threshold_ && neiVal < threshold_)
|
||||
)
|
||||
{
|
||||
blockedFace[faceI] = true;
|
||||
blockedFace[facei] = true;
|
||||
nBlocked++;
|
||||
}
|
||||
}
|
||||
|
||||
// Block coupled faces
|
||||
forAll(alpha.boundaryField(), patchI)
|
||||
forAll(alpha.boundaryField(), patchi)
|
||||
{
|
||||
const fvPatchScalarField& fvp = alpha.boundaryField()[patchI];
|
||||
const fvPatchScalarField& fvp = alpha.boundaryField()[patchi];
|
||||
if (fvp.coupled())
|
||||
{
|
||||
tmp<scalarField> townFld(fvp.patchInternalField());
|
||||
@ -529,9 +529,9 @@ void Foam::regionSizeDistribution::write()
|
||||
Info<< " Dumping region as volScalarField to " << region.name()
|
||||
<< endl;
|
||||
|
||||
forAll(regions, cellI)
|
||||
forAll(regions, celli)
|
||||
{
|
||||
region[cellI] = regions[cellI];
|
||||
region[celli] = regions[celli];
|
||||
}
|
||||
region.correctBoundaryConditions();
|
||||
region.write();
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -39,18 +39,18 @@ Foam::Map<Type> Foam::regionSizeDistribution::regionSum
|
||||
// Per region the sum of fld
|
||||
Map<Type> regionToSum(regions.nRegions()/Pstream::nProcs());
|
||||
|
||||
forAll(fld, cellI)
|
||||
forAll(fld, celli)
|
||||
{
|
||||
label regionI = regions[cellI];
|
||||
label regionI = regions[celli];
|
||||
|
||||
typename Map<Type>::iterator fnd = regionToSum.find(regionI);
|
||||
if (fnd == regionToSum.end())
|
||||
{
|
||||
regionToSum.insert(regionI, fld[cellI]);
|
||||
regionToSum.insert(regionI, fld[celli]);
|
||||
}
|
||||
else
|
||||
{
|
||||
fnd() += fld[cellI];
|
||||
fnd() += fld[celli];
|
||||
}
|
||||
}
|
||||
Pstream::mapCombineGather(regionToSum, plusEqOp<Type>());
|
||||
|
||||
@ -55,12 +55,12 @@ Foam::streamLine::wallPatch() const
|
||||
|
||||
label nFaces = 0;
|
||||
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
//if (!polyPatch::constraintType(patches[patchI].type()))
|
||||
if (isA<wallPolyPatch>(patches[patchI]))
|
||||
//if (!polyPatch::constraintType(patches[patchi].type()))
|
||||
if (isA<wallPolyPatch>(patches[patchi]))
|
||||
{
|
||||
nFaces += patches[patchI].size();
|
||||
nFaces += patches[patchi].size();
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,12 +68,12 @@ Foam::streamLine::wallPatch() const
|
||||
|
||||
nFaces = 0;
|
||||
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
//if (!polyPatch::constraintType(patches[patchI].type()))
|
||||
if (isA<wallPolyPatch>(patches[patchI]))
|
||||
//if (!polyPatch::constraintType(patches[patchi].type()))
|
||||
if (isA<wallPolyPatch>(patches[patchi]))
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
forAll(pp, i)
|
||||
{
|
||||
|
||||
@ -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
|
||||
@ -59,14 +59,14 @@ Foam::vector Foam::streamLineParticle::interpolateFields
|
||||
(
|
||||
const trackingData& td,
|
||||
const point& position,
|
||||
const label cellI,
|
||||
const label faceI
|
||||
const label celli,
|
||||
const label facei
|
||||
)
|
||||
{
|
||||
if (cellI == -1)
|
||||
if (celli == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cell:" << cellI << abort(FatalError);
|
||||
<< "Cell:" << celli << abort(FatalError);
|
||||
}
|
||||
|
||||
sampledScalars_.setSize(td.vsInterp_.size());
|
||||
@ -77,8 +77,8 @@ Foam::vector Foam::streamLineParticle::interpolateFields
|
||||
td.vsInterp_[scalarI].interpolate
|
||||
(
|
||||
position,
|
||||
cellI,
|
||||
faceI
|
||||
celli,
|
||||
facei
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -91,8 +91,8 @@ Foam::vector Foam::streamLineParticle::interpolateFields
|
||||
td.vvInterp_[vectorI].interpolate
|
||||
(
|
||||
position,
|
||||
cellI,
|
||||
faceI
|
||||
celli,
|
||||
facei
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -109,11 +109,11 @@ Foam::streamLineParticle::streamLineParticle
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const vector& position,
|
||||
const label cellI,
|
||||
const label celli,
|
||||
const label lifeTime
|
||||
)
|
||||
:
|
||||
particle(mesh, position, cellI),
|
||||
particle(mesh, position, celli),
|
||||
lifeTime_(lifeTime)
|
||||
{}
|
||||
|
||||
|
||||
@ -152,8 +152,8 @@ private:
|
||||
(
|
||||
const trackingData&,
|
||||
const point&,
|
||||
const label cellI,
|
||||
const label faceI
|
||||
const label celli,
|
||||
const label facei
|
||||
);
|
||||
|
||||
|
||||
@ -166,7 +166,7 @@ public:
|
||||
(
|
||||
const polyMesh& c,
|
||||
const vector& position,
|
||||
const label cellI,
|
||||
const label celli,
|
||||
const label lifeTime
|
||||
);
|
||||
|
||||
|
||||
@ -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
|
||||
@ -302,14 +302,14 @@ Foam::wallBoundedParticle::wallBoundedParticle
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const vector& position,
|
||||
const label cellI,
|
||||
const label celli,
|
||||
const label tetFaceI,
|
||||
const label tetPtI,
|
||||
const label meshEdgeStart,
|
||||
const label diagEdge
|
||||
)
|
||||
:
|
||||
particle(mesh, position, cellI, tetFaceI, tetPtI),
|
||||
particle(mesh, position, celli, tetFaceI, tetPtI),
|
||||
meshEdgeStart_(meshEdgeStart),
|
||||
diagEdge_(diagEdge)
|
||||
{}
|
||||
|
||||
@ -104,7 +104,7 @@ protected:
|
||||
|
||||
//- Particle is on diagonal edge:
|
||||
// const face& f = mesh.faces()[tetFace()]
|
||||
// label faceBasePtI = mesh.tetBasePtIs()[faceI];
|
||||
// label faceBasePtI = mesh.tetBasePtIs()[facei];
|
||||
// label diagPtI = (faceBasePtI+diagEdge_)%f.size();
|
||||
// const edge e(f[faceBasePtI], f[diagPtI]);
|
||||
label diagEdge_;
|
||||
@ -224,7 +224,7 @@ public:
|
||||
(
|
||||
const polyMesh& c,
|
||||
const vector& position,
|
||||
const label cellI,
|
||||
const label celli,
|
||||
const label tetFaceI,
|
||||
const label tetPtI,
|
||||
const label meshEdgeStart,
|
||||
|
||||
@ -40,10 +40,10 @@ void Foam::wallBoundedParticle::patchInteraction
|
||||
particleType& p = static_cast<particleType&>(*this);
|
||||
p.hitFace(td);
|
||||
|
||||
if (!internalFace(faceI_))
|
||||
if (!internalFace(facei_))
|
||||
{
|
||||
label origFaceI = faceI_;
|
||||
label patchI = patch(faceI_);
|
||||
label origFaceI = facei_;
|
||||
label patchi = patch(facei_);
|
||||
|
||||
// No action taken for tetPtI_ for tetFaceI_ here, handled by
|
||||
// patch interaction call or later during processor transfer.
|
||||
@ -56,9 +56,9 @@ void Foam::wallBoundedParticle::patchInteraction
|
||||
(
|
||||
!p.hitPatch
|
||||
(
|
||||
mesh_.boundaryMesh()[patchI],
|
||||
mesh_.boundaryMesh()[patchi],
|
||||
td,
|
||||
patchI,
|
||||
patchi,
|
||||
trackFraction,
|
||||
faceHitTetIs
|
||||
)
|
||||
@ -66,12 +66,12 @@ void Foam::wallBoundedParticle::patchInteraction
|
||||
{
|
||||
// Did patch interaction model switch patches?
|
||||
// Note: recalculate meshEdgeStart_, diagEdge_!
|
||||
if (faceI_ != origFaceI)
|
||||
if (facei_ != origFaceI)
|
||||
{
|
||||
patchI = patch(faceI_);
|
||||
patchi = patch(facei_);
|
||||
}
|
||||
|
||||
const polyPatch& patch = mesh_.boundaryMesh()[patchI];
|
||||
const polyPatch& patch = mesh_.boundaryMesh()[patchi];
|
||||
|
||||
if (isA<wedgePolyPatch>(patch))
|
||||
{
|
||||
@ -168,9 +168,9 @@ Foam::scalar Foam::wallBoundedParticle::trackToEdge
|
||||
{
|
||||
label nbrCellI =
|
||||
(
|
||||
cellI_ == mesh_.faceOwner()[faceI_]
|
||||
? mesh_.faceNeighbour()[faceI_]
|
||||
: mesh_.faceOwner()[faceI_]
|
||||
celli_ == mesh_.faceOwner()[facei_]
|
||||
? mesh_.faceNeighbour()[facei_]
|
||||
: mesh_.faceOwner()[facei_]
|
||||
);
|
||||
// Check angle to nbrCell tet. Is it in the direction of the
|
||||
// endposition? I.e. since volume of nbr tet is positive the
|
||||
@ -179,9 +179,9 @@ Foam::scalar Foam::wallBoundedParticle::trackToEdge
|
||||
if ((nbrTi.faceTri(mesh_).normal() & (endPosition-position())) < 0)
|
||||
{
|
||||
// Change into nbrCell. No need to change tetFace, tetPt.
|
||||
//Pout<< " crossed from cell:" << cellI_
|
||||
//Pout<< " crossed from cell:" << celli_
|
||||
// << " into " << nbrCellI << endl;
|
||||
cellI_ = nbrCellI;
|
||||
celli_ = nbrCellI;
|
||||
patchInteraction(td, trackFraction);
|
||||
}
|
||||
else
|
||||
@ -386,7 +386,7 @@ bool Foam::wallBoundedParticle::hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
TrackData& td,
|
||||
const label patchI,
|
||||
const label patchi,
|
||||
const scalar trackFraction,
|
||||
const tetIndices& tetIs
|
||||
)
|
||||
|
||||
@ -57,12 +57,12 @@ Foam::wallBoundedStreamLine::wallPatch() const
|
||||
|
||||
label nFaces = 0;
|
||||
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
//if (!polyPatch::constraintType(patches[patchI].type()))
|
||||
if (isA<wallPolyPatch>(patches[patchI]))
|
||||
//if (!polyPatch::constraintType(patches[patchi].type()))
|
||||
if (isA<wallPolyPatch>(patches[patchi]))
|
||||
{
|
||||
nFaces += patches[patchI].size();
|
||||
nFaces += patches[patchi].size();
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,12 +70,12 @@ Foam::wallBoundedStreamLine::wallPatch() const
|
||||
|
||||
nFaces = 0;
|
||||
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
//if (!polyPatch::constraintType(patches[patchI].type()))
|
||||
if (isA<wallPolyPatch>(patches[patchI]))
|
||||
//if (!polyPatch::constraintType(patches[patchi].type()))
|
||||
if (isA<wallPolyPatch>(patches[patchi]))
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
forAll(pp, i)
|
||||
{
|
||||
@ -103,12 +103,12 @@ Foam::tetIndices Foam::wallBoundedStreamLine::findNearestTet
|
||||
(
|
||||
const PackedBoolList& isWallPatch,
|
||||
const point& seedPt,
|
||||
const label cellI
|
||||
const label celli
|
||||
) const
|
||||
{
|
||||
const fvMesh& mesh = dynamic_cast<const fvMesh&>(obr_);
|
||||
|
||||
const cell& cFaces = mesh.cells()[cellI];
|
||||
const cell& cFaces = mesh.cells()[celli];
|
||||
|
||||
label minFaceI = -1;
|
||||
label minTetPtI = -1;
|
||||
@ -116,12 +116,12 @@ Foam::tetIndices Foam::wallBoundedStreamLine::findNearestTet
|
||||
|
||||
forAll(cFaces, cFaceI)
|
||||
{
|
||||
label faceI = cFaces[cFaceI];
|
||||
label facei = cFaces[cFaceI];
|
||||
|
||||
if (isWallPatch[faceI])
|
||||
if (isWallPatch[facei])
|
||||
{
|
||||
const face& f = mesh.faces()[faceI];
|
||||
const label fp0 = mesh.tetBasePtIs()[faceI];
|
||||
const face& f = mesh.faces()[facei];
|
||||
const label fp0 = mesh.tetBasePtIs()[facei];
|
||||
const point& basePoint = mesh.points()[f[fp0]];
|
||||
|
||||
label fp = f.fcIndex(fp0);
|
||||
@ -137,7 +137,7 @@ Foam::tetIndices Foam::wallBoundedStreamLine::findNearestTet
|
||||
if (d2 < minDistSqr)
|
||||
{
|
||||
minDistSqr = d2;
|
||||
minFaceI = faceI;
|
||||
minFaceI = facei;
|
||||
minTetPtI = i-1;
|
||||
}
|
||||
fp = nextFp;
|
||||
@ -148,7 +148,7 @@ Foam::tetIndices Foam::wallBoundedStreamLine::findNearestTet
|
||||
// Put particle in tet
|
||||
return tetIndices
|
||||
(
|
||||
cellI,
|
||||
celli,
|
||||
minFaceI,
|
||||
minTetPtI,
|
||||
mesh
|
||||
@ -196,9 +196,9 @@ void Foam::wallBoundedStreamLine::track()
|
||||
forAll(seedPoints, i)
|
||||
{
|
||||
const point& seedPt = seedPoints[i];
|
||||
label cellI = seedPoints.cells()[i];
|
||||
label celli = seedPoints.cells()[i];
|
||||
|
||||
tetIndices ids(findNearestTet(isWallPatch, seedPt, cellI));
|
||||
tetIndices ids(findNearestTet(isWallPatch, seedPt, celli));
|
||||
|
||||
if (ids.face() != -1 && isWallPatch[ids.face()])
|
||||
{
|
||||
@ -583,16 +583,16 @@ void Foam::wallBoundedStreamLine::read(const dictionary& dict)
|
||||
|
||||
// 2. all edges on a cell having two faces
|
||||
EdgeMap<label> numFacesPerEdge;
|
||||
forAll(mesh.cells(), cellI)
|
||||
forAll(mesh.cells(), celli)
|
||||
{
|
||||
const cell& cFaces = mesh.cells()[cellI];
|
||||
const cell& cFaces = mesh.cells()[celli];
|
||||
|
||||
numFacesPerEdge.clear();
|
||||
|
||||
forAll(cFaces, cFaceI)
|
||||
{
|
||||
label faceI = cFaces[cFaceI];
|
||||
const face& f = mesh.faces()[faceI];
|
||||
label facei = cFaces[cFaceI];
|
||||
const face& f = mesh.faces()[facei];
|
||||
forAll(f, fp)
|
||||
{
|
||||
const edge e(f[fp], f.nextLabel(fp));
|
||||
@ -614,7 +614,7 @@ void Foam::wallBoundedStreamLine::read(const dictionary& dict)
|
||||
if (iter() != 2)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "problem cell:" << cellI
|
||||
<< "problem cell:" << celli
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
@ -219,7 +219,7 @@ class wallBoundedStreamLine
|
||||
(
|
||||
const PackedBoolList& isWallPatch,
|
||||
const point& seedPt,
|
||||
const label cellI
|
||||
const label celli
|
||||
) const;
|
||||
|
||||
//- Do all seeding and tracking
|
||||
|
||||
@ -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
|
||||
@ -32,14 +32,14 @@ Foam::vector Foam::wallBoundedStreamLineParticle::interpolateFields
|
||||
(
|
||||
const trackingData& td,
|
||||
const point& position,
|
||||
const label cellI,
|
||||
const label faceI
|
||||
const label celli,
|
||||
const label facei
|
||||
)
|
||||
{
|
||||
if (cellI == -1)
|
||||
if (celli == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cell:" << cellI << abort(FatalError);
|
||||
<< "Cell:" << celli << abort(FatalError);
|
||||
}
|
||||
|
||||
const tetIndices ti = currentTetIndices();
|
||||
@ -47,8 +47,8 @@ Foam::vector Foam::wallBoundedStreamLineParticle::interpolateFields
|
||||
const vector U = td.vvInterp_[td.UIndex_].interpolate
|
||||
(
|
||||
position,
|
||||
ti, //cellI,
|
||||
faceI
|
||||
ti, //celli,
|
||||
facei
|
||||
);
|
||||
|
||||
// Check if at different position
|
||||
@ -70,8 +70,8 @@ Foam::vector Foam::wallBoundedStreamLineParticle::interpolateFields
|
||||
td.vsInterp_[scalarI].interpolate
|
||||
(
|
||||
position,
|
||||
ti, //cellI,
|
||||
faceI
|
||||
ti, //celli,
|
||||
facei
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -90,8 +90,8 @@ Foam::vector Foam::wallBoundedStreamLineParticle::interpolateFields
|
||||
positionU = td.vvInterp_[vectorI].interpolate
|
||||
(
|
||||
position,
|
||||
ti, //cellI,
|
||||
faceI
|
||||
ti, //celli,
|
||||
facei
|
||||
);
|
||||
}
|
||||
sampledVectors_[vectorI].append(positionU);
|
||||
@ -134,7 +134,7 @@ Foam::wallBoundedStreamLineParticle::wallBoundedStreamLineParticle
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const vector& position,
|
||||
const label cellI,
|
||||
const label celli,
|
||||
const label tetFaceI,
|
||||
const label tetPtI,
|
||||
const label meshEdgeStart,
|
||||
@ -146,7 +146,7 @@ Foam::wallBoundedStreamLineParticle::wallBoundedStreamLineParticle
|
||||
(
|
||||
mesh,
|
||||
position,
|
||||
cellI,
|
||||
celli,
|
||||
tetFaceI,
|
||||
tetPtI,
|
||||
meshEdgeStart,
|
||||
|
||||
@ -144,8 +144,8 @@ private:
|
||||
(
|
||||
const trackingData& td,
|
||||
const point& position,
|
||||
const label cellI,
|
||||
const label faceI
|
||||
const label celli,
|
||||
const label facei
|
||||
);
|
||||
|
||||
vector sample(trackingData& td);
|
||||
@ -160,7 +160,7 @@ public:
|
||||
(
|
||||
const polyMesh& c,
|
||||
const vector& position,
|
||||
const label cellI,
|
||||
const label celli,
|
||||
const label tetFaceI,
|
||||
const label tetPtI,
|
||||
const label meshEdgeStart,
|
||||
|
||||
Reference in New Issue
Block a user