Go to the documentation of this file.
37 #ifndef indexedOctree_H
38 #define indexedOctree_H
55 template<
class Type>
class indexedOctree;
56 template<
class Type> Ostream&
operator<<(Ostream&,
const indexedOctree<Type>&);
74 public indexedOctreeName
102 return is >>
n.bb_ >>
n.parent_ >>
n.subNodes_;
128 static scalar perturbTol_;
154 const scalar nearestDistSqr,
188 static label compactContents
192 const label compactLevel,
201 volumeType calcVolumeType(
const label nodeI)
const;
210 template<
class FindNearestOp>
217 label& nearestShapeI,
221 const FindNearestOp& fnOp
227 const label parentNodeI,
233 static point pushPoint
237 const bool pushInside
242 static point pushPoint
247 const bool pushInside
255 static point pushPointIntoFace
289 template<
class FindIntersectOp>
293 const point& treeStart,
304 const FindIntersectOp& fiOp
308 template<
class FindIntersectOp>
312 const point& treeStart,
313 const point& treeEnd,
314 const label startNodeI,
316 const FindIntersectOp& fiOp,
317 const bool verbose =
false
321 template<
class FindIntersectOp>
327 const FindIntersectOp& fiOp
344 const scalar radiusSqr,
349 template<
class CompareOp>
352 const scalar nearDist,
367 label countElements(
const labelBits index)
const;
370 void writeOBJ(
const label nodeI,
const direction octant)
const;
383 static labelBits nodePlusOctant
389 return labelBits(i + 1, octant);
393 static labelBits emptyPlusOctant
398 return labelBits(0, octant);
416 const List<node>&
nodes,
424 const treeBoundBox&
bb,
425 const label maxLevels,
426 const scalar maxLeafRatio,
427 const scalar maxDuplicity
445 const Type&
shapes()
const
471 return nodes_[0].bb_;
529 const scalar nearestDistSqr
537 template<
class FindNearestOp>
541 const scalar nearestDistSqr,
543 const FindNearestOp& fnOp
547 template<
class FindNearestOp>
553 scalar& nearestDistSqr,
554 label& nearestShapeI,
557 const FindNearestOp& fnOp
574 template<
class FindNearestOp>
581 const FindNearestOp& fnOp
599 template<
class FindIntersectOp>
604 const FindIntersectOp& fiOp
608 template<
class FindIntersectOp>
613 const FindIntersectOp& fiOp
626 const scalar radiusSqr
649 const vector& outsideNormal,
659 const scalar nearestDistSqr,
665 template<
class CompareOp>
668 const scalar nearDist,
681 const bool printContents,
FixedList< labelBits, 8 > subNodes_
IDs of the 8 nodes on all sides of the mid point.
label parent_
Parent node (index into nodes_ of tree)
A class for handling words, derived from Foam::string.
indexedOctree(const Type &shapes)
Construct null.
friend Istream & operator>>(Istream &is, node &n)
A 29bits label and 3bits direction packed into single label.
static bool isContent(const labelBits i)
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Standard boundBox with extra functionality for use in octree.
static bool isNode(const labelBits i)
Tree node. Has up pointer and down pointers.
const List< node > & nodes() const
List of all nodes.
const Type & shapes() const
Reference to shape.
treeBoundBox bb_
Bounding box of this node.
pointIndexHit findLineAny(const point &start, const point &end) const
Find any intersection of line between start and end.
static label getNode(const labelBits i)
autoPtr< indexedOctree< Type > > clone() const
Clone.
static scalar & perturbTol()
Get the perturbation tolerance.
label facePoint(const int facei, const block &block, const label i, const label j)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Version of OSstream that prints a prefix on each line.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
An enumeration wrapper for classification of a location as being inside/outside of a volume.
labelBits findNode(const label nodeI, const point &) const
Find deepest node (as parent+octant) containing point. Starts.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
friend bool operator!=(const node &a, const node &b)
const labelListList & contents() const
List of all contents (referenced by those nodes that are.
Non-pointer based hierarchical recursive searching.
TemplateName(blendedSchemeBase)
label findInside(const point &) const
Find shape containing point. Only implemented for certain.
void print(prefixOSstream &, const bool printContents, const label) const
Print tree. Either print all indices (printContent = true) or.
OBJstream os(runTime.globalPath()/outputName)
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
errorManip< error > abort(error &err)
static direction getOctant(const labelBits i)
friend Ostream & operator<<(Ostream &os, const node &n)
const treeBoundBox & bb() const
Top bounding box.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
static bool isEmpty(const labelBits i)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
List< labelList > labelListList
A List of labelList.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static label getContent(const labelBits i)
static volumeType getSide(const vector &outsideNormal, const vector &vec)
Helper function to return the side. Returns outside if.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T> with a fixed length <N>.
const labelList & findIndices(const point &) const
Find the shape indices that occupy the result of findNode.
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
friend bool operator==(const node &a, const node &b)
PackedList< 2 > & nodeTypes() const
Per node, per octant whether is fully inside/outside/mixed.
Minimal example by using system/controlDict.functions:
bool write(Ostream &os) const