47 bool Foam::pointBoundaryMesh::hasGroupIDs()
const 52 return !groupIDsPtr_->empty();
59 if (!
p.inGroups().empty())
69 void 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." 108 void Foam::pointBoundaryMesh::addPatches(
const polyBoundaryMesh&
pbm)
125 Foam::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()
162 <<
" type:" <<
pp.type() <<
endl;
169 Foam::pointBoundaryMesh::pointBoundaryMesh
173 const polyBoundaryMesh&
pbm 183 polyMesh::meshSubDir/pointMesh::meshSubDir,
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&): " 216 PtrList<entry> patchEntries(is);
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()
281 <<
" type:" <<
pp.type() <<
endl;
298 if (isA<processorPointPatch>(
p))
318 if (isA<processorPointPatch>(
p))
343 PtrListOps::get<word>
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();
432 const wordRes& matcher,
440 else if (matcher.size() == 1)
442 return this->indices(matcher.front(), useGroups);
448 if (useGroups && this->hasGroupIDs())
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())
489 const wordRes::filter matcher(allow, deny);
494 if (useGroups && this->hasGroupIDs())
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())
586 void 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);
625 operator[](patchi).calcGeometry(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);
671 operator[](patchi).movePoints(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);
717 operator[](patchi).updateMesh(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");
Begin block [isseparator].
const polyBoundaryMesh & pbm
labelList findMatching(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
Extract list indices for all items with 'name()' that matches.
PtrList< pointPatch > pointPatchList
Store lists of pointPatch as a PtrList.
const pointPatch * cfindPatch(const word &patchName) const
Find patch by name and return const pointer.
readOption readOpt() const noexcept
Get the read option.
Ostream & indent(Ostream &os)
Indent stream.
label nNonProcessor() const
The number of patches before the first processor patch.
errorManipArg< error, int > exit(error &err, const int errNo=1)
wordList physicalTypes() const
Return a list of physical types.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void movePoints(const pointField &)
Correct pointBoundaryMesh after moving points.
const word & name() const noexcept
Return the object name.
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.
label nProcessorPatches() const
The number of processorPointPatch patches.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool headerOk()
Read and check header info. Does not check the headerClassName.
void reorder(const labelUList &oldToNew, const bool check=false)
Reorder elements. Reordering must be unique (ie, shuffle).
labelList indices(const wordRe &matcher, const bool useGroups) const
The (sorted) patch indices for all matches, optionally matching patch groups.
Begin list [isseparator].
List< lduScheduleEntry > lduSchedule
A List of lduSchedule entries.
const T * get(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
void updateMesh()
Correct pointBoundaryMesh after topology update.
bool isReadOptional() const noexcept
True if (LAZY_READ) bits are set [same as READ_IF_PRESENT].
UList< label > labelUList
A UList of labels.
Extract name (as a word) from an object, typically using its name() method.
static autoPtr< facePointPatch > New(const polyPatch &, const pointBoundaryMesh &)
Return a pointer to a new patch created on freestore from polyPatch.
#define forAll(list, i)
Loop across all elements in list.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
void resize_null(const label newLen)
Set the addressed list to the given size, deleting all existing entries. Afterwards the list contains...
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
vectorField pointField
pointField is a vectorField.
"scheduled" (MPI standard) : (MPI_Send, MPI_Recv)
void close()
Close Istream.
A class for handling words, derived from Foam::string.
static word defaultRegion
Return the default region name.
label size() const noexcept
The number of entries in the list.
void reorder(const labelUList &oldToNew, const bool validBoundary)
Reorders patches. Ordering does not have to be done in.
const globalMeshData & globalData() const
Return parallel info (demand-driven)
A HashTable similar to std::unordered_map.
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
bool isReadRequired() const noexcept
True if (MUST_READ | READ_MODIFIED) bits are set.
label findPatchID(const word &patchName, const bool allowNotFound=true) const
Find patch index given a name.
static commsTypes defaultCommsType
Default commsType.
decomposeUsingBbs false
Use bounding boxes (default) or unique decomposition of triangles (i.e. do not duplicate triangles) ...
#define WarningInFunction
Report a warning using Foam::Warning.
Basic pointPatch represents a set of points from the mesh.
const HashTable< labelList > & groupPatchIDs() const
The patch indices per patch group.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
const lduSchedule & patchSchedule() const noexcept
Order in which the patches should be initialised/evaluated corresponding to the schedule.
void reserve(label numEntries)
Reserve space for at least the specified number of elements (not the number of buckets) and regenerat...
const polyBoundaryMesh & patches
fileName objectRelPath() const
The object path relative to the case.
"nonBlocking" (immediate) : (MPI_Isend, MPI_Irecv)
wordList types() const
Return a list of patch types.
List< label > labelList
A List of labels.
"buffered" : (MPI_Bsend, MPI_Recv)
wordList names() const
Return a list of patch names.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Istream & readStream(const word &, const bool readOnProc=true)
Return Istream and check object type against that given.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
virtual bool writeData(Ostream &) const
writeData member function required by regIOobject
Extract type (as a word) from an object, typically using its type() method.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
forAllConstIters(mixture.phases(), phase)
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...
label firstMatching(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
Find first list item with 'name()' that matches, -1 on failure.