Go to the documentation of this file.
66 label meshEdgeI =
bMesh.featureToEdge()[featEdgeI];
68 markedEdges[markedI++] = meshEdgeI;
76 int main(
int argc,
char *argv[])
80 "Divides external faces into patches based on feature angle"
96 Info<<
"Mesh read in = "
101 const scalar featureAngle =
args.
get<scalar>(1);
102 const bool overwrite =
args.
found(
"overwrite");
106 Info<<
"Feature:" << featureAngle <<
endl
107 <<
"minCos :" << minCos <<
endl
118 bMesh.setFeatureEdges(minCos);
123 collectFeatureEdges(
bMesh, markedEdges);
136 label newPatchi =
bMesh.patches().size();
143 label unsetFacei = patchIDs.find(-1);
145 if (unsetFacei == -1)
155 patchName =
"auto" +
name(suffix++);
157 while (
bMesh.findPatchID(patchName) != -1);
159 bMesh.addPatch(patchName);
161 bMesh.changePatchType(patchName,
"patch");
167 bMesh.markFaces(markedEdges, unsetFacei, visited);
179 patchIDs[facei] = newPatchi;
183 Info<<
"Assigned " << nVisited <<
" faces to patch " << patchName
203 newPatchPtrList[newPatchi] =
216 for (label patchi = newPatchi; patchi <
patches.size(); patchi++)
241 polyMeshRepatcher.changePatches(newPatchPtrList);
252 label meshFacei = meshFace[facei];
254 polyMeshRepatcher.changePatchID(meshFacei, patchIDs[facei]);
257 polyMeshRepatcher.repatch();
A class for handling words, derived from Foam::string.
virtual bool write(const bool valid=true) const
Write mesh using IO settings from time.
label nFaces() const
Number of mesh faces.
label nEdges() const
Return number of edges in patch.
static void addNote(const string ¬e)
Add extra notes for the usage information.
Unit conversion functions.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
T get(const label index) const
Get a value from the argument at index.
#define forAll(list, i)
Loop across all elements in list.
Like polyPatch but without reference to mesh. Used in boundaryMesh to hold data on patches....
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
const fileName & pointsInstance() const
Return the current instance directory for points.
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
A mesh which allows changes in the patch distribution of the boundary faces. The change in patching i...
messageStream Info
Information stream (uses stdout - output is on the master only)
A patch is a list of labels that address the faces in the global face list.
word name(const complex &c)
Return string representation of complex.
PrimitivePatch< List< face >, const pointField > bMesh
Holder of faceList and points. (v.s. e.g. primitivePatch which references points)
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
static autoPtr< polyPatch > New(const word &patchType, const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
Return a pointer to a new patch created on freestore from.
constexpr scalar degToRad(const scalar deg) noexcept
Conversion from degrees to radians.
An ordered pair of two objects of type <T> with first() and second() elements.
static unsigned int defaultPrecision()
Return the default precision.
const std::string patch
OpenFOAM patch number as a std::string.
const polyBoundaryMesh & patches
double cpuTimeIncrement() const
Return CPU time (in seconds) since last call to cpuTimeIncrement()
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
Various functions to operate on Lists.
static void noParallel()
Remove the parallel options.
void setSize(const label newSize)
Alias for resize(const label)
Foam::argList args(argc, argv)
const word & name() const
The patch name.
void setInstance(const fileName &instance, const IOobject::writeOption wOpt=IOobject::AUTO_WRITE)
Set the instance for mesh files.
bool found(const word &optName) const
Return true if the named option is found.
A list of faces which address into the list of points.
dimensionedScalar cos(const dimensionedScalar &ds)