mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
merge patch faces only on meshed patches
This commit is contained in:
@ -1183,7 +1183,8 @@ void Foam::autoHexMeshDriver::mergePatchFaces()
|
||||
meshRefiner.mergePatchFaces
|
||||
(
|
||||
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_)
|
||||
|
||||
@ -62,7 +62,15 @@ Foam::label Foam::autoHexMeshDriver::mergePatchFacesUndo
|
||||
combineFaces faceCombiner(mesh_, true);
|
||||
|
||||
// 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>());
|
||||
|
||||
|
||||
@ -607,9 +607,8 @@ public:
|
||||
label mergePatchFaces
|
||||
(
|
||||
const scalar minCos,
|
||||
const scalar concaveCos
|
||||
//const dictionary& motionDict,
|
||||
//const labelList& globalToPatch
|
||||
const scalar concaveCos,
|
||||
const labelList& patchIDs
|
||||
);
|
||||
|
||||
//- Remove points not used by any face or points used
|
||||
|
||||
@ -48,14 +48,43 @@ Class
|
||||
Foam::label Foam::meshRefinement::mergePatchFaces
|
||||
(
|
||||
const scalar minCos,
|
||||
const scalar concaveCos
|
||||
const scalar concaveCos,
|
||||
const labelList& patchIDs
|
||||
)
|
||||
{
|
||||
// Patch face merging engine
|
||||
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
|
||||
labelListList mergeSets(faceCombiner.getMergeSets(minCos, concaveCos));
|
||||
labelListList mergeSets
|
||||
(
|
||||
faceCombiner.getMergeSets
|
||||
(
|
||||
minCos,
|
||||
concaveCos,
|
||||
boundaryCells
|
||||
)
|
||||
);
|
||||
|
||||
label nFaceSets = returnReduce(mergeSets.size(), sumOp<label>());
|
||||
|
||||
|
||||
@ -293,27 +293,10 @@ Foam::combineFaces::combineFaces
|
||||
Foam::labelListList Foam::combineFaces::getMergeSets
|
||||
(
|
||||
const scalar featureCos,
|
||||
const scalar minConcaveCos
|
||||
const scalar minConcaveCos,
|
||||
const labelHashSet& boundaryCells
|
||||
) 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.
|
||||
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
|
||||
// - in same order as faces
|
||||
// - in mesh vertex labels
|
||||
|
||||
@ -152,6 +152,15 @@ public:
|
||||
|
||||
// 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
|
||||
// be merged. Uses getFaceRegions.
|
||||
labelListList getMergeSets
|
||||
|
||||
Reference in New Issue
Block a user