Loading...
Searching...
No Matches
refinementFeatures Class Reference

Encapsulates queries for features. More...

#include <refinementFeatures.H>

Inheritance diagram for refinementFeatures:
Collaboration diagram for refinementFeatures:

Public Member Functions

 refinementFeatures (const objectRegistry &io, const PtrList< dictionary > &featDicts, const bool dryRun=false)
 Construct from description.
const labelListListlevels () const
 Per featureEdgeMesh the list of level.
const List< scalarField > & distances () const
 Per featureEdgeMesh the list of ranges.
scalar maxDistance () const
 Highest distance of all features.
void findNearestEdge (const pointField &samples, const scalarField &nearestDistSqr, labelList &nearFeature, List< pointIndexHit > &nearInfo, vectorField &nearNormal) const
 Find nearest point on nearest feature edge. Sets.
void findNearestRegionEdge (const pointField &samples, const scalarField &nearestDistSqr, labelList &nearFeature, List< pointIndexHit > &nearInfo, vectorField &nearNormal) const
 Find nearest point on nearest region edge. Sets.
void findNearestPoint (const pointField &samples, const scalarField &nearestDistSqr, labelList &nearFeature, List< pointIndexHit > &nearInfo) const
 Find nearest feature point. Sets.
void findHigherLevel (const pointField &pt, const labelList &ptLevel, labelList &maxLevel) const
 Find shell level higher than ptLevel.
bool checkSizes (const scalar maxRatio, const boundBox &meshBb, const bool report, Ostream &os) const
 Check sizes - return true if error and stream to os.
Public Member Functions inherited from PtrList< extendedFeatureEdgeMesh >
Foam::PtrList< extendedFeatureEdgeMeshclone (Args &&... args) const
constexpr PtrList () noexcept
 Default construct.
 ~PtrList ()
 Destructor. Frees all pointers.
