ENH: rolling back WIP on face filtering.

This commit is contained in:
graham
2011-06-29 11:19:27 +01:00
parent 68b591cee1
commit bd87fc30a4
3 changed files with 131 additions and 178 deletions

View File

@ -67,7 +67,6 @@ SourceFiles
#include "wallPolyPatch.H" #include "wallPolyPatch.H"
#include "processorPolyPatch.H" #include "processorPolyPatch.H"
#include "zeroGradientFvPatchFields.H" #include "zeroGradientFvPatchFields.H"
#include "globalIndex.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -780,8 +779,7 @@ private:
void indexDualVertices void indexDualVertices
( (
pointField& pts, pointField& pts,
PackedBoolList& boundaryPts, PackedBoolList& boundaryPts
const globalIndex& globalParallelPointIndices
); );
//- Re-index all of the the Delaunay cells //- Re-index all of the the Delaunay cells

View File

@ -58,90 +58,73 @@ void Foam::conformalVoronoiMesh::calcDualMesh
++cit ++cit
) )
{ {
if
(
!cit->vertex(0)->real()
|| !cit->vertex(1)->real()
|| !cit->vertex(2)->real()
|| !cit->vertex(3)->real()
)
{
cit->filterCount() = 100;
}
else
{
cit->filterCount() = 0; cit->filterCount() = 0;
}
} }
// for for
// ( (
// Delaunay::Finite_cells_iterator cit = finite_cells_begin(); Delaunay::Finite_vertices_iterator vit = finite_vertices_begin();
// cit != finite_cells_end(); vit != finite_vertices_end();
// ++cit vit++
// ) )
// { {
// if std::list<Cell_handle> cells;
// ( incident_cells(vit, std::back_inserter(cells));
// !cit->vertex(0)->real()
// || !cit->vertex(1)->real()
// || !cit->vertex(2)->real()
// || !cit->vertex(3)->real()
// )
// {
// cit->filterCount() = 100;
// }
// else
// {
// cit->filterCount() = 0;
// }
// }
// for bool hasProcPt = false;
// (
// Delaunay::Finite_vertices_iterator vit = finite_vertices_begin();
// vit != finite_vertices_end();
// vit++
// )
// {
// std::list<Cell_handle> cells;
// incident_cells(vit, std::back_inserter(cells));
// bool hasProcPt = false; for
(
std::list<Cell_handle>::iterator cit=cells.begin();
cit != cells.end();
++cit
)
{
if
(
!(*cit)->vertex(0)->real()
|| !(*cit)->vertex(1)->real()
|| !(*cit)->vertex(2)->real()
|| !(*cit)->vertex(3)->real()
)
{
hasProcPt = true;
// for break;
// ( }
// std::list<Cell_handle>::iterator cit=cells.begin(); }
// cit != cells.end();
// ++cit
// )
// {
// if
// (
// !(*cit)->vertex(0)->real()
// || !(*cit)->vertex(1)->real()
// || !(*cit)->vertex(2)->real()
// || !(*cit)->vertex(3)->real()
// )
// {
// hasProcPt = true;
// break; if (hasProcPt)
// } {
// } for
(
// if (hasProcPt) std::list<Cell_handle>::iterator cit=cells.begin();
// { cit != cells.end();
// for ++cit
// ( )
// std::list<Cell_handle>::iterator cit=cells.begin(); {
// cit != cells.end(); (*cit)->filterCount() = 100;
// ++cit }
// ) }
// { }
// (*cit)->filterCount() = 100;
// }
// }
// }
PackedBoolList boundaryPts(number_of_cells(), false); PackedBoolList boundaryPts(number_of_cells(), false);
globalIndex globalParallelPointIndices(number_of_cells()); indexDualVertices(points, boundaryPts);
indexDualVertices
(
points,
boundaryPts,
globalParallelPointIndices
);
{ {
// Ideally requires a no-risk face filtering to get rid of zero area // Ideally requires a no-risk face filtering to get rid of zero area
@ -199,12 +182,7 @@ void Foam::conformalVoronoiMesh::calcDualMesh
// Reindexing the Delaunay cells and regenerating the // Reindexing the Delaunay cells and regenerating the
// points resets the mesh to the starting condition. // points resets the mesh to the starting condition.
indexDualVertices indexDualVertices(points, boundaryPts);
(
points,
boundaryPts,
globalParallelPointIndices
);
{ {
Info<< nl << "Merging close points" << endl; Info<< nl << "Merging close points" << endl;
@ -1551,65 +1529,65 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::checkPolyMeshQuality
List<polyPatch*> patches(patchStarts.size()); List<polyPatch*> patches(patchStarts.size());
// label nValidPatches = 0; label nValidPatches = 0;
// forAll(patches, p)
// {
// if (patchTypes[p] == processorPolyPatch::typeName)
// {
// // Do not create empty processor patches
// if (patchSizes[p] > 0)
// {
// patches[nValidPatches] = new processorPolyPatch
// (
// patchNames[p],
// patchSizes[p],
// patchStarts[p],
// nValidPatches,
// pMesh.boundaryMesh(),
// Pstream::myProcNo(),
// procNeighbours[p]
// );
// nValidPatches++;
// }
// }
// else
// {
// patches[nValidPatches] = polyPatch::New
// (
// patchTypes[p],
// patchNames[p],
// patchSizes[p],
// patchStarts[p],
// nValidPatches,
// pMesh.boundaryMesh()
// ).ptr();
// nValidPatches++;
// }
// }
// patches.setSize(nValidPatches);
// pMesh.addPatches(patches);
Info<< "ADDPATCHES NOT IN PARALLEL" << endl;
forAll(patches, p) forAll(patches, p)
{ {
patches[p] = new polyPatch if (patchTypes[p] == processorPolyPatch::typeName)
( {
patchNames[p], // Do not create empty processor patches
patchSizes[p],
patchStarts[p], if (patchSizes[p] > 0)
p, {
pMesh.boundaryMesh() patches[nValidPatches] = new processorPolyPatch
); (
patchNames[p],
patchSizes[p],
patchStarts[p],
nValidPatches,
pMesh.boundaryMesh(),
Pstream::myProcNo(),
procNeighbours[p]
);
nValidPatches++;
}
}
else
{
patches[nValidPatches] = polyPatch::New
(
patchTypes[p],
patchNames[p],
patchSizes[p],
patchStarts[p],
nValidPatches,
pMesh.boundaryMesh()
).ptr();
nValidPatches++;
}
} }
pMesh.addPatches(patches, false); patches.setSize(nValidPatches);
pMesh.addPatches(patches);
// Info<< "ADDPATCHES NOT IN PARALLEL" << endl;
// forAll(patches, p)
// {
// patches[p] = new polyPatch
// (
// patchNames[p],
// patchSizes[p],
// patchStarts[p],
// p,
// pMesh.boundaryMesh()
// );
// }
// pMesh.addPatches(patches, false);
// pMesh.overrideCellCentres(cellCentres); // pMesh.overrideCellCentres(cellCentres);
@ -1807,8 +1785,7 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::checkPolyMeshQuality
void Foam::conformalVoronoiMesh::indexDualVertices void Foam::conformalVoronoiMesh::indexDualVertices
( (
pointField& pts, pointField& pts,
PackedBoolList& boundaryPts, PackedBoolList& boundaryPts
const globalIndex& globalParallelPointIndices
) )
{ {
// Indexing Delaunay cells, which are the dual vertices // Indexing Delaunay cells, which are the dual vertices
@ -1821,16 +1798,6 @@ void Foam::conformalVoronoiMesh::indexDualVertices
boundaryPts = false; boundaryPts = false;
OFstream tetStr
(
runTime_.path()
/"processor_"
+ name(Pstream::myProcNo())
+ "_parallelTets.obj"
);
label pTetI = 0;
for for
( (
Delaunay::Finite_cells_iterator cit = finite_cells_begin(); Delaunay::Finite_cells_iterator cit = finite_cells_begin();
@ -1840,35 +1807,23 @@ void Foam::conformalVoronoiMesh::indexDualVertices
{ {
if (cit->internalOrBoundaryDualVertex()) if (cit->internalOrBoundaryDualVertex())
{ {
if (cit->parallelDualVertex()) cit->cellIndex() = dualVertI;
{
cit->cellIndex() = globalParallelPointIndices.toGlobal
(
dualVertI
);
drawDelaunayCell(tetStr, cit, pTetI++);
}
else
{
cit->cellIndex() = dualVertI;
if
(
!cit->vertex(0)->internalOrBoundaryPoint()
|| !cit->vertex(1)->internalOrBoundaryPoint()
|| !cit->vertex(2)->internalOrBoundaryPoint()
|| !cit->vertex(3)->internalOrBoundaryPoint()
)
{
// This is a boundary dual vertex
boundaryPts[dualVertI] = true;
}
}
pts[dualVertI] = topoint(dual(cit)); pts[dualVertI] = topoint(dual(cit));
if
(
!cit->vertex(0)->internalOrBoundaryPoint()
|| !cit->vertex(1)->internalOrBoundaryPoint()
|| !cit->vertex(2)->internalOrBoundaryPoint()
|| !cit->vertex(3)->internalOrBoundaryPoint()
)
{
// This is a boundary dual vertex
boundaryPts[dualVertI] = true;
}
dualVertI++; dualVertI++;
} }
else else

View File

@ -423,10 +423,10 @@ void Foam::conformalVoronoiMesh::writeMesh
patches.setSize(nValidPatches); patches.setSize(nValidPatches);
// mesh.addFvPatches(patches); mesh.addFvPatches(patches);
Info<< "ADDPATCHES NOT IN PARALLEL" << endl; // Info<< "ADDPATCHES NOT IN PARALLEL" << endl;
mesh.addFvPatches(patches, false); // mesh.addFvPatches(patches, false);
if (!mesh.write()) if (!mesh.write())
{ {
@ -456,7 +456,7 @@ void Foam::conformalVoronoiMesh::writeMesh
// cellCs.write(); // cellCs.write();
// writeCellSizes(mesh); writeCellSizes(mesh);
findRemainingProtrusionSet(mesh); findRemainingProtrusionSet(mesh);
} }