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
|
||||
@ -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