Go to the documentation of this file.
41 const label nextPointI
47 label eI = pe[pointI][ppI];
49 const edge&
e = es[eI];
51 if (
e.start() == nextPointI ||
e.end() == nextPointI)
58 label edgeI = es.size();
60 pe[nextPointI].append(edgeI);
61 if (pointI < nextPointI)
77 Pout<<
"primitiveMesh::calcEdges(const bool) : "
78 <<
"calculating edges, pointEdges and optionally faceEdges"
87 <<
"edges or pointEdges or faceEdges already calculated"
136 label nInt1Edges = 0;
146 const face&
f = fcs[faceI];
151 label nextPointI =
f[
f.fcIndex(fp)];
157 (*fePtr_)[faceI][fp] = edgeI;
171 const face&
f = fcs[faceI];
176 label nextPointI =
f[
f.fcIndex(fp)];
178 label oldNEdges = es.size();
181 if (es.size() > oldNEdges)
187 (*fePtr_)[faceI][fp] = edgeI;
195 const face&
f = fcs[faceI];
200 label nextPointI =
f[
f.fcIndex(fp)];
202 label oldNEdges = es.size();
205 if (es.size() > oldNEdges)
232 (*fePtr_)[faceI][fp] = edgeI;
282 label internal0EdgeI = 0;
303 nbrPoints.setSize(pEdges.size());
307 const edge&
e = es[pEdges[i]];
309 label nbrPointI =
e.otherVertex(pointI);
311 if (nbrPointI < pointI)
317 nbrPoints[i] = nbrPointI;
328 if (nbrPoints[i] != -1)
332 oldToNew[edgeI] = internal0EdgeI++;
342 label nbrPointI = nbrPoints[i];
348 if (edgeI < nExtEdges)
351 oldToNew[edgeI] = externalEdgeI++;
356 oldToNew[edgeI] = internal0EdgeI++;
361 oldToNew[edgeI] = internal1EdgeI++;
370 label nbrPointI = nbrPoints[i];
376 if (edgeI < nExtEdges)
379 oldToNew[edgeI] = externalEdgeI++;
390 oldToNew[edgeI] = internal2EdgeI++;
405 const edge&
e = es[edgeI];
408 <<
"Did not sort edge " << edgeI <<
" points:" <<
e
411 <<
"Current buckets:" <<
endl
412 <<
" internal0EdgeI:" << internal0EdgeI <<
endl
413 <<
" internal1EdgeI:" << internal1EdgeI <<
endl
414 <<
" internal2EdgeI:" << internal2EdgeI <<
endl
415 <<
" externalEdgeI:" << externalEdgeI <<
endl
429 edges[oldToNew[edgeI]] = es[edgeI];
465 labelList::const_iterator iter1 = list1.begin();
466 labelList::const_iterator iter2 = list2.begin();
468 while (iter1 != list1.end() && iter2 != list2.end())
474 else if (*iter1 > *iter2)
487 <<
"No common elements in lists " << list1 <<
" and " << list2
525 Pout<<
"primitiveMesh::faceEdges() : "
526 <<
"calculating faceEdges" <<
endl;
539 const face&
f = fcs[faceI];
547 label nextPointI =
f[
f.fcIndex(fp)];
554 label edgeI = pEdges[i];
556 if (es[edgeI].otherVertex(pointI) == nextPointI)
588 return faceEdges()[faceI];
593 const face&
f = faces()[faceI];
605 findFirstCommonElementFromSortedLists
608 pointEs[
f.nextLabel(fp)]
620 return faceEdges(faceI, labels_);
632 return cellEdges()[cellI];
642 const labelList& fe = faceEdges(cFaces[i]);
646 labelSet_.insert(fe[feI]);
652 if (labelSet_.size() > storage.
capacity())
659 storage.
append(iter.key());
669 return cellEdges(cellI, labels_);
labelListList * fePtr_
Face-edges.
labelListList * pePtr_
Point-edges.
List< label > labelList
A List of labels.
label nInternal1Edges_
Number of internal edges using 0 or 1 boundary points.
virtual const pointField & points() const =0
Return mesh points.
label capacity() const
Size of the underlying storage.
void sort()
(stable) sort the list (if changed after construction time)
#define forAll(list, i)
Loop across all elements in list.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
virtual const faceList & faces() const =0
Return faces.
Template functions to aid in the implementation of demand driven data.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
const labelListList & pointEdges() const
label nInternal0Edges_
Number of internal edges using 0 boundary points.
static const unsigned edgesPerPoint_
Estimated number of edges per point.
void calcEdges() const
Calculate edges, pointEdges and faceEdges.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
void inplaceRenumber(const labelUList &oldToNew, ListType &)
Inplace renumber the values of a list.
void deleteDemandDrivenData(DataPtr &dataPtr)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const labelListList & cellEdges() const
void clear()
Clear the addressed list, i.e. set the size to zero.
void setCapacity(const label)
Alter the size of the underlying storage.
const labelListList & faceEdges() const
label nInternalFaces_
Number of internal faces.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
void clearOutEdges()
During edge calculation, a larger set of data is assembled.
A list that is sorted upon construction or when explicitly requested with the sort() method.
static label findFirstCommonElementFromSortedLists(const labelList &, const labelList &)
For on-the-fly addressing calculation.
errorManip< error > abort(error &err)
const double e
Elementary charge.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
void setSize(const label)
Reset size of List.
List< labelList > labelListList
A List of labelList.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
prefixOSstream Pout(cout, "Pout")
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
edgeList * edgesPtr_
Edges are ordered in upper triangular order.
const dimensionedScalar e
Elementary charge.
void clear()
Clear the list, i.e. set size to zero.
static label getEdge(List< dynamicLabelList > &, DynamicList< edge > &, const label, const label)
Helper:
const labelList & indices() const
Return the list of sorted indices. Updated every sort.
label nInternalEdges_
Number of internal edges using 0,1 or 2boundary points.
A face is a list of labels corresponding to mesh vertices.
Various functions to operate on Lists.
void size(const label)
Override size to be inconsistent with allocated storage.
label nInternalPoints_
Number of internal points (or -1 if points not sorted)