75 bool Foam::distributedTriSurfaceMesh::read()
88 mergeDist_ = dict_.
lookup<scalar>(
"mergeDistance");
95 bool Foam::distributedTriSurfaceMesh::isLocal
97 const List<treeBoundBox>& myBbs,
104 if (myBbs[bbI].contains(start) && myBbs[bbI].contains(end))
175 void Foam::distributedTriSurfaceMesh::distributeSegment
177 const label segmentI,
181 DynamicList<segment>& allSegments,
182 DynamicList<label>& allSegmentMap,
183 List<DynamicList<label>>& sendMap
200 const List<treeBoundBox>& bbs = procBb_[proci];
202 if (isLocal(bbs, start, end))
204 sendMap[proci].append(allSegments.size());
205 allSegmentMap.append(segmentI);
206 allSegments.append(
segment(start, end));
217 const List<treeBoundBox>& bbs = procBb_[proci];
221 const treeBoundBox& bb = bbs[bbI];
229 if (bb.intersects(start, end, clipPt))
231 sendMap[proci].append(allSegments.size());
232 allSegmentMap.append(segmentI);
233 allSegments.append(
segment(start, end));
256 Foam::distributedTriSurfaceMesh::distributeSegments
261 List<segment>& allSegments,
276 DynamicList<segment> dynAllSegments(start.size());
278 DynamicList<label> dynAllSegmentMap(start.size());
300 dynSendMap[proci].shrink();
301 sendMap[proci].transfer(dynSendMap[proci]);
304 allSegments.transfer(dynAllSegments.shrink());
305 allSegmentMap.transfer(dynAllSegmentMap.shrink());
330 forAll(constructMap, proci)
336 constructMap[proci].setSize(nRecv);
338 for (
label i = 0; i < nRecv; i++)
340 constructMap[proci][i] = segmentI++;
345 return autoPtr<distributionMap>
357 void Foam::distributedTriSurfaceMesh::findLine
359 const bool nearestIntersection,
362 List<pointIndexHit>& info
365 const indexedOctree<treeDataTriSurface>& octree = tree();
368 info.setSize(start.size());
378 if (nearestIntersection)
380 info[i] = octree.findLine(start[i], end[i]);
384 info[i] = octree.findLineAny(start[i], end[i]);
391 const globalIndex& triIndexer = globalTris();
403 if (nearestIntersection)
405 info[i] = octree.findLine(start[i], end[i]);
409 info[i] = octree.findLineAny(start[i], end[i]);
414 info[i].setIndex(triIndexer.toGlobal(info[i].index()));
435 List<segment> allSegments(start.size());
439 const autoPtr<distributionMap> mapPtr
449 const distributionMap& map = mapPtr();
451 label nOldAllSegments = allSegments.size();
457 map.distribute(allSegments);
464 List<pointIndexHit> intersections(allSegments.size());
468 if (nearestIntersection)
470 intersections[i] = octree.findLine
472 allSegments[i].
first(),
478 intersections[i] = octree.findLineAny
480 allSegments[i].
first(),
486 if (intersections[i].hit())
488 intersections[i].setIndex
490 triIndexer.toGlobal(intersections[i].index())
499 map.reverseDistribute(nOldAllSegments, intersections);
508 label segmentI = allSegmentMap[i];
518 else if (nearestIntersection)
523 magSqr(allInfo.hitPoint()-start[segmentI])
524 <
magSqr(hitInfo.hitPoint()-start[segmentI])
541 Foam::distributedTriSurfaceMesh::calcLocalQueries
543 const List<pointIndexHit>& info,
547 triangleIndex.setSize(info.size());
549 const globalIndex& triIndexer = globalTris();
565 label proci = triIndexer.whichProcID(info[i].index());
574 sendMap[proci].setSize(nSend[proci]);
583 label proci = triIndexer.whichProcID(info[i].index());
584 triangleIndex[i] = triIndexer.toLocal(proci, info[i].index());
585 sendMap[proci][nSend[proci]++] = i;
589 triangleIndex[i] = -1;
619 forAll(constructMap, proci)
625 constructMap[proci].setSize(nRecv);
627 for (
label i = 0; i < nRecv; i++)
629 constructMap[proci][i] = segmentI++;
638 autoPtr<distributionMap> mapPtr
647 const distributionMap& map = mapPtr();
653 map.distribute(triangleIndex);
660 Foam::label Foam::distributedTriSurfaceMesh::calcOverlappingProcs
663 const scalar radiusSqr,
672 const List<treeBoundBox>& bbs = procBb_[proci];
676 if (bbs[bbI].overlaps(centre, radiusSqr))
678 overlaps[proci] =
true;
692 Foam::distributedTriSurfaceMesh::calcLocalQueries
709 DynamicList<point> dynAllCentres(centres.size());
710 DynamicList<scalar> dynAllRadiusSqr(centres.size());
712 DynamicList<label> dynAllSegmentMap(centres.size());
729 forAll(procBbOverlaps, proci)
733 dynSendMap[proci].append(dynAllCentres.size());
734 dynAllSegmentMap.append(centreI);
735 dynAllCentres.append(centres[centreI]);
736 dynAllRadiusSqr.append(radiusSqr[centreI]);
745 dynSendMap[proci].shrink();
746 sendMap[proci].transfer(dynSendMap[proci]);
749 allCentres.transfer(dynAllCentres.shrink());
750 allRadiusSqr.transfer(dynAllRadiusSqr.shrink());
751 allSegmentMap.transfer(dynAllSegmentMap.shrink());
776 forAll(constructMap, proci)
782 constructMap[proci].setSize(nRecv);
784 for (
label i = 0; i < nRecv; i++)
786 constructMap[proci][i] = segmentI++;
791 autoPtr<distributionMap> mapPtr
811 Foam::distributedTriSurfaceMesh::independentlyDistributedBbs
816 if (!distributor_.valid())
825 if (!isA<decompositionMethods::geometric>(distributor_()))
828 <<
"The decomposition method " << distributor_().typeName
829 <<
" is not a geometric decomposition method." <<
endl
830 <<
"Only geometric decomposition methods are currently"
840 triCentres[triI] =
s[triI].centre(
s.points());
844 decompositionMethods::geometric& distributor =
845 refCast<decompositionMethods::geometric>(distributor_());
848 labelList distribution(distributor.decompose(triCentres));
856 bbs[proci].setSize(1);
858 bbs[proci][0].min() =
point( vGreat, vGreat, vGreat);
859 bbs[proci][0].max() =
point(-vGreat, -vGreat, -vGreat);
864 point& bbMin = bbs[distribution[triI]][0].
min();
865 point& bbMax = bbs[distribution[triI]][0].
max();
870 const point& pt =
s.points()[
f[fp]];
881 reduce(bbs[proci][i].
min(), minOp<point>());
882 reduce(bbs[proci][i].
max(), maxOp<point>());
890 bool Foam::distributedTriSurfaceMesh::overlaps
892 const List<treeBoundBox>& bbs,
900 const treeBoundBox& bb = bbs[bbI];
902 treeBoundBox triBb(p0, p0);
903 triBb.min() =
min(triBb.min(), p1);
904 triBb.min() =
min(triBb.min(), p2);
906 triBb.max() =
max(triBb.max(), p1);
907 triBb.max() =
max(triBb.max(), p2);
913 if (bb.overlaps(triBb))
916 if (bb.contains(p0) || bb.contains(p1) || bb.contains(p2))
937 void Foam::distributedTriSurfaceMesh::subsetMeshMap
941 const label nIncluded,
947 newToOldFaces.setSize(nIncluded);
948 newToOldPoints.setSize(
s.points().size());
949 oldToNewPoints.setSize(
s.points().size());
957 if (include[oldFacei])
960 newToOldFaces[facei++] = oldFacei;
969 if (oldToNewPoints[oldPointi] == -1)
971 oldToNewPoints[oldPointi] = pointi;
972 newToOldPoints[pointi++] = oldPointi;
977 newToOldPoints.
setSize(pointi);
994 newPoints[i] =
s.points()[newToOldPoints[i]];
997 List<labelledTri> newTriangles(newToOldFaces.size());
1002 const labelledTri& tri =
s[newToOldFaces[i]];
1004 newTriangles[i][0] = oldToNewPoints[tri[0]];
1005 newTriangles[i][1] = oldToNewPoints[tri[1]];
1006 newTriangles[i][2] = oldToNewPoints[tri[2]];
1007 newTriangles[i].region() = tri.region();
1011 return triSurface(newTriangles,
s.patches(), newPoints,
true);
1017 const triSurface&
s,
1056 const triSurface&
s,
1063 createWithValues<boolList>
1072 newToOldPoints.setSize(
s.points().size());
1073 labelList oldToNewPoints(
s.points().size(), -1);
1077 forAll(include, oldFacei)
1079 if (include[oldFacei])
1088 if (oldToNewPoints[oldPointi] == -1)
1090 oldToNewPoints[oldPointi] = pointi;
1091 newToOldPoints[pointi++] = oldPointi;
1096 newToOldPoints.
setSize(pointi);
1109 Foam::label Foam::distributedTriSurfaceMesh::findTriangle
1111 const List<labelledTri>& allFaces,
1113 const labelledTri& otherF
1121 const labelledTri&
f = allFaces[
pFaces[i]];
1123 if (
f.region() == otherF.region())
1131 if (
f[fp1] == otherF[1] &&
f[fp2] == otherF[2])
1142 void Foam::distributedTriSurfaceMesh::merge
1144 const scalar mergeDist,
1145 const List<labelledTri>& subTris,
1148 List<labelledTri>& allTris,
1165 label nOldAllPoints = allPoints.size();
1171 label allPointi = nOldAllPoints;
1172 forAll(pointConstructMap, pointi)
1174 if (pointConstructMap[pointi] == -1)
1176 pointConstructMap[pointi] = allPointi++;
1180 if (allPointi > nOldAllPoints)
1182 allPoints.setSize(allPointi);
1184 forAll(pointConstructMap, pointi)
1186 if (pointConstructMap[pointi] >= nOldAllPoints)
1188 allPoints[pointConstructMap[pointi]] = subPoints[pointi];
1202 label allTriI = allTris.size();
1203 allTris.setSize(allTriI + subTris.size());
1205 faceConstructMap.setSize(subTris.size());
1209 const labelledTri& subTri = subTris[triI];
1212 labelledTri mappedTri
1214 pointConstructMap[subTri[0]],
1215 pointConstructMap[subTri[1]],
1216 pointConstructMap[subTri[2]],
1222 bool fullMatch =
true;
1226 if (mappedTri[fp] >= nOldAllPoints)
1237 label i = findTriangle
1247 faceConstructMap[triI] = allTriI;
1248 allTris[allTriI] = mappedTri;
1253 faceConstructMap[triI] = i;
1259 faceConstructMap[triI] = allTriI;
1260 allTris[allTriI] = mappedTri;
1264 allTris.setSize(allTriI);
1311 Info<<
'\t' << proci <<
'\t' << nTris[proci]
1312 <<
'\t' << procBb_[proci] <<
endl;
1326 io.time().findInstance(io.local(),
word::null),
1363 <<
" using 'timeStampMaster' or 'inotifyMaster.'\n"
1364 <<
" Modify the entry fileModificationChecking\n"
1365 <<
" in the etc/controlDict.\n"
1366 <<
" Use 'timeStamp' instead."
1389 Info<<
'\t' << proci <<
'\t' << nTris[proci]
1390 <<
'\t' << procBb_[proci] <<
endl;
1409 io.time().findInstance(io.local(),
word::null),
1447 <<
" using 'timeStampMaster' or 'inotifyMaster.'\n"
1448 <<
" Modify the entry fileModificationChecking\n"
1449 <<
" in the etc/controlDict.\n"
1450 <<
" Use 'timeStamp' instead."
1473 Info<<
'\t' << proci <<
'\t' << nTris[proci]
1474 <<
'\t' << procBb_[proci] <<
endl;
1491 globalTris_.clear();
1500 if (!globalTris_.valid())
1544 label nProcs = calcOverlappingProcs
1554 info[i] = octree.findNearest(
samples[i], nearestDistSqr[i]);
1557 info[i].setIndex(triIndexer.
toGlobal(info[i].index()));
1615 allInfo[i] = octree.findNearest
1620 if (allInfo[i].hit())
1622 allInfo[i].setIndex(triIndexer.
toGlobal(allInfo[i].index()));
1638 if (allInfo[i].hit())
1640 label pointi = allSegmentMap[i];
1642 if (!info[pointi].hit())
1645 info[pointi] = allInfo[i];
1656 info[pointi] = allInfo[i];
1665 void Foam::distributedTriSurfaceMesh::findLine
1733 +
vector(rootVSmall,rootVSmall,rootVSmall)
1742 info.setSize(hitInfo.
size());
1745 if (hitInfo[pointi].hit())
1747 info[pointi].setSize(1);
1748 info[pointi][0] = hitInfo[pointi];
1750 point pt = hitInfo[pointi].hitPoint() + smallVec[pointi];
1752 if (((pt-start[pointi])&dirVec[pointi]) <= magSqrDirVec[pointi])
1755 e1[compactI] = end[pointi];
1756 pointMap[compactI] = pointi;
1762 info[pointi].
clear();
1785 if (hitInfo[i].hit())
1787 label pointi = pointMap[i];
1790 info[pointi].setSize(sz+1);
1791 info[pointi][sz] = hitInfo[i];
1793 point pt = hitInfo[i].hitPoint() + smallVec[pointi];
1795 if (((pt-start[pointi])&dirVec[pointi]) <= magSqrDirVec[pointi])
1798 e1[compactI] = end[pointi];
1799 pointMap[compactI] = pointi;
1861 label triI = triangleIndex[i];
1862 region[i] =
s[triI].region();
1910 label triI = triangleIndex[i];
1911 normal[i] =
s[triI].normal(
s.points());
1934 if (foundObject<triSurfaceLabelField>(
"values"))
1964 label triI = triangleIndex[i];
1965 values[i] =
fld[triI];
1984 <<
"Volume type not supported for distributed surfaces."
2004 const scalar eps = 1.0e-4;
2007 const point mid = 0.5*(bbs[i].min() + bbs[i].max());
2008 const vector halfSpan = (1.0+eps)*(bbs[i].
max() - mid);
2010 bbsX[i].min() = mid - halfSpan;
2011 bbsX[i].max() = mid + halfSpan;
2017 const point& p0 =
s.points()[
f[0]];
2018 const point& p1 =
s.points()[
f[1]];
2019 const point& p2 =
s.points()[
f[2]];
2021 if (overlaps(bbsX, p0, p1, p2))
2023 includedFace[triI] =
true;
2027 return subsetMesh(
s, includedFace, subPointMap, subFaceMap);
2034 const bool keepNonLocal,
2058 newProcBb = independentlyDistributedBbs(*
this);
2071 if (newProcBb == procBb_)
2077 procBb_.transfer(newProcBb);
2092 <<
"before distribution:" <<
endl <<
"\tproc\ttris" <<
endl;
2096 Info<<
'\t' << proci <<
'\t' << nTris[proci] <<
endl;
2114 pointSendMap[proci],
2135 forAll(faceSendMap, proci)
2139 forAll(faceSendMap[proci], i)
2141 includedFace[faceSendMap[proci][i]] =
false;
2169 forAll(faceSendMap, proci)
2204 allTris = subSurface;
2205 allPoints = subSurface.
points();
2222 forAll(faceSendSizes, proci)
2258 forAll(faceSendSizes, proci)
2286 faceConstructMap[proci],
2287 pointConstructMap[proci]
2306 move(faceConstructMap)
2315 move(pointConstructMap)
2333 distributeFields<label>(
faceMap());
2334 distributeFields<scalar>(
faceMap());
2335 distributeFields<vector>(
faceMap());
2336 distributeFields<sphericalTensor>(
faceMap());
2337 distributeFields<symmTensor>(
faceMap());
2338 distributeFields<tensor>(
faceMap());
2348 <<
"after distribution:" <<
endl <<
"\tproc\ttris" <<
endl;
2352 Info<<
'\t' << proci <<
'\t' << nTris[proci] <<
endl;
2382 triSurface::write(fullPath,
true);
2406 <<
"Bounding Box : " << bb <<
endl;
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const Time & time() const
Return time.
fileName & instance() const
Return the instance directory, constant, system, <time> etc.
readOption readOpt() const
static fileCheckTypes fileModificationChecking
Type of file modification checking.
streamFormat
Enumeration for the format of data in the stream.
compressionType
Enumeration for the format of data in the stream.
Input inter-processor communications stream.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
label size() const
Return the number of elements in the UList.
void size(const label)
Override size to be inconsistent with allocated storage.
void clear()
Clear the list, i.e. set size to zero.
void setSize(const label)
Reset size of List.
Initialise the NamedEnum HashTable from the static list of names.
Enum read(Istream &) const
Read a word from Istream and return the corresponding.
Output inter-processor communications stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const Field< PointType > & points() const
Return reference to global points.
std::remove_reference< ::Foam::List< labelledTri > >::type::value_type FaceType
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.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
T & operator[](const label)
Return element of UList.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static bool & parRun()
Is this a parallel run?
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
void reset(T *=nullptr)
If object pointer already set, delete object and set to given.
A bounding box defined in terms of the points at its extremities.
const point & min() const
Minimum point defining the bounding box.
const point & max() const
Maximum point defining the bounding box.
static IOdictionary decomposeParDict(const Time &time)
Read and return the decomposeParDict.
static autoPtr< decompositionMethod > NewDistributor(const dictionary &decompositionDict)
Return a reference to the selected decomposition method.
A list of keyword definitions, which are a keyword followed by any number of values (e....
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
IOoject and searching on distributed triSurface. All processor hold (possibly overlapping) part of th...
virtual void getVolumeType(const pointField &, List< volumeType > &) const
Determine type (inside/outside/mixed) for point. unknown if.
static triSurface overlappingSurface(const triSurface &, const List< treeBoundBox > &, labelList &subPointMap, labelList &subFaceMap)
Subset the part of surface that is overlapping bounds.
virtual void findLineAny(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Return any intersection on segment from start to end.
static const NamedEnum< distributionType, 3 > distributionTypeNames_
virtual void getField(const List< pointIndexHit > &, labelList &) const
WIP. From a set of hits (points and.
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp, const bool write=true) const
Write using given format, version and compression.
virtual void getNormal(const List< pointIndexHit > &, vectorField &normal) const
From a set of points and indices get the normal.
virtual void getRegion(const List< pointIndexHit > &, labelList ®ion) const
From a set of points and indices get the region.
const globalIndex & globalTris() const
Triangle indexing (demand driven)
void writeStats(Ostream &os) const
Print some stats. Parallel aware version of.
virtual void findNearest(const pointField &sample, const scalarField &nearestDistSqr, List< pointIndexHit > &) const
distributedTriSurfaceMesh(const IOobject &, const triSurface &, const dictionary &dict)
Construct from triSurface.
virtual void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit >> &) const
Get all intersections in order from start to end.
virtual ~distributedTriSurfaceMesh()
Destructor.
virtual void distribute(const List< treeBoundBox > &, const bool keepNonLocal, autoPtr< distributionMap > &faceMap, autoPtr< distributionMap > &pointMap)
Set bounds of surface. Bounds currently set as list of.
void clearOut()
Clear storage.
Class containing processor-to-processor mapping information.
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute data using default commsType.
void reverseDistribute(const label constructSize, List< T > &, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Reverse distribute data using default commsType.
A class for handling file names.
fileName path() const
Return directory path name (part before last /)
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
label toGlobal(const label i) const
From local to global.
Non-pointer based hierarchical recursive searching.
Triangle with additional region number.
fileName objectPath() const
Return complete path + object name.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
const boundBox & bounds() const
Return const reference to boundBox.
A surface geometry formed of discrete facets, e.g. triangles and/or quadrilaterals,...
virtual void getField(const List< pointIndexHit > &, labelList &) const
WIP. From a set of hits (points and.
virtual void getNormal(const List< pointIndexHit > &, vectorField &normal) const
From a set of points and indices get the normal.
void clearOut()
Clear storage.
Triangulated surface description with patch information.
void operator=(const triSurface &)
static bool intersectBb(const point &p0, const point &p1, const point &p2, const treeBoundBox &cubeBb)
Does triangle intersect bounding box.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
gmvFile<< "tracers "<< particles.size()<< nl;{ pointField positions(particles.size());label particlei=0;forAllConstIter(Cloud< passiveParticle >, particles, iter) { positions[particlei++]=iter().position(mesh);} for(i=0;i< pTraits< point >::nComponents;i++) { forAll(positions, particlei) { gmvFile<< component(positions[particlei], i)<< ' ';} gmvFile<< nl;}}forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const fvPatchList & patches
Determine correspondence between points. See below.
#define InfoInFunction
Report an information message using Foam::Info.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
bool isFile(const fileName &, const bool checkVariants=true, const bool followLink=true)
Does the name exist as a file in the file system?
errorManipArg< error, int > exit(error &err, const int errNo=1)
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.
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
PointIndexHit< point > pointIndexHit
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
labelList second(const UList< labelPair > &p)
vectorField pointField
pointField is a vectorField.
List< bool > boolList
Bool container classes.
vector point
Point is a vector.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
labelList first(const UList< labelPair > &p)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
Vector< scalar > vector
A scalar version of the templated Vector.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
List< labelList > labelListList
A List of labelList.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
defineTypeNameAndDebug(combustionModel, 0)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
bool matchPoints(const UList< point > &pts0, const UList< point > &pts1, const UList< scalar > &matchDistance, const bool verbose, labelList &from0To1, const point &origin=point::zero)
Determine correspondence between pointFields. Gets passed.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
void invertManyToMany(const label len, const UList< InList > &, List< OutList > &)
Invert many-to-many.
Info<< "Finished reading KIVA file"<< endl;cellShapeList cellShapes(nPoints);labelList cellZoning(nPoints, -1);const cellModel &hex=*(cellModeller::lookup("hex"));labelList hexLabels(8);label activeCells=0;labelList pointMap(nPoints);forAll(pointMap, i){ pointMap[i]=i;}for(label i=0;i< nPoints;i++){ if(f[i] > 0.0) { hexLabels[0]=i;hexLabels[1]=i1tab[i];hexLabels[2]=i3tab[i1tab[i]];hexLabels[3]=i3tab[i];hexLabels[4]=i8tab[i];hexLabels[5]=i1tab[i8tab[i]];hexLabels[6]=i3tab[i1tab[i8tab[i]]];hexLabels[7]=i3tab[i8tab[i]];cellShapes[activeCells]=cellShape(hex, hexLabels);edgeList edges=cellShapes[activeCells].edges();forAll(edges, ei) { if(edges[ei].mag(points)< small) { label start=pointMap[edges[ei].start()];while(start !=pointMap[start]) { start=pointMap[start];} label end=pointMap[edges[ei].end()];while(end !=pointMap[end]) { end=pointMap[end];} label minLabel=min(start, end);pointMap[start]=pointMap[end]=minLabel;} } cellZoning[activeCells]=idreg[i];activeCells++;}}cellShapes.setSize(activeCells);cellZoning.setSize(activeCells);forAll(cellShapes, celli){ cellShape &cs=cellShapes[celli];forAll(cs, i) { cs[i]=pointMap[cs[i]];} cs.collapse();}label bcIDs[11]={-1, 0, 2, 4, -1, 5, -1, 6, 7, 8, 9};const label nBCs=12;const word *kivaPatchTypes[nBCs]={ &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &symmetryPolyPatch::typeName, &wedgePolyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &symmetryPolyPatch::typeName, &mergedCyclicPolyPatch::typeName};enum patchTypeNames{ PISTON, VALVE, LINER, CYLINDERHEAD, AXIS, WEDGE, INFLOW, OUTFLOW, PRESIN, PRESOUT, SYMMETRYPLANE, CYCLIC};const char *kivaPatchNames[nBCs]={ "piston", "valve", "liner", "cylinderHead", "axis", "wedge", "inflow", "outflow", "presin", "presout", "symmetryPlane", "cyclic"};List< SLList< face > > pFaces[nBCs]
scalarField samples(nIntervals, 0)