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."
74 timeSelector::addOptions(
true,
false);
75 argList::addBoolOption
78 "Collapse small and sliver faces as well as small edges"
85 "Collapse faces that are in the supplied face set"
88 argList::addOption(
"dict",
"file",
"Alternative collapseDict");
92 argList::noFunctionObjects();
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>"
122 <<
abort(FatalError);
128 word faceSetName(
"indirectPatchFaces");
133 readFlag = IOobject::MUST_READ;
144 IOobject::READ_IF_PRESENT,
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();
262 runTime.printExecutionTime(Info);
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
readOption
Enumeration defining the read options.
bool found(const word &optName) const
Return true if the named option is found.
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
void reset(autoPtr< T > &&other) 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.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const word dictName("faMeshDefinition")
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
constexpr char nl
The newline '\n' character (0x0a)
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.