72 void writeSet(
const cellSet& cells,
const string& msg)
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);
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");
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
#define forAll(list, i)
Loop across all elements in list.
const word & name() const
Return name.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Wave propagation of information through grid. Every iteration information goes through one layer of c...
label nTotalCells() const
Return total number of cells in decomposed mesh.
static void noParallel()
Remove the parallel options.
const cellList & cells() const
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
Holds information regarding type of cell. Used in inside/outside determination in cellClassification...
label size() const
Return number of elements in table.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
virtual const pointField & points() const
Return raw points.
Helper class to search on triSurface.
'Cuts' a mesh with a surface.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
label findCell(const point &location, const label seedCelli=-1, const bool useTreeSearch=true) const
Find cell containing location.
void append(const T &)
Append an element at the end of the list.
const fileName & local() const
label fillRegionPoints(const label meshType, const label fillType, const label maxIter)
Find regionPoints and fill all neighbours. Iterate until nothing.
bool hit() const
Is there a hit.
const globalMeshData & globalData() const
Return parallel info.
const labelListList & pointCells() const
Helper class to calculate minimum edge length on mesh.
Non-pointer based hierarchical recursive searching.
A collection of cell labels.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
label fillRegionEdges(const label meshType, const label fillType, const label maxIter)
Find regionEdges and fill one neighbour. Iterate until nothing.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
fileName & instance() const
Return the instance directory, constant, system, <time> etc.
Mesh consisting of general polyhedral cells.
virtual bool write(const bool write=true) const
Write using setting from DB.
Triangulated surface description with patch information.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
label fillHangingCells(const label meshType, const label fillType, const label maxIter)
Find hanging cells (cells with all points on outside) and set their.
const indexedOctree< treeDataTriSurface > & tree() const
Demand driven construction of the octree.
void shrink()
Shrink the allocated table to approx. twice number of elements.