Go to the documentation of this file.
77 # pragma omp parallel for schedule(dynamic, 40)
81 bool intersected(
false);
86 boundBox bb(cellCentres[cellI], cellCentres[cellI]);
90 const face&
f = faces[
c[fI]];
100 bb.
max() += spanCorr;
101 bb.
min() -= spanCorr;
128 boundBox obb(sp[tri[0]], sp[tri[0]]);
129 for(
label i=1;i<3;++i)
131 const point& v = sp[tri[i]];
136 const vector spanTriCorr = SMALL * obb.
span();
137 obb.
min() -= spanTriCorr;
138 obb.
max() += spanTriCorr;
141 reasonableCandidates.
insert(tIter.key());
144 triangles.
transfer(reasonableCandidates);
159 const point&
p = sp[nIter.key()];
164 bool foundIntersection(
false);
167 const face&
f = faces[
c[fI]];
169 if( owner[
c[fI]] == cellI )
188 pointFacets(nIter.key(), ptI)
192 foundIntersection =
true;
197 if( foundIntersection )
219 pointFacets(nIter.key(), ptI)
223 foundIntersection =
true;
228 if( foundIntersection )
238 if( facetsInCell.
found(tIter.key()) )
243 const face&
f = faces[
c[fI]];
257 facetsInCell.
insert(tIter.key());
268 # pragma omp critical
287 octreeGenerated_(
false),
289 facetsIntersectingCell_()
291 findIntersectedCells();
302 octreeGenerated_(
true),
304 facetsIntersectingCell_()
308 findIntersectedCells();
333 const word subsetName
336 const label setId = mesh_.addCellSubset(subsetName);
338 forAll(intersectedCells_, cellI)
339 if( intersectedCells_[cellI] )
340 mesh_.addCellToSubset(setId, cellI);
const labelList & owner() const
owner and neighbour cells for faces
const VRWGraph & facetsIntersectingCells() const
return the graph of facets intersecting each cell
const polyMeshGenAddressing & addressingData() const
addressing which may be needed
bool doFaceAndTriangleIntersect(const triSurf &surface, const label triI, const face &f, const pointField &facePoints)
check if the surface triangle and the face intersect
const vectorField & faceCentres() const
A class for handling words, derived from string.
const point & max() const
Maximum describing the bounding box.
const bool octreeGenerated_
check whether the octree was generated or not
List< Key > toc() const
Return the table of contents.
void setRow(const label rowI, const ListType &l)
Set row with the list.
#define forAll(list, i)
Loop across all elements in list.
void generateOctree(const triSurf &)
generate the octree
void transfer(HashTable< T, Key, Hash > &)
Transfer the contents of the argument table into this table.
boolList intersectedCells_
stores information about intersected cells
const vectorField & cellCentres() const
const pointField & points() const
access to points
bool hasContainedElements() const
return true if the box contains some triangles
const pointFieldPMG & points() const
access to points
polyMeshGen & mesh_
Reference to the mesh.
void findLeavesContainedInBox(const boundBox &, DynList< const meshOctreeCube *, 256 > &) const
find leaves contained in the box
const faceListPMG & faces() const
access to faces
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
vector span() const
The bounding box span (from minimum to maximum)
void deleteDemandDrivenData(DataPtr &dataPtr)
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.
bool overlaps(const boundBox &) const
Overlaps/touches boundingBox?
const cellListPMG & cells() const
access to cells
void createOctreeWithRefinedBoundary(const direction maxLevel, const label nTrianglesInLeaf=15)
void setSize(const label)
Reset the number of rows.
#define forAllRow(graph, rowI, index)
const point & min() const
Minimum describing the bounding box.
const VRWGraph & pointFacets() const
return point-facets addressing
Raster intersect(const Raster &rast1, const Raster &rast2)
const meshOctreeSlot * slotPtr() const
return the pointer to the slot containing the cube
bool found(const Key &) const
Return true if hashedEntry is found in table.
bool pointInTetrahedron(const point &p, const tetrahedron< point, point > &tet)
check if a vertex lies inside the tetrahedron
findCellsIntersectingSurface(polyMeshGen &mesh, const meshOctree &octree)
Construct from mesh and octree.
~findCellsIntersectingSurface()
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
void setSize(const label)
Reset size of List.
meshOctree * octreePtr_
Pointer to the octree.
VRWGraph containedTriangles_
surface triangles contained in an octree cube
const boolList & intersectedCells() const
return the list of intersected cells;
bool contains(const point &) const
Contains point? (inside or on edge)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
VRWGraph facetsIntersectingCell_
stores information which surface facets intersect each cell
void addIntersectedCellsToSubset(const word subsetName="intersectedCells")
create a cell subset containing intersected cells
bool insert(const Key &key)
Insert a new entry.
Triangle with additional region number.
A bounding box defined in terms of the points at its extremities.
const dimensionedScalar c
Speed of light in a vacuum.
A face is a list of labels corresponding to mesh vertices.
label containedElements() const
const triSurf & surface() const
return a reference to the surface
void findIntersectedCells()
check for the intersected cells
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
A cell is defined as a list of faces with extra functionality.
LongList< meshOctreeCube * > & leavesAccess()
return leaves