67 int 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" 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");
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);
254 Info<<
nl <<
"Writing collapsed mesh to time " 258 pointPriority.write();
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
static void addNote(const string ¬e)
Add extra notes for the usage information.
label filter(const label nOriginalBadFaces)
Filter edges and faces.
const autoPtr< labelList > & pointPriority() const
Return the new pointPriority list.
label nPoints() const noexcept
Number of mesh points.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const word & name() const noexcept
Return the object name.
constexpr char nl
The newline '\n' character (0x0a)
const word dictName("faMeshDefinition")
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
#define forAll(list, i)
Loop across all elements in list.
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
const fileName & pointsInstance() const
Return the current instance directory for points.
A class for handling words, derived from Foam::string.
Reading is optional [identical to LAZY_READ].
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
static instantList selectIfPresent(Time &runTime, const argList &args)
If any time option provided return the set of times (as select0) otherwise return just the current ti...
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
Remove the edges and faces of a polyMesh whilst satisfying the given mesh quality criteria...
errorManip< error > abort(error &err)
virtual bool write(const bool writeOnProc=true) const
Write mesh using IO settings from time.
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
Ostream & printExecutionTime(OSstream &os) const
Print the elapsed ExecutionTime (cpu-time), ClockTime.
void setInstance(const fileName &instance, const IOobjectOption::writeOption wOpt=IOobject::AUTO_WRITE)
Set the instance for mesh files.
Direct mesh changes based on v1.3 polyTopoChange syntax.
Automatically write from objectRegistry::writeObject()
messageStream Info
Information stream (stdout output on master, null elsewhere)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
const autoPtr< fvMesh > & filteredMesh() const
Return reference to the filtered mesh. Does not check if the.
List< label > labelList
A List of labels.
Foam::argList args(argc, argv)
Defines the attributes of an object for which implicit objectRegistry management is supported...
bool found(const word &optName) const
Return true if the named option is found.
static void addOptions(const bool constant=true, const bool withZero=false)
Add timeSelector options to argList::validOptions.
readOption
Enumeration defining read preferences.