Container for searchableSurfaces. The collection is specified as a dictionary. For example,. More...
#include <searchableSurfaces.H>


Public Member Functions | |
| ClassName ("searchableSurfaces") | |
| searchableSurfaces (const label) | |
| Construct with length specified. Fill later. | |
| searchableSurfaces (const IOobject &, const dictionary &, const bool singleRegionName) | |
| Construct from dictionary. | |
| const wordList & | names () const |
| Surface names, not region names. | |
| wordList & | names () |
| Surface names, not region names. | |
| const List< wordList > & | regionNames () const |
| Region names per surface. | |
| List< wordList > & | regionNames () |
| Region names per surface. | |
| label | findSurfaceID (const word &name) const |
| Find index of surface. Return -1 if not found. | |
| label | findSurfaceRegionID (const word &surfaceName, const word ®ionName) const |
| void | findAnyIntersection (const pointField &start, const pointField &end, labelList &surfaces, List< pointIndexHit > &) const |
| Find any intersection. Return hit point information and. | |
| void | findAllIntersections (const pointField &start, const pointField &end, labelListList &surfaces, List< List< pointIndexHit > > &) const |
| Find all intersections in order from start to end. Returns for. | |
| void | findNearestIntersection (const pointField &start, const pointField &end, labelList &surface1, List< pointIndexHit > &hit1, labelList &surface2, List< pointIndexHit > &hit2) const |
| void | findNearest (const pointField &, const scalarField &nearestDistSqr, labelList &surfaces, List< pointIndexHit > &) const |
| Find nearest. Return -1 (and a miss()) or surface and nearest. | |
| void | findNearest (const labelListList ®ionIndices, const pointField &samples, const scalarField &nearestDistSqr, labelList &nearestSurfaces, List< pointIndexHit > &nearestInfo) const |
| boundBox | bounds () const |
| Calculate bounding box. | |
| bool | checkClosed (const bool report) const |
| Are all surfaces closed and manifold. | |
| bool | checkNormalOrientation (const bool report) const |
| Are all (triangulated) surfaces consistent normal orientation. | |
| bool | checkSizes (const scalar maxRatio, const bool report) const |
| Are all bounding boxes of similar size. | |
| bool | checkIntersection (const scalar tol, autoPtr< coordSetWriter > &setWriter, const bool report) const |
| Do surfaces self-intersect or intersect others. | |
| bool | checkQuality (const scalar minQuality, const bool report) const |
| Check triangle quality. | |
| label | checkTopology (const bool report) const |
| All topological checks. Return number of failed checks. | |
| label | checkGeometry (const scalar maxRatio, const scalar tolerance, autoPtr< coordSetWriter > &setWriter, const scalar minQuality, const bool report) const |
| All geometric checks. Return number of failed checks. | |
| void | writeStats (const List< wordList > &, Ostream &) const |
| Write some stats. | |
| const searchableSurface & | operator[] (const word &) const |
| Return const reference to searchableSurface by name. | |
| searchableSurface & | operator[] (const word &) |
| Return reference to searchableSurface by name. | |
| Public Member Functions inherited from PtrList< searchableSurface > | |
| Foam::PtrList< searchableSurface > | clone (Args &&... args) const |
| constexpr | PtrList () noexcept |
| Default construct. | |
| ~PtrList () | |
| Destructor. Frees all pointers. | |
| const searchableSurface * | set (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. | |
| searchableSurface & | emplace_back (Args &&... args) |
| Construct and append an element to the end of the list, return reference to the new list element. | |
| void | push_back (searchableSurface *ptr) |
| Append an element to the end of the list. | |
| searchableSurface & | emplace_set (const label i, Args &&... args) |
| Construct and set a new element at given position, (discard old element at that location). | |
| searchableSurface & | emplace (const label i, Args &&... args) |
| Same as emplace_set(). | |
| searchableSurface & | try_emplace (const label i, Args &&... args) |
| Like emplace_set() but will not overwrite an occupied (non-null) location. | |
| autoPtr< searchableSurface > | release (const label i) |
| Release ownership of the pointer at the given position. | |
| void | transfer (PtrList< searchableSurface > &list) |
| Transfer into this list and annul the argument list. | |
| void | operator= (const UPtrList< searchableSurface > &list) |
| Copy assignment. | |
| void | setSize (const label n) |
| Same as resize(). | |
| void | append (autoPtr< searchableSurface > &ptr) |
| Move append an element to the end of the list. | |
| Public Member Functions inherited from UPtrList< searchableSurface > | |
| 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. | |
| searchableSurface & | front () |
| Reference to the first element of the list. | |
| searchableSurface & | back () |
| Reference to the last element of the list. | |
| const searchableSurface * | test (const label i) const |
| Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking). | |
| const searchableSurface * | get (const label i) const |
| Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking). | |
| const searchableSurface * | set (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 (searchableSurface *ptr) |
| Append an element to the end of the list. | |
| void | swap (UPtrList< searchableSurface > &list) noexcept |
| Swap content. | |
| void | transfer (UPtrList< searchableSurface > &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 searchableSurface & | at (const label i) const |
| Return const reference to the element at given position. FatalError for bounds problem or nullptr. | |
| const searchableSurface & | operator[] (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 searchableSurface *operator()(const label i) const | |
| Deprecated(2022-09) - same as get(). | |
| void | operator= (const UPtrList< searchableSurface > &list) |
| Copy assignment (shallow copies addresses). | |
| Ostream & | printAddresses (Ostream &os) const |
| Print pointer addresses to Ostream (debugging only). | |
| Ostream & | writeList (Ostream &os, const bool trimNull=false) const |
| Write UPtrList to Ostream, optionally ignoring null entries. | |
| searchableSurface ** | begin_ptr () noexcept |
| Iterator to begin of raw pointers traversal (use with caution). | |
| searchableSurface ** | 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(). | |
| searchableSurface & | first () |
| Reference to the first element of the list. | |
| searchableSurface & | last () |
| Return reference to the last element of the list. | |
| void | append (searchableSurface *ptr) |
| Append an element to the end of the list. | |
| label | count () const noexcept |
| The number of non-nullptr entries in the list. | |
Additional Inherited Members | |
| Public Types inherited from UPtrList< searchableSurface > | |
| typedef searchableSurface | value_type |
| Type of values the list contains. | |
| typedef searchableSurface & | reference |
| A non-const reference to the value_type. | |
| typedef const searchableSurface & | const_reference |
| A const reference to the value_type. | |
| Protected Member Functions inherited from PtrList< searchableSurface > | |
| void | readIstream (Istream &is, const INew &inew) |
| Read from Istream using Istream constructor class. | |
| Protected Member Functions inherited from UPtrList< searchableSurface > | |
| 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< searchableSurface > &&ptrs) noexcept | |
| Low-level move construct. | |
| Protected Attributes inherited from UPtrList< searchableSurface > | |
| Detail::PtrListDetail< searchableSurface > | ptrs_ |
| The list of pointers. | |
Container for searchableSurfaces. The collection is specified as a dictionary. For example,.
geometry
{
surface1
{
type ...;
}
surface2
{
type ...;
}
}
The Sub-dictionary parameters
| Property | Description | Required | Default |
|---|---|---|---|
name | alternative name for surface | no | dict name |
regions | Region names sub-dictionary | no |
Definition at line 89 of file searchableSurfaces.H.
|
explicit |
Construct with length specified. Fill later.
Definition at line 92 of file searchableSurfaces.C.
References Foam::identity(), PtrList< searchableSurface >::PtrList(), and UPtrList< searchableSurface >::size().

| searchableSurfaces | ( | const IOobject & | io, |
| const dictionary & | topDict, | ||
| const bool | singleRegionName ) |
Construct from dictionary.
| singleRegionName | controls if names are constructed as surfaceName "_" regionName (singleRegionName false) or for single region surfaces as surfaceName only (singleRegionName true) |
Definition at line 190 of file searchableSurfaces.C.
References dict, Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::identity(), io, searchableSurface::New(), operator[](), PtrList< searchableSurface >::PtrList(), s(), PtrList< searchableSurface >::set(), List< T >::setSize(), UList< T >::size(), UPtrList< searchableSurface >::size(), and dictionary::subDict().

| ClassName | ( | "searchableSurfaces" | ) |
|
inline |
Surface names, not region names.
Definition at line 172 of file searchableSurfaces.H.
|
inline |
Surface names, not region names.
Definition at line 180 of file searchableSurfaces.H.
Region names per surface.
Definition at line 188 of file searchableSurfaces.H.
Region names per surface.
Definition at line 196 of file searchableSurfaces.H.
| Foam::label findSurfaceID | ( | const word & | name | ) | const |
Find index of surface. Return -1 if not found.
Definition at line 302 of file searchableSurfaces.C.
Referenced by findSurfaceRegionID(), operator[](), and operator[]().

Definition at line 311 of file searchableSurfaces.C.
References findSurfaceID(), operator[](), and regionName.

| void findAnyIntersection | ( | const pointField & | start, |
| const pointField & | end, | ||
| labelList & | surfaces, | ||
| List< pointIndexHit > & | hitInfo ) const |
Find any intersection. Return hit point information and.
surface number. If multiple surfaces hit the first surface is returned, not necessarily the nearest (to start).
Definition at line 324 of file searchableSurfaces.C.
References UPtrList< searchableSurface >::end(), and searchableSurfacesQueries::findAnyIntersection().

| void findAllIntersections | ( | const pointField & | start, |
| const pointField & | end, | ||
| labelListList & | surfaces, | ||
| List< List< pointIndexHit > > & | hitInfo ) const |
Find all intersections in order from start to end. Returns for.
every hit the surface and the hit info.
Definition at line 344 of file searchableSurfaces.C.
References UPtrList< searchableSurface >::end(), and searchableSurfacesQueries::findAllIntersections().

| void findNearestIntersection | ( | const pointField & | start, |
| const pointField & | end, | ||
| labelList & | surface1, | ||
| List< pointIndexHit > & | hit1, | ||
| labelList & | surface2, | ||
| List< pointIndexHit > & | hit2 ) const |
Definition at line 365 of file searchableSurfaces.C.
References UPtrList< searchableSurface >::end(), and searchableSurfacesQueries::findNearestIntersection().

| void findNearest | ( | const pointField & | samples, |
| const scalarField & | nearestDistSqr, | ||
| labelList & | surfaces, | ||
| List< pointIndexHit > & | nearestInfo ) const |
Find nearest. Return -1 (and a miss()) or surface and nearest.
point.
Definition at line 389 of file searchableSurfaces.C.
References searchableSurfacesQueries::findNearest(), and samples().

| void findNearest | ( | const labelListList & | regionIndices, |
| const pointField & | samples, | ||
| const scalarField & | nearestDistSqr, | ||
| labelList & | nearestSurfaces, | ||
| List< pointIndexHit > & | nearestInfo ) const |
Definition at line 409 of file searchableSurfaces.C.
References searchableSurfacesQueries::findNearest(), and samples().

| Foam::boundBox bounds | ( | ) | const |
Calculate bounding box.
Definition at line 433 of file searchableSurfaces.C.
References searchableSurfacesQueries::bounds().

| bool checkClosed | ( | const bool | report | ) | const |
Are all surfaces closed and manifold.
Definition at line 443 of file searchableSurfaces.C.
References Foam::endl(), forAll, Foam::Info, Foam::isA(), names, Foam::nl, operator[](), Foam::returnReduceOr(), s(), and UPtrList< searchableSurface >::size().
Referenced by checkTopology().


| bool checkNormalOrientation | ( | const bool | report | ) | const |
Are all (triangulated) surfaces consistent normal orientation.
Definition at line 510 of file searchableSurfaces.C.
References PatchTools::checkOrientation(), Foam::endl(), forAll, Foam::Info, Foam::isA(), PatchTools::markZones(), names, operator[](), Foam::returnReduceOr(), and s().
Referenced by checkTopology().


| bool checkSizes | ( | const scalar | maxRatio, |
| const bool | report ) const |
Are all bounding boxes of similar size.
Definition at line 556 of file searchableSurfaces.C.
References Foam::endl(), forAll, Foam::Info, boundBox::mag(), names, Foam::nl, operator[](), Foam::returnReduceOr(), and UPtrList< searchableSurface >::size().
Referenced by checkGeometry().


| bool checkIntersection | ( | const scalar | tol, |
| autoPtr< coordSetWriter > & | setWriter, | ||
| const bool | report ) const |
Do surfaces self-intersect or intersect others.
Definition at line 604 of file searchableSurfaces.C.
References DynamicField< T, SizeMin >::append(), DynamicField< T, SizeMin >::capacity(), e, PrimitivePatch< FaceList, PointField >::edges(), UPtrList< searchableSurface >::end(), Foam::endl(), forAll, Foam::Info, Foam::isA(), PrimitivePatch< FaceList, PointField >::localPoints(), Foam::mag(), coordSet::name(), names, operator[](), IOobject::path(), Foam::returnReduceOr(), UList< T >::size(), and writer().
Referenced by checkGeometry().


| bool checkQuality | ( | const scalar | minQuality, |
| const bool | report ) const |
Check triangle quality.
Definition at line 744 of file searchableSurfaces.C.
References Foam::endl(), f(), forAll, Foam::Info, Foam::isA(), names, operator[](), triangle< Point, PointRef >::quality(), Foam::returnReduceOr(), and s().
Referenced by checkGeometry().


| Foam::label checkTopology | ( | const bool | report | ) | const |
All topological checks. Return number of failed checks.
Definition at line 809 of file searchableSurfaces.C.
References checkClosed(), and checkNormalOrientation().

| Foam::label checkGeometry | ( | const scalar | maxRatio, |
| const scalar | tolerance, | ||
| autoPtr< coordSetWriter > & | setWriter, | ||
| const scalar | minQuality, | ||
| const bool | report ) const |
All geometric checks. Return number of failed checks.
Definition at line 829 of file searchableSurfaces.C.
References checkIntersection(), checkQuality(), and checkSizes().

Write some stats.
Definition at line 859 of file searchableSurfaces.C.
References Foam::endl(), forAll, Foam::Info, Foam::isA(), names, PrimitivePatch< FaceList, PointField >::nEdges(), Foam::nl, operator[](), os(), patchTypes(), triSurfaceMesh::points(), s(), and UPtrList< searchableSurface >::size().

| const Foam::searchableSurface & operator[] | ( | const word & | surfName | ) | const |
Return const reference to searchableSurface by name.
Definition at line 904 of file searchableSurfaces.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, findSurfaceID(), Foam::nl, and operator[]().
Referenced by checkClosed(), checkIntersection(), checkNormalOrientation(), checkQuality(), checkSizes(), findSurfaceRegionID(), operator[](), operator[](), searchableSurfaces(), and writeStats().


| Foam::searchableSurface & operator[] | ( | const word & | surfName | ) |
Return reference to searchableSurface by name.
Definition at line 923 of file searchableSurfaces.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, findSurfaceID(), Foam::nl, and operator[]().
