67int main(
int argc,
char *argv[])
71 "Collapses small edges to a point.\n"
72 "Optionally collapse small faces to a point and thin faces to an edge."
78 "Collapse small and sliver faces as well as small edges"
85 "Collapse faces that are in the supplied face set"
101 const word oldInstance =
mesh.pointsInstance();
110 const bool overwrite =
args.found(
"overwrite");
112 const bool collapseFaces =
args.found(
"collapseFaces");
113 const bool collapseFaceSet =
args.found(
"collapseFaceSet");
115 if (collapseFaces && collapseFaceSet)
118 <<
"Both face zone collapsing and face collapsing have been"
119 <<
"selected. Choose only one of:" <<
nl
120 <<
" -collapseFaces" <<
nl
121 <<
" -collapseFaceSet <faceSet>"
128 word faceSetName(
"indirectPatchFaces");
131 if (
args.readIfPresent(
"collapseFaceSet", faceSetName))
151 runTime.setTime(timeDirs[timeI], timeI);
166 Info<<
"Read faceSet " << indirectPatchFaces.name()
184 nBadFaces = meshFilter.filterEdges(0);
188 meshMod.changeMesh(
mesh,
false);
190 polyMeshFilter::copySets(newMesh(),
mesh);
208 meshFilter.
filter(indirectPatchFaces);
212 meshMod.changeMesh(
mesh,
false);
214 polyMeshFilter::copySets(newMesh(),
mesh);
232 meshFilter.
filter(nBadFaces);
236 meshMod.changeMesh(
mesh,
false);
238 polyMeshFilter::copySets(newMesh(),
mesh);
251 mesh.setInstance(oldInstance);
254 Info<<
nl <<
"Writing collapsed mesh to time "
258 pointPriority.write();
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
readOption
Enumeration defining read preferences.
@ READ_IF_PRESENT
Reading is optional [identical to LAZY_READ].
@ MUST_READ
Reading required.
@ AUTO_WRITE
Automatically write from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
static void addNote(const string ¬e)
Add extra notes for the usage information.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
Remove the edges and faces of a polyMesh whilst satisfying the given mesh quality criteria.
const autoPtr< labelList > & pointPriority() const
Return the new pointPriority list.
label filter(const label nOriginalBadFaces)
Filter edges and faces.
const autoPtr< fvMesh > & filteredMesh() const
Return reference to the filtered mesh. Does not check if the.
Direct mesh changes based on v1.3 polyTopoChange syntax.
static void addOptions(const bool constant=true, const bool withZero=false)
Add timeSelector options to argList::validOptions.
static instantList selectIfPresent(Time &runTime, const argList &args)
If any time option provided return the set of times - as per select0() - otherwise return just the cu...
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const word dictName("faMeshDefinition")
return returnReduce(nRefine-oldNRefine, sumOp< label >())
List< label > labelList
A List of labels.
IOList< label > labelIOList
IO for a List of label.
messageStream Info
Information stream (stdout output on master, null elsewhere).
List< instant > instantList
List of instants.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
constexpr char nl
The newline '\n' character (0x0a).
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.