Go to the documentation of this file.
45 Info<<
nl <<
"Testing PackedList synchronisation." <<
endl;
57 edgeValues[i] = bits.
get(i);
80 || maxEdgeValues[i] !=
label(maxBits.
get(i))
85 <<
" minlabel:" << edgeValues[i]
86 <<
" minbits:" << bits.
get(i)
87 <<
" maxLabel:" << maxEdgeValues[i]
88 <<
" maxBits:" << maxBits.
get(i)
104 pointValues[i] = bits.
get(i);
126 pointValues[i] !=
label(bits.
get(i))
127 || maxPointValues[i] !=
label(maxBits.
get(i))
133 <<
" minlabel:" << pointValues[i]
134 <<
" minbits:" << bits.
get(i)
135 <<
" maxLabel:" << maxPointValues[i]
136 <<
" maxBits:" << maxBits.
get(i)
152 faceValues[faceI] = bits.
get(faceI);
168 faceValues[faceI] !=
label(bits.
get(faceI))
169 || maxFaceValues[faceI] !=
label(maxBits.
get(faceI))
174 <<
" minlabel:" << faceValues[faceI]
175 <<
" minbits:" << bits.
get(faceI)
176 <<
" maxLabel:" << maxFaceValues[faceI]
177 <<
" maxBits:" << maxBits.
get(faceI)
187 Info<<
nl <<
"Testing Map synchronisation." <<
endl;
190 <<
"Position test of sparse data only correct for cases without cyclics"
191 <<
" with shared points." <<
endl;
216 const point pt = localPoints[i] + 1
e-4*
rndGen.vector01();
220 sparseData.insert(meshPointI, pt);
221 fullData[meshPointI] = pt;
238 point(GREAT, GREAT, GREAT)
244 forAll(fullData, meshPointI)
246 const point& fullPt = fullData[meshPointI];
248 if (fullPt !=
point(GREAT, GREAT, GREAT))
250 const point& sparsePt = sparseData[meshPointI];
252 if (fullPt != sparsePt)
255 <<
"point:" << meshPointI
256 <<
" full:" << fullPt
257 <<
" sparse:" << sparsePt
266 const point& sparsePt = iter();
267 label meshPointI = iter.key();
268 const point& fullPt = fullData[meshPointI];
270 if (fullPt != sparsePt)
273 <<
"point:" << meshPointI
274 <<
" full:" << fullPt
275 <<
" sparse:" << sparsePt
299 const edge&
e = edges[i];
301 const point pt =
e.centre(localPoints) + 1
e-4*
rndGen.vector01();
303 label meshEdgeI = meshEdges[i];
306 fullData[meshEdgeI] = pt;
322 point(GREAT, GREAT, GREAT)
327 forAll(fullData, meshEdgeI)
329 const point& fullPt = fullData[meshEdgeI];
331 if (fullPt !=
point(GREAT, GREAT, GREAT))
335 if (fullPt != sparsePt)
338 <<
"edge:" << meshEdgeI
340 <<
" full:" << fullPt
341 <<
" sparse:" << sparsePt
348 forAll(fullData, meshEdgeI)
354 if (iter != sparseData.end())
356 const point& sparsePt = iter();
357 const point& fullPt = fullData[meshEdgeI];
359 if (fullPt != sparsePt)
362 <<
"Extra edge:" << meshEdgeI
364 <<
" full:" << fullPt
365 <<
" sparse:" << sparsePt
376 Info<<
nl <<
"Testing point-wise data synchronisation." <<
endl;
387 point(GREAT, GREAT, GREAT)
390 forAll(syncedPoints, pointI)
392 if (
mag(syncedPoints[pointI] -
mesh.
points()[pointI]) > SMALL)
395 <<
"Point " << pointI
396 <<
" original location " <<
mesh.
points()[pointI]
397 <<
" synced location " << syncedPoints[pointI]
410 forAll(isMasterPoint, pointI)
412 if (isMasterPoint[pointI])
414 nMasters[pointI] = 1;
428 if (nMasters[pointI] != 1)
431 <<
"Point " << pointI
432 <<
" original location " <<
mesh.
points()[pointI]
433 <<
" has " << nMasters[pointI]
444 Info<<
nl <<
"Testing edge-wise data synchronisation." <<
endl;
454 syncedMids[edgeI] = edges[edgeI].centre(
mesh.
points());
461 point(GREAT, GREAT, GREAT)
468 if (
mag(syncedMids[edgeI] - eMid) > SMALL)
472 <<
" original midpoint " << eMid
473 <<
" synced location " << syncedMids[edgeI]
486 forAll(isMasterEdge, edgeI)
488 if (isMasterEdge[edgeI])
504 if (nMasters[edgeI] != 1)
506 const edge&
e = edges[edgeI];
510 <<
" has " << nMasters[edgeI]
521 Info<<
nl <<
"Testing face-wise data synchronisation." <<
endl;
542 <<
" synced centre " << syncedFc[faceI]
555 forAll(isMasterFace, faceI)
557 if (isMasterFace[faceI])
572 if (nMasters[faceI] != 1)
577 <<
" has " << nMasters[faceI]
588 int main(
int argc,
char *argv[])
Simple random number generator.
virtual const pointField & points() const
Return raw points.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
#define forAll(list, i)
Loop across all elements in list.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
A List obtained as a section of another List.
labelList meshEdges(const edgeList &allEdges, const labelListList &cellEdges, const labelList &faceCells) const
Return labels of patch edges in the global edge list using.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
A HashTable to objects of type <T> with a label key.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
dimensioned< scalar > mag(const dimensioned< Type > &)
const labelListList & pointEdges() const
Mesh consisting of general polyhedral cells.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
label nInternalFaces() const
bool set(const label, const unsigned int val=~0u)
Set value at index I. Return true if value changed.
unsigned int get(const label) const
Get value at index I.
const double e
Elementary charge.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Map from edge (expressed as its endpoints) to value.
virtual const faceList & faces() const
Return raw faces.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A dynamically allocatable list of packed unsigned integers.
const vectorField & faceCentres() const
void size(const label)
Override size to be inconsistent with allocated storage.
vector point
Point is a vector.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
#define WarningInFunction
Report a warning using Foam::Warning.
cachedRandom rndGen(label(0), -1)
A list of faces which address into the list of points.