46 namespace searchableSurfaces
62 distributedTriSurfaceMesh,
63 "distributedTriSurfaceMesh"
82 bool Foam::searchableSurfaces::distributedTriSurface::read()
95 mergeDist_ = dict_.
lookup<scalar>(
"mergeDistance");
102 bool Foam::searchableSurfaces::distributedTriSurface::isLocal
104 const List<treeBoundBox>& myBbs,
111 if (myBbs[bbI].contains(start) && myBbs[bbI].contains(end))
182 void Foam::searchableSurfaces::distributedTriSurface::distributeSegment
184 const label segmentI,
188 DynamicList<segment>& allSegments,
189 DynamicList<label>& allSegmentMap,
190 List<DynamicList<label>>& sendMap
207 const List<treeBoundBox>& bbs = procBb_[proci];
209 if (isLocal(bbs, start, end))
211 sendMap[proci].append(allSegments.size());
212 allSegmentMap.append(segmentI);
213 allSegments.append(
segment(start, end));
224 const List<treeBoundBox>& bbs = procBb_[proci];
228 const treeBoundBox& bb = bbs[bbI];
236 if (bb.intersects(start, end, clipPt))
238 sendMap[proci].append(allSegments.size());
239 allSegmentMap.append(segmentI);
240 allSegments.append(
segment(start, end));
263 Foam::searchableSurfaces::distributedTriSurface::distributeSegments
268 List<segment>& allSegments,
283 DynamicList<segment> dynAllSegments(start.size());
285 DynamicList<label> dynAllSegmentMap(start.size());
307 dynSendMap[proci].shrink();
308 sendMap[proci].transfer(dynSendMap[proci]);
311 allSegments.transfer(dynAllSegments.shrink());
312 allSegmentMap.transfer(dynAllSegmentMap.shrink());
337 forAll(constructMap, proci)
343 constructMap[proci].setSize(nRecv);
345 for (
label i = 0; i < nRecv; i++)
347 constructMap[proci][i] = segmentI++;
352 return autoPtr<distributionMap>
364 void Foam::searchableSurfaces::distributedTriSurface::findLine
366 const bool nearestIntersection,
369 List<pointIndexHit>& info
372 const indexedOctree<treeDataTriSurface>& octree = tree();
375 info.setSize(start.size());
385 if (nearestIntersection)
387 info[i] = octree.findLine(start[i], end[i]);
391 info[i] = octree.findLineAny(start[i], end[i]);
398 const globalIndex& triIndexer = globalTris();
410 if (nearestIntersection)
412 info[i] = octree.findLine(start[i], end[i]);
416 info[i] = octree.findLineAny(start[i], end[i]);
421 info[i].setIndex(triIndexer.toGlobal(info[i].index()));
442 List<segment> allSegments(start.size());
446 const autoPtr<distributionMap> mapPtr
456 const distributionMap& map = mapPtr();
458 label nOldAllSegments = allSegments.size();
464 map.distribute(allSegments);
471 List<pointIndexHit> intersections(allSegments.size());
475 if (nearestIntersection)
477 intersections[i] = octree.findLine
479 allSegments[i].
first(),
485 intersections[i] = octree.findLineAny
487 allSegments[i].
first(),
493 if (intersections[i].hit())
495 intersections[i].setIndex
497 triIndexer.toGlobal(intersections[i].index())
506 map.reverseDistribute(nOldAllSegments, intersections);
515 label segmentI = allSegmentMap[i];
525 else if (nearestIntersection)
530 magSqr(allInfo.hitPoint()-start[segmentI])
531 <
magSqr(hitInfo.hitPoint()-start[segmentI])
548 Foam::searchableSurfaces::distributedTriSurface::calcLocalQueries
550 const List<pointIndexHit>& info,
554 triangleIndex.setSize(info.size());
556 const globalIndex& triIndexer = globalTris();
572 label proci = triIndexer.whichProcID(info[i].index());
581 sendMap[proci].setSize(nSend[proci]);
590 label proci = triIndexer.whichProcID(info[i].index());
591 triangleIndex[i] = triIndexer.toLocal(proci, info[i].index());
592 sendMap[proci][nSend[proci]++] = i;
596 triangleIndex[i] = -1;
626 forAll(constructMap, proci)
632 constructMap[proci].setSize(nRecv);
634 for (
label i = 0; i < nRecv; i++)
636 constructMap[proci][i] = segmentI++;
645 autoPtr<distributionMap> mapPtr
654 const distributionMap& map = mapPtr();
660 map.distribute(triangleIndex);
668 Foam::searchableSurfaces::distributedTriSurface::calcOverlappingProcs
671 const scalar radiusSqr,
680 const List<treeBoundBox>& bbs = procBb_[proci];
684 if (bbs[bbI].overlaps(centre, radiusSqr))
686 overlaps[proci] =
true;
700 Foam::searchableSurfaces::distributedTriSurface::calcLocalQueries
717 DynamicList<point> dynAllCentres(centres.size());
718 DynamicList<scalar> dynAllRadiusSqr(centres.size());
720 DynamicList<label> dynAllSegmentMap(centres.size());
737 forAll(procBbOverlaps, proci)
741 dynSendMap[proci].append(dynAllCentres.size());
742 dynAllSegmentMap.append(centreI);
743 dynAllCentres.append(centres[centreI]);
744 dynAllRadiusSqr.append(radiusSqr[centreI]);
753 dynSendMap[proci].shrink();
754 sendMap[proci].transfer(dynSendMap[proci]);
757 allCentres.transfer(dynAllCentres.shrink());
758 allRadiusSqr.transfer(dynAllRadiusSqr.shrink());
759 allSegmentMap.transfer(dynAllSegmentMap.shrink());
784 forAll(constructMap, proci)
790 constructMap[proci].setSize(nRecv);
792 for (
label i = 0; i < nRecv; i++)
794 constructMap[proci][i] = segmentI++;
799 autoPtr<distributionMap> mapPtr
819 Foam::searchableSurfaces::distributedTriSurface::independentlyDistributedBbs
824 if (!distributor_.valid())
833 if (!isA<decompositionMethods::geometric>(distributor_()))
836 <<
"The decomposition method " << distributor_().typeName
837 <<
" is not a geometric decomposition method." <<
endl
838 <<
"Only geometric decomposition methods are currently"
848 triCentres[triI] =
s[triI].centre(
s.points());
852 decompositionMethods::geometric& distributor =
853 refCast<decompositionMethods::geometric>(distributor_());
856 labelList distribution(distributor.decompose(triCentres));
864 bbs[proci].setSize(1);
866 bbs[proci][0].min() =
point( vGreat, vGreat, vGreat);
867 bbs[proci][0].max() =
point(-vGreat, -vGreat, -vGreat);
872 point& bbMin = bbs[distribution[triI]][0].
min();
873 point& bbMax = bbs[distribution[triI]][0].
max();
878 const point& pt =
s.points()[
f[fp]];
889 reduce(bbs[proci][i].
min(), minOp<point>());
890 reduce(bbs[proci][i].
max(), maxOp<point>());
898 bool Foam::searchableSurfaces::distributedTriSurface::overlaps
900 const List<treeBoundBox>& bbs,
908 const treeBoundBox& bb = bbs[bbI];
910 treeBoundBox triBb(p0, p0);
911 triBb.min() =
min(triBb.min(), p1);
912 triBb.min() =
min(triBb.min(), p2);
914 triBb.max() =
max(triBb.max(), p1);
915 triBb.max() =
max(triBb.max(), p2);
921 if (bb.overlaps(triBb))
924 if (bb.contains(p0) || bb.contains(p1) || bb.contains(p2))
945 void Foam::searchableSurfaces::distributedTriSurface::subsetMeshMap
949 const label nIncluded,
955 newToOldFaces.setSize(nIncluded);
956 newToOldPoints.setSize(
s.points().size());
957 oldToNewPoints.setSize(
s.points().size());
965 if (include[oldFacei])
968 newToOldFaces[facei++] = oldFacei;
977 if (oldToNewPoints[oldPointi] == -1)
979 oldToNewPoints[oldPointi] = pointi;
980 newToOldPoints[pointi++] = oldPointi;
985 newToOldPoints.setSize(pointi);
990 Foam::triSurface Foam::searchableSurfaces::distributedTriSurface::subsetMesh
1000 forAll(newToOldPoints, i)
1002 newPoints[i] =
s.points()[newToOldPoints[i]];
1005 List<labelledTri> newTriangles(newToOldFaces.size());
1010 const labelledTri& tri =
s[newToOldFaces[i]];
1012 newTriangles[i][0] = oldToNewPoints[tri[0]];
1013 newTriangles[i][1] = oldToNewPoints[tri[1]];
1014 newTriangles[i][2] = oldToNewPoints[tri[2]];
1015 newTriangles[i].region() = tri.region();
1023 Foam::triSurface Foam::searchableSurfaces::distributedTriSurface::subsetMesh
1062 Foam::triSurface Foam::searchableSurfaces::distributedTriSurface::subsetMesh
1071 createWithValues<boolList>
1080 newToOldPoints.setSize(
s.points().size());
1081 labelList oldToNewPoints(
s.points().size(), -1);
1085 forAll(include, oldFacei)
1087 if (include[oldFacei])
1096 if (oldToNewPoints[oldPointi] == -1)
1098 oldToNewPoints[oldPointi] = pointi;
1099 newToOldPoints[pointi++] = oldPointi;
1104 newToOldPoints.setSize(pointi);
1117 Foam::label Foam::searchableSurfaces::distributedTriSurface::findTriangle
1119 const List<labelledTri>& allFaces,
1121 const labelledTri& otherF
1129 const labelledTri&
f = allFaces[
pFaces[i]];
1131 if (
f.region() == otherF.region())
1136 label fp1 =
f.fcIndex(fp0);
1137 label fp2 =
f.fcIndex(fp1);
1139 if (
f[fp1] == otherF[1] &&
f[fp2] == otherF[2])
1150 void Foam::searchableSurfaces::distributedTriSurface::merge
1152 const scalar mergeDist,
1153 const List<labelledTri>& subTris,
1156 List<labelledTri>& allTris,
1173 label nOldAllPoints = allPoints.size();
1179 label allPointi = nOldAllPoints;
1180 forAll(pointConstructMap, pointi)
1182 if (pointConstructMap[pointi] == -1)
1184 pointConstructMap[pointi] = allPointi++;
1188 if (allPointi > nOldAllPoints)
1190 allPoints.setSize(allPointi);
1192 forAll(pointConstructMap, pointi)
1194 if (pointConstructMap[pointi] >= nOldAllPoints)
1196 allPoints[pointConstructMap[pointi]] = subPoints[pointi];
1210 label allTriI = allTris.size();
1211 allTris.setSize(allTriI + subTris.size());
1213 faceConstructMap.setSize(subTris.size());
1217 const labelledTri& subTri = subTris[triI];
1220 labelledTri mappedTri
1222 pointConstructMap[subTri[0]],
1223 pointConstructMap[subTri[1]],
1224 pointConstructMap[subTri[2]],
1230 bool fullMatch =
true;
1234 if (mappedTri[fp] >= nOldAllPoints)
1245 label i = findTriangle
1255 faceConstructMap[triI] = allTriI;
1256 allTris[allTriI] = mappedTri;
1261 faceConstructMap[triI] = i;
1267 faceConstructMap[triI] = allTriI;
1268 allTris[allTriI] = mappedTri;
1272 allTris.setSize(allTriI);
1319 Info<<
'\t' << proci <<
'\t' << nTris[proci]
1320 <<
'\t' << procBb_[proci] <<
endl;
1337 io.time().findInstance(io.local(),
word::null),
1374 <<
" using 'timeStampMaster' or 'inotifyMaster.'\n"
1375 <<
" Modify the entry fileModificationChecking\n"
1376 <<
" in the etc/controlDict.\n"
1377 <<
" Use 'timeStamp' instead."
1400 Info<<
'\t' << proci <<
'\t' << nTris[proci]
1401 <<
'\t' << procBb_[proci] <<
endl;
1420 io.time().findInstance(io.local(),
word::null),
1458 <<
" using 'timeStampMaster' or 'inotifyMaster.'\n"
1459 <<
" Modify the entry fileModificationChecking\n"
1460 <<
" in the etc/controlDict.\n"
1461 <<
" Use 'timeStamp' instead."
1484 Info<<
'\t' << proci <<
'\t' << nTris[proci]
1485 <<
'\t' << procBb_[proci] <<
endl;
1503 globalTris_.clear();
1513 if (!globalTris_.valid())
1557 label nProcs = calcOverlappingProcs
1567 info[i] = octree.findNearest(
samples[i], nearestDistSqr[i]);
1570 info[i].setIndex(triIndexer.
toGlobal(info[i].index()));
1628 allInfo[i] = octree.findNearest
1633 if (allInfo[i].hit())
1635 allInfo[i].setIndex(triIndexer.
toGlobal(allInfo[i].index()));
1651 if (allInfo[i].hit())
1653 label pointi = allSegmentMap[i];
1655 if (!info[pointi].hit())
1658 info[pointi] = allInfo[i];
1669 info[pointi] = allInfo[i];
1678 void Foam::searchableSurfaces::distributedTriSurface::findLine
1746 +
vector(rootVSmall,rootVSmall,rootVSmall)
1755 info.setSize(hitInfo.
size());
1758 if (hitInfo[pointi].hit())
1760 info[pointi].setSize(1);
1761 info[pointi][0] = hitInfo[pointi];
1763 point pt = hitInfo[pointi].hitPoint() + smallVec[pointi];
1765 if (((pt-start[pointi])&dirVec[pointi]) <= magSqrDirVec[pointi])
1768 e1[compactI] = end[pointi];
1769 pointMap[compactI] = pointi;
1775 info[pointi].
clear();
1798 if (hitInfo[i].hit())
1800 label pointi = pointMap[i];
1803 info[pointi].setSize(sz+1);
1804 info[pointi][sz] = hitInfo[i];
1806 point pt = hitInfo[i].hitPoint() + smallVec[pointi];
1808 if (((pt-start[pointi])&dirVec[pointi]) <= magSqrDirVec[pointi])
1811 e1[compactI] = end[pointi];
1812 pointMap[compactI] = pointi;
1875 label triI = triangleIndex[i];
1876 region[i] =
s[triI].region();
1924 label triI = triangleIndex[i];
1925 normal[i] =
s[triI].normal(
s.points());
1948 if (foundObject<triSurfaceLabelField>(
"values"))
1951 lookupObject<triSurfaceLabelField>(
"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);
2429 <<
"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.
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.
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 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.
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.
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)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
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,.
void magSqr(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
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)