Go to the documentation of this file.
79 Info<<
"Writing " << msg <<
" (" <<
cells.size() <<
") to cellSet "
105 const bool selectCut,
106 const bool selectInside,
107 const bool selectOutside,
108 const scalar nearDist,
126 writeSet(inside,
"inside cells");
130 writeSet(outside,
"outside cells");
134 writeSet(cutCells,
"cells cut by surface");
183 <<
"Multiple mesh regions in original mesh" <<
endl
184 <<
"Please use splitMeshRegions to separate these"
192 Info<<
"Removing cells with points closer than " << nearDist
193 <<
" to the surface ..." <<
nl <<
endl;
202 const point& pt = pts[pointi];
243 Info<<
"Removed " << nRemoved <<
" cells since too close to surface"
252 label selectOutsideCells
266 labelHashSet outsideFacesMap(outsidePts.size() * 6 * 2);
274 forAll(outsidePts, outsidePtI)
277 label celli = queryMesh.
findCell(outsidePts[outsidePtI], -1,
false);
279 if (celli != -1 &&
cellType[celli] == MESH)
281 Info<<
"Marking cell " << celli <<
" containing outside point "
282 << outsidePts[outsidePtI] <<
" with type " <<
cellType[celli]
293 label facei = cFaces[i];
295 if (outsideFacesMap.insert(facei))
297 outsideFaces.
append(facei);
298 outsideFacesInfo.append(meshInfo);
308 outsideFaces.shrink(),
309 outsideFacesInfo.shrink(),
319 forAll(allCellInfo, celli)
325 if (allCellInfo[celli].
type() != MESH)
338 int main(
int argc,
char *argv[])
342 "Select cells in relation to surface"
368 pointField outsidePts(refineDict.lookup(
"outsidePoints"));
369 const bool useSurface(refineDict.get<
bool>(
"useSurface"));
370 const bool selectCut(refineDict.get<
bool>(
"selectCut"));
371 const bool selectInside(refineDict.get<
bool>(
"selectInside"));
372 const bool selectOutside(refineDict.get<
bool>(
"selectOutside"));
373 const scalar nearDist(refineDict.get<scalar>(
"nearDistance"));
378 Info<<
"Cells to be used for meshing (0=false, 1=true):" <<
nl
379 <<
" cells cut by surface : " << selectCut <<
nl
380 <<
" cells inside of surface : " << selectInside <<
nl
381 <<
" cells outside of surface : " << selectOutside <<
nl
382 <<
" cells with points further than : " << nearDist <<
nl
387 Info<<
"Cells to be used for meshing (0=false, 1=true):" <<
nl
388 <<
" cells reachable from outsidePoints:" << selectOutside <<
nl
393 (void)edgeCalc.minLen(
Info);
399 forAll(outsidePts, outsideI)
401 const point& outsidePoint = outsidePts[outsideI];
403 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");
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
virtual const pointField & points() const
Return raw points.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Helper class to calculate minimum edge length on mesh.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
A class for handling file names.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
const cellList & cells() const
bool hit() const
Is there a hit.
label nTotalCells() const
Return total number of cells in decomposed mesh.
static void addNote(const string ¬e)
Add extra notes for the usage information.
void append(const T &val)
Append an element at the end of the list.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label findCell(const point &location, const label seedCelli=-1, const bool useTreeSearch=true) const
Find cell containing location.
Helper class to search on triSurface.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
label nCells() const
Number of mesh cells.
Triangulated surface description with patch information.
messageStream Info
Information stream (uses stdout - output is on the master only)
const indexedOctree< treeDataTriSurface > & tree() const
Demand driven construction of the octree.
Non-pointer based hierarchical recursive searching.
A collection of cell labels.
'Cuts' a mesh with a surface.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Holds information regarding type of cell. Used in inside/outside determination in cellClassification.
const word & system() const
Return system name.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
cellType
Equivalent to enumeration in "vtkCellType.h".
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const labelListList & pointCells() const
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
const globalMeshData & globalData() const
Return parallel info.
static void noParallel()
Remove the parallel options.
const List< Type > & allCellInfo() const
Get allCellInfo.