47bool Foam::pointBoundaryMesh::hasGroupIDs()
const
52 return !groupIDsPtr_->empty();
59 if (!
p.inGroups().empty())
69void Foam::pointBoundaryMesh::calcGroupIDs()
const
76 groupIDsPtr_.emplace(16);
77 auto& groupLookup = *groupIDsPtr_;
83 for (
const word& groupName :
patches[patchi].inGroups())
85 groupLookup(groupName).push_back(patchi);
92 if (groupLookup.empty())
100 <<
"' which clashes with patch " << patchi
101 <<
" of the same name."
125Foam::pointBoundaryMesh::pointBoundaryMesh
128 const polyBoundaryMesh&
pbm
139 polyMesh::meshSubDir/pointMesh::meshSubDir,
154 Pout<<
"pointBoundaryMesh::pointBoundaryMesh"
155 <<
"(const pointMesh&, const polyBoundaryMesh&): "
156 <<
"constructed pointBoundaryMesh:" <<
endl;
158 for (
const auto&
pp : Patches)
161 <<
"index:" <<
pp.index() <<
" patch:" <<
pp.name()
169Foam::pointBoundaryMesh::pointBoundaryMesh
199 <<
"Specified IOobject::MUST_READ_IF_MODIFIED but class"
200 <<
" does not support automatic rereading."
206 Pout<<
"pointBoundaryMesh::pointBoundaryMesh"
207 <<
"(const IOobject&, const pointMesh&,"
208 <<
" const polyBoundaryMesh&): "
217 Patches.setSize(patchEntries.size());
222 const word&
name = patchEntries[patchi].keyword();
224 autoPtr<pointPatch> pPtr
229 patchEntries[patchi].
dict(),
237 const label polyPatchi =
pbm.findPatchID(
name,
false);
240 pPtr->index() = patchi;
243 Patches.set(patchi, pPtr);
249 "pointBoundaryMesh::pointBoundaryMesh"
250 "(const IOobject&, const pointMesh&,"
251 " const polyBoundaryMesh&)"
260 Pout<<
"pointBoundaryMesh::pointBoundaryMesh"
261 <<
"(const IOobject&, const pointMesh&,"
262 <<
" const polyBoundaryMesh&): "
263 <<
"Constructing from polyBoundaryMesh only"
273 Pout<<
"pointBoundaryMesh::pointBoundaryMesh"
274 <<
"(const IOobject&, const pointMesh&, const polyBoundaryMesh&): "
275 <<
"constructed pointBoundaryMesh:" <<
endl;
277 for (
const auto&
pp : Patches)
280 <<
"index:" <<
pp.index() <<
" patch:" <<
pp.
name()
359 return *groupIDsPtr_;
365 const wordRe& matcher,
375 const bool checkGroups = (useGroups && this->hasGroupIDs());
379 if (matcher.isPattern())
383 const auto& groupLookup = groupPatchIDs();
386 if (matcher(iter.key()))
389 ids.insert(iter.val());
414 else if (checkGroups)
416 const auto iter = groupPatchIDs().cfind(matcher);
421 ids.insert(iter.val());
426 return ids.sortedToc();
440 else if (matcher.size() == 1)
442 return this->indices(matcher.front(), useGroups);
448 if (useGroups && this->hasGroupIDs())
450 ids.reserve(this->size());
452 const auto& groupLookup = groupPatchIDs();
455 if (matcher(iter.key()))
458 ids.insert(iter.val());
472 return ids.sortedToc();
478 const wordRes& allow,
483 if (allow.empty() && deny.empty())
494 if (useGroups && this->hasGroupIDs())
496 ids.reserve(this->size());
498 const auto& groupLookup = groupPatchIDs();
501 if (matcher(iter.key()))
504 ids.insert(iter.val());
518 return ids.sortedToc();
524 const word& patchName,
529 if (patchName.empty())
544 <<
"Patch '" << patchName <<
"' not found. "
545 <<
"Available patch names";
550 <<
" in region '" << mesh_.name() <<
"'";
561 Pout<<
"label pointBoundaryMesh::findPatchID(const word&) const"
562 <<
" Patch named " << patchName <<
" not found. "
563 <<
"Available patch names: " <<
names() <<
endl;
576 if (!patchName.empty())
586void Foam::pointBoundaryMesh::calcGeometry()
598 operator[](patchi).initGeometry(pBufs);
601 pBufs.finishedSends();
605 operator[](patchi).calcGeometry(pBufs);
613 pBufs.finishedSends();
615 for (
const auto& schedEval : patchSchedule)
617 const label patchi = schedEval.patch;
621 operator[](patchi).initGeometry(pBufs);
644 operator[](patchi).initMovePoints(pBufs,
p);
647 pBufs.finishedSends();
651 operator[](patchi).movePoints(pBufs,
p);
659 pBufs.finishedSends();
661 for (
const auto& schedEval : patchSchedule)
663 const label patchi = schedEval.patch;
667 operator[](patchi).initMovePoints(pBufs,
p);
690 operator[](patchi).initUpdateMesh(pBufs);
693 pBufs.finishedSends();
697 operator[](patchi).updateMesh(pBufs);
705 pBufs.finishedSends();
707 for (
const auto& schedEval : patchSchedule)
709 const label patchi = schedEval.patch;
713 operator[](patchi).initUpdateMesh(pBufs);
727 const bool validBoundary
738 patches[patchi].index() = patchi;
742 groupIDsPtr_.reset(
nullptr);
753 Pout<<
"pointBoundaryMesh::reorder"
754 <<
"(const labelUList&, const bool): "
755 <<
"reordered pointBoundaryMesh:" <<
endl;
757 for (
const auto&
pp : Patches)
760 <<
"index:" <<
pp.index() <<
" patch:" <<
pp.name()
785 os.
check(
"pointBoundaryMesh::writeData(Ostream& os) const");
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const polyBoundaryMesh & pbm
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
A HashTable similar to std::unordered_map.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
bool empty() const noexcept
True if the hash table is empty.
void reserve(label numEntries)
Reserve space for at least the specified number of elements (not the number of buckets) and regenerat...
bool isReadOptional() const noexcept
True if (LAZY_READ) bits are set [same as READ_IF_PRESENT].
bool isReadRequired() const noexcept
True if (MUST_READ | READ_MODIFIED) bits are set.
readOption readOpt() const noexcept
Get the read option.
writeOption writeOpt() const noexcept
Get the write option.
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
fileName objectRelPath() const
The object path relative to the case.
const fileName & instance() const noexcept
Read access to instance path component.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
bool good() const noexcept
True if next operation might succeed.
virtual const fileName & name() const
The name of the stream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Buffers for inter-processor communications streams (UOPstream, UIPstream).
UPstream::commsTypes commsType() const noexcept
The communications type of the stream.
void finishedSends(const bool wait=true)
Mark the send phase as being finished.
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie,...
void setSize(const label n)
Same as resize().
void resize_null(const label newLen)
Set the addressed list to the given size, deleting all existing entries. Afterwards the list contains...
constexpr PtrList() noexcept
bool empty() const noexcept
True if List is empty (ie, size() is zero).
T & front()
Access first element of the list, position [0].
void size(const label n)
Older name for setAddressableSize.
@ scheduled
"scheduled" (MPI standard) : (MPI_Send, MPI_Recv)
@ nonBlocking
"nonBlocking" (immediate) : (MPI_Isend, MPI_Irecv)
@ buffered
"buffered" : (MPI_Bsend, MPI_Recv)
static commsTypes defaultCommsType
Default commsType.
const T & operator[](const label i) const
Return const reference to the element at given position. FatalError for bounds problem or nullptr....
void reorder(const labelUList &oldToNew, const bool check=false)
Reorder elements. Reordering must be unique (ie, shuffle).
label size() const noexcept
The number of entries in the list.
label count() const noexcept
The number of non-nullptr entries in the list.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
static autoPtr< facePointPatch > New(const polyPatch &, const pointBoundaryMesh &)
Return a pointer to a new patch created on freestore from polyPatch.
Type type(bool followLink=true, bool checkGzip=false) const
Return the directory entry type: UNDEFINED, FILE, DIRECTORY (or SYMLINK).
const lduSchedule & patchSchedule() const noexcept
Order in which the patches should be initialised/evaluated corresponding to the schedule.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
A pointBoundaryMesh is a pointPatch list with registered IO, a reference to the associated pointMesh,...
label nNonProcessor() const
The number of patches before the first processor patch.
wordList physicalTypes() const
Return a list of physical types.
const HashTable< labelList > & groupPatchIDs() const
The patch indices per patch group.
virtual bool writeData(Ostream &) const
writeData member function required by regIOobject
const pointMesh & mesh() const noexcept
Return the mesh reference.
void reorder(const labelUList &oldToNew, const bool validBoundary)
Reorders patches. Ordering does not have to be done in.
wordList types() const
Return a list of patch types.
label findPatchID(const word &patchName, const bool allowNotFound=true) const
Find patch index given a name.
labelList indices(const wordRe &matcher, const bool useGroups) const
The (sorted) patch indices for all matches, optionally matching patch groups.
void movePoints(const pointField &)
Correct pointBoundaryMesh after moving points.
friend class pointMesh
Declare friendship with pointMesh.
wordList names() const
Return a list of patch names.
void updateMesh()
Correct pointBoundaryMesh after topology update.
label nProcessorPatches() const
The number of processorPointPatch patches.
const pointPatch * cfindPatch(const word &patchName) const
Find patch by name and return const pointer.
Mesh representing a set of points created from polyMesh.
Basic pointPatch represents a set of points from the mesh.
static autoPtr< pointPatch > New(const word &name, const dictionary &dict, const label index, const pointBoundaryMesh &)
Return a pointer to a new patch created on freestore. Returns null if not found.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
Mesh consisting of general polyhedral cells.
static word defaultRegion
Return the default region name.
const globalMeshData & globalData() const
Return parallel info (demand-driven).
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
void close()
Close Istream.
regIOobject(const IOobject &io, const bool isTimeObject=false)
Construct from IOobject. The optional flag adds special handling if the object is the top-level regIO...
bool headerOk()
Read and check header info. Does not check the headerClassName.
@ BEGIN_BLOCK
Begin block [isseparator].
@ END_BLOCK
End block [isseparator].
@ BEGIN_LIST
Begin list [isseparator].
@ END_LIST
End list [isseparator].
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
bool isPattern() const noexcept
The wordRe is a pattern, not a literal string.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const polyBoundaryMesh & patches
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
labelList findMatching(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
Extract list indices for all items with 'name()' that matches.
label firstMatching(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
Find first list item with 'name()' that matches, -1 on failure.
Namespace for handling debugging switches.
List< word > wordList
List of word.
List< label > labelList
A List of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
List< lduScheduleEntry > lduSchedule
A List of lduSchedule entries.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & indent(Ostream &os)
Indent stream.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
PtrList< pointPatch > pointPatchList
Store lists of pointPatch as a PtrList.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
vectorField pointField
pointField is a vectorField.
errorManipArg< error, int > exit(error &err, const int errNo=1)
UList< label > labelUList
A UList of labels.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.
Extract name (as a word) from an object, typically using its name() method.
Extract type (as a word) from an object, typically using its type() method.
Functor wrapper of allow/deny lists of wordRe for filtering.