Loading...
Searching...
No Matches
searchableSurfaces Class Reference

Container for searchableSurfaces. The collection is specified as a dictionary. For example,. More...

#include <searchableSurfaces.H>

Inheritance diagram for searchableSurfaces:
Collaboration diagram for searchableSurfaces:

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 wordListnames () const
 Surface names, not region names.
wordListnames ()
 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 &regionName) 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 &regionIndices, 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 searchableSurfaceoperator[] (const word &) const
 Return const reference to searchableSurface by name.
searchableSurfaceoperator[] (const word &)
 Return reference to searchableSurface by name.
Public Member Functions inherited from PtrList< searchableSurface >
Foam::PtrList< searchableSurfaceclone (Args &&... args) const
constexpr PtrList () noexcept
 Default construct.
 ~PtrList ()
 Destructor. Frees all pointers.
const searchableSurfaceset (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.
searchableSurfaceemplace_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.
searchableSurfaceemplace_set (const label i, Args &&... args)
 Construct and set a new element at given position, (discard old element at that location).
searchableSurfaceemplace (const label i, Args &&... args)
 Same as emplace_set().
searchableSurfacetry_emplace (const label i, Args &&... args)
 Like emplace_set() but will not overwrite an occupied (non-null) location.
autoPtr< searchableSurfacerelease (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.
searchableSurfacefront ()
 Reference to the first element of the list.
searchableSurfaceback ()
 Reference to the last element of the list.
const searchableSurfacetest (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
const searchableSurfaceget (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
const searchableSurfaceset (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 searchableSurfaceat (const label i) const
 Return const reference to the element at given position. FatalError for bounds problem or nullptr.
const searchableSurfaceoperator[] (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).
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.
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().
searchableSurfacefirst ()
 Reference to the first element of the list.
searchableSurfacelast ()
 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 searchableSurfacereference
 A non-const reference to the value_type.
typedef const searchableSurfaceconst_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< searchableSurfaceptrs_
 The list of pointers.

Detailed Description

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
Source files

Definition at line 89 of file searchableSurfaces.H.

Constructor & Destructor Documentation

◆ searchableSurfaces() [1/2]

searchableSurfaces ( const label size)
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().

Here is the call graph for this function:

◆ searchableSurfaces() [2/2]

searchableSurfaces ( const IOobject & io,
const dictionary & topDict,
const bool singleRegionName )

Construct from dictionary.

Parameters
singleRegionNamecontrols 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().

Here is the call graph for this function:

Member Function Documentation

◆ ClassName()

ClassName ( "searchableSurfaces" )

◆ names() [1/2]

const wordList & names ( ) const
inline

Surface names, not region names.

Definition at line 172 of file searchableSurfaces.H.

◆ names() [2/2]

wordList & names ( )
inline

Surface names, not region names.

Definition at line 180 of file searchableSurfaces.H.

◆ regionNames() [1/2]

const List< wordList > & regionNames ( ) const
inline

Region names per surface.

Definition at line 188 of file searchableSurfaces.H.

◆ regionNames() [2/2]

List< wordList > & regionNames ( )
inline

Region names per surface.

Definition at line 196 of file searchableSurfaces.H.

◆ findSurfaceID()

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[]().

Here is the caller graph for this function:

◆ findSurfaceRegionID()

Foam::label findSurfaceRegionID ( const word & surfaceName,
const word & regionName ) const

Definition at line 311 of file searchableSurfaces.C.

References findSurfaceID(), operator[](), and regionName.

Here is the call graph for this function:

◆ findAnyIntersection()

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().

Here is the call graph for this function:

◆ findAllIntersections()

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().

Here is the call graph for this function:

◆ findNearestIntersection()

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().

Here is the call graph for this function:

◆ findNearest() [1/2]

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().

Here is the call graph for this function:

◆ findNearest() [2/2]

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().

Here is the call graph for this function:

◆ bounds()

Foam::boundBox bounds ( ) const

Calculate bounding box.

Definition at line 433 of file searchableSurfaces.C.

References searchableSurfacesQueries::bounds().

Here is the call graph for this function:

◆ checkClosed()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkNormalOrientation()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkSizes()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkIntersection()

bool checkIntersection ( const scalar tol,
autoPtr< coordSetWriter > & setWriter,
const bool report ) const

◆ checkQuality()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkTopology()

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().

Here is the call graph for this function:

◆ checkGeometry()

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().

Here is the call graph for this function:

◆ writeStats()

void writeStats ( const List< wordList > & patchTypes,
Ostream & os ) const

◆ operator[]() [1/2]

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator[]() [2/2]

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[]().

Here is the call graph for this function:

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