47 namespace searchableSurfaces
63 distributedTriSurfaceMesh,
64 "distributedTriSurfaceMesh"
83 bool Foam::searchableSurfaces::distributedTriSurface::read()
96 mergeDist_ = dict_.
lookup<scalar>(
"mergeDistance");
103 bool Foam::searchableSurfaces::distributedTriSurface::isLocal
112 if (myBbs[bbI].contains(start) && myBbs[bbI].contains(end))
183 void Foam::searchableSurfaces::distributedTriSurface::distributeSegment
185 const label segmentI,
189 DynamicList<segment>& allSegments,
190 DynamicList<label>& allSegmentMap,
191 List<DynamicList<label>>& sendMap
210 if (isLocal(bbs, start, end))
212 sendMap[proci].append(allSegments.size());
213 allSegmentMap.append(segmentI);
214 allSegments.append(
segment(start, end));
229 const treeBoundBox& bb = bbs[bbI];
237 if (bb.intersects(start, end, clipPt))
239 sendMap[proci].append(allSegments.size());
240 allSegmentMap.append(segmentI);
241 allSegments.append(
segment(start, end));
264 Foam::searchableSurfaces::distributedTriSurface::distributeSegments
284 DynamicList<segment> dynAllSegments(start.size());
286 DynamicList<label> dynAllSegmentMap(start.size());
308 dynSendMap[proci].shrink();
309 sendMap[proci].transfer(dynSendMap[proci]);
312 allSegments.transfer(dynAllSegments.shrink());
313 allSegmentMap.transfer(dynAllSegmentMap.shrink());
338 forAll(constructMap, proci)
344 constructMap[proci].setSize(nRecv);
346 for (
label i = 0; i < nRecv; i++)
348 constructMap[proci][i] = segmentI++;
353 return autoPtr<distributionMap>
365 void Foam::searchableSurfaces::distributedTriSurface::findLine
367 const bool nearestIntersection,
373 const indexedOctree<treeDataTriSurface>& octree = tree();
376 info.setSize(start.size());
386 if (nearestIntersection)
388 info[i] = octree.findLine(start[i], end[i]);
392 info[i] = octree.findLineAny(start[i], end[i]);
399 const globalIndex& triIndexer = globalTris();
411 if (nearestIntersection)
413 info[i] = octree.findLine(start[i], end[i]);
417 info[i] = octree.findLineAny(start[i], end[i]);
422 info[i].setIndex(triIndexer.toGlobal(info[i].index()));
447 const autoPtr<distributionMap> mapPtr
457 const distributionMap& map = mapPtr();
459 label nOldAllSegments = allSegments.size();
465 map.distribute(allSegments);
476 if (nearestIntersection)
478 intersections[i] = octree.findLine
480 allSegments[i].
first(),
486 intersections[i] = octree.findLineAny
488 allSegments[i].
first(),
494 if (intersections[i].hit())
496 intersections[i].setIndex
498 triIndexer.toGlobal(intersections[i].index())
507 map.reverseDistribute(nOldAllSegments, intersections);
516 label segmentI = allSegmentMap[i];
526 else if (nearestIntersection)
531 magSqr(allInfo.hitPoint()-start[segmentI])
532 <
magSqr(hitInfo.hitPoint()-start[segmentI])
549 Foam::searchableSurfaces::distributedTriSurface::calcLocalQueries
555 triangleIndex.setSize(info.size());
557 const globalIndex& triIndexer = globalTris();
573 label proci = triIndexer.whichProcID(info[i].index());
582 sendMap[proci].setSize(nSend[proci]);
591 label proci = triIndexer.whichProcID(info[i].index());
592 triangleIndex[i] = triIndexer.toLocal(proci, info[i].index());
593 sendMap[proci][nSend[proci]++] = i;
597 triangleIndex[i] = -1;
627 forAll(constructMap, proci)
633 constructMap[proci].setSize(nRecv);
635 for (
label i = 0; i < nRecv; i++)
637 constructMap[proci][i] = segmentI++;
646 autoPtr<distributionMap> mapPtr
655 const distributionMap& map = mapPtr();
661 map.distribute(triangleIndex);
669 Foam::searchableSurfaces::distributedTriSurface::calcOverlappingProcs
672 const scalar radiusSqr,
685 if (bbs[bbI].overlaps(centre, radiusSqr))
687 overlaps[proci] =
true;
701 Foam::searchableSurfaces::distributedTriSurface::calcLocalQueries
718 DynamicList<point> dynAllCentres(centres.size());
719 DynamicList<scalar> dynAllRadiusSqr(centres.size());
721 DynamicList<label> dynAllSegmentMap(centres.size());
738 forAll(procBbOverlaps, proci)
742 dynSendMap[proci].append(dynAllCentres.size());
743 dynAllSegmentMap.append(centreI);
744 dynAllCentres.append(centres[centreI]);
745 dynAllRadiusSqr.append(radiusSqr[centreI]);
754 dynSendMap[proci].shrink();
755 sendMap[proci].transfer(dynSendMap[proci]);
758 allCentres.transfer(dynAllCentres.shrink());
759 allRadiusSqr.transfer(dynAllRadiusSqr.shrink());
760 allSegmentMap.transfer(dynAllSegmentMap.shrink());
785 forAll(constructMap, proci)
791 constructMap[proci].setSize(nRecv);
793 for (
label i = 0; i < nRecv; i++)
795 constructMap[proci][i] = segmentI++;
800 autoPtr<distributionMap> mapPtr
820 Foam::searchableSurfaces::distributedTriSurface::independentlyDistributedBbs
825 if (!distributor_.valid())
834 if (!isA<decompositionMethods::geometric>(distributor_()))
837 <<
"The decomposition method " << distributor_().typeName
838 <<
" is not a geometric decomposition method." <<
endl
839 <<
"Only geometric decomposition methods are currently"
849 triCentres[triI] =
s[triI].centre(
s.points());
853 decompositionMethods::geometric& distributor =
854 refCast<decompositionMethods::geometric>(distributor_());
857 labelList distribution(distributor.decompose(triCentres));
865 bbs[proci].setSize(1);
867 bbs[proci][0].min() =
point( vGreat, vGreat, vGreat);
868 bbs[proci][0].max() =
point(-vGreat, -vGreat, -vGreat);
873 point& bbMin = bbs[distribution[triI]][0].min();
874 point& bbMax = bbs[distribution[triI]][0].max();
879 const point& pt =
s.points()[
f[fp]];
890 reduce(bbs[proci][i].
min(), minOp<point>());
891 reduce(bbs[proci][i].
max(), maxOp<point>());
909 const treeBoundBox& bb = bbs[bbI];
911 treeBoundBox triBb(p0, p0);
912 triBb.min() =
min(triBb.min(), p1);
913 triBb.min() =
min(triBb.min(), p2);
915 triBb.max() =
max(triBb.max(), p1);
916 triBb.max() =
max(triBb.max(), p2);
922 if (bb.overlaps(triBb))
925 if (bb.contains(p0) || bb.contains(p1) || bb.contains(p2))
946 void Foam::searchableSurfaces::distributedTriSurface::subsetMeshMap
950 const label nIncluded,
956 newToOldFaces.setSize(nIncluded);
957 newToOldPoints.setSize(
s.points().size());
958 oldToNewPoints.setSize(
s.points().size());
966 if (include[oldFacei])
969 newToOldFaces[facei++] = oldFacei;
978 if (oldToNewPoints[oldPointi] == -1)
980 oldToNewPoints[oldPointi] = pointi;
981 newToOldPoints[pointi++] = oldPointi;
986 newToOldPoints.setSize(pointi);
991 Foam::triSurface Foam::searchableSurfaces::distributedTriSurface::subsetMesh
1001 forAll(newToOldPoints, i)
1003 newPoints[i] =
s.points()[newToOldPoints[i]];
1011 const labelledTri& tri =
s[newToOldFaces[i]];
1013 newTriangles[i][0] = oldToNewPoints[tri[0]];
1014 newTriangles[i][1] = oldToNewPoints[tri[1]];
1015 newTriangles[i][2] = oldToNewPoints[tri[2]];
1016 newTriangles[i].region() = tri.region();
1024 Foam::triSurface Foam::searchableSurfaces::distributedTriSurface::subsetMesh
1063 Foam::triSurface Foam::searchableSurfaces::distributedTriSurface::subsetMesh
1072 createWithValues<boolList>
1081 newToOldPoints.setSize(
s.points().size());
1082 labelList oldToNewPoints(
s.points().size(), -1);
1086 forAll(include, oldFacei)
1088 if (include[oldFacei])
1097 if (oldToNewPoints[oldPointi] == -1)
1099 oldToNewPoints[oldPointi] = pointi;
1100 newToOldPoints[pointi++] = oldPointi;
1105 newToOldPoints.setSize(pointi);
1118 Foam::label Foam::searchableSurfaces::distributedTriSurface::findTriangle
1122 const labelledTri& otherF
1130 const labelledTri&
f = allFaces[
pFaces[i]];
1132 if (
f.region() == otherF.region())
1137 label fp1 =
f.fcIndex(fp0);
1138 label fp2 =
f.fcIndex(fp1);
1140 if (
f[fp1] == otherF[1] &&
f[fp2] == otherF[2])
1151 void Foam::searchableSurfaces::distributedTriSurface::merge
1153 const scalar mergeDist,
1174 label nOldAllPoints = allPoints.size();
1180 label allPointi = nOldAllPoints;
1181 forAll(pointConstructMap, pointi)
1183 if (pointConstructMap[pointi] == -1)
1185 pointConstructMap[pointi] = allPointi++;
1189 if (allPointi > nOldAllPoints)
1191 allPoints.setSize(allPointi);
1193 forAll(pointConstructMap, pointi)
1195 if (pointConstructMap[pointi] >= nOldAllPoints)
1197 allPoints[pointConstructMap[pointi]] = subPoints[pointi];
1211 label allTriI = allTris.size();
1212 allTris.setSize(allTriI + subTris.size());
1214 faceConstructMap.setSize(subTris.size());
1218 const labelledTri& subTri = subTris[triI];
1221 labelledTri mappedTri
1223 pointConstructMap[subTri[0]],
1224 pointConstructMap[subTri[1]],
1225 pointConstructMap[subTri[2]],
1231 bool fullMatch =
true;
1235 if (mappedTri[fp] >= nOldAllPoints)
1246 label i = findTriangle
1256 faceConstructMap[triI] = allTriI;
1257 allTris[allTriI] = mappedTri;
1262 faceConstructMap[triI] = i;
1268 faceConstructMap[triI] = allTriI;
1269 allTris[allTriI] = mappedTri;
1273 allTris.setSize(allTriI);
1320 Info<<
'\t' << proci <<
'\t' << nTris[proci]
1321 <<
'\t' << procBb_[proci] <<
endl;
1338 io.
time().findInstance(io.local(),
word::null),
1375 <<
" using 'timeStampMaster' or 'inotifyMaster.'\n"
1376 <<
" Modify the entry fileModificationChecking\n"
1377 <<
" in the etc/controlDict.\n"
1378 <<
" Use 'timeStamp' instead."
1401 Info<<
'\t' << proci <<
'\t' << nTris[proci]
1402 <<
'\t' << procBb_[proci] <<
endl;
1421 io.
time().findInstance(io.local(),
word::null),
1459 <<
" using 'timeStampMaster' or 'inotifyMaster.'\n"
1460 <<
" Modify the entry fileModificationChecking\n"
1461 <<
" in the etc/controlDict.\n"
1462 <<
" Use 'timeStamp' instead."
1485 Info<<
'\t' << proci <<
'\t' << nTris[proci]
1486 <<
'\t' << procBb_[proci] <<
endl;
1504 globalTris_.clear();
1514 if (!globalTris_.valid())
1558 label nProcs = calcOverlappingProcs
1568 info[i] = octree.findNearest(
samples[i], nearestDistSqr[i]);
1571 info[i].setIndex(triIndexer.
toGlobal(info[i].index()));
1629 allInfo[i] = octree.findNearest
1634 if (allInfo[i].hit())
1636 allInfo[i].setIndex(triIndexer.
toGlobal(allInfo[i].index()));
1652 if (allInfo[i].hit())
1654 label pointi = allSegmentMap[i];
1656 if (!info[pointi].hit())
1659 info[pointi] = allInfo[i];
1670 info[pointi] = allInfo[i];
1679 void Foam::searchableSurfaces::distributedTriSurface::findLine
1747 +
vector(rootVSmall,rootVSmall,rootVSmall)
1756 info.setSize(hitInfo.
size());
1759 if (hitInfo[pointi].hit())
1761 info[pointi].setSize(1);
1762 info[pointi][0] = hitInfo[pointi];
1764 point pt = hitInfo[pointi].hitPoint() + smallVec[pointi];
1766 if (((pt-start[pointi])&dirVec[pointi]) <= magSqrDirVec[pointi])
1769 e1[compactI] = end[pointi];
1770 pointMap[compactI] = pointi;
1776 info[pointi].clear();
1799 if (hitInfo[i].hit())
1801 label pointi = pointMap[i];
1803 label sz = info[pointi].size();
1804 info[pointi].setSize(sz+1);
1805 info[pointi][sz] = hitInfo[i];
1807 point pt = hitInfo[i].hitPoint() + smallVec[pointi];
1809 if (((pt-start[pointi])&dirVec[pointi]) <= magSqrDirVec[pointi])
1812 e1[compactI] = end[pointi];
1813 pointMap[compactI] = pointi;
1876 label triI = triangleIndex[i];
1925 label triI = triangleIndex[i];
1926 normal[i] =
s[triI].normal(
s.points());
1949 if (foundObject<labelIOField>(
"values"))
1975 label triI = triangleIndex[i];
1976 values[i] =
fld[triI];
1995 <<
"Volume type not supported for distributed surfaces."
2016 const scalar eps = 1.0e-4;
2019 const point mid = 0.5*(bbs[i].min() + bbs[i].max());
2020 const vector halfSpan = (1.0+eps)*(bbs[i].
max() - mid);
2022 bbsX[i].min() = mid - halfSpan;
2023 bbsX[i].max() = mid + halfSpan;
2029 const point& p0 =
s.points()[
f[0]];
2030 const point& p1 =
s.points()[
f[1]];
2031 const point& p2 =
s.points()[
f[2]];
2033 if (overlaps(bbsX, p0, p1, p2))
2035 includedFace[triI] =
true;
2039 return subsetMesh(
s, includedFace, subPointMap, subFaceMap);
2046 const bool keepNonLocal,
2070 newProcBb = independentlyDistributedBbs(*
this);
2083 if (newProcBb == procBb_)
2089 procBb_.transfer(newProcBb);
2104 <<
"before distribution:" <<
endl <<
"\tproc\ttris" <<
endl;
2108 Info<<
'\t' << proci <<
'\t' << nTris[proci] <<
endl;
2126 pointSendMap[proci],
2147 forAll(faceSendMap, proci)
2151 forAll(faceSendMap[proci], i)
2153 includedFace[faceSendMap[proci][i]] =
false;
2181 forAll(faceSendMap, proci)
2216 allTris = subSurface;
2217 allPoints = subSurface.
points();
2234 forAll(faceSendSizes, proci)
2270 forAll(faceSendSizes, proci)
2298 faceConstructMap[proci],
2299 pointConstructMap[proci]
2318 move(faceConstructMap)
2327 move(pointConstructMap)
2348 distributeFields<label>(
faceMap());
2349 distributeFields<scalar>(
faceMap());
2350 distributeFields<vector>(
faceMap());
2351 distributeFields<sphericalTensor>(
faceMap());
2352 distributeFields<symmTensor>(
faceMap());
2353 distributeFields<tensor>(
faceMap());
2363 <<
"after distribution:" <<
endl <<
"\tproc\ttris" <<
endl;
2367 Info<<
'\t' << proci <<
'\t' << nTris[proci] <<
endl;
2397 Foam::triSurface::write(fullPath,
true);
2426 os <<
indent <<
"Triangles : "
2428 <<
indent <<
"Vertices : "
2430 <<
indent <<
"Bounding Box : " << bb <<
endl;
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
A primitive field of type <Type> with automated input and output.
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...
void size(const label)
Override size to be inconsistent with allocated storage.
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.
T & operator[](const label)
Return element of UList.
friend Ostream & operator(Ostream &, const UList< T > &)
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
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.
Motion of the mesh specified as a list of pointMeshMovers.
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.
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.
virtual bool overlaps(const boundBox &bb) const
Does any part of the surface overlap the supplied bound box?
virtual void findLineAny(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Return any intersection on segment from start to end.
virtual ~distributedTriSurface()
Destructor.
static Foam::triSurface overlappingSurface(const Foam::triSurface &, const List< treeBoundBox > &, labelList &subPointMap, labelList &subFaceMap)
Subset the part of surface that is overlapping bounds.
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.
distributedTriSurface(const IOobject &, const Foam::triSurface &, const dictionary &dict)
Construct from triSurface.
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
static const NamedEnum< distributionType, 3 > distributionTypeNames_
virtual void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit >> &) const
Get all intersections in order from start to end.
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.
A surface geometry formed of discrete facets, e.g. triangles and/or quadrilaterals,...
virtual label size() const
Range of local indices that can be returned.
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.
label size() const
Return size.
Triangulated surface description with patch information.
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(lagrangian::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(), lagrangian::cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), lagrangian::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.
addToRunTimeSelectionTable(searchableSurface, box, dictionary)
defineTypeNameAndDebug(box, 0)
addBackwardCompatibleToRunTimeSelectionTable(searchableSurface, box, dictionary, searchableBox, "searchableBox")
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.
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.
const fvMesh & region(const dictionary &dict)
Cast the give dictionary to the corresponding region fvMesh.
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)
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)
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
bool matchPoints(const Field< point > &pts0, const Field< point > &pts1, const Field< scalar > &matchDistance, const bool verbose, labelList &from0To1, const point &origin=point::zero)
Determine correspondence between pointFields. Gets passed.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
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.
tmp< DimensionedField< scalar, GeoMesh, Field > > magSqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
Ostream & indent(Ostream &os)
Indent stream.
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
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)