45 template<
class FaceList,
class Po
intField>
51 if (edgesPtr_ || faceFacesPtr_ || edgeFacesPtr_ || faceEdgesPtr_)
55 <<
"addressing already calculated" 60 const List<face_type>& locFcs = localFaces();
67 for (
const auto&
f : locFcs)
69 maxEdges +=
f.nEdges();
73 edgesPtr_.reset(
new edgeList(maxEdges));
74 auto& edges = *edgesPtr_;
77 auto& edgeFaces = *edgeFacesPtr_;
80 auto& faceEdges = *faceEdgesPtr_;
87 faceIntoEdges[facei] = locFcs[facei].edges();
88 faceEdges[facei].resize(faceIntoEdges[facei].size(), -1);
93 List<DynamicList<label>>
ff(locFcs.size());
109 const face_type& curF = locFcs[facei];
110 const edgeList& curEdges = faceIntoEdges[facei];
113 List<DynamicList<label>> neiFaces(curF.size());
114 List<DynamicList<label>> edgeOfNeiFace(curF.size());
116 label nNeighbours = 0;
122 if (faceEdges[facei][edgeI] >= 0)
continue;
125 const edge&
e = curEdges[edgeI];
133 forAll(nbrFaces, nbrFacei)
136 label curNei = nbrFaces[nbrFacei];
142 const edgeList& searchEdges = faceIntoEdges[curNei];
144 forAll(searchEdges, neiEdgeI)
146 if (searchEdges[neiEdgeI] ==
e)
151 neiFaces[edgeI].append(curNei);
152 edgeOfNeiFace[edgeI].append(neiEdgeI);
155 ff[facei].append(curNei);
156 ff[curNei].append(facei);
176 for (label neiSearch = 0; neiSearch < nNeighbours; neiSearch++)
180 label minNei = locFcs.size();
184 if (neiFaces[nfI].size() && neiFaces[nfI][0] < minNei)
187 minNei = neiFaces[nfI][0];
194 edges[nEdges] = curEdges[nextNei];
197 faceEdges[facei][nextNei] = nEdges;
199 DynamicList<label>& cnf = neiFaces[nextNei];
200 DynamicList<label>& eonf = edgeOfNeiFace[nextNei];
204 curEf.
resize(cnf.size() + 1);
209 faceEdges[cnf[cnfI]][eonf[cnfI]] = nEdges;
211 curEf[cnfI + 1] = cnf[cnfI];
224 <<
"Error in internal edge insertion" 230 nInternalEdges_ = nEdges;
240 if (curEdges[edgeI] < 0)
243 edges[nEdges] = faceIntoEdges[facei][edgeI];
244 curEdges[edgeI] = nEdges;
257 edges.resize(nEdges);
260 edgeFaces.resize(nEdges);
264 auto& faceFaces = *faceFacesPtr_;
268 faceFaces[facei].transfer(
ff[facei]);
void resize(const label len)
Adjust allocated size of list.
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.
List< edge > edgeList
List of edge.
List< edgeList > edgeListList
List of edgeList.
constexpr char nl
The newline '\n' character (0x0a)
List< labelList > labelListList
List of labelList.
#define forAll(list, i)
Loop across all elements in list.
A list of faces which address into the list of points.
const dimensionedScalar e
Elementary charge.
#define DebugInFunction
Report an information message using Foam::Info.
errorManip< error > abort(error &err)
List< label > labelList
A List of labels.
const FieldField< fvPatchField, Type > & ff(const FieldField< fvPatchField, Type > &bf)