ENH: cvMesh: detect and remove indirect patch faces

Find patch faces that do not result from point pairs and aggressively delete
This commit is contained in:
laurence
2013-01-04 14:33:23 +00:00
parent 45ce8ab68d
commit d722378fc4
10 changed files with 375 additions and 98 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -70,6 +70,12 @@ int main(int argc, char *argv[])
"Collapse small and sliver faces as well as small edges"
);
argList::addBoolOption
(
"collapseIndirectPatchFaces",
"Collapse faces that are in the face zone indirectPatchFaces"
);
# include "addOverwriteOption.H"
# include "setRootCase.H"
# include "createTime.H"
@ -84,6 +90,8 @@ int main(int argc, char *argv[])
const bool overwrite = args.optionFound("overwrite");
const bool collapseFaces = args.optionFound("collapseFaces");
const bool collapseIndirectPatchFaces =
args.optionFound("collapseIndirectPatchFaces");
forAll(timeDirs, timeI)
{
@ -105,6 +113,18 @@ int main(int argc, char *argv[])
meshMod.changeMesh(mesh, false);
}
if (collapseIndirectPatchFaces)
{
// Filter faces. Pass in the number of bad faces that are present
// from the previous edge filtering to use as a stopping criterion.
meshFilter.filterIndirectPatchFaces();
{
polyTopoChange meshMod(newMesh);
meshMod.changeMesh(mesh, false);
}
}
if (collapseFaces)
{
// Filter faces. Pass in the number of bad faces that are present

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -73,11 +73,7 @@ void Foam::PrintTable<KeyType, DataType>::print
{
HashTable<HashTable<DataType, label>, KeyType> combinedTable;
List<HashTable<DataType, KeyType> > procData
(
Pstream::nProcs(),
HashTable<DataType, KeyType>()
);
List<HashTableData> procData(Pstream::nProcs(), HashTableData());
procData[Pstream::myProcNo()] = table_;
@ -92,13 +88,11 @@ void Foam::PrintTable<KeyType, DataType>::print
forAll(procData, procI)
{
const HashTable<DataType, KeyType>& procIData
= procData[procI];
const HashTableData& procIData = procData[procI];
for
(
typename HashTable<DataType, KeyType>
::const_iterator iter = procIData.begin();
typename HashTableData::const_iterator iter = procIData.begin();
iter != procIData.end();
++iter
)
@ -112,8 +106,7 @@ void Foam::PrintTable<KeyType, DataType>::print
);
}
HashTable<DataType, label>& key
= combinedTable[iter.key()];
HashTable<DataType, label>& key = combinedTable[iter.key()];
key.insert(procI, iter());

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -68,10 +68,13 @@ namespace Foam
template<class KeyType, class DataType>
class PrintTable
{
typedef HashTable<DataType, KeyType> HashTableData;
// Private data
//- Hash table holding the data
HashTable<DataType, KeyType> table_;
HashTableData table_;
//- Title of the table
string title_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -1191,6 +1191,36 @@ void Foam::conformalVoronoiMesh::writeMesh
}
}
// Add indirectPatchFaces to a face zone
{
labelList addr(boundaryFacesToRemove.count());
label count = 0;
forAll(boundaryFacesToRemove, faceI)
{
if (boundaryFacesToRemove[faceI])
{
addr[count++] = faceI;
}
}
label sz = mesh.faceZones().size();
boolList flip(addr.size(), false);
mesh.faceZones().setSize(sz + 1);
mesh.faceZones().set
(
sz,
new faceZone
(
"indirectPatchFaces",
addr,
flip,
sz,
mesh.faceZones()
)
);
}
patches.setSize(nValidPatches);
mesh.addFvPatches(patches);