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
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 outsideFaces.shrink(),
305 outsideFacesInfo.shrink(),
314 forAll(cellInfoList, celli)
316 if (cellType[celli] == MESH)
320 if (cellInfoList[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(refineDict.lookup<scalar>(
"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");
#define forAll(list, i)
Loop across all elements in list.
Wave propagation of information through grid. Every iteration information goes through one layer of c...
bool insert(const Key &key)
Insert a new entry.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void append(const T &)
Append an element at the end of the list.
void size(const label)
Override size to be inconsistent with allocated storage.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
bool hit() const
Is there a hit.
static void noParallel()
Remove the parallel options.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
'Cuts' a mesh with a surface.
label fillRegionPoints(const label meshType, const label fillType, const label maxIter)
Find regionPoints and fill all neighbours. Iterate until nothing.
label fillHangingCells(const label meshType, const label fillType, const label maxIter)
Find hanging cells (cells with all points on outside) and set their.
label fillRegionEdges(const label meshType, const label fillType, const label maxIter)
Find regionEdges and fill one neighbour. Iterate until nothing.
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.
label nTotalCells() const
Return total number of cells in decomposed mesh.
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.
const globalMeshData & globalData() const
Return parallel info.
virtual const pointField & points() const
Return raw points.
const labelListList & pointCells() const
const cellList & cells() const
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.
int main(int argc, char *argv[])
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & endl(Ostream &os)
Add newline and flush stream.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.