74 Info<<
"Writing " << msg <<
" (" <<
cells.
size() <<
") to cellSet "
100 const bool selectInside,
101 const bool selectOutside,
102 const scalar nearDist,
113 writeSet(inside,
"inside cells");
117 writeSet(outside,
"outside cells");
121 writeSet(cutCells,
"cells cut by surface");
132 label cType = cellType[celli];
138 cellType[celli] = MESH;
142 cellType[celli] = NONMESH;
149 cellType[celli] = MESH;
153 cellType[celli] = NONMESH;
160 cellType[celli] = MESH;
164 cellType[celli] = NONMESH;
170 <<
"Multiple mesh regions in original mesh" <<
endl
171 <<
"Please use splitMeshRegions to separate these"
179 Info<<
"Removing cells with points closer than " << nearDist
180 <<
" to the surface ..." <<
nl <<
endl;
189 const point& pt = pts[pointi];
199 if (cellType[pCells[i]] != NONMESH)
201 cellType[pCells[i]] = NONMESH;
230 Info<<
"Removed " << nRemoved <<
" cells since too close to surface"
239 label selectOutsideCells
260 forAll(outsidePts, outsidePtI)
265 if (celli != -1 && cellType[celli] == MESH)
267 Info<<
"Marking cell " << celli <<
" containing outside point "
268 << outsidePts[outsidePtI] <<
" with type " << cellType[celli]
279 label facei = cFaces[i];
281 if (outsideFacesMap.insert(facei))
283 outsideFaces.
append(facei);
284 outsideFacesInfo.append(meshInfo);
296 outsideFacesInfo.shrink(),
305 forAll(cellInfoList, celli)
307 if (cellType[celli] == MESH)
311 if (cellInfoList[celli].
type() != MESH)
313 cellType[celli] = NONMESH;
324 int main(
int argc,
char *argv[])
348 fileName surfName(refineDict.lookup(
"surface"));
349 pointField outsidePts(refineDict.lookup(
"outsidePoints"));
350 bool useSurface(
readBool(refineDict.lookup(
"useSurface")));
351 bool selectCut(
readBool(refineDict.lookup(
"selectCut")));
352 bool selectInside(
readBool(refineDict.lookup(
"selectInside")));
353 bool selectOutside(
readBool(refineDict.lookup(
"selectOutside")));
354 scalar nearDist(refineDict.lookup<scalar>(
"nearDistance"));
359 Info<<
"Cells to be used for meshing (0=false, 1=true):" <<
nl
360 <<
" cells cut by surface : " << selectCut <<
nl
361 <<
" cells inside of surface : " << selectInside <<
nl
362 <<
" cells outside of surface : " << selectOutside <<
nl
363 <<
" cells with points further than : " << nearDist <<
nl
368 Info<<
"Cells to be used for meshing (0=false, 1=true):" <<
nl
369 <<
" cells reachable from outsidePoints:" << selectOutside <<
nl
374 (void)edgeCalc.minLen(
Info);
377 forAll(outsidePts, outsideI)
379 const point& outsidePoint = outsidePts[outsideI];
386 <<
"outsidePoint " << outsidePoint
387 <<
" is not inside any cell"
415 surf().writeStats(
Info);
440 label nHanging, nRegionEdges, nRegionPoints, nOutside;
444 Info<<
"Removing cells which after subsetting would have all points"
445 <<
" on outside ..." <<
nl <<
endl;
455 Info<<
"Removing edges connecting cells unconnected by faces ..."
466 Info<<
"Removing points connecting cells unconnected by faces ..."
482 nOutside = selectOutsideCells(
mesh, outsidePts, cellType);
488 || nRegionPoints != 0
493 getType(cellType, MESH, selectedCells);
495 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.
void shrink()
Shrink the allocated table to approx. twice number of elements.
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.
static label findCellNoTree(const polyMesh &mesh, const point &p, const pointInCellShapes=pointInCellShapes::tets)
Find the cell containing the given point. Do a.
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.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
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.