50const Foam::vector Foam::boundaryMesh::splitNormal_(3, 2, 1);
53const Foam::scalar Foam::boundaryMesh::distanceTol_ = 1
e-2;
59Foam::label Foam::boundaryMesh::nFeatureEdges(label pointi)
const
67 label edgeI = pEdges[pEdgeI];
69 if (edgeToFeature_[edgeI] != -1)
79Foam::label Foam::boundaryMesh::nextFeatureEdge
89 label nbrEdgeI = pEdges[pEdgeI];
91 if (nbrEdgeI != edgeI)
93 label featI = edgeToFeature_[nbrEdgeI];
112 const label startEdgeI,
118 label edgeI = startEdgeI;
122 label vertI =
e.start();
124 while (!isFeaturePoint[vertI])
128 edgeI = nextFeatureEdge(edgeI, vertI);
130 if ((edgeI == -1) || (edgeI == startEdgeI))
139 vertI =
e.otherVertex(vertI);
151 labelList featLabels(featureEdges_.size());
153 label featLabelI = 0;
155 label initEdgeI = edgeI;
160 label featI = edgeToFeature_[edgeI];
167 featLabels[featLabelI++] = featI;
169 featVisited[featI] =
true;
175 vertI =
e.otherVertex(vertI);
179 edgeI = nextFeatureEdge(edgeI, vertI);
181 if ((edgeI == -1) || (edgeI == initEdgeI))
186 while (!isFeaturePoint[vertI]);
190 featLabels.setSize(featLabelI);
196void Foam::boundaryMesh::markEdges
198 const label maxDistance,
202 DynamicList<label>& visited
209 if (minDistance[edgeI] == -1)
212 visited.append(edgeI);
214 else if (minDistance[edgeI] <=
distance)
227 forAll(startEdges, pEdgeI)
257Foam::label Foam::boundaryMesh::findPatchID
260 const word& patchName
281 names[patchi] = patches_[patchi].name();
287Foam::label Foam::boundaryMesh::whichPatch
297 if ((facei >= pp.
start()) && (facei < (pp.
start() + pp.size())))
321 label facei = changedFaces[i];
327 label edgeI = fEdges[fEdgeI];
329 if (!regionEdge[edgeI] && (edgeRegion[edgeI] == -1))
331 edgeRegion[edgeI] = region;
333 changedEdges[changedI++] = edgeI;
338 changedEdges.setSize(changedI);
357 label edgeI = changedEdges[i];
363 label facei = eFaces[eFacei];
365 if (faceRegion[facei] == -1)
367 faceRegion[facei] = region;
369 changedFaces[changedI++] = facei;
374 changedFaces.setSize(changedI);
381void Foam::boundaryMesh::markZone
389 faceZone[facei] = currentZone;
401 changedEdges = faceToEdge
411 Pout<<
"From changedFaces:" << changedFaces.size()
412 <<
" to changedEdges:" << changedEdges.size()
416 if (changedEdges.empty())
421 changedFaces = edgeToFace(currentZone, changedEdges, faceZone);
425 Pout<<
"From changedEdges:" << changedEdges.size()
426 <<
" to changedFaces:" << changedFaces.size()
430 if (changedFaces.empty())
458 meshPtr_.reset(
nullptr);
473 meshFace_.setSize(nBFaces);
498 meshFace_[bFacei] = pp.
start() + patchFacei;
500 bFaces[bFacei] = pp[patchFacei];
509 Pout<<
"read : patches now:" <<
endl;
540 const bMesh& msh = *meshPtr_;
542 Pout<<
"** Start of Faces **" <<
endl;
546 const face&
f = msh[facei];
562 Pout<<
"** End of Faces **" <<
endl;
564 Pout<<
"** Start of Points **" <<
endl;
569 <<
" coord:" << msh.
points()[pointi]
573 Pout<<
"** End of Points **" <<
endl;
577 featurePoints_.clear();
578 featureEdges_.clear();
580 featureToEdge_.clear();
581 edgeToFeature_.resize(meshPtr_->nEdges());
584 featureSegments_.clear();
603 regions[triI] = surf[triI].region();
610 label oldRegion = -1111;
611 label boundPatch = 0;
615 if (regions[i] != oldRegion)
617 regionToBoundaryPatch.
insert(regions[i], boundPatch);
619 oldRegion = regions[i];
628 if (surfPatches.
size() == regionToBoundaryPatch.
size())
633 patches_.setSize(surfPatches.
size());
636 forAll(surfPatches, patchi)
658 patches_.setSize(regionToBoundaryPatch.
size());
685 meshFace_.setSize(surf.
size());
690 label surfRegion = regions[0];
691 label foamRegion = regionToBoundaryPatch[surfRegion];
693 Pout<<
"Surface region " << surfRegion <<
" becomes boundary patch "
694 << foamRegion <<
" with name " << patches_[foamRegion].
name() <<
endl;
698 label startFacei = 0;
702 label triI = indices[indexI];
706 if (tri.
region() != surfRegion)
711 bp.
size() = bFacei - startFacei;
712 bp.
start() = startFacei;
714 surfRegion = tri.
region();
715 foamRegion = regionToBoundaryPatch[surfRegion];
717 Pout<<
"Surface region " << surfRegion <<
" becomes boundary patch "
718 << foamRegion <<
" with name " << patches_[foamRegion].
name()
724 meshFace_[bFacei] = triI;
726 bFaces[bFacei++] =
face(tri);
732 bp.
size() = bFacei - startFacei;
733 bp.
start() = startFacei;
745 featurePoints_.clear();
746 featureEdges_.clear();
748 featureToEdge_.clear();
749 edgeToFeature_.resize(meshPtr_->nEdges());
752 featureSegments_.clear();
765 surfPatches[patchi] =
781 label totalNTris = getNTris(0,
mesh().size(), nTris);
790 startTri[facei] = triI;
792 triI += nTris[facei];
798 triangulate(0,
mesh().size(), totalNTris, triVerts);
812 label facei = bp.
start() + patchFacei;
814 label triVertI = 3*startTri[facei];
816 for (label faceTriI = 0; faceTriI < nTris[facei]; faceTriI++)
818 label v0 = triVerts[triVertI++];
819 label v1 = triVerts[triVertI++];
820 label v2 = triVerts[triVertI++];
831 surf.
write(surfStream);
861 scalar
sign =
mesh().faceNormals()[bFacei] & splitNormal_;
865 rightFaces.
append(bFacei);
878 Pout<<
"getNearest :"
879 <<
" rightBin:" << rightFaces.
size()
880 <<
" leftBin:" << leftFaces.
size()
901 scalar tol = 1
e-6 * overallBb.
avgDim();
913 const scalar planarTol =
954 Pout<<
"getNearest : built trees" <<
endl;
969 const scalar searchDimSqr =
magSqr(searchSpan);
971 forAll(nearestBFacei, patchFacei)
977 if (debug && (patchFacei % 1000) == 0)
979 Pout<<
"getNearest : patchFace:" << patchFacei
980 <<
" meshFacei:" << meshFacei <<
" ctr:" << ctr <<
endl;
986 scalar area =
mag(
n);
989 scalar typDim = -GREAT;
998 pointIndexHit rightInfo = rightTree.findNearest(ctr, searchDimSqr);
1002 pointIndexHit leftInfo = leftTree.findNearest(ctr, searchDimSqr);
1004 if (rightInfo.
hit())
1009 label rightFacei = rightFaces[rightInfo.
index()];
1010 label leftFacei = leftFaces[leftInfo.
index()];
1015 scalar rightSign =
n & ns[rightFacei];
1016 scalar leftSign =
n & ns[leftFacei];
1020 (rightSign > 0 && leftSign > 0)
1021 || (rightSign < 0 && leftSign < 0)
1025 if (rightDist < leftDist)
1027 nearestBFacei[patchFacei] = rightFacei;
1031 nearestBFacei[patchFacei] = leftFacei;
1043 typDim *= distanceTol_;
1045 if (rightDist < typDim && leftDist < typDim)
1050 nearestBFacei[patchFacei] = rightFacei;
1054 nearestBFacei[patchFacei] = leftFacei;
1060 if (rightDist < leftDist)
1062 nearestBFacei[patchFacei] = rightFacei;
1066 nearestBFacei[patchFacei] = leftFacei;
1075 label rightFacei = rightFaces[rightInfo.
index()];
1076 nearestBFacei[patchFacei] = rightFacei;
1087 nearestBFacei[patchFacei] = leftFaces[leftInfo.
index()];
1092 nearestBFacei[patchFacei] = -1;
1097 return nearestBFacei;
1116 Map<word> indexToName(2*patches_.size());
1119 label nNewPatches = patches_.size();
1121 forAll(oldPatches, oldPatchi)
1123 const polyPatch& patch = oldPatches[oldPatchi];
1124 const label newPatchi = findPatchID(patch.name());
1126 if (newPatchi != -1)
1128 nameToIndex.
insert(patch.name(), newPatchi);
1129 indexToName.
insert(newPatchi, patch.name());
1135 forAll(patches_, bPatchi)
1159 forAll(patches_, bPatchi)
1163 const label newPatchi = nameToIndex[bp.
name()];
1166 const label oldPatchi = findPatchID(oldPatches, bp.
name());
1168 if (oldPatchi == -1)
1173 Pout<<
"patchify : Creating new polyPatch:" << bp.
name()
1187 meshFacei += facesToBeDone;
1195 const polyPatch& oldPatch = oldPatches[oldPatchi];
1199 Pout<<
"patchify : Cloning existing polyPatch:"
1203 newPatchPtrList[newPatchi] = oldPatch.
clone
1211 meshFacei += facesToBeDone;
1221 Pout<<
"Patchify : new polyPatch list:" <<
endl;
1223 forAll(newPatchPtrList, patchi)
1225 const polyPatch& newPatch = *newPatchPtrList[patchi];
1230 <<
" type :" << newPatch.typeName <<
endl
1231 <<
" size :" << newPatch.size() <<
endl
1232 <<
" start:" << newPatch.
start() <<
endl
1233 <<
" index:" << patchi <<
endl;
1246 if (newPatchPtrList.
size())
1253 forAll(patchFaces, newPatchi)
1255 patchFaces[newPatchi].setCapacity(nAvgFaces);
1263 forAll(oldPatches, oldPatchi)
1265 const polyPatch& patch = oldPatches[oldPatchi];
1267 forAll(patch, patchFacei)
1271 label meshFacei = patch.start() + patchFacei;
1275 patchFaces[whichPatch(nearest[bFacei])].
append(meshFacei);
1279 forAll(patchFaces, newPatchi)
1281 patchFaces[newPatchi].shrink();
1288 for (label newPatchi = 1; newPatchi < patchFaces.
size(); newPatchi++)
1307 edgeToFeature_ = -1;
1316 if (minCos >= 0.9999)
1321 edgeToFeature_[edgeI] = featureI;
1322 featureToEdge_[featureI++] = edgeI;
1331 if (eFaces.
size() == 2)
1333 label face0I = eFaces[0];
1335 label face1I = eFaces[1];
1346 const vector& n0 =
mesh().faceNormals()[face0I];
1348 const vector& n1 =
mesh().faceNormals()[face1I];
1350 float cosAng = n0 & n1;
1352 if (cosAng < minCos)
1354 edgeToFeature_[edgeI] = featureI;
1355 featureToEdge_[featureI++] = edgeI;
1362 edgeToFeature_[edgeI] = featureI;
1363 featureToEdge_[featureI++] = edgeI;
1369 featureToEdge_.setSize(featureI);
1375 featureEdges_.setSize(featureI);
1382 forAll(featureToEdge_, fEdgeI)
1384 label edgeI = featureToEdge_[fEdgeI];
1388 label start = featToMeshPoint[
e.start()];
1392 featToMeshPoint[
e.start()] = featPtI;
1394 featurePoints_[featPtI] =
mesh().
points()[
e.start()];
1401 label end = featToMeshPoint[
e.
end()];
1405 featToMeshPoint[
e.
end()] = featPtI;
1415 featureEdges_[fEdgeI] =
edge(start, end);
1419 featurePoints_.setSize(featPtI);
1431 forAll(featureToEdge_, featI)
1433 label edgeI = featureToEdge_[featI];
1437 if (nFeatureEdges(
e.start()) != 2)
1439 isFeaturePoint[
e.start()] =
true;
1442 if (nFeatureEdges(
e.
end()) != 2)
1444 isFeaturePoint[
e.
end()] =
true;
1457 boolList featVisited(featureToEdge_.size(),
false);
1461 label startFeatI = -1;
1463 forAll(featVisited, featI)
1465 if (!featVisited[featI])
1473 if (startFeatI == -1)
1484 featureToEdge_[startFeatI],
1495 featureSegments_.setSize(segments.
size());
1497 forAll(featureSegments_, segmentI)
1499 featureSegments_[segmentI] = segments[segmentI];
1512 markEdges(8, edgeI, 0, minDistance, visitedEdges);
1515 extraEdges_.transfer(visitedEdges);
1519Foam::label Foam::boundaryMesh::whichPatch(
const label facei)
const
1532 <<
"Cannot find face " << facei <<
" in list of boundaryPatches "
1540Foam::label Foam::boundaryMesh::findPatchID(
const word& patchName)
const
1544 if (patches_[patchi].
name() == patchName)
1556 patches_.setSize(patches_.size() + 1);
1560 label patchi = patches_.size()-1;
1571 patches_.set(patchi, bpPtr);
1575 Pout<<
"addPatch : patches now:" <<
endl;
1593 const label delPatchi = findPatchID(patchName);
1595 if (delPatchi == -1)
1598 <<
"Can't find patch named " << patchName
1602 if (patches_[delPatchi].size())
1605 <<
"Trying to delete non-empty patch " << patchName
1606 <<
endl <<
"Current size:" << patches_[delPatchi].size()
1612 for (label patchi = 0; patchi < delPatchi; patchi++)
1614 newPatches.
set(patchi, patches_[patchi].clone());
1619 for (label patchi = delPatchi + 1; patchi < patches_.size(); patchi++)
1621 newPatches.
set(patchi - 1, patches_[patchi].clone());
1626 patches_ = newPatches;
1630 Pout<<
"deletePatch : patches now:" <<
endl;
1648 const word& patchName,
1649 const word& patchType
1652 const label changeI = findPatchID(patchName);
1657 <<
"Can't find patch named " << patchName
1670 if (patchi == changeI)
1684 newPatches.
set(patchi, bpPtr);
1689 newPatches.
set(patchi, patches_[patchi].clone());
1693 patches_ = newPatches;
1703 if (patchIDs.
size() !=
mesh().size())
1706 <<
"List of patchIDs not equal to number of faces." <<
endl
1707 <<
"PatchIDs size:" << patchIDs.
size()
1718 label
patchID = patchIDs[facei];
1720 if (patchID < 0 || patchID >= patches_.size())
1723 <<
"PatchID " <<
patchID <<
" out of range"
1736 for (label patchi = 1; patchi < patches_.size(); patchi++)
1738 startFace[patchi] = startFace[patchi-1] +
nFaces[patchi-1];
1761 patches_ = newPatches;
1765 Pout<<
"changeFaces : patches now:" <<
endl;
1785 int patchID = patchIDs[facei];
1787 oldToNew[facei] = startFace[
patchID]++;
1797 newFaces[oldToNew[facei]] =
mesh()[facei];
1798 newMeshFace[oldToNew[facei]] = meshFace_[facei];
1806 meshFace_.transfer(newMeshFace);
1813 meshPtr_ = std::move(newMeshPtr);
1827 const label startFacei,
1832 label totalNTris = 0;
1836 for (label i = 0; i <
nFaces; i++)
1838 label faceNTris = getNTris(startFacei + i);
1840 nTris[i] = faceNTris;
1842 totalNTris += faceNTris;
1852 const label startFacei,
1854 const label totalNTris,
1859 triVerts.
setSize(3*totalNTris);
1863 for (label i = 0; i <
nFaces; i++)
1865 label facei = startFacei + i;
1878 forAll(triFaces, triFacei)
1880 const face& triF = triFaces[triFacei];
1882 triVerts[vertI++] = triF[0];
1883 triVerts[vertI++] = triF[1];
1884 triVerts[vertI++] = triF[2];
1893 const label startFacei,
1903 return patch.nPoints();
1910 const label startFacei,
1912 const label totalNTris,
1924 localToGlobal = patch.meshPoints();
1927 triVerts.
setSize(3*totalNTris);
1931 for (label i = 0; i <
nFaces; i++)
1934 const face&
f = patch.localFaces()[i];
1937 faceList triFaces(
f.nTriangles(patch.localPoints()));
1941 f.triangles(patch.localPoints(), nTri, triFaces);
1945 forAll(triFaces, triFacei)
1947 const face& triF = triFaces[triFacei];
1949 triVerts[vertI++] = triF[0];
1950 triVerts[vertI++] = triF[1];
1951 triVerts[vertI++] = triF[2];
1960 const label seedFacei,
1966 forAll(protectedEdges, i)
1968 protectedEdge[protectedEdges[i]] =
true;
1976 markZone(protectedEdge, seedFacei, 0, currentZone);
1981 forAll(currentZone, facei)
1983 if (currentZone[facei] == 0)
1985 visited[facei] =
true;
1989 visited[facei] =
false;
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
DynamicList< T, SizeMin > & shrink()
Shrink the allocated space to the number of elements used.
void append(const T &val)
Copy append an element to the end of this list.
A HashTable similar to std::unordered_map.
bool found(const Key &key) const
Return true if hashed entry is found in table.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
label size() const noexcept
The number of elements in table.
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
void setSize(const label n)
Alias for resize()
void append(const T &val)
Append an element at the end of the list.
void clear()
Clear the list, i.e. set size to zero.
A HashTable to objects of type <T> with a label key.
virtual label triangulate()
Triangulate in-place, returning the number of triangles added.
Output to file stream, using an OSstream.
virtual const fileName & name() const
Get the name of the stream.
label edgeToFace()
Propagate from edge to face.
label faceToEdge()
Propagate from face to edge.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
label index() const noexcept
Return the hit index.
bool hit() const noexcept
Is there a hit?
const point_type & hitPoint() const
Return hit point. Fatal if not hit.
A list of faces which address into the list of points.
const labelListList & pointEdges() const
Return point-edge addressing.
const Field< point_type > & localPoints() const
Return pointField of points in patch.
const Field< point_type > & points() const noexcept
Return reference to global points.
const List< face_type > & localFaces() const
Return patch faces addressing into local point list.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
const T * set(const label i) const
virtual bool read()
Re-read model coefficients if they have changed.
A list that is sorted upon construction or when explicitly requested with the sort() method.
const labelList & indices() const noexcept
Return the list of sorted indices. Updated every sort.
void sort()
Forward (stable) sort the list (if changed after construction).
A List obtained as a section of another List.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
A List with indirect addressing. Like IndirectList but does not store addressing.
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
iterator end() noexcept
Return an iterator to end traversing the UList.
void size(const label n)
Older name for setAddressableSize.
label size() const noexcept
The number of elements in the list.
const Cmpt & z() const
Access to the vector z component.
const Cmpt & y() const
Access to the vector y component.
const Cmpt & x() const
Access to the vector x component.
const point & min() const
Minimum describing the bounding box.
const point & max() const
Maximum describing the bounding box.
scalar avgDim() const
Average length/height/width dimension.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
void addPatch(const word &patchName)
Add to back of patch list.
void writeTriSurface(const fileName &) const
Write to file.
void setFeatureEdges(const scalar minCos)
Set featureEdges, edgeToFeature, featureSegments according.
label getNTris(const label facei) const
Simple triangulation of face subset. Returns number of triangles.
void setExtraEdges(const label edgeI)
Set extraEdges to edges 'near' to edgeI. Uses point-edge walk.
void readTriSurface(const fileName &)
Read from triSurface.
void deletePatch(const word &patchName)
Delete from patch list.
wordList patchNames() const
Get names of patches.
boundaryMesh()
Default construct.
void triangulateLocal(const label startFacei, const label nFaces, const label totalNTris, labelList &triVerts, labelList &localToGlobal) const
Same as triangulate but in local vertex numbering.
labelList getNearest(const primitiveMesh &pMesh, const vector &searchSpan) const
Get bMesh index of nearest face for every boundary face in.
const bMesh & mesh() const
void changeFaces(const labelList &patchIDs, labelList &oldToNew)
Recalculate face ordering and patches. Return old to new.
label getNPoints(const label startFacei, const label nFaces) const
Number of points used in face subset.
void markFaces(const labelList &protectedEdges, const label facei, boolList &visited) const
void patchify(const labelList &nearest, const polyBoundaryMesh &oldPatches, polyMesh &newMesh) const
Take over patches onto polyMesh from nearest face in *this.
void changePatchType(const word &patchName, const word &type)
Change patch.
Like polyPatch but without reference to mesh. Used in boundaryMesh to hold data on patches....
static word defaultName
The default cloud name: defaultCloud.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A face is a list of labels corresponding to mesh vertices.
A class for handling file names.
Identifies a surface patch/zone by name and index, with geometric type.
const word & geometricType() const noexcept
The geometric type of the patch/zone.
static constexpr const char *const emptyType
The name for an 'empty' type.
const word & name() const noexcept
The patch/zone name.
Non-pointer based hierarchical recursive searching.
A triFace with additional (region) index.
label region() const noexcept
Return the region index.
const word & physicalType() const noexcept
The (optional) physical type of the patch.
label index() const noexcept
The index of this patch in the boundaryMesh.
const word & name() const noexcept
The patch name.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
Mesh consisting of general polyhedral cells.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual const pointField & points() const
Return raw points.
A patch is a list of labels that address the faces in the global face list.
virtual autoPtr< polyPatch > clone(const labelList &faceCells) const
Construct and return a clone, setting faceCells.
label start() const
Return start label of this patch in the polyMesh face list.
Cell-face mesh analysis engine.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
const labelListList & pointEdges() const
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
const vectorField & faceCentres() const
virtual const faceList & faces() const =0
Return faces.
label nInternalFaces() const noexcept
Number of internal faces.
const labelListList & edgeFaces() const
const labelListList & faceEdges() const
const vectorField & faceAreas() const
virtual const pointField & points() const =0
Return mesh points.
A mesh which allows changes in the patch distribution of the boundary faces. The change in patching i...
void changePatchID(const label faceID, const label patchID)
Change patch ID for a boundary face. Note: patchID should be in new.
void changePatches(const List< polyPatch * > &patches)
Change patches.
void repatch()
Re-patch the mesh.
Standard boundBox with extra functionality for use in octree.
Encapsulation of data needed to search on PrimitivePatches.
Triangulated surface description with patch information.
void write(Ostream &os) const
Write to Ostream in simple OpenFOAM format.
const geometricSurfacePatchList & patches() const noexcept
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const polyBoundaryMesh & patches
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const labelList nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
const labelList nEdges(UPstream::listGatherValues< label >(aMesh.nEdges()))
scalar distance(const vector &p1, const vector &p2)
PtrList< polyPatch > polyPatchList
Store lists of polyPatch as a PtrList.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedScalar sign(const dimensionedScalar &ds)
List< label > labelList
A List of labels.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
errorManip< error > abort(error &err)
PrimitivePatch< List< face >, const pointField > bMesh
Holder of faceList and points. (v.s. e.g. primitivePatch which references points)
List< bool > boolList
A List of bools.
static constexpr const zero Zero
Global zero (0)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
Info<< "Finished reading KIVA file"<< endl;cellShapeList cellShapes(nPoints);labelList cellZoning(nPoints, -1);const cellModel &hex=cellModel::ref(cellModel::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].reset(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, &oldCyclicPolyPatch::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]
#define forAll(list, i)
Loop across all elements in list.