merge patch faces only on meshed patches

This commit is contained in:
mattijs
2008-05-22 13:34:37 +01:00
parent 628c19fa63
commit 0edb41f45e
6 changed files with 83 additions and 26 deletions

View File

@ -1183,7 +1183,8 @@ void Foam::autoHexMeshDriver::mergePatchFaces()
meshRefiner.mergePatchFaces meshRefiner.mergePatchFaces
( (
Foam::cos(45*mathematicalConstant::pi/180.0), Foam::cos(45*mathematicalConstant::pi/180.0),
Foam::cos(45*mathematicalConstant::pi/180.0) Foam::cos(45*mathematicalConstant::pi/180.0),
meshRefinement::addedPatches(globalToPatch_)
); );
if (debug_) if (debug_)

View File

@ -62,7 +62,15 @@ Foam::label Foam::autoHexMeshDriver::mergePatchFacesUndo
combineFaces faceCombiner(mesh_, true); combineFaces faceCombiner(mesh_, true);
// Get all sets of faces that can be merged // Get all sets of faces that can be merged
labelListList allFaceSets(faceCombiner.getMergeSets(minCos, concaveCos)); labelListList allFaceSets
(
faceCombiner.getMergeSets
(
minCos,
concaveCos,
meshRefinement::addedPatches(globalToPatch_)
)
);
label nFaceSets = returnReduce(allFaceSets.size(), sumOp<label>()); label nFaceSets = returnReduce(allFaceSets.size(), sumOp<label>());

View File

@ -607,9 +607,8 @@ public:
label mergePatchFaces label mergePatchFaces
( (
const scalar minCos, const scalar minCos,
const scalar concaveCos const scalar concaveCos,
//const dictionary& motionDict, const labelList& patchIDs
//const labelList& globalToPatch
); );
//- Remove points not used by any face or points used //- Remove points not used by any face or points used

View File

@ -48,14 +48,43 @@ Class
Foam::label Foam::meshRefinement::mergePatchFaces Foam::label Foam::meshRefinement::mergePatchFaces
( (
const scalar minCos, const scalar minCos,
const scalar concaveCos const scalar concaveCos,
const labelList& patchIDs
) )
{ {
// Patch face merging engine // Patch face merging engine
combineFaces faceCombiner(mesh_); combineFaces faceCombiner(mesh_);
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
// Pick up all cells on boundary
labelHashSet boundaryCells(mesh_.nFaces()-mesh_.nInternalFaces());
forAll(patchIDs, i)
{
label patchI = patchIDs[i];
const polyPatch& patch = patches[patchI];
if (!patch.coupled())
{
forAll(patch, i)
{
boundaryCells.insert(mesh_.faceOwner()[patch.start()+i]);
}
}
}
// Get all sets of faces that can be merged // Get all sets of faces that can be merged
labelListList mergeSets(faceCombiner.getMergeSets(minCos, concaveCos)); labelListList mergeSets
(
faceCombiner.getMergeSets
(
minCos,
concaveCos,
boundaryCells
)
);
label nFaceSets = returnReduce(mergeSets.size(), sumOp<label>()); label nFaceSets = returnReduce(mergeSets.size(), sumOp<label>());

View File

@ -293,27 +293,10 @@ Foam::combineFaces::combineFaces
Foam::labelListList Foam::combineFaces::getMergeSets Foam::labelListList Foam::combineFaces::getMergeSets
( (
const scalar featureCos, const scalar featureCos,
const scalar minConcaveCos const scalar minConcaveCos,
const labelHashSet& boundaryCells
) const ) const
{ {
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
// Pick up all cells on boundary
labelHashSet boundaryCells(mesh_.nFaces()-mesh_.nInternalFaces());
forAll(patches, patchI)
{
const polyPatch& patch = patches[patchI];
if (!patch.coupled())
{
forAll(patch, i)
{
boundaryCells.insert(mesh_.faceOwner()[patch.start()+i]);
}
}
}
// Lists of faces that can be merged. // Lists of faces that can be merged.
DynamicList<labelList> allFaceSets(boundaryCells.size() / 10); DynamicList<labelList> allFaceSets(boundaryCells.size() / 10);
@ -387,6 +370,34 @@ Foam::labelListList Foam::combineFaces::getMergeSets
} }
Foam::labelListList Foam::combineFaces::getMergeSets
(
const scalar featureCos,
const scalar minConcaveCos
) const
{
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
// Pick up all cells on boundary
labelHashSet boundaryCells(mesh_.nFaces()-mesh_.nInternalFaces());
forAll(patches, patchI)
{
const polyPatch& patch = patches[patchI];
if (!patch.coupled())
{
forAll(patch, i)
{
boundaryCells.insert(mesh_.faceOwner()[patch.start()+i]);
}
}
}
return getMergeSets(featureCos, minConcaveCos, boundaryCells);
}
// Gets outside edgeloop as a face // Gets outside edgeloop as a face
// - in same order as faces // - in same order as faces
// - in mesh vertex labels // - in mesh vertex labels

View File

@ -152,6 +152,15 @@ public:
// Helper functions // Helper functions
//- Extract lists of all (non-coupled) boundary faces on selected
// cells that can be merged. Uses getFaceRegions.
labelListList getMergeSets
(
const scalar featureCos,
const scalar minConcaveCos,
const labelHashSet& boundaryCells
) const;
//- Extract lists of all (non-coupled) boundary faces that can //- Extract lists of all (non-coupled) boundary faces that can
// be merged. Uses getFaceRegions. // be merged. Uses getFaceRegions.
labelListList getMergeSets labelListList getMergeSets