80 Info<<
"Writing " << msg <<
" (" <<
cells.
size() <<
") to cellSet " 106 const bool selectCut,
107 const bool selectInside,
108 const bool selectOutside,
109 const scalar nearDist,
127 writeSet(inside,
"inside cells");
131 writeSet(outside,
"outside cells");
135 writeSet(cutCells,
"cells cut by surface");
184 <<
"Multiple mesh regions in original mesh" <<
endl 185 <<
"Please use splitMeshRegions to separate these" 193 Info<<
"Removing cells with points closer than " << nearDist
194 <<
" to the surface ..." <<
nl <<
endl;
244 Info<<
"Removed " << nRemoved <<
" cells since too close to surface" 253 label selectOutsideCells
275 forAll(outsidePts, outsidePtI)
278 label celli = queryMesh.
findCell(outsidePts[outsidePtI], -1,
false);
280 if (celli != -1 &&
cellType[celli] == MESH)
282 Info<<
"Marking cell " << celli <<
" containing outside point " 283 << outsidePts[outsidePtI] <<
" with type " <<
cellType[celli]
294 label facei = cFaces[i];
296 if (outsideFacesMap.insert(facei))
298 outsideFaces.
append(facei);
299 outsideFacesInfo.append(meshInfo);
309 outsideFaces.shrink(),
310 outsideFacesInfo.shrink(),
339 int main(
int argc,
char *argv[])
343 "Select cells in relation to surface" 369 pointField outsidePts(refineDict.lookup(
"outsidePoints"));
370 const bool useSurface(refineDict.get<
bool>(
"useSurface"));
371 const bool selectCut(refineDict.get<
bool>(
"selectCut"));
372 const bool selectInside(refineDict.get<
bool>(
"selectInside"));
373 const bool selectOutside(refineDict.get<
bool>(
"selectOutside"));
374 const scalar nearDist(refineDict.get<scalar>(
"nearDistance"));
379 Info<<
"Cells to be used for meshing (0=false, 1=true):" <<
nl 380 <<
" cells cut by surface : " << selectCut <<
nl 381 <<
" cells inside of surface : " << selectInside <<
nl 382 <<
" cells outside of surface : " << selectOutside <<
nl 383 <<
" cells with points further than : " << nearDist <<
nl 388 Info<<
"Cells to be used for meshing (0=false, 1=true):" <<
nl 389 <<
" cells reachable from outsidePoints:" << selectOutside <<
nl 394 (void)edgeCalc.minLen(
Info);
400 for (
const point& outsidePoint : outsidePts)
402 const label celli = queryMesh.
findCell(outsidePoint, -1,
false);
407 <<
"outsidePoint " << outsidePoint
408 <<
" is not inside any cell" 431 surf.writeStats(
Info);
456 label nHanging, nRegionEdges, nRegionPoints, nOutside;
460 Info<<
"Removing cells which after subsetting would have all points" 461 <<
" on outside ..." <<
nl <<
endl;
463 nHanging =
cellType.fillHangingCells
471 Info<<
"Removing edges connecting cells unconnected by faces ..." 474 nRegionEdges =
cellType.fillRegionEdges
482 Info<<
"Removing points connecting cells unconnected by faces ..." 485 nRegionPoints =
cellType.fillRegionPoints
498 nOutside = selectOutsideCells
510 || nRegionPoints != 0
515 getType(
cellType, MESH, selectedCells);
517 writeSet(selectedCells,
"cells selected for meshing");
cellType
Equivalent to enumeration in "vtkCellType.h" (should be uint8_t)
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
static void addNote(const string ¬e)
Add extra notes for the usage information.
void size(const label n)
Older name for setAddressableSize.
A class for handling file names.
List< wallPoints > allCellInfo(mesh_.nCells())
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void append(const T &val)
Append an element at the end of the list.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void noParallel()
Remove the parallel options.
const cellList & cells() const
This class describes the interaction of an object (often a face) and a point. It carries the info of ...
Ignore writing from objectRegistry::writeObject()
Holds information regarding type of cell. Used in inside/outside determination in cellClassification...
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
virtual const pointField & points() const
Return raw points.
#define forAll(list, i)
Loop across all elements in list.
Helper class to search on triSurface.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
bool returnReduceAnd(const bool value, const label comm=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
'Cuts' a mesh with a surface.
label findCell(const point &location, const label seedCelli=-1, const bool useTreeSearch=true) const
Find cell containing location.
const word & system() const noexcept
Return system name.
Tree tree(triangles.begin(), triangles.end())
const globalMeshData & globalData() const
Return parallel info (demand-driven)
const labelListList & pointCells() const
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
label nTotalCells() const noexcept
Total global number of mesh cells.
bool hit() const noexcept
Is there a hit?
Helper class to calculate minimum edge length on mesh.
Non-pointer based hierarchical recursive searching.
label nCells() const noexcept
Number of mesh cells.
A collection of cell labels.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Mesh consisting of general polyhedral cells.
Triangulated surface description with patch information.
Defines the attributes of an object for which implicit objectRegistry management is supported...
const indexedOctree< treeDataTriSurface > & tree() const
Demand driven construction of the octree.