65 <<
"Specified IOobject::MUST_READ_IF_MODIFIED but class"
66 <<
" does not support automatic rereading."
86 patchEntries[
patchi].keyword(),
97 "polyBoundaryMesh::polyBoundaryMesh"
98 "(const IOobject&, const polyMesh&)"
141 <<
"Specified IOobject::MUST_READ_IF_MODIFIED but class"
142 <<
" does not support automatic rereading."
161 patchEntries[
patchi].keyword(),
172 "polyBoundaryMesh::polyBoundaryMesh"
173 "(const IOobject&, const polyMesh&, const polyPatchList&)"
202 operator[](
patchi).clearGeom();
210 nbrEdgesPtr_.clear();
211 patchIndicesPtr_.clear();
212 patchFaceIndicesPtr_.clear();
213 groupPatchIndicesPtr_.clear();
219 operator[](
patchi).clearAddressing();
227 void Foam::polyBoundaryMesh::calcGeometry()
239 operator[](
patchi).initCalcGeometry(pBufs);
242 pBufs.finishedSends();
246 operator[](
patchi).calcGeometry(pBufs);
251 const lduSchedule& patchSchedule = mesh().globalData().patchSchedule();
254 pBufs.finishedSends();
256 forAll(patchSchedule, patchEvali)
258 const label patchi = patchSchedule[patchEvali].patch;
260 if (patchSchedule[patchEvali].init)
262 operator[](
patchi).initCalcGeometry(pBufs);
266 operator[](
patchi).calcGeometry(pBufs);
279 <<
"Neighbour edge addressing not correct across parallel"
280 <<
" boundaries." <<
endl;
283 if (!nbrEdgesPtr_.valid())
289 label nEdgePairs = 0;
320 edgei < edges.
size();
325 const edge&
e = edges[edgei];
333 if (fnd == pointsToEdge.
end())
355 nbrEdges[edgeInfo[0]][edgeInfo[1]]
366 if (pointsToEdge.
size())
369 <<
"Not all boundary edges of patches match up." <<
nl
370 <<
"Is the outside of your mesh multiply connected?"
382 const labelPair& edgeInfo = nbrEdgesp[i];
384 if (edgeInfo[0] == -1 || edgeInfo[1] == -1)
390 <<
"Not all boundary edges of patches match up." <<
nl
391 <<
"Edge " << edgeI <<
" on patch " << pp.
name()
394 <<
" edge on any other patch." <<
nl
395 <<
"Is the outside of your mesh multiply connected?"
402 return nbrEdgesPtr_();
408 if (!patchIndicesPtr_.valid())
410 patchIndicesPtr_.reset
415 - mesh_.nInternalFaces()
418 labelList& patchIndices = patchIndicesPtr_();
424 label bFacei = bm[
patchi].start() - mesh_.nInternalFaces();
427 patchIndices[bFacei++] =
patchi;
431 return patchIndicesPtr_();
437 if (!patchFaceIndicesPtr_.valid())
439 patchFaceIndicesPtr_.reset
444 - mesh_.nInternalFaces()
447 labelList& patchFaceID = patchFaceIndicesPtr_();
453 label bFacei = bm[
patchi].start() - mesh_.nInternalFaces();
456 patchFaceID[bFacei++] = i;
460 return patchFaceIndicesPtr_();
467 if (!groupPatchIndicesPtr_.valid())
484 groupPatchIndices.
find
490 if (iter != groupPatchIndices.
end())
507 <<
"Removing patchGroup '" << bm[
patchi].
name()
508 <<
"' which clashes with patch " <<
patchi
509 <<
" of the same name."
515 return groupPatchIndicesPtr_();
521 const word& groupName,
525 groupPatchIndicesPtr_.clear();
558 if (groups[i] != groupName)
560 groups[newI++] = groups[i];
624 const bool usePatchGroups
635 if (usePatchGroups && groupPatchIndices().size())
639 const wordList allGroupNames = groupPatchIndices().toc();
643 const word& grpName = allGroupNames[groupIndices[i]];
645 groupPatchIndices()[grpName];
648 if (indexSet.
insert(patchIndices[j]))
650 indices.
append(patchIndices[j]);
664 if (key ==
operator[](i).
name())
671 if (usePatchGroups && groupPatchIndices().size())
674 groupPatchIndices().find(key);
676 if (iter != groupPatchIndices().end())
683 if (indexSet.
insert(patchIndices[j]))
685 indices.
append(patchIndices[j]);
712 Pout<<
"label polyBoundaryMesh::findIndex(const word&) const"
713 <<
"Patch named " << patchName <<
" not found. "
714 <<
"List of available patch names: " << names() <<
endl;
728 if (faceIndex < mesh().nInternalFaces())
732 else if (faceIndex >= mesh().nFaces())
735 <<
"given label " << faceIndex
736 <<
" greater than the number of geometric faces " << mesh().nFaces()
747 faceIndex >= bp.
start()
757 <<
"Cannot find face " << faceIndex <<
" in any of the patches "
759 <<
"It seems your patches are not consistent with the mesh :"
760 <<
" internalFaces:" << mesh().nInternalFaces()
761 <<
" total number of faces:" << mesh().nFaces()
771 const bool warnNotFound,
772 const bool usePatchGroups
775 const wordList allPatchNames(this->names());
788 ids.
insert(patchIndices[j]);
791 if (patchIndices.
empty())
795 const wordList allGroupNames = groupPatchIndices().toc();
802 const word&
name = allGroupNames[groupIndices[i]];
804 groupPatchIndices()[
name];
806 forAll(extraPatchIndices, extraI)
808 ids.
insert(extraPatchIndices[extraI]);
812 if (groupIndices.
empty() && warnNotFound)
815 <<
"Cannot find any patch or group names matching "
820 else if (warnNotFound)
823 <<
"Cannot find any patch names matching " << patchName
847 this->groupPatchIndices();
852 groupPatchIndices.
begin();
853 iter != groupPatchIndices.
end();
864 label nMatch = nonGroupPatches.
erase(groupPatchSet);
866 if (nMatch == groupPatchSet.
size())
868 matchedGroups.
append(iter.key());
870 else if (nMatch != 0)
873 nonGroupPatches.
transfer(oldNonGroupPatches);
891 bool hasError =
false;
901 if (!isA<processorPolyPatch>(bm[
patchi]))
910 Pout<<
" ***Problem with boundary patch " <<
patchi
912 <<
" of type " << bm[
patchi].type()
913 <<
". The patch seems to be preceded by processor"
914 <<
" patches. This is can give problems."
921 types[nonProci] = bm[
patchi].type();
941 for (
label proci = 1; proci < allNames.
size(); ++proci)
945 (allNames[proci] != allNames[0])
946 || (allTypes[proci] != allTypes[0])
953 Info<<
" ***Inconsistent patches across processors, "
954 "processor 0 has patch names:" << allNames[0]
955 <<
" patch types:" << allTypes[0]
956 <<
" processor " << proci <<
" has patch names:"
958 <<
" patch types:" << allTypes[proci]
972 bool hasError =
false;
982 Info<<
" ****Duplicate boundary patch " <<
patchi
984 <<
" of type " << bm[
patchi].type()
986 <<
"Suppressing future warnings." <<
endl;
996 Pout<<
" ***Boundary definition is in error." <<
endl;
1000 Info<<
" Boundary definition OK." <<
endl;
1020 operator[](
patchi).initMovePoints(pBufs,
p);
1027 operator[](
patchi).movePoints(pBufs,
p);
1032 const lduSchedule& patchSchedule = mesh().globalData().patchSchedule();
1037 forAll(patchSchedule, patchEvali)
1039 const label patchi = patchSchedule[patchEvali].patch;
1041 if (patchSchedule[patchEvali].init)
1043 operator[](
patchi).initMovePoints(pBufs,
p);
1047 operator[](
patchi).movePoints(pBufs,
p);
1056 nbrEdgesPtr_.clear();
1057 patchIndicesPtr_.clear();
1058 patchFaceIndicesPtr_.clear();
1059 groupPatchIndicesPtr_.clear();
1071 operator[](
patchi).initTopoChange(pBufs);
1078 operator[](
patchi).topoChange(pBufs);
1083 const lduSchedule& patchSchedule = mesh().globalData().patchSchedule();
1088 forAll(patchSchedule, patchEvali)
1090 const label patchi = patchSchedule[patchEvali].patch;
1092 if (patchSchedule[patchEvali].init)
1094 operator[](
patchi).initTopoChange(pBufs);
1098 operator[](
patchi).topoChange(pBufs);
1108 const bool validBoundary
1130 const bool validBoundary
1170 os.
check(
"polyBoundaryMesh::writeData(Ostream& os) const");
1192 const word& patchName
1200 <<
"Patch named " << patchName <<
" not found." <<
nl
1201 <<
"Available patch names: " << names() <<
endl
1205 return operator[](
patchi);
1211 const word& patchName
1219 <<
"Patch named " << patchName <<
" not found." <<
nl
1220 <<
"Available patch names: " << names() <<
endl
1224 return operator[](
patchi);
#define forAll(list, i)
Loop across all elements in list.
void setCapacity(const label)
Alter the size of the underlying storage.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
bool insert(const Key &key)
Insert a new entry.
An STL-conforming const_iterator.
An STL-conforming iterator.
An STL-conforming hash table.
bool erase(const iterator &)
Erase a hashedEntry specified by given iterator.
void transfer(HashTable< T, Key, Hash > &)
Transfer the contents of the argument table into this table.
iterator begin()
Iterator set to the beginning of the HashTable.
label size() const
Return number of elements in table.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
readOption readOpt() const
autoPtr< IOobject > clone() const
Clone.
const word & name() const
Return name.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
streamFormat
Enumeration for the format of data in the stream.
compressionType
Enumeration for the format of data in the stream.
bool good() const
Return true if next operation might succeed.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
void append(const T &)
Append an element at the end of the list.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
label nEdges() const
Return number of edges in patch.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
label nInternalEdges() const
Number of internal edges.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
void finishedSends(const bool block=true)
Mark all sends as having been done. This will start receives.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
bool set(const label) const
Is element set.
void reorder(const labelUList &oldToNew)
Reorders elements. Ordering does not have to be done in.
void shuffle(const labelUList &newToOld)
Reorders elements. Ordering does not have to be done in.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label size() const
Return the number of elements in the UList.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
static bool master(const label communicator=0)
Am I the master process.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static bool & parRun()
Is this a parallel run?
static commsTypes defaultCommsType
Default commsType.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
label size() const
Return the number of elements in the UPtrList.
friend Ostream & operator(Ostream &, const UPtrList< T > &)
Write UPtrList to Ostream.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
bool inGroup(const word &) const
Test if in group.
const wordList & inGroups() const
Return the optional groups patch belongs to.
const word & name() const
Return name.
bool checkDefinition(const bool report=false) const
Check boundary definition. Return true if in error.
const labelList & patchIndices() const
Boundary face patch indices.
wordList physicalTypes() const
Return a list of physical types.
void topoChange()
Correct polyBoundaryMesh after topology update.
bool writeData(Ostream &) const
writeData member function required by regIOobject
label findIndex(const word &patchName) const
Find patch index given a name.
const HashTable< labelList, word > & groupPatchIndices() const
Per patch group the patch indices.
wordList types() const
Return a list of patch types.
void clearGeom()
Clear geometry at this level and at patches.
void setGroup(const word &groupName, const labelList &patchIndices)
Set/add group with patches.
const labelList & patchFaceIndices() const
Boundary face patch face indices.
~polyBoundaryMesh()
Destructor.
bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp, const bool write=true) const
Write using given format, version and form uncompression.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
void clearAddressing()
Clear addressing at this level and at patches.
void matchGroups(const labelUList &patchIndices, wordList &groups, labelHashSet &nonGroupPatches) const
Match the patches to groups. Returns all the (fully matched) groups.
void movePoints(const pointField &)
Correct polyBoundaryMesh after moving points.
void renamePatches(const wordUList &newNames, const bool validBoundary)
Rename the patches. If validBoundary is set this calls topoChange()
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool usePatchGroups=true) const
Return the set of patch indices corresponding to the given names.
labelHashSet findIndices() const
Find patch indices for a given polyPatch type.
void reorderPatches(const labelUList &newToOld, const bool validBoundary)
Reorders the patches. Ordering does not have to be done in.
polyBoundaryMesh(const IOobject &, const polyMesh &)
Read constructor given IOobject and a polyMesh reference.
wordList names() const
Return the list of patch names.
wordList toc() const
Return the list of patch names.
const List< labelPairList > & nbrEdges() const
Per patch the edges on the neighbouring patch. Is for every external.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all patches and in same order. Return.
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
static autoPtr< polyPatch > New(const word &patchType, const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
Return a pointer to a new patch created on freestore from.
label start() const
Return start label of this patch in the polyMesh face list.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
void close()
Close Istream.
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType, const bool write) const
Write using given format, version and compression.
bool headerOk()
Read and check header info.
Istream & readStream(const word &, const bool read=true)
Return Istream and check object type against that given.
A wordRe is a word, but can also have a regular expression for matching words.
static bool isPattern(const string &)
Test string for regular expression meta characters.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const fvPatchList & patches
#define WarningInFunction
Report a warning using Foam::Warning.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
Pair< label > labelPair
Label pair.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool findStrings(const wordReListMatcher &matcher, const std::string &str)
Return true if string matches one of the regular expressions.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
errorManip< error > abort(error &err)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
List< lduScheduleEntry > lduSchedule
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
edge meshEdge(const PrimitivePatch< FaceList, PointField > &p, const label edgei)
defineTypeNameAndDebug(combustionModel, 0)
prefixOSstream Pout(cout, "Pout")
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
Ostream & indent(Ostream &os)
Indent stream.
wordList patchNames(nPatches)
Operations on lists of strings.
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable