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
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -131,11 +131,11 @@ int main(int argc, char *argv[])
|
|||||||
protectedCell = 0;
|
protectedCell = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(betav, cellI)
|
forAll(betav, celli)
|
||||||
{
|
{
|
||||||
if (betav[cellI] < 0.99)
|
if (betav[celli] < 0.99)
|
||||||
{
|
{
|
||||||
protectedCell[cellI] = 1;
|
protectedCell[celli] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -155,11 +155,11 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::D
|
|||||||
|
|
||||||
volScalarField& D(tmpD.ref());
|
volScalarField& D(tmpD.ref());
|
||||||
|
|
||||||
forAll(p, cellI)
|
forAll(p, celli)
|
||||||
{
|
{
|
||||||
D[cellI] =
|
D[celli] =
|
||||||
localThermo.alphah(p[cellI], T[cellI])
|
localThermo.alphah(p[celli], T[celli])
|
||||||
/localThermo.rho(p[cellI], T[cellI]);
|
/localThermo.rho(p[celli], T[celli]);
|
||||||
}
|
}
|
||||||
|
|
||||||
D /= Le_;
|
D /= Le_;
|
||||||
@ -209,11 +209,11 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::L
|
|||||||
|
|
||||||
volScalarField& L(tmpL.ref());
|
volScalarField& L(tmpL.ref());
|
||||||
|
|
||||||
forAll(p, cellI)
|
forAll(p, celli)
|
||||||
{
|
{
|
||||||
L[cellI] =
|
L[celli] =
|
||||||
localThermo.Ha(p[cellI], Tf[cellI])
|
localThermo.Ha(p[celli], Tf[celli])
|
||||||
- otherLocalThermo.Ha(otherP[cellI], Tf[cellI]);
|
- otherLocalThermo.Ha(otherP[celli], Tf[celli]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return tmpL;
|
return tmpL;
|
||||||
|
|||||||
@ -85,23 +85,23 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::yPlusTherm
|
|||||||
tmp<scalarField> typsf(new scalarField(this->size()));
|
tmp<scalarField> typsf(new scalarField(this->size()));
|
||||||
scalarField& ypsf = typsf.ref();
|
scalarField& ypsf = typsf.ref();
|
||||||
|
|
||||||
forAll(ypsf, faceI)
|
forAll(ypsf, facei)
|
||||||
{
|
{
|
||||||
scalar ypt = 11.0;
|
scalar ypt = 11.0;
|
||||||
|
|
||||||
for (int i=0; i<maxIters_; i++)
|
for (int i=0; i<maxIters_; i++)
|
||||||
{
|
{
|
||||||
scalar f = ypt - (log(E_*ypt)/kappa_ + P[faceI])/Prat[faceI];
|
scalar f = ypt - (log(E_*ypt)/kappa_ + P[facei])/Prat[facei];
|
||||||
scalar df = 1 - 1.0/(ypt*kappa_*Prat[faceI]);
|
scalar df = 1 - 1.0/(ypt*kappa_*Prat[facei]);
|
||||||
scalar yptNew = ypt - f/df;
|
scalar yptNew = ypt - f/df;
|
||||||
|
|
||||||
if (yptNew < VSMALL)
|
if (yptNew < VSMALL)
|
||||||
{
|
{
|
||||||
ypsf[faceI] = 0;
|
ypsf[facei] = 0;
|
||||||
}
|
}
|
||||||
else if (mag(yptNew - ypt) < tolerance_)
|
else if (mag(yptNew - ypt) < tolerance_)
|
||||||
{
|
{
|
||||||
ypsf[faceI] = yptNew;
|
ypsf[facei] = yptNew;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -109,7 +109,7 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::yPlusTherm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ypsf[faceI] = ypt;
|
ypsf[facei] = ypt;
|
||||||
}
|
}
|
||||||
|
|
||||||
return typsf;
|
return typsf;
|
||||||
@ -200,32 +200,32 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::calcAlphat
|
|||||||
scalarField& alphatConv = talphatConv.ref();
|
scalarField& alphatConv = talphatConv.ref();
|
||||||
|
|
||||||
// Populate boundary values
|
// Populate boundary values
|
||||||
forAll(alphatConv, faceI)
|
forAll(alphatConv, facei)
|
||||||
{
|
{
|
||||||
// Evaluate new effective thermal diffusivity
|
// Evaluate new effective thermal diffusivity
|
||||||
scalar alphaEff = 0.0;
|
scalar alphaEff = 0.0;
|
||||||
if (yPlus[faceI] < yPlusTherm[faceI])
|
if (yPlus[facei] < yPlusTherm[facei])
|
||||||
{
|
{
|
||||||
scalar A = qDot[faceI]*rhow[faceI]*uTau[faceI]*y[faceI];
|
scalar A = qDot[facei]*rhow[facei]*uTau[facei]*y[facei];
|
||||||
scalar B = qDot[faceI]*Pr[faceI]*yPlus[faceI];
|
scalar B = qDot[facei]*Pr[facei]*yPlus[facei];
|
||||||
scalar C = Pr[faceI]*0.5*rhow[faceI]*uTau[faceI]*sqr(magUp[faceI]);
|
scalar C = Pr[facei]*0.5*rhow[facei]*uTau[facei]*sqr(magUp[facei]);
|
||||||
alphaEff = A/(B + C + VSMALL);
|
alphaEff = A/(B + C + VSMALL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
scalar A = qDot[faceI]*rhow[faceI]*uTau[faceI]*y[faceI];
|
scalar A = qDot[facei]*rhow[facei]*uTau[facei]*y[facei];
|
||||||
scalar B =
|
scalar B =
|
||||||
qDot[faceI]*Prt_*(1.0/kappa_*log(E_*yPlus[faceI]) + P[faceI]);
|
qDot[facei]*Prt_*(1.0/kappa_*log(E_*yPlus[facei]) + P[facei]);
|
||||||
scalar magUc =
|
scalar magUc =
|
||||||
uTau[faceI]/kappa_*log(E_*yPlusTherm[faceI]) - mag(Uw[faceI]);
|
uTau[facei]/kappa_*log(E_*yPlusTherm[facei]) - mag(Uw[facei]);
|
||||||
scalar C =
|
scalar C =
|
||||||
0.5*rhow[faceI]*uTau[faceI]
|
0.5*rhow[facei]*uTau[facei]
|
||||||
*(Prt_*sqr(magUp[faceI]) + (Pr[faceI] - Prt_)*sqr(magUc));
|
*(Prt_*sqr(magUp[facei]) + (Pr[facei] - Prt_)*sqr(magUc));
|
||||||
alphaEff = A/(B + C + VSMALL);
|
alphaEff = A/(B + C + VSMALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update convective heat transfer turbulent thermal diffusivity
|
// Update convective heat transfer turbulent thermal diffusivity
|
||||||
alphatConv[faceI] = max(0.0, alphaEff - alphaw[faceI]);
|
alphatConv[facei] = max(0.0, alphaEff - alphaw[facei]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return talphatConv;
|
return talphatConv;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -88,9 +88,9 @@ int main(int argc, char *argv[])
|
|||||||
dimensionedScalar("aggomeration", dimless, 0.0)
|
dimensionedScalar("aggomeration", dimless, 0.0)
|
||||||
);
|
);
|
||||||
scalarField& fld = scalarAgglomeration.internalField();
|
scalarField& fld = scalarAgglomeration.internalField();
|
||||||
forAll(fld, cellI)
|
forAll(fld, celli)
|
||||||
{
|
{
|
||||||
fld[cellI] = cellToCoarse[cellI];
|
fld[celli] = cellToCoarse[celli];
|
||||||
}
|
}
|
||||||
fld /= max(fld);
|
fld /= max(fld);
|
||||||
scalarAgglomeration.correctBoundaryConditions();
|
scalarAgglomeration.correctBoundaryConditions();
|
||||||
@ -167,9 +167,9 @@ int main(int argc, char *argv[])
|
|||||||
dimensionedScalar("aggomeration", dimless, 0.0)
|
dimensionedScalar("aggomeration", dimless, 0.0)
|
||||||
);
|
);
|
||||||
scalarField& fld = scalarAgglomeration.internalField();
|
scalarField& fld = scalarAgglomeration.internalField();
|
||||||
forAll(fld, cellI)
|
forAll(fld, celli)
|
||||||
{
|
{
|
||||||
fld[cellI] = cellToCoarse[cellI];
|
fld[celli] = cellToCoarse[celli];
|
||||||
}
|
}
|
||||||
if (normalise)
|
if (normalise)
|
||||||
{
|
{
|
||||||
@ -185,9 +185,9 @@ int main(int argc, char *argv[])
|
|||||||
label vertI = 0;
|
label vertI = 0;
|
||||||
|
|
||||||
// Write all mesh cc
|
// Write all mesh cc
|
||||||
forAll(mesh.cellCentres(), cellI)
|
forAll(mesh.cellCentres(), celli)
|
||||||
{
|
{
|
||||||
meshTools::writeOBJ(str, mesh.cellCentres()[cellI]);
|
meshTools::writeOBJ(str, mesh.cellCentres()[celli]);
|
||||||
vertI++;
|
vertI++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,9 +205,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAll(cellLabels, i)
|
forAll(cellLabels, i)
|
||||||
{
|
{
|
||||||
label cellI = cellLabels[i];
|
label celli = cellLabels[i];
|
||||||
|
|
||||||
str << "l " << cellI+1 << ' ' << vertI << nl;
|
str << "l " << celli+1 << ' ' << vertI << nl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -114,9 +114,9 @@ int main(int argc, char *argv[])
|
|||||||
dimensionedScalar("patchDist", dimLength, 0.0)
|
dimensionedScalar("patchDist", dimLength, 0.0)
|
||||||
);
|
);
|
||||||
scalarField pf(vsf.boundaryField()[patch.index()].size());
|
scalarField pf(vsf.boundaryField()[patch.index()].size());
|
||||||
forAll(pf, faceI)
|
forAll(pf, facei)
|
||||||
{
|
{
|
||||||
pf[faceI] = Foam::sqrt(allFaceInfo[faceI].distSqr());
|
pf[facei] = Foam::sqrt(allFaceInfo[facei].distSqr());
|
||||||
}
|
}
|
||||||
vsf.boundaryFieldRef()[patch.index()] = pf;
|
vsf.boundaryFieldRef()[patch.index()] = pf;
|
||||||
|
|
||||||
|
|||||||
@ -72,10 +72,10 @@ using namespace Foam;
|
|||||||
// const faceList& localFaces = p.localFaces();
|
// const faceList& localFaces = p.localFaces();
|
||||||
// const vectorField& faceAreas = mesh.faceAreas();
|
// const vectorField& faceAreas = mesh.faceAreas();
|
||||||
//
|
//
|
||||||
// forAll(localFaces, faceI)
|
// forAll(localFaces, facei)
|
||||||
// {
|
// {
|
||||||
// const face& f = localFaces[faceI];
|
// const face& f = localFaces[facei];
|
||||||
// const vector& n = faceAreas[meshFaces[faceI]];
|
// const vector& n = faceAreas[meshFaces[facei]];
|
||||||
// forAll(f, fp)
|
// forAll(f, fp)
|
||||||
// {
|
// {
|
||||||
// extrudeN[f[fp]] += n;
|
// extrudeN[f[fp]] += n;
|
||||||
|
|||||||
@ -168,13 +168,13 @@ int main(int argc, char *argv[])
|
|||||||
// stencilPoints
|
// stencilPoints
|
||||||
// );
|
// );
|
||||||
//
|
//
|
||||||
// forAll(stencilPoints, faceI)
|
// forAll(stencilPoints, facei)
|
||||||
// {
|
// {
|
||||||
// writeStencilOBJ
|
// writeStencilOBJ
|
||||||
// (
|
// (
|
||||||
// runTime.path()/"faceEdgeCell" + Foam::name(faceI) + ".obj",
|
// runTime.path()/"faceEdgeCell" + Foam::name(facei) + ".obj",
|
||||||
// mesh.faceCentres()[faceI],
|
// mesh.faceCentres()[facei],
|
||||||
// stencilPoints[faceI]
|
// stencilPoints[facei]
|
||||||
// );
|
// );
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@ -200,14 +200,14 @@ int main(int argc, char *argv[])
|
|||||||
// //{
|
// //{
|
||||||
// // const labelListList& stencil = addressing.stencil();
|
// // const labelListList& stencil = addressing.stencil();
|
||||||
// // List<List<scalar>> stencilWeights(stencil.size());
|
// // List<List<scalar>> stencilWeights(stencil.size());
|
||||||
// // forAll(stencil, faceI)
|
// // forAll(stencil, facei)
|
||||||
// // {
|
// // {
|
||||||
// // const labelList& fStencil = stencil[faceI];
|
// // const labelList& fStencil = stencil[facei];
|
||||||
// //
|
// //
|
||||||
// // if (fStencil.size() > 0)
|
// // if (fStencil.size() > 0)
|
||||||
// // {
|
// // {
|
||||||
// // // Uniform weights
|
// // // Uniform weights
|
||||||
// // stencilWeights[faceI] = scalarList
|
// // stencilWeights[facei] = scalarList
|
||||||
// // (
|
// // (
|
||||||
// // fStencil.size(),
|
// // fStencil.size(),
|
||||||
// // 1.0/fStencil.size()
|
// // 1.0/fStencil.size()
|
||||||
@ -230,15 +230,15 @@ int main(int argc, char *argv[])
|
|||||||
// stencilPoints
|
// stencilPoints
|
||||||
// );
|
// );
|
||||||
//
|
//
|
||||||
// forAll(stencilPoints, faceI)
|
// forAll(stencilPoints, facei)
|
||||||
// {
|
// {
|
||||||
// if (stencilPoints[faceI].size() >= 15)
|
// if (stencilPoints[facei].size() >= 15)
|
||||||
// {
|
// {
|
||||||
// writeStencilOBJ
|
// writeStencilOBJ
|
||||||
// (
|
// (
|
||||||
// runTime.path()/"centredFace" + Foam::name(faceI) + ".obj",
|
// runTime.path()/"centredFace" + Foam::name(facei) + ".obj",
|
||||||
// mesh.faceCentres()[faceI],
|
// mesh.faceCentres()[facei],
|
||||||
// stencilPoints[faceI]
|
// stencilPoints[facei]
|
||||||
// );
|
// );
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@ -267,13 +267,13 @@ int main(int argc, char *argv[])
|
|||||||
// // stencilPoints
|
// // stencilPoints
|
||||||
// //);
|
// //);
|
||||||
// //
|
// //
|
||||||
// //forAll(stencilPoints, faceI)
|
// //forAll(stencilPoints, facei)
|
||||||
// //{
|
// //{
|
||||||
// // writeStencilOBJ
|
// // writeStencilOBJ
|
||||||
// // (
|
// // (
|
||||||
// // runTime.path()/"centredPoint" + Foam::name(faceI) + ".obj",
|
// // runTime.path()/"centredPoint" + Foam::name(facei) + ".obj",
|
||||||
// // mesh.faceCentres()[faceI],
|
// // mesh.faceCentres()[facei],
|
||||||
// // stencilPoints[faceI]
|
// // stencilPoints[facei]
|
||||||
// // );
|
// // );
|
||||||
// //}
|
// //}
|
||||||
// }
|
// }
|
||||||
@ -302,13 +302,13 @@ int main(int argc, char *argv[])
|
|||||||
// // stencilPoints
|
// // stencilPoints
|
||||||
// //);
|
// //);
|
||||||
// //
|
// //
|
||||||
// //forAll(stencilPoints, faceI)
|
// //forAll(stencilPoints, facei)
|
||||||
// //{
|
// //{
|
||||||
// // writeStencilOBJ
|
// // writeStencilOBJ
|
||||||
// // (
|
// // (
|
||||||
// // runTime.path()/"centredEdge" + Foam::name(faceI) + ".obj",
|
// // runTime.path()/"centredEdge" + Foam::name(facei) + ".obj",
|
||||||
// // mesh.faceCentres()[faceI],
|
// // mesh.faceCentres()[facei],
|
||||||
// // stencilPoints[faceI]
|
// // stencilPoints[facei]
|
||||||
// // );
|
// // );
|
||||||
// //}
|
// //}
|
||||||
// }
|
// }
|
||||||
@ -340,13 +340,13 @@ int main(int argc, char *argv[])
|
|||||||
// ownPoints
|
// ownPoints
|
||||||
// );
|
// );
|
||||||
//
|
//
|
||||||
// forAll(ownPoints, faceI)
|
// forAll(ownPoints, facei)
|
||||||
// {
|
// {
|
||||||
// writeStencilOBJ
|
// writeStencilOBJ
|
||||||
// (
|
// (
|
||||||
// runTime.path()/"ownFEC" + Foam::name(faceI) + ".obj",
|
// runTime.path()/"ownFEC" + Foam::name(facei) + ".obj",
|
||||||
// mesh.faceCentres()[faceI],
|
// mesh.faceCentres()[facei],
|
||||||
// ownPoints[faceI]
|
// ownPoints[facei]
|
||||||
// );
|
// );
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@ -361,13 +361,13 @@ int main(int argc, char *argv[])
|
|||||||
// neiPoints
|
// neiPoints
|
||||||
// );
|
// );
|
||||||
//
|
//
|
||||||
// forAll(neiPoints, faceI)
|
// forAll(neiPoints, facei)
|
||||||
// {
|
// {
|
||||||
// writeStencilOBJ
|
// writeStencilOBJ
|
||||||
// (
|
// (
|
||||||
// runTime.path()/"neiFEC" + Foam::name(faceI) + ".obj",
|
// runTime.path()/"neiFEC" + Foam::name(facei) + ".obj",
|
||||||
// mesh.faceCentres()[faceI],
|
// mesh.faceCentres()[facei],
|
||||||
// neiPoints[faceI]
|
// neiPoints[facei]
|
||||||
// );
|
// );
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@ -400,13 +400,13 @@ int main(int argc, char *argv[])
|
|||||||
// ownPoints
|
// ownPoints
|
||||||
// );
|
// );
|
||||||
//
|
//
|
||||||
// forAll(ownPoints, faceI)
|
// forAll(ownPoints, facei)
|
||||||
// {
|
// {
|
||||||
// writeStencilOBJ
|
// writeStencilOBJ
|
||||||
// (
|
// (
|
||||||
// runTime.path()/"ownCFC" + Foam::name(faceI) + ".obj",
|
// runTime.path()/"ownCFC" + Foam::name(facei) + ".obj",
|
||||||
// mesh.faceCentres()[faceI],
|
// mesh.faceCentres()[facei],
|
||||||
// ownPoints[faceI]
|
// ownPoints[facei]
|
||||||
// );
|
// );
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@ -421,13 +421,13 @@ int main(int argc, char *argv[])
|
|||||||
// neiPoints
|
// neiPoints
|
||||||
// );
|
// );
|
||||||
//
|
//
|
||||||
// forAll(neiPoints, faceI)
|
// forAll(neiPoints, facei)
|
||||||
// {
|
// {
|
||||||
// writeStencilOBJ
|
// writeStencilOBJ
|
||||||
// (
|
// (
|
||||||
// runTime.path()/"neiCFC" + Foam::name(faceI) + ".obj",
|
// runTime.path()/"neiCFC" + Foam::name(facei) + ".obj",
|
||||||
// mesh.faceCentres()[faceI],
|
// mesh.faceCentres()[facei],
|
||||||
// neiPoints[faceI]
|
// neiPoints[facei]
|
||||||
// );
|
// );
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@ -458,13 +458,13 @@ int main(int argc, char *argv[])
|
|||||||
stencilPoints
|
stencilPoints
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(stencilPoints, cellI)
|
forAll(stencilPoints, celli)
|
||||||
{
|
{
|
||||||
writeStencilOBJ
|
writeStencilOBJ
|
||||||
(
|
(
|
||||||
runTime.path()/"centredCECCell" + Foam::name(cellI) + ".obj",
|
runTime.path()/"centredCECCell" + Foam::name(celli) + ".obj",
|
||||||
mesh.cellCentres()[cellI],
|
mesh.cellCentres()[celli],
|
||||||
stencilPoints[cellI]
|
stencilPoints[celli]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -486,13 +486,13 @@ int main(int argc, char *argv[])
|
|||||||
stencilPoints
|
stencilPoints
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(stencilPoints, cellI)
|
forAll(stencilPoints, celli)
|
||||||
{
|
{
|
||||||
writeStencilOBJ
|
writeStencilOBJ
|
||||||
(
|
(
|
||||||
runTime.path()/"centredCPCCell" + Foam::name(cellI) + ".obj",
|
runTime.path()/"centredCPCCell" + Foam::name(celli) + ".obj",
|
||||||
mesh.cellCentres()[cellI],
|
mesh.cellCentres()[celli],
|
||||||
stencilPoints[cellI]
|
stencilPoints[celli]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -514,13 +514,13 @@ int main(int argc, char *argv[])
|
|||||||
stencilPoints
|
stencilPoints
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(stencilPoints, cellI)
|
forAll(stencilPoints, celli)
|
||||||
{
|
{
|
||||||
writeStencilOBJ
|
writeStencilOBJ
|
||||||
(
|
(
|
||||||
runTime.path()/"centredCFCCell" + Foam::name(cellI) + ".obj",
|
runTime.path()/"centredCFCCell" + Foam::name(celli) + ".obj",
|
||||||
mesh.cellCentres()[cellI],
|
mesh.cellCentres()[celli],
|
||||||
stencilPoints[cellI]
|
stencilPoints[celli]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -538,12 +538,12 @@ int main(int argc, char *argv[])
|
|||||||
// );
|
// );
|
||||||
// for (label faci = 0; faci < mesh.nInternalFaces(); faci++)
|
// for (label faci = 0; faci < mesh.nInternalFaces(); faci++)
|
||||||
// {
|
// {
|
||||||
// const scalarList& stData = stencilData[faceI];
|
// const scalarList& stData = stencilData[facei];
|
||||||
// const scalarList& stWeight = fit[faceI];
|
// const scalarList& stWeight = fit[facei];
|
||||||
//
|
//
|
||||||
// forAll(stData, i)
|
// forAll(stData, i)
|
||||||
// {
|
// {
|
||||||
// sf[faceI] += stWeight[i]*stData[i];
|
// sf[facei] += stWeight[i]*stData[i];
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// See finiteVolume/lnInclude/leastSquaresGrad.C
|
// See finiteVolume/lnInclude/leastSquaresGrad.C
|
||||||
|
|||||||
@ -150,9 +150,9 @@ int main(int argc, char *argv[])
|
|||||||
List<point> compactFld(map.constructSize(), Zero);
|
List<point> compactFld(map.constructSize(), Zero);
|
||||||
|
|
||||||
// Insert my internal values
|
// Insert my internal values
|
||||||
forAll(fld, cellI)
|
forAll(fld, celli)
|
||||||
{
|
{
|
||||||
compactFld[cellI] = fld[cellI];
|
compactFld[celli] = fld[celli];
|
||||||
}
|
}
|
||||||
// Insert my boundary values
|
// Insert my boundary values
|
||||||
label nCompact = fld.size();
|
label nCompact = fld.size();
|
||||||
@ -172,27 +172,27 @@ int main(int argc, char *argv[])
|
|||||||
// 2. Pull to stencil
|
// 2. Pull to stencil
|
||||||
stencilPoints.setSize(stencil.size());
|
stencilPoints.setSize(stencil.size());
|
||||||
|
|
||||||
forAll(stencil, cellI)
|
forAll(stencil, celli)
|
||||||
{
|
{
|
||||||
const labelList& compactCells = stencil[cellI];
|
const labelList& compactCells = stencil[celli];
|
||||||
|
|
||||||
stencilPoints[cellI].setSize(compactCells.size());
|
stencilPoints[celli].setSize(compactCells.size());
|
||||||
|
|
||||||
forAll(compactCells, i)
|
forAll(compactCells, i)
|
||||||
{
|
{
|
||||||
stencilPoints[cellI][i] = compactFld[compactCells[i]];
|
stencilPoints[celli][i] = compactFld[compactCells[i]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
forAll(stencilPoints, cellI)
|
forAll(stencilPoints, celli)
|
||||||
{
|
{
|
||||||
writeStencilOBJ
|
writeStencilOBJ
|
||||||
(
|
(
|
||||||
runTime.path()/"centredCell" + Foam::name(cellI) + ".obj",
|
runTime.path()/"centredCell" + Foam::name(celli) + ".obj",
|
||||||
mesh.cellCentres()[cellI],
|
mesh.cellCentres()[celli],
|
||||||
stencilPoints[cellI]
|
stencilPoints[celli]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -66,26 +66,26 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convert from local to global and back.
|
// convert from local to global and back.
|
||||||
for (label cellI = 0; cellI < mesh.nCells(); cellI++)
|
for (label celli = 0; celli < mesh.nCells(); celli++)
|
||||||
{
|
{
|
||||||
// to global index
|
// to global index
|
||||||
label globalCellI = globalNumbering.toGlobal(cellI);
|
label globalCellI = globalNumbering.toGlobal(celli);
|
||||||
|
|
||||||
// and back
|
// and back
|
||||||
label procI = globalNumbering.whichProcID(globalCellI);
|
label procI = globalNumbering.whichProcID(globalCellI);
|
||||||
label localCellI = globalNumbering.toLocal(globalCellI);
|
label localCellI = globalNumbering.toLocal(globalCellI);
|
||||||
|
|
||||||
if (procI != Pstream::myProcNo() || localCellI != cellI)
|
if (procI != Pstream::myProcNo() || localCellI != celli)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Problem. cellI:" << cellI << " localCellI:" << localCellI
|
<< "Problem. celli:" << celli << " localCellI:" << localCellI
|
||||||
<< " procI:" << procI << abort(FatalError);
|
<< " procI:" << procI << abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!globalNumbering.isLocal(globalCellI))
|
if (!globalNumbering.isLocal(globalCellI))
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Problem. cellI:" << cellI << " globalCellI:" << globalCellI
|
<< "Problem. celli:" << celli << " globalCellI:" << globalCellI
|
||||||
<< " not local" << abort(FatalError);
|
<< " not local" << abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -196,16 +196,16 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const label cellI = args.optionLookupOrDefault("cell", 0);
|
const label celli = args.optionLookupOrDefault("cell", 0);
|
||||||
|
|
||||||
tensorField mI(momentOfInertia::meshInertia(mesh));
|
tensorField mI(momentOfInertia::meshInertia(mesh));
|
||||||
|
|
||||||
tensor& J = mI[cellI];
|
tensor& J = mI[celli];
|
||||||
|
|
||||||
vector eVal = eigenValues(J);
|
vector eVal = eigenValues(J);
|
||||||
|
|
||||||
Info<< nl
|
Info<< nl
|
||||||
<< "Inertia tensor of cell " << cellI << " " << J << nl
|
<< "Inertia tensor of cell " << celli << " " << J << nl
|
||||||
<< "eigenValues (principal moments) " << eVal << endl;
|
<< "eigenValues (principal moments) " << eVal << endl;
|
||||||
|
|
||||||
J /= cmptMax(eVal);
|
J /= cmptMax(eVal);
|
||||||
@ -215,16 +215,16 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "eigenVectors (principal axes, from normalised inertia) " << eVec
|
Info<< "eigenVectors (principal axes, from normalised inertia) " << eVec
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
OFstream str("cell_" + name(cellI) + "_inertia.obj");
|
OFstream str("cell_" + name(celli) + "_inertia.obj");
|
||||||
|
|
||||||
Info<< nl << "Writing scaled principal axes of cell " << cellI << " to "
|
Info<< nl << "Writing scaled principal axes of cell " << celli << " to "
|
||||||
<< str.name() << endl;
|
<< str.name() << endl;
|
||||||
|
|
||||||
const point& cC = mesh.cellCentres()[cellI];
|
const point& cC = mesh.cellCentres()[celli];
|
||||||
|
|
||||||
scalar scale = mag
|
scalar scale = mag
|
||||||
(
|
(
|
||||||
(cC - mesh.faceCentres()[mesh.cells()[cellI][0]])
|
(cC - mesh.faceCentres()[mesh.cells()[celli][0]])
|
||||||
/eVal.component(findMin(eVal))
|
/eVal.component(findMin(eVal))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -76,11 +76,11 @@ int main(int argc, char *argv[])
|
|||||||
DynamicList<label> changedEdges(4*patch.size());
|
DynamicList<label> changedEdges(4*patch.size());
|
||||||
DynamicList<patchEdgeFaceRegions> changedInfo(changedEdges.size());
|
DynamicList<patchEdgeFaceRegions> changedInfo(changedEdges.size());
|
||||||
|
|
||||||
forAll(patch, faceI)
|
forAll(patch, facei)
|
||||||
{
|
{
|
||||||
const labelList& fEdges = patch.faceEdges()[faceI];
|
const labelList& fEdges = patch.faceEdges()[facei];
|
||||||
|
|
||||||
label globalFaceI = globalNumbering.toGlobal(faceI);
|
label globalFaceI = globalNumbering.toGlobal(facei);
|
||||||
|
|
||||||
forAll(fEdges, i)
|
forAll(fEdges, i)
|
||||||
{
|
{
|
||||||
@ -117,13 +117,13 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
labelList currentRegion(patch.nPoints(), -1);
|
labelList currentRegion(patch.nPoints(), -1);
|
||||||
|
|
||||||
forAll(patch.localFaces(), faceI)
|
forAll(patch.localFaces(), facei)
|
||||||
{
|
{
|
||||||
const face& f = patch.localFaces()[faceI];
|
const face& f = patch.localFaces()[facei];
|
||||||
|
|
||||||
forAll(f, fp)
|
forAll(f, fp)
|
||||||
{
|
{
|
||||||
label faceRegion = allFaceInfo[faceI].regions()[fp];
|
label faceRegion = allFaceInfo[facei].regions()[fp];
|
||||||
|
|
||||||
label pointI = f[fp];
|
label pointI = f[fp];
|
||||||
|
|
||||||
|
|||||||
@ -59,11 +59,11 @@ void checkFaceEdges
|
|||||||
const labelListList& faceEdges
|
const labelListList& faceEdges
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
forAll(faceEdges, faceI)
|
forAll(faceEdges, facei)
|
||||||
{
|
{
|
||||||
const face& f = localFaces[faceI];
|
const face& f = localFaces[facei];
|
||||||
|
|
||||||
const labelList& myEdges = faceEdges[faceI];
|
const labelList& myEdges = faceEdges[facei];
|
||||||
|
|
||||||
forAll(f, fp)
|
forAll(f, fp)
|
||||||
{
|
{
|
||||||
@ -73,7 +73,7 @@ void checkFaceEdges
|
|||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Edges of face not in face point order:"
|
<< "Edges of face not in face point order:"
|
||||||
<< "face:" << faceI << " localF:" << f
|
<< "face:" << facei << " localF:" << f
|
||||||
<< " faceEdges:" << myEdges
|
<< " faceEdges:" << myEdges
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
@ -130,9 +130,9 @@ void writeFaceEdges
|
|||||||
|
|
||||||
writeObj(feStream, localPoints);
|
writeObj(feStream, localPoints);
|
||||||
|
|
||||||
forAll(faceEdges, faceI)
|
forAll(faceEdges, facei)
|
||||||
{
|
{
|
||||||
const labelList& myEdges = faceEdges[faceI];
|
const labelList& myEdges = faceEdges[facei];
|
||||||
|
|
||||||
forAll(myEdges, i)
|
forAll(myEdges, i)
|
||||||
{
|
{
|
||||||
@ -158,9 +158,9 @@ void writeEdgeFaces
|
|||||||
|
|
||||||
pointField ctrs(localFaces.size(), Zero);
|
pointField ctrs(localFaces.size(), Zero);
|
||||||
|
|
||||||
forAll(localFaces, faceI)
|
forAll(localFaces, facei)
|
||||||
{
|
{
|
||||||
ctrs[faceI] = localFaces[faceI].centre(localPoints);
|
ctrs[facei] = localFaces[facei].centre(localPoints);
|
||||||
}
|
}
|
||||||
writeObj(efStream, ctrs);
|
writeObj(efStream, ctrs);
|
||||||
|
|
||||||
@ -190,19 +190,19 @@ void writeFaceFaces
|
|||||||
|
|
||||||
pointField ctrs(localFaces.size(), Zero);
|
pointField ctrs(localFaces.size(), Zero);
|
||||||
|
|
||||||
forAll(localFaces, faceI)
|
forAll(localFaces, facei)
|
||||||
{
|
{
|
||||||
ctrs[faceI] = localFaces[faceI].centre(localPoints);
|
ctrs[facei] = localFaces[facei].centre(localPoints);
|
||||||
}
|
}
|
||||||
writeObj(ffStream, ctrs);
|
writeObj(ffStream, ctrs);
|
||||||
|
|
||||||
forAll(faceFaces, faceI)
|
forAll(faceFaces, facei)
|
||||||
{
|
{
|
||||||
const labelList& nbrs = faceFaces[faceI];
|
const labelList& nbrs = faceFaces[facei];
|
||||||
|
|
||||||
forAll(nbrs, nbI)
|
forAll(nbrs, nbI)
|
||||||
{
|
{
|
||||||
ffStream << "l " << faceI+1 << ' ' << nbrs[nbI]+1 << endl;
|
ffStream << "l " << facei+1 << ' ' << nbrs[nbI]+1 << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -141,15 +141,15 @@ void testPackedList(const polyMesh& mesh, Random& rndGen)
|
|||||||
|
|
||||||
{
|
{
|
||||||
PackedList<3> bits(mesh.nFaces());
|
PackedList<3> bits(mesh.nFaces());
|
||||||
forAll(bits, faceI)
|
forAll(bits, facei)
|
||||||
{
|
{
|
||||||
bits.set(faceI, rndGen.integer(0,3));
|
bits.set(facei, rndGen.integer(0,3));
|
||||||
}
|
}
|
||||||
|
|
||||||
labelList faceValues(mesh.nFaces());
|
labelList faceValues(mesh.nFaces());
|
||||||
forAll(bits, faceI)
|
forAll(bits, facei)
|
||||||
{
|
{
|
||||||
faceValues[faceI] = bits.get(faceI);
|
faceValues[facei] = bits.get(facei);
|
||||||
}
|
}
|
||||||
|
|
||||||
PackedList<3> maxBits(bits);
|
PackedList<3> maxBits(bits);
|
||||||
@ -161,20 +161,20 @@ void testPackedList(const polyMesh& mesh, Random& rndGen)
|
|||||||
syncTools::syncFaceList(mesh, maxBits, maxEqOp<unsigned int>());
|
syncTools::syncFaceList(mesh, maxBits, maxEqOp<unsigned int>());
|
||||||
syncTools::syncFaceList(mesh, maxFaceValues, maxEqOp<label>());
|
syncTools::syncFaceList(mesh, maxFaceValues, maxEqOp<label>());
|
||||||
|
|
||||||
forAll(bits, faceI)
|
forAll(bits, facei)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
faceValues[faceI] != label(bits.get(faceI))
|
faceValues[facei] != label(bits.get(facei))
|
||||||
|| maxFaceValues[faceI] != label(maxBits.get(faceI))
|
|| maxFaceValues[facei] != label(maxBits.get(facei))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "face:" << faceI
|
<< "face:" << facei
|
||||||
<< " minlabel:" << faceValues[faceI]
|
<< " minlabel:" << faceValues[facei]
|
||||||
<< " minbits:" << bits.get(faceI)
|
<< " minbits:" << bits.get(facei)
|
||||||
<< " maxLabel:" << maxFaceValues[faceI]
|
<< " maxLabel:" << maxFaceValues[facei]
|
||||||
<< " maxBits:" << maxBits.get(faceI)
|
<< " maxBits:" << maxBits.get(facei)
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -532,14 +532,14 @@ void testFaceSync(const polyMesh& mesh, Random& rndGen)
|
|||||||
maxMagSqrEqOp<point>()
|
maxMagSqrEqOp<point>()
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(syncedFc, faceI)
|
forAll(syncedFc, facei)
|
||||||
{
|
{
|
||||||
if (mag(syncedFc[faceI] - mesh.faceCentres()[faceI]) > SMALL)
|
if (mag(syncedFc[facei] - mesh.faceCentres()[facei]) > SMALL)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Face " << faceI
|
<< "Face " << facei
|
||||||
<< " original centre " << mesh.faceCentres()[faceI]
|
<< " original centre " << mesh.faceCentres()[facei]
|
||||||
<< " synced centre " << syncedFc[faceI]
|
<< " synced centre " << syncedFc[facei]
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -552,11 +552,11 @@ void testFaceSync(const polyMesh& mesh, Random& rndGen)
|
|||||||
|
|
||||||
PackedBoolList isMasterFace(syncTools::getMasterFaces(mesh));
|
PackedBoolList isMasterFace(syncTools::getMasterFaces(mesh));
|
||||||
|
|
||||||
forAll(isMasterFace, faceI)
|
forAll(isMasterFace, facei)
|
||||||
{
|
{
|
||||||
if (isMasterFace[faceI])
|
if (isMasterFace[facei])
|
||||||
{
|
{
|
||||||
nMasters[faceI] = 1;
|
nMasters[facei] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -567,14 +567,14 @@ void testFaceSync(const polyMesh& mesh, Random& rndGen)
|
|||||||
plusEqOp<label>()
|
plusEqOp<label>()
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(nMasters, faceI)
|
forAll(nMasters, facei)
|
||||||
{
|
{
|
||||||
if (nMasters[faceI] != 1)
|
if (nMasters[facei] != 1)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Face " << faceI
|
<< "Face " << facei
|
||||||
<< " centre " << mesh.faceCentres()[faceI]
|
<< " centre " << mesh.faceCentres()[facei]
|
||||||
<< " has " << nMasters[faceI]
|
<< " has " << nMasters[facei]
|
||||||
<< " masters."
|
<< " masters."
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -68,7 +68,7 @@ void modifyOrAddFace
|
|||||||
(
|
(
|
||||||
polyTopoChange& meshMod,
|
polyTopoChange& meshMod,
|
||||||
const face& f,
|
const face& f,
|
||||||
const label faceI,
|
const label facei,
|
||||||
const label own,
|
const label own,
|
||||||
const bool flipFaceFlux,
|
const bool flipFaceFlux,
|
||||||
const label newPatchI,
|
const label newPatchI,
|
||||||
@ -78,7 +78,7 @@ void modifyOrAddFace
|
|||||||
PackedBoolList& modifiedFace
|
PackedBoolList& modifiedFace
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (!modifiedFace[faceI])
|
if (!modifiedFace[facei])
|
||||||
{
|
{
|
||||||
// First usage of face. Modify.
|
// First usage of face. Modify.
|
||||||
meshMod.setAction
|
meshMod.setAction
|
||||||
@ -86,7 +86,7 @@ void modifyOrAddFace
|
|||||||
polyModifyFace
|
polyModifyFace
|
||||||
(
|
(
|
||||||
f, // modified face
|
f, // modified face
|
||||||
faceI, // label of face
|
facei, // label of face
|
||||||
own, // owner
|
own, // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
flipFaceFlux, // face flip
|
flipFaceFlux, // face flip
|
||||||
@ -96,7 +96,7 @@ void modifyOrAddFace
|
|||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
modifiedFace[faceI] = 1;
|
modifiedFace[facei] = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -110,7 +110,7 @@ void modifyOrAddFace
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
-1, // master point
|
-1, // master point
|
||||||
-1, // master edge
|
-1, // master edge
|
||||||
faceI, // master face
|
facei, // master face
|
||||||
flipFaceFlux, // face flip
|
flipFaceFlux, // face flip
|
||||||
newPatchI, // patch for face
|
newPatchI, // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
@ -321,18 +321,18 @@ void createCoupledBaffles
|
|||||||
{
|
{
|
||||||
const faceZoneMesh& faceZones = mesh.faceZones();
|
const faceZoneMesh& faceZones = mesh.faceZones();
|
||||||
|
|
||||||
forAll(coupledWantedPatch, faceI)
|
forAll(coupledWantedPatch, facei)
|
||||||
{
|
{
|
||||||
if (coupledWantedPatch[faceI] != -1)
|
if (coupledWantedPatch[facei] != -1)
|
||||||
{
|
{
|
||||||
const face& f = mesh.faces()[faceI];
|
const face& f = mesh.faces()[facei];
|
||||||
label zoneID = faceZones.whichZone(faceI);
|
label zoneID = faceZones.whichZone(facei);
|
||||||
bool zoneFlip = false;
|
bool zoneFlip = false;
|
||||||
|
|
||||||
if (zoneID >= 0)
|
if (zoneID >= 0)
|
||||||
{
|
{
|
||||||
const faceZone& fZone = faceZones[zoneID];
|
const faceZone& fZone = faceZones[zoneID];
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use owner side of face
|
// Use owner side of face
|
||||||
@ -340,34 +340,34 @@ void createCoupledBaffles
|
|||||||
(
|
(
|
||||||
meshMod,
|
meshMod,
|
||||||
f, // modified face
|
f, // modified face
|
||||||
faceI, // label of face
|
facei, // label of face
|
||||||
mesh.faceOwner()[faceI], // owner
|
mesh.faceOwner()[facei], // owner
|
||||||
false, // face flip
|
false, // face flip
|
||||||
coupledWantedPatch[faceI], // patch for face
|
coupledWantedPatch[facei], // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip, // face flip in zone
|
zoneFlip, // face flip in zone
|
||||||
modifiedFace // modify or add status
|
modifiedFace // modify or add status
|
||||||
);
|
);
|
||||||
|
|
||||||
if (mesh.isInternalFace(faceI))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
label zoneID = faceZones.whichZone(faceI);
|
label zoneID = faceZones.whichZone(facei);
|
||||||
bool zoneFlip = false;
|
bool zoneFlip = false;
|
||||||
|
|
||||||
if (zoneID >= 0)
|
if (zoneID >= 0)
|
||||||
{
|
{
|
||||||
const faceZone& fZone = faceZones[zoneID];
|
const faceZone& fZone = faceZones[zoneID];
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||||
}
|
}
|
||||||
// Use neighbour side of face
|
// Use neighbour side of face
|
||||||
modifyOrAddFace
|
modifyOrAddFace
|
||||||
(
|
(
|
||||||
meshMod,
|
meshMod,
|
||||||
f.reverseFace(), // modified face
|
f.reverseFace(), // modified face
|
||||||
faceI, // label of face
|
facei, // label of face
|
||||||
mesh.faceNeighbour()[faceI],// owner
|
mesh.faceNeighbour()[facei],// owner
|
||||||
false, // face flip
|
false, // face flip
|
||||||
coupledWantedPatch[faceI], // patch for face
|
coupledWantedPatch[facei], // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip, // face flip in zone
|
zoneFlip, // face flip in zone
|
||||||
modifiedFace // modify or add status
|
modifiedFace // modify or add status
|
||||||
@ -389,29 +389,29 @@ void createCyclicCoupledBaffles
|
|||||||
{
|
{
|
||||||
const faceZoneMesh& faceZones = mesh.faceZones();
|
const faceZoneMesh& faceZones = mesh.faceZones();
|
||||||
|
|
||||||
forAll(cyclicMasterPatch, faceI)
|
forAll(cyclicMasterPatch, facei)
|
||||||
{
|
{
|
||||||
if (cyclicMasterPatch[faceI] != -1)
|
if (cyclicMasterPatch[facei] != -1)
|
||||||
{
|
{
|
||||||
const face& f = mesh.faces()[faceI];
|
const face& f = mesh.faces()[facei];
|
||||||
|
|
||||||
label zoneID = faceZones.whichZone(faceI);
|
label zoneID = faceZones.whichZone(facei);
|
||||||
bool zoneFlip = false;
|
bool zoneFlip = false;
|
||||||
|
|
||||||
if (zoneID >= 0)
|
if (zoneID >= 0)
|
||||||
{
|
{
|
||||||
const faceZone& fZone = faceZones[zoneID];
|
const faceZone& fZone = faceZones[zoneID];
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||||
}
|
}
|
||||||
|
|
||||||
modifyOrAddFace
|
modifyOrAddFace
|
||||||
(
|
(
|
||||||
meshMod,
|
meshMod,
|
||||||
f.reverseFace(), // modified face
|
f.reverseFace(), // modified face
|
||||||
faceI, // label of face
|
facei, // label of face
|
||||||
mesh.faceNeighbour()[faceI], // owner
|
mesh.faceNeighbour()[facei], // owner
|
||||||
false, // face flip
|
false, // face flip
|
||||||
cyclicMasterPatch[faceI], // patch for face
|
cyclicMasterPatch[facei], // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip, // face flip in zone
|
zoneFlip, // face flip in zone
|
||||||
modifiedFace // modify or add
|
modifiedFace // modify or add
|
||||||
@ -419,30 +419,30 @@ void createCyclicCoupledBaffles
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(cyclicSlavePatch, faceI)
|
forAll(cyclicSlavePatch, facei)
|
||||||
{
|
{
|
||||||
if (cyclicSlavePatch[faceI] != -1)
|
if (cyclicSlavePatch[facei] != -1)
|
||||||
{
|
{
|
||||||
const face& f = mesh.faces()[faceI];
|
const face& f = mesh.faces()[facei];
|
||||||
if (mesh.isInternalFace(faceI))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
label zoneID = faceZones.whichZone(faceI);
|
label zoneID = faceZones.whichZone(facei);
|
||||||
bool zoneFlip = false;
|
bool zoneFlip = false;
|
||||||
|
|
||||||
if (zoneID >= 0)
|
if (zoneID >= 0)
|
||||||
{
|
{
|
||||||
const faceZone& fZone = faceZones[zoneID];
|
const faceZone& fZone = faceZones[zoneID];
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||||
}
|
}
|
||||||
// Use owner side of face
|
// Use owner side of face
|
||||||
modifyOrAddFace
|
modifyOrAddFace
|
||||||
(
|
(
|
||||||
meshMod,
|
meshMod,
|
||||||
f, // modified face
|
f, // modified face
|
||||||
faceI, // label of face
|
facei, // label of face
|
||||||
mesh.faceOwner()[faceI], // owner
|
mesh.faceOwner()[facei], // owner
|
||||||
false, // face flip
|
false, // face flip
|
||||||
cyclicSlavePatch[faceI], // patch for face
|
cyclicSlavePatch[facei], // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip, // face flip in zone
|
zoneFlip, // face flip in zone
|
||||||
modifiedFace // modify or add status
|
modifiedFace // modify or add status
|
||||||
@ -462,19 +462,19 @@ void createBaffles
|
|||||||
{
|
{
|
||||||
const faceZoneMesh& faceZones = mesh.faceZones();
|
const faceZoneMesh& faceZones = mesh.faceZones();
|
||||||
Info << "faceZone:createBaffle " << faceZones << endl;
|
Info << "faceZone:createBaffle " << faceZones << endl;
|
||||||
forAll(wantedPatch, faceI)
|
forAll(wantedPatch, facei)
|
||||||
{
|
{
|
||||||
if (wantedPatch[faceI] != -1)
|
if (wantedPatch[facei] != -1)
|
||||||
{
|
{
|
||||||
const face& f = mesh.faces()[faceI];
|
const face& f = mesh.faces()[facei];
|
||||||
|
|
||||||
label zoneID = faceZones.whichZone(faceI);
|
label zoneID = faceZones.whichZone(facei);
|
||||||
bool zoneFlip = false;
|
bool zoneFlip = false;
|
||||||
|
|
||||||
if (zoneID >= 0)
|
if (zoneID >= 0)
|
||||||
{
|
{
|
||||||
const faceZone& fZone = faceZones[zoneID];
|
const faceZone& fZone = faceZones[zoneID];
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.setAction
|
||||||
@ -482,26 +482,26 @@ void createBaffles
|
|||||||
polyModifyFace
|
polyModifyFace
|
||||||
(
|
(
|
||||||
f, // modified face
|
f, // modified face
|
||||||
faceI, // label of face
|
facei, // label of face
|
||||||
mesh.faceOwner()[faceI], // owner
|
mesh.faceOwner()[facei], // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
wantedPatch[faceI], // patch for face
|
wantedPatch[facei], // patch for face
|
||||||
false, // remove from zone
|
false, // remove from zone
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (mesh.isInternalFace(faceI))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
label zoneID = faceZones.whichZone(faceI);
|
label zoneID = faceZones.whichZone(facei);
|
||||||
bool zoneFlip = false;
|
bool zoneFlip = false;
|
||||||
|
|
||||||
if (zoneID >= 0)
|
if (zoneID >= 0)
|
||||||
{
|
{
|
||||||
const faceZone& fZone = faceZones[zoneID];
|
const faceZone& fZone = faceZones[zoneID];
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.setAction
|
||||||
@ -509,13 +509,13 @@ void createBaffles
|
|||||||
polyAddFace
|
polyAddFace
|
||||||
(
|
(
|
||||||
f.reverseFace(), // modified face
|
f.reverseFace(), // modified face
|
||||||
mesh.faceNeighbour()[faceI],// owner
|
mesh.faceNeighbour()[facei],// owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
-1, // masterPointID
|
-1, // masterPointID
|
||||||
-1, // masterEdgeID
|
-1, // masterEdgeID
|
||||||
faceI, // masterFaceID,
|
facei, // masterFaceID,
|
||||||
false, // face flip
|
false, // face flip
|
||||||
wantedPatch[faceI], // patch for face
|
wantedPatch[facei], // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
)
|
||||||
|
|||||||
@ -299,20 +299,20 @@ void addCutNeighbours
|
|||||||
|
|
||||||
forAllConstIter(labelHashSet, cutCells, iter)
|
forAllConstIter(labelHashSet, cutCells, iter)
|
||||||
{
|
{
|
||||||
const label cellI = iter.key();
|
const label celli = iter.key();
|
||||||
const labelList& cFaces = mesh.cells()[cellI];
|
const labelList& cFaces = mesh.cells()[celli];
|
||||||
|
|
||||||
forAll(cFaces, i)
|
forAll(cFaces, i)
|
||||||
{
|
{
|
||||||
const label faceI = cFaces[i];
|
const label facei = cFaces[i];
|
||||||
|
|
||||||
if (mesh.isInternalFace(faceI))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
label nbr = mesh.faceOwner()[faceI];
|
label nbr = mesh.faceOwner()[facei];
|
||||||
|
|
||||||
if (nbr == cellI)
|
if (nbr == celli)
|
||||||
{
|
{
|
||||||
nbr = mesh.faceNeighbour()[faceI];
|
nbr = mesh.faceNeighbour()[facei];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectInside && inside.found(nbr))
|
if (selectInside && inside.found(nbr))
|
||||||
@ -351,11 +351,11 @@ bool limitRefinementLevel
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Do simple check on validity of refinement level.
|
// Do simple check on validity of refinement level.
|
||||||
forAll(refLevel, cellI)
|
forAll(refLevel, celli)
|
||||||
{
|
{
|
||||||
if (!excludeCells.found(cellI))
|
if (!excludeCells.found(celli))
|
||||||
{
|
{
|
||||||
const labelList& cCells = mesh.cellCells()[cellI];
|
const labelList& cCells = mesh.cellCells()[celli];
|
||||||
|
|
||||||
forAll(cCells, i)
|
forAll(cCells, i)
|
||||||
{
|
{
|
||||||
@ -363,13 +363,13 @@ bool limitRefinementLevel
|
|||||||
|
|
||||||
if (!excludeCells.found(nbr))
|
if (!excludeCells.found(nbr))
|
||||||
{
|
{
|
||||||
if (refLevel[cellI] - refLevel[nbr] >= limitDiff)
|
if (refLevel[celli] - refLevel[nbr] >= limitDiff)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Level difference between neighbouring cells "
|
<< "Level difference between neighbouring cells "
|
||||||
<< cellI << " and " << nbr
|
<< celli << " and " << nbr
|
||||||
<< " greater than or equal to " << limitDiff << endl
|
<< " greater than or equal to " << limitDiff << endl
|
||||||
<< "refLevels:" << refLevel[cellI] << ' '
|
<< "refLevels:" << refLevel[celli] << ' '
|
||||||
<< refLevel[nbr] << abort(FatalError);
|
<< refLevel[nbr] << abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -382,9 +382,9 @@ bool limitRefinementLevel
|
|||||||
|
|
||||||
forAllConstIter(labelHashSet, cutCells, iter)
|
forAllConstIter(labelHashSet, cutCells, iter)
|
||||||
{
|
{
|
||||||
// cellI will be refined.
|
// celli will be refined.
|
||||||
const label cellI = iter.key();
|
const label celli = iter.key();
|
||||||
const labelList& cCells = mesh.cellCells()[cellI];
|
const labelList& cCells = mesh.cellCells()[celli];
|
||||||
|
|
||||||
forAll(cCells, i)
|
forAll(cCells, i)
|
||||||
{
|
{
|
||||||
@ -392,7 +392,7 @@ bool limitRefinementLevel
|
|||||||
|
|
||||||
if (!excludeCells.found(nbr) && !cutCells.found(nbr))
|
if (!excludeCells.found(nbr) && !cutCells.found(nbr))
|
||||||
{
|
{
|
||||||
if (refLevel[cellI] + 1 - refLevel[nbr] >= limitDiff)
|
if (refLevel[celli] + 1 - refLevel[nbr] >= limitDiff)
|
||||||
{
|
{
|
||||||
addCutCells.insert(nbr);
|
addCutCells.insert(nbr);
|
||||||
}
|
}
|
||||||
@ -451,9 +451,9 @@ void doRefinement
|
|||||||
|
|
||||||
refLevel.setSize(mesh.nCells());
|
refLevel.setSize(mesh.nCells());
|
||||||
|
|
||||||
for (label cellI = oldCells; cellI < mesh.nCells(); cellI++)
|
for (label celli = oldCells; celli < mesh.nCells(); celli++)
|
||||||
{
|
{
|
||||||
refLevel[cellI] = 0;
|
refLevel[celli] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const labelListList& addedCells = multiRef.addedCells();
|
const labelListList& addedCells = multiRef.addedCells();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -46,7 +46,7 @@ defineTypeNameAndDebug(cellSplitter, 0);
|
|||||||
|
|
||||||
void Foam::cellSplitter::getFaceInfo
|
void Foam::cellSplitter::getFaceInfo
|
||||||
(
|
(
|
||||||
const label faceI,
|
const label facei,
|
||||||
label& patchID,
|
label& patchID,
|
||||||
label& zoneID,
|
label& zoneID,
|
||||||
label& zoneFlip
|
label& zoneFlip
|
||||||
@ -54,12 +54,12 @@ void Foam::cellSplitter::getFaceInfo
|
|||||||
{
|
{
|
||||||
patchID = -1;
|
patchID = -1;
|
||||||
|
|
||||||
if (!mesh_.isInternalFace(faceI))
|
if (!mesh_.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
patchID = mesh_.boundaryMesh().whichPatch(faceI);
|
patchID = mesh_.boundaryMesh().whichPatch(facei);
|
||||||
}
|
}
|
||||||
|
|
||||||
zoneID = mesh_.faceZones().whichZone(faceI);
|
zoneID = mesh_.faceZones().whichZone(facei);
|
||||||
|
|
||||||
zoneFlip = false;
|
zoneFlip = false;
|
||||||
|
|
||||||
@ -67,20 +67,20 @@ void Foam::cellSplitter::getFaceInfo
|
|||||||
{
|
{
|
||||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
||||||
|
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Find the new owner of faceI (since the original cell has been split into
|
// Find the new owner of facei (since the original cell has been split into
|
||||||
// newCells
|
// newCells
|
||||||
Foam::label Foam::cellSplitter::newOwner
|
Foam::label Foam::cellSplitter::newOwner
|
||||||
(
|
(
|
||||||
const label faceI,
|
const label facei,
|
||||||
const Map<labelList>& cellToCells
|
const Map<labelList>& cellToCells
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
label oldOwn = mesh_.faceOwner()[faceI];
|
label oldOwn = mesh_.faceOwner()[facei];
|
||||||
|
|
||||||
Map<labelList>::const_iterator fnd = cellToCells.find(oldOwn);
|
Map<labelList>::const_iterator fnd = cellToCells.find(oldOwn);
|
||||||
|
|
||||||
@ -97,18 +97,18 @@ Foam::label Foam::cellSplitter::newOwner
|
|||||||
|
|
||||||
const cell& cFaces = mesh_.cells()[oldOwn];
|
const cell& cFaces = mesh_.cells()[oldOwn];
|
||||||
|
|
||||||
return newCells[findIndex(cFaces, faceI)];
|
return newCells[findIndex(cFaces, facei)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::cellSplitter::newNeighbour
|
Foam::label Foam::cellSplitter::newNeighbour
|
||||||
(
|
(
|
||||||
const label faceI,
|
const label facei,
|
||||||
const Map<labelList>& cellToCells
|
const Map<labelList>& cellToCells
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
label oldNbr = mesh_.faceNeighbour()[faceI];
|
label oldNbr = mesh_.faceNeighbour()[facei];
|
||||||
|
|
||||||
Map<labelList>::const_iterator fnd = cellToCells.find(oldNbr);
|
Map<labelList>::const_iterator fnd = cellToCells.find(oldNbr);
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ Foam::label Foam::cellSplitter::newNeighbour
|
|||||||
|
|
||||||
const cell& cFaces = mesh_.cells()[oldNbr];
|
const cell& cFaces = mesh_.cells()[oldNbr];
|
||||||
|
|
||||||
return newCells[findIndex(cFaces, faceI)];
|
return newCells[findIndex(cFaces, facei)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,9 +164,9 @@ void Foam::cellSplitter::setRefinement
|
|||||||
|
|
||||||
forAllConstIter(Map<point>, cellToMidPoint, iter)
|
forAllConstIter(Map<point>, cellToMidPoint, iter)
|
||||||
{
|
{
|
||||||
label cellI = iter.key();
|
label celli = iter.key();
|
||||||
|
|
||||||
label anchorPoint = mesh_.cellPoints()[cellI][0];
|
label anchorPoint = mesh_.cellPoints()[celli][0];
|
||||||
|
|
||||||
label addedPointI =
|
label addedPointI =
|
||||||
meshMod.setAction
|
meshMod.setAction
|
||||||
@ -179,11 +179,11 @@ void Foam::cellSplitter::setRefinement
|
|||||||
true // supports a cell
|
true // supports a cell
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
addedPoints_.insert(cellI, addedPointI);
|
addedPoints_.insert(celli, addedPointI);
|
||||||
|
|
||||||
//Pout<< "Added point " << addedPointI
|
//Pout<< "Added point " << addedPointI
|
||||||
// << iter() << " in cell " << cellI << " with centre "
|
// << iter() << " in cell " << celli << " with centre "
|
||||||
// << mesh_.cellCentres()[cellI] << endl;
|
// << mesh_.cellCentres()[celli] << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -195,15 +195,15 @@ void Foam::cellSplitter::setRefinement
|
|||||||
|
|
||||||
forAllConstIter(Map<point>, cellToMidPoint, iter)
|
forAllConstIter(Map<point>, cellToMidPoint, iter)
|
||||||
{
|
{
|
||||||
label cellI = iter.key();
|
label celli = iter.key();
|
||||||
|
|
||||||
const cell& cFaces = mesh_.cells()[cellI];
|
const cell& cFaces = mesh_.cells()[celli];
|
||||||
|
|
||||||
// Cells created for this cell.
|
// Cells created for this cell.
|
||||||
labelList newCells(cFaces.size());
|
labelList newCells(cFaces.size());
|
||||||
|
|
||||||
// First pyramid is the original cell
|
// First pyramid is the original cell
|
||||||
newCells[0] = cellI;
|
newCells[0] = celli;
|
||||||
|
|
||||||
// Add other pyramids
|
// Add other pyramids
|
||||||
for (label i = 1; i < cFaces.size(); i++)
|
for (label i = 1; i < cFaces.size(); i++)
|
||||||
@ -216,7 +216,7 @@ void Foam::cellSplitter::setRefinement
|
|||||||
-1, // master point
|
-1, // master point
|
||||||
-1, // master edge
|
-1, // master edge
|
||||||
-1, // master face
|
-1, // master face
|
||||||
cellI, // master cell
|
celli, // master cell
|
||||||
-1 // zone
|
-1 // zone
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -224,10 +224,10 @@ void Foam::cellSplitter::setRefinement
|
|||||||
newCells[i] = addedCellI;
|
newCells[i] = addedCellI;
|
||||||
}
|
}
|
||||||
|
|
||||||
cellToCells.insert(cellI, newCells);
|
cellToCells.insert(celli, newCells);
|
||||||
|
|
||||||
//Pout<< "Split cell " << cellI
|
//Pout<< "Split cell " << celli
|
||||||
// << " with centre " << mesh_.cellCentres()[cellI] << nl
|
// << " with centre " << mesh_.cellCentres()[celli] << nl
|
||||||
// << " faces:" << cFaces << nl
|
// << " faces:" << cFaces << nl
|
||||||
// << " into :" << newCells << endl;
|
// << " into :" << newCells << endl;
|
||||||
}
|
}
|
||||||
@ -240,13 +240,13 @@ void Foam::cellSplitter::setRefinement
|
|||||||
|
|
||||||
forAllConstIter(Map<point>, cellToMidPoint, iter)
|
forAllConstIter(Map<point>, cellToMidPoint, iter)
|
||||||
{
|
{
|
||||||
label cellI = iter.key();
|
label celli = iter.key();
|
||||||
|
|
||||||
label midPointI = addedPoints_[cellI];
|
label midPointI = addedPoints_[celli];
|
||||||
|
|
||||||
const cell& cFaces = mesh_.cells()[cellI];
|
const cell& cFaces = mesh_.cells()[celli];
|
||||||
|
|
||||||
const labelList& cEdges = mesh_.cellEdges()[cellI];
|
const labelList& cEdges = mesh_.cellEdges()[celli];
|
||||||
|
|
||||||
forAll(cEdges, i)
|
forAll(cEdges, i)
|
||||||
{
|
{
|
||||||
@ -255,11 +255,11 @@ void Foam::cellSplitter::setRefinement
|
|||||||
|
|
||||||
// Get the faces on the cell using the edge
|
// Get the faces on the cell using the edge
|
||||||
label face0, face1;
|
label face0, face1;
|
||||||
meshTools::getEdgeFaces(mesh_, cellI, edgeI, face0, face1);
|
meshTools::getEdgeFaces(mesh_, celli, edgeI, face0, face1);
|
||||||
|
|
||||||
// Get the cells on both sides of the face by indexing into cFaces.
|
// Get the cells on both sides of the face by indexing into cFaces.
|
||||||
// (since newly created cells are stored in cFaces order)
|
// (since newly created cells are stored in cFaces order)
|
||||||
const labelList& newCells = cellToCells[cellI];
|
const labelList& newCells = cellToCells[celli];
|
||||||
|
|
||||||
label cell0 = newCells[findIndex(cFaces, face0)];
|
label cell0 = newCells[findIndex(cFaces, face0)];
|
||||||
label cell1 = newCells[findIndex(cFaces, face1)];
|
label cell1 = newCells[findIndex(cFaces, face1)];
|
||||||
@ -267,7 +267,7 @@ void Foam::cellSplitter::setRefinement
|
|||||||
if (cell0 < cell1)
|
if (cell0 < cell1)
|
||||||
{
|
{
|
||||||
// Construct face to midpoint that is pointing away from
|
// Construct face to midpoint that is pointing away from
|
||||||
// (pyramid split off from) cellI
|
// (pyramid split off from) celli
|
||||||
|
|
||||||
const face& f0 = mesh_.faces()[face0];
|
const face& f0 = mesh_.faces()[face0];
|
||||||
|
|
||||||
@ -275,10 +275,10 @@ void Foam::cellSplitter::setRefinement
|
|||||||
|
|
||||||
bool edgeInFaceOrder = (f0[f0.fcIndex(index)] == e[1]);
|
bool edgeInFaceOrder = (f0[f0.fcIndex(index)] == e[1]);
|
||||||
|
|
||||||
// Check if cellI is the face owner
|
// Check if celli is the face owner
|
||||||
|
|
||||||
face newF(3);
|
face newF(3);
|
||||||
if (edgeInFaceOrder == (mesh_.faceOwner()[face0] == cellI))
|
if (edgeInFaceOrder == (mesh_.faceOwner()[face0] == celli))
|
||||||
{
|
{
|
||||||
// edge used in face order.
|
// edge used in face order.
|
||||||
newF[0] = e[1];
|
newF[0] = e[1];
|
||||||
@ -313,7 +313,7 @@ void Foam::cellSplitter::setRefinement
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Construct face to midpoint that is pointing away from
|
// Construct face to midpoint that is pointing away from
|
||||||
// (pyramid split off from) cellI
|
// (pyramid split off from) celli
|
||||||
|
|
||||||
const face& f1 = mesh_.faces()[face1];
|
const face& f1 = mesh_.faces()[face1];
|
||||||
|
|
||||||
@ -321,10 +321,10 @@ void Foam::cellSplitter::setRefinement
|
|||||||
|
|
||||||
bool edgeInFaceOrder = (f1[f1.fcIndex(index)] == e[1]);
|
bool edgeInFaceOrder = (f1[f1.fcIndex(index)] == e[1]);
|
||||||
|
|
||||||
// Check if cellI is the face owner
|
// Check if celli is the face owner
|
||||||
|
|
||||||
face newF(3);
|
face newF(3);
|
||||||
if (edgeInFaceOrder == (mesh_.faceOwner()[face1] == cellI))
|
if (edgeInFaceOrder == (mesh_.faceOwner()[face1] == celli))
|
||||||
{
|
{
|
||||||
// edge used in face order.
|
// edge used in face order.
|
||||||
newF[0] = e[1];
|
newF[0] = e[1];
|
||||||
@ -370,28 +370,28 @@ void Foam::cellSplitter::setRefinement
|
|||||||
|
|
||||||
forAllConstIter(Map<point>, cellToMidPoint, iter)
|
forAllConstIter(Map<point>, cellToMidPoint, iter)
|
||||||
{
|
{
|
||||||
label cellI = iter.key();
|
label celli = iter.key();
|
||||||
|
|
||||||
const cell& cFaces = mesh_.cells()[cellI];
|
const cell& cFaces = mesh_.cells()[celli];
|
||||||
|
|
||||||
forAll(cFaces, i)
|
forAll(cFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = cFaces[i];
|
label facei = cFaces[i];
|
||||||
|
|
||||||
faceUpToDate[faceI] = false;
|
faceUpToDate[facei] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(faceUpToDate, faceI)
|
forAll(faceUpToDate, facei)
|
||||||
{
|
{
|
||||||
if (!faceUpToDate[faceI])
|
if (!faceUpToDate[facei])
|
||||||
{
|
{
|
||||||
const face& f = mesh_.faces()[faceI];
|
const face& f = mesh_.faces()[facei];
|
||||||
|
|
||||||
if (mesh_.isInternalFace(faceI))
|
if (mesh_.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
label newOwn = newOwner(faceI, cellToCells);
|
label newOwn = newOwner(facei, cellToCells);
|
||||||
label newNbr = newNeighbour(faceI, cellToCells);
|
label newNbr = newNeighbour(facei, cellToCells);
|
||||||
|
|
||||||
if (newOwn < newNbr)
|
if (newOwn < newNbr)
|
||||||
{
|
{
|
||||||
@ -400,7 +400,7 @@ void Foam::cellSplitter::setRefinement
|
|||||||
polyModifyFace
|
polyModifyFace
|
||||||
(
|
(
|
||||||
f,
|
f,
|
||||||
faceI,
|
facei,
|
||||||
newOwn, // owner
|
newOwn, // owner
|
||||||
newNbr, // neighbour
|
newNbr, // neighbour
|
||||||
false, // flux flip
|
false, // flux flip
|
||||||
@ -418,7 +418,7 @@ void Foam::cellSplitter::setRefinement
|
|||||||
polyModifyFace
|
polyModifyFace
|
||||||
(
|
(
|
||||||
f.reverseFace(),
|
f.reverseFace(),
|
||||||
faceI,
|
facei,
|
||||||
newNbr, // owner
|
newNbr, // owner
|
||||||
newOwn, // neighbour
|
newOwn, // neighbour
|
||||||
false, // flux flip
|
false, // flux flip
|
||||||
@ -433,17 +433,17 @@ void Foam::cellSplitter::setRefinement
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
label newOwn = newOwner(faceI, cellToCells);
|
label newOwn = newOwner(facei, cellToCells);
|
||||||
|
|
||||||
label patchID, zoneID, zoneFlip;
|
label patchID, zoneID, zoneFlip;
|
||||||
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
|
getFaceInfo(facei, patchID, zoneID, zoneFlip);
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.setAction
|
||||||
(
|
(
|
||||||
polyModifyFace
|
polyModifyFace
|
||||||
(
|
(
|
||||||
mesh_.faces()[faceI],
|
mesh_.faces()[facei],
|
||||||
faceI,
|
facei,
|
||||||
newOwn, // owner
|
newOwn, // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // flux flip
|
false, // flux flip
|
||||||
@ -455,7 +455,7 @@ void Foam::cellSplitter::setRefinement
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
faceUpToDate[faceI] = true;
|
faceUpToDate[facei] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -71,7 +71,7 @@ class cellSplitter
|
|||||||
//- Get patch and zone info for face
|
//- Get patch and zone info for face
|
||||||
void getFaceInfo
|
void getFaceInfo
|
||||||
(
|
(
|
||||||
const label faceI,
|
const label facei,
|
||||||
label& patchID,
|
label& patchID,
|
||||||
label& zoneID,
|
label& zoneID,
|
||||||
label& zoneFlip
|
label& zoneFlip
|
||||||
@ -80,14 +80,14 @@ class cellSplitter
|
|||||||
//- Find the new owner (if any) of the face.
|
//- Find the new owner (if any) of the face.
|
||||||
label newOwner
|
label newOwner
|
||||||
(
|
(
|
||||||
const label faceI,
|
const label facei,
|
||||||
const Map<labelList>& cellToCells
|
const Map<labelList>& cellToCells
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Find the new neighbour (if any) of the face.
|
//- Find the new neighbour (if any) of the face.
|
||||||
label newNeighbour
|
label newNeighbour
|
||||||
(
|
(
|
||||||
const label faceI,
|
const label facei,
|
||||||
const Map<labelList>& cellToCells
|
const Map<labelList>& cellToCells
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|||||||
@ -279,13 +279,13 @@ label findFace
|
|||||||
// Find cell with cell centre close to given point.
|
// Find cell with cell centre close to given point.
|
||||||
label findCell(const primitiveMesh& mesh, const point& nearPoint)
|
label findCell(const primitiveMesh& mesh, const point& nearPoint)
|
||||||
{
|
{
|
||||||
label cellI = mesh.findCell(nearPoint);
|
label celli = mesh.findCell(nearPoint);
|
||||||
|
|
||||||
if (cellI != -1)
|
if (celli != -1)
|
||||||
{
|
{
|
||||||
scalar distToCcSqr = magSqr(nearPoint - mesh.cellCentres()[cellI]);
|
scalar distToCcSqr = magSqr(nearPoint - mesh.cellCentres()[celli]);
|
||||||
|
|
||||||
const labelList& cPoints = mesh.cellPoints()[cellI];
|
const labelList& cPoints = mesh.cellPoints()[celli];
|
||||||
|
|
||||||
label minI = -1;
|
label minI = -1;
|
||||||
scalar minDistSqr = GREAT;
|
scalar minDistSqr = GREAT;
|
||||||
@ -305,9 +305,9 @@ label findCell(const primitiveMesh& mesh, const point& nearPoint)
|
|||||||
|
|
||||||
// Decide if nearPoint unique enough.
|
// Decide if nearPoint unique enough.
|
||||||
Info<< "Found to point " << nearPoint << nl
|
Info<< "Found to point " << nearPoint << nl
|
||||||
<< " nearest cell : " << cellI
|
<< " nearest cell : " << celli
|
||||||
<< " distance " << Foam::sqrt(distToCcSqr)
|
<< " distance " << Foam::sqrt(distToCcSqr)
|
||||||
<< " to cell centre " << mesh.cellCentres()[cellI] << nl
|
<< " to cell centre " << mesh.cellCentres()[celli] << nl
|
||||||
<< " nearest mesh point : " << minI
|
<< " nearest mesh point : " << minI
|
||||||
<< " distance " << Foam::sqrt(minDistSqr)
|
<< " distance " << Foam::sqrt(minDistSqr)
|
||||||
<< " to " << mesh.points()[minI] << nl
|
<< " to " << mesh.points()[minI] << nl
|
||||||
@ -318,11 +318,11 @@ label findCell(const primitiveMesh& mesh, const point& nearPoint)
|
|||||||
Info<< "Mesh point too close to nearest cell centre. Aborting"
|
Info<< "Mesh point too close to nearest cell centre. Aborting"
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
cellI = -1;
|
celli = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return cellI;
|
return celli;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -470,11 +470,11 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
const Pair<point>& pts = facesToTriangulate[i];
|
const Pair<point>& pts = facesToTriangulate[i];
|
||||||
|
|
||||||
label faceI = findFace(mesh, allBoundary, pts.first());
|
label facei = findFace(mesh, allBoundary, pts.first());
|
||||||
|
|
||||||
if (faceI == -1 || !faceToDecompose.insert(faceI, pts.second()))
|
if (facei == -1 || !faceToDecompose.insert(facei, pts.second()))
|
||||||
{
|
{
|
||||||
Info<< "Could not insert mesh face " << faceI
|
Info<< "Could not insert mesh face " << facei
|
||||||
<< " for input point " << pts.first() << nl
|
<< " for input point " << pts.first() << nl
|
||||||
<< "Perhaps the face is already marked for splitting?" << endl;
|
<< "Perhaps the face is already marked for splitting?" << endl;
|
||||||
|
|
||||||
@ -491,11 +491,11 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
const Pair<point>& pts = cellsToPyramidise[i];
|
const Pair<point>& pts = cellsToPyramidise[i];
|
||||||
|
|
||||||
label cellI = findCell(mesh, pts.first());
|
label celli = findCell(mesh, pts.first());
|
||||||
|
|
||||||
if (cellI == -1 || !cellToPyrCentre.insert(cellI, pts.second()))
|
if (celli == -1 || !cellToPyrCentre.insert(celli, pts.second()))
|
||||||
{
|
{
|
||||||
Info<< "Could not insert mesh cell " << cellI
|
Info<< "Could not insert mesh cell " << celli
|
||||||
<< " for input point " << pts.first() << nl
|
<< " for input point " << pts.first() << nl
|
||||||
<< "Perhaps the cell is already marked for splitting?" << endl;
|
<< "Perhaps the cell is already marked for splitting?" << endl;
|
||||||
|
|
||||||
|
|||||||
@ -64,17 +64,17 @@ bool limitRefinementLevel
|
|||||||
|
|
||||||
label oldNCells = refCells.size();
|
label oldNCells = refCells.size();
|
||||||
|
|
||||||
forAll(cellCells, cellI)
|
forAll(cellCells, celli)
|
||||||
{
|
{
|
||||||
const labelList& cCells = cellCells[cellI];
|
const labelList& cCells = cellCells[celli];
|
||||||
|
|
||||||
forAll(cCells, i)
|
forAll(cCells, i)
|
||||||
{
|
{
|
||||||
if (refLevel[cCells[i]] > (refLevel[cellI]+1))
|
if (refLevel[cCells[i]] > (refLevel[celli]+1))
|
||||||
{
|
{
|
||||||
// Found neighbour with >=2 difference in refLevel.
|
// Found neighbour with >=2 difference in refLevel.
|
||||||
refCells.insert(cellI);
|
refCells.insert(celli);
|
||||||
refLevel[cellI]++;
|
refLevel[celli]++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -308,11 +308,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Info<< "Setting field for patch "<< endl;
|
Info<< "Setting field for patch "<< endl;
|
||||||
|
|
||||||
forAll(bField, faceI)
|
forAll(bField, facei)
|
||||||
{
|
{
|
||||||
label own = mesh.faceOwner()[pp.start() + faceI];
|
label own = mesh.faceOwner()[pp.start() + facei];
|
||||||
|
|
||||||
bField[faceI] = postRefLevel[own];
|
bField[facei] = postRefLevel[own];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -135,41 +135,41 @@ void cutBySurface
|
|||||||
// Is a bit of a hack but allows us to reuse all the functionality
|
// Is a bit of a hack but allows us to reuse all the functionality
|
||||||
// in cellClassification.
|
// in cellClassification.
|
||||||
|
|
||||||
forAll(cellType, cellI)
|
forAll(cellType, celli)
|
||||||
{
|
{
|
||||||
label cType = cellType[cellI];
|
label cType = cellType[celli];
|
||||||
|
|
||||||
if (cType == cellClassification::CUT)
|
if (cType == cellClassification::CUT)
|
||||||
{
|
{
|
||||||
if (selectCut)
|
if (selectCut)
|
||||||
{
|
{
|
||||||
cellType[cellI] = MESH;
|
cellType[celli] = MESH;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cellType[cellI] = NONMESH;
|
cellType[celli] = NONMESH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (cType == cellClassification::INSIDE)
|
else if (cType == cellClassification::INSIDE)
|
||||||
{
|
{
|
||||||
if (selectInside)
|
if (selectInside)
|
||||||
{
|
{
|
||||||
cellType[cellI] = MESH;
|
cellType[celli] = MESH;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cellType[cellI] = NONMESH;
|
cellType[celli] = NONMESH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (cType == cellClassification::OUTSIDE)
|
else if (cType == cellClassification::OUTSIDE)
|
||||||
{
|
{
|
||||||
if (selectOutside)
|
if (selectOutside)
|
||||||
{
|
{
|
||||||
cellType[cellI] = MESH;
|
cellType[celli] = MESH;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cellType[cellI] = NONMESH;
|
cellType[celli] = NONMESH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -269,27 +269,27 @@ label selectOutsideCells
|
|||||||
forAll(outsidePts, outsidePtI)
|
forAll(outsidePts, outsidePtI)
|
||||||
{
|
{
|
||||||
// Find cell containing point. Linear search.
|
// Find cell containing point. Linear search.
|
||||||
label cellI = queryMesh.findCell(outsidePts[outsidePtI], -1, false);
|
label celli = queryMesh.findCell(outsidePts[outsidePtI], -1, false);
|
||||||
|
|
||||||
if (cellI != -1 && cellType[cellI] == MESH)
|
if (celli != -1 && cellType[celli] == MESH)
|
||||||
{
|
{
|
||||||
Info<< "Marking cell " << cellI << " containing outside point "
|
Info<< "Marking cell " << celli << " containing outside point "
|
||||||
<< outsidePts[outsidePtI] << " with type " << cellType[cellI]
|
<< outsidePts[outsidePtI] << " with type " << cellType[celli]
|
||||||
<< " ..." << endl;
|
<< " ..." << endl;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Mark this cell and its faces to start walking from
|
// Mark this cell and its faces to start walking from
|
||||||
//
|
//
|
||||||
|
|
||||||
// Mark faces of cellI
|
// Mark faces of celli
|
||||||
const labelList& cFaces = mesh.cells()[cellI];
|
const labelList& cFaces = mesh.cells()[celli];
|
||||||
forAll(cFaces, i)
|
forAll(cFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = cFaces[i];
|
label facei = cFaces[i];
|
||||||
|
|
||||||
if (outsideFacesMap.insert(faceI))
|
if (outsideFacesMap.insert(facei))
|
||||||
{
|
{
|
||||||
outsideFaces.append(faceI);
|
outsideFaces.append(facei);
|
||||||
outsideFacesInfo.append(meshInfo);
|
outsideFacesInfo.append(meshInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -311,15 +311,15 @@ label selectOutsideCells
|
|||||||
|
|
||||||
label nChanged = 0;
|
label nChanged = 0;
|
||||||
|
|
||||||
forAll(allCellInfo, cellI)
|
forAll(allCellInfo, celli)
|
||||||
{
|
{
|
||||||
if (cellType[cellI] == MESH)
|
if (cellType[celli] == MESH)
|
||||||
{
|
{
|
||||||
// Original cell was selected for meshing. Check if cell was
|
// Original cell was selected for meshing. Check if cell was
|
||||||
// reached from outsidePoints
|
// reached from outsidePoints
|
||||||
if (allCellInfo[cellI].type() != MESH)
|
if (allCellInfo[celli].type() != MESH)
|
||||||
{
|
{
|
||||||
cellType[cellI] = NONMESH;
|
cellType[celli] = NONMESH;
|
||||||
nChanged++;
|
nChanged++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -390,8 +390,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
const point& outsidePoint = outsidePts[outsideI];
|
const point& outsidePoint = outsidePts[outsideI];
|
||||||
|
|
||||||
label cellI = queryMesh.findCell(outsidePoint, -1, false);
|
label celli = queryMesh.findCell(outsidePoint, -1, false);
|
||||||
if (returnReduce(cellI, maxOp<label>()) == -1)
|
if (returnReduce(celli, maxOp<label>()) == -1)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "outsidePoint " << outsidePoint
|
<< "outsidePoint " << outsidePoint
|
||||||
@ -428,7 +428,7 @@ int main(int argc, char *argv[])
|
|||||||
// Search engine on surface.
|
// Search engine on surface.
|
||||||
querySurf.reset(new triSurfaceSearch(surf));
|
querySurf.reset(new triSurfaceSearch(surf));
|
||||||
|
|
||||||
// Set cellType[cellI] according to relation to surface
|
// Set cellType[celli] according to relation to surface
|
||||||
cutBySurface
|
cutBySurface
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -100,14 +100,14 @@ scalarField pack(const boolList& lst, const scalarField& elems)
|
|||||||
|
|
||||||
|
|
||||||
// Given sin and cos of max angle between normals calculate whether f0 and f1
|
// Given sin and cos of max angle between normals calculate whether f0 and f1
|
||||||
// on cellI make larger angle. Uses sinAngle only for quadrant detection.
|
// on celli make larger angle. Uses sinAngle only for quadrant detection.
|
||||||
bool largerAngle
|
bool largerAngle
|
||||||
(
|
(
|
||||||
const primitiveMesh& mesh,
|
const primitiveMesh& mesh,
|
||||||
const scalar cosAngle,
|
const scalar cosAngle,
|
||||||
const scalar sinAngle,
|
const scalar sinAngle,
|
||||||
|
|
||||||
const label cellI,
|
const label celli,
|
||||||
const label f0, // face label
|
const label f0, // face label
|
||||||
const label f1,
|
const label f1,
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ bool largerAngle
|
|||||||
{
|
{
|
||||||
const labelList& own = mesh.faceOwner();
|
const labelList& own = mesh.faceOwner();
|
||||||
|
|
||||||
bool sameFaceOrder = !((own[f0] == cellI) ^ (own[f1] == cellI));
|
bool sameFaceOrder = !((own[f0] == celli) ^ (own[f1] == celli));
|
||||||
|
|
||||||
// Get cos between faceArea vectors. Correct so flat angle (180 degrees)
|
// Get cos between faceArea vectors. Correct so flat angle (180 degrees)
|
||||||
// gives -1.
|
// gives -1.
|
||||||
@ -137,7 +137,7 @@ bool largerAngle
|
|||||||
|
|
||||||
scalar fcCosAngle = n0 & c1c0;
|
scalar fcCosAngle = n0 & c1c0;
|
||||||
|
|
||||||
if (own[f0] != cellI)
|
if (own[f0] != celli)
|
||||||
{
|
{
|
||||||
fcCosAngle = -fcCosAngle;
|
fcCosAngle = -fcCosAngle;
|
||||||
}
|
}
|
||||||
@ -190,7 +190,7 @@ bool largerAngle
|
|||||||
bool splitHex
|
bool splitHex
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
const label cellI,
|
const label celli,
|
||||||
const label edgeI,
|
const label edgeI,
|
||||||
|
|
||||||
DynamicList<label>& cutCells,
|
DynamicList<label>& cutCells,
|
||||||
@ -214,13 +214,13 @@ bool splitHex
|
|||||||
label leftFp = -1;
|
label leftFp = -1;
|
||||||
label rightFp = -1;
|
label rightFp = -1;
|
||||||
|
|
||||||
const cell& cFaces = mesh.cells()[cellI];
|
const cell& cFaces = mesh.cells()[celli];
|
||||||
|
|
||||||
forAll(cFaces, i)
|
forAll(cFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = cFaces[i];
|
label facei = cFaces[i];
|
||||||
|
|
||||||
const face& f = faces[faceI];
|
const face& f = faces[facei];
|
||||||
|
|
||||||
label fp0 = findIndex(f, e[0]);
|
label fp0 = findIndex(f, e[0]);
|
||||||
label fp1 = findIndex(f, e[1]);
|
label fp1 = findIndex(f, e[1]);
|
||||||
@ -230,7 +230,7 @@ bool splitHex
|
|||||||
if (fp1 != -1)
|
if (fp1 != -1)
|
||||||
{
|
{
|
||||||
// Face uses e[1] but not e[0]
|
// Face uses e[1] but not e[0]
|
||||||
rightI = faceI;
|
rightI = facei;
|
||||||
rightFp = fp1;
|
rightFp = fp1;
|
||||||
|
|
||||||
if (leftI != -1)
|
if (leftI != -1)
|
||||||
@ -248,7 +248,7 @@ bool splitHex
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
leftI = faceI;
|
leftI = facei;
|
||||||
leftFp = fp0;
|
leftFp = fp0;
|
||||||
|
|
||||||
if (rightI != -1)
|
if (rightI != -1)
|
||||||
@ -287,7 +287,7 @@ bool splitHex
|
|||||||
loopWeights[2] = -GREAT;
|
loopWeights[2] = -GREAT;
|
||||||
loopWeights[3] = -GREAT;
|
loopWeights[3] = -GREAT;
|
||||||
|
|
||||||
cutCells.append(cellI);
|
cutCells.append(celli);
|
||||||
cellLoops.append(loop);
|
cellLoops.append(loop);
|
||||||
cellEdgeWeights.append(loopWeights);
|
cellEdgeWeights.append(loopWeights);
|
||||||
|
|
||||||
@ -295,13 +295,13 @@ bool splitHex
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Split cellI along edgeI with a plane along halfNorm direction.
|
// Split celli along edgeI with a plane along halfNorm direction.
|
||||||
bool splitCell
|
bool splitCell
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
const geomCellLooper& cellCutter,
|
const geomCellLooper& cellCutter,
|
||||||
|
|
||||||
const label cellI,
|
const label celli,
|
||||||
const label edgeI,
|
const label edgeI,
|
||||||
const vector& halfNorm,
|
const vector& halfNorm,
|
||||||
|
|
||||||
@ -339,7 +339,7 @@ bool splitCell
|
|||||||
cellCutter.cut
|
cellCutter.cut
|
||||||
(
|
(
|
||||||
cutPlane,
|
cutPlane,
|
||||||
cellI,
|
celli,
|
||||||
vertIsCut,
|
vertIsCut,
|
||||||
edgeIsCut,
|
edgeIsCut,
|
||||||
edgeWeight,
|
edgeWeight,
|
||||||
@ -349,7 +349,7 @@ bool splitCell
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Did manage to cut cell. Copy into overall list.
|
// Did manage to cut cell. Copy into overall list.
|
||||||
cutCells.append(cellI);
|
cutCells.append(celli);
|
||||||
cellLoops.append(loop);
|
cellLoops.append(loop);
|
||||||
cellEdgeWeights.append(loopWeights);
|
cellEdgeWeights.append(loopWeights);
|
||||||
|
|
||||||
@ -397,15 +397,15 @@ void collectCuts
|
|||||||
|
|
||||||
forAllConstIter(cellSet, cellsToCut, iter)
|
forAllConstIter(cellSet, cellsToCut, iter)
|
||||||
{
|
{
|
||||||
const label cellI = iter.key();
|
const label celli = iter.key();
|
||||||
const labelList& cEdges = cellEdges[cellI];
|
const labelList& cEdges = cellEdges[celli];
|
||||||
|
|
||||||
forAll(cEdges, i)
|
forAll(cEdges, i)
|
||||||
{
|
{
|
||||||
label edgeI = cEdges[i];
|
label edgeI = cEdges[i];
|
||||||
|
|
||||||
label f0, f1;
|
label f0, f1;
|
||||||
meshTools::getEdgeFaces(mesh, cellI, edgeI, f0, f1);
|
meshTools::getEdgeFaces(mesh, celli, edgeI, f0, f1);
|
||||||
|
|
||||||
vector n0 = faceAreas[f0];
|
vector n0 = faceAreas[f0];
|
||||||
n0 /= mag(n0);
|
n0 /= mag(n0);
|
||||||
@ -421,7 +421,7 @@ void collectCuts
|
|||||||
minCos,
|
minCos,
|
||||||
minSin,
|
minSin,
|
||||||
|
|
||||||
cellI,
|
celli,
|
||||||
f0,
|
f0,
|
||||||
f1,
|
f1,
|
||||||
n0,
|
n0,
|
||||||
@ -431,13 +431,13 @@ void collectCuts
|
|||||||
{
|
{
|
||||||
bool splitOk = false;
|
bool splitOk = false;
|
||||||
|
|
||||||
if (!geometry && cellShapes[cellI].model() == hex)
|
if (!geometry && cellShapes[celli].model() == hex)
|
||||||
{
|
{
|
||||||
splitOk =
|
splitOk =
|
||||||
splitHex
|
splitHex
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
cellI,
|
celli,
|
||||||
edgeI,
|
edgeI,
|
||||||
|
|
||||||
cutCells,
|
cutCells,
|
||||||
@ -449,7 +449,7 @@ void collectCuts
|
|||||||
{
|
{
|
||||||
vector halfNorm;
|
vector halfNorm;
|
||||||
|
|
||||||
if ((own[f0] == cellI) ^ (own[f1] == cellI))
|
if ((own[f0] == celli) ^ (own[f1] == celli))
|
||||||
{
|
{
|
||||||
// Opposite owner orientation
|
// Opposite owner orientation
|
||||||
halfNorm = 0.5*(n0 - n1);
|
halfNorm = 0.5*(n0 - n1);
|
||||||
@ -466,7 +466,7 @@ void collectCuts
|
|||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
cellCutter,
|
cellCutter,
|
||||||
cellI,
|
celli,
|
||||||
edgeI,
|
edgeI,
|
||||||
halfNorm,
|
halfNorm,
|
||||||
|
|
||||||
@ -603,9 +603,9 @@ int main(int argc, char *argv[])
|
|||||||
if (!readSet)
|
if (!readSet)
|
||||||
{
|
{
|
||||||
// Try all cells for cutting
|
// Try all cells for cutting
|
||||||
for (label cellI = 0; cellI < mesh.nCells(); cellI++)
|
for (label celli = 0; celli < mesh.nCells(); celli++)
|
||||||
{
|
{
|
||||||
cellsToCut.insert(cellI);
|
cellsToCut.insert(celli);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -658,13 +658,13 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove cut cells from cellsToCut (Note:only relevant if -readSet)
|
// Remove cut cells from cellsToCut (Note:only relevant if -readSet)
|
||||||
forAll(cuts.cellLoops(), cellI)
|
forAll(cuts.cellLoops(), celli)
|
||||||
{
|
{
|
||||||
if (cuts.cellLoops()[cellI].size())
|
if (cuts.cellLoops()[celli].size())
|
||||||
{
|
{
|
||||||
//Info<< "Removing cut cell " << cellI << " from wishlist"
|
//Info<< "Removing cut cell " << celli << " from wishlist"
|
||||||
// << endl;
|
// << endl;
|
||||||
cellsToCut.erase(cellI);
|
cellsToCut.erase(celli);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -67,27 +67,27 @@ labelList getInternalFaceOrder
|
|||||||
// First unassigned face
|
// First unassigned face
|
||||||
label newFaceI = 0;
|
label newFaceI = 0;
|
||||||
|
|
||||||
forAll(cells, cellI)
|
forAll(cells, celli)
|
||||||
{
|
{
|
||||||
const labelList& cFaces = cells[cellI];
|
const labelList& cFaces = cells[celli];
|
||||||
|
|
||||||
SortableList<label> nbr(cFaces.size());
|
SortableList<label> nbr(cFaces.size());
|
||||||
|
|
||||||
forAll(cFaces, i)
|
forAll(cFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = cFaces[i];
|
label facei = cFaces[i];
|
||||||
|
|
||||||
label nbrCellI = neighbour[faceI];
|
label nbrCellI = neighbour[facei];
|
||||||
|
|
||||||
if (nbrCellI != -1)
|
if (nbrCellI != -1)
|
||||||
{
|
{
|
||||||
// Internal face. Get cell on other side.
|
// Internal face. Get cell on other side.
|
||||||
if (nbrCellI == cellI)
|
if (nbrCellI == celli)
|
||||||
{
|
{
|
||||||
nbrCellI = owner[faceI];
|
nbrCellI = owner[facei];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cellI < nbrCellI)
|
if (celli < nbrCellI)
|
||||||
{
|
{
|
||||||
// CellI is master
|
// CellI is master
|
||||||
nbr[i] = nbrCellI;
|
nbr[i] = nbrCellI;
|
||||||
@ -117,9 +117,9 @@ labelList getInternalFaceOrder
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Keep boundary faces in same order.
|
// Keep boundary faces in same order.
|
||||||
for (label faceI = newFaceI; faceI < owner.size(); faceI++)
|
for (label facei = newFaceI; facei < owner.size(); facei++)
|
||||||
{
|
{
|
||||||
oldToNew[faceI] = faceI;
|
oldToNew[facei] = facei;
|
||||||
}
|
}
|
||||||
|
|
||||||
return oldToNew;
|
return oldToNew;
|
||||||
@ -128,7 +128,7 @@ labelList getInternalFaceOrder
|
|||||||
|
|
||||||
void storeCellInZone
|
void storeCellInZone
|
||||||
(
|
(
|
||||||
const label cellI,
|
const label celli,
|
||||||
const label cellType,
|
const label cellType,
|
||||||
Map<label>& typeToZone,
|
Map<label>& typeToZone,
|
||||||
List<DynamicList<label>>& zoneCells
|
List<DynamicList<label>>& zoneCells
|
||||||
@ -149,12 +149,12 @@ void storeCellInZone
|
|||||||
<< zoneI << endl;
|
<< zoneI << endl;
|
||||||
typeToZone.insert(cellType, zoneI);
|
typeToZone.insert(cellType, zoneI);
|
||||||
|
|
||||||
zoneCells[zoneI].append(cellI);
|
zoneCells[zoneI].append(celli);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Existing zone for type
|
// Existing zone for type
|
||||||
zoneCells[zoneFnd()].append(cellI);
|
zoneCells[zoneFnd()].append(celli);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -482,12 +482,12 @@ void ReadCells
|
|||||||
|
|
||||||
unsigned int pos = 0;
|
unsigned int pos = 0;
|
||||||
|
|
||||||
for (unsigned int faceI = 0; faceI < nInternalFaces; faceI++)
|
for (unsigned int facei = 0; facei < nInternalFaces; facei++)
|
||||||
{
|
{
|
||||||
foamFaceMap[faceI] = mapData[faceI];
|
foamFaceMap[facei] = mapData[facei];
|
||||||
foamOwner[faceI] = faceCells[2*faceI];
|
foamOwner[facei] = faceCells[2*facei];
|
||||||
foamNeighbour[faceI] = faceCells[2*faceI+1];
|
foamNeighbour[facei] = faceCells[2*facei+1];
|
||||||
face& f = foamFaces[faceI];
|
face& f = foamFaces[facei];
|
||||||
|
|
||||||
f.setSize(faces[pos++]);
|
f.setSize(faces[pos++]);
|
||||||
forAll(f, fp)
|
forAll(f, fp)
|
||||||
@ -804,9 +804,9 @@ int main(int argc, char *argv[])
|
|||||||
label maxCCMPointI = max(foamPointMap);
|
label maxCCMPointI = max(foamPointMap);
|
||||||
labelList toFoamPoints(invert(maxCCMPointI+1, foamPointMap));
|
labelList toFoamPoints(invert(maxCCMPointI+1, foamPointMap));
|
||||||
|
|
||||||
forAll(foamFaces, faceI)
|
forAll(foamFaces, facei)
|
||||||
{
|
{
|
||||||
inplaceRenumber(toFoamPoints, foamFaces[faceI]);
|
inplaceRenumber(toFoamPoints, foamFaces[facei]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -831,15 +831,15 @@ int main(int argc, char *argv[])
|
|||||||
// Set owner/neighbour so owner < neighbour
|
// Set owner/neighbour so owner < neighbour
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
forAll(foamNeighbour, faceI)
|
forAll(foamNeighbour, facei)
|
||||||
{
|
{
|
||||||
label nbr = foamNeighbour[faceI];
|
label nbr = foamNeighbour[facei];
|
||||||
label own = foamOwner[faceI];
|
label own = foamOwner[facei];
|
||||||
|
|
||||||
if (nbr >= foamCellType.size() || own >= foamCellType.size())
|
if (nbr >= foamCellType.size() || own >= foamCellType.size())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "face:" << faceI
|
<< "face:" << facei
|
||||||
<< " nbr:" << nbr
|
<< " nbr:" << nbr
|
||||||
<< " own:" << own
|
<< " own:" << own
|
||||||
<< " nCells:" << foamCellType.size()
|
<< " nCells:" << foamCellType.size()
|
||||||
@ -850,15 +850,15 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
if (nbr < own)
|
if (nbr < own)
|
||||||
{
|
{
|
||||||
foamOwner[faceI] = foamNeighbour[faceI];
|
foamOwner[facei] = foamNeighbour[facei];
|
||||||
foamNeighbour[faceI] = own;
|
foamNeighbour[facei] = own;
|
||||||
foamFaces[faceI].flip();
|
foamFaces[facei].flip();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// And check the face
|
// And check the face
|
||||||
const face& f = foamFaces[faceI];
|
const face& f = foamFaces[facei];
|
||||||
|
|
||||||
forAll(f, fp)
|
forAll(f, fp)
|
||||||
{
|
{
|
||||||
@ -897,9 +897,9 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Reorder faces accordingly
|
// Reorder faces accordingly
|
||||||
forAll(foamCells, cellI)
|
forAll(foamCells, celli)
|
||||||
{
|
{
|
||||||
inplaceRenumber(oldToNew, foamCells[cellI]);
|
inplaceRenumber(oldToNew, foamCells[celli]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reorder faces.
|
// Reorder faces.
|
||||||
@ -1024,12 +1024,12 @@ int main(int argc, char *argv[])
|
|||||||
// Storage for cell zones.
|
// Storage for cell zones.
|
||||||
List<DynamicList<label>> zoneCells(0);
|
List<DynamicList<label>> zoneCells(0);
|
||||||
|
|
||||||
forAll(foamCellType, cellI)
|
forAll(foamCellType, celli)
|
||||||
{
|
{
|
||||||
storeCellInZone
|
storeCellInZone
|
||||||
(
|
(
|
||||||
cellI,
|
celli,
|
||||||
foamCellType[cellI],
|
foamCellType[celli],
|
||||||
typeToZone,
|
typeToZone,
|
||||||
zoneCells
|
zoneCells
|
||||||
);
|
);
|
||||||
@ -1094,9 +1094,9 @@ int main(int argc, char *argv[])
|
|||||||
dimensionedScalar("cellId", dimless, 0.0)
|
dimensionedScalar("cellId", dimless, 0.0)
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(foamCellMap, cellI)
|
forAll(foamCellMap, celli)
|
||||||
{
|
{
|
||||||
cellIdField[cellI] = foamCellMap[cellI];
|
cellIdField[celli] = foamCellMap[celli];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct field with calculated bc to hold cell type.
|
// Construct field with calculated bc to hold cell type.
|
||||||
@ -1114,9 +1114,9 @@ int main(int argc, char *argv[])
|
|||||||
dimensionedScalar("cellType", dimless, 0.0)
|
dimensionedScalar("cellType", dimless, 0.0)
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(foamCellType, cellI)
|
forAll(foamCellType, celli)
|
||||||
{
|
{
|
||||||
cellTypeField[cellI] = foamCellType[cellI];
|
cellTypeField[celli] = foamCellType[celli];
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Writing cellIds as volScalarField to " << cellIdField.objectPath()
|
Info<< "Writing cellIds as volScalarField to " << cellIdField.objectPath()
|
||||||
|
|||||||
@ -277,11 +277,11 @@ label findFace(const polyMesh& mesh, const face& f)
|
|||||||
|
|
||||||
forAll(pFaces, i)
|
forAll(pFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = pFaces[i];
|
label facei = pFaces[i];
|
||||||
|
|
||||||
if (mesh.faces()[faceI] == f)
|
if (mesh.faces()[facei] == f)
|
||||||
{
|
{
|
||||||
return faceI;
|
return facei;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -611,11 +611,11 @@ int main(int argc, char *argv[])
|
|||||||
label oldSize = renumberedPatch.size();
|
label oldSize = renumberedPatch.size();
|
||||||
renumberedPatch.setSize(oldSize + curRawPatch.size());
|
renumberedPatch.setSize(oldSize + curRawPatch.size());
|
||||||
|
|
||||||
forAll(curRawPatch, faceI)
|
forAll(curRawPatch, facei)
|
||||||
{
|
{
|
||||||
const face& oldFace = curRawPatch[faceI];
|
const face& oldFace = curRawPatch[facei];
|
||||||
|
|
||||||
face& newFace = renumberedPatch[oldSize + faceI];
|
face& newFace = renumberedPatch[oldSize + facei];
|
||||||
newFace.setSize(oldFace.size());
|
newFace.setSize(oldFace.size());
|
||||||
|
|
||||||
forAll(oldFace, pointI)
|
forAll(oldFace, pointI)
|
||||||
@ -635,11 +635,11 @@ int main(int argc, char *argv[])
|
|||||||
faceList& renumberedPatch = boundary[nCreatedPatches];
|
faceList& renumberedPatch = boundary[nCreatedPatches];
|
||||||
renumberedPatch.setSize(curRawPatch.size());
|
renumberedPatch.setSize(curRawPatch.size());
|
||||||
|
|
||||||
forAll(curRawPatch, faceI)
|
forAll(curRawPatch, facei)
|
||||||
{
|
{
|
||||||
const face& oldFace = curRawPatch[faceI];
|
const face& oldFace = curRawPatch[facei];
|
||||||
|
|
||||||
face& newFace = renumberedPatch[faceI];
|
face& newFace = renumberedPatch[facei];
|
||||||
newFace.setSize(oldFace.size());
|
newFace.setSize(oldFace.size());
|
||||||
|
|
||||||
forAll(oldFace, pointI)
|
forAll(oldFace, pointI)
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -367,9 +367,9 @@ faceList hexBlock::patchFaces(const label direc, const labelList& range) const
|
|||||||
else if (blockHandedness_ == left)
|
else if (blockHandedness_ == left)
|
||||||
{
|
{
|
||||||
// turn all faces inside out
|
// turn all faces inside out
|
||||||
forAll(result, faceI)
|
forAll(result, facei)
|
||||||
{
|
{
|
||||||
result[faceI].flip();
|
result[facei].flip();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -85,24 +85,24 @@ cellShape create3DCellShape
|
|||||||
// make a list of outward-pointing faces
|
// make a list of outward-pointing faces
|
||||||
labelListList localFaces(faceLabels.size());
|
labelListList localFaces(faceLabels.size());
|
||||||
|
|
||||||
forAll(faceLabels, faceI)
|
forAll(faceLabels, facei)
|
||||||
{
|
{
|
||||||
const label curFaceLabel = faceLabels[faceI];
|
const label curFaceLabel = faceLabels[facei];
|
||||||
|
|
||||||
const labelList& curFace = faces[curFaceLabel];
|
const labelList& curFace = faces[curFaceLabel];
|
||||||
|
|
||||||
if (owner[curFaceLabel] == cellIndex)
|
if (owner[curFaceLabel] == cellIndex)
|
||||||
{
|
{
|
||||||
localFaces[faceI] = curFace;
|
localFaces[facei] = curFace;
|
||||||
}
|
}
|
||||||
else if (neighbour[curFaceLabel] == cellIndex)
|
else if (neighbour[curFaceLabel] == cellIndex)
|
||||||
{
|
{
|
||||||
// Reverse the face
|
// Reverse the face
|
||||||
localFaces[faceI].setSize(curFace.size());
|
localFaces[facei].setSize(curFace.size());
|
||||||
|
|
||||||
forAllReverse(curFace, i)
|
forAllReverse(curFace, i)
|
||||||
{
|
{
|
||||||
localFaces[faceI][curFace.size() - i - 1] =
|
localFaces[facei][curFace.size() - i - 1] =
|
||||||
curFace[i];
|
curFace[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -67,9 +67,9 @@ cellShape extrudedQuadCellShape
|
|||||||
// make a list of outward-pointing faces
|
// make a list of outward-pointing faces
|
||||||
labelListList localFaces(4);
|
labelListList localFaces(4);
|
||||||
|
|
||||||
forAll(faceLabels, faceI)
|
forAll(faceLabels, facei)
|
||||||
{
|
{
|
||||||
const label curFaceLabel = faceLabels[faceI];
|
const label curFaceLabel = faceLabels[facei];
|
||||||
|
|
||||||
const face& curFace = faces[curFaceLabel];
|
const face& curFace = faces[curFaceLabel];
|
||||||
|
|
||||||
@ -83,18 +83,18 @@ cellShape extrudedQuadCellShape
|
|||||||
|
|
||||||
if (owner[curFaceLabel] == cellIndex)
|
if (owner[curFaceLabel] == cellIndex)
|
||||||
{
|
{
|
||||||
localFaces[faceI] = curFace;
|
localFaces[facei] = curFace;
|
||||||
}
|
}
|
||||||
else if (neighbour[curFaceLabel] == cellIndex)
|
else if (neighbour[curFaceLabel] == cellIndex)
|
||||||
{
|
{
|
||||||
// Reverse the face. Note: it is necessary to reverse by
|
// Reverse the face. Note: it is necessary to reverse by
|
||||||
// hand to preserve connectivity of a 2-D mesh.
|
// hand to preserve connectivity of a 2-D mesh.
|
||||||
//
|
//
|
||||||
localFaces[faceI].setSize(curFace.size());
|
localFaces[facei].setSize(curFace.size());
|
||||||
|
|
||||||
forAllReverse(curFace, i)
|
forAllReverse(curFace, i)
|
||||||
{
|
{
|
||||||
localFaces[faceI][curFace.size() - i - 1] =
|
localFaces[facei][curFace.size() - i - 1] =
|
||||||
curFace[i];
|
curFace[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -69,9 +69,9 @@ cellShape extrudedTriangleCellShape
|
|||||||
// make a list of outward-pointing faces
|
// make a list of outward-pointing faces
|
||||||
labelListList localFaces(3);
|
labelListList localFaces(3);
|
||||||
|
|
||||||
forAll(faceLabels, faceI)
|
forAll(faceLabels, facei)
|
||||||
{
|
{
|
||||||
const label curFaceLabel = faceLabels[faceI];
|
const label curFaceLabel = faceLabels[facei];
|
||||||
|
|
||||||
const face& curFace = faces[curFaceLabel];
|
const face& curFace = faces[curFaceLabel];
|
||||||
|
|
||||||
@ -85,18 +85,18 @@ cellShape extrudedTriangleCellShape
|
|||||||
|
|
||||||
if (owner[curFaceLabel] == cellIndex)
|
if (owner[curFaceLabel] == cellIndex)
|
||||||
{
|
{
|
||||||
localFaces[faceI] = curFace;
|
localFaces[facei] = curFace;
|
||||||
}
|
}
|
||||||
else if (neighbour[curFaceLabel] == cellIndex)
|
else if (neighbour[curFaceLabel] == cellIndex)
|
||||||
{
|
{
|
||||||
// Reverse the face. Note: it is necessary to reverse by
|
// Reverse the face. Note: it is necessary to reverse by
|
||||||
// hand to preserve connectivity of a 2-D mesh.
|
// hand to preserve connectivity of a 2-D mesh.
|
||||||
//
|
//
|
||||||
localFaces[faceI].setSize(curFace.size());
|
localFaces[facei].setSize(curFace.size());
|
||||||
|
|
||||||
forAllReverse(curFace, i)
|
forAllReverse(curFace, i)
|
||||||
{
|
{
|
||||||
localFaces[faceI][curFace.size() - i - 1] =
|
localFaces[facei][curFace.size() - i - 1] =
|
||||||
curFace[i];
|
curFace[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -241,7 +241,7 @@ endOfSection {space}")"{space}
|
|||||||
|
|
||||||
// Face data
|
// Face data
|
||||||
label faceGroupElementType = -1;
|
label faceGroupElementType = -1;
|
||||||
label faceI = 0;
|
label facei = 0;
|
||||||
|
|
||||||
// Cell data
|
// Cell data
|
||||||
label cellGroupElementType = -1;
|
label cellGroupElementType = -1;
|
||||||
@ -458,7 +458,7 @@ endOfSection {space}")"{space}
|
|||||||
faceGroupElementType = readHexLabel(faceGroupDataStream);
|
faceGroupElementType = readHexLabel(faceGroupDataStream);
|
||||||
|
|
||||||
// In FOAM, indices start from zero - adjust
|
// In FOAM, indices start from zero - adjust
|
||||||
faceI = faceGroupStartIndex.last() - 1;
|
facei = faceGroupStartIndex.last() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
<readNumberOfFaces,readFaceGroupData>{spaceNl}{endOfSection} {
|
<readNumberOfFaces,readFaceGroupData>{spaceNl}{endOfSection} {
|
||||||
@ -483,7 +483,7 @@ endOfSection {space}")"{space}
|
|||||||
|
|
||||||
IStringStream mixedFaceStream(YYText());
|
IStringStream mixedFaceStream(YYText());
|
||||||
|
|
||||||
face& curFaceLabels = faces[faceI];
|
face& curFaceLabels = faces[facei];
|
||||||
|
|
||||||
// set size of label list
|
// set size of label list
|
||||||
curFaceLabels.setSize(readLabel(mixedFaceStream));
|
curFaceLabels.setSize(readLabel(mixedFaceStream));
|
||||||
@ -494,16 +494,16 @@ endOfSection {space}")"{space}
|
|||||||
}
|
}
|
||||||
|
|
||||||
// read neighbour and owner. Neighbour comes first
|
// read neighbour and owner. Neighbour comes first
|
||||||
neighbour[faceI] = readHexLabel(mixedFaceStream) - 1;
|
neighbour[facei] = readHexLabel(mixedFaceStream) - 1;
|
||||||
owner[faceI] = readHexLabel(mixedFaceStream) - 1;
|
owner[facei] = readHexLabel(mixedFaceStream) - 1;
|
||||||
faceI++;
|
facei++;
|
||||||
}
|
}
|
||||||
|
|
||||||
<readFacesUniform>{spaceNl}{hexLabelList} {
|
<readFacesUniform>{spaceNl}{hexLabelList} {
|
||||||
|
|
||||||
IStringStream mixedFaceStream(YYText());
|
IStringStream mixedFaceStream(YYText());
|
||||||
|
|
||||||
face& curFaceLabels = faces[faceI];
|
face& curFaceLabels = faces[facei];
|
||||||
|
|
||||||
// set size of label list. This is OK because in Fluent the type
|
// set size of label list. This is OK because in Fluent the type
|
||||||
// for edge is 2, for triangle is 3 and for quad is 4
|
// for edge is 2, for triangle is 3 and for quad is 4
|
||||||
@ -515,20 +515,20 @@ endOfSection {space}")"{space}
|
|||||||
}
|
}
|
||||||
|
|
||||||
// read neighbour and owner. Neighbour comes first
|
// read neighbour and owner. Neighbour comes first
|
||||||
neighbour[faceI] = readHexLabel(mixedFaceStream) - 1;
|
neighbour[facei] = readHexLabel(mixedFaceStream) - 1;
|
||||||
owner[faceI] = readHexLabel(mixedFaceStream) - 1;
|
owner[facei] = readHexLabel(mixedFaceStream) - 1;
|
||||||
faceI++;
|
facei++;
|
||||||
}
|
}
|
||||||
|
|
||||||
<readFacesMixed,readFacesUniform>{spaceNl}{endOfSection} {
|
<readFacesMixed,readFacesUniform>{spaceNl}{endOfSection} {
|
||||||
|
|
||||||
// check read of fluentFaces
|
// check read of fluentFaces
|
||||||
if (faceI != faceGroupEndIndex.last())
|
if (facei != faceGroupEndIndex.last())
|
||||||
{
|
{
|
||||||
Info<< "problem with reading fluentFaces: "
|
Info<< "problem with reading fluentFaces: "
|
||||||
<< "start index: " << faceGroupStartIndex.last()
|
<< "start index: " << faceGroupStartIndex.last()
|
||||||
<< " end index: " << faceGroupEndIndex.last()
|
<< " end index: " << faceGroupEndIndex.last()
|
||||||
<< " last fluentFaces read: " << faceI << endl;
|
<< " last fluentFaces read: " << facei << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
yy_pop_state();
|
yy_pop_state();
|
||||||
@ -844,11 +844,11 @@ label findFace(const primitiveMesh& mesh, const face& f)
|
|||||||
|
|
||||||
forAll(pFaces, i)
|
forAll(pFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = pFaces[i];
|
label facei = pFaces[i];
|
||||||
|
|
||||||
if (f == mesh.faces()[faceI])
|
if (f == mesh.faces()[facei])
|
||||||
{
|
{
|
||||||
return faceI;
|
return facei;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -932,23 +932,23 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// fill in owner and neighbour
|
// fill in owner and neighbour
|
||||||
|
|
||||||
forAll(owner, faceI)
|
forAll(owner, facei)
|
||||||
{
|
{
|
||||||
if (owner[faceI] > -1)
|
if (owner[facei] > -1)
|
||||||
{
|
{
|
||||||
label curCell = owner[faceI];
|
label curCell = owner[facei];
|
||||||
cellFaces[curCell][nFacesInCell[curCell] ] = faceI;
|
cellFaces[curCell][nFacesInCell[curCell] ] = facei;
|
||||||
|
|
||||||
nFacesInCell[curCell]++;
|
nFacesInCell[curCell]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(neighbour, faceI)
|
forAll(neighbour, facei)
|
||||||
{
|
{
|
||||||
if (neighbour[faceI] > -1)
|
if (neighbour[facei] > -1)
|
||||||
{
|
{
|
||||||
label curCell = neighbour[faceI];
|
label curCell = neighbour[facei];
|
||||||
cellFaces[curCell][nFacesInCell[curCell] ] = faceI;
|
cellFaces[curCell][nFacesInCell[curCell] ] = facei;
|
||||||
|
|
||||||
nFacesInCell[curCell]++;
|
nFacesInCell[curCell]++;
|
||||||
}
|
}
|
||||||
@ -1062,17 +1062,17 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create new faces
|
// Create new faces
|
||||||
forAll(faces, faceI)
|
forAll(faces, facei)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (faces[faceI].size() != 2)
|
if (faces[facei].size() != 2)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "fluentMeshToFoam: a 2-D face defined with "
|
<< "fluentMeshToFoam: a 2-D face defined with "
|
||||||
<< faces[faceI].size() << " points." << endl;
|
<< faces[facei].size() << " points." << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
labelList& newFace = faces[faceI];
|
labelList& newFace = faces[facei];
|
||||||
|
|
||||||
newFace.setSize(4);
|
newFace.setSize(4);
|
||||||
|
|
||||||
@ -1125,16 +1125,16 @@ int main(int argc, char *argv[])
|
|||||||
// area vector points into the domain. Turn them round before making patches
|
// area vector points into the domain. Turn them round before making patches
|
||||||
// for Foam compatibility
|
// for Foam compatibility
|
||||||
|
|
||||||
forAll(faces, faceI)
|
forAll(faces, facei)
|
||||||
{
|
{
|
||||||
if (owner[faceI] == -1)
|
if (owner[facei] == -1)
|
||||||
{
|
{
|
||||||
// reverse face
|
// reverse face
|
||||||
labelList oldFace = faces[faceI];
|
labelList oldFace = faces[facei];
|
||||||
|
|
||||||
forAllReverse(oldFace, i)
|
forAllReverse(oldFace, i)
|
||||||
{
|
{
|
||||||
faces[faceI][oldFace.size() - i - 1] =
|
faces[facei][oldFace.size() - i - 1] =
|
||||||
oldFace[i];
|
oldFace[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1241,7 +1241,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
faceList patchFaces(faceGroupEndIndexIter() - faceLabel);
|
faceList patchFaces(faceGroupEndIndexIter() - faceLabel);
|
||||||
|
|
||||||
forAll(patchFaces, faceI)
|
forAll(patchFaces, facei)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
@ -1249,14 +1249,14 @@ int main(int argc, char *argv[])
|
|||||||
|| faces[faceLabel].size() == 4
|
|| faces[faceLabel].size() == 4
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
patchFaces[faceI] = face(faces[faceLabel]);
|
patchFaces[facei] = face(faces[faceLabel]);
|
||||||
faceLabel++;
|
faceLabel++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "unrecognised face shape with "
|
<< "unrecognised face shape with "
|
||||||
<< patchFaces[faceI].size() << " vertices"
|
<< patchFaces[facei].size() << " vertices"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1412,28 +1412,28 @@ int main(int argc, char *argv[])
|
|||||||
//and mark patch number to global list
|
//and mark patch number to global list
|
||||||
forAll(meshFaces, i)
|
forAll(meshFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = meshFaces[i];
|
label facei = meshFaces[i];
|
||||||
|
|
||||||
if (pShapeMesh.isInternalFace(faceI))
|
if (pShapeMesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Face " << faceI << " on new patch "
|
<< "Face " << facei << " on new patch "
|
||||||
<< patchNames[patchi]
|
<< patchNames[patchi]
|
||||||
<< " is not an external face of the mesh." << endl
|
<< " is not an external face of the mesh." << endl
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (facePatchID[faceI - pShapeMesh.nInternalFaces()]!= -1)
|
if (facePatchID[facei - pShapeMesh.nInternalFaces()]!= -1)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Face " << faceI << " on new patch "
|
<< "Face " << facei << " on new patch "
|
||||||
<< patchNames[patchi]
|
<< patchNames[patchi]
|
||||||
<< " has already been marked for repatching to"
|
<< " has already been marked for repatching to"
|
||||||
<< " patch "
|
<< " patch "
|
||||||
<< facePatchID[faceI - pShapeMesh.nInternalFaces()]
|
<< facePatchID[facei - pShapeMesh.nInternalFaces()]
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
facePatchID[faceI - pShapeMesh.nInternalFaces()] = nBoundaries;
|
facePatchID[facei - pShapeMesh.nInternalFaces()] = nBoundaries;
|
||||||
}
|
}
|
||||||
|
|
||||||
//add to boundary patch
|
//add to boundary patch
|
||||||
@ -1521,9 +1521,9 @@ int main(int argc, char *argv[])
|
|||||||
// Change patch ids
|
// Change patch ids
|
||||||
forAll(facePatchID, idI)
|
forAll(facePatchID, idI)
|
||||||
{
|
{
|
||||||
label faceI = idI + pShapeMesh.nInternalFaces();
|
label facei = idI + pShapeMesh.nInternalFaces();
|
||||||
|
|
||||||
repatcher.changePatchID(faceI, facePatchID[idI]);
|
repatcher.changePatchID(facei, facePatchID[idI]);
|
||||||
}
|
}
|
||||||
repatcher.repatch();
|
repatcher.repatch();
|
||||||
|
|
||||||
@ -1626,15 +1626,15 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
|
|
||||||
DynamicList<label> zoneFaces(pShapeMesh.nFaces());
|
DynamicList<label> zoneFaces(pShapeMesh.nFaces());
|
||||||
forAll(pShapeMesh.faceNeighbour(), faceI)
|
forAll(pShapeMesh.faceNeighbour(), facei)
|
||||||
{
|
{
|
||||||
label nei = pShapeMesh.faceNeighbour()[faceI];
|
label nei = pShapeMesh.faceNeighbour()[facei];
|
||||||
label own = pShapeMesh.faceOwner()[faceI];
|
label own = pShapeMesh.faceOwner()[facei];
|
||||||
if (nei != -1)
|
if (nei != -1)
|
||||||
{
|
{
|
||||||
if (zoneCell[nei] && zoneCell[own])
|
if (zoneCell[nei] && zoneCell[own])
|
||||||
{
|
{
|
||||||
zoneFaces.append(faceI);
|
zoneFaces.append(facei);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -135,9 +135,9 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
<< "(13 (2 1 "
|
<< "(13 (2 1 "
|
||||||
<< own.size() << " 2 0)" << std::endl << "(" << std::endl;
|
<< own.size() << " 2 0)" << std::endl << "(" << std::endl;
|
||||||
|
|
||||||
forAll(own, faceI)
|
forAll(own, facei)
|
||||||
{
|
{
|
||||||
const labelList& l = fcs[faceI];
|
const labelList& l = fcs[facei];
|
||||||
|
|
||||||
fluentMeshFile << " ";
|
fluentMeshFile << " ";
|
||||||
|
|
||||||
@ -148,8 +148,8 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
fluentMeshFile << l[lI] + 1 << " ";
|
fluentMeshFile << l[lI] + 1 << " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
fluentMeshFile << nei[faceI] + 1 << " ";
|
fluentMeshFile << nei[facei] + 1 << " ";
|
||||||
fluentMeshFile << own[faceI] + 1 << std::endl;
|
fluentMeshFile << own[facei] + 1 << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
fluentMeshFile << "))" << std::endl;
|
fluentMeshFile << "))" << std::endl;
|
||||||
@ -194,9 +194,9 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
fluentMeshFile
|
fluentMeshFile
|
||||||
<<" 0)" << std::endl << "(" << std::endl;
|
<<" 0)" << std::endl << "(" << std::endl;
|
||||||
|
|
||||||
forAll(patchFaces, faceI)
|
forAll(patchFaces, facei)
|
||||||
{
|
{
|
||||||
const labelList& l = patchFaces[faceI];
|
const labelList& l = patchFaces[facei];
|
||||||
|
|
||||||
fluentMeshFile << " ";
|
fluentMeshFile << " ";
|
||||||
|
|
||||||
@ -210,7 +210,7 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
fluentMeshFile << l[lI] + 1 << " ";
|
fluentMeshFile << l[lI] + 1 << " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
fluentMeshFile << patchFaceCells[faceI] + 1 << " 0" << std::endl;
|
fluentMeshFile << patchFaceCells[facei] + 1 << " 0" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
fluentMeshFile << "))" << std::endl;
|
fluentMeshFile << "))" << std::endl;
|
||||||
@ -230,21 +230,21 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
|
|
||||||
bool hasWarned = false;
|
bool hasWarned = false;
|
||||||
|
|
||||||
forAll(cells, cellI)
|
forAll(cells, celli)
|
||||||
{
|
{
|
||||||
if (cells[cellI].model() == tet)
|
if (cells[celli].model() == tet)
|
||||||
{
|
{
|
||||||
fluentMeshFile << " " << 2;
|
fluentMeshFile << " " << 2;
|
||||||
}
|
}
|
||||||
else if (cells[cellI].model() == hex)
|
else if (cells[celli].model() == hex)
|
||||||
{
|
{
|
||||||
fluentMeshFile << " " << 4;
|
fluentMeshFile << " " << 4;
|
||||||
}
|
}
|
||||||
else if (cells[cellI].model() == pyr)
|
else if (cells[celli].model() == pyr)
|
||||||
{
|
{
|
||||||
fluentMeshFile << " " << 5;
|
fluentMeshFile << " " << 5;
|
||||||
}
|
}
|
||||||
else if (cells[cellI].model() == prism)
|
else if (cells[celli].model() == prism)
|
||||||
{
|
{
|
||||||
fluentMeshFile << " " << 6;
|
fluentMeshFile << " " << 6;
|
||||||
}
|
}
|
||||||
@ -256,7 +256,7 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
|
|
||||||
WarningInFunction
|
WarningInFunction
|
||||||
<< "foamMeshToFluent: cell shape for cell "
|
<< "foamMeshToFluent: cell shape for cell "
|
||||||
<< cellI << " only supported by Fluent polyhedral meshes."
|
<< celli << " only supported by Fluent polyhedral meshes."
|
||||||
<< nl
|
<< nl
|
||||||
<< " Suppressing any further messages for polyhedral"
|
<< " Suppressing any further messages for polyhedral"
|
||||||
<< " cells." << endl;
|
<< " cells." << endl;
|
||||||
|
|||||||
@ -328,14 +328,14 @@ mtype {space}"MTYPE:"{space}
|
|||||||
|
|
||||||
IStringStream elementStream(YYText());
|
IStringStream elementStream(YYText());
|
||||||
|
|
||||||
label cellI(readLabel(elementStream));
|
label celli(readLabel(elementStream));
|
||||||
label cellType(readLabel(elementStream));
|
label cellType(readLabel(elementStream));
|
||||||
label nVertices(readLabel(elementStream));
|
label nVertices(readLabel(elementStream));
|
||||||
|
|
||||||
// reset number of continuation lines
|
// reset number of continuation lines
|
||||||
nCellContinuationLines = 0;
|
nCellContinuationLines = 0;
|
||||||
|
|
||||||
cellMap[curNumberOfCells] = cellI;
|
cellMap[curNumberOfCells] = celli;
|
||||||
cellTypes[curNumberOfCells] = cellType;
|
cellTypes[curNumberOfCells] = cellType;
|
||||||
cellLabels.set(curNumberOfCells, new labelList(nVertices));
|
cellLabels.set(curNumberOfCells, new labelList(nVertices));
|
||||||
|
|
||||||
@ -682,19 +682,19 @@ int main(int argc, char *argv[])
|
|||||||
// make a cell mapping array
|
// make a cell mapping array
|
||||||
label maxCellIndex = 0;
|
label maxCellIndex = 0;
|
||||||
|
|
||||||
forAll(cellMap, cellI)
|
forAll(cellMap, celli)
|
||||||
{
|
{
|
||||||
if (cellMap[cellI] > maxCellIndex)
|
if (cellMap[celli] > maxCellIndex)
|
||||||
{
|
{
|
||||||
maxCellIndex = cellMap[cellI];
|
maxCellIndex = cellMap[celli];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
labelList cellLookup(maxCellIndex + 1);
|
labelList cellLookup(maxCellIndex + 1);
|
||||||
|
|
||||||
forAll(cellMap, cellI)
|
forAll(cellMap, celli)
|
||||||
{
|
{
|
||||||
cellLookup[cellMap[cellI] ] = cellI;
|
cellLookup[cellMap[celli] ] = celli;
|
||||||
}
|
}
|
||||||
|
|
||||||
const cellModel& hex = *(cellModeller::lookup("hex"));
|
const cellModel& hex = *(cellModeller::lookup("hex"));
|
||||||
@ -709,23 +709,23 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
cellShapeList cells(cellLabels.size());
|
cellShapeList cells(cellLabels.size());
|
||||||
|
|
||||||
forAll(cellTypes, cellI)
|
forAll(cellTypes, celli)
|
||||||
{
|
{
|
||||||
const labelList& curCellLabels = cellLabels[cellI];
|
const labelList& curCellLabels = cellLabels[celli];
|
||||||
|
|
||||||
// Tetrahedron
|
// Tetrahedron
|
||||||
if (cellTypes[cellI] == 6)
|
if (cellTypes[celli] == 6)
|
||||||
{
|
{
|
||||||
labelsTet[0] = pointLookup[curCellLabels[0] ];
|
labelsTet[0] = pointLookup[curCellLabels[0] ];
|
||||||
labelsTet[1] = pointLookup[curCellLabels[2] ];
|
labelsTet[1] = pointLookup[curCellLabels[2] ];
|
||||||
labelsTet[2] = pointLookup[curCellLabels[3] ];
|
labelsTet[2] = pointLookup[curCellLabels[3] ];
|
||||||
labelsTet[3] = pointLookup[curCellLabels[1] ];
|
labelsTet[3] = pointLookup[curCellLabels[1] ];
|
||||||
|
|
||||||
cells[cellI] = cellShape(tet, labelsTet);
|
cells[celli] = cellShape(tet, labelsTet);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Square-based pyramid
|
// Square-based pyramid
|
||||||
else if (cellTypes[cellI] == 7)
|
else if (cellTypes[celli] == 7)
|
||||||
{
|
{
|
||||||
labelsPyramid[0] = pointLookup[curCellLabels[0] ];
|
labelsPyramid[0] = pointLookup[curCellLabels[0] ];
|
||||||
labelsPyramid[1] = pointLookup[curCellLabels[1] ];
|
labelsPyramid[1] = pointLookup[curCellLabels[1] ];
|
||||||
@ -733,11 +733,11 @@ int main(int argc, char *argv[])
|
|||||||
labelsPyramid[3] = pointLookup[curCellLabels[2] ];
|
labelsPyramid[3] = pointLookup[curCellLabels[2] ];
|
||||||
labelsPyramid[4] = pointLookup[curCellLabels[4] ];
|
labelsPyramid[4] = pointLookup[curCellLabels[4] ];
|
||||||
|
|
||||||
cells[cellI] = cellShape(pyr, labelsPyramid);
|
cells[celli] = cellShape(pyr, labelsPyramid);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Triangular prism
|
// Triangular prism
|
||||||
else if (cellTypes[cellI] == 5)
|
else if (cellTypes[celli] == 5)
|
||||||
{
|
{
|
||||||
labelsPrism[0] = pointLookup[curCellLabels[0] ];
|
labelsPrism[0] = pointLookup[curCellLabels[0] ];
|
||||||
labelsPrism[1] = pointLookup[curCellLabels[1] ];
|
labelsPrism[1] = pointLookup[curCellLabels[1] ];
|
||||||
@ -746,11 +746,11 @@ int main(int argc, char *argv[])
|
|||||||
labelsPrism[4] = pointLookup[curCellLabels[4] ];
|
labelsPrism[4] = pointLookup[curCellLabels[4] ];
|
||||||
labelsPrism[5] = pointLookup[curCellLabels[5] ];
|
labelsPrism[5] = pointLookup[curCellLabels[5] ];
|
||||||
|
|
||||||
cells[cellI] = cellShape(prism, labelsPrism);
|
cells[celli] = cellShape(prism, labelsPrism);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hex
|
// Hex
|
||||||
else if (cellTypes[cellI] == 4)
|
else if (cellTypes[celli] == 4)
|
||||||
{
|
{
|
||||||
labelsHex[0] = pointLookup[curCellLabels[0] ];
|
labelsHex[0] = pointLookup[curCellLabels[0] ];
|
||||||
labelsHex[1] = pointLookup[curCellLabels[1] ];
|
labelsHex[1] = pointLookup[curCellLabels[1] ];
|
||||||
@ -761,7 +761,7 @@ int main(int argc, char *argv[])
|
|||||||
labelsHex[6] = pointLookup[curCellLabels[7] ];
|
labelsHex[6] = pointLookup[curCellLabels[7] ];
|
||||||
labelsHex[7] = pointLookup[curCellLabels[6] ];
|
labelsHex[7] = pointLookup[curCellLabels[6] ];
|
||||||
|
|
||||||
cells[cellI] = cellShape(hex, labelsHex);
|
cells[celli] = cellShape(hex, labelsHex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -788,18 +788,18 @@ int main(int argc, char *argv[])
|
|||||||
faceList& patchFaces = boundary[patchi];
|
faceList& patchFaces = boundary[patchi];
|
||||||
patchFaces.setSize(curCells.size());
|
patchFaces.setSize(curCells.size());
|
||||||
|
|
||||||
forAll(curCells, faceI)
|
forAll(curCells, facei)
|
||||||
{
|
{
|
||||||
patchFaces[faceI] =
|
patchFaces[facei] =
|
||||||
cells[cellLookup[curCells[faceI] ] ].faces()
|
cells[cellLookup[curCells[facei] ] ].faces()
|
||||||
[
|
[
|
||||||
faceIndex
|
faceIndex
|
||||||
[
|
[
|
||||||
// this picks a cell type
|
// this picks a cell type
|
||||||
cells[cellLookup[curCells[faceI] ] ]
|
cells[cellLookup[curCells[facei] ] ]
|
||||||
.model().index()
|
.model().index()
|
||||||
]
|
]
|
||||||
[curFaces[faceI] - 1] // this gives a fluent face - 1
|
[curFaces[facei] - 1] // this gives a fluent face - 1
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -120,9 +120,9 @@ label findFace(const primitivePatch& pp, const labelList& meshF)
|
|||||||
// meshF vertices (in any order ;-)
|
// meshF vertices (in any order ;-)
|
||||||
forAll(pFaces, i)
|
forAll(pFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = pFaces[i];
|
label facei = pFaces[i];
|
||||||
|
|
||||||
const face& f = pp[faceI];
|
const face& f = pp[facei];
|
||||||
|
|
||||||
// Count uses of vertices of meshF for f
|
// Count uses of vertices of meshF for f
|
||||||
label nMatched = 0;
|
label nMatched = 0;
|
||||||
@ -137,7 +137,7 @@ label findFace(const primitivePatch& pp, const labelList& meshF)
|
|||||||
|
|
||||||
if (nMatched == meshF.size())
|
if (nMatched == meshF.size())
|
||||||
{
|
{
|
||||||
return faceI;
|
return facei;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,9 +152,9 @@ label findInternalFace(const primitiveMesh& mesh, const labelList& meshF)
|
|||||||
|
|
||||||
forAll(pFaces, i)
|
forAll(pFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = pFaces[i];
|
label facei = pFaces[i];
|
||||||
|
|
||||||
const face& f = mesh.faces()[faceI];
|
const face& f = mesh.faces()[facei];
|
||||||
|
|
||||||
// Count uses of vertices of meshF for f
|
// Count uses of vertices of meshF for f
|
||||||
label nMatched = 0;
|
label nMatched = 0;
|
||||||
@ -169,7 +169,7 @@ label findInternalFace(const primitiveMesh& mesh, const labelList& meshF)
|
|||||||
|
|
||||||
if (nMatched == meshF.size())
|
if (nMatched == meshF.size())
|
||||||
{
|
{
|
||||||
return faceI;
|
return facei;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
@ -207,7 +207,7 @@ bool correctOrientation(const pointField& points, const cellShape& shape)
|
|||||||
void storeCellInZone
|
void storeCellInZone
|
||||||
(
|
(
|
||||||
const label regPhys,
|
const label regPhys,
|
||||||
const label cellI,
|
const label celli,
|
||||||
Map<label>& physToZone,
|
Map<label>& physToZone,
|
||||||
|
|
||||||
labelList& zoneToPhys,
|
labelList& zoneToPhys,
|
||||||
@ -228,12 +228,12 @@ void storeCellInZone
|
|||||||
physToZone.insert(regPhys, zoneI);
|
physToZone.insert(regPhys, zoneI);
|
||||||
|
|
||||||
zoneToPhys[zoneI] = regPhys;
|
zoneToPhys[zoneI] = regPhys;
|
||||||
zoneCells[zoneI].append(cellI);
|
zoneCells[zoneI].append(celli);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Existing zone for region
|
// Existing zone for region
|
||||||
zoneCells[zoneFnd()].append(cellI);
|
zoneCells[zoneFnd()].append(celli);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -449,7 +449,7 @@ void readCells
|
|||||||
// Storage for all cells. Too big. Shrink later
|
// Storage for all cells. Too big. Shrink later
|
||||||
cells.setSize(nElems);
|
cells.setSize(nElems);
|
||||||
|
|
||||||
label cellI = 0;
|
label celli = 0;
|
||||||
label nTet = 0;
|
label nTet = 0;
|
||||||
label nPyr = 0;
|
label nPyr = 0;
|
||||||
label nPrism = 0;
|
label nPrism = 0;
|
||||||
@ -566,7 +566,7 @@ void readCells
|
|||||||
storeCellInZone
|
storeCellInZone
|
||||||
(
|
(
|
||||||
regPhys,
|
regPhys,
|
||||||
cellI,
|
celli,
|
||||||
physToZone,
|
physToZone,
|
||||||
zoneToPhys,
|
zoneToPhys,
|
||||||
zoneCells
|
zoneCells
|
||||||
@ -578,7 +578,7 @@ void readCells
|
|||||||
|
|
||||||
renumber(mshToFoam, tetPoints);
|
renumber(mshToFoam, tetPoints);
|
||||||
|
|
||||||
cells[cellI++] = cellShape(tet, tetPoints);
|
cells[celli++] = cellShape(tet, tetPoints);
|
||||||
|
|
||||||
nTet++;
|
nTet++;
|
||||||
}
|
}
|
||||||
@ -587,7 +587,7 @@ void readCells
|
|||||||
storeCellInZone
|
storeCellInZone
|
||||||
(
|
(
|
||||||
regPhys,
|
regPhys,
|
||||||
cellI,
|
celli,
|
||||||
physToZone,
|
physToZone,
|
||||||
zoneToPhys,
|
zoneToPhys,
|
||||||
zoneCells
|
zoneCells
|
||||||
@ -599,7 +599,7 @@ void readCells
|
|||||||
|
|
||||||
renumber(mshToFoam, pyrPoints);
|
renumber(mshToFoam, pyrPoints);
|
||||||
|
|
||||||
cells[cellI++] = cellShape(pyr, pyrPoints);
|
cells[celli++] = cellShape(pyr, pyrPoints);
|
||||||
|
|
||||||
nPyr++;
|
nPyr++;
|
||||||
}
|
}
|
||||||
@ -608,7 +608,7 @@ void readCells
|
|||||||
storeCellInZone
|
storeCellInZone
|
||||||
(
|
(
|
||||||
regPhys,
|
regPhys,
|
||||||
cellI,
|
celli,
|
||||||
physToZone,
|
physToZone,
|
||||||
zoneToPhys,
|
zoneToPhys,
|
||||||
zoneCells
|
zoneCells
|
||||||
@ -620,13 +620,13 @@ void readCells
|
|||||||
|
|
||||||
renumber(mshToFoam, prismPoints);
|
renumber(mshToFoam, prismPoints);
|
||||||
|
|
||||||
cells[cellI] = cellShape(prism, prismPoints);
|
cells[celli] = cellShape(prism, prismPoints);
|
||||||
|
|
||||||
const cellShape& cell = cells[cellI];
|
const cellShape& cell = cells[celli];
|
||||||
|
|
||||||
if (!keepOrientation && !correctOrientation(points, cell))
|
if (!keepOrientation && !correctOrientation(points, cell))
|
||||||
{
|
{
|
||||||
Info<< "Inverting prism " << cellI << endl;
|
Info<< "Inverting prism " << celli << endl;
|
||||||
// Reorder prism.
|
// Reorder prism.
|
||||||
prismPoints[0] = cell[0];
|
prismPoints[0] = cell[0];
|
||||||
prismPoints[1] = cell[2];
|
prismPoints[1] = cell[2];
|
||||||
@ -635,10 +635,10 @@ void readCells
|
|||||||
prismPoints[4] = cell[4];
|
prismPoints[4] = cell[4];
|
||||||
prismPoints[5] = cell[5];
|
prismPoints[5] = cell[5];
|
||||||
|
|
||||||
cells[cellI] = cellShape(prism, prismPoints);
|
cells[celli] = cellShape(prism, prismPoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
cellI++;
|
celli++;
|
||||||
|
|
||||||
nPrism++;
|
nPrism++;
|
||||||
}
|
}
|
||||||
@ -647,7 +647,7 @@ void readCells
|
|||||||
storeCellInZone
|
storeCellInZone
|
||||||
(
|
(
|
||||||
regPhys,
|
regPhys,
|
||||||
cellI,
|
celli,
|
||||||
physToZone,
|
physToZone,
|
||||||
zoneToPhys,
|
zoneToPhys,
|
||||||
zoneCells
|
zoneCells
|
||||||
@ -661,13 +661,13 @@ void readCells
|
|||||||
|
|
||||||
renumber(mshToFoam, hexPoints);
|
renumber(mshToFoam, hexPoints);
|
||||||
|
|
||||||
cells[cellI] = cellShape(hex, hexPoints);
|
cells[celli] = cellShape(hex, hexPoints);
|
||||||
|
|
||||||
const cellShape& cell = cells[cellI];
|
const cellShape& cell = cells[celli];
|
||||||
|
|
||||||
if (!keepOrientation && !correctOrientation(points, cell))
|
if (!keepOrientation && !correctOrientation(points, cell))
|
||||||
{
|
{
|
||||||
Info<< "Inverting hex " << cellI << endl;
|
Info<< "Inverting hex " << celli << endl;
|
||||||
// Reorder hex.
|
// Reorder hex.
|
||||||
hexPoints[0] = cell[4];
|
hexPoints[0] = cell[4];
|
||||||
hexPoints[1] = cell[5];
|
hexPoints[1] = cell[5];
|
||||||
@ -678,10 +678,10 @@ void readCells
|
|||||||
hexPoints[6] = cell[2];
|
hexPoints[6] = cell[2];
|
||||||
hexPoints[7] = cell[3];
|
hexPoints[7] = cell[3];
|
||||||
|
|
||||||
cells[cellI] = cellShape(hex, hexPoints);
|
cells[celli] = cellShape(hex, hexPoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
cellI++;
|
celli++;
|
||||||
|
|
||||||
nHex++;
|
nHex++;
|
||||||
}
|
}
|
||||||
@ -705,7 +705,7 @@ void readCells
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cells.setSize(cellI);
|
cells.setSize(celli);
|
||||||
|
|
||||||
forAll(patchFaces, patchi)
|
forAll(patchFaces, patchi)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -250,15 +250,15 @@ void readPoints
|
|||||||
void addAndExtend
|
void addAndExtend
|
||||||
(
|
(
|
||||||
DynamicList<label>& indizes,
|
DynamicList<label>& indizes,
|
||||||
label cellI,
|
label celli,
|
||||||
label val
|
label val
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (indizes.size() < (cellI+1))
|
if (indizes.size() < (celli+1))
|
||||||
{
|
{
|
||||||
indizes.setSize(cellI+1,-1);
|
indizes.setSize(celli+1,-1);
|
||||||
}
|
}
|
||||||
indizes[cellI] = val;
|
indizes[celli] = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reads cells section. Read region as well? Not handled yet but should just
|
// Reads cells section. Read region as well? Not handled yet but should just
|
||||||
@ -304,16 +304,16 @@ void readCells
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
label cellI, feID, physProp, matProp, colour, nNodes;
|
label celli, feID, physProp, matProp, colour, nNodes;
|
||||||
|
|
||||||
IStringStream lineStr(line);
|
IStringStream lineStr(line);
|
||||||
lineStr
|
lineStr
|
||||||
>> cellI >> feID >> physProp >> matProp >> colour >> nNodes;
|
>> celli >> feID >> physProp >> matProp >> colour >> nNodes;
|
||||||
|
|
||||||
if (foundFeType.insert(feID))
|
if (foundFeType.insert(feID))
|
||||||
{
|
{
|
||||||
Info<< "First occurrence of element type " << feID
|
Info<< "First occurrence of element type " << feID
|
||||||
<< " for cell " << cellI << " at line "
|
<< " for cell " << celli << " at line "
|
||||||
<< is.lineNumber() << endl;
|
<< is.lineNumber() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -338,7 +338,7 @@ void readCells
|
|||||||
lineStr
|
lineStr
|
||||||
>> cVerts[0] >> cVerts[1] >> cVerts[2];
|
>> cVerts[0] >> cVerts[1] >> cVerts[2];
|
||||||
boundaryFaces.append(cVerts);
|
boundaryFaces.append(cVerts);
|
||||||
boundaryFaceIndices.append(cellI);
|
boundaryFaceIndices.append(celli);
|
||||||
}
|
}
|
||||||
else if (feID == 44 || feID == 94)
|
else if (feID == 44 || feID == 94)
|
||||||
{
|
{
|
||||||
@ -350,7 +350,7 @@ void readCells
|
|||||||
lineStr
|
lineStr
|
||||||
>> cVerts[0] >> cVerts[1] >> cVerts[2] >> cVerts[3];
|
>> cVerts[0] >> cVerts[1] >> cVerts[2] >> cVerts[3];
|
||||||
boundaryFaces.append(cVerts);
|
boundaryFaces.append(cVerts);
|
||||||
boundaryFaceIndices.append(cellI);
|
boundaryFaceIndices.append(celli);
|
||||||
}
|
}
|
||||||
else if (feID == 111)
|
else if (feID == 111)
|
||||||
{
|
{
|
||||||
@ -364,12 +364,12 @@ void readCells
|
|||||||
|
|
||||||
cellVerts.append(cellShape(tet, cVerts, true));
|
cellVerts.append(cellShape(tet, cVerts, true));
|
||||||
cellMaterial.append(physProp);
|
cellMaterial.append(physProp);
|
||||||
addAndExtend(cellCorrespondence,cellI,cellMaterial.size()-1);
|
addAndExtend(cellCorrespondence,celli,cellMaterial.size()-1);
|
||||||
|
|
||||||
if (cellVerts.last().size() != cVerts.size())
|
if (cellVerts.last().size() != cVerts.size())
|
||||||
{
|
{
|
||||||
Info<< "Line:" << is.lineNumber()
|
Info<< "Line:" << is.lineNumber()
|
||||||
<< " element:" << cellI
|
<< " element:" << celli
|
||||||
<< " type:" << feID
|
<< " type:" << feID
|
||||||
<< " collapsed from " << cVerts << nl
|
<< " collapsed from " << cVerts << nl
|
||||||
<< " to:" << cellVerts.last()
|
<< " to:" << cellVerts.last()
|
||||||
@ -389,12 +389,12 @@ void readCells
|
|||||||
|
|
||||||
cellVerts.append(cellShape(prism, cVerts, true));
|
cellVerts.append(cellShape(prism, cVerts, true));
|
||||||
cellMaterial.append(physProp);
|
cellMaterial.append(physProp);
|
||||||
addAndExtend(cellCorrespondence,cellI,cellMaterial.size()-1);
|
addAndExtend(cellCorrespondence,celli,cellMaterial.size()-1);
|
||||||
|
|
||||||
if (cellVerts.last().size() != cVerts.size())
|
if (cellVerts.last().size() != cVerts.size())
|
||||||
{
|
{
|
||||||
Info<< "Line:" << is.lineNumber()
|
Info<< "Line:" << is.lineNumber()
|
||||||
<< " element:" << cellI
|
<< " element:" << celli
|
||||||
<< " type:" << feID
|
<< " type:" << feID
|
||||||
<< " collapsed from " << cVerts << nl
|
<< " collapsed from " << cVerts << nl
|
||||||
<< " to:" << cellVerts.last()
|
<< " to:" << cellVerts.last()
|
||||||
@ -414,12 +414,12 @@ void readCells
|
|||||||
|
|
||||||
cellVerts.append(cellShape(hex, cVerts, true));
|
cellVerts.append(cellShape(hex, cVerts, true));
|
||||||
cellMaterial.append(physProp);
|
cellMaterial.append(physProp);
|
||||||
addAndExtend(cellCorrespondence,cellI,cellMaterial.size()-1);
|
addAndExtend(cellCorrespondence,celli,cellMaterial.size()-1);
|
||||||
|
|
||||||
if (cellVerts.last().size() != cVerts.size())
|
if (cellVerts.last().size() != cVerts.size())
|
||||||
{
|
{
|
||||||
Info<< "Line:" << is.lineNumber()
|
Info<< "Line:" << is.lineNumber()
|
||||||
<< " element:" << cellI
|
<< " element:" << celli
|
||||||
<< " type:" << feID
|
<< " type:" << feID
|
||||||
<< " collapsed from " << cVerts << nl
|
<< " collapsed from " << cVerts << nl
|
||||||
<< " to:" << cellVerts.last()
|
<< " to:" << cellVerts.last()
|
||||||
@ -446,12 +446,12 @@ void readCells
|
|||||||
|
|
||||||
cellVerts.append(cellShape(tet, cVerts, true));
|
cellVerts.append(cellShape(tet, cVerts, true));
|
||||||
cellMaterial.append(physProp);
|
cellMaterial.append(physProp);
|
||||||
addAndExtend(cellCorrespondence,cellI,cellMaterial.size()-1);
|
addAndExtend(cellCorrespondence,celli,cellMaterial.size()-1);
|
||||||
|
|
||||||
if (cellVerts.last().size() != cVerts.size())
|
if (cellVerts.last().size() != cVerts.size())
|
||||||
{
|
{
|
||||||
Info<< "Line:" << is.lineNumber()
|
Info<< "Line:" << is.lineNumber()
|
||||||
<< " element:" << cellI
|
<< " element:" << celli
|
||||||
<< " type:" << feID
|
<< " type:" << feID
|
||||||
<< " collapsed from " << cVerts << nl
|
<< " collapsed from " << cVerts << nl
|
||||||
<< " to:" << cellVerts.last()
|
<< " to:" << cellVerts.last()
|
||||||
@ -790,28 +790,28 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Renumber vertex numbers on cells
|
// Renumber vertex numbers on cells
|
||||||
|
|
||||||
forAll(cellVerts, cellI)
|
forAll(cellVerts, celli)
|
||||||
{
|
{
|
||||||
labelList foamVerts
|
labelList foamVerts
|
||||||
(
|
(
|
||||||
renumber
|
renumber
|
||||||
(
|
(
|
||||||
unvToFoam,
|
unvToFoam,
|
||||||
static_cast<labelList&>(cellVerts[cellI])
|
static_cast<labelList&>(cellVerts[celli])
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (findIndex(foamVerts, -1) != -1)
|
if (findIndex(foamVerts, -1) != -1)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Cell " << cellI
|
<< "Cell " << celli
|
||||||
<< " unv vertices " << cellVerts[cellI]
|
<< " unv vertices " << cellVerts[celli]
|
||||||
<< " has some undefined vertices " << foamVerts
|
<< " has some undefined vertices " << foamVerts
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bit nasty: replace vertex list.
|
// Bit nasty: replace vertex list.
|
||||||
cellVerts[cellI].transfer(foamVerts);
|
cellVerts[celli].transfer(foamVerts);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Renumber vertex numbers on boundaryFaces
|
// Renumber vertex numbers on boundaryFaces
|
||||||
@ -850,15 +850,15 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
{
|
{
|
||||||
HashTable<label, face, Hash<face>> faceToFaceID(boundaryFaces.size());
|
HashTable<label, face, Hash<face>> faceToFaceID(boundaryFaces.size());
|
||||||
forAll(boundaryFaces, faceI)
|
forAll(boundaryFaces, facei)
|
||||||
{
|
{
|
||||||
SortableList<label> sortedVerts(boundaryFaces[faceI]);
|
SortableList<label> sortedVerts(boundaryFaces[facei]);
|
||||||
faceToFaceID.insert(face(sortedVerts), faceI);
|
faceToFaceID.insert(face(sortedVerts), facei);
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(cellVerts, cellI)
|
forAll(cellVerts, celli)
|
||||||
{
|
{
|
||||||
faceList faces = cellVerts[cellI].faces();
|
faceList faces = cellVerts[celli].faces();
|
||||||
forAll(faces, i)
|
forAll(faces, i)
|
||||||
{
|
{
|
||||||
SortableList<label> sortedVerts(faces[i]);
|
SortableList<label> sortedVerts(faces[i]);
|
||||||
@ -867,31 +867,31 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (fnd != faceToFaceID.end())
|
if (fnd != faceToFaceID.end())
|
||||||
{
|
{
|
||||||
label faceI = fnd();
|
label facei = fnd();
|
||||||
int stat = face::compare(faces[i], boundaryFaces[faceI]);
|
int stat = face::compare(faces[i], boundaryFaces[facei]);
|
||||||
|
|
||||||
if (stat == 1)
|
if (stat == 1)
|
||||||
{
|
{
|
||||||
// Same orientation. Cell is owner.
|
// Same orientation. Cell is owner.
|
||||||
own[faceI] = cellI;
|
own[facei] = celli;
|
||||||
}
|
}
|
||||||
else if (stat == -1)
|
else if (stat == -1)
|
||||||
{
|
{
|
||||||
// Opposite orientation. Cell is neighbour.
|
// Opposite orientation. Cell is neighbour.
|
||||||
nei[faceI] = cellI;
|
nei[facei] = celli;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
label nReverse = 0;
|
label nReverse = 0;
|
||||||
forAll(own, faceI)
|
forAll(own, facei)
|
||||||
{
|
{
|
||||||
if (own[faceI] == -1 && nei[faceI] != -1)
|
if (own[facei] == -1 && nei[facei] != -1)
|
||||||
{
|
{
|
||||||
// Boundary face with incorrect orientation
|
// Boundary face with incorrect orientation
|
||||||
boundaryFaces[faceI] = boundaryFaces[faceI].reverseFace();
|
boundaryFaces[facei] = boundaryFaces[facei].reverseFace();
|
||||||
Swap(own[faceI], nei[faceI]);
|
Swap(own[facei], nei[facei]);
|
||||||
nReverse++;
|
nReverse++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -903,12 +903,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
|
|
||||||
label cnt = 0;
|
label cnt = 0;
|
||||||
forAll(own, faceI)
|
forAll(own, facei)
|
||||||
{
|
{
|
||||||
if (own[faceI] != -1 && nei[faceI] != -1)
|
if (own[facei] != -1 && nei[facei] != -1)
|
||||||
{
|
{
|
||||||
faceToCell[1].insert(faceI, own[faceI]);
|
faceToCell[1].insert(facei, own[facei]);
|
||||||
faceToCell[0].insert(faceI, nei[faceI]);
|
faceToCell[0].insert(facei, nei[facei]);
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -958,9 +958,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
List<DynamicList<face>> dynPatchFaces(dofVertIndices.size());
|
List<DynamicList<face>> dynPatchFaces(dofVertIndices.size());
|
||||||
|
|
||||||
forAll(cellVerts, cellI)
|
forAll(cellVerts, celli)
|
||||||
{
|
{
|
||||||
const cellShape& shape = cellVerts[cellI];
|
const cellShape& shape = cellVerts[celli];
|
||||||
|
|
||||||
const faceList shapeFaces(shape.faces());
|
const faceList shapeFaces(shape.faces());
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -92,24 +92,24 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (readHex)
|
if (readHex)
|
||||||
{
|
{
|
||||||
for (label cellI = 0; cellI < nCells; cellI++)
|
for (label celli = 0; celli < nCells; celli++)
|
||||||
{
|
{
|
||||||
for (label cp = 0; cp < 8; cp++)
|
for (label cp = 0; cp < 8; cp++)
|
||||||
{
|
{
|
||||||
mshStream >> hexPoints[cp];
|
mshStream >> hexPoints[cp];
|
||||||
}
|
}
|
||||||
cells[cellI] = cellShape(hex, hexPoints);
|
cells[celli] = cellShape(hex, hexPoints);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (label cellI = 0; cellI < nCells; cellI++)
|
for (label celli = 0; celli < nCells; celli++)
|
||||||
{
|
{
|
||||||
for (label cp = 0; cp < 4; cp++)
|
for (label cp = 0; cp < 4; cp++)
|
||||||
{
|
{
|
||||||
mshStream >> tetPoints[cp];
|
mshStream >> tetPoints[cp];
|
||||||
}
|
}
|
||||||
cells[cellI] = cellShape(tet, tetPoints);
|
cells[celli] = cellShape(tet, tetPoints);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -127,7 +127,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
labelList tetPoints(4);
|
labelList tetPoints(4);
|
||||||
|
|
||||||
forAll(cells, cellI)
|
forAll(cells, celli)
|
||||||
{
|
{
|
||||||
label domain(readLabel(str));
|
label domain(readLabel(str));
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ int main(int argc, char *argv[])
|
|||||||
tetPoints[2] = readLabel(str) - 1;
|
tetPoints[2] = readLabel(str) - 1;
|
||||||
tetPoints[3] = readLabel(str) - 1;
|
tetPoints[3] = readLabel(str) - 1;
|
||||||
|
|
||||||
cells[cellI] = cellShape(tet, tetPoints);
|
cells[celli] = cellShape(tet, tetPoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ int main(int argc, char *argv[])
|
|||||||
// Boundary faces as three vertices
|
// Boundary faces as three vertices
|
||||||
HashTable<label, triFace, Hash<triFace>> vertsToBoundary(nFaces);
|
HashTable<label, triFace, Hash<triFace>> vertsToBoundary(nFaces);
|
||||||
|
|
||||||
forAll(boundaryFaces, faceI)
|
forAll(boundaryFaces, facei)
|
||||||
{
|
{
|
||||||
label patchi(readLabel(str));
|
label patchi(readLabel(str));
|
||||||
|
|
||||||
@ -183,13 +183,13 @@ int main(int argc, char *argv[])
|
|||||||
triFace tri(readLabel(str)-1, readLabel(str)-1, readLabel(str)-1);
|
triFace tri(readLabel(str)-1, readLabel(str)-1, readLabel(str)-1);
|
||||||
|
|
||||||
// Store boundary face as is for now. Later on reverse it.
|
// Store boundary face as is for now. Later on reverse it.
|
||||||
boundaryFaces[faceI].setSize(3);
|
boundaryFaces[facei].setSize(3);
|
||||||
boundaryFaces[faceI][0] = tri[0];
|
boundaryFaces[facei][0] = tri[0];
|
||||||
boundaryFaces[faceI][1] = tri[1];
|
boundaryFaces[facei][1] = tri[1];
|
||||||
boundaryFaces[faceI][2] = tri[2];
|
boundaryFaces[facei][2] = tri[2];
|
||||||
boundaryPatch[faceI] = patchi;
|
boundaryPatch[facei] = patchi;
|
||||||
|
|
||||||
vertsToBoundary.insert(tri, faceI);
|
vertsToBoundary.insert(tri, facei);
|
||||||
}
|
}
|
||||||
|
|
||||||
label nPatches = maxPatch + 1;
|
label nPatches = maxPatch + 1;
|
||||||
@ -199,9 +199,9 @@ int main(int argc, char *argv[])
|
|||||||
// For storage reasons I store the triangles and loop over the cells instead
|
// For storage reasons I store the triangles and loop over the cells instead
|
||||||
// of the other way around (store cells and loop over triangles) though
|
// of the other way around (store cells and loop over triangles) though
|
||||||
// that would be faster.
|
// that would be faster.
|
||||||
forAll(cells, cellI)
|
forAll(cells, celli)
|
||||||
{
|
{
|
||||||
const cellShape& cll = cells[cellI];
|
const cellShape& cll = cells[celli];
|
||||||
|
|
||||||
// Get the four (outwards pointing) faces of the cell
|
// Get the four (outwards pointing) faces of the cell
|
||||||
faceList tris(cll.faces());
|
faceList tris(cll.faces());
|
||||||
@ -217,7 +217,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (iter != vertsToBoundary.end())
|
if (iter != vertsToBoundary.end())
|
||||||
{
|
{
|
||||||
label faceI = iter();
|
label facei = iter();
|
||||||
const triFace& tri = iter.key();
|
const triFace& tri = iter.key();
|
||||||
|
|
||||||
// Determine orientation of tri v.s. cell centre.
|
// Determine orientation of tri v.s. cell centre.
|
||||||
@ -228,7 +228,7 @@ int main(int argc, char *argv[])
|
|||||||
if (((fc - cc) & fn) < 0)
|
if (((fc - cc) & fn) < 0)
|
||||||
{
|
{
|
||||||
// Boundary face points inwards. Flip.
|
// Boundary face points inwards. Flip.
|
||||||
boundaryFaces[faceI].flip();
|
boundaryFaces[facei].flip();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Done this face so erase from hash
|
// Done this face so erase from hash
|
||||||
@ -268,11 +268,11 @@ int main(int argc, char *argv[])
|
|||||||
// Sort boundaryFaces by patch.
|
// Sort boundaryFaces by patch.
|
||||||
List<DynamicList<face>> allPatchFaces(nPatches);
|
List<DynamicList<face>> allPatchFaces(nPatches);
|
||||||
|
|
||||||
forAll(boundaryPatch, faceI)
|
forAll(boundaryPatch, facei)
|
||||||
{
|
{
|
||||||
label patchi = boundaryPatch[faceI];
|
label patchi = boundaryPatch[facei];
|
||||||
|
|
||||||
allPatchFaces[patchi].append(boundaryFaces[faceI]);
|
allPatchFaces[patchi].append(boundaryFaces[facei]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Patches:" << nl
|
Info<< "Patches:" << nl
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -464,9 +464,9 @@ faceList hexBlock::patchFaces(const label direc, const labelList& range) const
|
|||||||
else if (blockHandedness_ == left)
|
else if (blockHandedness_ == left)
|
||||||
{
|
{
|
||||||
// turn all faces inside out
|
// turn all faces inside out
|
||||||
forAll(result, faceI)
|
forAll(result, facei)
|
||||||
{
|
{
|
||||||
result[faceI].flip();
|
result[facei].flip();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -69,9 +69,9 @@ void Foam::sammMesh::calcPointCells() const
|
|||||||
//
|
//
|
||||||
|
|
||||||
// For each cell
|
// For each cell
|
||||||
forAll(cellShapes_, cellI)
|
forAll(cellShapes_, celli)
|
||||||
{
|
{
|
||||||
const faceList& faces = cellFaces_[cellI];
|
const faceList& faces = cellFaces_[celli];
|
||||||
|
|
||||||
forAll(faces, i)
|
forAll(faces, i)
|
||||||
{
|
{
|
||||||
@ -90,7 +90,7 @@ void Foam::sammMesh::calcPointCells() const
|
|||||||
|
|
||||||
for (label f = 0; f < curCount; f++)
|
for (label f = 0; f < curCount; f++)
|
||||||
{
|
{
|
||||||
if (curPointCells[f] == cellI)
|
if (curPointCells[f] == celli)
|
||||||
{
|
{
|
||||||
found = true;
|
found = true;
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ void Foam::sammMesh::calcPointCells() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Enter the cell label in the point's cell list
|
// Enter the cell label in the point's cell list
|
||||||
curPointCells[curCount] = cellI;
|
curPointCells[curCount] = celli;
|
||||||
|
|
||||||
// Increment the cell count for the point addressed
|
// Increment the cell count for the point addressed
|
||||||
cellCount[curPoint]++;
|
cellCount[curPoint]++;
|
||||||
|
|||||||
@ -76,11 +76,11 @@ void Foam::sammMesh::createBoundaryFaces()
|
|||||||
|
|
||||||
const labelListList& PointCells = pointCells();
|
const labelListList& PointCells = pointCells();
|
||||||
|
|
||||||
forAll(patchFaces, faceI)
|
forAll(patchFaces, facei)
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
face& curFace = patchFaces[faceI];
|
face& curFace = patchFaces[facei];
|
||||||
const labelList& facePoints = curFace;
|
const labelList& facePoints = curFace;
|
||||||
|
|
||||||
forAll(facePoints, pointI)
|
forAll(facePoints, pointI)
|
||||||
@ -88,10 +88,10 @@ void Foam::sammMesh::createBoundaryFaces()
|
|||||||
const labelList& facePointCells =
|
const labelList& facePointCells =
|
||||||
PointCells[facePoints[pointI]];
|
PointCells[facePoints[pointI]];
|
||||||
|
|
||||||
forAll(facePointCells, cellI)
|
forAll(facePointCells, celli)
|
||||||
{
|
{
|
||||||
const faceList& curCellFaces =
|
const faceList& curCellFaces =
|
||||||
cellFaces_[facePointCells[cellI]];
|
cellFaces_[facePointCells[celli]];
|
||||||
|
|
||||||
forAll(curCellFaces, cellFaceI)
|
forAll(curCellFaces, cellFaceI)
|
||||||
{
|
{
|
||||||
@ -113,7 +113,7 @@ void Foam::sammMesh::createBoundaryFaces()
|
|||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Face " << faceI
|
<< "Face " << facei
|
||||||
<< " does not have neighbour cell." << endl
|
<< " does not have neighbour cell." << endl
|
||||||
<< " face : " << endl << curFace
|
<< " face : " << endl << curFace
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
|
|||||||
@ -47,11 +47,11 @@ void Foam::sammMesh::createPolyBoundary()
|
|||||||
|
|
||||||
polyBoundaryPatchStartIndices_[patchi] = nCreatedFaces;
|
polyBoundaryPatchStartIndices_[patchi] = nCreatedFaces;
|
||||||
|
|
||||||
forAll(curShapePatch, faceI)
|
forAll(curShapePatch, facei)
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
const face& curFace = curShapePatch[faceI];
|
const face& curFace = curShapePatch[facei];
|
||||||
|
|
||||||
meshFaces_[nCreatedFaces] = curFace;
|
meshFaces_[nCreatedFaces] = curFace;
|
||||||
|
|
||||||
@ -64,10 +64,10 @@ void Foam::sammMesh::createPolyBoundary()
|
|||||||
const labelList& facePointCells =
|
const labelList& facePointCells =
|
||||||
PointCells[facePoints[pointI]];
|
PointCells[facePoints[pointI]];
|
||||||
|
|
||||||
forAll(facePointCells, cellI)
|
forAll(facePointCells, celli)
|
||||||
{
|
{
|
||||||
const faceList& curCellFaces =
|
const faceList& curCellFaces =
|
||||||
cellFaces_[facePointCells[cellI]];
|
cellFaces_[facePointCells[celli]];
|
||||||
|
|
||||||
forAll(curCellFaces, cellFaceI)
|
forAll(curCellFaces, cellFaceI)
|
||||||
{
|
{
|
||||||
@ -79,7 +79,7 @@ void Foam::sammMesh::createPolyBoundary()
|
|||||||
// Debugging
|
// Debugging
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
cellPolys_[facePointCells[cellI]][cellFaceI]
|
cellPolys_[facePointCells[celli]][cellFaceI]
|
||||||
!= -1
|
!= -1
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -89,7 +89,7 @@ void Foam::sammMesh::createPolyBoundary()
|
|||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
cellPolys_[facePointCells[cellI]][cellFaceI] =
|
cellPolys_[facePointCells[celli]][cellFaceI] =
|
||||||
nCreatedFaces;
|
nCreatedFaces;
|
||||||
|
|
||||||
nBoundaryFacesFound++;
|
nBoundaryFacesFound++;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -40,18 +40,18 @@ void Foam::sammMesh::createPolyCells()
|
|||||||
|
|
||||||
label maxFaces = 0;
|
label maxFaces = 0;
|
||||||
|
|
||||||
forAll(cellPolys_, cellI)
|
forAll(cellPolys_, celli)
|
||||||
{
|
{
|
||||||
cell& curCell = cellPolys_[cellI];
|
cell& curCell = cellPolys_[celli];
|
||||||
|
|
||||||
curCell.setSize(cellFaces_[cellI].size());
|
curCell.setSize(cellFaces_[celli].size());
|
||||||
|
|
||||||
forAll(curCell, fI)
|
forAll(curCell, fI)
|
||||||
{
|
{
|
||||||
curCell[fI] = -1;
|
curCell[fI] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
maxFaces += cellFaces_[cellI].size();
|
maxFaces += cellFaces_[celli].size();
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Maximum possible number of faces in mesh: " << maxFaces << endl;
|
Info<< "Maximum possible number of faces in mesh: " << maxFaces << endl;
|
||||||
@ -65,7 +65,7 @@ void Foam::sammMesh::createPolyCells()
|
|||||||
|
|
||||||
nInternalFaces_ = 0;
|
nInternalFaces_ = 0;
|
||||||
|
|
||||||
forAll(cellFaces_, cellI)
|
forAll(cellFaces_, celli)
|
||||||
{
|
{
|
||||||
// Note:
|
// Note:
|
||||||
// Insertion cannot be done in one go as the faces need to be
|
// Insertion cannot be done in one go as the faces need to be
|
||||||
@ -73,7 +73,7 @@ void Foam::sammMesh::createPolyCells()
|
|||||||
// cells. Therefore, all neighbours will be detected first
|
// cells. Therefore, all neighbours will be detected first
|
||||||
// and then added in the correct order.
|
// and then added in the correct order.
|
||||||
|
|
||||||
const faceList& curFaces = cellFaces_[cellI];
|
const faceList& curFaces = cellFaces_[celli];
|
||||||
|
|
||||||
// Record the neighbour cell
|
// Record the neighbour cell
|
||||||
labelList neiCells(curFaces.size(), -1);
|
labelList neiCells(curFaces.size(), -1);
|
||||||
@ -84,14 +84,14 @@ void Foam::sammMesh::createPolyCells()
|
|||||||
label nNeighbours = 0;
|
label nNeighbours = 0;
|
||||||
|
|
||||||
// For all faces ...
|
// For all faces ...
|
||||||
forAll(curFaces, faceI)
|
forAll(curFaces, facei)
|
||||||
{
|
{
|
||||||
// Skip faces that have already been matched
|
// Skip faces that have already been matched
|
||||||
if (cellPolys_[cellI][faceI] >= 0) continue;
|
if (cellPolys_[celli][facei] >= 0) continue;
|
||||||
|
|
||||||
found = false;
|
found = false;
|
||||||
|
|
||||||
const face& curFace = curFaces[faceI];
|
const face& curFace = curFaces[facei];
|
||||||
|
|
||||||
// get the list of labels
|
// get the list of labels
|
||||||
const labelList& curPoints = curFace;
|
const labelList& curPoints = curFace;
|
||||||
@ -109,7 +109,7 @@ void Foam::sammMesh::createPolyCells()
|
|||||||
|
|
||||||
// reject neighbours with the lower label. This should
|
// reject neighbours with the lower label. This should
|
||||||
// also reject current cell.
|
// also reject current cell.
|
||||||
if (curNei > cellI)
|
if (curNei > celli)
|
||||||
{
|
{
|
||||||
// get the list of search faces
|
// get the list of search faces
|
||||||
const faceList& searchFaces = cellFaces_[curNei];
|
const faceList& searchFaces = cellFaces_[curNei];
|
||||||
@ -122,8 +122,8 @@ void Foam::sammMesh::createPolyCells()
|
|||||||
found = true;
|
found = true;
|
||||||
|
|
||||||
// Record the neighbour cell and face
|
// Record the neighbour cell and face
|
||||||
neiCells[faceI] = curNei;
|
neiCells[facei] = curNei;
|
||||||
faceOfNeiCell[faceI] = neiFaceI;
|
faceOfNeiCell[facei] = neiFaceI;
|
||||||
nNeighbours++;
|
nNeighbours++;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -159,7 +159,7 @@ void Foam::sammMesh::createPolyCells()
|
|||||||
meshFaces_[nInternalFaces_] = curFaces[nextNei];
|
meshFaces_[nInternalFaces_] = curFaces[nextNei];
|
||||||
|
|
||||||
// Mark for owner
|
// Mark for owner
|
||||||
cellPolys_[cellI][nextNei] = nInternalFaces_;
|
cellPolys_[celli][nextNei] = nInternalFaces_;
|
||||||
|
|
||||||
// Mark for neighbour
|
// Mark for neighbour
|
||||||
cellPolys_[neiCells[nextNei]][faceOfNeiCell[nextNei]] =
|
cellPolys_[neiCells[nextNei]][faceOfNeiCell[nextNei]] =
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -34,21 +34,21 @@ void Foam::sammMesh::fixCollapsedEdges()
|
|||||||
{
|
{
|
||||||
cellFaces_.setSize(cellShapes_.size());
|
cellFaces_.setSize(cellShapes_.size());
|
||||||
|
|
||||||
forAll(cellShapes_, cellI)
|
forAll(cellShapes_, celli)
|
||||||
{
|
{
|
||||||
cellFaces_[cellI] = cellShapes_[cellI].faces();
|
cellFaces_[celli] = cellShapes_[celli].faces();
|
||||||
}
|
}
|
||||||
|
|
||||||
// go through the faces and find if there exist faces with duplicate
|
// go through the faces and find if there exist faces with duplicate
|
||||||
// vertices. If so, purge the duplicates and mark the mesh as a polyMesh
|
// vertices. If so, purge the duplicates and mark the mesh as a polyMesh
|
||||||
|
|
||||||
forAll(cellFaces_, cellI)
|
forAll(cellFaces_, celli)
|
||||||
{
|
{
|
||||||
faceList& curFaces = cellFaces_[cellI];
|
faceList& curFaces = cellFaces_[celli];
|
||||||
|
|
||||||
forAll(curFaces, faceI)
|
forAll(curFaces, facei)
|
||||||
{
|
{
|
||||||
face& vertexLabels = curFaces[faceI];
|
face& vertexLabels = curFaces[facei];
|
||||||
|
|
||||||
bool duplicatesFound = false;
|
bool duplicatesFound = false;
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ void Foam::sammMesh::fixCollapsedEdges()
|
|||||||
if (nNewVertices < 3)
|
if (nNewVertices < 3)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "face " << faceI << " of cell " << cellI
|
<< "face " << facei << " of cell " << celli
|
||||||
<< " is colapsed down to a point or edge, which is "
|
<< " is colapsed down to a point or edge, which is "
|
||||||
<< "not permitted" << endl
|
<< "not permitted" << endl
|
||||||
<< "original face: " << vertexLabels << endl
|
<< "original face: " << vertexLabels << endl
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -32,20 +32,20 @@ Description
|
|||||||
|
|
||||||
void Foam::sammMesh::purgeCellShapes()
|
void Foam::sammMesh::purgeCellShapes()
|
||||||
{
|
{
|
||||||
forAll(cellFaces_, cellI)
|
forAll(cellFaces_, celli)
|
||||||
{
|
{
|
||||||
const faceList& curFaces = cellFaces_[cellI];
|
const faceList& curFaces = cellFaces_[celli];
|
||||||
|
|
||||||
// Get model faces
|
// Get model faces
|
||||||
faceList shapeFaces = cellShapes_[cellI].faces();
|
faceList shapeFaces = cellShapes_[celli].faces();
|
||||||
|
|
||||||
forAll(shapeFaces, faceI)
|
forAll(shapeFaces, facei)
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
forAll(curFaces, i)
|
forAll(curFaces, i)
|
||||||
{
|
{
|
||||||
if (shapeFaces[faceI] == curFaces[i])
|
if (shapeFaces[facei] == curFaces[i])
|
||||||
{
|
{
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
@ -54,8 +54,8 @@ void Foam::sammMesh::purgeCellShapes()
|
|||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
Info<< "Purging cell shape " << cellI << endl;
|
Info<< "Purging cell shape " << celli << endl;
|
||||||
cellShapes_[cellI] = cellShape(*unknownPtr_, labelList(0));
|
cellShapes_[celli] = cellShape(*unknownPtr_, labelList(0));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -139,7 +139,7 @@ void Foam::sammMesh::readBoundary()
|
|||||||
|
|
||||||
IFstream boundaryFile(boundaryFileName);
|
IFstream boundaryFile(boundaryFileName);
|
||||||
|
|
||||||
for (label faceI=0; faceI<nFaces; faceI++)
|
for (label facei=0; facei<nFaces; facei++)
|
||||||
{
|
{
|
||||||
boundaryFile >> lineIndex;
|
boundaryFile >> lineIndex;
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ void Foam::sammMesh::readBoundary()
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
//Info<< "Converting collapsed quad into triangle"
|
//Info<< "Converting collapsed quad into triangle"
|
||||||
// << " for face " << faceI
|
// << " for face " << facei
|
||||||
// << " in Samm boundary " << lineIndex << endl;
|
// << " in Samm boundary " << lineIndex << endl;
|
||||||
|
|
||||||
pointLabelsTri[0] = pointLabels[0];
|
pointLabelsTri[0] = pointLabels[0];
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -230,7 +230,7 @@ void Foam::sammMesh::readCells()
|
|||||||
labelList labels(24, label(-1));
|
labelList labels(24, label(-1));
|
||||||
label lineLabel, sammLabel, regionLabel, typeFlag;
|
label lineLabel, sammLabel, regionLabel, typeFlag;
|
||||||
|
|
||||||
for (label cellI = 0; cellI < nCells; cellI++)
|
for (label celli = 0; celli < nCells; celli++)
|
||||||
{
|
{
|
||||||
label nLabels = 0;
|
label nLabels = 0;
|
||||||
|
|
||||||
@ -294,15 +294,15 @@ void Foam::sammMesh::readCells()
|
|||||||
|
|
||||||
} while (typeFlag == -1 || addOnToCell);
|
} while (typeFlag == -1 || addOnToCell);
|
||||||
|
|
||||||
starCellLabelLookup_[lineLabel] = cellI;
|
starCellLabelLookup_[lineLabel] = celli;
|
||||||
|
|
||||||
if (nLabels == 8)
|
if (nLabels == 8)
|
||||||
{
|
{
|
||||||
addRegularCell(labels, cellI);
|
addRegularCell(labels, celli);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
addSAMMcell(typeFlag, labels, cellI);
|
addSAMMcell(typeFlag, labels, celli);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -127,15 +127,15 @@ void Foam::sammMesh::readCouples()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Once all couples are read, remove zero size faces from all cells
|
// Once all couples are read, remove zero size faces from all cells
|
||||||
forAll(cellFaces_, cellI)
|
forAll(cellFaces_, celli)
|
||||||
{
|
{
|
||||||
faceList& curFaces = cellFaces_[cellI];
|
faceList& curFaces = cellFaces_[celli];
|
||||||
|
|
||||||
label zeroSizeFound = 0;
|
label zeroSizeFound = 0;
|
||||||
|
|
||||||
forAll(curFaces, faceI)
|
forAll(curFaces, facei)
|
||||||
{
|
{
|
||||||
if (curFaces[faceI].empty())
|
if (curFaces[facei].empty())
|
||||||
{
|
{
|
||||||
zeroSizeFound++;
|
zeroSizeFound++;
|
||||||
}
|
}
|
||||||
@ -150,11 +150,11 @@ void Foam::sammMesh::readCouples()
|
|||||||
|
|
||||||
label nFaces = 0;
|
label nFaces = 0;
|
||||||
|
|
||||||
forAll(oldFaces, faceI)
|
forAll(oldFaces, facei)
|
||||||
{
|
{
|
||||||
if (oldFaces[faceI].size())
|
if (oldFaces[facei].size())
|
||||||
{
|
{
|
||||||
curFaces[nFaces] = oldFaces[faceI];
|
curFaces[nFaces] = oldFaces[facei];
|
||||||
|
|
||||||
nFaces++;
|
nFaces++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -128,21 +128,21 @@ void Foam::sammMesh::createPolyMeshData()
|
|||||||
label nProblemCells = 0;
|
label nProblemCells = 0;
|
||||||
|
|
||||||
// check that there is no zeros in the cellPolys_
|
// check that there is no zeros in the cellPolys_
|
||||||
forAll(cellPolys_, cellI)
|
forAll(cellPolys_, celli)
|
||||||
{
|
{
|
||||||
const labelList& curFaceLabels = cellPolys_[cellI];
|
const labelList& curFaceLabels = cellPolys_[celli];
|
||||||
|
|
||||||
forAll(curFaceLabels, faceI)
|
forAll(curFaceLabels, facei)
|
||||||
{
|
{
|
||||||
if (curFaceLabels[faceI] == -1)
|
if (curFaceLabels[facei] == -1)
|
||||||
{
|
{
|
||||||
Info<< "cell " << cellI
|
Info<< "cell " << celli
|
||||||
<< " has got an unmatched face. "
|
<< " has got an unmatched face. "
|
||||||
<< "Index: " << cellShapes_[cellI].model().index() << endl
|
<< "Index: " << cellShapes_[celli].model().index() << endl
|
||||||
// << "cell shape: " << cellShapes_[cellI] << endl
|
// << "cell shape: " << cellShapes_[celli] << endl
|
||||||
// << "shape faces: " << cellShapes_[cellI].faces() << endl
|
// << "shape faces: " << cellShapes_[celli].faces() << endl
|
||||||
<< "cellPolys: " << cellPolys_[cellI] << endl
|
<< "cellPolys: " << cellPolys_[celli] << endl
|
||||||
// << "cell faces: " << cellFaces_[cellI]
|
// << "cell faces: " << cellFaces_[celli]
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
nProblemCells++;
|
nProblemCells++;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -69,9 +69,9 @@ void Foam::starMesh::calcPointCells() const
|
|||||||
//
|
//
|
||||||
|
|
||||||
// For each cell
|
// For each cell
|
||||||
forAll(cellShapes_, cellI)
|
forAll(cellShapes_, celli)
|
||||||
{
|
{
|
||||||
const faceList& faces = cellFaces_[cellI];
|
const faceList& faces = cellFaces_[celli];
|
||||||
|
|
||||||
forAll(faces, i)
|
forAll(faces, i)
|
||||||
{
|
{
|
||||||
@ -90,7 +90,7 @@ void Foam::starMesh::calcPointCells() const
|
|||||||
|
|
||||||
for (label f = 0; f < curCount; f++)
|
for (label f = 0; f < curCount; f++)
|
||||||
{
|
{
|
||||||
if (curPointCells[f] == cellI)
|
if (curPointCells[f] == celli)
|
||||||
{
|
{
|
||||||
found = true;
|
found = true;
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ void Foam::starMesh::calcPointCells() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Enter the cell label in the point's cell list
|
// Enter the cell label in the point's cell list
|
||||||
curPointCells[curCount] = cellI;
|
curPointCells[curCount] = celli;
|
||||||
|
|
||||||
// Increment the cell count for the point addressed
|
// Increment the cell count for the point addressed
|
||||||
cellCount[curPoint]++;
|
cellCount[curPoint]++;
|
||||||
|
|||||||
@ -110,11 +110,11 @@ void Foam::starMesh::markBoundaryFaces()
|
|||||||
|
|
||||||
const labelListList& PointCells = pointCells();
|
const labelListList& PointCells = pointCells();
|
||||||
|
|
||||||
forAll(patchFaces, faceI)
|
forAll(patchFaces, facei)
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
const face& curFace = patchFaces[faceI];
|
const face& curFace = patchFaces[facei];
|
||||||
const labelList& facePoints = curFace;
|
const labelList& facePoints = curFace;
|
||||||
|
|
||||||
forAll(facePoints, pointI)
|
forAll(facePoints, pointI)
|
||||||
@ -122,9 +122,9 @@ void Foam::starMesh::markBoundaryFaces()
|
|||||||
const labelList& facePointCells =
|
const labelList& facePointCells =
|
||||||
PointCells[facePoints[pointI]];
|
PointCells[facePoints[pointI]];
|
||||||
|
|
||||||
forAll(facePointCells, cellI)
|
forAll(facePointCells, celli)
|
||||||
{
|
{
|
||||||
const label curCellIndex = facePointCells[cellI];
|
const label curCellIndex = facePointCells[celli];
|
||||||
|
|
||||||
const faceList& curCellFaces =
|
const faceList& curCellFaces =
|
||||||
cellFaces_[curCellIndex];
|
cellFaces_[curCellIndex];
|
||||||
@ -137,8 +137,8 @@ void Foam::starMesh::markBoundaryFaces()
|
|||||||
found = true;
|
found = true;
|
||||||
|
|
||||||
// Set boundary face to the corresponding cell face
|
// Set boundary face to the corresponding cell face
|
||||||
curBoundaryCellIDs[faceI] = curCellIndex;
|
curBoundaryCellIDs[facei] = curCellIndex;
|
||||||
curBoundaryCellFaceIDs[faceI] = cellFaceI;
|
curBoundaryCellFaceIDs[facei] = cellFaceI;
|
||||||
}
|
}
|
||||||
if (found) break;
|
if (found) break;
|
||||||
}
|
}
|
||||||
@ -149,7 +149,7 @@ void Foam::starMesh::markBoundaryFaces()
|
|||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Face " << faceI
|
<< "Face " << facei
|
||||||
<< " does not have neighbour cell."
|
<< " does not have neighbour cell."
|
||||||
<< " Face : " << endl << curFace << endl
|
<< " Face : " << endl << curFace << endl
|
||||||
<< "PROSTAR Command: vset,news,vlis";
|
<< "PROSTAR Command: vset,news,vlis";
|
||||||
@ -186,11 +186,11 @@ void Foam::starMesh::collectBoundaryFaces()
|
|||||||
const labelList& curBoundaryCellIDs = boundaryCellIDs_[patchi];
|
const labelList& curBoundaryCellIDs = boundaryCellIDs_[patchi];
|
||||||
const labelList& curBoundaryCellFaceIDs = boundaryCellFaceIDs_[patchi];
|
const labelList& curBoundaryCellFaceIDs = boundaryCellFaceIDs_[patchi];
|
||||||
|
|
||||||
forAll(curBoundaryCellIDs, faceI)
|
forAll(curBoundaryCellIDs, facei)
|
||||||
{
|
{
|
||||||
patchFaces[faceI] =
|
patchFaces[facei] =
|
||||||
cellFaces_[curBoundaryCellIDs[faceI]]
|
cellFaces_[curBoundaryCellIDs[facei]]
|
||||||
[curBoundaryCellFaceIDs[faceI]];
|
[curBoundaryCellFaceIDs[facei]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1423,9 +1423,9 @@ void Foam::starMesh::createCoupleMatches()
|
|||||||
// Loop through all cells and reset faces for removal to zero size
|
// Loop through all cells and reset faces for removal to zero size
|
||||||
const labelList crfToc = cellRemovedFaces.toc();
|
const labelList crfToc = cellRemovedFaces.toc();
|
||||||
|
|
||||||
forAll(crfToc, cellI)
|
forAll(crfToc, celli)
|
||||||
{
|
{
|
||||||
const label curCell = crfToc[cellI];
|
const label curCell = crfToc[celli];
|
||||||
|
|
||||||
const SLList<label>& curRemovedFaces = cellRemovedFaces[curCell];
|
const SLList<label>& curRemovedFaces = cellRemovedFaces[curCell];
|
||||||
|
|
||||||
@ -1450,9 +1450,9 @@ void Foam::starMesh::createCoupleMatches()
|
|||||||
const labelList cafToc = cellAddedFaces.toc();
|
const labelList cafToc = cellAddedFaces.toc();
|
||||||
|
|
||||||
// Insert the new faces into the list
|
// Insert the new faces into the list
|
||||||
forAll(cafToc, cellI)
|
forAll(cafToc, celli)
|
||||||
{
|
{
|
||||||
const label curCell = cafToc[cellI];
|
const label curCell = cafToc[celli];
|
||||||
|
|
||||||
const SLList<face>& curAddedFaces = cellAddedFaces[curCell];
|
const SLList<face>& curAddedFaces = cellAddedFaces[curCell];
|
||||||
|
|
||||||
@ -1464,11 +1464,11 @@ void Foam::starMesh::createCoupleMatches()
|
|||||||
label nNewFaces = 0;
|
label nNewFaces = 0;
|
||||||
|
|
||||||
// copy original faces that have not been removed
|
// copy original faces that have not been removed
|
||||||
forAll(oldFaces, faceI)
|
forAll(oldFaces, facei)
|
||||||
{
|
{
|
||||||
if (oldFaces[faceI].size())
|
if (oldFaces[facei].size())
|
||||||
{
|
{
|
||||||
newFaces[nNewFaces] = oldFaces[faceI];
|
newFaces[nNewFaces] = oldFaces[facei];
|
||||||
nNewFaces++;
|
nNewFaces++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,11 +47,11 @@ void Foam::starMesh::createPolyBoundary()
|
|||||||
|
|
||||||
polyBoundaryPatchStartIndices_[patchi] = nCreatedFaces;
|
polyBoundaryPatchStartIndices_[patchi] = nCreatedFaces;
|
||||||
|
|
||||||
forAll(curShapePatch, faceI)
|
forAll(curShapePatch, facei)
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
const face& curFace = curShapePatch[faceI];
|
const face& curFace = curShapePatch[facei];
|
||||||
|
|
||||||
meshFaces_[nCreatedFaces] = curFace;
|
meshFaces_[nCreatedFaces] = curFace;
|
||||||
|
|
||||||
@ -64,10 +64,10 @@ void Foam::starMesh::createPolyBoundary()
|
|||||||
const labelList& facePointCells =
|
const labelList& facePointCells =
|
||||||
PointCells[facePoints[pointI]];
|
PointCells[facePoints[pointI]];
|
||||||
|
|
||||||
forAll(facePointCells, cellI)
|
forAll(facePointCells, celli)
|
||||||
{
|
{
|
||||||
const faceList& curCellFaces =
|
const faceList& curCellFaces =
|
||||||
cellFaces_[facePointCells[cellI]];
|
cellFaces_[facePointCells[celli]];
|
||||||
|
|
||||||
forAll(curCellFaces, cellFaceI)
|
forAll(curCellFaces, cellFaceI)
|
||||||
{
|
{
|
||||||
@ -79,13 +79,13 @@ void Foam::starMesh::createPolyBoundary()
|
|||||||
// Debugging
|
// Debugging
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
cellPolys_[facePointCells[cellI]][cellFaceI]
|
cellPolys_[facePointCells[celli]][cellFaceI]
|
||||||
!= -1
|
!= -1
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
cellPolys_[facePointCells[cellI]][cellFaceI]
|
cellPolys_[facePointCells[celli]][cellFaceI]
|
||||||
> nInternalFaces_
|
> nInternalFaces_
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -157,7 +157,7 @@ void Foam::starMesh::createPolyBoundary()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cellPolys_[facePointCells[cellI]][cellFaceI] =
|
cellPolys_[facePointCells[celli]][cellFaceI] =
|
||||||
nCreatedFaces;
|
nCreatedFaces;
|
||||||
|
|
||||||
nBoundaryFacesFound++;
|
nBoundaryFacesFound++;
|
||||||
@ -176,20 +176,20 @@ void Foam::starMesh::createPolyBoundary()
|
|||||||
// check all cellPolys_ to see if there are any missing faces
|
// check all cellPolys_ to see if there are any missing faces
|
||||||
label nMissingFaceFound = 0;
|
label nMissingFaceFound = 0;
|
||||||
|
|
||||||
forAll(cellPolys_, cellI)
|
forAll(cellPolys_, celli)
|
||||||
{
|
{
|
||||||
const labelList& curFaces = cellPolys_[cellI];
|
const labelList& curFaces = cellPolys_[celli];
|
||||||
|
|
||||||
forAll(curFaces, faceI)
|
forAll(curFaces, facei)
|
||||||
{
|
{
|
||||||
if (curFaces[faceI] < 0)
|
if (curFaces[facei] < 0)
|
||||||
{
|
{
|
||||||
const face& missingFace = cellFaces_[cellI][faceI];
|
const face& missingFace = cellFaces_[celli][facei];
|
||||||
|
|
||||||
InfoInFunction
|
InfoInFunction
|
||||||
<< "Missing face found in cell " << cellI
|
<< "Missing face found in cell " << celli
|
||||||
<< ".\nType: " << cellShapes_[cellI].model().name()
|
<< ".\nType: " << cellShapes_[celli].model().name()
|
||||||
<< ". STAR cell number: " << starCellID_[cellI]
|
<< ". STAR cell number: " << starCellID_[celli]
|
||||||
<< ". Face: " << missingFace << endl;
|
<< ". Face: " << missingFace << endl;
|
||||||
|
|
||||||
nMissingFaceFound++;
|
nMissingFaceFound++;
|
||||||
@ -228,13 +228,13 @@ void Foam::starMesh::createPolyBoundary()
|
|||||||
// (faces addressed once or more than twice)
|
// (faces addressed once or more than twice)
|
||||||
labelList markupFaces(meshFaces_.size(), 0);
|
labelList markupFaces(meshFaces_.size(), 0);
|
||||||
|
|
||||||
forAll(cellPolys_, cellI)
|
forAll(cellPolys_, celli)
|
||||||
{
|
{
|
||||||
const labelList& curFaces = cellPolys_[cellI];
|
const labelList& curFaces = cellPolys_[celli];
|
||||||
|
|
||||||
forAll(curFaces, faceI)
|
forAll(curFaces, facei)
|
||||||
{
|
{
|
||||||
markupFaces[curFaces[faceI]]++;
|
markupFaces[curFaces[facei]]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,15 +245,15 @@ void Foam::starMesh::createPolyBoundary()
|
|||||||
|
|
||||||
label nProblemFacesFound = 0;
|
label nProblemFacesFound = 0;
|
||||||
|
|
||||||
forAll(markupFaces, faceI)
|
forAll(markupFaces, facei)
|
||||||
{
|
{
|
||||||
if (markupFaces[faceI] != 2)
|
if (markupFaces[facei] != 2)
|
||||||
{
|
{
|
||||||
const face& problemFace = meshFaces_[faceI];
|
const face& problemFace = meshFaces_[facei];
|
||||||
|
|
||||||
InfoInFunction
|
InfoInFunction
|
||||||
<< "Problem with face " << faceI << ": addressed "
|
<< "Problem with face " << facei << ": addressed "
|
||||||
<< markupFaces[faceI] << " times (should be 2!). Face: "
|
<< markupFaces[facei] << " times (should be 2!). Face: "
|
||||||
<< problemFace << endl;
|
<< problemFace << endl;
|
||||||
|
|
||||||
nProblemFacesFound++;
|
nProblemFacesFound++;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -40,18 +40,18 @@ void Foam::starMesh::createPolyCells()
|
|||||||
|
|
||||||
label maxFaces = 0;
|
label maxFaces = 0;
|
||||||
|
|
||||||
forAll(cellPolys_, cellI)
|
forAll(cellPolys_, celli)
|
||||||
{
|
{
|
||||||
cell& curCell = cellPolys_[cellI];
|
cell& curCell = cellPolys_[celli];
|
||||||
|
|
||||||
curCell.setSize(cellFaces_[cellI].size());
|
curCell.setSize(cellFaces_[celli].size());
|
||||||
|
|
||||||
forAll(curCell, fI)
|
forAll(curCell, fI)
|
||||||
{
|
{
|
||||||
curCell[fI] = -1;
|
curCell[fI] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
maxFaces += cellFaces_[cellI].size();
|
maxFaces += cellFaces_[celli].size();
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Maximum possible number of faces in mesh: " << maxFaces << endl;
|
Info<< "Maximum possible number of faces in mesh: " << maxFaces << endl;
|
||||||
@ -65,7 +65,7 @@ void Foam::starMesh::createPolyCells()
|
|||||||
|
|
||||||
nInternalFaces_ = 0;
|
nInternalFaces_ = 0;
|
||||||
|
|
||||||
forAll(cellFaces_, cellI)
|
forAll(cellFaces_, celli)
|
||||||
{
|
{
|
||||||
// Note:
|
// Note:
|
||||||
// Insertion cannot be done in one go as the faces need to be
|
// Insertion cannot be done in one go as the faces need to be
|
||||||
@ -73,7 +73,7 @@ void Foam::starMesh::createPolyCells()
|
|||||||
// cells. Therefore, all neighbours will be detected first
|
// cells. Therefore, all neighbours will be detected first
|
||||||
// and then added in the correct order.
|
// and then added in the correct order.
|
||||||
|
|
||||||
const faceList& curFaces = cellFaces_[cellI];
|
const faceList& curFaces = cellFaces_[celli];
|
||||||
|
|
||||||
// Record the neighbour cell
|
// Record the neighbour cell
|
||||||
labelList neiCells(curFaces.size(), -1);
|
labelList neiCells(curFaces.size(), -1);
|
||||||
@ -84,14 +84,14 @@ void Foam::starMesh::createPolyCells()
|
|||||||
label nNeighbours = 0;
|
label nNeighbours = 0;
|
||||||
|
|
||||||
// For all faces ...
|
// For all faces ...
|
||||||
forAll(curFaces, faceI)
|
forAll(curFaces, facei)
|
||||||
{
|
{
|
||||||
// Skip faces that have already been matched
|
// Skip faces that have already been matched
|
||||||
if (cellPolys_[cellI][faceI] >= 0) continue;
|
if (cellPolys_[celli][facei] >= 0) continue;
|
||||||
|
|
||||||
found = false;
|
found = false;
|
||||||
|
|
||||||
const face& curFace = curFaces[faceI];
|
const face& curFace = curFaces[facei];
|
||||||
|
|
||||||
// get the list of labels
|
// get the list of labels
|
||||||
const labelList& curPoints = curFace;
|
const labelList& curPoints = curFace;
|
||||||
@ -109,7 +109,7 @@ void Foam::starMesh::createPolyCells()
|
|||||||
|
|
||||||
// reject neighbours with the lower label. This should
|
// reject neighbours with the lower label. This should
|
||||||
// also reject current cell.
|
// also reject current cell.
|
||||||
if (curNei > cellI)
|
if (curNei > celli)
|
||||||
{
|
{
|
||||||
// get the list of search faces
|
// get the list of search faces
|
||||||
const faceList& searchFaces = cellFaces_[curNei];
|
const faceList& searchFaces = cellFaces_[curNei];
|
||||||
@ -122,8 +122,8 @@ void Foam::starMesh::createPolyCells()
|
|||||||
found = true;
|
found = true;
|
||||||
|
|
||||||
// Record the neighbour cell and face
|
// Record the neighbour cell and face
|
||||||
neiCells[faceI] = curNei;
|
neiCells[facei] = curNei;
|
||||||
faceOfNeiCell[faceI] = neiFaceI;
|
faceOfNeiCell[facei] = neiFaceI;
|
||||||
nNeighbours++;
|
nNeighbours++;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -159,7 +159,7 @@ void Foam::starMesh::createPolyCells()
|
|||||||
meshFaces_[nInternalFaces_] = curFaces[nextNei];
|
meshFaces_[nInternalFaces_] = curFaces[nextNei];
|
||||||
|
|
||||||
// Mark for owner
|
// Mark for owner
|
||||||
cellPolys_[cellI][nextNei] = nInternalFaces_;
|
cellPolys_[celli][nextNei] = nInternalFaces_;
|
||||||
|
|
||||||
// Mark for neighbour
|
// Mark for neighbour
|
||||||
cellPolys_[neiCells[nextNei]][faceOfNeiCell[nextNei]] =
|
cellPolys_[neiCells[nextNei]][faceOfNeiCell[nextNei]] =
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -34,21 +34,21 @@ void Foam::starMesh::fixCollapsedEdges()
|
|||||||
{
|
{
|
||||||
cellFaces_.setSize(cellShapes_.size());
|
cellFaces_.setSize(cellShapes_.size());
|
||||||
|
|
||||||
forAll(cellShapes_, cellI)
|
forAll(cellShapes_, celli)
|
||||||
{
|
{
|
||||||
cellFaces_[cellI] = cellShapes_[cellI].faces();
|
cellFaces_[celli] = cellShapes_[celli].faces();
|
||||||
}
|
}
|
||||||
|
|
||||||
// go through the faces and find if there exist faces with duplicate
|
// go through the faces and find if there exist faces with duplicate
|
||||||
// vertices. If so, purge the duplicates and mark the mesh as a polyMesh
|
// vertices. If so, purge the duplicates and mark the mesh as a polyMesh
|
||||||
|
|
||||||
forAll(cellFaces_, cellI)
|
forAll(cellFaces_, celli)
|
||||||
{
|
{
|
||||||
faceList& curFaces = cellFaces_[cellI];
|
faceList& curFaces = cellFaces_[celli];
|
||||||
|
|
||||||
forAll(curFaces, faceI)
|
forAll(curFaces, facei)
|
||||||
{
|
{
|
||||||
face& vertexLabels = curFaces[faceI];
|
face& vertexLabels = curFaces[facei];
|
||||||
|
|
||||||
bool duplicatesFound = false;
|
bool duplicatesFound = false;
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ void Foam::starMesh::fixCollapsedEdges()
|
|||||||
if (nNewVertices < 3)
|
if (nNewVertices < 3)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Face " << faceI << " of cell " << cellI
|
<< "Face " << facei << " of cell " << celli
|
||||||
<< " is colapsed down to a point or edge, which is "
|
<< " is colapsed down to a point or edge, which is "
|
||||||
<< "not permitted" << endl
|
<< "not permitted" << endl
|
||||||
<< "original face: " << vertexLabels << endl
|
<< "original face: " << vertexLabels << endl
|
||||||
|
|||||||
@ -62,9 +62,9 @@ void Foam::starMesh::mergeCoupleFacePoints()
|
|||||||
|
|
||||||
label nMergeSets = 0;
|
label nMergeSets = 0;
|
||||||
|
|
||||||
forAll(cellFaces_, cellI)
|
forAll(cellFaces_, celli)
|
||||||
{
|
{
|
||||||
const faceList& curFaces = cellFaces_[cellI];
|
const faceList& curFaces = cellFaces_[celli];
|
||||||
|
|
||||||
// create a list of all points for the cell with duplicates
|
// create a list of all points for the cell with duplicates
|
||||||
// and find the shortest edge length
|
// and find the shortest edge length
|
||||||
@ -73,11 +73,11 @@ void Foam::starMesh::mergeCoupleFacePoints()
|
|||||||
|
|
||||||
scalar pointMergeTol = GREAT;
|
scalar pointMergeTol = GREAT;
|
||||||
|
|
||||||
forAll(curFaces, faceI)
|
forAll(curFaces, facei)
|
||||||
{
|
{
|
||||||
nPointsInCell += curFaces[faceI].size();
|
nPointsInCell += curFaces[facei].size();
|
||||||
|
|
||||||
edgeList curEdges = curFaces[faceI].edges();
|
edgeList curEdges = curFaces[facei].edges();
|
||||||
|
|
||||||
forAll(curEdges, edgeI)
|
forAll(curEdges, edgeI)
|
||||||
{
|
{
|
||||||
@ -97,9 +97,9 @@ void Foam::starMesh::mergeCoupleFacePoints()
|
|||||||
labelList cellPoints(nPointsInCell);
|
labelList cellPoints(nPointsInCell);
|
||||||
label nAddedPoints = 0;
|
label nAddedPoints = 0;
|
||||||
|
|
||||||
forAll(curFaces, faceI)
|
forAll(curFaces, facei)
|
||||||
{
|
{
|
||||||
const face& f = curFaces[faceI];
|
const face& f = curFaces[facei];
|
||||||
|
|
||||||
forAll(f, fI)
|
forAll(f, fI)
|
||||||
{
|
{
|
||||||
@ -252,15 +252,15 @@ void Foam::starMesh::mergeCoupleFacePoints()
|
|||||||
// renumbering of all faces. This will only be used to see which
|
// renumbering of all faces. This will only be used to see which
|
||||||
// points are still used!
|
// points are still used!
|
||||||
|
|
||||||
forAll(cellFaces_, cellI)
|
forAll(cellFaces_, celli)
|
||||||
{
|
{
|
||||||
faceList& prelimFaces = cellFaces_[cellI];
|
faceList& prelimFaces = cellFaces_[celli];
|
||||||
|
|
||||||
forAll(prelimFaces, faceI)
|
forAll(prelimFaces, facei)
|
||||||
{
|
{
|
||||||
face oldFacePoints = prelimFaces[faceI];
|
face oldFacePoints = prelimFaces[facei];
|
||||||
|
|
||||||
face& prelimFacePoints = prelimFaces[faceI];
|
face& prelimFacePoints = prelimFaces[facei];
|
||||||
|
|
||||||
forAll(prelimFacePoints, pointI)
|
forAll(prelimFacePoints, pointI)
|
||||||
{
|
{
|
||||||
@ -283,13 +283,13 @@ void Foam::starMesh::mergeCoupleFacePoints()
|
|||||||
// re-create the point list and renumber the whole lot
|
// re-create the point list and renumber the whole lot
|
||||||
renumberPoints = 0;
|
renumberPoints = 0;
|
||||||
|
|
||||||
forAll(cellFaces_, cellI)
|
forAll(cellFaces_, celli)
|
||||||
{
|
{
|
||||||
const faceList& curFaces = cellFaces_[cellI];
|
const faceList& curFaces = cellFaces_[celli];
|
||||||
|
|
||||||
forAll(curFaces, faceI)
|
forAll(curFaces, facei)
|
||||||
{
|
{
|
||||||
const face& curFacePoints = curFaces[faceI];
|
const face& curFacePoints = curFaces[facei];
|
||||||
|
|
||||||
forAll(curFacePoints, pointI)
|
forAll(curFacePoints, pointI)
|
||||||
{
|
{
|
||||||
@ -298,9 +298,9 @@ void Foam::starMesh::mergeCoupleFacePoints()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(cellShapes_, cellI)
|
forAll(cellShapes_, celli)
|
||||||
{
|
{
|
||||||
const labelList& curLabels = cellShapes_[cellI];
|
const labelList& curLabels = cellShapes_[celli];
|
||||||
|
|
||||||
forAll(curLabels, pointI)
|
forAll(curLabels, pointI)
|
||||||
{
|
{
|
||||||
@ -308,7 +308,7 @@ void Foam::starMesh::mergeCoupleFacePoints()
|
|||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Error in point merging for cell "
|
<< "Error in point merging for cell "
|
||||||
<< cellI << ". STAR index: " << starCellID_[cellI]
|
<< celli << ". STAR index: " << starCellID_[celli]
|
||||||
<< ". " << endl
|
<< ". " << endl
|
||||||
<< "Point index: " << curLabels[pointI] << " STAR index "
|
<< "Point index: " << curLabels[pointI] << " STAR index "
|
||||||
<< starPointID_[curLabels[pointI]] << endl
|
<< starPointID_[curLabels[pointI]] << endl
|
||||||
@ -346,15 +346,15 @@ void Foam::starMesh::mergeCoupleFacePoints()
|
|||||||
|
|
||||||
Info<< "Renumbering all faces" << endl;
|
Info<< "Renumbering all faces" << endl;
|
||||||
|
|
||||||
forAll(cellFaces_, cellI)
|
forAll(cellFaces_, celli)
|
||||||
{
|
{
|
||||||
faceList& newFaces = cellFaces_[cellI];
|
faceList& newFaces = cellFaces_[celli];
|
||||||
|
|
||||||
forAll(newFaces, faceI)
|
forAll(newFaces, facei)
|
||||||
{
|
{
|
||||||
face oldFacePoints = newFaces[faceI];
|
face oldFacePoints = newFaces[facei];
|
||||||
|
|
||||||
face& newFacePoints = newFaces[faceI];
|
face& newFacePoints = newFaces[facei];
|
||||||
|
|
||||||
forAll(newFacePoints, pointI)
|
forAll(newFacePoints, pointI)
|
||||||
{
|
{
|
||||||
@ -375,11 +375,11 @@ void Foam::starMesh::mergeCoupleFacePoints()
|
|||||||
|
|
||||||
Info<< "Renumbering all cell shapes" << endl;
|
Info<< "Renumbering all cell shapes" << endl;
|
||||||
|
|
||||||
forAll(cellShapes_, cellI)
|
forAll(cellShapes_, celli)
|
||||||
{
|
{
|
||||||
labelList oldLabels = cellShapes_[cellI];
|
labelList oldLabels = cellShapes_[celli];
|
||||||
|
|
||||||
labelList& curLabels = cellShapes_[cellI];
|
labelList& curLabels = cellShapes_[celli];
|
||||||
|
|
||||||
forAll(curLabels, pointI)
|
forAll(curLabels, pointI)
|
||||||
{
|
{
|
||||||
@ -387,7 +387,7 @@ void Foam::starMesh::mergeCoupleFacePoints()
|
|||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Error in point renumbering for cell "
|
<< "Error in point renumbering for cell "
|
||||||
<< cellI << ". STAR index: " << starCellID_[cellI]
|
<< celli << ". STAR index: " << starCellID_[celli]
|
||||||
<< ". " << endl
|
<< ". " << endl
|
||||||
<< "Point index: " << curLabels[pointI] << " STAR index "
|
<< "Point index: " << curLabels[pointI] << " STAR index "
|
||||||
<< starPointID_[curLabels[pointI]] << " returns invalid "
|
<< starPointID_[curLabels[pointI]] << " returns invalid "
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -32,20 +32,20 @@ Description
|
|||||||
|
|
||||||
void Foam::starMesh::purgeCellShapes()
|
void Foam::starMesh::purgeCellShapes()
|
||||||
{
|
{
|
||||||
forAll(cellFaces_, cellI)
|
forAll(cellFaces_, celli)
|
||||||
{
|
{
|
||||||
const faceList& curFaces = cellFaces_[cellI];
|
const faceList& curFaces = cellFaces_[celli];
|
||||||
|
|
||||||
// Get model faces
|
// Get model faces
|
||||||
faceList shapeFaces = cellShapes_[cellI].faces();
|
faceList shapeFaces = cellShapes_[celli].faces();
|
||||||
|
|
||||||
forAll(shapeFaces, faceI)
|
forAll(shapeFaces, facei)
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
forAll(curFaces, i)
|
forAll(curFaces, i)
|
||||||
{
|
{
|
||||||
if (shapeFaces[faceI] == curFaces[i])
|
if (shapeFaces[facei] == curFaces[i])
|
||||||
{
|
{
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
@ -54,8 +54,8 @@ void Foam::starMesh::purgeCellShapes()
|
|||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
Info<< "Purging cell shape " << cellI << endl;
|
Info<< "Purging cell shape " << celli << endl;
|
||||||
cellShapes_[cellI] = cellShape(*unknownPtr_, labelList(0));
|
cellShapes_[celli] = cellShape(*unknownPtr_, labelList(0));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -137,7 +137,7 @@ void Foam::starMesh::readBoundary()
|
|||||||
|
|
||||||
IFstream boundaryFile(boundaryFileName);
|
IFstream boundaryFile(boundaryFileName);
|
||||||
|
|
||||||
for (label faceI=0; faceI<nFaces; faceI++)
|
for (label facei=0; facei<nFaces; facei++)
|
||||||
{
|
{
|
||||||
boundaryFile >> lineIndex;
|
boundaryFile >> lineIndex;
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ void Foam::starMesh::readBoundary()
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
//Info<< "Converting collapsed quad into triangle"
|
//Info<< "Converting collapsed quad into triangle"
|
||||||
// << " for face " << faceI
|
// << " for face " << facei
|
||||||
// << " in Star boundary " << lineIndex << endl;
|
// << " in Star boundary " << lineIndex << endl;
|
||||||
|
|
||||||
pointLabelsTri[0] = pointLabels[0];
|
pointLabelsTri[0] = pointLabels[0];
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -275,7 +275,7 @@ void Foam::starMesh::readCells()
|
|||||||
labelList labels(24, label(-1));
|
labelList labels(24, label(-1));
|
||||||
label lineLabel, starLabel, regionLabel, typeFlag;
|
label lineLabel, starLabel, regionLabel, typeFlag;
|
||||||
|
|
||||||
for (label cellI = 0; cellI < nCells; cellI++)
|
for (label celli = 0; celli < nCells; celli++)
|
||||||
{
|
{
|
||||||
label nLabels = 0;
|
label nLabels = 0;
|
||||||
|
|
||||||
@ -346,29 +346,29 @@ void Foam::starMesh::readCells()
|
|||||||
} while (addOnToCell >= 0);
|
} while (addOnToCell >= 0);
|
||||||
|
|
||||||
// Record STAR cell number (used for debugging)
|
// Record STAR cell number (used for debugging)
|
||||||
starCellID_[cellI] = lineLabel;
|
starCellID_[celli] = lineLabel;
|
||||||
|
|
||||||
// insert STAR lookup addressing
|
// insert STAR lookup addressing
|
||||||
starCellLabelLookup_[lineLabel] = cellI;
|
starCellLabelLookup_[lineLabel] = celli;
|
||||||
|
|
||||||
if (nLabels == 8)
|
if (nLabels == 8)
|
||||||
{
|
{
|
||||||
addRegularCell(labels, cellI);
|
addRegularCell(labels, celli);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
addSAMMcell(labels, cellI);
|
addSAMMcell(labels, celli);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check cell labels
|
// check cell labels
|
||||||
const labelList& curShapeLabels = cellShapes_[cellI];
|
const labelList& curShapeLabels = cellShapes_[celli];
|
||||||
|
|
||||||
forAll(curShapeLabels, i)
|
forAll(curShapeLabels, i)
|
||||||
{
|
{
|
||||||
if (curShapeLabels[i] < 0)
|
if (curShapeLabels[i] < 0)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Invalid vertex found in cell " << cellI
|
<< "Invalid vertex found in cell " << celli
|
||||||
<< ". STAR cell no: " << lineLabel
|
<< ". STAR cell no: " << lineLabel
|
||||||
<< " labels: " << curShapeLabels
|
<< " labels: " << curShapeLabels
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
|
|||||||
@ -80,11 +80,11 @@ label findFace(const primitiveMesh& mesh, const face& f)
|
|||||||
|
|
||||||
forAll(pFaces, i)
|
forAll(pFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = pFaces[i];
|
label facei = pFaces[i];
|
||||||
|
|
||||||
if (mesh.faces()[faceI] == f)
|
if (mesh.faces()[facei] == f)
|
||||||
{
|
{
|
||||||
return faceI;
|
return facei;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,7 +279,7 @@ int main(int argc, char *argv[])
|
|||||||
labelList tetPoints(4);
|
labelList tetPoints(4);
|
||||||
|
|
||||||
cellShapeList cells(nTets);
|
cellShapeList cells(nTets);
|
||||||
label cellI = 0;
|
label celli = 0;
|
||||||
|
|
||||||
while (eleStream.good())
|
while (eleStream.good())
|
||||||
{
|
{
|
||||||
@ -299,7 +299,7 @@ int main(int argc, char *argv[])
|
|||||||
tetPoints[i] = nodeToPoint[nodeI];
|
tetPoints[i] = nodeToPoint[nodeI];
|
||||||
}
|
}
|
||||||
|
|
||||||
cells[cellI++] = cellShape(tet, tetPoints);
|
cells[celli++] = cellShape(tet, tetPoints);
|
||||||
|
|
||||||
// Skip attributes
|
// Skip attributes
|
||||||
for (label i = 0; i < nElemAttr; i++)
|
for (label i = 0; i < nElemAttr; i++)
|
||||||
@ -391,7 +391,7 @@ int main(int argc, char *argv[])
|
|||||||
boundaryPatch.setSize(nFaces);
|
boundaryPatch.setSize(nFaces);
|
||||||
boundaryPatch = -1;
|
boundaryPatch = -1;
|
||||||
|
|
||||||
label faceI = 0;
|
label facei = 0;
|
||||||
|
|
||||||
// Region to patch conversion
|
// Region to patch conversion
|
||||||
Map<label> regionToPatch;
|
Map<label> regionToPatch;
|
||||||
@ -422,7 +422,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (findFace(mesh, f) >= mesh.nInternalFaces())
|
if (findFace(mesh, f) >= mesh.nInternalFaces())
|
||||||
{
|
{
|
||||||
boundaryFaces[faceI] = f;
|
boundaryFaces[facei] = f;
|
||||||
|
|
||||||
if (nFaceAttr > 0)
|
if (nFaceAttr > 0)
|
||||||
{
|
{
|
||||||
@ -451,7 +451,7 @@ int main(int argc, char *argv[])
|
|||||||
patchi = patchFind();
|
patchi = patchFind();
|
||||||
}
|
}
|
||||||
|
|
||||||
boundaryPatch[faceI] = patchi;
|
boundaryPatch[facei] = patchi;
|
||||||
|
|
||||||
// Skip remaining attributes
|
// Skip remaining attributes
|
||||||
for (label i = 1; i < nFaceAttr; i++)
|
for (label i = 1; i < nFaceAttr; i++)
|
||||||
@ -460,15 +460,15 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
faceI++;
|
facei++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Trim
|
// Trim
|
||||||
boundaryFaces.setSize(faceI);
|
boundaryFaces.setSize(facei);
|
||||||
boundaryPatch.setSize(faceI);
|
boundaryPatch.setSize(facei);
|
||||||
|
|
||||||
|
|
||||||
// Print region to patch mapping
|
// Print region to patch mapping
|
||||||
@ -500,11 +500,11 @@ int main(int argc, char *argv[])
|
|||||||
// Sort boundaryFaces by patch using boundaryPatch.
|
// Sort boundaryFaces by patch using boundaryPatch.
|
||||||
List<DynamicList<face>> allPatchFaces(nPatches);
|
List<DynamicList<face>> allPatchFaces(nPatches);
|
||||||
|
|
||||||
forAll(boundaryPatch, faceI)
|
forAll(boundaryPatch, facei)
|
||||||
{
|
{
|
||||||
label patchi = boundaryPatch[faceI];
|
label patchi = boundaryPatch[facei];
|
||||||
|
|
||||||
allPatchFaces[patchi].append(boundaryFaces[faceI]);
|
allPatchFaces[patchi].append(boundaryFaces[facei]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Patch sizes:" << endl;
|
Info<< "Patch sizes:" << endl;
|
||||||
|
|||||||
@ -106,9 +106,9 @@ void writePoints
|
|||||||
|
|
||||||
forAll(cellLabels, i)
|
forAll(cellLabels, i)
|
||||||
{
|
{
|
||||||
label cellI = cellLabels[i];
|
label celli = cellLabels[i];
|
||||||
|
|
||||||
const labelList& cEdges = mesh.cellEdges()[cellI];
|
const labelList& cEdges = mesh.cellEdges()[celli];
|
||||||
|
|
||||||
forAll(cEdges, cEdgeI)
|
forAll(cEdges, cEdgeI)
|
||||||
{
|
{
|
||||||
@ -155,21 +155,21 @@ void writePoints
|
|||||||
void writePoints
|
void writePoints
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
const label cellI,
|
const label celli,
|
||||||
const fileName& timeName
|
const fileName& timeName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
fileName fName
|
fileName fName
|
||||||
(
|
(
|
||||||
mesh.time().path()
|
mesh.time().path()
|
||||||
/ "meshPoints_" + timeName + '_' + name(cellI) + ".obj"
|
/ "meshPoints_" + timeName + '_' + name(celli) + ".obj"
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "Writing mesh points and edges to " << fName << endl;
|
Info<< "Writing mesh points and edges to " << fName << endl;
|
||||||
|
|
||||||
OFstream pointStream(fName);
|
OFstream pointStream(fName);
|
||||||
|
|
||||||
const cell& cFaces = mesh.cells()[cellI];
|
const cell& cFaces = mesh.cells()[celli];
|
||||||
|
|
||||||
meshTools::writeOBJ(pointStream, mesh.faces(), mesh.points(), cFaces);
|
meshTools::writeOBJ(pointStream, mesh.faces(), mesh.points(), cFaces);
|
||||||
}
|
}
|
||||||
@ -189,9 +189,9 @@ void writeFaceCentres(const polyMesh& mesh,const fileName& timeName)
|
|||||||
|
|
||||||
OFstream faceStream(faceFile);
|
OFstream faceStream(faceFile);
|
||||||
|
|
||||||
forAll(mesh.faceCentres(), faceI)
|
forAll(mesh.faceCentres(), facei)
|
||||||
{
|
{
|
||||||
writeOBJ(mesh.faceCentres()[faceI], faceStream);
|
writeOBJ(mesh.faceCentres()[facei], faceStream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,9 +207,9 @@ void writeCellCentres(const polyMesh& mesh, const fileName& timeName)
|
|||||||
|
|
||||||
OFstream cellStream(cellFile);
|
OFstream cellStream(cellFile);
|
||||||
|
|
||||||
forAll(mesh.cellCentres(), cellI)
|
forAll(mesh.cellCentres(), celli)
|
||||||
{
|
{
|
||||||
writeOBJ(mesh.cellCentres()[cellI], cellStream);
|
writeOBJ(mesh.cellCentres()[celli], cellStream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,9 +235,9 @@ void writePatchCentres
|
|||||||
|
|
||||||
OFstream patchFaceStream(faceFile);
|
OFstream patchFaceStream(faceFile);
|
||||||
|
|
||||||
forAll(pp.faceCentres(), faceI)
|
forAll(pp.faceCentres(), facei)
|
||||||
{
|
{
|
||||||
writeOBJ(pp.faceCentres()[faceI], patchFaceStream);
|
writeOBJ(pp.faceCentres()[facei], patchFaceStream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -270,9 +270,9 @@ void writePatchFaces
|
|||||||
writeOBJ(pp.localPoints()[pointI], patchFaceStream);
|
writeOBJ(pp.localPoints()[pointI], patchFaceStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(pp.localFaces(), faceI)
|
forAll(pp.localFaces(), facei)
|
||||||
{
|
{
|
||||||
const face& f = pp.localFaces()[faceI];
|
const face& f = pp.localFaces()[facei];
|
||||||
|
|
||||||
patchFaceStream<< 'f';
|
patchFaceStream<< 'f';
|
||||||
|
|
||||||
@ -464,9 +464,9 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
if (doCell)
|
if (doCell)
|
||||||
{
|
{
|
||||||
label cellI = args.optionRead<label>("cell");
|
label celli = args.optionRead<label>("cell");
|
||||||
|
|
||||||
writePoints(mesh, cellI, runTime.timeName());
|
writePoints(mesh, celli, runTime.timeName());
|
||||||
}
|
}
|
||||||
if (doPoint)
|
if (doPoint)
|
||||||
{
|
{
|
||||||
@ -476,7 +476,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
if (doFace)
|
if (doFace)
|
||||||
{
|
{
|
||||||
label faceI = args.optionRead<label>("face");
|
label facei = args.optionRead<label>("face");
|
||||||
|
|
||||||
fileName fName
|
fileName fName
|
||||||
(
|
(
|
||||||
@ -484,7 +484,7 @@ int main(int argc, char *argv[])
|
|||||||
/ "meshPoints_"
|
/ "meshPoints_"
|
||||||
+ runTime.timeName()
|
+ runTime.timeName()
|
||||||
+ '_'
|
+ '_'
|
||||||
+ name(faceI)
|
+ name(facei)
|
||||||
+ ".obj"
|
+ ".obj"
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -492,7 +492,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
OFstream str(fName);
|
OFstream str(fName);
|
||||||
|
|
||||||
const face& f = mesh.faces()[faceI];
|
const face& f = mesh.faces()[facei];
|
||||||
|
|
||||||
meshTools::writeOBJ(str, faceList(1, f), mesh.points());
|
meshTools::writeOBJ(str, faceList(1, f), mesh.points());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -188,10 +188,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
const pointField& cellCentres = topo.cellCentres();
|
const pointField& cellCentres = topo.cellCentres();
|
||||||
|
|
||||||
forAll(cellCentres, cellI)
|
forAll(cellCentres, celli)
|
||||||
{
|
{
|
||||||
//point cc = b.blockShape().centre(b.points());
|
//point cc = b.blockShape().centre(b.points());
|
||||||
const point& cc = cellCentres[cellI];
|
const point& cc = cellCentres[celli];
|
||||||
|
|
||||||
str << "v " << cc.x() << ' ' << cc.y() << ' ' << cc.z() << nl;
|
str << "v " << cc.x() << ' ' << cc.y() << ' ' << cc.z() << nl;
|
||||||
}
|
}
|
||||||
@ -257,7 +257,7 @@ int main(int argc, char *argv[])
|
|||||||
List<DynamicList<label>> zoneCells(nZones);
|
List<DynamicList<label>> zoneCells(nZones);
|
||||||
|
|
||||||
// Running cell counter
|
// Running cell counter
|
||||||
label cellI = 0;
|
label celli = 0;
|
||||||
|
|
||||||
// Largest zone so far
|
// Largest zone so far
|
||||||
label freeZoneI = 0;
|
label freeZoneI = 0;
|
||||||
@ -289,12 +289,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAll(blockCells, i)
|
forAll(blockCells, i)
|
||||||
{
|
{
|
||||||
zoneCells[zoneI].append(cellI++);
|
zoneCells[zoneI].append(celli++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cellI += b.cells().size();
|
celli += b.cells().size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -744,9 +744,9 @@ int main(int argc, char *argv[])
|
|||||||
layerExtrude.layerFaces()
|
layerExtrude.layerFaces()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
forAll(addedCells, faceI)
|
forAll(addedCells, facei)
|
||||||
{
|
{
|
||||||
const labelList& aCells = addedCells[faceI];
|
const labelList& aCells = addedCells[facei];
|
||||||
forAll(aCells, i)
|
forAll(aCells, i)
|
||||||
{
|
{
|
||||||
addedCellsSet.insert(aCells[i]);
|
addedCellsSet.insert(aCells[i]);
|
||||||
|
|||||||
@ -426,14 +426,14 @@ void checkZoneInside
|
|||||||
|
|
||||||
forAll(extrudeMeshFaces, i)
|
forAll(extrudeMeshFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = extrudeMeshFaces[i];
|
label facei = extrudeMeshFaces[i];
|
||||||
label zoneI = zoneID[i];
|
label zoneI = zoneID[i];
|
||||||
if (isInternal[zoneI] != mesh.isInternalFace(faceI))
|
if (isInternal[zoneI] != mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Zone " << zoneNames[zoneI]
|
<< "Zone " << zoneNames[zoneI]
|
||||||
<< " is not consistently all internal or all boundary faces."
|
<< " is not consistently all internal or all boundary faces."
|
||||||
<< " Face " << faceI << " at " << mesh.faceCentres()[faceI]
|
<< " Face " << facei << " at " << mesh.faceCentres()[facei]
|
||||||
<< " is the first occurrence."
|
<< " is the first occurrence."
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
@ -532,17 +532,17 @@ label findUncoveredPatchFace
|
|||||||
const labelList& eFaces = mesh.edgeFaces()[meshEdgeI];
|
const labelList& eFaces = mesh.edgeFaces()[meshEdgeI];
|
||||||
forAll(eFaces, i)
|
forAll(eFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = eFaces[i];
|
label facei = eFaces[i];
|
||||||
label patchi = pbm.whichPatch(faceI);
|
label patchi = pbm.whichPatch(facei);
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
patchi != -1
|
patchi != -1
|
||||||
&& !pbm[patchi].coupled()
|
&& !pbm[patchi].coupled()
|
||||||
&& !extrudeFaceSet.found(faceI)
|
&& !extrudeFaceSet.found(facei)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return faceI;
|
return facei;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
@ -568,17 +568,17 @@ label findUncoveredCyclicPatchFace
|
|||||||
const labelList& eFaces = mesh.edgeFaces()[meshEdgeI];
|
const labelList& eFaces = mesh.edgeFaces()[meshEdgeI];
|
||||||
forAll(eFaces, i)
|
forAll(eFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = eFaces[i];
|
label facei = eFaces[i];
|
||||||
label patchi = pbm.whichPatch(faceI);
|
label patchi = pbm.whichPatch(facei);
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
patchi != -1
|
patchi != -1
|
||||||
&& isA<cyclicPolyPatch>(pbm[patchi])
|
&& isA<cyclicPolyPatch>(pbm[patchi])
|
||||||
&& !extrudeFaceSet.found(faceI)
|
&& !extrudeFaceSet.found(facei)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return faceI;
|
return facei;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
@ -705,14 +705,14 @@ void countExtrudePatches
|
|||||||
// so choose any uncovered one. If none found put face in
|
// so choose any uncovered one. If none found put face in
|
||||||
// undetermined zone 'side' patch
|
// undetermined zone 'side' patch
|
||||||
|
|
||||||
label faceI = findUncoveredPatchFace
|
label facei = findUncoveredPatchFace
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
UIndirectList<label>(extrudeMeshFaces, eFaces),
|
UIndirectList<label>(extrudeMeshFaces, eFaces),
|
||||||
extrudeMeshEdges[edgeI]
|
extrudeMeshEdges[edgeI]
|
||||||
);
|
);
|
||||||
|
|
||||||
if (faceI == -1)
|
if (facei == -1)
|
||||||
{
|
{
|
||||||
zoneSidePatch[minZoneID[edgeI]]++;
|
zoneSidePatch[minZoneID[edgeI]]++;
|
||||||
}
|
}
|
||||||
@ -927,21 +927,21 @@ void addCoupledPatches
|
|||||||
// Cyclic patch since both procs the same. This cyclic should
|
// Cyclic patch since both procs the same. This cyclic should
|
||||||
// already exist in newPatches so no adding necessary.
|
// already exist in newPatches so no adding necessary.
|
||||||
|
|
||||||
label faceI = findUncoveredCyclicPatchFace
|
label facei = findUncoveredCyclicPatchFace
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
UIndirectList<label>(extrudeMeshFaces, eFaces),
|
UIndirectList<label>(extrudeMeshFaces, eFaces),
|
||||||
extrudeMeshEdges[edgeI]
|
extrudeMeshEdges[edgeI]
|
||||||
);
|
);
|
||||||
|
|
||||||
if (faceI != -1)
|
if (facei != -1)
|
||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
label newPatchI = findPatchID
|
label newPatchI = findPatchID
|
||||||
(
|
(
|
||||||
newPatches,
|
newPatches,
|
||||||
patches[patches.whichPatch(faceI)].name()
|
patches[patches.whichPatch(facei)].name()
|
||||||
);
|
);
|
||||||
|
|
||||||
sidePatchID[edgeI] = newPatchI;
|
sidePatchID[edgeI] = newPatchI;
|
||||||
@ -1305,26 +1305,26 @@ void extrudeGeometricProperties
|
|||||||
// Work out layers. Guaranteed in columns so no fancy parallel bits.
|
// Work out layers. Guaranteed in columns so no fancy parallel bits.
|
||||||
|
|
||||||
|
|
||||||
forAll(extruder.faceToFaceMap(), faceI)
|
forAll(extruder.faceToFaceMap(), facei)
|
||||||
{
|
{
|
||||||
if (extruder.faceToFaceMap()[faceI] != 0)
|
if (extruder.faceToFaceMap()[facei] != 0)
|
||||||
{
|
{
|
||||||
// 'horizontal' face
|
// 'horizontal' face
|
||||||
label patchFaceI = mag(extruder.faceToFaceMap()[faceI])-1;
|
label patchFaceI = mag(extruder.faceToFaceMap()[facei])-1;
|
||||||
|
|
||||||
label cellI = regionMesh.faceOwner()[faceI];
|
label celli = regionMesh.faceOwner()[facei];
|
||||||
if (regionMesh.isInternalFace(faceI))
|
if (regionMesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
cellI = max(cellI, regionMesh.faceNeighbour()[faceI]);
|
celli = max(celli, regionMesh.faceNeighbour()[facei]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate layer from cell numbering (see createShellMesh)
|
// Calculate layer from cell numbering (see createShellMesh)
|
||||||
label layerI = (cellI % model.nLayers());
|
label layerI = (celli % model.nLayers());
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
!regionMesh.isInternalFace(faceI)
|
!regionMesh.isInternalFace(facei)
|
||||||
&& extruder.faceToFaceMap()[faceI] > 0
|
&& extruder.faceToFaceMap()[facei] > 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Top face
|
// Top face
|
||||||
@ -1333,7 +1333,7 @@ void extrudeGeometricProperties
|
|||||||
|
|
||||||
|
|
||||||
// Recalculate based on extrusion model
|
// Recalculate based on extrusion model
|
||||||
faceCentres[faceI] = model
|
faceCentres[facei] = model
|
||||||
(
|
(
|
||||||
patchFaceCentres[patchFaceI],
|
patchFaceCentres[patchFaceI],
|
||||||
extrudePatch.faceNormals()[patchFaceI],
|
extrudePatch.faceNormals()[patchFaceI],
|
||||||
@ -1343,10 +1343,10 @@ void extrudeGeometricProperties
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 'vertical face
|
// 'vertical face
|
||||||
label patchEdgeI = extruder.faceToEdgeMap()[faceI];
|
label patchEdgeI = extruder.faceToEdgeMap()[facei];
|
||||||
label layerI =
|
label layerI =
|
||||||
(
|
(
|
||||||
regionMesh.faceOwner()[faceI]
|
regionMesh.faceOwner()[facei]
|
||||||
% model.nLayers()
|
% model.nLayers()
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1366,7 +1366,7 @@ void extrudeGeometricProperties
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Interpolate
|
// Interpolate
|
||||||
faceCentres[faceI] = 0.5*(pt0+pt1);
|
faceCentres[facei] = 0.5*(pt0+pt1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1385,12 +1385,12 @@ void extrudeGeometricProperties
|
|||||||
regionMesh.nCells()
|
regionMesh.nCells()
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(extruder.cellToFaceMap(), cellI)
|
forAll(extruder.cellToFaceMap(), celli)
|
||||||
{
|
{
|
||||||
label patchFaceI = extruder.cellToFaceMap()[cellI];
|
label patchFaceI = extruder.cellToFaceMap()[celli];
|
||||||
|
|
||||||
// Calculate layer from cell numbering (see createShellMesh)
|
// Calculate layer from cell numbering (see createShellMesh)
|
||||||
label layerI = (cellI % model.nLayers());
|
label layerI = (celli % model.nLayers());
|
||||||
|
|
||||||
// Recalculate based on extrusion model
|
// Recalculate based on extrusion model
|
||||||
point pt0 = model
|
point pt0 = model
|
||||||
@ -1407,7 +1407,7 @@ void extrudeGeometricProperties
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Interpolate
|
// Interpolate
|
||||||
cellCentres[cellI] = 0.5*(pt0+pt1);
|
cellCentres[celli] = 0.5*(pt0+pt1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1417,29 +1417,29 @@ void extrudeGeometricProperties
|
|||||||
OBJstream faceStr(regionMesh.time().path()/"faceCentres.obj");
|
OBJstream faceStr(regionMesh.time().path()/"faceCentres.obj");
|
||||||
OBJstream cellStr(regionMesh.time().path()/"cellCentres.obj");
|
OBJstream cellStr(regionMesh.time().path()/"cellCentres.obj");
|
||||||
|
|
||||||
forAll(faceCentres, faceI)
|
forAll(faceCentres, facei)
|
||||||
{
|
{
|
||||||
Pout<< "Model :" << faceCentres[faceI] << endl
|
Pout<< "Model :" << faceCentres[facei] << endl
|
||||||
<< "regionMesh:" << regionMesh.faceCentres()[faceI] << endl;
|
<< "regionMesh:" << regionMesh.faceCentres()[facei] << endl;
|
||||||
faceStr.write
|
faceStr.write
|
||||||
(
|
(
|
||||||
linePointRef
|
linePointRef
|
||||||
(
|
(
|
||||||
faceCentres[faceI],
|
faceCentres[facei],
|
||||||
regionMesh.faceCentres()[faceI]
|
regionMesh.faceCentres()[facei]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
forAll(cellCentres, cellI)
|
forAll(cellCentres, celli)
|
||||||
{
|
{
|
||||||
Pout<< "Model :" << cellCentres[cellI] << endl
|
Pout<< "Model :" << cellCentres[celli] << endl
|
||||||
<< "regionMesh:" << regionMesh.cellCentres()[cellI] << endl;
|
<< "regionMesh:" << regionMesh.cellCentres()[celli] << endl;
|
||||||
cellStr.write
|
cellStr.write
|
||||||
(
|
(
|
||||||
linePointRef
|
linePointRef
|
||||||
(
|
(
|
||||||
cellCentres[cellI],
|
cellCentres[celli],
|
||||||
regionMesh.cellCentres()[cellI]
|
regionMesh.cellCentres()[celli]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -1798,8 +1798,8 @@ int main(int argc, char *argv[])
|
|||||||
const faceSet& fz = zones[i];
|
const faceSet& fz = zones[i];
|
||||||
forAllConstIter(faceSet, fz, iter)
|
forAllConstIter(faceSet, fz, iter)
|
||||||
{
|
{
|
||||||
label faceI = iter.key();
|
label facei = iter.key();
|
||||||
if (mesh.isInternalFace(faceI))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
FatalIOErrorIn(args.executable().c_str(), dict)
|
FatalIOErrorIn(args.executable().c_str(), dict)
|
||||||
<< "faceSet " << fz.name()
|
<< "faceSet " << fz.name()
|
||||||
@ -1807,13 +1807,13 @@ int main(int argc, char *argv[])
|
|||||||
<< " This is not permitted."
|
<< " This is not permitted."
|
||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
extrudeMeshFaces[nExtrudeFaces] = faceI;
|
extrudeMeshFaces[nExtrudeFaces] = facei;
|
||||||
zoneFaces[nExtrudeFaces] = mesh.faces()[faceI];
|
zoneFaces[nExtrudeFaces] = mesh.faces()[facei];
|
||||||
zoneID[nExtrudeFaces] = i;
|
zoneID[nExtrudeFaces] = i;
|
||||||
zoneFlipMap[nExtrudeFaces] = false;
|
zoneFlipMap[nExtrudeFaces] = false;
|
||||||
nExtrudeFaces++;
|
nExtrudeFaces++;
|
||||||
|
|
||||||
if (mesh.isInternalFace(faceI))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
isInternal[i] = true;
|
isInternal[i] = true;
|
||||||
}
|
}
|
||||||
@ -1858,8 +1858,8 @@ int main(int argc, char *argv[])
|
|||||||
const faceSet& fz = shadowZones[i];
|
const faceSet& fz = shadowZones[i];
|
||||||
forAllConstIter(faceSet, fz, iter)
|
forAllConstIter(faceSet, fz, iter)
|
||||||
{
|
{
|
||||||
label faceI = iter.key();
|
label facei = iter.key();
|
||||||
if (mesh.isInternalFace(faceI))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
FatalIOErrorIn(args.executable().c_str(), dict)
|
FatalIOErrorIn(args.executable().c_str(), dict)
|
||||||
<< "faceSet " << fz.name()
|
<< "faceSet " << fz.name()
|
||||||
@ -1867,7 +1867,7 @@ int main(int argc, char *argv[])
|
|||||||
<< " This is not permitted."
|
<< " This is not permitted."
|
||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
extrudeMeshShadowFaces[nShadowFaces] = faceI;
|
extrudeMeshShadowFaces[nShadowFaces] = facei;
|
||||||
zoneShadowFlipMap[nShadowFaces] = false;
|
zoneShadowFlipMap[nShadowFaces] = false;
|
||||||
zoneShadowID[nShadowFaces] = i;
|
zoneShadowID[nShadowFaces] = i;
|
||||||
nShadowFaces++;
|
nShadowFaces++;
|
||||||
@ -2042,10 +2042,10 @@ int main(int argc, char *argv[])
|
|||||||
labelList extrudeTopPatchID(extrudePatch.size());
|
labelList extrudeTopPatchID(extrudePatch.size());
|
||||||
labelList extrudeBottomPatchID(extrudePatch.size());
|
labelList extrudeBottomPatchID(extrudePatch.size());
|
||||||
|
|
||||||
forAll(zoneID, faceI)
|
forAll(zoneID, facei)
|
||||||
{
|
{
|
||||||
extrudeTopPatchID[faceI] = interRegionTopPatch[zoneID[faceI]];
|
extrudeTopPatchID[facei] = interRegionTopPatch[zoneID[facei]];
|
||||||
extrudeBottomPatchID[faceI] = interRegionBottomPatch[zoneID[faceI]];
|
extrudeBottomPatchID[facei] = interRegionBottomPatch[zoneID[facei]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2231,19 +2231,19 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
label faceI = findUncoveredPatchFace
|
label facei = findUncoveredPatchFace
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
UIndirectList<label>(extrudeMeshFaces, eFaces),
|
UIndirectList<label>(extrudeMeshFaces, eFaces),
|
||||||
extrudeMeshEdges[edgeI]
|
extrudeMeshEdges[edgeI]
|
||||||
);
|
);
|
||||||
|
|
||||||
if (faceI != -1)
|
if (facei != -1)
|
||||||
{
|
{
|
||||||
label newPatchI = findPatchID
|
label newPatchI = findPatchID
|
||||||
(
|
(
|
||||||
regionPatches,
|
regionPatches,
|
||||||
patches[patches.whichPatch(faceI)].name()
|
patches[patches.whichPatch(facei)].name()
|
||||||
);
|
);
|
||||||
ePatches.setSize(eFaces.size(), newPatchI);
|
ePatches.setSize(eFaces.size(), newPatchI);
|
||||||
}
|
}
|
||||||
@ -2283,10 +2283,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Per local region an originating point
|
// Per local region an originating point
|
||||||
labelList localRegionPoints(localToGlobalRegion.size());
|
labelList localRegionPoints(localToGlobalRegion.size());
|
||||||
forAll(pointLocalRegions, faceI)
|
forAll(pointLocalRegions, facei)
|
||||||
{
|
{
|
||||||
const face& f = extrudePatch.localFaces()[faceI];
|
const face& f = extrudePatch.localFaces()[facei];
|
||||||
const face& pRegions = pointLocalRegions[faceI];
|
const face& pRegions = pointLocalRegions[facei];
|
||||||
forAll(pRegions, fp)
|
forAll(pRegions, fp)
|
||||||
{
|
{
|
||||||
localRegionPoints[pRegions[fp]] = f[fp];
|
localRegionPoints[pRegions[fp]] = f[fp];
|
||||||
@ -2298,13 +2298,13 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
pointField localSum(localToGlobalRegion.size(), Zero);
|
pointField localSum(localToGlobalRegion.size(), Zero);
|
||||||
|
|
||||||
forAll(pointLocalRegions, faceI)
|
forAll(pointLocalRegions, facei)
|
||||||
{
|
{
|
||||||
const face& pRegions = pointLocalRegions[faceI];
|
const face& pRegions = pointLocalRegions[facei];
|
||||||
forAll(pRegions, fp)
|
forAll(pRegions, fp)
|
||||||
{
|
{
|
||||||
label localRegionI = pRegions[fp];
|
label localRegionI = pRegions[fp];
|
||||||
localSum[localRegionI] += extrudePatch.faceNormals()[faceI];
|
localSum[localRegionI] += extrudePatch.faceNormals()[facei];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2337,13 +2337,13 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
scalar thickness = model().sumThickness(1);
|
scalar thickness = model().sumThickness(1);
|
||||||
|
|
||||||
forAll(pointLocalRegions, faceI)
|
forAll(pointLocalRegions, facei)
|
||||||
{
|
{
|
||||||
const face& f = extrudeFaces[faceI];
|
const face& f = extrudeFaces[facei];
|
||||||
|
|
||||||
forAll(f, fp)
|
forAll(f, fp)
|
||||||
{
|
{
|
||||||
label region = pointLocalRegions[faceI][fp];
|
label region = pointLocalRegions[facei][fp];
|
||||||
const point& pt = extrudePoints[f[fp]];
|
const point& pt = extrudePoints[f[fp]];
|
||||||
|
|
||||||
meshTools::writeOBJ(str, pt);
|
meshTools::writeOBJ(str, pt);
|
||||||
|
|||||||
@ -39,12 +39,12 @@ namespace Foam
|
|||||||
void Foam::extrude2DMesh::check2D() const
|
void Foam::extrude2DMesh::check2D() const
|
||||||
{
|
{
|
||||||
const faceList& faces = mesh_.faces();
|
const faceList& faces = mesh_.faces();
|
||||||
forAll(faces, faceI)
|
forAll(faces, facei)
|
||||||
{
|
{
|
||||||
if (faces[faceI].size() != 2)
|
if (faces[facei].size() != 2)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Face " << faceI << " size " << faces[faceI].size()
|
<< "Face " << facei << " size " << faces[facei].size()
|
||||||
<< " is not of size 2: mesh is not a valid two-dimensional "
|
<< " is not of size 2: mesh is not a valid two-dimensional "
|
||||||
<< "mesh" << exit(FatalError);
|
<< "mesh" << exit(FatalError);
|
||||||
}
|
}
|
||||||
@ -205,15 +205,15 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
{
|
{
|
||||||
label offset = layer * mesh_.nCells();
|
label offset = layer * mesh_.nCells();
|
||||||
|
|
||||||
forAll(mesh_.cells(), cellI)
|
forAll(mesh_.cells(), celli)
|
||||||
{
|
{
|
||||||
meshMod.addCell
|
meshMod.addCell
|
||||||
(
|
(
|
||||||
-1, //masterPointID,
|
-1, //masterPointID,
|
||||||
-1, //masterEdgeID,
|
-1, //masterEdgeID,
|
||||||
-1, //masterFaceID,
|
-1, //masterFaceID,
|
||||||
cellI + offset, //masterCellID,
|
celli + offset, //masterCellID,
|
||||||
mesh_.cellZones().whichZone(cellI) //zoneID
|
mesh_.cellZones().whichZone(celli) //zoneID
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -262,18 +262,18 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
label currentLayerOffset = layer * mesh_.nPoints();
|
label currentLayerOffset = layer * mesh_.nPoints();
|
||||||
label nextLayerOffset = currentLayerOffset + mesh_.nPoints();
|
label nextLayerOffset = currentLayerOffset + mesh_.nPoints();
|
||||||
|
|
||||||
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
|
||||||
{
|
{
|
||||||
label zoneID = mesh_.faceZones().whichZone(faceI);
|
label zoneID = mesh_.faceZones().whichZone(facei);
|
||||||
bool zoneFlip = false;
|
bool zoneFlip = false;
|
||||||
if (zoneID != -1)
|
if (zoneID != -1)
|
||||||
{
|
{
|
||||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||||
}
|
}
|
||||||
|
|
||||||
face newFace(4);
|
face newFace(4);
|
||||||
const face& f = faces[faceI];
|
const face& f = faces[facei];
|
||||||
newFace[0] = f[0] + currentLayerOffset;
|
newFace[0] = f[0] + currentLayerOffset;
|
||||||
newFace[1] = f[1] + currentLayerOffset;
|
newFace[1] = f[1] + currentLayerOffset;
|
||||||
newFace[2] = f[1] + nextLayerOffset;
|
newFace[2] = f[1] + nextLayerOffset;
|
||||||
@ -281,15 +281,15 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
|
|
||||||
//{
|
//{
|
||||||
// vector n = newFace.normal(pointField(meshMod.points()));
|
// vector n = newFace.normal(pointField(meshMod.points()));
|
||||||
// label own = mesh_.faceOwner()[faceI];
|
// label own = mesh_.faceOwner()[facei];
|
||||||
// const labelList& ownPoints = mesh_.cellPoints()[own];
|
// const labelList& ownPoints = mesh_.cellPoints()[own];
|
||||||
// point ownCc = sum(pointField(mesh_.points(), ownPoints))/ownPoints.size();
|
// point ownCc = sum(pointField(mesh_.points(), ownPoints))/ownPoints.size();
|
||||||
// label nei = mesh_.faceNeighbour()[faceI];
|
// label nei = mesh_.faceNeighbour()[facei];
|
||||||
// const labelList& neiPoints = mesh_.cellPoints()[nei];
|
// const labelList& neiPoints = mesh_.cellPoints()[nei];
|
||||||
// point neiCc = sum(pointField(mesh_.points(), neiPoints))/neiPoints.size();
|
// point neiCc = sum(pointField(mesh_.points(), neiPoints))/neiPoints.size();
|
||||||
// vector d = neiCc - ownCc;
|
// vector d = neiCc - ownCc;
|
||||||
|
|
||||||
// Pout<< "face:" << faceI << " at:" << f.centre(mesh_.points()) << endl
|
// Pout<< "face:" << facei << " at:" << f.centre(mesh_.points()) << endl
|
||||||
// << " own:" << own << " at:" << ownCc << endl
|
// << " own:" << own << " at:" << ownCc << endl
|
||||||
// << " nei:" << nei << " at:" << neiCc << endl
|
// << " nei:" << nei << " at:" << neiCc << endl
|
||||||
// << " sign:" << (n & d) << endl
|
// << " sign:" << (n & d) << endl
|
||||||
@ -301,8 +301,8 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
meshMod.addFace
|
meshMod.addFace
|
||||||
(
|
(
|
||||||
newFace,
|
newFace,
|
||||||
mesh_.faceOwner()[faceI] + offset, // own
|
mesh_.faceOwner()[facei] + offset, // own
|
||||||
mesh_.faceNeighbour()[faceI] + offset, // nei
|
mesh_.faceNeighbour()[facei] + offset, // nei
|
||||||
-1, // masterPointID
|
-1, // masterPointID
|
||||||
-1, // masterEdgeID
|
-1, // masterEdgeID
|
||||||
nFaces++, // masterFaceID
|
nFaces++, // masterFaceID
|
||||||
@ -315,8 +315,8 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< newFace << " "
|
Info<< newFace << " "
|
||||||
<< mesh_.faceOwner()[faceI] + offset << " "
|
<< mesh_.faceOwner()[facei] + offset << " "
|
||||||
<< mesh_.faceNeighbour()[faceI] + offset << " "
|
<< mesh_.faceNeighbour()[facei] + offset << " "
|
||||||
<< nFaces - 1
|
<< nFaces - 1
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
@ -333,18 +333,18 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
label startFaceI = patches[patchi].start();
|
label startFaceI = patches[patchi].start();
|
||||||
label endFaceI = startFaceI + patches[patchi].size();
|
label endFaceI = startFaceI + patches[patchi].size();
|
||||||
|
|
||||||
for (label faceI = startFaceI; faceI < endFaceI; faceI++)
|
for (label facei = startFaceI; facei < endFaceI; facei++)
|
||||||
{
|
{
|
||||||
label zoneID = mesh_.faceZones().whichZone(faceI);
|
label zoneID = mesh_.faceZones().whichZone(facei);
|
||||||
bool zoneFlip = false;
|
bool zoneFlip = false;
|
||||||
if (zoneID != -1)
|
if (zoneID != -1)
|
||||||
{
|
{
|
||||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
|
||||||
}
|
}
|
||||||
|
|
||||||
face newFace(4);
|
face newFace(4);
|
||||||
const face& f = faces[faceI];
|
const face& f = faces[facei];
|
||||||
newFace[0] = f[0] + currentLayerOffset;
|
newFace[0] = f[0] + currentLayerOffset;
|
||||||
newFace[1] = f[1] + currentLayerOffset;
|
newFace[1] = f[1] + currentLayerOffset;
|
||||||
newFace[2] = f[1] + nextLayerOffset;
|
newFace[2] = f[1] + nextLayerOffset;
|
||||||
@ -355,7 +355,7 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
meshMod.addFace
|
meshMod.addFace
|
||||||
(
|
(
|
||||||
newFace,
|
newFace,
|
||||||
mesh_.faceOwner()[faceI] + offset, // own
|
mesh_.faceOwner()[facei] + offset, // own
|
||||||
-1, // nei
|
-1, // nei
|
||||||
-1, // masterPointID
|
-1, // masterPointID
|
||||||
-1, // masterEdgeID
|
-1, // masterEdgeID
|
||||||
@ -369,7 +369,7 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< newFace << " "
|
Info<< newFace << " "
|
||||||
<< mesh_.faceOwner()[faceI] + offset << " "
|
<< mesh_.faceOwner()[facei] + offset << " "
|
||||||
<< nFaces - 1
|
<< nFaces - 1
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
@ -379,9 +379,9 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
|
|
||||||
// Add extra internal faces that need special treatment for owners and
|
// Add extra internal faces that need special treatment for owners and
|
||||||
// neighbours.
|
// neighbours.
|
||||||
forAll(mesh_.cells(), cellI)
|
forAll(mesh_.cells(), celli)
|
||||||
{
|
{
|
||||||
const cell& cFaces = mesh_.cells()[cellI];
|
const cell& cFaces = mesh_.cells()[celli];
|
||||||
|
|
||||||
face frontFace(cFaces.size());
|
face frontFace(cFaces.size());
|
||||||
|
|
||||||
@ -391,7 +391,7 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
const face& f = faces[nextFaceI];
|
const face& f = faces[nextFaceI];
|
||||||
|
|
||||||
label nextPointI;
|
label nextPointI;
|
||||||
if (mesh_.faceOwner()[nextFaceI] == cellI)
|
if (mesh_.faceOwner()[nextFaceI] == celli)
|
||||||
{
|
{
|
||||||
frontFace[0] = f[0];
|
frontFace[0] = f[0];
|
||||||
nextPointI = f[1];
|
nextPointI = f[1];
|
||||||
@ -410,21 +410,21 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
// Find face containing pointI
|
// Find face containing pointI
|
||||||
forAll(cFaces, cFaceI)
|
forAll(cFaces, cFaceI)
|
||||||
{
|
{
|
||||||
label faceI = cFaces[cFaceI];
|
label facei = cFaces[cFaceI];
|
||||||
if (faceI != nextFaceI)
|
if (facei != nextFaceI)
|
||||||
{
|
{
|
||||||
const face& f = faces[faceI];
|
const face& f = faces[facei];
|
||||||
|
|
||||||
if (f[0] == nextPointI)
|
if (f[0] == nextPointI)
|
||||||
{
|
{
|
||||||
nextPointI = f[1];
|
nextPointI = f[1];
|
||||||
nextFaceI = faceI;
|
nextFaceI = facei;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (f[1] == nextPointI)
|
else if (f[1] == nextPointI)
|
||||||
{
|
{
|
||||||
nextPointI = f[0];
|
nextPointI = f[0];
|
||||||
nextFaceI = faceI;
|
nextFaceI = facei;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -444,13 +444,13 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
label nei = -1;
|
label nei = -1;
|
||||||
if (layer != nLayers - 1)
|
if (layer != nLayers - 1)
|
||||||
{
|
{
|
||||||
nei = cellI + offset + mesh_.nCells();
|
nei = celli + offset + mesh_.nCells();
|
||||||
}
|
}
|
||||||
|
|
||||||
meshMod.addFace
|
meshMod.addFace
|
||||||
(
|
(
|
||||||
frontFace,
|
frontFace,
|
||||||
cellI + offset, // own
|
celli + offset, // own
|
||||||
nei, // nei
|
nei, // nei
|
||||||
-1, // masterPointID
|
-1, // masterPointID
|
||||||
-1, // masterEdgeID
|
-1, // masterEdgeID
|
||||||
@ -464,7 +464,7 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< frontFace << " "
|
Info<< frontFace << " "
|
||||||
<< cellI + offset << " "
|
<< celli + offset << " "
|
||||||
<< nei << " "
|
<< nei << " "
|
||||||
<< nFaces - 1
|
<< nFaces - 1
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -475,9 +475,9 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
// Generate front and back faces
|
// Generate front and back faces
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
forAll(mesh_.cells(), cellI)
|
forAll(mesh_.cells(), celli)
|
||||||
{
|
{
|
||||||
const cell& cFaces = mesh_.cells()[cellI];
|
const cell& cFaces = mesh_.cells()[celli];
|
||||||
|
|
||||||
face frontFace(cFaces.size());
|
face frontFace(cFaces.size());
|
||||||
|
|
||||||
@ -487,7 +487,7 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
const face& f = faces[nextFaceI];
|
const face& f = faces[nextFaceI];
|
||||||
|
|
||||||
label nextPointI;
|
label nextPointI;
|
||||||
if (mesh_.faceOwner()[nextFaceI] == cellI)
|
if (mesh_.faceOwner()[nextFaceI] == celli)
|
||||||
{
|
{
|
||||||
frontFace[0] = f[0];
|
frontFace[0] = f[0];
|
||||||
nextPointI = f[1];
|
nextPointI = f[1];
|
||||||
@ -506,21 +506,21 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
// Find face containing pointI
|
// Find face containing pointI
|
||||||
forAll(cFaces, cFaceI)
|
forAll(cFaces, cFaceI)
|
||||||
{
|
{
|
||||||
label faceI = cFaces[cFaceI];
|
label facei = cFaces[cFaceI];
|
||||||
if (faceI != nextFaceI)
|
if (facei != nextFaceI)
|
||||||
{
|
{
|
||||||
const face& f = faces[faceI];
|
const face& f = faces[facei];
|
||||||
|
|
||||||
if (f[0] == nextPointI)
|
if (f[0] == nextPointI)
|
||||||
{
|
{
|
||||||
nextPointI = f[1];
|
nextPointI = f[1];
|
||||||
nextFaceI = faceI;
|
nextFaceI = facei;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (f[1] == nextPointI)
|
else if (f[1] == nextPointI)
|
||||||
{
|
{
|
||||||
nextPointI = f[0];
|
nextPointI = f[0];
|
||||||
nextFaceI = faceI;
|
nextFaceI = facei;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -531,7 +531,7 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
meshMod.addFace
|
meshMod.addFace
|
||||||
(
|
(
|
||||||
frontFace.reverseFace(),
|
frontFace.reverseFace(),
|
||||||
cellI, // own
|
celli, // own
|
||||||
-1, // nei
|
-1, // nei
|
||||||
-1, // masterPointID
|
-1, // masterPointID
|
||||||
-1, // masterEdgeID
|
-1, // masterEdgeID
|
||||||
@ -545,7 +545,7 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< nl<<frontFace.reverseFace() << " "
|
Info<< nl<<frontFace.reverseFace() << " "
|
||||||
<< cellI << " "
|
<< celli << " "
|
||||||
<< nFaces - 1
|
<< nFaces - 1
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
@ -561,7 +561,7 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
meshMod.addFace
|
meshMod.addFace
|
||||||
(
|
(
|
||||||
frontFace,
|
frontFace,
|
||||||
cellI + offset, // own
|
celli + offset, // own
|
||||||
-1, // nei
|
-1, // nei
|
||||||
-1, // masterPointID
|
-1, // masterPointID
|
||||||
-1, // masterEdgeID
|
-1, // masterEdgeID
|
||||||
@ -575,7 +575,7 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< frontFace << " "
|
Info<< frontFace << " "
|
||||||
<< cellI + offset << " "
|
<< celli + offset << " "
|
||||||
<< nFaces - 1
|
<< nFaces - 1
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -103,9 +103,9 @@ Foam::labelList Foam::patchToPoly2DMesh::internalFaceOrder()
|
|||||||
|
|
||||||
label newFaceI = 0;
|
label newFaceI = 0;
|
||||||
|
|
||||||
forAll(faceEdges, faceI)
|
forAll(faceEdges, facei)
|
||||||
{
|
{
|
||||||
const labelList& fEdges = faceEdges[faceI];
|
const labelList& fEdges = faceEdges[facei];
|
||||||
// Neighbouring faces
|
// Neighbouring faces
|
||||||
SortableList<label> nbr(fEdges.size(), -1);
|
SortableList<label> nbr(fEdges.size(), -1);
|
||||||
|
|
||||||
@ -117,14 +117,14 @@ Foam::labelList Foam::patchToPoly2DMesh::internalFaceOrder()
|
|||||||
|
|
||||||
label nbrFaceI = neighbour_[fEdges[feI]];
|
label nbrFaceI = neighbour_[fEdges[feI]];
|
||||||
|
|
||||||
if (nbrFaceI == faceI)
|
if (nbrFaceI == facei)
|
||||||
{
|
{
|
||||||
nbrFaceI = owner_[fEdges[feI]];
|
nbrFaceI = owner_[fEdges[feI]];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (faceI < nbrFaceI)
|
if (facei < nbrFaceI)
|
||||||
{
|
{
|
||||||
// faceI is master
|
// facei is master
|
||||||
nbr[feI] = nbrFaceI;
|
nbr[feI] = nbrFaceI;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -109,16 +109,16 @@ void Foam::DelaunayMesh<Triangulation>::addPatches
|
|||||||
faces.setSize(nInternalFaces + nBoundaryFaces);
|
faces.setSize(nInternalFaces + nBoundaryFaces);
|
||||||
owner.setSize(nInternalFaces + nBoundaryFaces);
|
owner.setSize(nInternalFaces + nBoundaryFaces);
|
||||||
|
|
||||||
label faceI = nInternalFaces;
|
label facei = nInternalFaces;
|
||||||
|
|
||||||
forAll(patchFaces, p)
|
forAll(patchFaces, p)
|
||||||
{
|
{
|
||||||
forAll(patchFaces[p], f)
|
forAll(patchFaces[p], f)
|
||||||
{
|
{
|
||||||
faces[faceI] = patchFaces[p][f];
|
faces[facei] = patchFaces[p][f];
|
||||||
owner[faceI] = patchOwners[p][f];
|
owner[facei] = patchOwners[p][f];
|
||||||
|
|
||||||
faceI++;
|
facei++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -429,7 +429,7 @@ Foam::DelaunayMesh<Triangulation>::createMesh
|
|||||||
|
|
||||||
|
|
||||||
// Index the cells
|
// Index the cells
|
||||||
label cellI = 0;
|
label celli = 0;
|
||||||
|
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
@ -445,11 +445,11 @@ Foam::DelaunayMesh<Triangulation>::createMesh
|
|||||||
&& cit->real()
|
&& cit->real()
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
cellMap[cit->cellIndex()] = cellI++;
|
cellMap[cit->cellIndex()] = celli++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
label faceI = 0;
|
label facei = 0;
|
||||||
labelList verticesOnTriFace(3, label(-1));
|
labelList verticesOnTriFace(3, label(-1));
|
||||||
face newFace(verticesOnTriFace);
|
face newFace(verticesOnTriFace);
|
||||||
|
|
||||||
@ -566,16 +566,16 @@ Foam::DelaunayMesh<Triangulation>::createMesh
|
|||||||
neighbourCell = c1I;
|
neighbourCell = c1I;
|
||||||
}
|
}
|
||||||
|
|
||||||
faces[faceI] = newFace;
|
faces[facei] = newFace;
|
||||||
owner[faceI] = ownerCell;
|
owner[facei] = ownerCell;
|
||||||
neighbour[faceI] = neighbourCell;
|
neighbour[facei] = neighbourCell;
|
||||||
faceI++;
|
facei++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
faces.setSize(faceI);
|
faces.setSize(facei);
|
||||||
owner.setSize(faceI);
|
owner.setSize(facei);
|
||||||
neighbour.setSize(faceI);
|
neighbour.setSize(facei);
|
||||||
|
|
||||||
sortFaces(faces, owner, neighbour);
|
sortFaces(faces, owner, neighbour);
|
||||||
|
|
||||||
@ -583,7 +583,7 @@ Foam::DelaunayMesh<Triangulation>::createMesh
|
|||||||
|
|
||||||
addPatches
|
addPatches
|
||||||
(
|
(
|
||||||
faceI,
|
facei,
|
||||||
faces,
|
faces,
|
||||||
owner,
|
owner,
|
||||||
patchDicts,
|
patchDicts,
|
||||||
|
|||||||
@ -164,13 +164,13 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
|
|||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
// Determine/update the status of each cell
|
// Determine/update the status of each cell
|
||||||
forAll(volumeStatus, cellI)
|
forAll(volumeStatus, celli)
|
||||||
{
|
{
|
||||||
if (volumeStatus[cellI] == volumeType::UNKNOWN)
|
if (volumeStatus[celli] == volumeType::UNKNOWN)
|
||||||
{
|
{
|
||||||
treeBoundBox cellBb
|
treeBoundBox cellBb
|
||||||
(
|
(
|
||||||
mesh_.cells()[cellI].points
|
mesh_.cells()[celli].points
|
||||||
(
|
(
|
||||||
mesh_.faces(),
|
mesh_.faces(),
|
||||||
mesh_.points()
|
mesh_.points()
|
||||||
@ -179,15 +179,15 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
|
|||||||
|
|
||||||
if (geometry.overlaps(cellBb))
|
if (geometry.overlaps(cellBb))
|
||||||
{
|
{
|
||||||
volumeStatus[cellI] = volumeType::MIXED;
|
volumeStatus[celli] = volumeType::MIXED;
|
||||||
}
|
}
|
||||||
else if (geometry.inside(cellBb.midpoint()))
|
else if (geometry.inside(cellBb.midpoint()))
|
||||||
{
|
{
|
||||||
volumeStatus[cellI] = volumeType::INSIDE;
|
volumeStatus[celli] = volumeType::INSIDE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
volumeStatus[cellI] = volumeType::OUTSIDE;
|
volumeStatus[celli] = volumeType::OUTSIDE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -211,17 +211,17 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
|
|||||||
|
|
||||||
forAll(newCellsToRefine, nCTRI)
|
forAll(newCellsToRefine, nCTRI)
|
||||||
{
|
{
|
||||||
label cellI = newCellsToRefine[nCTRI];
|
label celli = newCellsToRefine[nCTRI];
|
||||||
|
|
||||||
if (volumeStatus[cellI] == volumeType::MIXED)
|
if (volumeStatus[celli] == volumeType::MIXED)
|
||||||
{
|
{
|
||||||
volumeStatus[cellI] = volumeType::UNKNOWN;
|
volumeStatus[celli] = volumeType::UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
icellWeights[cellI] = max
|
icellWeights[celli] = max
|
||||||
(
|
(
|
||||||
1.0,
|
1.0,
|
||||||
icellWeights[cellI]/8.0
|
icellWeights[celli]/8.0
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -283,13 +283,13 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Determine/update the status of each cell
|
// Determine/update the status of each cell
|
||||||
forAll(volumeStatus, cellI)
|
forAll(volumeStatus, celli)
|
||||||
{
|
{
|
||||||
if (volumeStatus[cellI] == volumeType::UNKNOWN)
|
if (volumeStatus[celli] == volumeType::UNKNOWN)
|
||||||
{
|
{
|
||||||
treeBoundBox cellBb
|
treeBoundBox cellBb
|
||||||
(
|
(
|
||||||
mesh_.cells()[cellI].points
|
mesh_.cells()[celli].points
|
||||||
(
|
(
|
||||||
mesh_.faces(),
|
mesh_.faces(),
|
||||||
mesh_.points()
|
mesh_.points()
|
||||||
@ -298,15 +298,15 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
|
|||||||
|
|
||||||
if (geometry.overlaps(cellBb))
|
if (geometry.overlaps(cellBb))
|
||||||
{
|
{
|
||||||
volumeStatus[cellI] = volumeType::MIXED;
|
volumeStatus[celli] = volumeType::MIXED;
|
||||||
}
|
}
|
||||||
else if (geometry.inside(cellBb.midpoint()))
|
else if (geometry.inside(cellBb.midpoint()))
|
||||||
{
|
{
|
||||||
volumeStatus[cellI] = volumeType::INSIDE;
|
volumeStatus[celli] = volumeType::INSIDE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
volumeStatus[cellI] = volumeType::OUTSIDE;
|
volumeStatus[celli] = volumeType::OUTSIDE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -318,11 +318,11 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
|
|||||||
{
|
{
|
||||||
DynamicList<label> cellsToRemove;
|
DynamicList<label> cellsToRemove;
|
||||||
|
|
||||||
forAll(volumeStatus, cellI)
|
forAll(volumeStatus, celli)
|
||||||
{
|
{
|
||||||
if (volumeStatus[cellI] == volumeType::OUTSIDE)
|
if (volumeStatus[celli] == volumeType::OUTSIDE)
|
||||||
{
|
{
|
||||||
cellsToRemove.append(cellI);
|
cellsToRemove.append(celli);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -503,7 +503,7 @@ void Foam::backgroundMeshDecomposition::printMeshData
|
|||||||
|
|
||||||
bool Foam::backgroundMeshDecomposition::refineCell
|
bool Foam::backgroundMeshDecomposition::refineCell
|
||||||
(
|
(
|
||||||
label cellI,
|
label celli,
|
||||||
volumeType volType,
|
volumeType volType,
|
||||||
scalar& weightEstimate
|
scalar& weightEstimate
|
||||||
) const
|
) const
|
||||||
@ -515,7 +515,7 @@ bool Foam::backgroundMeshDecomposition::refineCell
|
|||||||
|
|
||||||
treeBoundBox cellBb
|
treeBoundBox cellBb
|
||||||
(
|
(
|
||||||
mesh_.cells()[cellI].points
|
mesh_.cells()[celli].points
|
||||||
(
|
(
|
||||||
mesh_.faces(),
|
mesh_.faces(),
|
||||||
mesh_.points()
|
mesh_.points()
|
||||||
@ -637,29 +637,29 @@ Foam::labelList Foam::backgroundMeshDecomposition::selectRefinementCells
|
|||||||
labelHashSet cellsToRefine;
|
labelHashSet cellsToRefine;
|
||||||
|
|
||||||
// Determine/update the status of each cell
|
// Determine/update the status of each cell
|
||||||
forAll(volumeStatus, cellI)
|
forAll(volumeStatus, celli)
|
||||||
{
|
{
|
||||||
if (volumeStatus[cellI] == volumeType::MIXED)
|
if (volumeStatus[celli] == volumeType::MIXED)
|
||||||
{
|
{
|
||||||
if (meshCutter_.cellLevel()[cellI] < minLevels_)
|
if (meshCutter_.cellLevel()[celli] < minLevels_)
|
||||||
{
|
{
|
||||||
cellsToRefine.insert(cellI);
|
cellsToRefine.insert(celli);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (volumeStatus[cellI] != volumeType::OUTSIDE)
|
if (volumeStatus[celli] != volumeType::OUTSIDE)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
refineCell
|
refineCell
|
||||||
(
|
(
|
||||||
cellI,
|
celli,
|
||||||
volumeStatus[cellI],
|
volumeStatus[celli],
|
||||||
icellWeights[cellI]
|
icellWeights[celli]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
cellsToRefine.insert(cellI);
|
cellsToRefine.insert(celli);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -943,9 +943,9 @@ Foam::backgroundMeshDecomposition::distribute
|
|||||||
|
|
||||||
forAll(newCellsToRefine, nCTRI)
|
forAll(newCellsToRefine, nCTRI)
|
||||||
{
|
{
|
||||||
label cellI = newCellsToRefine[nCTRI];
|
label celli = newCellsToRefine[nCTRI];
|
||||||
|
|
||||||
icellWeights[cellI] /= 8.0;
|
icellWeights[celli] /= 8.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mesh changing engine.
|
// Mesh changing engine.
|
||||||
|
|||||||
@ -167,7 +167,7 @@ class backgroundMeshDecomposition
|
|||||||
// it
|
// it
|
||||||
bool refineCell
|
bool refineCell
|
||||||
(
|
(
|
||||||
label cellI,
|
label celli,
|
||||||
volumeType volType,
|
volumeType volType,
|
||||||
scalar& weightEstimate
|
scalar& weightEstimate
|
||||||
) const;
|
) const;
|
||||||
|
|||||||
@ -133,7 +133,7 @@ void Foam::conformalVoronoiMesh::calcTetMesh
|
|||||||
points.setSize(vertI);
|
points.setSize(vertI);
|
||||||
pointToDelaunayVertex.setSize(vertI);
|
pointToDelaunayVertex.setSize(vertI);
|
||||||
|
|
||||||
label cellI = 0;
|
label celli = 0;
|
||||||
|
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
@ -144,7 +144,7 @@ void Foam::conformalVoronoiMesh::calcTetMesh
|
|||||||
{
|
{
|
||||||
if (cit->internalOrBoundaryDualVertex())
|
if (cit->internalOrBoundaryDualVertex())
|
||||||
{
|
{
|
||||||
cit->cellIndex() = cellI++;
|
cit->cellIndex() = celli++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -170,7 +170,7 @@ void Foam::conformalVoronoiMesh::calcTetMesh
|
|||||||
|
|
||||||
neighbour.setSize(number_of_finite_facets());
|
neighbour.setSize(number_of_finite_facets());
|
||||||
|
|
||||||
label faceI = 0;
|
label facei = 0;
|
||||||
|
|
||||||
labelList verticesOnTriFace(3, label(-1));
|
labelList verticesOnTriFace(3, label(-1));
|
||||||
|
|
||||||
@ -262,14 +262,14 @@ void Foam::conformalVoronoiMesh::calcTetMesh
|
|||||||
neighbourCell = c1I;
|
neighbourCell = c1I;
|
||||||
}
|
}
|
||||||
|
|
||||||
faces[faceI] = newFace;
|
faces[facei] = newFace;
|
||||||
owner[faceI] = ownerCell;
|
owner[facei] = ownerCell;
|
||||||
neighbour[faceI] = neighbourCell;
|
neighbour[facei] = neighbourCell;
|
||||||
faceI++;
|
facei++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
label nInternalFaces = faceI;
|
label nInternalFaces = facei;
|
||||||
|
|
||||||
faces.setSize(nInternalFaces);
|
faces.setSize(nInternalFaces);
|
||||||
owner.setSize(nInternalFaces);
|
owner.setSize(nInternalFaces);
|
||||||
@ -910,11 +910,11 @@ void Foam::conformalVoronoiMesh::checkCellSizing()
|
|||||||
pointField cellsToResize(cellsToResizeMap.size());
|
pointField cellsToResize(cellsToResizeMap.size());
|
||||||
|
|
||||||
label count = 0;
|
label count = 0;
|
||||||
for (label cellI = 0; cellI < pMesh.nCells(); ++cellI)
|
for (label celli = 0; celli < pMesh.nCells(); ++celli)
|
||||||
{
|
{
|
||||||
if (cellsToResizeMap.found(cellI))
|
if (cellsToResizeMap.found(celli))
|
||||||
{
|
{
|
||||||
cellsToResize[count++] = pMesh.cellCentres()[cellI];
|
cellsToResize[count++] = pMesh.cellCentres()[celli];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1152,9 +1152,9 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::checkPolyMeshQuality
|
|||||||
|
|
||||||
// forAllConstIter(labelHashSet, limitCells, iter)
|
// forAllConstIter(labelHashSet, limitCells, iter)
|
||||||
// {
|
// {
|
||||||
// label cellI = iter.key();
|
// label celli = iter.key();
|
||||||
|
|
||||||
// const labelList& cP = cellPts[cellI];
|
// const labelList& cP = cellPts[celli];
|
||||||
|
|
||||||
// forAll(cP, cPI)
|
// forAll(cP, cPI)
|
||||||
// {
|
// {
|
||||||
@ -2527,17 +2527,17 @@ void Foam::conformalVoronoiMesh::addPatches
|
|||||||
owner.setSize(nInternalFaces + nBoundaryFaces);
|
owner.setSize(nInternalFaces + nBoundaryFaces);
|
||||||
boundaryFacesToRemove.setSize(nInternalFaces + nBoundaryFaces);
|
boundaryFacesToRemove.setSize(nInternalFaces + nBoundaryFaces);
|
||||||
|
|
||||||
label faceI = nInternalFaces;
|
label facei = nInternalFaces;
|
||||||
|
|
||||||
forAll(patchFaces, p)
|
forAll(patchFaces, p)
|
||||||
{
|
{
|
||||||
forAll(patchFaces[p], f)
|
forAll(patchFaces[p], f)
|
||||||
{
|
{
|
||||||
faces[faceI] = patchFaces[p][f];
|
faces[facei] = patchFaces[p][f];
|
||||||
owner[faceI] = patchOwners[p][f];
|
owner[facei] = patchOwners[p][f];
|
||||||
boundaryFacesToRemove[faceI] = indirectPatchFace[p][f];
|
boundaryFacesToRemove[facei] = indirectPatchFace[p][f];
|
||||||
|
|
||||||
faceI++;
|
facei++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2623,7 +2623,7 @@ Foam::labelList Foam::conformalVoronoiMesh::removeUnusedCells
|
|||||||
cellUsed[neighbour[nI]] = true;
|
cellUsed[neighbour[nI]] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
label cellI = 0;
|
label celli = 0;
|
||||||
|
|
||||||
labelList oldToNew(cellUsed.size(), label(-1));
|
labelList oldToNew(cellUsed.size(), label(-1));
|
||||||
|
|
||||||
@ -2634,11 +2634,11 @@ Foam::labelList Foam::conformalVoronoiMesh::removeUnusedCells
|
|||||||
{
|
{
|
||||||
if (cellUsed[cellUI] == true)
|
if (cellUsed[cellUI] == true)
|
||||||
{
|
{
|
||||||
oldToNew[cellUI] = cellI++;
|
oldToNew[cellUI] = celli++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
labelList newToOld(invert(cellI, oldToNew));
|
labelList newToOld(invert(celli, oldToNew));
|
||||||
|
|
||||||
// Find all of the unused cells, create a list of them, then
|
// Find all of the unused cells, create a list of them, then
|
||||||
// subtract one from each owner and neighbour entry for each of
|
// subtract one from each owner and neighbour entry for each of
|
||||||
|
|||||||
@ -132,30 +132,30 @@ Foam::label Foam::conformalVoronoiMesh::findVerticesNearBoundaries()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (label cellI = 0; cellI < 4; ++cellI)
|
for (label celli = 0; celli < 4; ++celli)
|
||||||
{
|
{
|
||||||
Vertex_handle v = c1->vertex(cellI);
|
Vertex_handle v = c1->vertex(celli);
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
!is_infinite(v)
|
!is_infinite(v)
|
||||||
&& v->internalPoint()
|
&& v->internalPoint()
|
||||||
&& fit->second != cellI
|
&& fit->second != celli
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
v->setNearBoundary();
|
v->setNearBoundary();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (label cellI = 0; cellI < 4; ++cellI)
|
for (label celli = 0; celli < 4; ++celli)
|
||||||
{
|
{
|
||||||
Vertex_handle v = c2->vertex(cellI);
|
Vertex_handle v = c2->vertex(celli);
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
!is_infinite(v)
|
!is_infinite(v)
|
||||||
&& v->internalPoint()
|
&& v->internalPoint()
|
||||||
&& fit->second != cellI
|
&& fit->second != celli
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
v->setNearBoundary();
|
v->setNearBoundary();
|
||||||
|
|||||||
@ -179,7 +179,7 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
|
|||||||
|
|
||||||
if (foamyHexMeshControls().writeTetDualMesh())
|
if (foamyHexMeshControls().writeTetDualMesh())
|
||||||
{
|
{
|
||||||
label cellI = 0;
|
label celli = 0;
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
Finite_cells_iterator cit = finite_cells_begin();
|
Finite_cells_iterator cit = finite_cells_begin();
|
||||||
@ -193,7 +193,7 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
|
|||||||
&& !is_infinite(cit)
|
&& !is_infinite(cit)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
cit->cellIndex() = cellI++;
|
cit->cellIndex() = celli++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,20 +213,20 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
|
|||||||
// // or patch face (negative index)
|
// // or patch face (negative index)
|
||||||
// labelList vertexToDualAddressing(number_of_vertices(), 0);
|
// labelList vertexToDualAddressing(number_of_vertices(), 0);
|
||||||
//
|
//
|
||||||
// forAll(cellToDelaunayVertex, cellI)
|
// forAll(cellToDelaunayVertex, celli)
|
||||||
// {
|
// {
|
||||||
// label vertI = cellToDelaunayVertex[cellI];
|
// label vertI = cellToDelaunayVertex[celli];
|
||||||
//
|
//
|
||||||
// if (vertexToDualAddressing[vertI] != 0)
|
// if (vertexToDualAddressing[vertI] != 0)
|
||||||
// {
|
// {
|
||||||
// FatalErrorInFunction
|
// FatalErrorInFunction
|
||||||
// << "Delaunay vertex " << vertI
|
// << "Delaunay vertex " << vertI
|
||||||
// << " from cell " << cellI
|
// << " from cell " << celli
|
||||||
// << " is already mapped to "
|
// << " is already mapped to "
|
||||||
// << vertexToDualAddressing[vertI]
|
// << vertexToDualAddressing[vertI]
|
||||||
// << exit(FatalError);
|
// << exit(FatalError);
|
||||||
// }
|
// }
|
||||||
// vertexToDualAddressing[vertI] = cellI+1;
|
// vertexToDualAddressing[vertI] = celli+1;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// forAll(patchToDelaunayVertex, patchi)
|
// forAll(patchToDelaunayVertex, patchi)
|
||||||
@ -356,15 +356,15 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
|
|||||||
//
|
//
|
||||||
// if (index > 0)
|
// if (index > 0)
|
||||||
// {
|
// {
|
||||||
// label cellI = index-1;
|
// label celli = index-1;
|
||||||
// dualPoints[pointI] = mesh.cellCentres()[cellI];
|
// dualPoints[pointI] = mesh.cellCentres()[celli];
|
||||||
// }
|
// }
|
||||||
// else if (index < 0)
|
// else if (index < 0)
|
||||||
// {
|
// {
|
||||||
// label faceI = -index-1;
|
// label facei = -index-1;
|
||||||
// if (faceI >= mesh.nInternalFaces())
|
// if (facei >= mesh.nInternalFaces())
|
||||||
// {
|
// {
|
||||||
// dualPoints[pointI] = mesh.faceCentres()[faceI];
|
// dualPoints[pointI] = mesh.faceCentres()[facei];
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@ -736,9 +736,9 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
|
|||||||
{
|
{
|
||||||
label nReorderedFaces = 0;
|
label nReorderedFaces = 0;
|
||||||
|
|
||||||
forAll(faceMap, faceI)
|
forAll(faceMap, facei)
|
||||||
{
|
{
|
||||||
if (faceMap[faceI] != -1)
|
if (faceMap[facei] != -1)
|
||||||
{
|
{
|
||||||
nReorderedFaces++;
|
nReorderedFaces++;
|
||||||
}
|
}
|
||||||
@ -752,11 +752,11 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
|
|||||||
// Rotate faces (rotation is already in new face indices).
|
// Rotate faces (rotation is already in new face indices).
|
||||||
label nRotated = 0;
|
label nRotated = 0;
|
||||||
|
|
||||||
forAll(rotation, faceI)
|
forAll(rotation, facei)
|
||||||
{
|
{
|
||||||
if (rotation[faceI] != 0)
|
if (rotation[facei] != 0)
|
||||||
{
|
{
|
||||||
faces[faceI] = rotateList(faces[faceI], rotation[faceI]);
|
faces[facei] = rotateList(faces[facei], rotation[facei]);
|
||||||
nRotated++;
|
nRotated++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -961,11 +961,11 @@ void Foam::conformalVoronoiMesh::writeMesh
|
|||||||
labelList addr(boundaryFacesToRemove.count());
|
labelList addr(boundaryFacesToRemove.count());
|
||||||
label count = 0;
|
label count = 0;
|
||||||
|
|
||||||
forAll(boundaryFacesToRemove, faceI)
|
forAll(boundaryFacesToRemove, facei)
|
||||||
{
|
{
|
||||||
if (boundaryFacesToRemove[faceI])
|
if (boundaryFacesToRemove[facei])
|
||||||
{
|
{
|
||||||
addr[count++] = faceI;
|
addr[count++] = facei;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -98,22 +98,22 @@ bool Foam::conformalVoronoiMesh::distributeBackground(const Triangulation& mesh)
|
|||||||
{
|
{
|
||||||
pointFromPoint v = topoint(vit->point());
|
pointFromPoint v = topoint(vit->point());
|
||||||
|
|
||||||
label cellI = cellSearch.findCell(v);
|
label celli = cellSearch.findCell(v);
|
||||||
|
|
||||||
if (cellI == -1)
|
if (celli == -1)
|
||||||
{
|
{
|
||||||
// Pout<< "findCell conformalVoronoiMesh::distribute "
|
// Pout<< "findCell conformalVoronoiMesh::distribute "
|
||||||
// << "findCell "
|
// << "findCell "
|
||||||
// << vit->type() << " "
|
// << vit->type() << " "
|
||||||
// << vit->index() << " "
|
// << vit->index() << " "
|
||||||
// << v << " "
|
// << v << " "
|
||||||
// << cellI
|
// << celli
|
||||||
// << " find nearest cellI ";
|
// << " find nearest celli ";
|
||||||
|
|
||||||
cellI = cellSearch.findNearestCell(v);
|
celli = cellSearch.findNearestCell(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
cellVertices[cellI]++;
|
cellVertices[celli]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -116,15 +116,15 @@ void Foam::conformalVoronoiMesh::findCellZoneInsideWalk
|
|||||||
boolList blockedFace(mesh.nFaces());
|
boolList blockedFace(mesh.nFaces());
|
||||||
selectSeparatedCoupledFaces(mesh, blockedFace);
|
selectSeparatedCoupledFaces(mesh, blockedFace);
|
||||||
|
|
||||||
forAll(faceToSurface, faceI)
|
forAll(faceToSurface, facei)
|
||||||
{
|
{
|
||||||
if (faceToSurface[faceI] == -1)
|
if (faceToSurface[facei] == -1)
|
||||||
{
|
{
|
||||||
blockedFace[faceI] = false;
|
blockedFace[facei] = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
blockedFace[faceI] = true;
|
blockedFace[facei] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// No need to sync since namedSurfaceIndex already is synced
|
// No need to sync since namedSurfaceIndex already is synced
|
||||||
@ -156,16 +156,16 @@ void Foam::conformalVoronoiMesh::findCellZoneInsideWalk
|
|||||||
// Find the region containing the insidePoint
|
// Find the region containing the insidePoint
|
||||||
label keepRegionI = -1;
|
label keepRegionI = -1;
|
||||||
|
|
||||||
label cellI = mesh.findCell(insidePoint);
|
label celli = mesh.findCell(insidePoint);
|
||||||
|
|
||||||
if (cellI != -1)
|
if (celli != -1)
|
||||||
{
|
{
|
||||||
keepRegionI = cellRegion[cellI];
|
keepRegionI = cellRegion[celli];
|
||||||
}
|
}
|
||||||
reduce(keepRegionI, maxOp<label>());
|
reduce(keepRegionI, maxOp<label>());
|
||||||
|
|
||||||
Info<< " For surface " << surfName
|
Info<< " For surface " << surfName
|
||||||
<< " found point " << insidePoint << " in cell " << cellI
|
<< " found point " << insidePoint << " in cell " << celli
|
||||||
<< " in global region " << keepRegionI
|
<< " in global region " << keepRegionI
|
||||||
<< " out of " << cellRegion.nRegions() << " regions." << endl;
|
<< " out of " << cellRegion.nRegions() << " regions." << endl;
|
||||||
|
|
||||||
@ -179,22 +179,22 @@ void Foam::conformalVoronoiMesh::findCellZoneInsideWalk
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set all cells with this region
|
// Set all cells with this region
|
||||||
forAll(cellRegion, cellI)
|
forAll(cellRegion, celli)
|
||||||
{
|
{
|
||||||
if (cellRegion[cellI] == keepRegionI)
|
if (cellRegion[celli] == keepRegionI)
|
||||||
{
|
{
|
||||||
if (cellToSurface[cellI] == -2)
|
if (cellToSurface[celli] == -2)
|
||||||
{
|
{
|
||||||
cellToSurface[cellI] = surfI;
|
cellToSurface[celli] = surfI;
|
||||||
}
|
}
|
||||||
else if (cellToSurface[cellI] != surfI)
|
else if (cellToSurface[celli] != surfI)
|
||||||
{
|
{
|
||||||
WarningInFunction
|
WarningInFunction
|
||||||
<< "Cell " << cellI
|
<< "Cell " << celli
|
||||||
<< " at " << mesh.cellCentres()[cellI]
|
<< " at " << mesh.cellCentres()[celli]
|
||||||
<< " is inside surface " << surfName
|
<< " is inside surface " << surfName
|
||||||
<< " but already marked as being in zone "
|
<< " but already marked as being in zone "
|
||||||
<< cellToSurface[cellI] << endl
|
<< cellToSurface[celli] << endl
|
||||||
<< "This can happen if your surfaces are not"
|
<< "This can happen if your surfaces are not"
|
||||||
<< " (sufficiently) closed."
|
<< " (sufficiently) closed."
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -343,65 +343,65 @@ void Foam::conformalVoronoiMesh::calcFaceZones
|
|||||||
|
|
||||||
syncTools::swapBoundaryFaceList(mesh, neiFaceOwner);
|
syncTools::swapBoundaryFaceList(mesh, neiFaceOwner);
|
||||||
|
|
||||||
forAll(faces, faceI)
|
forAll(faces, facei)
|
||||||
{
|
{
|
||||||
const label ownerSurfaceI = cellToSurface[faceOwner[faceI]];
|
const label ownerSurfacei = cellToSurface[faceOwner[facei]];
|
||||||
|
|
||||||
if (faceToSurface[faceI] >= 0)
|
if (faceToSurface[facei] >= 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mesh.isInternalFace(faceI))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
const label neiSurfaceI = cellToSurface[faceNeighbour[faceI]];
|
const label neiSurfacei = cellToSurface[faceNeighbour[facei]];
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
(ownerSurfaceI >= 0 || neiSurfaceI >= 0)
|
(ownerSurfacei >= 0 || neiSurfacei >= 0)
|
||||||
&& ownerSurfaceI != neiSurfaceI
|
&& ownerSurfacei != neiSurfacei
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
flipMap[faceI] =
|
flipMap[facei] =
|
||||||
(
|
(
|
||||||
ownerSurfaceI == max(ownerSurfaceI, neiSurfaceI)
|
ownerSurfacei == max(ownerSurfacei, neiSurfacei)
|
||||||
? false
|
? false
|
||||||
: true
|
: true
|
||||||
);
|
);
|
||||||
|
|
||||||
faceToSurface[faceI] = max(ownerSurfaceI, neiSurfaceI);
|
faceToSurface[facei] = max(ownerSurfacei, neiSurfacei);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
label patchID = mesh.boundaryMesh().whichPatch(faceI);
|
label patchID = mesh.boundaryMesh().whichPatch(facei);
|
||||||
|
|
||||||
if (mesh.boundaryMesh()[patchID].coupled())
|
if (mesh.boundaryMesh()[patchID].coupled())
|
||||||
{
|
{
|
||||||
const label neiSurfaceI =
|
const label neiSurfacei =
|
||||||
neiFaceOwner[faceI - mesh.nInternalFaces()];
|
neiFaceOwner[facei - mesh.nInternalFaces()];
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
(ownerSurfaceI >= 0 || neiSurfaceI >= 0)
|
(ownerSurfacei >= 0 || neiSurfacei >= 0)
|
||||||
&& ownerSurfaceI != neiSurfaceI
|
&& ownerSurfacei != neiSurfacei
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
flipMap[faceI] =
|
flipMap[facei] =
|
||||||
(
|
(
|
||||||
ownerSurfaceI == max(ownerSurfaceI, neiSurfaceI)
|
ownerSurfacei == max(ownerSurfacei, neiSurfacei)
|
||||||
? false
|
? false
|
||||||
: true
|
: true
|
||||||
);
|
);
|
||||||
|
|
||||||
faceToSurface[faceI] = max(ownerSurfaceI, neiSurfaceI);
|
faceToSurface[facei] = max(ownerSurfacei, neiSurfacei);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ownerSurfaceI >= 0)
|
if (ownerSurfacei >= 0)
|
||||||
{
|
{
|
||||||
faceToSurface[faceI] = ownerSurfaceI;
|
faceToSurface[facei] = ownerSurfacei;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -430,23 +430,23 @@ void Foam::conformalVoronoiMesh::calcFaceZones
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Use intersection of cellCentre connections
|
// Use intersection of cellCentre connections
|
||||||
forAll(faces, faceI)
|
forAll(faces, facei)
|
||||||
{
|
{
|
||||||
if (faceToSurface[faceI] >= 0)
|
if (faceToSurface[facei] >= 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
label patchID = mesh.boundaryMesh().whichPatch(faceI);
|
label patchID = mesh.boundaryMesh().whichPatch(facei);
|
||||||
|
|
||||||
const label own = faceOwner[faceI];
|
const label own = faceOwner[facei];
|
||||||
|
|
||||||
List<pointIndexHit> surfHit;
|
List<pointIndexHit> surfHit;
|
||||||
labelList hitSurface;
|
labelList hitSurface;
|
||||||
|
|
||||||
if (mesh.isInternalFace(faceI))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
const label nei = faceNeighbour[faceI];
|
const label nei = faceNeighbour[facei];
|
||||||
|
|
||||||
geometryToConformTo().findSurfaceAllIntersections
|
geometryToConformTo().findSurfaceAllIntersections
|
||||||
(
|
(
|
||||||
@ -461,7 +461,7 @@ void Foam::conformalVoronoiMesh::calcFaceZones
|
|||||||
geometryToConformTo().findSurfaceAllIntersections
|
geometryToConformTo().findSurfaceAllIntersections
|
||||||
(
|
(
|
||||||
cellCentres[own],
|
cellCentres[own],
|
||||||
neiCc[faceI - mesh.nInternalFaces()],
|
neiCc[facei - mesh.nInternalFaces()],
|
||||||
surfHit,
|
surfHit,
|
||||||
hitSurface
|
hitSurface
|
||||||
);
|
);
|
||||||
@ -481,19 +481,19 @@ void Foam::conformalVoronoiMesh::calcFaceZones
|
|||||||
norm
|
norm
|
||||||
);
|
);
|
||||||
|
|
||||||
vector fN = faces[faceI].normal(mesh.points());
|
vector fN = faces[facei].normal(mesh.points());
|
||||||
fN /= mag(fN) + SMALL;
|
fN /= mag(fN) + SMALL;
|
||||||
|
|
||||||
if ((norm[0] & fN) < 0)
|
if ((norm[0] & fN) < 0)
|
||||||
{
|
{
|
||||||
flipMap[faceI] = true;
|
flipMap[facei] = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
flipMap[faceI] = false;
|
flipMap[facei] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
faceToSurface[faceI] = hitSurface[0];
|
faceToSurface[facei] = hitSurface[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -509,9 +509,9 @@ void Foam::conformalVoronoiMesh::calcFaceZones
|
|||||||
// {
|
// {
|
||||||
// forAll(pp, i)
|
// forAll(pp, i)
|
||||||
// {
|
// {
|
||||||
// label faceI = pp.start()+i;
|
// label facei = pp.start()+i;
|
||||||
// label ownSurface = cellToSurface[faceOwner[faceI]];
|
// label ownSurface = cellToSurface[faceOwner[facei]];
|
||||||
// neiCellSurface[faceI - mesh.nInternalFaces()] = ownSurface;
|
// neiCellSurface[facei - mesh.nInternalFaces()] = ownSurface;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@ -525,15 +525,15 @@ void Foam::conformalVoronoiMesh::calcFaceZones
|
|||||||
// {
|
// {
|
||||||
// forAll(pp, i)
|
// forAll(pp, i)
|
||||||
// {
|
// {
|
||||||
// label faceI = pp.start()+i;
|
// label facei = pp.start()+i;
|
||||||
// label ownSurface = cellToSurface[faceOwner[faceI]];
|
// label ownSurface = cellToSurface[faceOwner[facei]];
|
||||||
// label neiSurface =
|
// label neiSurface =
|
||||||
// neiCellSurface[faceI-mesh.nInternalFaces()];
|
// neiCellSurface[facei-mesh.nInternalFaces()];
|
||||||
//
|
//
|
||||||
// if (faceToSurface[faceI] == -1 && (ownSurface != neiSurface))
|
// if (faceToSurface[facei] == -1 && (ownSurface != neiSurface))
|
||||||
// {
|
// {
|
||||||
// // Give face the max cell zone
|
// // Give face the max cell zone
|
||||||
// faceToSurface[faceI] = max(ownSurface, neiSurface);
|
// faceToSurface[facei] = max(ownSurface, neiSurface);
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@ -617,13 +617,13 @@ void Foam::conformalVoronoiMesh::addZones
|
|||||||
// Topochange container
|
// Topochange container
|
||||||
polyTopoChange meshMod(mesh);
|
polyTopoChange meshMod(mesh);
|
||||||
|
|
||||||
forAll(cellToSurface, cellI)
|
forAll(cellToSurface, celli)
|
||||||
{
|
{
|
||||||
label surfaceI = cellToSurface[cellI];
|
label surfacei = cellToSurface[celli];
|
||||||
|
|
||||||
if (surfaceI >= 0)
|
if (surfacei >= 0)
|
||||||
{
|
{
|
||||||
label zoneI = surfaceToCellZone[surfaceI];
|
label zoneI = surfaceToCellZone[surfacei];
|
||||||
|
|
||||||
if (zoneI >= 0)
|
if (zoneI >= 0)
|
||||||
{
|
{
|
||||||
@ -631,7 +631,7 @@ void Foam::conformalVoronoiMesh::addZones
|
|||||||
(
|
(
|
||||||
polyModifyCell
|
polyModifyCell
|
||||||
(
|
(
|
||||||
cellI,
|
celli,
|
||||||
false, // removeFromZone
|
false, // removeFromZone
|
||||||
zoneI
|
zoneI
|
||||||
)
|
)
|
||||||
@ -643,55 +643,55 @@ void Foam::conformalVoronoiMesh::addZones
|
|||||||
const labelList& faceOwner = mesh.faceOwner();
|
const labelList& faceOwner = mesh.faceOwner();
|
||||||
const labelList& faceNeighbour = mesh.faceNeighbour();
|
const labelList& faceNeighbour = mesh.faceNeighbour();
|
||||||
|
|
||||||
forAll(faceToSurface, faceI)
|
forAll(faceToSurface, facei)
|
||||||
{
|
{
|
||||||
label surfaceI = faceToSurface[faceI];
|
label surfacei = faceToSurface[facei];
|
||||||
|
|
||||||
if (surfaceI < 0)
|
if (surfacei < 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
label patchID = mesh.boundaryMesh().whichPatch(faceI);
|
label patchID = mesh.boundaryMesh().whichPatch(facei);
|
||||||
|
|
||||||
if (mesh.isInternalFace(faceI))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
label own = faceOwner[faceI];
|
label own = faceOwner[facei];
|
||||||
label nei = faceNeighbour[faceI];
|
label nei = faceNeighbour[facei];
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.setAction
|
||||||
(
|
(
|
||||||
polyModifyFace
|
polyModifyFace
|
||||||
(
|
(
|
||||||
mesh.faces()[faceI], // modified face
|
mesh.faces()[facei], // modified face
|
||||||
faceI, // label of face
|
facei, // label of face
|
||||||
own, // owner
|
own, // owner
|
||||||
nei, // neighbour
|
nei, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
-1, // patch for face
|
-1, // patch for face
|
||||||
false, // remove from zone
|
false, // remove from zone
|
||||||
surfaceToFaceZone[surfaceI], // zone for face
|
surfaceToFaceZone[surfacei], // zone for face
|
||||||
flipMap[faceI] // face flip in zone
|
flipMap[facei] // face flip in zone
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (patchID != -1 && mesh.boundaryMesh()[patchID].coupled())
|
else if (patchID != -1 && mesh.boundaryMesh()[patchID].coupled())
|
||||||
{
|
{
|
||||||
label own = faceOwner[faceI];
|
label own = faceOwner[facei];
|
||||||
|
|
||||||
meshMod.setAction
|
meshMod.setAction
|
||||||
(
|
(
|
||||||
polyModifyFace
|
polyModifyFace
|
||||||
(
|
(
|
||||||
mesh.faces()[faceI], // modified face
|
mesh.faces()[facei], // modified face
|
||||||
faceI, // label of face
|
facei, // label of face
|
||||||
own, // owner
|
own, // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchID, // patch for face
|
patchID, // patch for face
|
||||||
false, // remove from zone
|
false, // remove from zone
|
||||||
surfaceToFaceZone[surfaceI], // zone for face
|
surfaceToFaceZone[surfacei], // zone for face
|
||||||
flipMap[faceI] // face flip in zone
|
flipMap[facei] // face flip in zone
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -255,7 +255,7 @@ autoPtr<polyMesh> generateHexMesh
|
|||||||
cellShapeList cellShapes(nCells[0]*nCells[1]*nCells[2]);
|
cellShapeList cellShapes(nCells[0]*nCells[1]*nCells[2]);
|
||||||
|
|
||||||
labelList hexPoints(8);
|
labelList hexPoints(8);
|
||||||
label cellI = 0;
|
label celli = 0;
|
||||||
for (label i = 0; i < nCells[0]; i++)
|
for (label i = 0; i < nCells[0]; i++)
|
||||||
{
|
{
|
||||||
for (label j = 0; j < nCells[1]; j++)
|
for (label j = 0; j < nCells[1]; j++)
|
||||||
@ -270,7 +270,7 @@ autoPtr<polyMesh> generateHexMesh
|
|||||||
hexPoints[5] = vtxLabel(nCells, i+1, j, k+1);
|
hexPoints[5] = vtxLabel(nCells, i+1, j, k+1);
|
||||||
hexPoints[6] = vtxLabel(nCells, i+1, j+1, k+1);
|
hexPoints[6] = vtxLabel(nCells, i+1, j+1, k+1);
|
||||||
hexPoints[7] = vtxLabel(nCells, i, j+1, k+1);
|
hexPoints[7] = vtxLabel(nCells, i, j+1, k+1);
|
||||||
cellShapes[cellI++] = cellShape(hex, hexPoints);
|
cellShapes[celli++] = cellShape(hex, hexPoints);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -627,11 +627,11 @@ int main(int argc, char *argv[])
|
|||||||
scalarField distSqr(cellDistance.size());
|
scalarField distSqr(cellDistance.size());
|
||||||
|
|
||||||
const labelList& cellLevel = backgroundMesh.cellLevel();
|
const labelList& cellLevel = backgroundMesh.cellLevel();
|
||||||
forAll(cellLevel, cellI)
|
forAll(cellLevel, celli)
|
||||||
{
|
{
|
||||||
// The largest edge of the cell will always be less than the
|
// The largest edge of the cell will always be less than the
|
||||||
// span of the bounding box of the cell.
|
// span of the bounding box of the cell.
|
||||||
distSqr[cellI] = magSqr(cellSize)/pow(2, cellLevel[cellI]);
|
distSqr[celli] = magSqr(cellSize)/pow(2, cellLevel[celli]);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -682,12 +682,12 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
{
|
{
|
||||||
scalarField pointDistSqr(fvm.nPoints(), -sqr(GREAT));
|
scalarField pointDistSqr(fvm.nPoints(), -sqr(GREAT));
|
||||||
for (label faceI = 0; faceI < fvm.nInternalFaces(); faceI++)
|
for (label facei = 0; facei < fvm.nInternalFaces(); facei++)
|
||||||
{
|
{
|
||||||
label own = fvm.faceOwner()[faceI];
|
label own = fvm.faceOwner()[facei];
|
||||||
label ownDistSqr = distSqr[own];
|
label ownDistSqr = distSqr[own];
|
||||||
|
|
||||||
const face& f = fvm.faces()[faceI];
|
const face& f = fvm.faces()[facei];
|
||||||
forAll(f, fp)
|
forAll(f, fp)
|
||||||
{
|
{
|
||||||
pointDistSqr[f[fp]] = max(pointDistSqr[f[fp]], ownDistSqr);
|
pointDistSqr[f[fp]] = max(pointDistSqr[f[fp]], ownDistSqr);
|
||||||
|
|||||||
@ -243,9 +243,9 @@ Foam::shortEdgeFilter2D::filter()
|
|||||||
|
|
||||||
// List of number of vertices in a face.
|
// List of number of vertices in a face.
|
||||||
labelList newFaceVertexCount(faces.size(), -1);
|
labelList newFaceVertexCount(faces.size(), -1);
|
||||||
forAll(faces, faceI)
|
forAll(faces, facei)
|
||||||
{
|
{
|
||||||
newFaceVertexCount[faceI] = faces[faceI].size();
|
newFaceVertexCount[facei] = faces[facei].size();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the point is a boundary point. Flag if it is so that
|
// Check if the point is a boundary point. Flag if it is so that
|
||||||
@ -456,9 +456,9 @@ Foam::shortEdgeFilter2D::filter()
|
|||||||
label newFaceSize = 0;
|
label newFaceSize = 0;
|
||||||
|
|
||||||
// Now need to iterate over the faces and remove points. Global index.
|
// Now need to iterate over the faces and remove points. Global index.
|
||||||
forAll(faces, faceI)
|
forAll(faces, facei)
|
||||||
{
|
{
|
||||||
const face& f = faces[faceI];
|
const face& f = faces[facei];
|
||||||
|
|
||||||
newFace.clear();
|
newFace.clear();
|
||||||
newFace.setSize(f.size());
|
newFace.setSize(f.size());
|
||||||
@ -526,7 +526,7 @@ Foam::shortEdgeFilter2D::filter()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Only " << newFace.size() << " in face " << faceI
|
<< "Only " << newFace.size() << " in face " << facei
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -157,13 +157,13 @@ int main(int argc, char *argv[])
|
|||||||
// Assign all visited faces to current patch
|
// Assign all visited faces to current patch
|
||||||
label nVisited = 0;
|
label nVisited = 0;
|
||||||
|
|
||||||
forAll(visited, faceI)
|
forAll(visited, facei)
|
||||||
{
|
{
|
||||||
if (visited[faceI])
|
if (visited[facei])
|
||||||
{
|
{
|
||||||
nVisited++;
|
nVisited++;
|
||||||
|
|
||||||
patchIDs[faceI] = newPatchI;
|
patchIDs[facei] = newPatchI;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,11 +234,11 @@ int main(int argc, char *argv[])
|
|||||||
// have to do the geometric stuff.
|
// have to do the geometric stuff.
|
||||||
const labelList& meshFace = bMesh.meshFace();
|
const labelList& meshFace = bMesh.meshFace();
|
||||||
|
|
||||||
forAll(patchIDs, faceI)
|
forAll(patchIDs, facei)
|
||||||
{
|
{
|
||||||
label meshFaceI = meshFace[faceI];
|
label meshFaceI = meshFace[facei];
|
||||||
|
|
||||||
polyMeshRepatcher.changePatchID(meshFaceI, patchIDs[faceI]);
|
polyMeshRepatcher.changePatchID(meshFaceI, patchIDs[facei]);
|
||||||
}
|
}
|
||||||
|
|
||||||
polyMeshRepatcher.repatch();
|
polyMeshRepatcher.repatch();
|
||||||
|
|||||||
@ -156,9 +156,9 @@ bool Foam::checkWedges
|
|||||||
// Check all non-wedge faces
|
// Check all non-wedge faces
|
||||||
label nEdgesInError = 0;
|
label nEdgesInError = 0;
|
||||||
|
|
||||||
forAll(fcs, faceI)
|
forAll(fcs, facei)
|
||||||
{
|
{
|
||||||
const face& f = fcs[faceI];
|
const face& f = fcs[facei];
|
||||||
|
|
||||||
forAll(f, fp)
|
forAll(f, fp)
|
||||||
{
|
{
|
||||||
@ -200,7 +200,7 @@ bool Foam::checkWedges
|
|||||||
// Ok if purely in empty directions.
|
// Ok if purely in empty directions.
|
||||||
if (nNonEmptyDirs > 0)
|
if (nNonEmptyDirs > 0)
|
||||||
{
|
{
|
||||||
if (edgesInError.insert(edge(p0, p1), faceI))
|
if (edgesInError.insert(edge(p0, p1), facei))
|
||||||
{
|
{
|
||||||
nEdgesInError++;
|
nEdgesInError++;
|
||||||
}
|
}
|
||||||
@ -209,7 +209,7 @@ bool Foam::checkWedges
|
|||||||
else if (nEmptyDirs > 1)
|
else if (nEmptyDirs > 1)
|
||||||
{
|
{
|
||||||
// Always an error
|
// Always an error
|
||||||
if (edgesInError.insert(edge(p0, p1), faceI))
|
if (edgesInError.insert(edge(p0, p1), facei))
|
||||||
{
|
{
|
||||||
nEdgesInError++;
|
nEdgesInError++;
|
||||||
}
|
}
|
||||||
@ -274,9 +274,9 @@ namespace Foam
|
|||||||
// lists of size cpp to transform.
|
// lists of size cpp to transform.
|
||||||
|
|
||||||
List<pointField> newPts(pts.size());
|
List<pointField> newPts(pts.size());
|
||||||
forAll(pts, faceI)
|
forAll(pts, facei)
|
||||||
{
|
{
|
||||||
newPts[faceI].setSize(pts[faceI].size());
|
newPts[facei].setSize(pts[facei].size());
|
||||||
}
|
}
|
||||||
|
|
||||||
label index = 0;
|
label index = 0;
|
||||||
@ -286,12 +286,12 @@ namespace Foam
|
|||||||
|
|
||||||
// Extract for every face the i'th position
|
// Extract for every face the i'th position
|
||||||
pointField ptsAtIndex(pts.size(), Zero);
|
pointField ptsAtIndex(pts.size(), Zero);
|
||||||
forAll(cpp, faceI)
|
forAll(cpp, facei)
|
||||||
{
|
{
|
||||||
const pointField& facePts = pts[faceI];
|
const pointField& facePts = pts[facei];
|
||||||
if (facePts.size() > index)
|
if (facePts.size() > index)
|
||||||
{
|
{
|
||||||
ptsAtIndex[faceI] = facePts[index];
|
ptsAtIndex[facei] = facePts[index];
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -306,12 +306,12 @@ namespace Foam
|
|||||||
cpp.transformPosition(ptsAtIndex);
|
cpp.transformPosition(ptsAtIndex);
|
||||||
|
|
||||||
// Extract back from ptsAtIndex into newPts
|
// Extract back from ptsAtIndex into newPts
|
||||||
forAll(cpp, faceI)
|
forAll(cpp, facei)
|
||||||
{
|
{
|
||||||
pointField& facePts = newPts[faceI];
|
pointField& facePts = newPts[facei];
|
||||||
if (facePts.size() > index)
|
if (facePts.size() > index)
|
||||||
{
|
{
|
||||||
facePts[index] = ptsAtIndex[faceI];
|
facePts[index] = ptsAtIndex[facei];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -97,19 +97,19 @@ Foam::label Foam::checkTopology
|
|||||||
{
|
{
|
||||||
cellSet cells(mesh, "illegalCells", mesh.nCells()/100);
|
cellSet cells(mesh, "illegalCells", mesh.nCells()/100);
|
||||||
|
|
||||||
forAll(mesh.cells(), cellI)
|
forAll(mesh.cells(), celli)
|
||||||
{
|
{
|
||||||
const cell& cFaces = mesh.cells()[cellI];
|
const cell& cFaces = mesh.cells()[celli];
|
||||||
|
|
||||||
if (cFaces.size() <= 3)
|
if (cFaces.size() <= 3)
|
||||||
{
|
{
|
||||||
cells.insert(cellI);
|
cells.insert(celli);
|
||||||
}
|
}
|
||||||
forAll(cFaces, i)
|
forAll(cFaces, i)
|
||||||
{
|
{
|
||||||
if (cFaces[i] < 0 || cFaces[i] >= mesh.nFaces())
|
if (cFaces[i] < 0 || cFaces[i] >= mesh.nFaces())
|
||||||
{
|
{
|
||||||
cells.insert(cellI);
|
cells.insert(celli);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -223,10 +223,10 @@ Foam::label Foam::checkTopology
|
|||||||
{
|
{
|
||||||
labelList nInternalFaces(mesh.nCells(), 0);
|
labelList nInternalFaces(mesh.nCells(), 0);
|
||||||
|
|
||||||
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
|
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||||
{
|
{
|
||||||
nInternalFaces[mesh.faceOwner()[faceI]]++;
|
nInternalFaces[mesh.faceOwner()[facei]]++;
|
||||||
nInternalFaces[mesh.faceNeighbour()[faceI]]++;
|
nInternalFaces[mesh.faceNeighbour()[facei]]++;
|
||||||
}
|
}
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
forAll(patches, patchi)
|
forAll(patches, patchi)
|
||||||
@ -245,15 +245,15 @@ Foam::label Foam::checkTopology
|
|||||||
cellSet oneCells(mesh, "oneInternalFaceCells", mesh.nCells()/100);
|
cellSet oneCells(mesh, "oneInternalFaceCells", mesh.nCells()/100);
|
||||||
cellSet twoCells(mesh, "twoInternalFacesCells", mesh.nCells()/100);
|
cellSet twoCells(mesh, "twoInternalFacesCells", mesh.nCells()/100);
|
||||||
|
|
||||||
forAll(nInternalFaces, cellI)
|
forAll(nInternalFaces, celli)
|
||||||
{
|
{
|
||||||
if (nInternalFaces[cellI] <= 1)
|
if (nInternalFaces[celli] <= 1)
|
||||||
{
|
{
|
||||||
oneCells.insert(cellI);
|
oneCells.insert(celli);
|
||||||
}
|
}
|
||||||
else if (nInternalFaces[cellI] == 2)
|
else if (nInternalFaces[celli] == 2)
|
||||||
{
|
{
|
||||||
twoCells.insert(cellI);
|
twoCells.insert(celli);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -97,36 +97,36 @@ void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology)
|
|||||||
|
|
||||||
Map<label> polyhedralFaces;
|
Map<label> polyhedralFaces;
|
||||||
|
|
||||||
for (label cellI = 0; cellI < mesh.nCells(); cellI++)
|
for (label celli = 0; celli < mesh.nCells(); celli++)
|
||||||
{
|
{
|
||||||
if (hex.isA(mesh, cellI))
|
if (hex.isA(mesh, celli))
|
||||||
{
|
{
|
||||||
nHex++;
|
nHex++;
|
||||||
}
|
}
|
||||||
else if (tet.isA(mesh, cellI))
|
else if (tet.isA(mesh, celli))
|
||||||
{
|
{
|
||||||
nTet++;
|
nTet++;
|
||||||
}
|
}
|
||||||
else if (pyr.isA(mesh, cellI))
|
else if (pyr.isA(mesh, celli))
|
||||||
{
|
{
|
||||||
nPyr++;
|
nPyr++;
|
||||||
}
|
}
|
||||||
else if (prism.isA(mesh, cellI))
|
else if (prism.isA(mesh, celli))
|
||||||
{
|
{
|
||||||
nPrism++;
|
nPrism++;
|
||||||
}
|
}
|
||||||
else if (wedge.isA(mesh, cellI))
|
else if (wedge.isA(mesh, celli))
|
||||||
{
|
{
|
||||||
nWedge++;
|
nWedge++;
|
||||||
}
|
}
|
||||||
else if (tetWedge.isA(mesh, cellI))
|
else if (tetWedge.isA(mesh, celli))
|
||||||
{
|
{
|
||||||
nTetWedge++;
|
nTetWedge++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nUnknown++;
|
nUnknown++;
|
||||||
polyhedralFaces(mesh.cells()[cellI].size())++;
|
polyhedralFaces(mesh.cells()[celli].size())++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -110,7 +110,7 @@ void modifyOrAddFace
|
|||||||
(
|
(
|
||||||
polyTopoChange& meshMod,
|
polyTopoChange& meshMod,
|
||||||
const face& f,
|
const face& f,
|
||||||
const label faceI,
|
const label facei,
|
||||||
const label own,
|
const label own,
|
||||||
const bool flipFaceFlux,
|
const bool flipFaceFlux,
|
||||||
const label newPatchI,
|
const label newPatchI,
|
||||||
@ -120,7 +120,7 @@ void modifyOrAddFace
|
|||||||
PackedBoolList& modifiedFace
|
PackedBoolList& modifiedFace
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (!modifiedFace[faceI])
|
if (!modifiedFace[facei])
|
||||||
{
|
{
|
||||||
// First usage of face. Modify.
|
// First usage of face. Modify.
|
||||||
meshMod.setAction
|
meshMod.setAction
|
||||||
@ -128,7 +128,7 @@ void modifyOrAddFace
|
|||||||
polyModifyFace
|
polyModifyFace
|
||||||
(
|
(
|
||||||
f, // modified face
|
f, // modified face
|
||||||
faceI, // label of face
|
facei, // label of face
|
||||||
own, // owner
|
own, // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
flipFaceFlux, // face flip
|
flipFaceFlux, // face flip
|
||||||
@ -138,7 +138,7 @@ void modifyOrAddFace
|
|||||||
zoneFlip // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
modifiedFace[faceI] = 1;
|
modifiedFace[facei] = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -152,7 +152,7 @@ void modifyOrAddFace
|
|||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
-1, // master point
|
-1, // master point
|
||||||
-1, // master edge
|
-1, // master edge
|
||||||
faceI, // master face
|
facei, // master face
|
||||||
flipFaceFlux, // face flip
|
flipFaceFlux, // face flip
|
||||||
newPatchI, // patch for face
|
newPatchI, // patch for face
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
@ -184,9 +184,9 @@ void createFaces
|
|||||||
// Pass 1. Do selected side of zone
|
// Pass 1. Do selected side of zone
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
|
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||||
{
|
{
|
||||||
label zoneFaceI = fZone.whichFace(faceI);
|
label zoneFaceI = fZone.whichFace(facei);
|
||||||
|
|
||||||
if (zoneFaceI != -1)
|
if (zoneFaceI != -1)
|
||||||
{
|
{
|
||||||
@ -196,9 +196,9 @@ void createFaces
|
|||||||
modifyOrAddFace
|
modifyOrAddFace
|
||||||
(
|
(
|
||||||
meshMod,
|
meshMod,
|
||||||
mesh.faces()[faceI], // modified face
|
mesh.faces()[facei], // modified face
|
||||||
faceI, // label of face
|
facei, // label of face
|
||||||
mesh.faceOwner()[faceI],// owner
|
mesh.faceOwner()[facei],// owner
|
||||||
false, // face flip
|
false, // face flip
|
||||||
newMasterPatches[i], // patch for face
|
newMasterPatches[i], // patch for face
|
||||||
fZone.index(), // zone for face
|
fZone.index(), // zone for face
|
||||||
@ -215,9 +215,9 @@ void createFaces
|
|||||||
modifyOrAddFace
|
modifyOrAddFace
|
||||||
(
|
(
|
||||||
meshMod,
|
meshMod,
|
||||||
mesh.faces()[faceI].reverseFace(), // modified face
|
mesh.faces()[facei].reverseFace(), // modified face
|
||||||
faceI, // label of face
|
facei, // label of face
|
||||||
mesh.faceNeighbour()[faceI],// owner
|
mesh.faceNeighbour()[facei],// owner
|
||||||
true, // face flip
|
true, // face flip
|
||||||
newMasterPatches[i], // patch for face
|
newMasterPatches[i], // patch for face
|
||||||
fZone.index(), // zone for face
|
fZone.index(), // zone for face
|
||||||
@ -234,9 +234,9 @@ void createFaces
|
|||||||
// Pass 2. Do other side of zone
|
// Pass 2. Do other side of zone
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
|
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||||
{
|
{
|
||||||
label zoneFaceI = fZone.whichFace(faceI);
|
label zoneFaceI = fZone.whichFace(facei);
|
||||||
|
|
||||||
if (zoneFaceI != -1)
|
if (zoneFaceI != -1)
|
||||||
{
|
{
|
||||||
@ -246,9 +246,9 @@ void createFaces
|
|||||||
modifyOrAddFace
|
modifyOrAddFace
|
||||||
(
|
(
|
||||||
meshMod,
|
meshMod,
|
||||||
mesh.faces()[faceI].reverseFace(), // modified face
|
mesh.faces()[facei].reverseFace(), // modified face
|
||||||
faceI, // label of face
|
facei, // label of face
|
||||||
mesh.faceNeighbour()[faceI], // owner
|
mesh.faceNeighbour()[facei], // owner
|
||||||
true, // face flip
|
true, // face flip
|
||||||
newSlavePatches[i], // patch for face
|
newSlavePatches[i], // patch for face
|
||||||
fZone.index(), // zone for face
|
fZone.index(), // zone for face
|
||||||
@ -262,9 +262,9 @@ void createFaces
|
|||||||
modifyOrAddFace
|
modifyOrAddFace
|
||||||
(
|
(
|
||||||
meshMod,
|
meshMod,
|
||||||
mesh.faces()[faceI], // modified face
|
mesh.faces()[facei], // modified face
|
||||||
faceI, // label of face
|
facei, // label of face
|
||||||
mesh.faceOwner()[faceI],// owner
|
mesh.faceOwner()[facei],// owner
|
||||||
false, // face flip
|
false, // face flip
|
||||||
newSlavePatches[i], // patch for face
|
newSlavePatches[i], // patch for face
|
||||||
fZone.index(), // zone for face
|
fZone.index(), // zone for face
|
||||||
@ -305,9 +305,9 @@ void createFaces
|
|||||||
{
|
{
|
||||||
forAll(pp, i)
|
forAll(pp, i)
|
||||||
{
|
{
|
||||||
label faceI = pp.start()+i;
|
label facei = pp.start()+i;
|
||||||
|
|
||||||
label zoneFaceI = fZone.whichFace(faceI);
|
label zoneFaceI = fZone.whichFace(facei);
|
||||||
|
|
||||||
if (zoneFaceI != -1)
|
if (zoneFaceI != -1)
|
||||||
{
|
{
|
||||||
@ -328,9 +328,9 @@ void createFaces
|
|||||||
modifyOrAddFace
|
modifyOrAddFace
|
||||||
(
|
(
|
||||||
meshMod,
|
meshMod,
|
||||||
mesh.faces()[faceI], // modified face
|
mesh.faces()[facei], // modified face
|
||||||
faceI, // label of face
|
facei, // label of face
|
||||||
mesh.faceOwner()[faceI], // owner
|
mesh.faceOwner()[facei], // owner
|
||||||
false, // face flip
|
false, // face flip
|
||||||
newPatchI, // patch for face
|
newPatchI, // patch for face
|
||||||
fZone.index(), // zone for face
|
fZone.index(), // zone for face
|
||||||
@ -494,9 +494,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Add faces to faceZones
|
// Add faces to faceZones
|
||||||
labelList nFaces(mesh.faceZones().size(), 0);
|
labelList nFaces(mesh.faceZones().size(), 0);
|
||||||
forAll(faceToZoneID, faceI)
|
forAll(faceToZoneID, facei)
|
||||||
{
|
{
|
||||||
label zoneID = faceToZoneID[faceI];
|
label zoneID = faceToZoneID[facei];
|
||||||
if (zoneID != -1)
|
if (zoneID != -1)
|
||||||
{
|
{
|
||||||
nFaces[zoneID]++;
|
nFaces[zoneID]++;
|
||||||
@ -512,13 +512,13 @@ int main(int argc, char *argv[])
|
|||||||
labelList addr(n);
|
labelList addr(n);
|
||||||
boolList flip(n);
|
boolList flip(n);
|
||||||
n = 0;
|
n = 0;
|
||||||
forAll(faceToZoneID, faceI)
|
forAll(faceToZoneID, facei)
|
||||||
{
|
{
|
||||||
label zone = faceToZoneID[faceI];
|
label zone = faceToZoneID[facei];
|
||||||
if (zone == zoneID)
|
if (zone == zoneID)
|
||||||
{
|
{
|
||||||
addr[n] = faceI;
|
addr[n] = facei;
|
||||||
flip[n] = faceToFlip[faceI];
|
flip[n] = faceToFlip[facei];
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -94,11 +94,11 @@ void Foam::faceSelection::select
|
|||||||
{
|
{
|
||||||
if (flip_)
|
if (flip_)
|
||||||
{
|
{
|
||||||
forAll(faceToZoneID, faceI)
|
forAll(faceToZoneID, facei)
|
||||||
{
|
{
|
||||||
if (faceToZoneID[faceI] == zoneID)
|
if (faceToZoneID[facei] == zoneID)
|
||||||
{
|
{
|
||||||
faceToFlip[faceI] = !faceToFlip[faceI];
|
faceToFlip[facei] = !faceToFlip[facei];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -81,18 +81,18 @@ void Foam::faceSelections::faceZoneSelection::select
|
|||||||
|
|
||||||
forAll(fZone, i)
|
forAll(fZone, i)
|
||||||
{
|
{
|
||||||
label faceI = fZone[i];
|
label facei = fZone[i];
|
||||||
|
|
||||||
if (faceToZoneID[faceI] == -1)
|
if (faceToZoneID[facei] == -1)
|
||||||
{
|
{
|
||||||
faceToZoneID[faceI] = zoneID;
|
faceToZoneID[facei] = zoneID;
|
||||||
faceToFlip[faceI] = fZone.flipMap()[i];
|
faceToFlip[facei] = fZone.flipMap()[i];
|
||||||
}
|
}
|
||||||
else if (faceToZoneID[faceI] != zoneID)
|
else if (faceToZoneID[facei] != zoneID)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Face " << faceI << " already in faceZone "
|
<< "Face " << facei << " already in faceZone "
|
||||||
<< faceToZoneID[faceI]
|
<< faceToZoneID[facei]
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -98,10 +98,10 @@ void Foam::faceSelections::searchableSurfaceSelection::select
|
|||||||
pointField end(mesh_.nFaces());
|
pointField end(mesh_.nFaces());
|
||||||
|
|
||||||
// Internal faces
|
// Internal faces
|
||||||
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
|
||||||
{
|
{
|
||||||
start[faceI] = mesh_.cellCentres()[mesh_.faceOwner()[faceI]];
|
start[facei] = mesh_.cellCentres()[mesh_.faceOwner()[facei]];
|
||||||
end[faceI] = mesh_.cellCentres()[mesh_.faceNeighbour()[faceI]];
|
end[facei] = mesh_.cellCentres()[mesh_.faceNeighbour()[facei]];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Boundary faces
|
// Boundary faces
|
||||||
@ -123,18 +123,18 @@ void Foam::faceSelections::searchableSurfaceSelection::select
|
|||||||
{
|
{
|
||||||
forAll(pp, i)
|
forAll(pp, i)
|
||||||
{
|
{
|
||||||
label faceI = pp.start()+i;
|
label facei = pp.start()+i;
|
||||||
start[faceI] = mesh_.cellCentres()[mesh_.faceOwner()[faceI]];
|
start[facei] = mesh_.cellCentres()[mesh_.faceOwner()[facei]];
|
||||||
end[faceI] = neighbourCellCentres[faceI-mesh_.nInternalFaces()];
|
end[facei] = neighbourCellCentres[facei-mesh_.nInternalFaces()];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
forAll(pp, i)
|
forAll(pp, i)
|
||||||
{
|
{
|
||||||
label faceI = pp.start()+i;
|
label facei = pp.start()+i;
|
||||||
start[faceI] = mesh_.cellCentres()[mesh_.faceOwner()[faceI]];
|
start[facei] = mesh_.cellCentres()[mesh_.faceOwner()[facei]];
|
||||||
end[faceI] = mesh_.faceCentres()[faceI];
|
end[facei] = mesh_.faceCentres()[facei];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -146,13 +146,13 @@ void Foam::faceSelections::searchableSurfaceSelection::select
|
|||||||
|
|
||||||
//- Note: do not select boundary faces.
|
//- Note: do not select boundary faces.
|
||||||
|
|
||||||
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
|
||||||
{
|
{
|
||||||
if (hits[faceI].hit())
|
if (hits[facei].hit())
|
||||||
{
|
{
|
||||||
faceToZoneID[faceI] = zoneID;
|
faceToZoneID[facei] = zoneID;
|
||||||
vector d = end[faceI]-start[faceI];
|
vector d = end[facei]-start[facei];
|
||||||
faceToFlip[faceI] = ((normals[faceI] & d) < 0);
|
faceToFlip[facei] = ((normals[facei] & d) < 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
forAll(pbm, patchi)
|
forAll(pbm, patchi)
|
||||||
@ -163,12 +163,12 @@ void Foam::faceSelections::searchableSurfaceSelection::select
|
|||||||
{
|
{
|
||||||
forAll(pp, i)
|
forAll(pp, i)
|
||||||
{
|
{
|
||||||
label faceI = pp.start()+i;
|
label facei = pp.start()+i;
|
||||||
if (hits[faceI].hit())
|
if (hits[facei].hit())
|
||||||
{
|
{
|
||||||
faceToZoneID[faceI] = zoneID;
|
faceToZoneID[facei] = zoneID;
|
||||||
vector d = end[faceI]-start[faceI];
|
vector d = end[facei]-start[facei];
|
||||||
faceToFlip[faceI] = ((normals[faceI] & d) < 0);
|
faceToFlip[facei] = ((normals[facei] & d) < 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -244,12 +244,12 @@ void dumpCyclicMatch(const fileName& prefix, const polyMesh& mesh)
|
|||||||
Pout<< "Dumping cyclic match as lines between face centres to "
|
Pout<< "Dumping cyclic match as lines between face centres to "
|
||||||
<< str.name() << endl;
|
<< str.name() << endl;
|
||||||
|
|
||||||
forAll(cycPatch, faceI)
|
forAll(cycPatch, facei)
|
||||||
{
|
{
|
||||||
const point& fc0 = mesh.faceCentres()[cycPatch.start()+faceI];
|
const point& fc0 = mesh.faceCentres()[cycPatch.start()+facei];
|
||||||
meshTools::writeOBJ(str, fc0);
|
meshTools::writeOBJ(str, fc0);
|
||||||
vertI++;
|
vertI++;
|
||||||
const point& fc1 = mesh.faceCentres()[nbrPatch.start()+faceI];
|
const point& fc1 = mesh.faceCentres()[nbrPatch.start()+facei];
|
||||||
meshTools::writeOBJ(str, fc1);
|
meshTools::writeOBJ(str, fc1);
|
||||||
vertI++;
|
vertI++;
|
||||||
|
|
||||||
@ -716,12 +716,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAll(patchFaces, i)
|
forAll(patchFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = patchFaces[i];
|
label facei = patchFaces[i];
|
||||||
|
|
||||||
if (mesh.isInternalFace(faceI))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Face " << faceI << " specified in set "
|
<< "Face " << facei << " specified in set "
|
||||||
<< faces.name()
|
<< faces.name()
|
||||||
<< " is not an external face of the mesh." << endl
|
<< " is not an external face of the mesh." << endl
|
||||||
<< "This application can only repatch existing boundary"
|
<< "This application can only repatch existing boundary"
|
||||||
@ -731,7 +731,7 @@ int main(int argc, char *argv[])
|
|||||||
changePatchID
|
changePatchID
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
faceI,
|
facei,
|
||||||
destPatchI,
|
destPatchI,
|
||||||
meshMod
|
meshMod
|
||||||
);
|
);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -75,11 +75,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
boolList inside(querySurf.calcInside(mesh.cellCentres()));
|
boolList inside(querySurf.calcInside(mesh.cellCentres()));
|
||||||
|
|
||||||
forAll(inside, cellI)
|
forAll(inside, celli)
|
||||||
{
|
{
|
||||||
if (inside[cellI])
|
if (inside[celli])
|
||||||
{
|
{
|
||||||
insideCells.insert(cellI);
|
insideCells.insert(celli);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -244,10 +244,10 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
|||||||
cellZoneIndices[zoneI] = zoneIndex(cellZoneNames_, cz[zoneI].name());
|
cellZoneIndices[zoneI] = zoneIndex(cellZoneNames_, cz[zoneI].name());
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(c, cellI)
|
forAll(c, celli)
|
||||||
{
|
{
|
||||||
// Grab zone ID. If a cell is not in a zone, it will return -1
|
// Grab zone ID. If a cell is not in a zone, it will return -1
|
||||||
zoneID = cz.whichZone(cellI);
|
zoneID = cz.whichZone(celli);
|
||||||
|
|
||||||
if (zoneID >= 0)
|
if (zoneID >= 0)
|
||||||
{
|
{
|
||||||
@ -255,7 +255,7 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
|||||||
zoneID = cellZoneIndices[zoneID];
|
zoneID = cellZoneIndices[zoneID];
|
||||||
}
|
}
|
||||||
|
|
||||||
renumberCells[cellI] =
|
renumberCells[celli] =
|
||||||
meshMod_.setAction
|
meshMod_.setAction
|
||||||
(
|
(
|
||||||
polyAddCell
|
polyAddCell
|
||||||
@ -303,9 +303,9 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
|||||||
label newOwn, newNei, newPatch, newZone;
|
label newOwn, newNei, newPatch, newZone;
|
||||||
bool newZoneFlip;
|
bool newZoneFlip;
|
||||||
|
|
||||||
forAll(f, faceI)
|
forAll(f, facei)
|
||||||
{
|
{
|
||||||
const face& curFace = f[faceI];
|
const face& curFace = f[facei];
|
||||||
|
|
||||||
face newFace(curFace.size());
|
face newFace(curFace.size());
|
||||||
|
|
||||||
@ -320,22 +320,22 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
|||||||
if (min(newFace) < 0)
|
if (min(newFace) < 0)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Error in point mapping for face " << faceI
|
<< "Error in point mapping for face " << facei
|
||||||
<< ". Old face: " << curFace << " New face: " << newFace
|
<< ". Old face: " << curFace << " New face: " << newFace
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (faceI < m.nInternalFaces() || faceI >= m.nFaces())
|
if (facei < m.nInternalFaces() || facei >= m.nFaces())
|
||||||
{
|
{
|
||||||
newPatch = -1;
|
newPatch = -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
newPatch = patchIndices[bm.whichPatch(faceI)];
|
newPatch = patchIndices[bm.whichPatch(facei)];
|
||||||
}
|
}
|
||||||
|
|
||||||
newOwn = own[faceI];
|
newOwn = own[facei];
|
||||||
if (newOwn > -1) newOwn = renumberCells[newOwn];
|
if (newOwn > -1) newOwn = renumberCells[newOwn];
|
||||||
|
|
||||||
if (newPatch > -1)
|
if (newPatch > -1)
|
||||||
@ -344,23 +344,23 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
newNei = nei[faceI];
|
newNei = nei[facei];
|
||||||
newNei = renumberCells[newNei];
|
newNei = renumberCells[newNei];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
newZone = fz.whichZone(faceI);
|
newZone = fz.whichZone(facei);
|
||||||
newZoneFlip = false;
|
newZoneFlip = false;
|
||||||
|
|
||||||
if (newZone >= 0)
|
if (newZone >= 0)
|
||||||
{
|
{
|
||||||
newZoneFlip = fz[newZone].flipMap()[fz[newZone].whichFace(faceI)];
|
newZoneFlip = fz[newZone].flipMap()[fz[newZone].whichFace(facei)];
|
||||||
|
|
||||||
// Grab the new zone
|
// Grab the new zone
|
||||||
newZone = faceZoneIndices[newZone];
|
newZone = faceZoneIndices[newZone];
|
||||||
}
|
}
|
||||||
|
|
||||||
renumberFaces[faceI] =
|
renumberFaces[facei] =
|
||||||
meshMod_.setAction
|
meshMod_.setAction
|
||||||
(
|
(
|
||||||
polyAddFace
|
polyAddFace
|
||||||
|
|||||||
@ -170,16 +170,16 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
|
|||||||
{
|
{
|
||||||
if (duplicates[bFaceI] != -1)
|
if (duplicates[bFaceI] != -1)
|
||||||
{
|
{
|
||||||
label faceI = mesh.nInternalFaces() + bFaceI;
|
label facei = mesh.nInternalFaces() + bFaceI;
|
||||||
label patchi = patches.whichPatch(faceI);
|
label patchi = patches.whichPatch(facei);
|
||||||
|
|
||||||
if (isA<processorPolyPatch>(patches[patchi]))
|
if (isA<processorPolyPatch>(patches[patchi]))
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Duplicate face " << faceI
|
<< "Duplicate face " << facei
|
||||||
<< " is on a processorPolyPatch."
|
<< " is on a processorPolyPatch."
|
||||||
<< "This is not allowed." << nl
|
<< "This is not allowed." << nl
|
||||||
<< "Face:" << faceI
|
<< "Face:" << facei
|
||||||
<< " is on patch:" << patches[patchi].name()
|
<< " is on patch:" << patches[patchi].name()
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -130,12 +130,12 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
|||||||
|
|
||||||
const labelUList& oldOwnerStart = lduAddr().ownerStartAddr();
|
const labelUList& oldOwnerStart = lduAddr().ownerStartAddr();
|
||||||
|
|
||||||
forAll(newCellFaces, cellI)
|
forAll(newCellFaces, celli)
|
||||||
{
|
{
|
||||||
labelList& curFaces = newCellFaces[cellI];
|
labelList& curFaces = newCellFaces[celli];
|
||||||
|
|
||||||
const label s = oldOwnerStart[cellI];
|
const label s = oldOwnerStart[celli];
|
||||||
const label e = oldOwnerStart[cellI + 1];
|
const label e = oldOwnerStart[celli + 1];
|
||||||
|
|
||||||
curFaces.setSize(e - s);
|
curFaces.setSize(e - s);
|
||||||
|
|
||||||
@ -171,12 +171,12 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
|||||||
const labelUList& curFaceCells = curPatch.faceCells();
|
const labelUList& curFaceCells = curPatch.faceCells();
|
||||||
const label curStart = curPatch.start();
|
const label curStart = curPatch.start();
|
||||||
|
|
||||||
forAll(curPatch, faceI)
|
forAll(curPatch, facei)
|
||||||
{
|
{
|
||||||
// Find out if the mirrored face is identical to the
|
// Find out if the mirrored face is identical to the
|
||||||
// original. If so, the face needs to become internal and
|
// original. If so, the face needs to become internal and
|
||||||
// added to its owner cell
|
// added to its owner cell
|
||||||
const face& origFace = curPatch[faceI];
|
const face& origFace = curPatch[facei];
|
||||||
|
|
||||||
face mirrorFace(origFace.size());
|
face mirrorFace(origFace.size());
|
||||||
forAll(mirrorFace, pointI)
|
forAll(mirrorFace, pointI)
|
||||||
@ -188,12 +188,12 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
|||||||
{
|
{
|
||||||
// The mirror is identical to current face. This will
|
// The mirror is identical to current face. This will
|
||||||
// become an internal face
|
// become an internal face
|
||||||
const label oldSize = newCellFaces[curFaceCells[faceI]].size();
|
const label oldSize = newCellFaces[curFaceCells[facei]].size();
|
||||||
|
|
||||||
newCellFaces[curFaceCells[faceI]].setSize(oldSize + 1);
|
newCellFaces[curFaceCells[facei]].setSize(oldSize + 1);
|
||||||
newCellFaces[curFaceCells[faceI]][oldSize] = curStart + faceI;
|
newCellFaces[curFaceCells[facei]][oldSize] = curStart + facei;
|
||||||
|
|
||||||
curInsBouFace[faceI] = true;
|
curInsBouFace[facei] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -210,9 +210,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
|||||||
label nNewFaces = 0;
|
label nNewFaces = 0;
|
||||||
|
|
||||||
// Insert original (internal) faces
|
// Insert original (internal) faces
|
||||||
forAll(newCellFaces, cellI)
|
forAll(newCellFaces, celli)
|
||||||
{
|
{
|
||||||
const labelList& curCellFaces = newCellFaces[cellI];
|
const labelList& curCellFaces = newCellFaces[celli];
|
||||||
|
|
||||||
forAll(curCellFaces, cfI)
|
forAll(curCellFaces, cfI)
|
||||||
{
|
{
|
||||||
@ -224,9 +224,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Mirror internal faces
|
// Mirror internal faces
|
||||||
for (label faceI = 0; faceI < nOldInternalFaces; faceI++)
|
for (label facei = 0; facei < nOldInternalFaces; facei++)
|
||||||
{
|
{
|
||||||
const face& oldFace = oldFaces[faceI];
|
const face& oldFace = oldFaces[facei];
|
||||||
face& nf = newFaces[nNewFaces];
|
face& nf = newFaces[nNewFaces];
|
||||||
nf.setSize(oldFace.size());
|
nf.setSize(oldFace.size());
|
||||||
|
|
||||||
@ -237,7 +237,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
|||||||
nf[i] = mirrorPointLookup[oldFace[oldFace.size() - i]];
|
nf[i] = mirrorPointLookup[oldFace[oldFace.size() - i]];
|
||||||
}
|
}
|
||||||
|
|
||||||
mirrorFaceLookup[faceI] = nNewFaces;
|
mirrorFaceLookup[facei] = nNewFaces;
|
||||||
nNewFaces++;
|
nNewFaces++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -258,27 +258,27 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
|||||||
newPatchStarts[nNewPatches] = nNewFaces;
|
newPatchStarts[nNewPatches] = nNewFaces;
|
||||||
|
|
||||||
// Master side
|
// Master side
|
||||||
for (label faceI = 0; faceI < curPatchSize; faceI++)
|
for (label facei = 0; facei < curPatchSize; facei++)
|
||||||
{
|
{
|
||||||
// Check if the face has already been added. If not, add it and
|
// Check if the face has already been added. If not, add it and
|
||||||
// insert the numbering details.
|
// insert the numbering details.
|
||||||
if (!curInserted[faceI])
|
if (!curInserted[facei])
|
||||||
{
|
{
|
||||||
newFaces[nNewFaces] = oldFaces[curPatchStart + faceI];
|
newFaces[nNewFaces] = oldFaces[curPatchStart + facei];
|
||||||
|
|
||||||
masterFaceLookup[curPatchStart + faceI] = nNewFaces;
|
masterFaceLookup[curPatchStart + facei] = nNewFaces;
|
||||||
nNewFaces++;
|
nNewFaces++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mirror side
|
// Mirror side
|
||||||
for (label faceI = 0; faceI < curPatchSize; faceI++)
|
for (label facei = 0; facei < curPatchSize; facei++)
|
||||||
{
|
{
|
||||||
// Check if the face has already been added. If not, add it and
|
// Check if the face has already been added. If not, add it and
|
||||||
// insert the numbering details.
|
// insert the numbering details.
|
||||||
if (!curInserted[faceI])
|
if (!curInserted[facei])
|
||||||
{
|
{
|
||||||
const face& oldFace = oldFaces[curPatchStart + faceI];
|
const face& oldFace = oldFaces[curPatchStart + facei];
|
||||||
face& nf = newFaces[nNewFaces];
|
face& nf = newFaces[nNewFaces];
|
||||||
nf.setSize(oldFace.size());
|
nf.setSize(oldFace.size());
|
||||||
|
|
||||||
@ -289,14 +289,14 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
|||||||
nf[i] = mirrorPointLookup[oldFace[oldFace.size() - i]];
|
nf[i] = mirrorPointLookup[oldFace[oldFace.size() - i]];
|
||||||
}
|
}
|
||||||
|
|
||||||
mirrorFaceLookup[curPatchStart + faceI] = nNewFaces;
|
mirrorFaceLookup[curPatchStart + facei] = nNewFaces;
|
||||||
nNewFaces++;
|
nNewFaces++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Grab the index of the master face for the mirror side
|
// Grab the index of the master face for the mirror side
|
||||||
mirrorFaceLookup[curPatchStart + faceI] =
|
mirrorFaceLookup[curPatchStart + facei] =
|
||||||
masterFaceLookup[curPatchStart + faceI];
|
masterFaceLookup[curPatchStart + facei];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,9 +330,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
|||||||
label nNewCells = 0;
|
label nNewCells = 0;
|
||||||
|
|
||||||
// Grab the original cells. Take care of face renumbering.
|
// Grab the original cells. Take care of face renumbering.
|
||||||
forAll(oldCells, cellI)
|
forAll(oldCells, celli)
|
||||||
{
|
{
|
||||||
const cell& oc = oldCells[cellI];
|
const cell& oc = oldCells[celli];
|
||||||
|
|
||||||
cell& nc = newCells[nNewCells];
|
cell& nc = newCells[nNewCells];
|
||||||
nc.setSize(oc.size());
|
nc.setSize(oc.size());
|
||||||
@ -346,9 +346,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Mirror the cells
|
// Mirror the cells
|
||||||
forAll(oldCells, cellI)
|
forAll(oldCells, celli)
|
||||||
{
|
{
|
||||||
const cell& oc = oldCells[cellI];
|
const cell& oc = oldCells[celli];
|
||||||
|
|
||||||
cell& nc = newCells[nNewCells];
|
cell& nc = newCells[nNewCells];
|
||||||
nc.setSize(oc.size());
|
nc.setSize(oc.size());
|
||||||
|
|||||||
@ -99,9 +99,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
label nProtected = 0;
|
label nProtected = 0;
|
||||||
|
|
||||||
forAll(faceLabels, faceI)
|
forAll(faceLabels, facei)
|
||||||
{
|
{
|
||||||
const label meshFaceI = faceLabels[faceI];
|
const label meshFaceI = faceLabels[facei];
|
||||||
const label patchi = bm.whichPatch(meshFaceI);
|
const label patchi = bm.whichPatch(meshFaceI);
|
||||||
|
|
||||||
if
|
if
|
||||||
@ -112,7 +112,7 @@ int main(int argc, char *argv[])
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Slave side. Mark so doesn't get visited.
|
// Slave side. Mark so doesn't get visited.
|
||||||
allFaceInfo[faceI] = orientedSurface::NOFLIP;
|
allFaceInfo[facei] = orientedSurface::NOFLIP;
|
||||||
nProtected++;
|
nProtected++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -125,13 +125,13 @@ int main(int argc, char *argv[])
|
|||||||
// Number of (master)faces per edge
|
// Number of (master)faces per edge
|
||||||
labelList nMasterFaces(patch.nEdges(), 0);
|
labelList nMasterFaces(patch.nEdges(), 0);
|
||||||
|
|
||||||
forAll(faceLabels, faceI)
|
forAll(faceLabels, facei)
|
||||||
{
|
{
|
||||||
const label meshFaceI = faceLabels[faceI];
|
const label meshFaceI = faceLabels[facei];
|
||||||
|
|
||||||
if (isMasterFace[meshFaceI])
|
if (isMasterFace[meshFaceI])
|
||||||
{
|
{
|
||||||
const labelList& fEdges = patch.faceEdges()[faceI];
|
const labelList& fEdges = patch.faceEdges()[facei];
|
||||||
forAll(fEdges, fEdgeI)
|
forAll(fEdges, fEdgeI)
|
||||||
{
|
{
|
||||||
nMasterFaces[fEdges[fEdgeI]]++;
|
nMasterFaces[fEdges[fEdgeI]]++;
|
||||||
@ -184,11 +184,11 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
// Pick an unset face
|
// Pick an unset face
|
||||||
label unsetFaceI = labelMax;
|
label unsetFaceI = labelMax;
|
||||||
forAll(allFaceInfo, faceI)
|
forAll(allFaceInfo, facei)
|
||||||
{
|
{
|
||||||
if (allFaceInfo[faceI] == orientedSurface::UNVISITED)
|
if (allFaceInfo[facei] == orientedSurface::UNVISITED)
|
||||||
{
|
{
|
||||||
unsetFaceI = globalFaces.toGlobal(faceI);
|
unsetFaceI = globalFaces.toGlobal(facei);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -347,25 +347,25 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
boolList newFlipMap(allFaceInfo.size(), false);
|
boolList newFlipMap(allFaceInfo.size(), false);
|
||||||
label nChanged = 0;
|
label nChanged = 0;
|
||||||
forAll(allFaceInfo, faceI)
|
forAll(allFaceInfo, facei)
|
||||||
{
|
{
|
||||||
if (allFaceInfo[faceI] == orientedSurface::NOFLIP)
|
if (allFaceInfo[facei] == orientedSurface::NOFLIP)
|
||||||
{
|
{
|
||||||
newFlipMap[faceI] = false;
|
newFlipMap[facei] = false;
|
||||||
}
|
}
|
||||||
else if (allFaceInfo[faceI] == orientedSurface::FLIP)
|
else if (allFaceInfo[facei] == orientedSurface::FLIP)
|
||||||
{
|
{
|
||||||
newFlipMap[faceI] = true;
|
newFlipMap[facei] = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Problem : unvisited face " << faceI
|
<< "Problem : unvisited face " << facei
|
||||||
<< " centre:" << mesh.faceCentres()[faceLabels[faceI]]
|
<< " centre:" << mesh.faceCentres()[faceLabels[facei]]
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fZone.flipMap()[faceI] != newFlipMap[faceI])
|
if (fZone.flipMap()[facei] != newFlipMap[facei])
|
||||||
{
|
{
|
||||||
nChanged++;
|
nChanged++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -102,9 +102,9 @@ void Foam::meshDualiser::dumpPolyTopoChange
|
|||||||
|
|
||||||
const DynamicList<face>& faces = meshMod.faces();
|
const DynamicList<face>& faces = meshMod.faces();
|
||||||
|
|
||||||
forAll(faces, faceI)
|
forAll(faces, facei)
|
||||||
{
|
{
|
||||||
const face& f = faces[faceI];
|
const face& f = faces[facei];
|
||||||
|
|
||||||
str1<< 'f';
|
str1<< 'f';
|
||||||
forAll(f, fp)
|
forAll(f, fp)
|
||||||
@ -125,7 +125,7 @@ void Foam::meshDualiser::dumpPolyTopoChange
|
|||||||
|
|
||||||
Foam::label Foam::meshDualiser::findDualCell
|
Foam::label Foam::meshDualiser::findDualCell
|
||||||
(
|
(
|
||||||
const label cellI,
|
const label celli,
|
||||||
const label pointI
|
const label pointI
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
@ -137,7 +137,7 @@ Foam::label Foam::meshDualiser::findDualCell
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
label index = findIndex(mesh_.pointCells()[pointI], cellI);
|
label index = findIndex(mesh_.pointCells()[pointI], celli);
|
||||||
|
|
||||||
return dualCells[index];
|
return dualCells[index];
|
||||||
}
|
}
|
||||||
@ -177,19 +177,19 @@ void Foam::meshDualiser::generateDualBoundaryEdges
|
|||||||
// sides.
|
// sides.
|
||||||
bool Foam::meshDualiser::sameDualCell
|
bool Foam::meshDualiser::sameDualCell
|
||||||
(
|
(
|
||||||
const label faceI,
|
const label facei,
|
||||||
const label pointI
|
const label pointI
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if (!mesh_.isInternalFace(faceI))
|
if (!mesh_.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "face:" << faceI << " is not internal face."
|
<< "face:" << facei << " is not internal face."
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
label own = mesh_.faceOwner()[faceI];
|
label own = mesh_.faceOwner()[facei];
|
||||||
label nei = mesh_.faceNeighbour()[faceI];
|
label nei = mesh_.faceNeighbour()[facei];
|
||||||
|
|
||||||
return findDualCell(own, pointI) == findDualCell(nei, pointI);
|
return findDualCell(own, pointI) == findDualCell(nei, pointI);
|
||||||
}
|
}
|
||||||
@ -436,19 +436,19 @@ void Foam::meshDualiser::createFacesAroundEdge
|
|||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
label faceI = ie.faceLabel();
|
label facei = ie.faceLabel();
|
||||||
|
|
||||||
// Mark face as visited.
|
// Mark face as visited.
|
||||||
doneEFaces[findIndex(eFaces, faceI)] = true;
|
doneEFaces[findIndex(eFaces, facei)] = true;
|
||||||
|
|
||||||
if (faceToDualPoint_[faceI] != -1)
|
if (faceToDualPoint_[facei] != -1)
|
||||||
{
|
{
|
||||||
verts.append(faceToDualPoint_[faceI]);
|
verts.append(faceToDualPoint_[facei]);
|
||||||
}
|
}
|
||||||
|
|
||||||
label cellI = ie.cellLabel();
|
label celli = ie.cellLabel();
|
||||||
|
|
||||||
if (cellI == -1)
|
if (celli == -1)
|
||||||
{
|
{
|
||||||
// At ending boundary face. We've stored the face point above
|
// At ending boundary face. We've stored the face point above
|
||||||
// so this is the whole face.
|
// so this is the whole face.
|
||||||
@ -456,8 +456,8 @@ void Foam::meshDualiser::createFacesAroundEdge
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
label dualCell0 = findDualCell(cellI, e[0]);
|
label dualCell0 = findDualCell(celli, e[0]);
|
||||||
label dualCell1 = findDualCell(cellI, e[1]);
|
label dualCell1 = findDualCell(celli, e[1]);
|
||||||
|
|
||||||
// Generate face. (always if splitFace=true; only if needed to
|
// Generate face. (always if splitFace=true; only if needed to
|
||||||
// separate cells otherwise)
|
// separate cells otherwise)
|
||||||
@ -492,15 +492,15 @@ void Foam::meshDualiser::createFacesAroundEdge
|
|||||||
{
|
{
|
||||||
verts.append(edgeToDualPoint_[edgeI]);
|
verts.append(edgeToDualPoint_[edgeI]);
|
||||||
}
|
}
|
||||||
if (faceToDualPoint_[faceI] != -1)
|
if (faceToDualPoint_[facei] != -1)
|
||||||
{
|
{
|
||||||
verts.append(faceToDualPoint_[faceI]);
|
verts.append(faceToDualPoint_[facei]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cellToDualPoint_[cellI] != -1)
|
if (cellToDualPoint_[celli] != -1)
|
||||||
{
|
{
|
||||||
verts.append(cellToDualPoint_[cellI]);
|
verts.append(cellToDualPoint_[celli]);
|
||||||
}
|
}
|
||||||
|
|
||||||
++ie;
|
++ie;
|
||||||
@ -537,22 +537,22 @@ void Foam::meshDualiser::createFacesAroundEdge
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Walks around circumference of faceI. Creates single face. Gets given
|
// Walks around circumference of facei. Creates single face. Gets given
|
||||||
// starting (feature) edge to start from. Returns ending edge. (all edges
|
// starting (feature) edge to start from. Returns ending edge. (all edges
|
||||||
// in form of index in faceEdges)
|
// in form of index in faceEdges)
|
||||||
void Foam::meshDualiser::createFaceFromInternalFace
|
void Foam::meshDualiser::createFaceFromInternalFace
|
||||||
(
|
(
|
||||||
const label faceI,
|
const label facei,
|
||||||
label& fp,
|
label& fp,
|
||||||
polyTopoChange& meshMod
|
polyTopoChange& meshMod
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const face& f = mesh_.faces()[faceI];
|
const face& f = mesh_.faces()[facei];
|
||||||
const labelList& fEdges = mesh_.faceEdges()[faceI];
|
const labelList& fEdges = mesh_.faceEdges()[facei];
|
||||||
label own = mesh_.faceOwner()[faceI];
|
label own = mesh_.faceOwner()[facei];
|
||||||
label nei = mesh_.faceNeighbour()[faceI];
|
label nei = mesh_.faceNeighbour()[facei];
|
||||||
|
|
||||||
//Pout<< "createFaceFromInternalFace : At face:" << faceI
|
//Pout<< "createFaceFromInternalFace : At face:" << facei
|
||||||
// << " verts:" << f
|
// << " verts:" << f
|
||||||
// << " points:" << UIndirectList<point>(mesh_.points(), f)()
|
// << " points:" << UIndirectList<point>(mesh_.points(), f)()
|
||||||
// << " started walking at edge:" << fEdges[fp]
|
// << " started walking at edge:" << fEdges[fp]
|
||||||
@ -563,7 +563,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
|
|||||||
// Walk and collect face.
|
// Walk and collect face.
|
||||||
DynamicList<label> verts(100);
|
DynamicList<label> verts(100);
|
||||||
|
|
||||||
verts.append(faceToDualPoint_[faceI]);
|
verts.append(faceToDualPoint_[facei]);
|
||||||
verts.append(edgeToDualPoint_[fEdges[fp]]);
|
verts.append(edgeToDualPoint_[fEdges[fp]]);
|
||||||
|
|
||||||
// Step to vertex after edge mid
|
// Step to vertex after edge mid
|
||||||
@ -602,7 +602,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
|
|||||||
if (edgeToDualPoint_[edgeI] == -1)
|
if (edgeToDualPoint_[edgeI] == -1)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "face:" << faceI << " verts:" << f
|
<< "face:" << facei << " verts:" << f
|
||||||
<< " points:" << UIndirectList<point>(mesh_.points(), f)()
|
<< " points:" << UIndirectList<point>(mesh_.points(), f)()
|
||||||
<< " no feature edge between " << f[fp]
|
<< " no feature edge between " << f[fp]
|
||||||
<< " and " << f[nextFp] << " although have different"
|
<< " and " << f[nextFp] << " although have different"
|
||||||
@ -621,7 +621,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
|
|||||||
(
|
(
|
||||||
-1, // masterPointI
|
-1, // masterPointI
|
||||||
-1, // masterEdgeI
|
-1, // masterEdgeI
|
||||||
faceI, // masterFaceI
|
facei, // masterFaceI
|
||||||
true, // edgeOrder,
|
true, // edgeOrder,
|
||||||
currentDualCell0,
|
currentDualCell0,
|
||||||
currentDualCell1,
|
currentDualCell1,
|
||||||
@ -660,13 +660,13 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
|||||||
// pointFaces.
|
// pointFaces.
|
||||||
|
|
||||||
// Starting face
|
// Starting face
|
||||||
label faceI = startFaceI;
|
label facei = startFaceI;
|
||||||
|
|
||||||
DynamicList<label> verts(4);
|
DynamicList<label> verts(4);
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
label index = findIndex(pFaces, faceI-pp.start());
|
label index = findIndex(pFaces, facei-pp.start());
|
||||||
|
|
||||||
// Has face been visited already?
|
// Has face been visited already?
|
||||||
if (donePFaces[index])
|
if (donePFaces[index])
|
||||||
@ -676,15 +676,15 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
|||||||
donePFaces[index] = true;
|
donePFaces[index] = true;
|
||||||
|
|
||||||
// Insert face centre
|
// Insert face centre
|
||||||
verts.append(faceToDualPoint_[faceI]);
|
verts.append(faceToDualPoint_[facei]);
|
||||||
|
|
||||||
label dualCellI = findDualCell(own[faceI], pointI);
|
label dualCellI = findDualCell(own[facei], pointI);
|
||||||
|
|
||||||
// Get the edge before the patchPointI
|
// Get the edge before the patchPointI
|
||||||
const face& f = mesh_.faces()[faceI];
|
const face& f = mesh_.faces()[facei];
|
||||||
label fp = findIndex(f, pointI);
|
label fp = findIndex(f, pointI);
|
||||||
label prevFp = f.rcIndex(fp);
|
label prevFp = f.rcIndex(fp);
|
||||||
label edgeI = mesh_.faceEdges()[faceI][prevFp];
|
label edgeI = mesh_.faceEdges()[facei][prevFp];
|
||||||
|
|
||||||
if (edgeToDualPoint_[edgeI] != -1)
|
if (edgeToDualPoint_[edgeI] != -1)
|
||||||
{
|
{
|
||||||
@ -695,7 +695,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
|||||||
edgeFaceCirculator circ
|
edgeFaceCirculator circ
|
||||||
(
|
(
|
||||||
mesh_,
|
mesh_,
|
||||||
faceI,
|
facei,
|
||||||
true, // ownerSide
|
true, // ownerSide
|
||||||
prevFp, // index of edge in face
|
prevFp, // index of edge in face
|
||||||
true // isBoundaryEdge
|
true // isBoundaryEdge
|
||||||
@ -708,20 +708,20 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
|||||||
while (mesh_.isInternalFace(circ.faceLabel()));
|
while (mesh_.isInternalFace(circ.faceLabel()));
|
||||||
|
|
||||||
// Step to next face
|
// Step to next face
|
||||||
faceI = circ.faceLabel();
|
facei = circ.faceLabel();
|
||||||
|
|
||||||
if (faceI < pp.start() || faceI >= pp.start()+pp.size())
|
if (facei < pp.start() || facei >= pp.start()+pp.size())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Walked from face on patch:" << patchi
|
<< "Walked from face on patch:" << patchi
|
||||||
<< " to face:" << faceI
|
<< " to face:" << facei
|
||||||
<< " fc:" << mesh_.faceCentres()[faceI]
|
<< " fc:" << mesh_.faceCentres()[facei]
|
||||||
<< " on patch:" << patches.whichPatch(faceI)
|
<< " on patch:" << patches.whichPatch(facei)
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if different cell.
|
// Check if different cell.
|
||||||
if (dualCellI != findDualCell(own[faceI], pointI))
|
if (dualCellI != findDualCell(own[facei], pointI))
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Different dual cells but no feature edge"
|
<< "Different dual cells but no feature edge"
|
||||||
@ -733,7 +733,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
|||||||
|
|
||||||
verts.shrink();
|
verts.shrink();
|
||||||
|
|
||||||
label dualCellI = findDualCell(own[faceI], pointI);
|
label dualCellI = findDualCell(own[facei], pointI);
|
||||||
|
|
||||||
//Bit dodgy: create dualface from the last face (instead of from
|
//Bit dodgy: create dualface from the last face (instead of from
|
||||||
// the central point). This will also use the original faceZone to
|
// the central point). This will also use the original faceZone to
|
||||||
@ -744,7 +744,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
|||||||
//pointI, // masterPointI
|
//pointI, // masterPointI
|
||||||
-1, // masterPointI
|
-1, // masterPointI
|
||||||
-1, // masterEdgeI
|
-1, // masterEdgeI
|
||||||
faceI, // masterFaceI
|
facei, // masterFaceI
|
||||||
dualCellI,
|
dualCellI,
|
||||||
patchi,
|
patchi,
|
||||||
verts,
|
verts,
|
||||||
@ -753,17 +753,17 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
label faceI = startFaceI;
|
label facei = startFaceI;
|
||||||
|
|
||||||
// Storage for face
|
// Storage for face
|
||||||
DynamicList<label> verts(mesh_.faces()[faceI].size());
|
DynamicList<label> verts(mesh_.faces()[facei].size());
|
||||||
|
|
||||||
// Starting point.
|
// Starting point.
|
||||||
verts.append(pointToDualPoint_[pointI]);
|
verts.append(pointToDualPoint_[pointI]);
|
||||||
|
|
||||||
// Find edge between pointI and next point on face.
|
// Find edge between pointI and next point on face.
|
||||||
const labelList& fEdges = mesh_.faceEdges()[faceI];
|
const labelList& fEdges = mesh_.faceEdges()[facei];
|
||||||
label nextEdgeI = fEdges[findIndex(mesh_.faces()[faceI], pointI)];
|
label nextEdgeI = fEdges[findIndex(mesh_.faces()[facei], pointI)];
|
||||||
if (edgeToDualPoint_[nextEdgeI] != -1)
|
if (edgeToDualPoint_[nextEdgeI] != -1)
|
||||||
{
|
{
|
||||||
verts.append(edgeToDualPoint_[nextEdgeI]);
|
verts.append(edgeToDualPoint_[nextEdgeI]);
|
||||||
@ -771,7 +771,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
label index = findIndex(pFaces, faceI-pp.start());
|
label index = findIndex(pFaces, facei-pp.start());
|
||||||
|
|
||||||
// Has face been visited already?
|
// Has face been visited already?
|
||||||
if (donePFaces[index])
|
if (donePFaces[index])
|
||||||
@ -781,11 +781,11 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
|||||||
donePFaces[index] = true;
|
donePFaces[index] = true;
|
||||||
|
|
||||||
// Face centre
|
// Face centre
|
||||||
verts.append(faceToDualPoint_[faceI]);
|
verts.append(faceToDualPoint_[facei]);
|
||||||
|
|
||||||
// Find edge before pointI on faceI
|
// Find edge before pointI on facei
|
||||||
const labelList& fEdges = mesh_.faceEdges()[faceI];
|
const labelList& fEdges = mesh_.faceEdges()[facei];
|
||||||
const face& f = mesh_.faces()[faceI];
|
const face& f = mesh_.faces()[facei];
|
||||||
label prevFp = f.rcIndex(findIndex(f, pointI));
|
label prevFp = f.rcIndex(findIndex(f, pointI));
|
||||||
label edgeI = fEdges[prevFp];
|
label edgeI = fEdges[prevFp];
|
||||||
|
|
||||||
@ -798,8 +798,8 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
|||||||
(
|
(
|
||||||
-1, // masterPointI
|
-1, // masterPointI
|
||||||
-1, // masterEdgeI
|
-1, // masterEdgeI
|
||||||
faceI, // masterFaceI
|
facei, // masterFaceI
|
||||||
findDualCell(own[faceI], pointI),
|
findDualCell(own[facei], pointI),
|
||||||
patchi,
|
patchi,
|
||||||
verts.shrink(),
|
verts.shrink(),
|
||||||
meshMod
|
meshMod
|
||||||
@ -814,7 +814,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
|||||||
edgeFaceCirculator circ
|
edgeFaceCirculator circ
|
||||||
(
|
(
|
||||||
mesh_,
|
mesh_,
|
||||||
faceI,
|
facei,
|
||||||
true, // ownerSide
|
true, // ownerSide
|
||||||
prevFp, // index of edge in face
|
prevFp, // index of edge in face
|
||||||
true // isBoundaryEdge
|
true // isBoundaryEdge
|
||||||
@ -827,13 +827,13 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
|||||||
while (mesh_.isInternalFace(circ.faceLabel()));
|
while (mesh_.isInternalFace(circ.faceLabel()));
|
||||||
|
|
||||||
// Step to next face. Quit if not on same patch.
|
// Step to next face. Quit if not on same patch.
|
||||||
faceI = circ.faceLabel();
|
facei = circ.faceLabel();
|
||||||
}
|
}
|
||||||
while
|
while
|
||||||
(
|
(
|
||||||
faceI != startFaceI
|
facei != startFaceI
|
||||||
&& faceI >= pp.start()
|
&& facei >= pp.start()
|
||||||
&& faceI < pp.start()+pp.size()
|
&& facei < pp.start()+pp.size()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (verts.size() > 2)
|
if (verts.size() > 2)
|
||||||
@ -844,7 +844,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
|||||||
-1, // masterPointI
|
-1, // masterPointI
|
||||||
-1, // masterEdgeI
|
-1, // masterEdgeI
|
||||||
startFaceI, // masterFaceI
|
startFaceI, // masterFaceI
|
||||||
findDualCell(own[faceI], pointI),
|
findDualCell(own[facei], pointI),
|
||||||
patchi,
|
patchi,
|
||||||
verts.shrink(),
|
verts.shrink(),
|
||||||
meshMod
|
meshMod
|
||||||
@ -887,9 +887,9 @@ void Foam::meshDualiser::setRefinement
|
|||||||
// (Note: in 1.4.2 we can use the built-in mesh point ordering
|
// (Note: in 1.4.2 we can use the built-in mesh point ordering
|
||||||
// facility instead)
|
// facility instead)
|
||||||
PackedBoolList isBoundaryEdge(mesh_.nEdges());
|
PackedBoolList isBoundaryEdge(mesh_.nEdges());
|
||||||
for (label faceI = mesh_.nInternalFaces(); faceI < mesh_.nFaces(); faceI++)
|
for (label facei = mesh_.nInternalFaces(); facei < mesh_.nFaces(); facei++)
|
||||||
{
|
{
|
||||||
const labelList& fEdges = mesh_.faceEdges()[faceI];
|
const labelList& fEdges = mesh_.faceEdges()[facei];
|
||||||
|
|
||||||
forAll(fEdges, i)
|
forAll(fEdges, i)
|
||||||
{
|
{
|
||||||
@ -912,15 +912,15 @@ void Foam::meshDualiser::setRefinement
|
|||||||
{
|
{
|
||||||
featureFaceSet[featureFaces[i]] = true;
|
featureFaceSet[featureFaces[i]] = true;
|
||||||
}
|
}
|
||||||
label faceI = findIndex(featureFaceSet, false);
|
label facei = findIndex(featureFaceSet, false);
|
||||||
|
|
||||||
if (faceI != -1)
|
if (facei != -1)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "In split-face-mode (splitFace=true) but not all faces"
|
<< "In split-face-mode (splitFace=true) but not all faces"
|
||||||
<< " marked as feature faces." << endl
|
<< " marked as feature faces." << endl
|
||||||
<< "First conflicting face:" << faceI
|
<< "First conflicting face:" << facei
|
||||||
<< " centre:" << mesh_.faceCentres()[faceI]
|
<< " centre:" << mesh_.faceCentres()[facei]
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -954,18 +954,18 @@ void Foam::meshDualiser::setRefinement
|
|||||||
}
|
}
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
label faceI = mesh_.nInternalFaces();
|
label facei = mesh_.nInternalFaces();
|
||||||
faceI < mesh_.nFaces();
|
facei < mesh_.nFaces();
|
||||||
faceI++
|
facei++
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (!featureFaceSet[faceI])
|
if (!featureFaceSet[facei])
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Not all boundary faces marked as feature faces."
|
<< "Not all boundary faces marked as feature faces."
|
||||||
<< endl
|
<< endl
|
||||||
<< "First conflicting face:" << faceI
|
<< "First conflicting face:" << facei
|
||||||
<< " centre:" << mesh_.faceCentres()[faceI]
|
<< " centre:" << mesh_.faceCentres()[facei]
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1116,12 +1116,12 @@ void Foam::meshDualiser::setRefinement
|
|||||||
// Dual points (from cell centres, feature faces, feature edges)
|
// Dual points (from cell centres, feature faces, feature edges)
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
forAll(cellToDualPoint_, cellI)
|
forAll(cellToDualPoint_, celli)
|
||||||
{
|
{
|
||||||
cellToDualPoint_[cellI] = meshMod.addPoint
|
cellToDualPoint_[celli] = meshMod.addPoint
|
||||||
(
|
(
|
||||||
cellCentres[cellI],
|
cellCentres[celli],
|
||||||
mesh_.faces()[mesh_.cells()[cellI][0]][0], // masterPoint
|
mesh_.faces()[mesh_.cells()[celli][0]][0], // masterPoint
|
||||||
-1, // zoneID
|
-1, // zoneID
|
||||||
true // inCell
|
true // inCell
|
||||||
);
|
);
|
||||||
@ -1131,12 +1131,12 @@ void Foam::meshDualiser::setRefinement
|
|||||||
|
|
||||||
forAll(featureFaces, i)
|
forAll(featureFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = featureFaces[i];
|
label facei = featureFaces[i];
|
||||||
|
|
||||||
faceToDualPoint_[faceI] = meshMod.addPoint
|
faceToDualPoint_[facei] = meshMod.addPoint
|
||||||
(
|
(
|
||||||
mesh_.faceCentres()[faceI],
|
mesh_.faceCentres()[facei],
|
||||||
mesh_.faces()[faceI][0], // masterPoint
|
mesh_.faces()[facei][0], // masterPoint
|
||||||
-1, // zoneID
|
-1, // zoneID
|
||||||
true // inCell
|
true // inCell
|
||||||
);
|
);
|
||||||
@ -1144,22 +1144,22 @@ void Foam::meshDualiser::setRefinement
|
|||||||
// Detect whether different dual cells on either side of a face. This
|
// Detect whether different dual cells on either side of a face. This
|
||||||
// would neccesitate having a dual face built from the face and thus a
|
// would neccesitate having a dual face built from the face and thus a
|
||||||
// dual point at the face centre.
|
// dual point at the face centre.
|
||||||
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
|
||||||
{
|
{
|
||||||
if (faceToDualPoint_[faceI] == -1)
|
if (faceToDualPoint_[facei] == -1)
|
||||||
{
|
{
|
||||||
const face& f = mesh_.faces()[faceI];
|
const face& f = mesh_.faces()[facei];
|
||||||
|
|
||||||
forAll(f, fp)
|
forAll(f, fp)
|
||||||
{
|
{
|
||||||
label ownDualCell = findDualCell(own[faceI], f[fp]);
|
label ownDualCell = findDualCell(own[facei], f[fp]);
|
||||||
label neiDualCell = findDualCell(nei[faceI], f[fp]);
|
label neiDualCell = findDualCell(nei[facei], f[fp]);
|
||||||
|
|
||||||
if (ownDualCell != neiDualCell)
|
if (ownDualCell != neiDualCell)
|
||||||
{
|
{
|
||||||
faceToDualPoint_[faceI] = meshMod.addPoint
|
faceToDualPoint_[facei] = meshMod.addPoint
|
||||||
(
|
(
|
||||||
mesh_.faceCentres()[faceI],
|
mesh_.faceCentres()[facei],
|
||||||
f[fp], // masterPoint
|
f[fp], // masterPoint
|
||||||
-1, // zoneID
|
-1, // zoneID
|
||||||
true // inCell
|
true // inCell
|
||||||
@ -1332,12 +1332,12 @@ void Foam::meshDualiser::setRefinement
|
|||||||
// - multiple cells: create single face between unique cell pair. Only
|
// - multiple cells: create single face between unique cell pair. Only
|
||||||
// create face where cells differ on either side.
|
// create face where cells differ on either side.
|
||||||
// - non-feature face : inbetween cell zones.
|
// - non-feature face : inbetween cell zones.
|
||||||
forAll(faceToDualPoint_, faceI)
|
forAll(faceToDualPoint_, facei)
|
||||||
{
|
{
|
||||||
if (faceToDualPoint_[faceI] != -1 && mesh_.isInternalFace(faceI))
|
if (faceToDualPoint_[facei] != -1 && mesh_.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
const face& f = mesh_.faces()[faceI];
|
const face& f = mesh_.faces()[facei];
|
||||||
const labelList& fEdges = mesh_.faceEdges()[faceI];
|
const labelList& fEdges = mesh_.faceEdges()[facei];
|
||||||
|
|
||||||
// Starting edge
|
// Starting edge
|
||||||
label fp = 0;
|
label fp = 0;
|
||||||
@ -1353,7 +1353,7 @@ void Foam::meshDualiser::setRefinement
|
|||||||
if
|
if
|
||||||
(
|
(
|
||||||
edgeToDualPoint_[fEdges[fp]] != -1
|
edgeToDualPoint_[fEdges[fp]] != -1
|
||||||
&& !sameDualCell(faceI, f.nextLabel(fp))
|
&& !sameDualCell(facei, f.nextLabel(fp))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
foundStart = true;
|
foundStart = true;
|
||||||
@ -1371,7 +1371,7 @@ void Foam::meshDualiser::setRefinement
|
|||||||
// Walk from edge fp and generate a face.
|
// Walk from edge fp and generate a face.
|
||||||
createFaceFromInternalFace
|
createFaceFromInternalFace
|
||||||
(
|
(
|
||||||
faceI,
|
facei,
|
||||||
fp,
|
fp,
|
||||||
meshMod
|
meshMod
|
||||||
);
|
);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -94,7 +94,7 @@ class meshDualiser
|
|||||||
static void dumpPolyTopoChange(const polyTopoChange&, const fileName&);
|
static void dumpPolyTopoChange(const polyTopoChange&, const fileName&);
|
||||||
|
|
||||||
//- Find dual cell given point and cell
|
//- Find dual cell given point and cell
|
||||||
label findDualCell(const label cellI, const label pointI) const;
|
label findDualCell(const label celli, const label pointI) const;
|
||||||
|
|
||||||
//- Helper function to generate dualpoints on all boundary edges
|
//- Helper function to generate dualpoints on all boundary edges
|
||||||
// emanating from (boundary & feature) point
|
// emanating from (boundary & feature) point
|
||||||
@ -108,7 +108,7 @@ class meshDualiser
|
|||||||
//- Check that owner and neighbour of face have same dual cell
|
//- Check that owner and neighbour of face have same dual cell
|
||||||
bool sameDualCell
|
bool sameDualCell
|
||||||
(
|
(
|
||||||
const label faceI,
|
const label facei,
|
||||||
const label pointI
|
const label pointI
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ class meshDualiser
|
|||||||
//- Create single internal face from internal face
|
//- Create single internal face from internal face
|
||||||
void createFaceFromInternalFace
|
void createFaceFromInternalFace
|
||||||
(
|
(
|
||||||
const label faceI,
|
const label facei,
|
||||||
label& fp,
|
label& fp,
|
||||||
polyTopoChange&
|
polyTopoChange&
|
||||||
) const;
|
) const;
|
||||||
|
|||||||
@ -234,9 +234,9 @@ void simpleMarkFeatures
|
|||||||
// Face centres that need inclusion in the dual mesh
|
// Face centres that need inclusion in the dual mesh
|
||||||
labelHashSet featureFaceSet(mesh.nFaces()-mesh.nInternalFaces());
|
labelHashSet featureFaceSet(mesh.nFaces()-mesh.nInternalFaces());
|
||||||
// A. boundary faces.
|
// A. boundary faces.
|
||||||
for (label faceI = mesh.nInternalFaces(); faceI < mesh.nFaces(); faceI++)
|
for (label facei = mesh.nInternalFaces(); facei < mesh.nFaces(); facei++)
|
||||||
{
|
{
|
||||||
featureFaceSet.insert(faceI);
|
featureFaceSet.insert(facei);
|
||||||
}
|
}
|
||||||
|
|
||||||
// B. face zones.
|
// B. face zones.
|
||||||
@ -270,11 +270,11 @@ void simpleMarkFeatures
|
|||||||
|
|
||||||
forAll(fz, i)
|
forAll(fz, i)
|
||||||
{
|
{
|
||||||
label faceI = fz[i];
|
label facei = fz[i];
|
||||||
const face& f = mesh.faces()[faceI];
|
const face& f = mesh.faces()[facei];
|
||||||
const labelList& fEdges = mesh.faceEdges()[faceI];
|
const labelList& fEdges = mesh.faceEdges()[facei];
|
||||||
|
|
||||||
featureFaceSet.insert(faceI);
|
featureFaceSet.insert(facei);
|
||||||
forAll(f, fp)
|
forAll(f, fp)
|
||||||
{
|
{
|
||||||
// Mark point as multi cell point (since both sides of
|
// Mark point as multi cell point (since both sides of
|
||||||
@ -385,9 +385,9 @@ int main(int argc, char *argv[])
|
|||||||
// (Note: in 1.4.2 we can use the built-in mesh point ordering
|
// (Note: in 1.4.2 we can use the built-in mesh point ordering
|
||||||
// facility instead)
|
// facility instead)
|
||||||
PackedBoolList isBoundaryEdge(mesh.nEdges());
|
PackedBoolList isBoundaryEdge(mesh.nEdges());
|
||||||
for (label faceI = mesh.nInternalFaces(); faceI < mesh.nFaces(); faceI++)
|
for (label facei = mesh.nInternalFaces(); facei < mesh.nFaces(); facei++)
|
||||||
{
|
{
|
||||||
const labelList& fEdges = mesh.faceEdges()[faceI];
|
const labelList& fEdges = mesh.faceEdges()[facei];
|
||||||
|
|
||||||
forAll(fEdges, i)
|
forAll(fEdges, i)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -240,9 +240,9 @@ int main(int argc, char *argv[])
|
|||||||
// Select all cells
|
// Select all cells
|
||||||
refCells.setSize(mesh.nCells());
|
refCells.setSize(mesh.nCells());
|
||||||
|
|
||||||
forAll(mesh.cells(), cellI)
|
forAll(mesh.cells(), celli)
|
||||||
{
|
{
|
||||||
refCells[cellI] = cellI;
|
refCells[celli] = celli;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mesh.nGeometricD() == 3)
|
if (mesh.nGeometricD() == 3)
|
||||||
|
|||||||
@ -86,9 +86,9 @@ tmp<volScalarField> createScalarField
|
|||||||
);
|
);
|
||||||
volScalarField& fld = tfld.ref();
|
volScalarField& fld = tfld.ref();
|
||||||
|
|
||||||
forAll(fld, cellI)
|
forAll(fld, celli)
|
||||||
{
|
{
|
||||||
fld[cellI] = elems[cellI];
|
fld[celli] = elems[celli];
|
||||||
}
|
}
|
||||||
|
|
||||||
return tfld;
|
return tfld;
|
||||||
@ -100,9 +100,9 @@ label getBand(const labelList& owner, const labelList& neighbour)
|
|||||||
{
|
{
|
||||||
label band = 0;
|
label band = 0;
|
||||||
|
|
||||||
forAll(neighbour, faceI)
|
forAll(neighbour, facei)
|
||||||
{
|
{
|
||||||
label diff = neighbour[faceI] - owner[faceI];
|
label diff = neighbour[facei] - owner[facei];
|
||||||
|
|
||||||
if (diff > band)
|
if (diff > band)
|
||||||
{
|
{
|
||||||
@ -128,10 +128,10 @@ void getBand
|
|||||||
labelList cellBandwidth(nCells, 0);
|
labelList cellBandwidth(nCells, 0);
|
||||||
scalarField nIntersect(nCells, 0.0);
|
scalarField nIntersect(nCells, 0.0);
|
||||||
|
|
||||||
forAll(neighbour, faceI)
|
forAll(neighbour, facei)
|
||||||
{
|
{
|
||||||
label own = owner[faceI];
|
label own = owner[facei];
|
||||||
label nei = neighbour[faceI];
|
label nei = neighbour[facei];
|
||||||
|
|
||||||
// Note: mag not necessary for correct (upper-triangular) ordering.
|
// Note: mag not necessary for correct (upper-triangular) ordering.
|
||||||
label diff = nei-own;
|
label diff = nei-own;
|
||||||
@ -142,17 +142,17 @@ void getBand
|
|||||||
|
|
||||||
// Do not use field algebra because of conversion label to scalar
|
// Do not use field algebra because of conversion label to scalar
|
||||||
profile = 0.0;
|
profile = 0.0;
|
||||||
forAll(cellBandwidth, cellI)
|
forAll(cellBandwidth, celli)
|
||||||
{
|
{
|
||||||
profile += 1.0*cellBandwidth[cellI];
|
profile += 1.0*cellBandwidth[celli];
|
||||||
}
|
}
|
||||||
|
|
||||||
sumSqrIntersect = 0.0;
|
sumSqrIntersect = 0.0;
|
||||||
if (calculateIntersect)
|
if (calculateIntersect)
|
||||||
{
|
{
|
||||||
forAll(nIntersect, cellI)
|
forAll(nIntersect, celli)
|
||||||
{
|
{
|
||||||
for (label colI = cellI-cellBandwidth[cellI]; colI <= cellI; colI++)
|
for (label colI = celli-cellBandwidth[celli]; colI <= celli; colI++)
|
||||||
{
|
{
|
||||||
nIntersect[colI] += 1.0;
|
nIntersect[colI] += 1.0;
|
||||||
}
|
}
|
||||||
@ -190,15 +190,15 @@ labelList getFaceOrder
|
|||||||
|
|
||||||
forAll(cFaces, i)
|
forAll(cFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = cFaces[i];
|
label facei = cFaces[i];
|
||||||
|
|
||||||
if (mesh.isInternalFace(faceI))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
// Internal face. Get cell on other side.
|
// Internal face. Get cell on other side.
|
||||||
label nbrCellI = reverseCellOrder[mesh.faceNeighbour()[faceI]];
|
label nbrCellI = reverseCellOrder[mesh.faceNeighbour()[facei]];
|
||||||
if (nbrCellI == newCellI)
|
if (nbrCellI == newCellI)
|
||||||
{
|
{
|
||||||
nbrCellI = reverseCellOrder[mesh.faceOwner()[faceI]];
|
nbrCellI = reverseCellOrder[mesh.faceOwner()[facei]];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newCellI < nbrCellI)
|
if (newCellI < nbrCellI)
|
||||||
@ -233,19 +233,19 @@ labelList getFaceOrder
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Leave patch faces intact.
|
// Leave patch faces intact.
|
||||||
for (label faceI = newFaceI; faceI < mesh.nFaces(); faceI++)
|
for (label facei = newFaceI; facei < mesh.nFaces(); facei++)
|
||||||
{
|
{
|
||||||
oldToNewFace[faceI] = faceI;
|
oldToNewFace[facei] = facei;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Check done all faces.
|
// Check done all faces.
|
||||||
forAll(oldToNewFace, faceI)
|
forAll(oldToNewFace, facei)
|
||||||
{
|
{
|
||||||
if (oldToNewFace[faceI] == -1)
|
if (oldToNewFace[facei] == -1)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Did not determine new position" << " for face " << faceI
|
<< "Did not determine new position" << " for face " << facei
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -286,15 +286,15 @@ labelList getRegionFaceOrder
|
|||||||
|
|
||||||
forAll(cFaces, i)
|
forAll(cFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = cFaces[i];
|
label facei = cFaces[i];
|
||||||
|
|
||||||
if (mesh.isInternalFace(faceI))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
// Internal face. Get cell on other side.
|
// Internal face. Get cell on other side.
|
||||||
label nbrCellI = reverseCellOrder[mesh.faceNeighbour()[faceI]];
|
label nbrCellI = reverseCellOrder[mesh.faceNeighbour()[facei]];
|
||||||
if (nbrCellI == newCellI)
|
if (nbrCellI == newCellI)
|
||||||
{
|
{
|
||||||
nbrCellI = reverseCellOrder[mesh.faceOwner()[faceI]];
|
nbrCellI = reverseCellOrder[mesh.faceOwner()[facei]];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cellToRegion[oldCellI] != cellToRegion[cellOrder[nbrCellI]])
|
if (cellToRegion[oldCellI] != cellToRegion[cellOrder[nbrCellI]])
|
||||||
@ -337,14 +337,14 @@ labelList getRegionFaceOrder
|
|||||||
// Sort in increasing region
|
// Sort in increasing region
|
||||||
SortableList<label> sortKey(mesh.nFaces(), labelMax);
|
SortableList<label> sortKey(mesh.nFaces(), labelMax);
|
||||||
|
|
||||||
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
|
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||||
{
|
{
|
||||||
label ownRegion = cellToRegion[mesh.faceOwner()[faceI]];
|
label ownRegion = cellToRegion[mesh.faceOwner()[facei]];
|
||||||
label neiRegion = cellToRegion[mesh.faceNeighbour()[faceI]];
|
label neiRegion = cellToRegion[mesh.faceNeighbour()[facei]];
|
||||||
|
|
||||||
if (ownRegion != neiRegion)
|
if (ownRegion != neiRegion)
|
||||||
{
|
{
|
||||||
sortKey[faceI] =
|
sortKey[facei] =
|
||||||
min(ownRegion, neiRegion)*nRegions
|
min(ownRegion, neiRegion)*nRegions
|
||||||
+max(ownRegion, neiRegion);
|
+max(ownRegion, neiRegion);
|
||||||
}
|
}
|
||||||
@ -372,20 +372,20 @@ labelList getRegionFaceOrder
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Leave patch faces intact.
|
// Leave patch faces intact.
|
||||||
for (label faceI = newFaceI; faceI < mesh.nFaces(); faceI++)
|
for (label facei = newFaceI; facei < mesh.nFaces(); facei++)
|
||||||
{
|
{
|
||||||
oldToNewFace[faceI] = faceI;
|
oldToNewFace[facei] = facei;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Check done all faces.
|
// Check done all faces.
|
||||||
forAll(oldToNewFace, faceI)
|
forAll(oldToNewFace, facei)
|
||||||
{
|
{
|
||||||
if (oldToNewFace[faceI] == -1)
|
if (oldToNewFace[facei] == -1)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Did not determine new position"
|
<< "Did not determine new position"
|
||||||
<< " for face " << faceI
|
<< " for face " << facei
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -427,16 +427,16 @@ autoPtr<mapPolyMesh> reorderMesh
|
|||||||
|
|
||||||
// Check if any faces need swapping.
|
// Check if any faces need swapping.
|
||||||
labelHashSet flipFaceFlux(newOwner.size());
|
labelHashSet flipFaceFlux(newOwner.size());
|
||||||
forAll(newNeighbour, faceI)
|
forAll(newNeighbour, facei)
|
||||||
{
|
{
|
||||||
label own = newOwner[faceI];
|
label own = newOwner[facei];
|
||||||
label nei = newNeighbour[faceI];
|
label nei = newNeighbour[facei];
|
||||||
|
|
||||||
if (nei < own)
|
if (nei < own)
|
||||||
{
|
{
|
||||||
newFaces[faceI].flip();
|
newFaces[facei].flip();
|
||||||
Swap(newOwner[faceI], newNeighbour[faceI]);
|
Swap(newOwner[facei], newNeighbour[facei]);
|
||||||
flipFaceFlux.insert(faceI);
|
flipFaceFlux.insert(facei);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -566,11 +566,11 @@ labelList regionRenumber
|
|||||||
|
|
||||||
labelListList regionToCells(invertOneToMany(nRegions, cellToRegion));
|
labelListList regionToCells(invertOneToMany(nRegions, cellToRegion));
|
||||||
|
|
||||||
label cellI = 0;
|
label celli = 0;
|
||||||
|
|
||||||
forAll(regionToCells, regionI)
|
forAll(regionToCells, regionI)
|
||||||
{
|
{
|
||||||
Info<< " region " << regionI << " starts at " << cellI << endl;
|
Info<< " region " << regionI << " starts at " << celli << endl;
|
||||||
|
|
||||||
// Make sure no parallel comms
|
// Make sure no parallel comms
|
||||||
bool oldParRun = UPstream::parRun();
|
bool oldParRun = UPstream::parRun();
|
||||||
@ -595,7 +595,7 @@ labelList regionRenumber
|
|||||||
|
|
||||||
forAll(subCellOrder, i)
|
forAll(subCellOrder, i)
|
||||||
{
|
{
|
||||||
cellOrder[cellI++] = cellMap[subCellOrder[i]];
|
cellOrder[celli++] = cellMap[subCellOrder[i]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
@ -975,13 +975,13 @@ int main(int argc, char *argv[])
|
|||||||
const labelUList& faceCells = pbm[patchi].faceCells();
|
const labelUList& faceCells = pbm[patchi].faceCells();
|
||||||
forAll(faceCells, i)
|
forAll(faceCells, i)
|
||||||
{
|
{
|
||||||
label cellI = faceCells[i];
|
label celli = faceCells[i];
|
||||||
|
|
||||||
if (reverseCellOrder[cellI] != -1)
|
if (reverseCellOrder[celli] != -1)
|
||||||
{
|
{
|
||||||
bndCells[nBndCells] = cellI;
|
bndCells[nBndCells] = celli;
|
||||||
bndCellMap[nBndCells++] = reverseCellOrder[cellI];
|
bndCellMap[nBndCells++] = reverseCellOrder[celli];
|
||||||
reverseCellOrder[cellI] = -1;
|
reverseCellOrder[celli] = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1105,10 +1105,10 @@ int main(int argc, char *argv[])
|
|||||||
const labelHashSet& fff = map().flipFaceFlux();
|
const labelHashSet& fff = map().flipFaceFlux();
|
||||||
forAllConstIter(labelHashSet, fff, iter)
|
forAllConstIter(labelHashSet, fff, iter)
|
||||||
{
|
{
|
||||||
label faceI = iter.key();
|
label facei = iter.key();
|
||||||
label masterFaceI = faceProcAddressing[faceI];
|
label masterFaceI = faceProcAddressing[facei];
|
||||||
|
|
||||||
faceProcAddressing[faceI] = -masterFaceI;
|
faceProcAddressing[facei] = -masterFaceI;
|
||||||
|
|
||||||
if (masterFaceI == 0)
|
if (masterFaceI == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -110,31 +110,31 @@ void writeVTK
|
|||||||
|
|
||||||
forAllConstIter(cellSet, currentSet, iter)
|
forAllConstIter(cellSet, currentSet, iter)
|
||||||
{
|
{
|
||||||
label cellI = iter.key();
|
label celli = iter.key();
|
||||||
|
|
||||||
const cell& cFaces = mesh.cells()[cellI];
|
const cell& cFaces = mesh.cells()[celli];
|
||||||
|
|
||||||
forAll(cFaces, i)
|
forAll(cFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = cFaces[i];
|
label facei = cFaces[i];
|
||||||
|
|
||||||
if (mesh.isInternalFace(faceI))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
label otherCellI = mesh.faceOwner()[faceI];
|
label otherCellI = mesh.faceOwner()[facei];
|
||||||
|
|
||||||
if (otherCellI == cellI)
|
if (otherCellI == celli)
|
||||||
{
|
{
|
||||||
otherCellI = mesh.faceNeighbour()[faceI];
|
otherCellI = mesh.faceNeighbour()[facei];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!currentSet.found(otherCellI))
|
if (!currentSet.found(otherCellI))
|
||||||
{
|
{
|
||||||
cellFaces.insert(faceI, cellI);
|
cellFaces.insert(facei, celli);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cellFaces.insert(faceI, cellI);
|
cellFaces.insert(facei, celli);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -81,9 +81,9 @@ void writePatch
|
|||||||
|
|
||||||
label nFaceVerts = 0;
|
label nFaceVerts = 0;
|
||||||
|
|
||||||
forAll(fp.localFaces(), faceI)
|
forAll(fp.localFaces(), facei)
|
||||||
{
|
{
|
||||||
nFaceVerts += fp.localFaces()[faceI].size() + 1;
|
nFaceVerts += fp.localFaces()[facei].size() + 1;
|
||||||
}
|
}
|
||||||
pStream << "POLYGONS " << fp.size() << ' ' << nFaceVerts
|
pStream << "POLYGONS " << fp.size() << ' ' << nFaceVerts
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
@ -91,9 +91,9 @@ void writePatch
|
|||||||
|
|
||||||
DynamicList<label> vertLabels(nFaceVerts);
|
DynamicList<label> vertLabels(nFaceVerts);
|
||||||
|
|
||||||
forAll(fp.localFaces(), faceI)
|
forAll(fp.localFaces(), facei)
|
||||||
{
|
{
|
||||||
const face& f = fp.localFaces()[faceI];
|
const face& f = fp.localFaces()[facei];
|
||||||
|
|
||||||
vertLabels.append(f.size());
|
vertLabels.append(f.size());
|
||||||
|
|
||||||
|
|||||||
@ -163,8 +163,8 @@ int main(int argc, char *argv[])
|
|||||||
// No flip map.
|
// No flip map.
|
||||||
forAll(faceLabels, i)
|
forAll(faceLabels, i)
|
||||||
{
|
{
|
||||||
label faceI = faceLabels[i];
|
label facei = faceLabels[i];
|
||||||
addressing.append(faceI);
|
addressing.append(facei);
|
||||||
flipMap.append(false);
|
flipMap.append(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -187,24 +187,24 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAll(faceLabels, i)
|
forAll(faceLabels, i)
|
||||||
{
|
{
|
||||||
label faceI = faceLabels[i];
|
label facei = faceLabels[i];
|
||||||
|
|
||||||
bool flip = false;
|
bool flip = false;
|
||||||
|
|
||||||
if (mesh.isInternalFace(faceI))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
cells.found(mesh.faceOwner()[faceI])
|
cells.found(mesh.faceOwner()[facei])
|
||||||
&& !cells.found(mesh.faceNeighbour()[faceI])
|
&& !cells.found(mesh.faceNeighbour()[facei])
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
flip = false;
|
flip = false;
|
||||||
}
|
}
|
||||||
else if
|
else if
|
||||||
(
|
(
|
||||||
!cells.found(mesh.faceOwner()[faceI])
|
!cells.found(mesh.faceOwner()[facei])
|
||||||
&& cells.found(mesh.faceNeighbour()[faceI])
|
&& cells.found(mesh.faceNeighbour()[facei])
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
flip = true;
|
flip = true;
|
||||||
@ -213,21 +213,21 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "One of owner or neighbour of internal face "
|
<< "One of owner or neighbour of internal face "
|
||||||
<< faceI << " should be in cellSet " << cells.name()
|
<< facei << " should be in cellSet " << cells.name()
|
||||||
<< " to be able to determine orientation." << endl
|
<< " to be able to determine orientation." << endl
|
||||||
<< "Face:" << faceI
|
<< "Face:" << facei
|
||||||
<< " own:" << mesh.faceOwner()[faceI]
|
<< " own:" << mesh.faceOwner()[facei]
|
||||||
<< " OwnInCellSet:"
|
<< " OwnInCellSet:"
|
||||||
<< cells.found(mesh.faceOwner()[faceI])
|
<< cells.found(mesh.faceOwner()[facei])
|
||||||
<< " nei:" << mesh.faceNeighbour()[faceI]
|
<< " nei:" << mesh.faceNeighbour()[facei]
|
||||||
<< " NeiInCellSet:"
|
<< " NeiInCellSet:"
|
||||||
<< cells.found(mesh.faceNeighbour()[faceI])
|
<< cells.found(mesh.faceNeighbour()[facei])
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (cells.found(mesh.faceOwner()[faceI]))
|
if (cells.found(mesh.faceOwner()[facei]))
|
||||||
{
|
{
|
||||||
flip = false;
|
flip = false;
|
||||||
}
|
}
|
||||||
@ -237,7 +237,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addressing.append(faceI);
|
addressing.append(facei);
|
||||||
flipMap.append(flip);
|
flipMap.append(flip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -43,16 +43,16 @@ defineTypeNameAndDebug(regionSide, 0);
|
|||||||
Foam::label Foam::regionSide::otherFace
|
Foam::label Foam::regionSide::otherFace
|
||||||
(
|
(
|
||||||
const primitiveMesh& mesh,
|
const primitiveMesh& mesh,
|
||||||
const label cellI,
|
const label celli,
|
||||||
const label faceI,
|
const label facei,
|
||||||
const label edgeI
|
const label edgeI
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
label f0I, f1I;
|
label f0I, f1I;
|
||||||
|
|
||||||
meshTools::getEdgeFaces(mesh, cellI, edgeI, f0I, f1I);
|
meshTools::getEdgeFaces(mesh, celli, edgeI, f0I, f1I);
|
||||||
|
|
||||||
if (f0I == faceI)
|
if (f0I == facei)
|
||||||
{
|
{
|
||||||
return f1I;
|
return f1I;
|
||||||
}
|
}
|
||||||
@ -67,7 +67,7 @@ Foam::label Foam::regionSide::otherFace
|
|||||||
Foam::label Foam::regionSide::otherEdge
|
Foam::label Foam::regionSide::otherEdge
|
||||||
(
|
(
|
||||||
const primitiveMesh& mesh,
|
const primitiveMesh& mesh,
|
||||||
const label faceI,
|
const label facei,
|
||||||
const label edgeI,
|
const label edgeI,
|
||||||
const label pointI
|
const label pointI
|
||||||
)
|
)
|
||||||
@ -77,7 +77,7 @@ Foam::label Foam::regionSide::otherEdge
|
|||||||
// Get other point on edge.
|
// Get other point on edge.
|
||||||
label freePointI = e.otherVertex(pointI);
|
label freePointI = e.otherVertex(pointI);
|
||||||
|
|
||||||
const labelList& fEdges = mesh.faceEdges()[faceI];
|
const labelList& fEdges = mesh.faceEdges()[facei];
|
||||||
|
|
||||||
forAll(fEdges, fEdgeI)
|
forAll(fEdges, fEdgeI)
|
||||||
{
|
{
|
||||||
@ -102,52 +102,52 @@ Foam::label Foam::regionSide::otherEdge
|
|||||||
}
|
}
|
||||||
|
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Cannot find other edge on face " << faceI << " that uses point "
|
<< "Cannot find other edge on face " << facei << " that uses point "
|
||||||
<< pointI << " but not point " << freePointI << endl
|
<< pointI << " but not point " << freePointI << endl
|
||||||
<< "Edges on face:" << fEdges
|
<< "Edges on face:" << fEdges
|
||||||
<< " verts:" << UIndirectList<edge>(mesh.edges(), fEdges)()
|
<< " verts:" << UIndirectList<edge>(mesh.edges(), fEdges)()
|
||||||
<< " Vertices on face:"
|
<< " Vertices on face:"
|
||||||
<< mesh.faces()[faceI]
|
<< mesh.faces()[facei]
|
||||||
<< " Vertices on original edge:" << e << abort(FatalError);
|
<< " Vertices on original edge:" << e << abort(FatalError);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Step from faceI (on side cellI) to connected face & cell without crossing
|
// Step from facei (on side celli) to connected face & cell without crossing
|
||||||
// fenceEdges.
|
// fenceEdges.
|
||||||
void Foam::regionSide::visitConnectedFaces
|
void Foam::regionSide::visitConnectedFaces
|
||||||
(
|
(
|
||||||
const primitiveMesh& mesh,
|
const primitiveMesh& mesh,
|
||||||
const labelHashSet& region,
|
const labelHashSet& region,
|
||||||
const labelHashSet& fenceEdges,
|
const labelHashSet& fenceEdges,
|
||||||
const label cellI,
|
const label celli,
|
||||||
const label faceI,
|
const label facei,
|
||||||
labelHashSet& visitedFace
|
labelHashSet& visitedFace
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (!visitedFace.found(faceI))
|
if (!visitedFace.found(facei))
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "visitConnectedFaces : cellI:" << cellI << " faceI:"
|
Info<< "visitConnectedFaces : celli:" << celli << " facei:"
|
||||||
<< faceI << " isOwner:" << (cellI == mesh.faceOwner()[faceI])
|
<< facei << " isOwner:" << (celli == mesh.faceOwner()[facei])
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mark as visited
|
// Mark as visited
|
||||||
visitedFace.insert(faceI);
|
visitedFace.insert(facei);
|
||||||
|
|
||||||
// Mark which side of face was visited.
|
// Mark which side of face was visited.
|
||||||
if (cellI == mesh.faceOwner()[faceI])
|
if (celli == mesh.faceOwner()[facei])
|
||||||
{
|
{
|
||||||
sideOwner_.insert(faceI);
|
sideOwner_.insert(facei);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Visit all neighbouring faces on faceSet. Stay on this 'side' of
|
// Visit all neighbouring faces on faceSet. Stay on this 'side' of
|
||||||
// face by doing edge-face-cell walk.
|
// face by doing edge-face-cell walk.
|
||||||
const labelList& fEdges = mesh.faceEdges()[faceI];
|
const labelList& fEdges = mesh.faceEdges()[facei];
|
||||||
|
|
||||||
forAll(fEdges, fEdgeI)
|
forAll(fEdges, fEdgeI)
|
||||||
{
|
{
|
||||||
@ -159,11 +159,11 @@ void Foam::regionSide::visitConnectedFaces
|
|||||||
// we hit face on faceSet.
|
// we hit face on faceSet.
|
||||||
|
|
||||||
// Find face reachable from edge
|
// Find face reachable from edge
|
||||||
label otherFaceI = otherFace(mesh, cellI, faceI, edgeI);
|
label otherFaceI = otherFace(mesh, celli, facei, edgeI);
|
||||||
|
|
||||||
if (mesh.isInternalFace(otherFaceI))
|
if (mesh.isInternalFace(otherFaceI))
|
||||||
{
|
{
|
||||||
label otherCellI = cellI;
|
label otherCellI = celli;
|
||||||
|
|
||||||
// Keep on crossing faces/cells until back on face on
|
// Keep on crossing faces/cells until back on face on
|
||||||
// surface
|
// surface
|
||||||
@ -173,7 +173,7 @@ void Foam::regionSide::visitConnectedFaces
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "visitConnectedFaces : cellI:" << cellI
|
Info<< "visitConnectedFaces : celli:" << celli
|
||||||
<< " found insideEdgeFace:" << otherFaceI
|
<< " found insideEdgeFace:" << otherFaceI
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
@ -234,13 +234,13 @@ void Foam::regionSide::walkPointConnectedFaces
|
|||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "walkPointConnectedFaces : regionPointI:" << regionPointI
|
Info<< "walkPointConnectedFaces : regionPointI:" << regionPointI
|
||||||
<< " faceI:" << startFaceI
|
<< " facei:" << startFaceI
|
||||||
<< " edgeI:" << startEdgeI << " verts:"
|
<< " edgeI:" << startEdgeI << " verts:"
|
||||||
<< mesh.edges()[startEdgeI]
|
<< mesh.edges()[startEdgeI]
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cross faceI i.e. get edge not startEdgeI which uses regionPointI
|
// Cross facei i.e. get edge not startEdgeI which uses regionPointI
|
||||||
label edgeI = otherEdge(mesh, startFaceI, startEdgeI, regionPointI);
|
label edgeI = otherEdge(mesh, startFaceI, startEdgeI, regionPointI);
|
||||||
|
|
||||||
if (!regionEdges.found(edgeI))
|
if (!regionEdges.found(edgeI))
|
||||||
@ -265,14 +265,14 @@ void Foam::regionSide::walkPointConnectedFaces
|
|||||||
|
|
||||||
forAll(eFaces, eFaceI)
|
forAll(eFaces, eFaceI)
|
||||||
{
|
{
|
||||||
label faceI = eFaces[eFaceI];
|
label facei = eFaces[eFaceI];
|
||||||
|
|
||||||
walkPointConnectedFaces
|
walkPointConnectedFaces
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
regionEdges,
|
regionEdges,
|
||||||
regionPointI,
|
regionPointI,
|
||||||
faceI,
|
facei,
|
||||||
edgeI,
|
edgeI,
|
||||||
visitedEdges
|
visitedEdges
|
||||||
);
|
);
|
||||||
@ -298,8 +298,8 @@ void Foam::regionSide::walkAllPointConnectedFaces
|
|||||||
|
|
||||||
forAllConstIter(labelHashSet, regionFaces, iter)
|
forAllConstIter(labelHashSet, regionFaces, iter)
|
||||||
{
|
{
|
||||||
const label faceI = iter.key();
|
const label facei = iter.key();
|
||||||
const labelList& fEdges = mesh.faceEdges()[faceI];
|
const labelList& fEdges = mesh.faceEdges()[facei];
|
||||||
|
|
||||||
forAll(fEdges, fEdgeI)
|
forAll(fEdges, fEdgeI)
|
||||||
{
|
{
|
||||||
@ -331,29 +331,29 @@ void Foam::regionSide::walkAllPointConnectedFaces
|
|||||||
|
|
||||||
forAllConstIter(labelHashSet, regionFaces, iter)
|
forAllConstIter(labelHashSet, regionFaces, iter)
|
||||||
{
|
{
|
||||||
const label faceI = iter.key();
|
const label facei = iter.key();
|
||||||
|
|
||||||
// Get side of face.
|
// Get side of face.
|
||||||
label cellI;
|
label celli;
|
||||||
|
|
||||||
if (sideOwner_.found(faceI))
|
if (sideOwner_.found(facei))
|
||||||
{
|
{
|
||||||
cellI = mesh.faceOwner()[faceI];
|
celli = mesh.faceOwner()[facei];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cellI = mesh.faceNeighbour()[faceI];
|
celli = mesh.faceNeighbour()[facei];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find starting point and edge on face.
|
// Find starting point and edge on face.
|
||||||
const labelList& fEdges = mesh.faceEdges()[faceI];
|
const labelList& fEdges = mesh.faceEdges()[facei];
|
||||||
|
|
||||||
forAll(fEdges, fEdgeI)
|
forAll(fEdges, fEdgeI)
|
||||||
{
|
{
|
||||||
label edgeI = fEdges[fEdgeI];
|
label edgeI = fEdges[fEdgeI];
|
||||||
|
|
||||||
// Get the face 'perpendicular' to faceI on region.
|
// Get the face 'perpendicular' to facei on region.
|
||||||
label otherFaceI = otherFace(mesh, cellI, faceI, edgeI);
|
label otherFaceI = otherFace(mesh, celli, facei, edgeI);
|
||||||
|
|
||||||
// Edge
|
// Edge
|
||||||
const edge& e = mesh.edges()[edgeI];
|
const edge& e = mesh.edges()[edgeI];
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -77,20 +77,20 @@ class regionSide
|
|||||||
static label otherEdge
|
static label otherEdge
|
||||||
(
|
(
|
||||||
const primitiveMesh& mesh,
|
const primitiveMesh& mesh,
|
||||||
const label faceI,
|
const label facei,
|
||||||
const label edgeI,
|
const label edgeI,
|
||||||
const label pointI
|
const label pointI
|
||||||
);
|
);
|
||||||
|
|
||||||
//- From faceI, side cellI, cross to other faces/cells by
|
//- From facei, side celli, cross to other faces/cells by
|
||||||
// face-cell walking and store visited faces and update sideOwner_.
|
// face-cell walking and store visited faces and update sideOwner_.
|
||||||
void visitConnectedFaces
|
void visitConnectedFaces
|
||||||
(
|
(
|
||||||
const primitiveMesh& mesh,
|
const primitiveMesh& mesh,
|
||||||
const labelHashSet& region,
|
const labelHashSet& region,
|
||||||
const labelHashSet& fenceEdges,
|
const labelHashSet& fenceEdges,
|
||||||
const label cellI,
|
const label celli,
|
||||||
const label faceI,
|
const label facei,
|
||||||
labelHashSet& visitedFace
|
labelHashSet& visitedFace
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ public:
|
|||||||
static label otherFace
|
static label otherFace
|
||||||
(
|
(
|
||||||
const primitiveMesh& mesh,
|
const primitiveMesh& mesh,
|
||||||
const label cellI,
|
const label celli,
|
||||||
const label excludeFaceI,
|
const label excludeFaceI,
|
||||||
const label edgeI
|
const label edgeI
|
||||||
);
|
);
|
||||||
|
|||||||
@ -250,11 +250,11 @@ void subsetSurfaceFields
|
|||||||
labelList getNonRegionCells(const labelList& cellRegion, const label regionI)
|
labelList getNonRegionCells(const labelList& cellRegion, const label regionI)
|
||||||
{
|
{
|
||||||
DynamicList<label> nonRegionCells(cellRegion.size());
|
DynamicList<label> nonRegionCells(cellRegion.size());
|
||||||
forAll(cellRegion, cellI)
|
forAll(cellRegion, celli)
|
||||||
{
|
{
|
||||||
if (cellRegion[cellI] != regionI)
|
if (cellRegion[celli] != regionI)
|
||||||
{
|
{
|
||||||
nonRegionCells.append(cellI);
|
nonRegionCells.append(celli);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nonRegionCells.shrink();
|
return nonRegionCells.shrink();
|
||||||
@ -329,17 +329,17 @@ void getInterfaceSizes
|
|||||||
// Internal faces
|
// Internal faces
|
||||||
// ~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~
|
||||||
|
|
||||||
forAll(mesh.faceNeighbour(), faceI)
|
forAll(mesh.faceNeighbour(), facei)
|
||||||
{
|
{
|
||||||
label ownRegion = cellRegion[mesh.faceOwner()[faceI]];
|
label ownRegion = cellRegion[mesh.faceOwner()[facei]];
|
||||||
label neiRegion = cellRegion[mesh.faceNeighbour()[faceI]];
|
label neiRegion = cellRegion[mesh.faceNeighbour()[facei]];
|
||||||
|
|
||||||
if (ownRegion != neiRegion)
|
if (ownRegion != neiRegion)
|
||||||
{
|
{
|
||||||
addToInterface
|
addToInterface
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
(useFaceZones ? mesh.faceZones().whichZone(faceI) : -1),
|
(useFaceZones ? mesh.faceZones().whichZone(facei) : -1),
|
||||||
ownRegion,
|
ownRegion,
|
||||||
neiRegion,
|
neiRegion,
|
||||||
regionsToSize
|
regionsToSize
|
||||||
@ -355,15 +355,15 @@ void getInterfaceSizes
|
|||||||
|
|
||||||
forAll(coupledRegion, i)
|
forAll(coupledRegion, i)
|
||||||
{
|
{
|
||||||
label cellI = mesh.faceOwner()[i+mesh.nInternalFaces()];
|
label celli = mesh.faceOwner()[i+mesh.nInternalFaces()];
|
||||||
coupledRegion[i] = cellRegion[cellI];
|
coupledRegion[i] = cellRegion[celli];
|
||||||
}
|
}
|
||||||
syncTools::swapBoundaryFaceList(mesh, coupledRegion);
|
syncTools::swapBoundaryFaceList(mesh, coupledRegion);
|
||||||
|
|
||||||
forAll(coupledRegion, i)
|
forAll(coupledRegion, i)
|
||||||
{
|
{
|
||||||
label faceI = i+mesh.nInternalFaces();
|
label facei = i+mesh.nInternalFaces();
|
||||||
label ownRegion = cellRegion[mesh.faceOwner()[faceI]];
|
label ownRegion = cellRegion[mesh.faceOwner()[facei]];
|
||||||
label neiRegion = coupledRegion[i];
|
label neiRegion = coupledRegion[i];
|
||||||
|
|
||||||
if (ownRegion != neiRegion)
|
if (ownRegion != neiRegion)
|
||||||
@ -371,7 +371,7 @@ void getInterfaceSizes
|
|||||||
addToInterface
|
addToInterface
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
(useFaceZones ? mesh.faceZones().whichZone(faceI) : -1),
|
(useFaceZones ? mesh.faceZones().whichZone(facei) : -1),
|
||||||
ownRegion,
|
ownRegion,
|
||||||
neiRegion,
|
neiRegion,
|
||||||
regionsToSize
|
regionsToSize
|
||||||
@ -519,17 +519,17 @@ void getInterfaceSizes
|
|||||||
// Mark all inter-region faces.
|
// Mark all inter-region faces.
|
||||||
faceToInterface.setSize(mesh.nFaces(), -1);
|
faceToInterface.setSize(mesh.nFaces(), -1);
|
||||||
|
|
||||||
forAll(mesh.faceNeighbour(), faceI)
|
forAll(mesh.faceNeighbour(), facei)
|
||||||
{
|
{
|
||||||
label ownRegion = cellRegion[mesh.faceOwner()[faceI]];
|
label ownRegion = cellRegion[mesh.faceOwner()[facei]];
|
||||||
label neiRegion = cellRegion[mesh.faceNeighbour()[faceI]];
|
label neiRegion = cellRegion[mesh.faceNeighbour()[facei]];
|
||||||
|
|
||||||
if (ownRegion != neiRegion)
|
if (ownRegion != neiRegion)
|
||||||
{
|
{
|
||||||
label zoneID = -1;
|
label zoneID = -1;
|
||||||
if (useFaceZones)
|
if (useFaceZones)
|
||||||
{
|
{
|
||||||
zoneID = mesh.faceZones().whichZone(faceI);
|
zoneID = mesh.faceZones().whichZone(facei);
|
||||||
}
|
}
|
||||||
|
|
||||||
edge interface
|
edge interface
|
||||||
@ -538,13 +538,13 @@ void getInterfaceSizes
|
|||||||
max(ownRegion, neiRegion)
|
max(ownRegion, neiRegion)
|
||||||
);
|
);
|
||||||
|
|
||||||
faceToInterface[faceI] = regionsToInterface[interface][zoneID];
|
faceToInterface[facei] = regionsToInterface[interface][zoneID];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
forAll(coupledRegion, i)
|
forAll(coupledRegion, i)
|
||||||
{
|
{
|
||||||
label faceI = i+mesh.nInternalFaces();
|
label facei = i+mesh.nInternalFaces();
|
||||||
label ownRegion = cellRegion[mesh.faceOwner()[faceI]];
|
label ownRegion = cellRegion[mesh.faceOwner()[facei]];
|
||||||
label neiRegion = coupledRegion[i];
|
label neiRegion = coupledRegion[i];
|
||||||
|
|
||||||
if (ownRegion != neiRegion)
|
if (ownRegion != neiRegion)
|
||||||
@ -552,7 +552,7 @@ void getInterfaceSizes
|
|||||||
label zoneID = -1;
|
label zoneID = -1;
|
||||||
if (useFaceZones)
|
if (useFaceZones)
|
||||||
{
|
{
|
||||||
zoneID = mesh.faceZones().whichZone(faceI);
|
zoneID = mesh.faceZones().whichZone(facei);
|
||||||
}
|
}
|
||||||
|
|
||||||
edge interface
|
edge interface
|
||||||
@ -561,7 +561,7 @@ void getInterfaceSizes
|
|||||||
max(ownRegion, neiRegion)
|
max(ownRegion, neiRegion)
|
||||||
);
|
);
|
||||||
|
|
||||||
faceToInterface[faceI] = regionsToInterface[interface][zoneID];
|
faceToInterface[facei] = regionsToInterface[interface][zoneID];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -639,8 +639,8 @@ autoPtr<mapPolyMesh> createRegionMesh
|
|||||||
|
|
||||||
forAll(coupledRegion, i)
|
forAll(coupledRegion, i)
|
||||||
{
|
{
|
||||||
label cellI = mesh.faceOwner()[i+mesh.nInternalFaces()];
|
label celli = mesh.faceOwner()[i+mesh.nInternalFaces()];
|
||||||
coupledRegion[i] = cellRegion[cellI];
|
coupledRegion[i] = cellRegion[celli];
|
||||||
}
|
}
|
||||||
syncTools::swapBoundaryFaceList(mesh, coupledRegion);
|
syncTools::swapBoundaryFaceList(mesh, coupledRegion);
|
||||||
|
|
||||||
@ -662,19 +662,19 @@ autoPtr<mapPolyMesh> createRegionMesh
|
|||||||
labelList exposedPatchIDs(exposedFaces.size());
|
labelList exposedPatchIDs(exposedFaces.size());
|
||||||
forAll(exposedFaces, i)
|
forAll(exposedFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = exposedFaces[i];
|
label facei = exposedFaces[i];
|
||||||
label interfaceI = faceToInterface[faceI];
|
label interfacei = faceToInterface[facei];
|
||||||
|
|
||||||
label ownRegion = cellRegion[mesh.faceOwner()[faceI]];
|
label ownRegion = cellRegion[mesh.faceOwner()[facei]];
|
||||||
label neiRegion = -1;
|
label neiRegion = -1;
|
||||||
|
|
||||||
if (mesh.isInternalFace(faceI))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
neiRegion = cellRegion[mesh.faceNeighbour()[faceI]];
|
neiRegion = cellRegion[mesh.faceNeighbour()[facei]];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
neiRegion = coupledRegion[faceI-mesh.nInternalFaces()];
|
neiRegion = coupledRegion[facei-mesh.nInternalFaces()];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -694,8 +694,8 @@ autoPtr<mapPolyMesh> createRegionMesh
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Exposed face:" << faceI
|
<< "Exposed face:" << facei
|
||||||
<< " fc:" << mesh.faceCentres()[faceI]
|
<< " fc:" << mesh.faceCentres()[facei]
|
||||||
<< " has owner region " << ownRegion
|
<< " has owner region " << ownRegion
|
||||||
<< " and neighbour region " << neiRegion
|
<< " and neighbour region " << neiRegion
|
||||||
<< " when handling region:" << regionI
|
<< " when handling region:" << regionI
|
||||||
@ -705,11 +705,11 @@ autoPtr<mapPolyMesh> createRegionMesh
|
|||||||
// Find the patch.
|
// Find the patch.
|
||||||
if (regionI < otherRegion)
|
if (regionI < otherRegion)
|
||||||
{
|
{
|
||||||
exposedPatchIDs[i] = interfacePatches[interfaceI];
|
exposedPatchIDs[i] = interfacePatches[interfacei];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
exposedPatchIDs[i] = interfacePatches[interfaceI]+1;
|
exposedPatchIDs[i] = interfacePatches[interfacei]+1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -770,10 +770,10 @@ void createAndWriteRegion
|
|||||||
|
|
||||||
// Make map of all added patches
|
// Make map of all added patches
|
||||||
labelHashSet addedPatches(2*interfacePatches.size());
|
labelHashSet addedPatches(2*interfacePatches.size());
|
||||||
forAll(interfacePatches, interfaceI)
|
forAll(interfacePatches, interfacei)
|
||||||
{
|
{
|
||||||
addedPatches.insert(interfacePatches[interfaceI]);
|
addedPatches.insert(interfacePatches[interfacei]);
|
||||||
addedPatches.insert(interfacePatches[interfaceI]+1);
|
addedPatches.insert(interfacePatches[interfacei]+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -968,23 +968,23 @@ void createAndWriteRegion
|
|||||||
),
|
),
|
||||||
newMesh().nFaces()
|
newMesh().nFaces()
|
||||||
);
|
);
|
||||||
forAll(faceProcAddressing, faceI)
|
forAll(faceProcAddressing, facei)
|
||||||
{
|
{
|
||||||
// face + turning index. (see decomposePar)
|
// face + turning index. (see decomposePar)
|
||||||
// Is the face pointing in the same direction?
|
// Is the face pointing in the same direction?
|
||||||
label oldFaceI = map().faceMap()[faceI];
|
label oldFaceI = map().faceMap()[facei];
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
map().cellMap()[newMesh().faceOwner()[faceI]]
|
map().cellMap()[newMesh().faceOwner()[facei]]
|
||||||
== mesh.faceOwner()[oldFaceI]
|
== mesh.faceOwner()[oldFaceI]
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
faceProcAddressing[faceI] = oldFaceI+1;
|
faceProcAddressing[facei] = oldFaceI+1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
faceProcAddressing[faceI] = -(oldFaceI+1);
|
faceProcAddressing[facei] = -(oldFaceI+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Info<< "Writing map " << faceProcAddressing.name()
|
Info<< "Writing map " << faceProcAddressing.name()
|
||||||
@ -1138,11 +1138,11 @@ label findCorrespondingRegion
|
|||||||
// Per region the number of cells in zoneI
|
// Per region the number of cells in zoneI
|
||||||
labelList cellsInZone(nCellRegions, 0);
|
labelList cellsInZone(nCellRegions, 0);
|
||||||
|
|
||||||
forAll(cellRegion, cellI)
|
forAll(cellRegion, celli)
|
||||||
{
|
{
|
||||||
if (existingZoneID[cellI] == zoneI)
|
if (existingZoneID[celli] == zoneI)
|
||||||
{
|
{
|
||||||
cellsInZone[cellRegion[cellI]]++;
|
cellsInZone[cellRegion[celli]]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1161,11 +1161,11 @@ label findCorrespondingRegion
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Check that region contains no cells that aren't in cellZone.
|
// Check that region contains no cells that aren't in cellZone.
|
||||||
forAll(cellRegion, cellI)
|
forAll(cellRegion, celli)
|
||||||
{
|
{
|
||||||
if (cellRegion[cellI] == regionI && existingZoneID[cellI] != zoneI)
|
if (cellRegion[celli] == regionI && existingZoneID[celli] != zoneI)
|
||||||
{
|
{
|
||||||
// cellI in regionI but not in zoneI
|
// celli in regionI but not in zoneI
|
||||||
regionI = -1;
|
regionI = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1200,18 +1200,18 @@ void getZoneID
|
|||||||
|
|
||||||
forAll(cz, i)
|
forAll(cz, i)
|
||||||
{
|
{
|
||||||
label cellI = cz[i];
|
label celli = cz[i];
|
||||||
if (zoneID[cellI] == -1)
|
if (zoneID[celli] == -1)
|
||||||
{
|
{
|
||||||
zoneID[cellI] = zoneI;
|
zoneID[celli] = zoneI;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Cell " << cellI << " with cell centre "
|
<< "Cell " << celli << " with cell centre "
|
||||||
<< mesh.cellCentres()[cellI]
|
<< mesh.cellCentres()[celli]
|
||||||
<< " is multiple zones. This is not allowed." << endl
|
<< " is multiple zones. This is not allowed." << endl
|
||||||
<< "It is in zone " << cellZones[zoneID[cellI]].name()
|
<< "It is in zone " << cellZones[zoneID[celli]].name()
|
||||||
<< " and in zone " << cellZones[zoneI].name()
|
<< " and in zone " << cellZones[zoneI].name()
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
@ -1386,9 +1386,9 @@ void writeCellToRegion(const fvMesh& mesh, const labelList& cellRegion)
|
|||||||
dimensionedScalar("zero", dimless, 0),
|
dimensionedScalar("zero", dimless, 0),
|
||||||
zeroGradientFvPatchScalarField::typeName
|
zeroGradientFvPatchScalarField::typeName
|
||||||
);
|
);
|
||||||
forAll(cellRegion, cellI)
|
forAll(cellRegion, celli)
|
||||||
{
|
{
|
||||||
cellToRegion[cellI] = cellRegion[cellI];
|
cellToRegion[celli] = cellRegion[celli];
|
||||||
}
|
}
|
||||||
cellToRegion.write();
|
cellToRegion.write();
|
||||||
|
|
||||||
@ -1662,25 +1662,25 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
blockedFace.setSize(mesh.nFaces(), false);
|
blockedFace.setSize(mesh.nFaces(), false);
|
||||||
|
|
||||||
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
|
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||||
{
|
{
|
||||||
label own = mesh.faceOwner()[faceI];
|
label own = mesh.faceOwner()[facei];
|
||||||
label nei = mesh.faceNeighbour()[faceI];
|
label nei = mesh.faceNeighbour()[facei];
|
||||||
|
|
||||||
if (zoneID[own] != zoneID[nei])
|
if (zoneID[own] != zoneID[nei])
|
||||||
{
|
{
|
||||||
blockedFace[faceI] = true;
|
blockedFace[facei] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Different cellZones on either side of processor patch.
|
// Different cellZones on either side of processor patch.
|
||||||
forAll(neiZoneID, i)
|
forAll(neiZoneID, i)
|
||||||
{
|
{
|
||||||
label faceI = i+mesh.nInternalFaces();
|
label facei = i+mesh.nInternalFaces();
|
||||||
|
|
||||||
if (zoneID[mesh.faceOwner()[faceI]] != neiZoneID[i])
|
if (zoneID[mesh.faceOwner()[facei]] != neiZoneID[i])
|
||||||
{
|
{
|
||||||
blockedFace[faceI] = true;
|
blockedFace[facei] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1740,9 +1740,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
labelList regionSizes(nCellRegions, 0);
|
labelList regionSizes(nCellRegions, 0);
|
||||||
|
|
||||||
forAll(cellRegion, cellI)
|
forAll(cellRegion, celli)
|
||||||
{
|
{
|
||||||
regionSizes[cellRegion[cellI]]++;
|
regionSizes[cellRegion[celli]]++;
|
||||||
}
|
}
|
||||||
forAll(regionSizes, regionI)
|
forAll(regionSizes, regionI)
|
||||||
{
|
{
|
||||||
@ -1992,14 +1992,14 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
(void)mesh.tetBasePtIs();
|
(void)mesh.tetBasePtIs();
|
||||||
|
|
||||||
label cellI = mesh.findCell(insidePoint);
|
label celli = mesh.findCell(insidePoint);
|
||||||
|
|
||||||
Info<< nl << "Found point " << insidePoint << " in cell " << cellI
|
Info<< nl << "Found point " << insidePoint << " in cell " << celli
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
if (cellI != -1)
|
if (celli != -1)
|
||||||
{
|
{
|
||||||
regionI = cellRegion[cellI];
|
regionI = cellRegion[celli];
|
||||||
}
|
}
|
||||||
|
|
||||||
reduce(regionI, maxOp<label>());
|
reduce(regionI, maxOp<label>());
|
||||||
|
|||||||
@ -12,11 +12,11 @@
|
|||||||
{
|
{
|
||||||
const labelList& curFaceAddr = faceProcAddressing[procI];
|
const labelList& curFaceAddr = faceProcAddressing[procI];
|
||||||
|
|
||||||
forAll(curFaceAddr, faceI)
|
forAll(curFaceAddr, facei)
|
||||||
{
|
{
|
||||||
if (mag(curFaceAddr[faceI]) < minFaceIndex)
|
if (mag(curFaceAddr[facei]) < minFaceIndex)
|
||||||
{
|
{
|
||||||
minFaceIndex = mag(curFaceAddr[faceI]);
|
minFaceIndex = mag(curFaceAddr[facei]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -37,9 +37,9 @@
|
|||||||
{
|
{
|
||||||
labelList& curFaceAddr = faceProcAddressing[procI];
|
labelList& curFaceAddr = faceProcAddressing[procI];
|
||||||
|
|
||||||
forAll(curFaceAddr, faceI)
|
forAll(curFaceAddr, facei)
|
||||||
{
|
{
|
||||||
curFaceAddr[faceI] += sign(curFaceAddr[faceI]);
|
curFaceAddr[facei] += sign(curFaceAddr[facei]);
|
||||||
}
|
}
|
||||||
|
|
||||||
faceProcAddressing[procI].write();
|
faceProcAddressing[procI].write();
|
||||||
|
|||||||
@ -404,9 +404,9 @@ void writeCellDistance
|
|||||||
zeroGradientFvPatchScalarField::typeName
|
zeroGradientFvPatchScalarField::typeName
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(cellDecomposition, cellI)
|
forAll(cellDecomposition, celli)
|
||||||
{
|
{
|
||||||
cellDist[cellI] = cellDecomposition[cellI];
|
cellDist[celli] = cellDecomposition[celli];
|
||||||
}
|
}
|
||||||
|
|
||||||
cellDist.write();
|
cellDist.write();
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user