const extendedFeatureEdgeMeshset (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
void clear ()
 Clear the PtrList. Delete allocated entries and set size to zero.
void free ()
 Free memory and nullify all entries. Does not change the list size.
void resize (const label newLen)
 Adjust size of PtrList.
void resize_null (const label newLen)
 Set the addressed list to the given size, deleting all existing entries. Afterwards the list contains all nullptr entries.
extendedFeatureEdgeMeshemplace_back (Args &&... args)
 Construct and append an element to the end of the list, return reference to the new list element.
void push_back (extendedFeatureEdgeMesh *ptr)
 Append an element to the end of the list.
extendedFeatureEdgeMeshemplace_set (const label i, Args &&... args)
 Construct and set a new element at given position, (discard old element at that location).
extendedFeatureEdgeMeshemplace (const label i, Args &&... args)
 Same as emplace_set().
extendedFeatureEdgeMeshtry_emplace (const label i, Args &&... args)
 Like emplace_set() but will not overwrite an occupied (non-null) location.
autoPtr< extendedFeatureEdgeMeshrelease (const label i)
 Release ownership of the pointer at the given position.
void transfer (PtrList< extendedFeatureEdgeMesh > &list)
 Transfer into this list and annul the argument list.
void operator= (const UPtrList< extendedFeatureEdgeMesh > &list)
 Copy assignment.
void setSize (const label n)
 Same as resize().
void append (autoPtr< extendedFeatureEdgeMesh > &ptr)
 Move append an element to the end of the list.
Public Member Functions inherited from UPtrList< extendedFeatureEdgeMesh >
bool empty () const noexcept
 True if the list is empty (ie, size() is zero).
label size () const noexcept
 The number of entries in the list.
label capacity () const noexcept
 Size of the underlying storage.
label count_nonnull () const noexcept
 The number of non-nullptr entries in the list.
extendedFeatureEdgeMeshfront ()
 Reference to the first element of the list.
extendedFeatureEdgeMeshback ()
 Reference to the last element of the list.
const extendedFeatureEdgeMeshtest (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
const extendedFeatureEdgeMeshget (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
const extendedFeatureEdgeMeshset (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
void clear ()
 Set list size to zero.
void free ()
 Nullify all entries. Does not change the list size.
void resize (const label newLen)
 Change the size of the list. Any new entries are nullptr.
void resize_null (const label newLen)
 Set the list to the given size and set all entries to nullptr.
label squeezeNull ()
 Squeeze out nullptr entries in the list of pointers after which any null pointers will be at the end of the list.
void push_back (extendedFeatureEdgeMesh *ptr)
 Append an element to the end of the list.
void swap (UPtrList< extendedFeatureEdgeMesh > &list) noexcept
 Swap content.
void transfer (UPtrList< extendedFeatureEdgeMesh > &list)
 Transfer contents into this list and annul the argument.
void reorder (const labelUList &oldToNew, const bool check=false)
 Reorder elements. Reordering must be unique (ie, shuffle).
void sortOrder (const labelUList &order, const bool check=false)
 Reorder elements according to new order mapping (newToOld). Reordering must be unique (ie, shuffle).
void checkNonNull () const
 Check and raise FatalError if any nullptr exists in the list.
const extendedFeatureEdgeMeshat (const label i) const
 Return const reference to the element at given position. FatalError for bounds problem or nullptr.
const extendedFeatureEdgeMeshoperator[] (const label i) const
 Return const reference to the element at given position. FatalError for bounds problem or nullptr. Same as at().
 FOAM_DEPRECATED_FOR (2022-09, "get(), set() or test() methods") const extendedFeatureEdgeMesh *operator()(const label i) const
 Deprecated(2022-09) - same as get().
void operator= (const UPtrList< extendedFeatureEdgeMesh > &list)
 Copy assignment (shallow copies addresses).
OstreamprintAddresses (Ostream &os) const
 Print pointer addresses to Ostream (debugging only).
OstreamwriteList (Ostream &os, const bool trimNull=false) const
 Write UPtrList to Ostream, optionally ignoring null entries.
extendedFeatureEdgeMesh ** begin_ptr () noexcept
 Iterator to begin of raw pointers traversal (use with caution).
extendedFeatureEdgeMesh ** end_ptr () noexcept
 Iterator beyond end of raw pointers traversal (use with caution).
iterator begin ()
 Return iterator to begin traversal of non-nullptr entries.
iterator end () noexcept
 Return iterator beyond end of UPtrList traversal.
const_iterator cbegin () const
 Return const_iterator to begin traversal of non-nullptr entries.
const_iterator cend () const noexcept
 Return const_iterator beyond end of UPtrList traversal.
void setSize (const label n)
 Alias for resize().
extendedFeatureEdgeMeshfirst ()
 Reference to the first element of the list.
extendedFeatureEdgeMeshlast ()
 Return reference to the last element of the list.
void append (extendedFeatureEdgeMesh *ptr)
 Append an element to the end of the list.
label count () const noexcept
 The number of non-nullptr entries in the list.

Protected Member Functions

const PtrList< indexedOctree< treeDataEdge > > & edgeTrees () const
const PtrList< indexedOctree< treeDataPoint > > & pointTrees () const
const PtrList< indexedOctree< treeDataEdge > > & regionEdgeTrees () const
Protected Member Functions inherited from PtrList< extendedFeatureEdgeMesh >
void readIstream (Istream &is, const INew &inew)
 Read from Istream using Istream constructor class.
Protected Member Functions inherited from UPtrList< extendedFeatureEdgeMesh >
void setAddressableSize (const label n) noexcept
 Adjust addressable size.
label find_next (label pos) const
 The next non-null entry after the specified position.
 UPtrList (Detail::PtrListDetail< extendedFeatureEdgeMesh > &&ptrs) noexcept
 Low-level move construct.

Additional Inherited Members

Public Types inherited from UPtrList< extendedFeatureEdgeMesh >
typedef extendedFeatureEdgeMesh value_type
 Type of values the list contains.
typedef extendedFeatureEdgeMeshreference
 A non-const reference to the value_type.
typedef const extendedFeatureEdgeMeshconst_reference
 A const reference to the value_type.
Protected Attributes inherited from UPtrList< extendedFeatureEdgeMesh >
Detail::PtrListDetail< extendedFeatureEdgeMeshptrs_
 The list of pointers.

Detailed Description

Encapsulates queries for features.

Source files

Definition at line 49 of file refinementFeatures.H.

Constructor & Destructor Documentation

◆ refinementFeatures()

refinementFeatures ( const objectRegistry & io,
const PtrList< dictionary > & featDicts,
const bool dryRun = false )

Construct from description.

Definition at line 458 of file refinementFeatures.C.

References forAll, io, PtrList< extendedFeatureEdgeMesh >::PtrList(), and UPtrList< extendedFeatureEdgeMesh >::size().

Here is the call graph for this function:

Member Function Documentation

◆ edgeTrees()

const PtrList< indexedOctree< treeDataEdge > > & edgeTrees ( ) const
inlineprotected

Definition at line 112 of file refinementFeatures.H.

References PtrList< extendedFeatureEdgeMesh >::PtrList().

Here is the call graph for this function:

◆ pointTrees()

const PtrList< indexedOctree< treeDataPoint > > & pointTrees ( ) const
inlineprotected

Definition at line 117 of file refinementFeatures.H.

References PtrList< extendedFeatureEdgeMesh >::PtrList().

Here is the call graph for this function:

◆ regionEdgeTrees()

◆ levels()

const labelListList & levels ( ) const
inline

Per featureEdgeMesh the list of level.

Definition at line 147 of file refinementFeatures.H.

◆ distances()

const List< scalarField > & distances ( ) const
inline

Per featureEdgeMesh the list of ranges.

Definition at line 155 of file refinementFeatures.H.

◆ maxDistance()

Foam::scalar maxDistance ( ) const

Highest distance of all features.

Definition at line 858 of file refinementFeatures.C.

References forAll, and Foam::max().

Here is the call graph for this function:

◆ findNearestEdge()

void findNearestEdge ( const pointField & samples,
const scalarField & nearestDistSqr,
labelList & nearFeature,
List< pointIndexHit > & nearInfo,
vectorField & nearNormal ) const

Find nearest point on nearest feature edge. Sets.

  • nearFeature: index of feature mesh
  • nearInfo : location on feature edge and edge index (note: not feature edge index but index into edges() directly)
  • nearNormal : local feature edge normal

Definition at line 625 of file refinementFeatures.C.

References treeDataEdge::empty(), forAll, PointIndexHit< PointType >::hit(), PointIndexHit< PointType >::index(), treeDataEdge::line(), treeDataEdge::objectIndex(), PointIndexHit< PointType >::point(), samples(), List< T >::setSize(), tree(), line< Point, PointRef >::unitVec(), and Foam::Zero.

Here is the call graph for this function:

◆ findNearestRegionEdge()

void findNearestRegionEdge ( const pointField & samples,
const scalarField & nearestDistSqr,
labelList & nearFeature,
List< pointIndexHit > & nearInfo,
vectorField & nearNormal ) const

Find nearest point on nearest region edge. Sets.

  • nearFeature: index of feature mesh
  • nearInfo : location on feature edge and edge index (note: not feature edge index but index into edges() directly)
  • nearNormal : local feature edge normal

Definition at line 681 of file refinementFeatures.C.

References forAll, PointIndexHit< PointType >::hit(), PointIndexHit< PointType >::index(), treeDataEdge::line(), treeDataEdge::objectIndex(), PointIndexHit< PointType >::point(), PtrList< extendedFeatureEdgeMesh >::PtrList(), regionEdgeTrees(), samples(), List< T >::setSize(), indexedOctree< Type >::shapes(), line< Point, PointRef >::unitVec(), and Foam::Zero.

Here is the call graph for this function:

◆ findNearestPoint()

void findNearestPoint ( const pointField & samples,
const scalarField & nearestDistSqr,
labelList & nearFeature,
List< pointIndexHit > & nearInfo ) const

Find nearest feature point. Sets.

  • nearFeature: index of feature mesh
  • nearInfo : location on feature point and point index. (note: not index into shapes().pointLabels() but index into points() directly)

Definition at line 789 of file refinementFeatures.C.

References forAll, PointIndexHit< PointType >::hit(), PointIndexHit< PointType >::index(), PointIndexHit< PointType >::point(), samples(), List< T >::setSize(), and tree().

Here is the call graph for this function:

◆ findHigherLevel()

void findHigherLevel ( const pointField & pt,
const labelList & ptLevel,
labelList & maxLevel ) const

Find shell level higher than ptLevel.

Definition at line 841 of file refinementFeatures.C.

References forAll.

◆ checkSizes()

bool checkSizes ( const scalar maxRatio,
const boundBox & meshBb,
const bool report,
Ostream & os ) const

Check sizes - return true if error and stream to os.

Definition at line 555 of file refinementFeatures.C.

References Foam::endl(), forAll, boundBox::mag(), meshBb(), IOobject::name(), Foam::nl, UPtrList< extendedFeatureEdgeMesh >::operator[](), os(), edgeMesh::points(), Foam::returnReduceOr(), and UPtrList< extendedFeatureEdgeMesh >::size().

Here is the call graph for this function:

The documentation for this class was generated from the following files: