66 label meshEdgeI =
bMesh.featureToEdge()[featEdgeI];
68 markedEdges[markedI++] = meshEdgeI;
76int main(
int argc,
char *argv[])
80 "Divides external faces into patches based on feature angle"
94 const word oldInstance =
mesh.pointsInstance();
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);
183 Info<<
"Assigned " << nVisited <<
" faces to patch " << patchName
219 for (label patchi = newPatchi; patchi <
patches.size(); patchi++)
248 polyMeshRepatcher.changePatches(newPatches);
259 label meshFacei = meshFace[facei];
261 polyMeshRepatcher.changePatchID(meshFacei,
patchIDs[facei]);
264 polyMeshRepatcher.repatch();
269 mesh.setInstance(oldInstance);
Various functions to operate on Lists.
static unsigned int minPrecision(unsigned int prec) noexcept
Set the minimum default precision.
void setSize(label n)
Alias for resize().
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
static void noParallel()
Remove the parallel options.
static void addNote(const string ¬e)
Add extra notes for the usage information.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
A patch is a list of labels that address the faces in the global face list.
static autoPtr< polyPatch > New(const word &patchType, const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
Return pointer to a new patch created on freestore from components.
A mesh which allows changes in the patch distribution of the boundary faces. The change in patching i...
A class for handling words, derived from Foam::string.
const polyBoundaryMesh & patches
const std::string patch
OpenFOAM patch number as a std::string.
PtrList< polyPatch > polyPatchList
Store lists of polyPatch as a PtrList.
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere).
constexpr scalar degToRad(const scalar deg) noexcept
Conversion from degrees to radians.
Ostream & endl(Ostream &os)
Add newline and flush stream.
List< bool > boolList
A List of bools.
PrimitivePatch< List< face >, const pointField > bMesh
Holder of faceList and points. (v.s. e.g. primitivePatch which references points).
dimensionedScalar cos(const dimensionedScalar &ds)
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.
Unit conversion functions.