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
static void addNote(const string ¬e)
Unit conversion functions.
const polyBoundaryMesh & boundaryMesh() const
Ostream & endl(Ostream &os)
double cpuTimeIncrement() const
T get(const label index) const
Like polyPatch but without reference to mesh. Used in boundaryMesh to hold data on patches....
static void addArgument(const string &argName, const string &usage="")
const fileName & pointsInstance() const
static void noFunctionObjects(bool addWithOption=false)
A mesh which allows changes in the patch distribution of the boundary faces. The change in patching i...
A patch is a list of labels that address the faces in the global face list.
PrimitivePatch< List< face >, const pointField > bMesh
Holder of faceList and points. (v.s. e.g. primitivePatch which references points)
void setSize(const label n)
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
label max(const labelHashSet &set, label maxValue=labelMin)
static autoPtr< polyPatch > New(const word &patchType, const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
constexpr scalar degToRad(const scalar deg) noexcept
static unsigned int defaultPrecision() noexcept
An ordered pair of two objects of type <T> with first() and second() elements.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const polyBoundaryMesh & patches
word name(const expressions::valueTypeCode typeCode)
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
label nFaces() const noexcept
const word & name() const noexcept
Various functions to operate on Lists.
Foam::argList args(argc, argv)
void setInstance(const fileName &instance, const IOobject::writeOption wOpt=IOobject::AUTO_WRITE)
bool found(const word &optName) const
A list of faces which address into the list of points.
dimensionedScalar cos(const dimensionedScalar &ds)