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);
96 <<
"' which clashes with patch " << patchi
97 <<
" of the same name." 104 void Foam::pointBoundaryMesh::addPatches(
const polyBoundaryMesh&
pbm)
121 Foam::pointBoundaryMesh::pointBoundaryMesh
124 const polyBoundaryMesh&
pbm 135 polyMesh::meshSubDir/pointMesh::meshSubDir,
150 Pout<<
"pointBoundaryMesh::pointBoundaryMesh" 151 <<
"(const pointMesh&, const polyBoundaryMesh&): " 152 <<
"constructed pointBoundaryMesh:" <<
endl;
154 for (
const auto&
pp : Patches)
157 <<
"index:" <<
pp.index() <<
" patch:" <<
pp.name()
158 <<
" type:" <<
pp.type() <<
endl;
165 Foam::pointBoundaryMesh::pointBoundaryMesh
169 const polyBoundaryMesh&
pbm 179 polyMesh::meshSubDir/pointMesh::meshSubDir,
195 <<
"Specified IOobject::MUST_READ_IF_MODIFIED but class" 196 <<
" does not support automatic rereading." 202 Pout<<
"pointBoundaryMesh::pointBoundaryMesh" 203 <<
"(const IOobject&, const pointMesh&," 204 <<
" const polyBoundaryMesh&): " 212 PtrList<entry> patchEntries(is);
213 Patches.setSize(patchEntries.size());
218 const word&
name = patchEntries[patchi].keyword();
220 autoPtr<pointPatch> pPtr
225 patchEntries[patchi].
dict(),
233 const label polyPatchi =
pbm.findPatchID(
name,
false);
236 pPtr->index() = patchi;
239 Patches.set(patchi, pPtr);
245 "pointBoundaryMesh::pointBoundaryMesh" 246 "(const IOobject&, const pointMesh&," 247 " const polyBoundaryMesh&)" 256 Pout<<
"pointBoundaryMesh::pointBoundaryMesh" 257 <<
"(const IOobject&, const pointMesh&," 258 <<
" const polyBoundaryMesh&): " 259 <<
"Constructing from polyBoundaryMesh only" 269 Pout<<
"pointBoundaryMesh::pointBoundaryMesh" 270 <<
"(const IOobject&, const pointMesh&, const polyBoundaryMesh&): " 271 <<
"constructed pointBoundaryMesh:" <<
endl;
273 for (
const auto&
pp : Patches)
276 <<
"index:" <<
pp.index() <<
" patch:" <<
pp.name()
277 <<
" type:" <<
pp.type() <<
endl;
294 if (isA<processorPointPatch>(
p))
314 if (isA<processorPointPatch>(
p))
339 PtrListOps::get<word>
355 return *groupIDsPtr_;
361 const wordRe& matcher,
371 const bool checkGroups = (useGroups && this->hasGroupIDs());
375 if (matcher.isPattern())
379 const auto& groupLookup = groupPatchIDs();
382 if (matcher(iter.key()))
385 ids.insert(iter.val());
410 else if (checkGroups)
412 const auto iter = groupPatchIDs().cfind(matcher);
417 ids.insert(iter.val());
422 return ids.sortedToc();
428 const wordRes& matcher,
436 else if (matcher.size() == 1)
438 return this->indices(matcher.front(), useGroups);
444 if (useGroups && this->hasGroupIDs())
446 ids.reserve(this->size());
448 const auto& groupLookup = groupPatchIDs();
451 if (matcher(iter.key()))
454 ids.insert(iter.val());
468 return ids.sortedToc();
475 const wordRes& ignore,
482 return this->indices(
select, useGroups);
485 const wordRes::filter matcher(
select, ignore);
490 if (useGroups && this->hasGroupIDs())
492 ids.reserve(this->size());
494 const auto& groupLookup = groupPatchIDs();
497 if (matcher(iter.key()))
500 ids.insert(iter.val());
514 return ids.sortedToc();
520 const word& patchName,
525 if (patchName.empty())
540 <<
"Patch '" << patchName <<
"' not found. " 541 <<
"Available patch names";
546 <<
" in region '" << mesh_.name() <<
"'";
557 Pout<<
"label pointBoundaryMesh::findPatchID(const word&) const" 558 <<
" Patch named " << patchName <<
" not found. " 559 <<
"Available patch names: " <<
names() <<
endl;
567 void Foam::pointBoundaryMesh::calcGeometry()
579 operator[](patchi).initGeometry(pBufs);
582 pBufs.finishedSends();
586 operator[](patchi).calcGeometry(pBufs);
594 pBufs.finishedSends();
596 for (
const auto& schedEval : patchSchedule)
598 const label patchi = schedEval.patch;
602 operator[](patchi).initGeometry(pBufs);
606 operator[](patchi).calcGeometry(pBufs);
625 operator[](patchi).initMovePoints(pBufs,
p);
628 pBufs.finishedSends();
632 operator[](patchi).movePoints(pBufs,
p);
640 pBufs.finishedSends();
642 for (
const auto& schedEval : patchSchedule)
644 const label patchi = schedEval.patch;
648 operator[](patchi).initMovePoints(pBufs,
p);
652 operator[](patchi).movePoints(pBufs,
p);
671 operator[](patchi).initUpdateMesh(pBufs);
674 pBufs.finishedSends();
678 operator[](patchi).updateMesh(pBufs);
686 pBufs.finishedSends();
688 for (
const auto& schedEval : patchSchedule)
690 const label patchi = schedEval.patch;
694 operator[](patchi).initUpdateMesh(pBufs);
698 operator[](patchi).updateMesh(pBufs);
708 const bool validBoundary
719 patches[patchi].index() = patchi;
723 groupIDsPtr_.reset(
nullptr);
734 Pout<<
"pointBoundaryMesh::reorder" 735 <<
"(const labelUList&, const bool): " 736 <<
"reordered pointBoundaryMesh:" <<
endl;
738 for (
const auto&
pp : Patches)
741 <<
"index:" <<
pp.index() <<
" patch:" <<
pp.name()
766 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.
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
List of names generated by calling name() for each list item and filtered for matches.
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.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
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.
List< bool > select(const label n, const labelUList &locations)
Construct a selection list of bools (all false) with the given pre-size, subsequently add specified l...
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
Return (sorted) patch indices for all matches.
Begin list [isseparator].
List< lduScheduleEntry > lduSchedule
A List of lduSchedule entries.
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.
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.
OBJstream os(runTime.globalPath()/outputName)
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.
#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.
bool good() const noexcept
True if next operation might succeed.
const lduSchedule & patchSchedule() const noexcept
Order in which the patches should be initialised/evaluated corresponding to the schedule.
const polyBoundaryMesh & patches
fileName objectRelPath() const
The object path relative to the root.
"nonBlocking" (immediate) : (MPI_Isend, MPI_Irecv)
wordList types() const
Return a list of patch types.
List< label > labelList
A List of labels.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
"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)
label firstMatching(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
Find first list item with 'name()' that matches, -1 on failure.