33 const Foam::label Foam::enrichedPatch::nFaceHits_ = 4;
37 void Foam::enrichedPatch::calcMasterPointFaces()
const 39 if (masterPointFacesPtr_)
42 <<
"Master point face addressing already calculated." 54 Map<DynamicList<label>> mpf(
meshPoints().size());
59 forAll(masterPatch_, facei)
61 const face& curFace = ef[facei + slavePatch_.size()];
65 Map<DynamicList<label>>::iterator mpfIter =
66 mpf.find(curFace[pointi]);
68 if (mpfIter == mpf.end())
78 mpf.find(curFace[pointi])().append(facei);
82 mpfIter().append(facei);
90 forAll(slavePointFaceHits_, pointi)
94 slavePointPointHits_[pointi] < 0
95 && slavePointEdgeHits_[pointi] < 0
96 && slavePointFaceHits_[pointi].hit()
101 const label mergedSmp =
104 Map<DynamicList<label>>::iterator mpfIter =
107 if (mpfIter == mpf.end())
117 mpf.find(mergedSmp)().append
119 slavePointFaceHits_[pointi].hitObject()
124 mpfIter().append(slavePointFaceHits_[pointi].hitObject());
132 masterPointFacesPtr_ =
new Map<labelList>(2*mpfToc.size());
133 Map<labelList>& masterPointFaceAddr = *masterPointFacesPtr_;
138 l.
transfer(mpf.find(mpfToc[mpfTocI])());
140 masterPointFaceAddr.insert(mpfToc[mpfTocI], l);
150 if (!masterPointFacesPtr_)
152 calcMasterPointFaces();
155 return *masterPointFacesPtr_;
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const Map< labelList > & masterPointFaces() const
Master point face addressing.
static const unsigned facesPerPoint_
Estimated number of faces per point.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
const faceList & enrichedFaces() const
Return enriched faces.
List< label > labelList
A List of labels.
errorManip< error > abort(error &err)
Map< label > & pointMergeMap()
Return map of point merges.
Template functions to aid in the implementation of demand driven data.
const labelList & meshPoints() const
Return mesh points.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
A HashTable to objects of type <T> with a label key.