Go to the documentation of this file.
97 Pout<<
"Created patch " << patchName <<
" at " << patchi <<
endl;
101 Pout<<
"Reusing patch " << patchName <<
" at " << patchi <<
endl;
119 bool changed =
false;
123 if (nearest[bFacei] != -1)
126 label bMeshPatchID =
bMesh.whichPatch(nearest[bFacei]);
128 label
patchID = surfToMeshPatch[bMeshPatchID];
136 bool zoneFlip =
false;
173 int main(
int argc,
char *argv[])
177 "Reads surface and applies surface regioning to a mesh"
186 "Only repatch the faces in specified faceSet"
192 "Search tolerance as fraction of mesh size (default 1e-3)"
201 Info<<
"Reading surface from " << surfName <<
" ..." <<
endl;
208 Info<<
"Repatching only the faces in faceSet " << setName
209 <<
" according to nearest surface triangle ..." <<
endl;
213 Info<<
"Patching all boundary faces according to nearest surface"
214 <<
" triangle ..." <<
endl;
223 Info<<
"All boundary faces further away than " << searchTol
224 <<
" of mesh bounding box " <<
meshBb
225 <<
" will keep their patch label ..." <<
endl;
228 Info<<
"Before patching:" <<
nl
229 <<
" patch\tsize" <<
endl;
242 bMesh.readTriSurface(surfName);
252 patchMap[i] = addPatch(
mesh, bPatches[i].
name());
262 faceSet unmatchedFaces(
mesh,
"unmatchedFaces", nearest.size()/100);
266 if (nearest[bFacei] == -1)
272 Pout<<
"Writing all " << unmatchedFaces.size()
273 <<
" unmatched faces to faceSet "
274 << unmatchedFaces.
name()
277 unmatchedFaces.
write();
288 Info<<
"Read " << faceLabels.size() <<
" faces to repatch ..." <<
endl;
290 for (
const label facei : faceLabels)
292 if (repatchFace(
mesh,
bMesh, nearest, patchMap, facei, meshMod))
304 if (repatchFace(
mesh,
bMesh, nearest, patchMap, facei, meshMod))
311 Pout<<
"Changed " << nChanged <<
" boundary faces." <<
nl <<
endl;
317 Info<<
"After patching:" <<
nl
318 <<
" patch\tsize" <<
endl;
void addPatches(PtrList< polyPatch > &plist, const bool validBoundary=true)
A class for handling words, derived from Foam::string.
A class for handling file names.
const boolList & flipMap() const noexcept
virtual bool write(const bool valid=true) const
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
T getOrDefault(const word &optName, const T &deflt) const
Direct mesh changes based on v1.3 polyTopoChange syntax.
static void addNote(const string ¬e)
Class describing modification of a face.
const polyBoundaryMesh & boundaryMesh() const
Ostream & endl(Ostream &os)
const Type & value() const
List< treeBoundBox > meshBb(1, treeBoundBox(boundBox(coarseMesh.points(), false)).extend(rndGen, 1e-3))
T get(const label index) const
bool readIfPresent(const word &optName, T &val) const
Mesh consisting of general polyhedral cells.
static void addArgument(const string &argName, const string &usage="")
A subset of mesh faces organised as a primitive patch.
A patch is a list of labels that address the faces in the global face list.
virtual const fileName & name() const
PrimitivePatch< List< face >, const pointField > bMesh
Holder of faceList and points. (v.s. e.g. primitivePatch which references points)
virtual const labelList & faceOwner() const
const faceZoneMesh & faceZones() const noexcept
label whichPatch(const label faceIndex) const
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
label findPatchID(const word &patchName, const bool allowNotFound=true) const
autoPtr< mapPolyMesh > changeMesh(polyMesh &mesh, const labelUList &patchMap, const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
label whichZone(const label objectIndex) const
const labelIOList & zoneID
virtual bool write(const token &tok)=0
label whichFace(const label globalCellID) const
const boundBox & bounds() const
const word & name() const noexcept
virtual const faceList & faces() const
label setAction(const topoAction &action)
label nInternalFaces() const noexcept
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const dimensionedScalar e
const polyBoundaryMesh & patches
A bounding box defined in terms of min/max extrema points.
virtual autoPtr< polyPatch > clone(const labelList &faceCells) const
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
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Foam::argList args(argc, argv)
A list of faces which address into the list of points.