Loading...
Searching...
No Matches
mappedPolyPatch Class Reference

Determines a mapping between patch face centres and mesh cell or face centres and processors they're on. More...

#include <mappedPolyPatch.H>

Inheritance diagram for mappedPolyPatch:
Collaboration diagram for mappedPolyPatch:

Public Member Functions

 TypeName ("mappedPatch")
 Runtime type information.
 mappedPolyPatch (const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
 Construct from components.
 mappedPolyPatch (const word &name, const label size, const label start, const label index, const word &sampleRegion, const mappedPatchBase::sampleMode mode, const word &samplePatch, const vectorField &offset, const polyBoundaryMesh &bm)
 Construct from components.
 mappedPolyPatch (const word &name, const label size, const label start, const label index, const word &sampleRegion, const mappedPatchBase::sampleMode mode, const word &samplePatch, const vector &offset, const polyBoundaryMesh &bm)
 Construct from components. Uniform offset.
 mappedPolyPatch (const word &name, const dictionary &dict, const label index, const polyBoundaryMesh &bm, const word &patchType)
 Construct from dictionary.
 mappedPolyPatch (const mappedPolyPatch &, const polyBoundaryMesh &)
 Construct as copy, resetting the boundary mesh.
 mappedPolyPatch (const mappedPolyPatch &pp, const polyBoundaryMesh &bm, const label index, const label newSize, const label newStart)
 Construct given the original patch and resetting the.
 mappedPolyPatch (const mappedPolyPatch &pp, const polyBoundaryMesh &bm, const label index, const labelUList &mapAddressing, const label newStart)
 Construct given the original patch and a map.
virtual autoPtr< polyPatchclone (const polyBoundaryMesh &bm) const
 Construct and return a clone, resetting the boundary mesh.
virtual autoPtr< polyPatchclone (const polyBoundaryMesh &bm, const label index, const label newSize, const label newStart) const
 Construct and return a clone, resetting the face list.
virtual autoPtr< polyPatchclone (const polyBoundaryMesh &bm, const label index, const labelUList &mapAddressing, const label newStart) const
 Construct and return a clone, resetting the face list.
virtual void newInternalProcFaces (label &iFaces, label &pFaces) const
 Return number of new internal of this polyPatch faces.
virtual const labelUListnbrCells () const
 Return nbrCells.
virtual label neighbPolyPatchID () const
 Return nbr patch ID.
virtual refPtr< labelListListmapCollocatedFaces () const
 Return collocated faces map.
virtual bool masterImplicit () const
 Return implicit master.
virtual word neighbRegionID () const
 Return neigh region ID.
virtual ~mappedPolyPatch ()
 Destructor.
virtual void write (Ostream &) const
 Write the polyPatch data as a dictionary.
Public Member Functions inherited from polyPatch
 TypeName ("patch")
 Runtime type information.
 declareRunTimeSelectionTable (autoPtr, polyPatch, word,(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType),(name, size, start, index, bm, patchType))
 declareRunTimeSelectionTable (autoPtr, polyPatch, dictionary,(const word &name, const dictionary &dict, const label index, const polyBoundaryMesh &bm, const word &patchType),(name, dict, index, bm, patchType))
 polyPatch (const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
 Construct from components.
 polyPatch (const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &physicalType, const wordList &inGroups)
 Construct from components.
 polyPatch (const word &name, const dictionary &dict, const label index, const polyBoundaryMesh &bm, const word &patchType)
 Construct from dictionary.
 polyPatch (const polyPatch &, const polyBoundaryMesh &)
 Copy construct, resetting the boundary mesh.
 polyPatch (const polyPatch &pp, const polyBoundaryMesh &bm, const label index, const label newSize, const label newStart)
 Construct given the original patch and resetting the face list and boundary mesh information.
 polyPatch (const polyPatch &pp, const polyBoundaryMesh &bm, const label index, const labelUList &mapAddressing, const label newStart)
 Construct given the original patch and a map.
 polyPatch (const polyPatch &p)
 Copy construct.
 polyPatch (const polyPatch &p, const labelList &faceCells)
 Copy construct, setting faceCells.
virtual autoPtr< polyPatchclone (const labelList &faceCells) const
 Construct and return a clone, setting faceCells.
virtual ~polyPatch ()
 Destructor.
label offset () const noexcept
 The offset where this patch starts in the boundary face list.
label start () const noexcept
 Return start label of this patch in the polyMesh face list.
labelRange range () const
 Return start/size range of this patch.
const polyBoundaryMeshboundaryMesh () const noexcept
 Return boundaryMesh reference.
virtual bool coupled () const
 Return true if this patch is geometrically coupled (i.e. faces and.
template<class T>
const UIndirectList< TpatchInternalList (const UList< T > &internalValues) const
 Extract face cell data.
template<class T>
const List< T >::subList patchSlice (const UList< T > &values) const
 This patch slice from the complete list, which has size mesh::nFaces(), using the number of patch faces.
template<class T>
const Field< T >::subField patchSlice (const Field< T > &values) const
 Slice Field to patch, using the number of patch faces.
template<class T>
const List< T >::subList boundarySlice (const UList< T > &values) const
 This patch slice from the list of boundary values, which has size mesh::nBoundaryFaces(), using the number of patch faces.
const faceList::subList faces () const
 Return mesh faces for the patch.
const labelList::subList faceOwner () const
 Return face owner for the patch.
const vectorField::subField faceCentres () const
 Return face centres.
const vectorField::subField faceAreas () const
 Return face normals.
tmp< vectorFieldfaceCellCentres () const
 Return face cell centres.
tmp< scalarFieldareaFraction (const pointField &points) const
 Calculate the area fraction as the ratio of the stored face area and the area given by the face points.
tmp< scalarFieldareaFraction () const
 Return the cached area fraction. Usually only set for the non-overlap patches on ACMI.
void areaFraction (const scalar fraction)
 Set uniform cached area fraction.
void areaFraction (const tmp< scalarField > &fraction)
 Set cached area fraction (non-uniform).
const labelUListfaceCells () const
 Return face-cell addressing.
const labelListmeshEdges () const
 Return global edge index for local edges.
virtual void clearAddressing ()
 Clear addressing.
label whichFace (const label facei) const noexcept
 Return label of face in patch from global face label.
virtual void initOrder (PstreamBuffers &, const primitivePatch &) const
 Initialize ordering for primitivePatch. Does not.
virtual bool order (PstreamBuffers &, const primitivePatch &, labelList &faceMap, labelList &rotation) const
 Return new ordering for primitivePatch.
virtual bool changeTopology () const
 For dynamic mesh cases - return true if this patch will change the topology.
virtual bool setTopology (polyTopoChange &)
 Collect topology changes in a polyTopoChange object.
void operator= (const polyPatch &p)
 Copy assignment.
Public Member Functions inherited from patchIdentifier
 patchIdentifier (const patchIdentifier &)=default
 Copy construct.
 patchIdentifier (patchIdentifier &&)=default
 Move construct.
patchIdentifieroperator= (const patchIdentifier &)=default
 Copy assignment.
patchIdentifieroperator= (patchIdentifier &&)=default
 Move assignment.
virtual ~patchIdentifier ()=default
 Destructor.
 patchIdentifier ()
 Default construct: name="", index=0.
 patchIdentifier (const word &name, const label index)
 Construct from mandatory components.
 patchIdentifier (const word &name, const label index, const word &physicalType, const wordList &inGroups=wordList())
 Construct from components.
 patchIdentifier (const word &name, const dictionary &dict, const label index)
 Construct from dictionary.
 patchIdentifier (const patchIdentifier &ident, const label newIndex)
 Copy construct, resetting the index (if non-negative).
 patchIdentifier (patchIdentifier &&ident, const label newIndex)
 Move construct, resetting the index (if non-negative).
const wordname () const noexcept
 The patch name.
wordname () noexcept
 Modifiable patch name.
label index () const noexcept
 The index of this patch in the boundaryMesh.
label & index () noexcept
 Modifiable index of this patch in the boundaryMesh.
const wordphysicalType () const noexcept
 The (optional) physical type of the patch.
wordphysicalType () noexcept
 Modifiable (optional) physical type of the patch.
const wordListinGroups () const noexcept
 The (optional) groups that the patch belongs to.
wordListinGroups () noexcept
 Modifiable (optional) groups that the patch belongs to.
bool inGroup (const word &name) const
 True if given name is in a group.
void addGroup (const word &name)
 Add (unique) group for the patch.
void removeGroup (const word &name)
 Remove group for the patch.
void write (Ostream &os) const
 Write (physicalType, inGroups) dictionary entries (without surrounding braces).
Public Member Functions inherited from PrimitivePatch< SubList< face >, const pointField & >
 PrimitivePatch (const SubList< face > &faces, const const pointField &&points)
 Construct from components.
 PrimitivePatch (SubList< face > &&faces, const const pointField &&points)
 Construct from components, transferring faces.
 PrimitivePatch (SubList< face > &faces, const pointField &&points, const bool reuse)
 Construct from components, reuse storage.
 PrimitivePatch (const PrimitivePatch< SubList< face >, const pointField & > &pp)
 Copy construct.
virtual ~PrimitivePatch ()
 Destructor.
void clearOut ()
void clearGeom ()
void clearTopology ()
void clearPatchMeshAddr ()
void swap (PrimitivePatch &)=delete
 Suppress direct swapping, since storage containers may be const.
const Field< point_type > & points () const noexcept
 Return reference to global points.
label nFaces () const noexcept
 Number of faces in the patch.
label nPoints () const
 Number of points supporting patch faces.
label nEdges () const
 Number of edges in patch.
const edgeListedges () const
 Return list of edges, address into LOCAL point list.
const edgeList::subList internalEdges () const
 Return sub-list of internal edges, address into LOCAL point list.
const edgeList::subList boundaryEdges () const
 Return sub-list of boundary edges, address into LOCAL point list.
label nInternalEdges () const
 Number of internal edges.
label nBoundaryEdges () const
 Number of boundary edges == (nEdges() - nInternalEdges()).
bool isInternalEdge (const label edgei) const
 Is internal edge?
const labelListboundaryPoints () const
 Return list of boundary points, address into LOCAL point list.
const labelListListfaceFaces () const
 Return face-face addressing.
const labelListListedgeFaces () const
 Return edge-face addressing.
const labelListListfaceEdges () const
 Return face-edge addressing.
const labelListListpointEdges () const
 Return point-edge addressing.
const labelListListpointFaces () const
 Return point-face addressing.
const List< face_type > & localFaces () const
 Return patch faces addressing into local point list.
labelList boundaryFaces () const
 Extract list of local faces corresponding to the boundary edges.
labelList uniqBoundaryFaces () const
 Extract sorted list of unique local faces associated with the boundary edges.
const labelListmeshPoints () const
 Return labelList of mesh points in patch.
const Map< label > & meshPointMap () const
 Mesh point map.
const Field< point_type > & localPoints () const
 Return pointField of points in patch.
const labelListlocalPointOrder () const
 Return orders the local points for most efficient search.
label whichPoint (const label gp) const
 Given a global point index, return the local point index.
edge meshEdge (const label edgei) const
 From patch edge to global edge using meshPoints.
edge meshEdge (const edge &e) const
 From patch edge to global edge using meshPoints.
label findEdge (const edge &e) const
 Search for edge (local point labels) and return its index in the edge list or -1 if not found.
labelList meshEdges (const edgeList &allEdges, const labelListList &cellEdges, const labelList &faceCells) const
 Return labels of patch edges in the global edge list using cell addressing.
labelList meshEdges (const edgeList &allEdges, const labelListList &pointEdges) const
 Return labels of patch edges into the global edge list using basic edge addressing.
label meshEdge (const label edgei, const edgeList &allEdges, const labelListList &pointEdges) const
 Return label of the local patch edge into the global edge list using basic edge addressing.
labelList meshEdges (const labelUList &edgeLabels, const edgeList &allEdges, const labelListList &pointEdges) const
 Return labels of specified patch edges into the global edge list using basic edge addressing.
const Field< point_type > & faceCentres () const
 Return face centres for patch.
const Field< point_type > & faceAreas () const
 Return face area vectors for patch.
const Field< scalar > & magFaceAreas () const
 Return face area magnitudes for patch.
const Field< point_type > & faceNormals () const
 Return face unit normals for patch.
const Field< point_type > & pointNormals () const
 Return point normals for patch.
Pair< point_typebox () const
 The enclosing (bounding) box for the patch points.
scalar sphere (const label facei) const
 The enclosing (bounding) sphere radius^2 for specified face.
bool hasFaceAreas () const
bool hasFaceCentres () const
bool hasFaceNormals () const
bool hasPointNormals () const
bool hasBoundaryPoints () const
bool hasEdges () const
bool hasFaceFaces () const
bool hasEdgeFaces () const
bool hasFaceEdges () const
bool hasPointEdges () const
bool hasPointFaces () const
bool hasMeshPoints () const
bool hasMeshPointMap () const
List< objectHitprojectPoints (const ToPatch &targetPatch, const Field< point_type > &projectionDirection, const intersection::algorithm=intersection::FULL_RAY, const intersection::direction=intersection::VECTOR) const
 Project vertices of patch onto another patch.
List< objectHitprojectFaceCentres (const ToPatch &targetPatch, const Field< point_type > &projectionDirection, const intersection::algorithm=intersection::FULL_RAY, const intersection::direction=intersection::VECTOR) const
 Project vertices of patch onto another patch.
const labelListListedgeLoops () const
 Return list of closed loops of boundary vertices.
surfaceTopo surfaceType (labelHashSet *badEdgesPtr=nullptr) const
 Calculate surface type formed by patch, optionally recording the indices of illegal edges.
bool checkTopology (const bool report=false, labelHashSet *pointSetPtr=nullptr) const
 Check surface formed by patch for manifoldness (see above).
bool checkPointManifold (const bool report=false, labelHashSet *pointSetPtr=nullptr) const
 Checks primitivePatch for faces sharing point but not edge.
void operator= (const PrimitivePatch< SubList< face >, const pointField & > &rhs)
 Copy assign faces. Leave points alone (could be a reference).
void operator= (PrimitivePatch< SubList< face >, const pointField & > &&rhs)
 Move assign faces. Leave points alone (could be a reference).
label whichEdge (const edge &e) const
 Identical to findEdge.
Foam::List< Foam::objectHitprojectPoints (const ToPatch &targetPatch, const Field< typename Foam::PrimitivePatch< SubList< face >, const pointField & >::point_type > &projectionDirection, const intersection::algorithm alg, const intersection::direction dir) const
Foam::List< Foam::objectHitprojectFaceCentres (const ToPatch &targetPatch, const Field< typename Foam::PrimitivePatch< SubList< face >, const pointField & >::point_type > &projectionDirection, const intersection::algorithm alg, const intersection::direction dir) const
Public Member Functions inherited from PrimitivePatchBase
 ClassName ("PrimitivePatch")
 Runtime type information.
 PrimitivePatchBase ()=default
 Default construct.
Public Member Functions inherited from SubList< face >
 SubList () noexcept=default
 Default construct, zero-sized and nullptr.
 SubList (const SubList< face > &) noexcept=default
 Copy construct, shallow copy.
 SubList (const UList< face > &list) noexcept
 Construct from UList, the entire size.
 SubList (const FixedList< face, N > &list) noexcept
 Construct from FixedList, the entire size.
 SubList (const UList< face > &list, const label len)
 Construct from UList and sub-list size, start at 0.
 SubList (const UList< face > &list, const label len, const label start)
 Construct from UList, sub-list size and start index.
 SubList (const UList< face > &list, const labelRange &range)
 Construct from UList and a (start,size) range.
 SubList (const labelRange &range, const UList< face > &list)
 Construct from UList and a (start,size) range, but bypassing run-time range checking.
UList< face > & reset (std::nullptr_t) noexcept
 Reset to zero-sized and nullptr.
UList< face > & reset (const UList< face > &list) noexcept
 Reset to use entire UList.
UList< face > & reset (const UList< face > &list, const label len)
 Reset to use UList with sub-list size, start at 0.
UList< face > & reset (const UList< face > &list, const label len, const label start)
 Reset to use UList with sub-list size and start index.
UList< face > & reset (const UList< face > &list, const labelRange &range)
 Reset to use UList with a (start,size) range.
UList< face > & reset (const labelRange &range, const UList< face > &list)
 Reset to use UList with a (start,size) range, but bypassing run-time range checking.
 operator const Foam::List< face > & () const
 Allow cast to a const List<T>&.
void operator= (const SubList< face > &list)
 Copy assign entries (deep copy) from given sub-list. Sizes must match!
void operator= (const UList< face > &list)
 Copy assign entries (deep copy) from given list. Sizes must match!
void operator= (const IndirectListBase< face, Addr > &list)
 Copy assign entries from given indirect list. Sizes must match!
void operator= (const face &val)
 Assign all entries to the given value.
void operator= (Foam::zero)
 Assign all entries to zero.
 operator const Foam::List< face > & () const
 Allow cast to a const List<T>&.
Public Member Functions inherited from UList< face >
 UList (const UList< face > &) noexcept=default
 Copy construct, shallow copy.
 UList (UList< face > &&) noexcept=default
 Move construct, shallow copy.
UList< face > & operator= (const UList< face > &)=delete
 No copy assignment (default: shallow copy).
UList< face > & operator= (UList< face > &&) noexcept=default
 Move assignment, shallow copy.
constexpr UList () noexcept
 Default construct, zero-sized and nullptr.
 UList (face *__restrict__ ptr, const label len) noexcept
 Construct from components.
 UList (SubList< face > &&) noexcept
 Move construct from a SubList, shallow copy.
label fcIndex (const label i) const noexcept
 The forward circular index. The next index in the list which returns to the first at the end of the list.
label rcIndex (const label i) const noexcept
 The reverse circular index. The previous index in the list which returns to the last at the beginning of the list.
const facefcValue (const label i) const
 Return forward circular value (ie, next value in the list).
facefcValue (const label i)
 Return forward circular value (ie, next value in the list).
const facercValue (const label i) const
 Return reverse circular value (ie, previous value in the list).
facercValue (const label i)
 Return reverse circular value (ie, previous value in the list).
const facecdata () const noexcept
 Return pointer to the underlying array serving as data storage.
facedata () noexcept
 Return pointer to the underlying array serving as data storage.
const char * cdata_bytes () const noexcept
 Return pointer to the underlying array serving as data storage,.
char * data_bytes () noexcept
 Return pointer to the underlying array serving as data storage,.
facefront ()
 Access first element of the list, position [0].
const facefront () const
 Access first element of the list.
faceback ()
 Access last element of the list, position [size()-1].
const faceback () const
 Access last element of the list, position [size()-1].
std::streamsize size_bytes () const noexcept
 Number of contiguous bytes for the List data.
std::streamsize byteSize () const
 Number of contiguous bytes for the List data, runtime FatalError if type is not contiguous.
void checkStart (const label start) const
 Check start is within valid range [0,size).
void checkSize (const label size) const
 Check size is within valid range [0,size].
void checkRange (const label start, const label len) const
 Check that start and length define a valid range.
void checkIndex (const label i) const
 Check index is within valid range [0,size).
bool uniform () const
 True if all entries have identical values, and list is non-empty.
bool contains (const face &val) const
 True if the value is contained in the list.
bool contains (const face &val, label pos, label len=-1) const
 Is the value contained in the list?
label find (const face &val) const
 Find index of the first occurrence of the value.
label find (const face &val, label pos, label len=-1) const
 Find index of the first occurrence of the value.
label rfind (const face &val, label pos=-1) const
 Find index of the last occurrence of the value.
void moveFirst (const label i)
 Move element to the first position.
void moveLast (const label i)
 Move element to the last position.
void swapFirst (const label i)
 Swap element with the first element. Fatal on an empty list.
void swapLast (const label i)
 Swap element with the last element. Fatal on an empty list.
void shallowCopy (face *__restrict__ ptr, const label len) noexcept
 Copy the pointer and size.
void shallowCopy (std::nullptr_t) noexcept
 Copy nullptr and zero size.
void shallowCopy (const UList< face > &list) noexcept
 Copy the pointer and size held by the given UList.
void deepCopy (const UList< face > &list)
 Copy elements of the given UList. Sizes must match!
void deepCopy (const IndirectListBase< face, Addr > &list)
 Copy elements of the given indirect list. Sizes must match!
SubList< faceslice (const label pos, label len=-1)
 Return SubList slice (non-const access) - no range checking.
const SubList< faceslice (const label pos, label len=-1) const
 Return SubList slice (const access) - no range checking.
SubList< faceslice (const labelRange &range)
 Return SubList slice (non-const access) - with range checking.
const SubList< faceslice (const labelRange &range) const
 Return SubList slice (const access) - with range checking.
faceoperator[] (const label i)
 Return element of UList.
const faceoperator[] (const label i) const
 Return element of constant UList.
 operator const Foam::List< face > & () const
 Allow cast to a const List<T>&.
void operator= (const face &val)
 Assignment of all entries to the given value.
void operator= (Foam::zero)
 Assignment of all entries to zero.
iterator begin () noexcept
 Return an iterator to begin traversing the UList.
iterator end () noexcept
 Return an iterator to end traversing the UList.
iterator begin (const label i) noexcept
 Return iterator at offset i from begin, clamped to [0,size] range.
const_iterator cbegin () const noexcept
 Return const_iterator to begin traversing the constant UList.
const_iterator cend () const noexcept
 Return const_iterator to end traversing the constant UList.
const_iterator begin () const noexcept
 Return const_iterator to begin traversing the constant UList.
const_iterator end () const noexcept
 Return const_iterator to end traversing the constant UList.
const_iterator cbegin (const label i) const noexcept
 Return const_iterator at offset i from begin, clamped to [0,size] range.
const_iterator begin (const label i) const noexcept
 Return const_iterator at offset i from begin, clamped to [0,size] range.
reverse_iterator rbegin ()
 Return reverse_iterator to begin reverse traversing the UList.
reverse_iterator rend ()
 Return reverse_iterator to end reverse traversing the UList.
const_reverse_iterator crbegin () const
 Return const_reverse_iterator to begin reverse traversing the UList.
const_reverse_iterator crend () const
 Return const_reverse_iterator to end reverse traversing the UList.
const_reverse_iterator rbegin () const
 Return const_reverse_iterator to begin reverse traversing the UList.
const_reverse_iterator rend () const
 Return const_reverse_iterator to end reverse traversing the UList.
bool empty () const noexcept
 True if List is empty (ie, size() is zero).
label size () const noexcept
 The number of elements in the container.
label capacity () const noexcept
 Size of the underlying storage.
void swap (UList< face > &list) noexcept
 Swap content with another UList of the same type in constant time.
bool operator== (const UList< face > &list) const
 Equality operation on ULists of the same type.
bool operator!= (const UList< face > &list) const
 The opposite of the equality operation. Takes linear time.
bool operator< (const UList< face > &list) const
 Compare two ULists lexicographically. Takes linear time.
bool operator> (const UList< face > &list) const
 Compare two ULists lexicographically. Takes linear time.
bool operator<= (const UList< face > &list) const
 Return true if !(a > b). Takes linear time.
bool operator>= (const UList< face > &list) const
 Return true if !(a < b). Takes linear time.
IstreamreadList (Istream &is)
 Read List contents from Istream.
void writeEntry (const word &keyword, Ostream &os) const
 Write the List as a dictionary entry with keyword.
OstreamwriteList (Ostream &os, const label shortLen=0) const
 Write List, with line-breaks in ASCII when length exceeds shortLen.
bool all () const
 True if all entries are 'true' or if the list is empty.
bool any () const
 True if any entries are 'true'.
bool none () const
 True if no entries are 'true'.
bool test (const label i) const
 Test bool value at specified position, always false for out-of-range access.
bool get (const label i) const
 Return bool value at specified position, always false for out-of-range access.
bool unset (const label i)
 Unset the bool entry at specified position, always false for out-of-range access.
std::string_view view () const
 Return a string_view of the charList. Content is non-modifiable.
facefirst ()
 Access first element of the list, position [0].
const facefirst () const
 Access first element of the list.
facelast ()
 Access last element of the list, position [size()-1].
const facelast () const
 Access last element of the list, position [size()-1].
bool found (const face &val, label pos=0) const
 Same as contains().
auto expr () const
 Wrap value as expression.
void operator= (const Expression::ListExpression< E > &expr)
 Assign values from expression.
 operator const Foam::List< face > & () const
 Allow cast to a const List<T>&.
Public Member Functions inherited from mappedPatchBase
 TypeName ("mappedPatchBase")
 Runtime type information.
 mappedPatchBase (const polyPatch &)
 Construct from patch.
 mappedPatchBase (const polyPatch &pp, const word &sampleRegion, const sampleMode sampleMode, const word &samplePatch, const vectorField &offsets)
 Construct with offsetMode=non-uniform.
 mappedPatchBase (const polyPatch &pp, const word &sampleRegion, const sampleMode sampleMode, const word &samplePatch, const vector &uniformOffset)
 Construct from offsetMode=uniform.
 mappedPatchBase (const polyPatch &pp, const word &sampleRegion, const sampleMode sampleMode, const word &samplePatch, const scalar normalDistance)
 Construct from offsetMode=normal and distance.
 mappedPatchBase (const polyPatch &, const dictionary &)
 Construct from dictionary.
 mappedPatchBase (const polyPatch &, const sampleMode, const dictionary &)
 Construct from dictionary and (collocated) sample mode.
 mappedPatchBase (const polyPatch &, const mappedPatchBase &)
 Construct as copy, resetting patch.
 mappedPatchBase (const polyPatch &, const mappedPatchBase &, const labelUList &mapAddressing)
 Construct as copy, resetting patch, map original data.
virtual ~mappedPatchBase ()
 Destructor.
void clearOut ()
void setOffset (const scalar normalDist)
 Change to normal offset with given distance.
void setOffset (const vector &uniformOffset)
 Change to uniform offset with value.
void setOffset (const vectorField &offsets)
 Change to non-uniform offsets.
sampleMode mode () const noexcept
 What to sample.
const wordsampleWorld () const noexcept
 World to sample.
const wordsampleRegion () const
 Region to sample.
const wordsamplePatch () const
 Patch (only if NEARESTPATCHFACE).
const wordcoupleGroup () const
 PatchGroup (only if NEARESTPATCHFACE).
label sampleSize () const
 Return size of mapped mesh/patch/boundary.
const vectoroffset () const noexcept
 Offset vector (from patch faces to destination mesh objects).
const vectorFieldoffsets () const noexcept
 Offset vectors (from patch faces to destination mesh objects).
label getCommunicator () const
 Get the communicator (worldComm or world-to-world).
label comm () const
 Identical to getCommunicator().
bool sameWorld () const
 Is sample world the local world?
bool masterWorld () const
 Is my world ordered before the sampleWorld?
bool sameRegion () const noexcept
 Cached sampleRegion != mesh.name().
uniformDimensionedScalarFieldupdateSampleMeshTime () const
 Local mesh update time.
uniformDimensionedScalarFieldupdateMeshTime () const
 Sample mesh upate time.
bool upToDate () const
const mapDistributemap () const
 Return reference to the parallel distribution map.
const AMIPatchToPatchInterpolationAMI (const bool forceUpdate=false) const
 Return reference to the AMI interpolator.
bool owner () const
 Is it owner.
const autoPtr< Foam::searchableSurface > & surfPtr () const
 Return a pointer to the AMI projection surface.
const polyMeshsampleMesh () const
 Get the region mesh.
const polyPatchsamplePolyPatch () const
 Get the patch on the region.
tmp< pointFieldsamplePoints () const
 Get the sample points.
const fileNamesampleDatabasePath () const
bool sampleDatabase () const noexcept
virtual fileName sendPath (const label proci) const
virtual fileName receivePath (const label proci) const
template<class Type>
void distribute (List< Type > &lst) const
 Wrapper around map/interpolate data distribution.
template<class Type, class CombineOp>
void distribute (List< Type > &lst, const CombineOp &cop) const
 Wrapper around map/interpolate data distribution with operation.
template<class Type>
void reverseDistribute (List< Type > &lst) const
 Wrapper around map/interpolate data distribution.
template<class Type, class CombineOp>
void reverseDistribute (List< Type > &lst, const CombineOp &cop) const
 Wrapper around map/interpolate data distribution with operation.

Protected Member Functions

virtual void initGeometry (PstreamBuffers &)
 Initialise the calculation of the patch geometry.
virtual void calcGeometry (PstreamBuffers &)
 Calculate the patch geometry.
virtual void initMovePoints (PstreamBuffers &, const pointField &)
 Initialise the patches for moving points.
virtual void movePoints (PstreamBuffers &, const pointField &)
 Correct patches after moving points.
virtual void initUpdateMesh (PstreamBuffers &)
 Initialise the update of the patch topology.
virtual void updateMesh (PstreamBuffers &)
 Update of the patch topology.
Protected Member Functions inherited from polyPatch
virtual void clearGeom ()
 Clear geometry.
virtual void movePoints (const Field< point_type > &)
 Inherit movePoints from primitivePatch.
Protected Member Functions inherited from UList< face >
void setAddressableSize (const label n) noexcept
 Set addressed size to be inconsistent with allocated storage.
void size (const label n)
 Older name for setAddressableSize.
void writeEntry (Ostream &os) const
 Write the UList with its compound type.
labelRange validateRange (const labelRange &requestedRange) const
 Return a validated (start,size) subset range, which means that it always addresses a valid section of the list.
void fill_uniform (const face &val)
 Assign all entries to the given value.
void fill_uniform (Foam::zero)
 Assign all entries to zero.
Protected Member Functions inherited from mappedPatchBase
bool addWorldConnection ()
 Add a world-world connection.
label getWorldCommunicator () const
 Get the communicator for the world-world connection.
const polyMeshlookupMesh (const word &region) const
 Lookup mesh.
const polyPatchlookupPatch (const word &sampleRegion, const word &samplePatch) const
 Lookup patch.
tmp< pointFieldfacePoints (const polyPatch &) const
 Get the points from face-centre-decomposition face centres and project them onto the face-diagonal-decomposition triangles.
void collectSamples (const label mySampleWorld, const pointField &facePoints, pointField &samples, labelList &patchFaceWorlds, labelList &patchFaceProcs, labelList &patchFaces, pointField &patchFc) const
 Collect single list of samples and originating processor+face + wanted world.
void findLocalSamples (const sampleMode mode, const label sampleWorld, const word &sampleRegion, const word &samplePatch, const pointField &samplePoints, List< nearInfoWorld > &nearest) const
 Find (local) cells/faces containing samples.
void findSamples (const sampleMode mode, const label myWorldIndex, const pointField &, const labelList &wantedWorlds, const labelList &origProcs, labelList &sampleProcs, labelList &sampleIndices, pointField &sampleLocations) const
 Find (global) cells/faces containing samples.
tmp< pointFieldsamplePoints (const pointField &) const
 Get the sample points given the face points.
void calcMapping () const
 Calculate mapping.
void calcAMI () const
 Calculate AMI interpolator.

Additional Inherited Members

Public Types inherited from PrimitivePatch< SubList< face >, const pointField & >
enum  surfaceTopo
 Enumeration defining the surface type. Used in check routines. More...
typedef std::remove_reference< SubList< face > >::type::value_type face_type
 The face type.
typedef std::remove_reference< const pointField & >::type::value_type point_type
 The point type.
typedef SubList< faceFaceListType
 The face list type.
typedef const pointFieldPointFieldType
 The point field type.
typedef face_type FaceType
 Deprecated(2020-03) prefer face_type typedef.
Public Types inherited from UList< face >
typedef face value_type
 The value type the list contains.
typedef facepointer
 The pointer type for non-const access to value_type items.
typedef const faceconst_pointer
 The pointer type for const access to value_type items.
typedef facereference
 The type used for storing into value_type objects.
typedef const faceconst_reference
 The type used for reading from constant value_type objects.
typedef faceiterator
 Random access iterator for traversing a UList.
typedef const faceconst_iterator
 Random access iterator for traversing a UList.
typedef label size_type
 The type to represent the size of a UList.
typedef label difference_type
 The difference between iterator objects.
typedef std::reverse_iterator< iteratorreverse_iterator
 Reverse iterator (non-const access).
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 Reverse iterator (const access).
using is_List
 Have unique tag.
Public Types inherited from mappedPatchBase
enum  sampleMode {
  NEARESTCELL , NEARESTPATCHFACE , NEARESTPATCHFACEAMI , NEARESTPATCHPOINT ,
  NEARESTFACE , NEARESTONLYCELL
}
 Mesh items to sample. More...
enum  offsetMode { UNIFORM , NONUNIFORM , NORMAL }
 How to project face centres. More...
typedef Tuple2< pointIndexHit, Tuple2< scalar, label > > nearInfo
 Helper class for finding nearest.
typedef Tuple2< nearInfo, label > nearInfoWorld
 nearest + world
Static Public Member Functions inherited from polyPatch
static autoPtr< polyPatchNew (const word &patchType, const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
 Return pointer to a new patch created on freestore from components.
static autoPtr< polyPatchNew (const word &name, const dictionary &dict, const label index, const polyBoundaryMesh &bm)
 Return pointer to a new patch created on freestore from dictionary.
static autoPtr< polyPatchNew (const word &patchType, const word &name, const dictionary &dict, const label index, const polyBoundaryMesh &bm)
 Return pointer to a new patch created on freestore from dictionary.
static bool constraintType (const word &patchType)
 Return true if the given type is a constraint type.
static wordList constraintTypes ()
 Return a list of all the constraint patch types.
Static Public Member Functions inherited from patchIdentifier
static word defaultName (const label n=-1)
 Default patch name: "patch" or "patchN".
Static Public Member Functions inherited from SubList< face >
static const SubList< face > & null () noexcept
 Return a null SubList (reference to a nullObject). Behaves like an empty SubList.
Static Public Member Functions inherited from UList< face >
static const UList< face > & null () noexcept
 Return a null UList (reference to a nullObject). Behaves like an empty UList.
static constexpr label max_size () noexcept
 The size of the largest possible UList.
Static Public Member Functions inherited from mappedPatchBase
static pointIndexHit facePoint (const polyMesh &, const label facei, const polyMesh::cellDecomposition)
 Get a point on the face given a face decomposition method:
static fileName sendPath (const fileName &root, const label proci)
 Helper: return path to store data to be sent to processor i.
static fileName receivePath (const fileName &root, const label proci)
 Helper: return path to store data to be received from processor i.
static FOAM_NO_DANGLING_REFERENCE const objectRegistrysubRegistry (const objectRegistry &obr, const fileName &path)
 Lookup (sub)objectRegistry from '/' separated path (relative to objectRegistry). Creates non-existing intermediate ones.
template<class Type>
static void storeField (objectRegistry &obr, const word &fieldName, const Field< Type > &values)
 Store an IOField on the objectRegistry relative to obr.
static void writeDict (const objectRegistry &obr, dictionary &dict)
 Convert objectRegistry contents into dictionary.
static void readDict (const dictionary &d, objectRegistry &obr)
 (recursively) construct and register IOFields from dictionary
Static Public Attributes inherited from polyPatch
static int disallowGenericPolyPatch
 Debug switch to disallow the use of genericPolyPatch.
Static Public Attributes inherited from mappedPatchBase
static const Enum< sampleModesampleModeNames_
static const Enum< offsetModeoffsetModeNames_
Static Protected Member Functions inherited from mappedPatchBase
static autoPtr< fileNamereadDatabase (const dictionary &dict)
 Read optional database name from dictionary.
static FOAM_NO_DANGLING_REFERENCE const objectRegistrysubRegistry (const objectRegistry &obr, const wordList &names, const label index)
 Lookup (sub)objectRegistry by following names of sub registries. Creates non-existing intermediate ones.
template<class Type>
static bool writeIOField (const regIOobject &obj, dictionary &dict)
 Attempt to detect an IOField<Type> and write to dictionary.
template<class Type>
static bool constructIOField (const word &name, token &tok, Istream &is, objectRegistry &obr)
 Attempt to read an IOField<Type> and store on objectRegistry.
Protected Attributes inherited from mappedPatchBase
const polyPatchpatch_
 Patch to sample.
word sampleWorld_
 World to sample.
word sampleRegion_
 Region to sample.
const sampleMode mode_
 What to sample.
word samplePatch_
 Patch (if in sampleMode NEARESTPATCH*).
const coupleGroupIdentifier coupleGroup_
 PatchGroup (if in sampleMode NEARESTPATCH*).
const autoPtr< fileNamesampleDatabasePtr_
 Empty or location of database.
offsetMode offsetMode_
 How to obtain samples.
vector offset_
 Offset vector (uniform).
vectorField offsets_
 Offset vector (nonuniform).
scalar distance_
 Offset distance (normal).
label communicator_
 Communicator.
bool sameRegion_
 Same region.
autoPtr< mapDistributemapPtr_
 Communication schedule:
const bool AMIReverse_
 Flag to indicate that slave patch should be reversed for AMI.
autoPtr< AMIPatchToPatchInterpolationAMIPtr_
 Pointer to AMI interpolator.
autoPtr< searchableSurfacesurfPtr_
 Pointer to projection surface employed by AMI interpolator.
dictionary surfDict_
 Dictionary storing projection surface description.
autoPtr< uniformDimensionedScalarFieldupdateMeshTimePtr_
 Local mesh update time.
autoPtr< uniformDimensionedScalarFieldupdateSampleMeshTimePtr_
 Sample mesh update time.

Detailed Description

Determines a mapping between patch face centres and mesh cell or face centres and processors they're on.

Note
Storage is not optimal. It stores all face centres and cells on all processors to keep the addressing calculation simple.
Source files

Definition at line 55 of file mappedPolyPatch.H.

Constructor & Destructor Documentation

◆ mappedPolyPatch() [1/7]

mappedPolyPatch ( const word & name,
const label size,
const label start,
const label index,
const polyBoundaryMesh & bm,
const word & patchType )

◆ mappedPolyPatch() [2/7]

mappedPolyPatch ( const word & name,
const label size,
const label start,
const label index,
const word & sampleRegion,
const mappedPatchBase::sampleMode mode,
const word & samplePatch,
const vectorField & offset,
const polyBoundaryMesh & bm )

◆ mappedPolyPatch() [3/7]

mappedPolyPatch ( const word & name,
const label size,
const label start,
const label index,
const word & sampleRegion,
const mappedPatchBase::sampleMode mode,
const word & samplePatch,
const vector & offset,
const polyBoundaryMesh & bm )

◆ mappedPolyPatch() [4/7]

mappedPolyPatch ( const word & name,
const dictionary & dict,
const label index,
const polyBoundaryMesh & bm,
const word & patchType )

◆ mappedPolyPatch() [5/7]

mappedPolyPatch ( const mappedPolyPatch & pp,
const polyBoundaryMesh & bm )

Construct as copy, resetting the boundary mesh.

Definition at line 123 of file mappedPolyPatch.C.

References mappedPatchBase::mappedPatchBase(), mappedPolyPatch(), polyPatch::polyBoundaryMesh, polyPatch::polyPatch(), and pp().

Here is the call graph for this function:

◆ mappedPolyPatch() [6/7]

mappedPolyPatch ( const mappedPolyPatch & pp,
const polyBoundaryMesh & bm,
const label index,
const label newSize,
const label newStart )

Construct given the original patch and resetting the.

face list and boundary mesh information

Definition at line 134 of file mappedPolyPatch.C.

References patchIdentifier::index(), mappedPatchBase::mappedPatchBase(), mappedPolyPatch(), polyPatch::polyBoundaryMesh, polyPatch::polyPatch(), and pp().

Here is the call graph for this function:

◆ mappedPolyPatch() [7/7]

mappedPolyPatch ( const mappedPolyPatch & pp,
const polyBoundaryMesh & bm,
const label index,
const labelUList & mapAddressing,
const label newStart )

Construct given the original patch and a map.

Definition at line 148 of file mappedPolyPatch.C.

References patchIdentifier::index(), mappedPatchBase::mappedPatchBase(), mappedPolyPatch(), polyPatch::polyBoundaryMesh, polyPatch::polyPatch(), and pp().

Here is the call graph for this function:

◆ ~mappedPolyPatch()

~mappedPolyPatch ( )
virtual

Destructor.

Definition at line 164 of file mappedPolyPatch.C.

Member Function Documentation

◆ initGeometry()

void initGeometry ( PstreamBuffers & pBufs)
protectedvirtual

Initialise the calculation of the patch geometry.

Reimplemented from polyPatch.

Definition at line 170 of file mappedPolyPatch.C.

References mappedPatchBase::initGeometry(), and polyPatch::initGeometry().

Here is the call graph for this function:

◆ calcGeometry()

void calcGeometry ( PstreamBuffers & pBufs)
protectedvirtual

Calculate the patch geometry.

Reimplemented from polyPatch.

Definition at line 177 of file mappedPolyPatch.C.

References mappedPatchBase::calcGeometry(), and polyPatch::calcGeometry().

Here is the call graph for this function:

◆ initMovePoints()

void initMovePoints ( PstreamBuffers & pBufs,
const pointField & p )
protectedvirtual

Initialise the patches for moving points.

Reimplemented from polyPatch.

Definition at line 184 of file mappedPolyPatch.C.

References mappedPatchBase::initMovePoints(), polyPatch::initMovePoints(), and p.

Here is the call graph for this function:

◆ movePoints()

void movePoints ( PstreamBuffers & pBufs,
const pointField & p )
protectedvirtual

Correct patches after moving points.

Reimplemented from polyPatch.

Definition at line 195 of file mappedPolyPatch.C.

References mappedPatchBase::movePoints(), polyPatch::movePoints(), and p.

Here is the call graph for this function:

◆ initUpdateMesh()

void initUpdateMesh ( PstreamBuffers & pBufs)
protectedvirtual

Initialise the update of the patch topology.

Reimplemented from polyPatch.

Definition at line 206 of file mappedPolyPatch.C.

References mappedPatchBase::initUpdateMesh(), and polyPatch::initUpdateMesh().

Here is the call graph for this function:

◆ updateMesh()

void updateMesh ( PstreamBuffers & pBufs)
protectedvirtual

Update of the patch topology.

Reimplemented from polyPatch.

Definition at line 213 of file mappedPolyPatch.C.

References mappedPatchBase::updateMesh(), and polyPatch::updateMesh().

Here is the call graph for this function:

◆ TypeName()

◆ clone() [1/3]

virtual autoPtr< polyPatch > clone ( const polyBoundaryMesh & bm) const
inlinevirtual

Construct and return a clone, resetting the boundary mesh.

Reimplemented from polyPatch.

Definition at line 199 of file mappedPolyPatch.H.

References mappedPolyPatch(), and polyPatch::polyBoundaryMesh.

Here is the call graph for this function:

◆ clone() [2/3]

virtual autoPtr< polyPatch > clone ( const polyBoundaryMesh & bm,
const label index,
const label newSize,
const label newStart ) const
inlinevirtual

Construct and return a clone, resetting the face list.

and boundary mesh

Reimplemented from polyPatch.

Definition at line 209 of file mappedPolyPatch.H.

References patchIdentifier::index(), mappedPolyPatch(), and polyPatch::polyBoundaryMesh.

Here is the call graph for this function:

◆ clone() [3/3]

virtual autoPtr< polyPatch > clone ( const polyBoundaryMesh & bm,
const label index,
const labelUList & mapAddressing,
const label newStart ) const
inlinevirtual

Construct and return a clone, resetting the face list.

and boundary mesh

Reimplemented from polyPatch.

Definition at line 228 of file mappedPolyPatch.H.

References patchIdentifier::index(), mappedPolyPatch(), and polyPatch::polyBoundaryMesh.

Here is the call graph for this function:

◆ newInternalProcFaces()

virtual void newInternalProcFaces ( label & iFaces,
label & pFaces ) const
inlinevirtual

Return number of new internal of this polyPatch faces.

Reimplemented from polyPatch.

Definition at line 254 of file mappedPolyPatch.H.

References mappedPatchBase::lookupPatch(), Foam::max(), mappedPatchBase::patch_, pFaces, mappedPatchBase::samplePatch_, mappedPatchBase::sampleRegion_, and UList< T >::size().

Here is the call graph for this function:

◆ nbrCells()

virtual const labelUList & nbrCells ( ) const
inlinevirtual

Return nbrCells.

Reimplemented from polyPatch.

Definition at line 270 of file mappedPolyPatch.H.

References polyPatch::faceCells(), mappedPatchBase::lookupPatch(), mappedPatchBase::samplePatch_, and mappedPatchBase::sampleRegion_.

Here is the call graph for this function:

◆ neighbPolyPatchID()

virtual label neighbPolyPatchID ( ) const
inlinevirtual

Return nbr patch ID.

Reimplemented from polyPatch.

Definition at line 278 of file mappedPolyPatch.H.

References patchIdentifier::index(), mappedPatchBase::lookupPatch(), mappedPatchBase::samplePatch_, and mappedPatchBase::sampleRegion_.

Here is the call graph for this function:

◆ mapCollocatedFaces()

virtual refPtr< labelListList > mapCollocatedFaces ( ) const
inlinevirtual

Return collocated faces map.

Reimplemented from polyPatch.

Definition at line 286 of file mappedPolyPatch.H.

References forAll, mappedPatchBase::map(), mappedPatchBase::patch_, refPtr< T >::ref(), and List< T >::setSize().

Here is the call graph for this function:

◆ masterImplicit()

virtual bool masterImplicit ( ) const
inlinevirtual

Return implicit master.

Reimplemented from polyPatch.

Definition at line 302 of file mappedPolyPatch.H.

References mappedPatchBase::owner().

Here is the call graph for this function:

◆ neighbRegionID()

virtual word neighbRegionID ( ) const
inlinevirtual

Return neigh region ID.

Reimplemented from polyPatch.

Definition at line 310 of file mappedPolyPatch.H.

References mappedPatchBase::sampleRegion_.

◆ write()

void write ( Ostream & os) const
virtual

Write the polyPatch data as a dictionary.

Reimplemented from polyPatch.

Definition at line 220 of file mappedPolyPatch.C.

References os(), mappedPatchBase::write(), and polyPatch::write().

Here is the call graph for this function:

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