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;
213 if (cellType[pCells[i]] != NONMESH)
244 Info<<
"Removed " << nRemoved <<
" cells since too close to surface"
253label 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(),
311 mesh.globalData().nTotalCells()+1
316 const List<cellInfo>&
allCellInfo = regionCalc.allCellInfo();
322 if (cellType[celli] == MESH)
339int 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");
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
bool hit() const noexcept
Is there a hit?
void size(const label n)
Older name for setAddressableSize.
static void noParallel()
Remove the parallel options.
static void addNote(const string ¬e)
Add extra notes for the usage information.
'Cuts' a mesh with a surface.
Holds information regarding type of cell. Used in inside/outside determination in cellClassification.
A collection of cell labels.
Helper class to calculate minimum edge length on mesh.
A class for handling file names.
Non-pointer based hierarchical recursive searching.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
label findCell(const point &location, const label seedCelli=-1, const bool useTreeSearch=true) const
Find cell containing location.
Mesh consisting of general polyhedral cells.
Helper class to search on triSurface.
const indexedOctree< treeDataTriSurface > & tree() const
Demand driven construction of the octree.
Triangulated surface description with patch information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< wallPoints > allCellInfo(mesh_.nCells())
void set(List< bool > &bools, const labelUList &locations)
Set the listed locations (assign 'true').
cellType
Equivalent to enumeration in "vtkCellType.h" (should be uint8_t).
List< label > labelList
A List of labels.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool returnReduceAnd(const bool value, const int communicator=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
vector point
Point is a vector.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
vectorField pointField
pointField is a vectorField.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).
Tree tree(triangles.begin(), triangles.end())
#define forAll(list, i)
Loop across all elements in list.