Go to the documentation of this file.
51 #include "triSurface.H"
59 #include "treeDataTriSurface.H"
74 Info<<
"Writing " << msg <<
" (" <<
cells.
size() <<
") to cellSet "
100 const bool selectCut,
101 const bool selectInside,
102 const bool selectOutside,
103 const scalar nearDist,
121 writeSet(inside,
"inside cells");
125 writeSet(outside,
"outside cells");
129 writeSet(cutCells,
"cells cut by surface");
140 label cType = cellType[cellI];
146 cellType[cellI] =
MESH;
150 cellType[cellI] = NONMESH;
157 cellType[cellI] =
MESH;
161 cellType[cellI] = NONMESH;
168 cellType[cellI] =
MESH;
172 cellType[cellI] = NONMESH;
178 <<
"Multiple mesh regions in original mesh" <<
endl
179 <<
"Please use splitMeshRegions to separate these"
187 Info<<
"Removing cells with points closer than " << nearDist
188 <<
" to the surface ..." <<
nl <<
endl;
197 const point& pt = pts[pointI];
207 if (cellType[pCells[i]] != NONMESH)
209 cellType[pCells[i]] = NONMESH;
238 Info<<
"Removed " << nRemoved <<
" cells since too close to surface"
247 label selectOutsideCells
261 labelHashSet outsideFacesMap(outsidePts.size() * 6 * 2);
269 forAll(outsidePts, outsidePtI)
272 label cellI = queryMesh.
findCell(outsidePts[outsidePtI], -1,
false);
274 if (cellI != -1 && cellType[cellI] ==
MESH)
276 Info<<
"Marking cell " << cellI <<
" containing outside point "
277 << outsidePts[outsidePtI] <<
" with type " << cellType[cellI]
288 label faceI = cFaces[i];
290 if (outsideFacesMap.insert(faceI))
292 outsideFaces.
append(faceI);
293 outsideFacesInfo.append(meshInfo);
304 outsideFacesInfo.shrink(),
314 forAll(allCellInfo, cellI)
316 if (cellType[cellI] ==
MESH)
320 if (allCellInfo[cellI].
type() !=
MESH)
322 cellType[cellI] = NONMESH;
333 int main(
int argc,
char *argv[])
357 fileName surfName(refineDict.lookup(
"surface"));
358 pointField outsidePts(refineDict.lookup(
"outsidePoints"));
359 bool useSurface(
readBool(refineDict.lookup(
"useSurface")));
360 bool selectCut(
readBool(refineDict.lookup(
"selectCut")));
361 bool selectInside(
readBool(refineDict.lookup(
"selectInside")));
362 bool selectOutside(
readBool(refineDict.lookup(
"selectOutside")));
363 scalar nearDist(
readScalar(refineDict.lookup(
"nearDistance")));
368 Info<<
"Cells to be used for meshing (0=false, 1=true):" <<
nl
369 <<
" cells cut by surface : " << selectCut <<
nl
370 <<
" cells inside of surface : " << selectInside <<
nl
371 <<
" cells outside of surface : " << selectOutside <<
nl
372 <<
" cells with points further than : " << nearDist <<
nl
377 Info<<
"Cells to be used for meshing (0=false, 1=true):" <<
nl
378 <<
" cells reachable from outsidePoints:" << selectOutside <<
nl
383 (void)edgeCalc.minLen(
Info);
389 forAll(outsidePts, outsideI)
391 const point& outsidePoint = outsidePts[outsideI];
397 <<
"outsidePoint " << outsidePoint
398 <<
" is not inside any cell"
426 surf().writeStats(
Info);
452 label nHanging, nRegionEdges, nRegionPoints, nOutside;
456 Info<<
"Removing cells which after subsetting would have all points"
457 <<
" on outside ..." <<
nl <<
endl;
467 Info<<
"Removing edges connecting cells unconnected by faces ..."
478 Info<<
"Removing points connecting cells unconnected by faces ..."
494 nOutside = selectOutsideCells
506 || nRegionPoints != 0
511 getType(cellType,
MESH, selectedCells);
513 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.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
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)
#define forAll(list, i)
Loop across all elements in list.
void shrink()
Shrink the allocated table to approx. twice number of elements.
const cellList & cells() const
bool hit() const
Is there a hit.
label nTotalCells() const
Return total number of cells in decomposed mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Helper class to search on triSurface.
Mesh consisting of general polyhedral cells.
label fillHangingCells(const label meshType, const label fillType, const label maxIter)
Find hanging cells (cells with all points on outside) and set their.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
Triangulated surface description with patch information.
void append(const T &)
Append an element at the end of the list.
const indexedOctree< treeDataTriSurface > & tree() const
Demand driven construction of the octree.
Non-pointer based hierarchical recursive searching.
label fillRegionEdges(const label meshType, const label fillType, const label maxIter)
Find regionEdges and fill one neighbour. Iterate until nothing.
int main(int argc, char *argv[])
A collection of cell labels.
'Cuts' a mesh with a surface.
errorManipArg< error, int > exit(error &err, const int errNo=1)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Holds information regarding type of cell. Used in inside/outside determination in cellClassification.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
label findCell(const point &location, const label seedCellI=-1, const bool useTreeSearch=true) const
Find cell containing location.
label fillRegionPoints(const label meshType, const label fillType, const label maxIter)
Find regionPoints and fill all neighbours. Iterate until nothing.
const labelListList & pointCells() const
bool insert(const Key &key)
Insert a new entry.
void findNearest(const label nodeI, const linePointRef &ln, treeBoundBox &tightest, label &nearestShapeI, point &linePoint, point &nearestPoint, const FindNearestOp &fnOp) const
Find nearest point to line.
void size(const label)
Override size to be inconsistent with allocated storage.
const globalMeshData & globalData() const
Return parallel info.
static void noParallel()
Remove the parallel options.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.