mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: polyMeshTetDecomposition: restore face centre tet decomposition
This commit is contained in:
@ -380,11 +380,11 @@ bool Foam::polyMeshTetDecomposition::checkFaceTets
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
const labelList& own = mesh.faceOwner();
|
const labelList& own = mesh.faceOwner();
|
||||||
// const labelList& nei = mesh.faceNeighbour();
|
const labelList& nei = mesh.faceNeighbour();
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
const vectorField& cc = mesh.cellCentres();
|
const vectorField& cc = mesh.cellCentres();
|
||||||
// const vectorField& fc = mesh.faceCentres();
|
const vectorField& fc = mesh.faceCentres();
|
||||||
|
|
||||||
// Calculate coupled cell centre
|
// Calculate coupled cell centre
|
||||||
pointField neiCc(mesh.nFaces() - mesh.nInternalFaces());
|
pointField neiCc(mesh.nFaces() - mesh.nInternalFaces());
|
||||||
@ -398,62 +398,62 @@ bool Foam::polyMeshTetDecomposition::checkFaceTets
|
|||||||
|
|
||||||
const faceList& fcs = mesh.faces();
|
const faceList& fcs = mesh.faces();
|
||||||
|
|
||||||
// const pointField& p = mesh.points();
|
const pointField& p = mesh.points();
|
||||||
|
|
||||||
label nErrorTets = 0;
|
label nErrorTets = 0;
|
||||||
|
|
||||||
forAll(fcs, faceI)
|
forAll(fcs, faceI)
|
||||||
{
|
{
|
||||||
// const face& f = fcs[faceI];
|
const face& f = fcs[faceI];
|
||||||
|
|
||||||
// forAll(f, fPtI)
|
forAll(f, fPtI)
|
||||||
// {
|
{
|
||||||
// scalar tetQual = tetPointRef
|
scalar tetQual = tetPointRef
|
||||||
// (
|
(
|
||||||
// p[f[fPtI]],
|
p[f[fPtI]],
|
||||||
// p[f.nextLabel(fPtI)],
|
p[f.nextLabel(fPtI)],
|
||||||
// fc[faceI],
|
fc[faceI],
|
||||||
// cc[own[faceI]]
|
cc[own[faceI]]
|
||||||
// ).quality();
|
).quality();
|
||||||
|
|
||||||
// if (tetQual > -tol)
|
if (tetQual > -tol)
|
||||||
// {
|
{
|
||||||
// if (setPtr)
|
if (setPtr)
|
||||||
// {
|
{
|
||||||
// setPtr->insert(faceI);
|
setPtr->insert(faceI);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// nErrorTets++;
|
nErrorTets++;
|
||||||
// break; // no need to check other tets
|
break; // no need to check other tets
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
if (mesh.isInternalFace(faceI))
|
if (mesh.isInternalFace(faceI))
|
||||||
{
|
{
|
||||||
// Create the neighbour tet - it will have positive volume
|
// Create the neighbour tet - it will have positive volume
|
||||||
// const face& f = fcs[faceI];
|
const face& f = fcs[faceI];
|
||||||
|
|
||||||
// forAll(f, fPtI)
|
forAll(f, fPtI)
|
||||||
// {
|
{
|
||||||
// scalar tetQual = tetPointRef
|
scalar tetQual = tetPointRef
|
||||||
// (
|
(
|
||||||
// p[f[fPtI]],
|
p[f[fPtI]],
|
||||||
// p[f.nextLabel(fPtI)],
|
p[f.nextLabel(fPtI)],
|
||||||
// fc[faceI],
|
fc[faceI],
|
||||||
// cc[nei[faceI]]
|
cc[nei[faceI]]
|
||||||
// ).quality();
|
).quality();
|
||||||
|
|
||||||
// if (tetQual < tol)
|
if (tetQual < tol)
|
||||||
// {
|
{
|
||||||
// if (setPtr)
|
if (setPtr)
|
||||||
// {
|
{
|
||||||
// setPtr->insert(faceI);
|
setPtr->insert(faceI);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// nErrorTets++;
|
nErrorTets++;
|
||||||
// break;
|
break;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
if (findSharedBasePoint(mesh, faceI, tol, report) == -1)
|
if (findSharedBasePoint(mesh, faceI, tol, report) == -1)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -309,6 +309,7 @@ Foam::scalar Foam::polyMeshGeometry::calcSkewness
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Create the neighbour pyramid - it will have positive volume
|
||||||
bool Foam::polyMeshGeometry::checkFaceTet
|
bool Foam::polyMeshGeometry::checkFaceTet
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
@ -787,7 +788,7 @@ bool Foam::polyMeshGeometry::checkFaceTets
|
|||||||
// check whether decomposing each cell into tets results in
|
// check whether decomposing each cell into tets results in
|
||||||
// positive volume, non-flat tets
|
// positive volume, non-flat tets
|
||||||
const labelList& own = mesh.faceOwner();
|
const labelList& own = mesh.faceOwner();
|
||||||
// const labelList& nei = mesh.faceNeighbour();
|
const labelList& nei = mesh.faceNeighbour();
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
// Calculate coupled cell centre
|
// Calculate coupled cell centre
|
||||||
@ -802,50 +803,48 @@ bool Foam::polyMeshGeometry::checkFaceTets
|
|||||||
|
|
||||||
label nErrorTets = 0;
|
label nErrorTets = 0;
|
||||||
|
|
||||||
// bool tetError = false
|
|
||||||
|
|
||||||
forAll(checkFaces, i)
|
forAll(checkFaces, i)
|
||||||
{
|
{
|
||||||
label faceI = checkFaces[i];
|
label faceI = checkFaces[i];
|
||||||
|
|
||||||
// Create the owner pyramid - note: exchange cell and face centre
|
// Create the owner pyramid - note: exchange cell and face centre
|
||||||
// to get positive volume.
|
// to get positive volume.
|
||||||
// tetError = checkFaceTet
|
bool tetError = checkFaceTet
|
||||||
// (
|
(
|
||||||
// mesh,
|
mesh,
|
||||||
// report,
|
report,
|
||||||
// minTetQuality,
|
minTetQuality,
|
||||||
// p,
|
p,
|
||||||
// faceI,
|
faceI,
|
||||||
// cellCentres[own[faceI]], // face centre
|
cellCentres[own[faceI]], // face centre
|
||||||
// faceCentres[faceI], // cell centre
|
faceCentres[faceI], // cell centre
|
||||||
// setPtr
|
setPtr
|
||||||
// );
|
);
|
||||||
|
|
||||||
// if (tetError)
|
if (tetError)
|
||||||
// {
|
{
|
||||||
// nErrorTets++;
|
nErrorTets++;
|
||||||
// }
|
}
|
||||||
|
|
||||||
if (mesh.isInternalFace(faceI))
|
if (mesh.isInternalFace(faceI))
|
||||||
{
|
{
|
||||||
// Create the neighbour tets - they will have positive volume
|
// Create the neighbour tets - they will have positive volume
|
||||||
// tetError = checkFaceTet
|
bool tetError = checkFaceTet
|
||||||
// (
|
(
|
||||||
// mesh,
|
mesh,
|
||||||
// report,
|
report,
|
||||||
// minTetQuality,
|
minTetQuality,
|
||||||
// p,
|
p,
|
||||||
// faceI,
|
faceI,
|
||||||
// faceCentres[faceI], // face centre
|
faceCentres[faceI], // face centre
|
||||||
// cellCentres[nei[faceI]], // cell centre
|
cellCentres[nei[faceI]], // cell centre
|
||||||
// setPtr
|
setPtr
|
||||||
// );
|
);
|
||||||
|
|
||||||
// if (tetError)
|
if (tetError)
|
||||||
// {
|
{
|
||||||
// nErrorTets++;
|
nErrorTets++;
|
||||||
// }
|
}
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
@ -921,40 +920,40 @@ bool Foam::polyMeshGeometry::checkFaceTets
|
|||||||
label face0 = baffles[i].first();
|
label face0 = baffles[i].first();
|
||||||
label face1 = baffles[i].second();
|
label face1 = baffles[i].second();
|
||||||
|
|
||||||
// tetError = checkFaceTet
|
bool tetError = checkFaceTet
|
||||||
// (
|
(
|
||||||
// mesh,
|
mesh,
|
||||||
// report,
|
report,
|
||||||
// minTetQuality,
|
minTetQuality,
|
||||||
// p,
|
p,
|
||||||
// face0,
|
face0,
|
||||||
// cellCentres[own[face0]], // face centre
|
cellCentres[own[face0]], // face centre
|
||||||
// faceCentres[face0], // cell centre
|
faceCentres[face0], // cell centre
|
||||||
// setPtr
|
setPtr
|
||||||
// );
|
);
|
||||||
|
|
||||||
// if (tetError)
|
if (tetError)
|
||||||
// {
|
{
|
||||||
// nErrorTets++;
|
nErrorTets++;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// // Create the neighbour tets - they will have positive volume
|
// Create the neighbour tets - they will have positive volume
|
||||||
// tetError = checkFaceTet
|
tetError = checkFaceTet
|
||||||
// (
|
(
|
||||||
// mesh,
|
mesh,
|
||||||
// report,
|
report,
|
||||||
// minTetQuality,
|
minTetQuality,
|
||||||
// p,
|
p,
|
||||||
// face0,
|
face0,
|
||||||
// faceCentres[face0], // face centre
|
faceCentres[face0], // face centre
|
||||||
// cellCentres[own[face1]], // cell centre
|
cellCentres[own[face1]], // cell centre
|
||||||
// setPtr
|
setPtr
|
||||||
// );
|
);
|
||||||
|
|
||||||
// if (tetError)
|
if (tetError)
|
||||||
// {
|
{
|
||||||
// nErrorTets++;
|
nErrorTets++;
|
||||||
// }
|
}
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user