122 void Foam::meshRefinement::calcNeighbourData
128 const labelList& cellLevel = meshCutter_.cellLevel();
129 const pointField& cellCentres = mesh_.cellCentres();
131 label nBoundaryFaces = mesh_.nFaces() - mesh_.nInternalFaces();
133 if (neiLevel.
size() != nBoundaryFaces || neiCc.
size() != nBoundaryFaces)
136 << nBoundaryFaces <<
" neiLevel:" << neiLevel.
size()
152 label bFacei = pp.
start()-mesh_.nInternalFaces();
158 neiLevel[bFacei] = cellLevel[faceCells[i]];
159 neiCc[bFacei] = cellCentres[faceCells[i]];
174 fn /=
mag(fn)+vSmall;
176 label own = faceCells[i];
177 label ownLevel = cellLevel[own];
178 label faceLevel = meshCutter_.faceLevel(pp.
start()+i);
181 scalar d = ((faceCentres[i] - cellCentres[own]) & fn);
182 if (faceLevel > ownLevel)
187 neiLevel[bFacei] = faceLevel;
189 neiCc[bFacei] = faceCentres[i] + d*fn;
197 neiLevel[bFacei] = cellLevel[faceCells[i]];
198 neiCc[bFacei] = faceCentres[i];
210 void Foam::meshRefinement::updateIntersections(
const labelList& changedFaces)
212 const pointField& cellCentres = mesh_.cellCentres();
218 label nMasterFaces = 0;
219 forAll(isMasterFace, facei)
221 if (isMasterFace.
get(facei) == 1)
228 label nChangedFaces = 0;
231 if (isMasterFace.
get(changedFaces[i]) == 1)
238 Info<<
"Edge intersection testing:" <<
nl 239 <<
" Number of edges : " << nMasterFaces <<
nl 240 <<
" Number of edges to retest : " << nChangedFaces
246 labelList neiLevel(mesh_.nFaces()-mesh_.nInternalFaces());
247 pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces());
248 calcNeighbourData(neiLevel, neiCc);
256 label facei = changedFaces[i];
257 label own = mesh_.faceOwner()[facei];
259 start[i] = cellCentres[own];
260 if (mesh_.isInternalFace(facei))
262 end[i] = cellCentres[mesh_.faceNeighbour()[facei]];
266 end[i] = neiCc[facei-mesh_.nInternalFaces()];
282 surfaces_.findHigherIntersection
295 surfaceIndex_[changedFaces[i]] = surfaceHit[i];
302 label nHits = countHits();
305 Info<<
" Number of intersected edges : " << nTotHits <<
endl;
308 setInstance(mesh_.facesInstance());
323 <<
"fld size:" << fld.
size() <<
" mesh points:" << mesh.
nPoints()
327 Pout<<
"Checking field " << msg <<
endl;
346 const scalar& minVal = minFld[pointi];
347 const scalar& maxVal = maxFld[pointi];
348 if (
mag(minVal-maxVal) > small)
351 <<
" minFld:" << minVal <<
nl 352 <<
" maxFld:" << maxVal <<
nl 370 <<
"fld size:" << fld.
size() <<
" mesh points:" << mesh.
nPoints()
374 Pout<<
"Checking field " << msg <<
endl;
381 point(great, great, great)
393 const point& minVal = minFld[pointi];
394 const point& maxVal = maxFld[pointi];
395 if (
mag(minVal-maxVal) > small)
398 <<
" minFld:" << minVal <<
nl 399 <<
" maxFld:" << maxVal <<
nl 408 Pout<<
"meshRefinement::checkData() : Checking refinement structure." 410 meshCutter_.checkMesh();
412 Pout<<
"meshRefinement::checkData() : Checking refinement levels." 414 meshCutter_.checkRefinementLevels(1,
labelList(0));
417 label nBnd = mesh_.nFaces()-mesh_.nInternalFaces();
419 Pout<<
"meshRefinement::checkData() : Checking synchronization." 429 mesh_.nInternalFaces()
442 testSyncBoundaryFaceList
445 "testing faceCentres : ",
455 calcNeighbourData(neiLevel, neiCc);
463 start[facei] = mesh_.cellCentres()[mesh_.faceOwner()[facei]];
465 if (mesh_.isInternalFace(facei))
467 end[facei] = mesh_.cellCentres()[mesh_.faceNeighbour()[facei]];
471 end[facei] = neiCc[facei-mesh_.nInternalFaces()];
487 surfaces_.findHigherIntersection
503 mesh_.nInternalFaces()
511 if (surfaceIndex_[facei] != surfaceHit[facei])
513 if (mesh_.isInternalFace(facei))
516 <<
"Internal face:" << facei
517 <<
" fc:" << mesh_.faceCentres()[facei]
518 <<
" cached surfaceIndex_:" << surfaceIndex_[facei]
519 <<
" current:" << surfaceHit[facei]
521 << mesh_.cellCentres()[mesh_.faceOwner()[facei]]
523 << mesh_.cellCentres()[mesh_.faceNeighbour()[facei]]
529 != neiHit[facei-mesh_.nInternalFaces()]
533 <<
"Boundary face:" << facei
534 <<
" fc:" << mesh_.faceCentres()[facei]
535 <<
" cached surfaceIndex_:" << surfaceIndex_[facei]
536 <<
" current:" << surfaceHit[facei]
538 << mesh_.cellCentres()[mesh_.faceOwner()[facei]]
539 <<
" end:" << end[facei]
549 mesh_.nFaces()-mesh_.nInternalFaces(),
550 mesh_.nInternalFaces()
553 labelList neiBoundarySurface(boundarySurface);
561 testSyncBoundaryFaceList
564 "testing surfaceIndex() : ",
572 Pout<<
"meshRefinement::checkData() : Counting duplicate faces." 580 identity(mesh_.nFaces()-mesh_.nInternalFaces())
581 + mesh_.nInternalFaces()
591 if (duplicateFace[i] != -1)
597 Pout<<
"meshRefinement::checkData() : Found " << nDup
598 <<
" duplicate pairs of faces." <<
endl;
605 meshCutter_.setInstance(inst);
606 surfaceIndex_.instance() = inst;
633 mesh_.updateMesh(map);
636 if (map().hasMotionPoints())
638 mesh_.movePoints(map().preMotionPoints());
648 setInstance(mesh_.facesInstance());
656 map().reverseFaceMap(),
663 updateMesh(map, newExposedFaces);
679 label facei = splitFaces[i];
680 const face&
f = mesh_.faces()[facei];
685 label nVerts = split[1]-split[0];
713 label own = mesh_.faceOwner()[facei];
716 if (facei >= mesh_.nInternalFaces())
718 patchi = mesh_.boundaryMesh().whichPatch(facei);
722 nei = mesh_.faceNeighbour()[facei];
725 label zoneI = mesh_.faceZones().whichZone(facei);
726 bool zoneFlip =
false;
729 const faceZone& fz = mesh_.faceZones()[zoneI];
736 Pout<<
"face:" << facei <<
" verts:" << f
737 <<
" split into f0:" << f0
775 mesh_.updateMesh(map);
778 if (map().hasMotionPoints())
780 mesh_.movePoints(map().preMotionPoints());
790 setInstance(mesh_.facesInstance());
793 const labelList& oldToNew = map().reverseFaceMap();
800 label oldFacei = map().faceMap()[facei];
801 if (oldToNew[oldFacei] != facei)
804 newSplitFaces[sz++] = facei;
808 updateMesh(map, newSplitFaces);
1161 Foam::meshRefinement::meshRefinement
1164 const scalar mergeDistance,
1165 const bool overwrite,
1172 mergeDistance_(mergeDistance),
1173 overwrite_(overwrite),
1175 surfaces_(surfaces),
1176 features_(features),
1188 mesh_.facesInstance(),
1200 updateIntersections(
identity(mesh_.nFaces()));
1213 forAll(surfaceIndex_, facei)
1215 if (surfaceIndex_[facei] >= 0 && isMasterFace.
get(facei) == 1)
1370 const bool keepZoneFaces,
1371 const bool keepBaffles,
1388 label nUnblocked = 0;
1402 specifiedProcessorFaces,
1408 if (keepZoneFaces || keepBaffles)
1430 const word& fzName = surfZones[surfI].faceZoneName();
1435 const faceZone& fZone = fZones[fzName];
1439 label facei = fZone[i];
1440 if (blockedFace[facei])
1444 mesh_.isInternalFace(facei)
1448 blockedFace[facei] =
false;
1471 Info<<
"Found " << nUnblocked
1472 <<
" zoned faces to keep together." <<
endl;
1478 boolList separatedCoupledFace(mesh_.nFaces(),
false);
1479 selectSeparatedCoupledFaces(separatedCoupledFace);
1481 label nSeparated = 0;
1482 forAll(separatedCoupledFace, facei)
1484 if (separatedCoupledFace[facei])
1486 if (blockedFace[facei])
1488 blockedFace[facei] =
false;
1494 Info<<
"Found " << nSeparated
1495 <<
" separated coupled faces to keep together." <<
endl;
1497 nUnblocked += nSeparated;
1503 label nBnd = mesh_.nFaces()-mesh_.nInternalFaces();
1505 labelList coupledFace(mesh_.nFaces(), -1);
1523 const labelPair& baffle = allCouples[i];
1531 forAll(coupledFace, facei)
1533 if (coupledFace[facei] != -1 && facei < coupledFace[facei])
1535 couples[nCpl++] =
labelPair(facei, coupledFace[facei]);
1544 Info<<
"Found " << nCouples <<
" baffles to keep together." 1599 blockedFace[baffle.
first()] =
false;
1600 blockedFace[baffle.
second()] =
false;
1608 specifiedProcessorFaces,
1616 Pout<<
"Wanted distribution:" << nProcCells <<
endl;
1621 Pout<<
"Wanted resulting decomposition:" <<
endl;
1622 forAll(nProcCells, proci)
1624 Pout<<
" " << proci <<
'\t' << nProcCells[proci] <<
endl;
1636 setInstance(mesh_.facesInstance());
1645 label nBoundaryFaces = 0;
1647 forAll(surfaceIndex_, facei)
1649 if (surfaceIndex_[facei] != -1)
1658 forAll(surfaceIndex_, facei)
1660 if (surfaceIndex_[facei] != -1)
1662 surfaceFaces[nBoundaryFaces++] = facei;
1665 return surfaceFaces;
1671 const faceList& faces = mesh_.faces();
1675 label nBoundaryPoints = 0;
1677 forAll(surfaceIndex_, facei)
1679 if (surfaceIndex_[facei] != -1)
1681 const face&
f = faces[facei];
1685 if (isBoundaryPoint.set(f[fp], 1u))
1722 labelList boundaryPoints(nBoundaryPoints);
1723 nBoundaryPoints = 0;
1724 forAll(isBoundaryPoint, pointi)
1726 if (isBoundaryPoint.get(pointi) == 1u)
1728 boundaryPoints[nBoundaryPoints++] = pointi;
1732 return boundaryPoints;
1749 const polyPatch& pp = patches[patchIDs[i]];
1751 nFaces += pp.size();
1760 const polyPatch& pp = patches[patchIDs[i]];
1766 addressing[nFaces++] = meshFacei++;
1794 pointPatches.
size(),
1795 slipPointPatchVectorField::typeName
1800 patchFieldTypes[adaptPatchIDs[i]] =
1801 fixedValuePointPatchVectorField::typeName;
1806 if (isA<processorPointPatch>(pointPatches[
patchi]))
1808 patchFieldTypes[
patchi] = calculatedPointPatchVectorField::typeName;
1810 else if (isA<cyclicPointPatch>(pointPatches[patchi]))
1812 patchFieldTypes[
patchi] = cyclicSlipPointPatchVectorField::typeName;
1824 "pointDisplacement",
1858 <<
"faceZones are not synchronised on processors." <<
nl 1859 <<
"Processor " << proci <<
" has faceZones " 1860 << zoneNames[proci] <<
nl 1862 <<
" has faceZones " 1876 const faceZone& fZone = fZones[zoneI];
1884 if (faceToZone[bFacei] == -1)
1886 faceToZone[bFacei] = zoneI;
1888 else if (faceToZone[bFacei] == zoneI)
1891 <<
"Face " << fZone[i] <<
" in zone " 1893 <<
" is twice in zone!" 1899 <<
"Face " << fZone[i] <<
" in zone " 1901 <<
" is also in zone " 1902 << fZones[faceToZone[bFacei]].
name()
1914 if (faceToZone[i] != neiFaceToZone[i])
1918 <<
" is in zone " << faceToZone[i]
1919 <<
", its coupled face is in zone " << neiFaceToZone[i]
1944 const edge&
e = edges[edgeI];
1950 pts[meshPoints[e[1]]]
1951 - pts[meshPoints[e[0]]]
1954 edgeWeights[edgeI] = 1.0/eMag;
1970 forAll(invSumWeight, pointi)
1972 scalar w = invSumWeight[pointi];
1976 invSumWeight[pointi] = 1.0/w;
1985 const label insertPatchi,
1986 const word& patchName,
2000 polyPatches.
setSize(patchi+1);
2018 polyPatches[patchi],
2023 addPatchFields<volScalarField>
2028 addPatchFields<volVectorField>
2033 addPatchFields<volSphericalTensorField>
2038 addPatchFields<volSymmTensorField>
2043 addPatchFields<volTensorField>
2051 addPatchFields<surfaceScalarField>
2056 addPatchFields<surfaceVectorField>
2061 addPatchFields<surfaceSphericalTensorField>
2066 addPatchFields<surfaceSymmTensorField>
2071 addPatchFields<surfaceTensorField>
2083 const word& patchName,
2099 label insertPatchi = polyPatches.
size();
2102 forAll(polyPatches, patchi)
2106 if (isA<processorPolyPatch>(pp))
2109 startFacei = pp.
start();
2115 patchDict.
set(
"nFaces", 0);
2116 patchDict.
set(
"startFace", startFacei);
2121 label addedPatchi = appendPatch(mesh, insertPatchi, patchName, patchDict);
2127 for (
label i = 0; i < insertPatchi; i++)
2132 for (
label i = insertPatchi; i < addedPatchi; i++)
2137 oldToNew[addedPatchi] = insertPatchi;
2140 polyPatches.
reorder(oldToNew,
true);
2143 reorderPatchFields<volScalarField>(
mesh, oldToNew);
2144 reorderPatchFields<volVectorField>(
mesh, oldToNew);
2145 reorderPatchFields<volSphericalTensorField>(
mesh, oldToNew);
2146 reorderPatchFields<volSymmTensorField>(
mesh, oldToNew);
2147 reorderPatchFields<volTensorField>(
mesh, oldToNew);
2148 reorderPatchFields<surfaceScalarField>(
mesh, oldToNew);
2149 reorderPatchFields<surfaceVectorField>(
mesh, oldToNew);
2150 reorderPatchFields<surfaceSphericalTensorField>(
mesh, oldToNew);
2151 reorderPatchFields<surfaceSymmTensorField>(
mesh, oldToNew);
2152 reorderPatchFields<surfaceTensorField>(
mesh, oldToNew);
2154 return insertPatchi;
2169 return mesh_.boundaryMesh().findPatchID(name);
2199 meshedPatches_.append(name);
2211 forAll(meshedPatches_, i)
2218 <<
"Problem : did not find patch " << meshedPatches_[i]
2219 <<
endl <<
"Valid patches are " << patches.
names()
2239 if (isA<coupledPolyPatch>(patches[
patchi]))
2250 selected[cpp.
start()+i] =
true;
2262 const vector& perturbVec,
2270 regionI = cellToRegion[celli];
2277 celli = mesh.
findCell(p+perturbVec);
2280 regionI = cellToRegion[celli];
2292 const point& keepPoint
2296 (void)mesh_.tetBasePtIs();
2301 boolList blockedFace(mesh_.nFaces(),
false);
2302 selectSeparatedCoupledFaces(blockedFace);
2306 label regionI = findRegion
2310 mergeDistance_*
vector(1,1,1),
2317 <<
"Point " << keepPoint
2318 <<
" is not inside the mesh." <<
nl 2319 <<
"Bounding box of the mesh:" << mesh_.bounds()
2328 forAll(cellRegion, celli)
2330 if (cellRegion[celli] != regionI)
2332 cellsToRemove.
append(celli);
2335 cellsToRemove.shrink();
2337 label nCellsToKeep = mesh_.nCells() - cellsToRemove.
size();
2340 Info<<
"Keeping all cells in region " << regionI
2341 <<
" containing point " << keepPoint <<
endl 2342 <<
"Selected for keeping : " 2344 <<
" cells." <<
endl;
2362 label defaultPatch = 0;
2363 if (globalToMasterPatch.
size())
2365 defaultPatch = globalToMasterPatch[0];
2369 <<
"Removing non-reachable cells exposes " 2370 << nExposedFaces <<
" internal or coupled faces." << endl
2371 <<
" These get put into patch " << defaultPatch <<
endl;
2372 exposedPatch.setSize(exposedFaces.
size(), defaultPatch);
2375 return doRemoveCells
2392 meshCutter_.distribute(map);
2418 geometry[i].distribute
2426 if (faceMap.
valid())
2429 geometry[i].instance() = geometry[i].time().timeName();
2447 updateMesh(map, changedFaces, dummyMap, dummyMap, dummyMap);
2459 meshCutter_.storeData
2480 meshCutter_.updateMesh
2492 updateIntersections(changedFaces);
2499 if (userFaceData_[i].first() == KEEPALL)
2504 else if (userFaceData_[i].first() == MASTERONLY)
2509 forAll(newFaceData, facei)
2515 newFaceData[facei] = data[oldFacei];
2535 if (reverseFaceMap[oldFacei] != facei)
2538 reverseFaceMap[oldFacei] = -1;
2545 forAll(newFaceData, facei)
2551 if (reverseFaceMap[oldFacei] == facei)
2553 newFaceData[facei] = data[oldFacei];
2565 bool writeOk = mesh_.write();
2590 writeOk = writeOk && s.
write();
2607 forAll(meshPoints, pointi)
2623 forAll(meshPoints, pointi)
2627 isPatchMasterPoint[pointi] =
true;
2631 return isPatchMasterPoint;
2646 myEdges[edgeI] = globalEdges.toGlobal(edgeI);
2662 if (myEdges[edgeI] == globalEdges.toGlobal(edgeI))
2664 isMasterEdge[edgeI] =
true;
2668 return isMasterEdge;
2680 <<
" : cells(local):" << mesh_.nCells()
2681 <<
" faces(local):" << mesh_.nFaces()
2682 <<
" points(local):" << mesh_.nPoints()
2688 label nMasterFaces = 0;
2691 if (isMasterFace[i])
2698 label nMasterPoints = 0;
2699 forAll(isMeshMasterPoint, i)
2701 if (isMeshMasterPoint[i])
2717 const labelList& cellLevel = meshCutter_.cellLevel();
2723 nCells[cellLevel[celli]]++;
2729 Info<<
"Cells per refinement level:" <<
endl;
2732 Info<<
" " << levelI <<
'\t' << nCells[levelI]
2741 if (overwrite_ && mesh_.time().timeIndex() == 0)
2743 return oldInstance_;
2747 return mesh_.time().timeName();
2762 mesh_.time().timeName(),
2772 const labelList& cellLevel = meshCutter_.cellLevel();
2774 forAll(volRefLevel, celli)
2776 volRefLevel[celli] = cellLevel[celli];
2779 volRefLevel.write();
2791 mesh_.time().timeName(),
2801 const labelList& pointLevel = meshCutter_.pointLevel();
2803 forAll(pointRefLevel, pointi)
2805 pointRefLevel[pointi] = pointLevel[pointi];
2808 pointRefLevel.write();
2816 const pointField& cellCentres = mesh_.cellCentres();
2818 OFstream str(prefix +
"_edges.obj");
2820 Pout<<
"meshRefinement::dumpIntersections :" 2821 <<
" Writing cellcentre-cellcentre intersections to file " 2829 labelList neiLevel(mesh_.nFaces()-mesh_.nInternalFaces());
2830 pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces());
2831 calcNeighbourData(neiLevel, neiCc);
2833 labelList intersectionFaces(intersectedFaces());
2839 forAll(intersectionFaces, i)
2841 label facei = intersectionFaces[i];
2842 start[i] = cellCentres[mesh_.faceOwner()[facei]];
2844 if (mesh_.isInternalFace(facei))
2846 end[i] = cellCentres[mesh_.faceNeighbour()[facei]];
2850 end[i] = neiCc[facei-mesh_.nInternalFaces()];
2856 const vectorField smallVec(rootSmall*(end-start));
2865 surfaces_.findAnyIntersection
2873 forAll(intersectionFaces, i)
2875 if (surfaceHit[i] != -1)
2883 str <<
"l " << vertI-2 <<
' ' << vertI-1 <<
nl 2884 <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
2900 if (writeFlags & WRITEMESH)
2905 if (writeFlags && !(writeFlags & NOWRITEREFINEMENT))
2907 meshCutter_.write();
2908 surfaceIndex_.write();
2911 if (writeFlags & WRITELEVELS)
2913 dumpRefinementLevel();
2916 if (debugFlags & OBJINTERSECTIONS && prefix.size())
2918 dumpIntersections(prefix);
2931 writeLevel_ = flags;
2937 return outputLevel_;
2943 outputLevel_ = flags;
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
ListType renumber(const labelUList &oldToNew, const ListType &)
Renumber the values (not the indices) of a list.
virtual labelList decompose(const pointField &points, const scalarField &pointWeights)
Return for every coordinate the wanted processor number.
This class separates the mesh into distinct unconnected regions, each of which is then given a label ...
void clearOut()
Clear all geometry and addressing.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
void printMeshInfo(const bool, const string &) const
Print some mesh stats.
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
IOoutputType
Enumeration for what to output.
A class for handling file names.
bool set(const label) const
Is element set.
virtual bool separated() const
Are the planes separated.
const faceZoneMesh & faceZones() const
Return face zone mesh.
errorManipArg< error, int > exit(error &err, const int errNo=1)
unsigned int get(const label) const
Get value at index I.
A face is a list of labels corresponding to mesh vertices.
void setRefinement(const labelList &cellsToRemove, const labelList &facesToExpose, const labelList &patchIDs, polyTopoChange &) const
Play commands into polyTopoChange to remove cells.
label countHits() const
Count number of intersections (local)
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
void reorder(const labelUList &)
Reorders elements. Ordering does not have to be done in.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label nInternalFaces() const
IOdebugType
Enumeration for what to debug.
static label findRegion(const polyMesh &, const labelList &cellRegion, const vector &perturbVec, const point &p)
Find region point is in. Uses optional perturbation to re-test.
Various mesh related information for a parallel run. Upon construction, constructs all info using par...
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
static const NamedEnum< IOoutputType, 1 > IOoutputTypeNames
void size(const label)
Override size to be inconsistent with allocated storage.
const boolList & flipMap() const
Return face flip map.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Given list of cells to remove insert all the topology changes.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label nTotalCells() const
Return total number of cells in decomposed mesh.
labelList intersectedFaces() const
Get faces with intersection.
static writeType writeLevel()
Get/set write level.
label findPatchID(const word &patchName) const
Find patch index given a name.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational d...
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines. WIP.
Vector< scalar > vector
A scalar version of the templated Vector.
Pre-declare related SubField type.
PrimitivePatch< face, IndirectList, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.
labelList intersectedPoints() const
Get points on surfaces with intersection and boundary faces.
const fileName & name() const
Return the name of the stream.
Initialise the NamedEnum HashTable from the static list of names.
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
autoPtr< mapPolyMesh > splitMeshRegions(const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const point &keepPoint)
Split mesh. Keep part containing point.
static labelPairList findDuplicateFacePairs(const polyMesh &)
Helper routine to find all baffles (two boundary faces.
static const pointMesh & New(const polyMesh &mesh)
IOwriteType
Enumeration for what to write.
Container for data on surfaces used for surface-driven refinement. Contains all the data about the le...
static label addPatch(fvMesh &, const word &name, const dictionary &)
Helper:add patch to mesh. Update all registered fields.
virtual const pointField & points() const
Return raw points.
Mesh representing a set of points created from polyMesh.
fileName caseSystem() const
Return system name for the case.
static bool constraintType(const word &pt)
Return true if the given type is a constraint type.
Encapsulates queries for features.
static label appendPatch(fvMesh &, const label insertPatchi, const word &, const dictionary &)
Helper:append patch to end of mesh.
void clear()
Delete object (if the pointer is valid) and set pointer to.
void distribute(const mapDistributePolyMesh &)
Update local numbering for mesh redistribution.
virtual bool parallel() const
Are the cyclic planes parallel.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
A List obtained as a section of another List.
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
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.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const fileName & pointsInstance() const
Return the current instance directory for points.
An ordered pair of two objects of type <T> with first() and second() elements.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
void distributeFaceData(List< T > &lst) const
Distribute list of face data.
label addFace(const face &f, const label own, const label nei, const label masterPointID, const label masterEdgeID, const label masterFaceID, const bool flipFaceFlux, const label patchID, const label zoneID, const bool zoneFlip)
Add face to cells. Return new face label.
static void calculateEdgeWeights(const polyMesh &mesh, const PackedBoolList &isMasterEdge, const labelList &meshPoints, const edgeList &edges, scalarField &edgeWeights, scalarField &invSumWeight)
Helper: calculate edge weights (1/length)
const labelUList & faceCells() const
Return face-cell addressing.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
bool found(const Key &) const
Return true if hashedEntry is found in table.
autoPtr< mapPolyMesh > splitFaces(const labelList &splitFaces, const labelPairList &splits)
Split faces into two.
A class for handling words, derived from string.
static PackedBoolList getMasterEdges(const polyMesh &mesh, const labelList &meshEdges)
Determine master edge for subset of edges. If coupled.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
wordList names() const
Return a list of patch names.
void append(const T &)
Append an element at the end of the list.
void setConstraints(const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections)
Helper: extract constraints:
const word & constant() const
Return constant name.
This boundary condition is not designed to be evaluated; it is assmued that the value is assigned via...
static const NamedEnum< IOdebugType, 5 > IOdebugTypeNames
static void checkCoupledFaceZones(const polyMesh &)
Helper function: check that face zones are synced.
Container for searchableSurfaces.
Pair< label > labelPair
Label pair.
static const label labelMax
List< label > labelList
A List of labels.
Abstract base class for decomposition.
Encapsulates queries for volume refinement ('refine all cells within shell').
const word & name() const
Return name.
autoPtr< mapDistributePolyMesh > balance(const bool keepZoneFaces, const bool keepBaffles, const scalarField &cellWeights, decompositionMethod &decomposer, fvMeshDistribute &distributor)
Redecompose according to cell count.
virtual const faceList & faces() const
Return raw faces.
Accumulating histogram of values. Specified bin resolution automatic generation of bins...
void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
const PtrList< surfaceZonesInfo > & surfZones() const
bool valid() const
Return true if the autoPtr valid (ie, the pointer is set)
errorManip< error > abort(error &err)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
word timeName() const
Replacement for Time::timeName() : return oldInstance (if.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
const word & system() const
Return system name.
List< treeBoundBox > meshBb(1, treeBoundBox(boundBox(coarseMesh.points(), false)).extend(1e-3))
const vectorField::subField faceAreas() const
Return face normals.
fileName caseConstant() const
Return constant name for the case.
void checkData()
Debugging: check that all faces still obey start()>end()
Type gMax(const FieldField< Field, Type > &f)
const Time & time() const
Return time.
defineTypeNameAndDebug(combustionModel, 0)
Database for solution data, solver performance and other reduced data.
label addMeshedPatch(const word &name, const dictionary &)
Add patch originating from meshing. Update meshedPatches_.
labelList meshedPatches() const
Get patchIDs for patches added in addMeshedPatch.
autoPtr< mapDistributePolyMesh > distribute(const labelList &dist)
Send cells to neighbours according to distribution.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
static autoPtr< indirectPrimitivePatch > makePatch(const polyMesh &, const labelList &)
Create patch from set of patches.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
static outputType outputLevel()
Get/set output level.
const labelList & faceMap() const
Old face map.
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
void updateMesh(const mapPolyMesh &, const labelList &changedFaces)
Update for external change to mesh. changedFaces are in new mesh.
const Type & second() const
Return second.
label size() const
Return the number of elements in the UPtrList.
void setInstance(const fileName &)
Set instance of all local IOobjects.
Calculates points shared by more than two processor patches or cyclic patches.
void setSize(const label)
Reset size of List.
void modifyFace(const face &f, const label facei, const label own, const label nei, const bool flipFaceFlux, const label patchID, const label zoneID, const bool zoneFlip)
Modify vertices or cell of face.
static bool & parRun()
Is this a parallel run?
const fileName & instance() const
static label nProcs(const label communicator=0)
Number of processes in parallel run.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
void storeData(const labelList &pointsToStore, const labelList &facesToStore, const labelList &cellsToStore)
Signal points/face/cells for which to store data.
vector point
Point is a vector.
#define WarningInFunction
Report a warning using Foam::Warning.
static void testSyncPointList(const string &msg, const polyMesh &mesh, const List< scalar > &fld)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const Time & time() const
Return time.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
prefixOSstream Pout(cout, "Pout")
Mesh data needed to do the Finite Volume discretisation.
Direct mesh changes based on v1.3 polyTopoChange syntax.
label start() const
Return start label of this patch in the polyMesh face list.
label findCell(const point &p, const cellDecomposition=CELL_TETS) const
Find cell enclosing this location and return index.
void set(entry *)
Assign a new entry, overwrite any existing entry.
static labelList findDuplicateFaces(const primitiveMesh &, const labelList &)
Helper routine to find baffles (two boundary faces using the.
void selectSeparatedCoupledFaces(boolList &) const
Select coupled faces that are not collocated.
Standard boundBox + extra functionality for use in octree.
wordList names() const
Return a list of zone names.
dimensioned< scalar > mag(const dimensioned< Type > &)
static autoPtr< polyPatch > New(const word &patchType, const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
Return a pointer to a new patch created on freestore from.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
const doubleScalar e
Elementary charge.
label size() const
Number of entries.
Mesh consisting of general polyhedral cells.
labelList getExposedFaces(const labelList &cellsToRemove) const
Get labels of exposed faces.
static autoPtr< fvPatch > New(const polyPatch &, const fvBoundaryMesh &)
Return a pointer to a new patch created on freestore from polyPatch.
A subset of mesh faces organised as a primitive patch.
autoPtr< mapPolyMesh > changeMesh(polyMesh &mesh, const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Inplace changes mesh without change of patches.
bool write() const
Write mesh and all data.
static tmp< pointVectorField > makeDisplacementField(const pointMesh &pMesh, const labelList &adaptPatchIDs)
Helper function to make a pointVectorField with correct.
A class for managing temporary objects.
A patch is a list of labels that address the faces in the global face list.
static PackedBoolList getMasterPoints(const polyMesh &mesh, const labelList &meshPoints)
Determine master point for subset of points. If coupled.
virtual bool write(const bool valid=true) const
Write using setting from DB.
void dumpIntersections(const fileName &prefix) const
Debug: Write intersection information to OBJ format.
const pointBoundaryMesh & boundary() const
Return reference to boundary mesh.
static labelList countCells(const labelList &)
Helper function: count cells per processor in wanted distribution.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
const Type & first() const
Return first.
A List with indirect addressing.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
void dumpRefinementLevel() const
Write refinement level as volScalarFields for postprocessing.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
void reorder(const labelUList &, const bool validBoundary)
Reorders patches. Ordering does not have to be done in.
static const Vector< scalar > zero
const labelList & reverseFaceMap() const
Reverse face map.
static const NamedEnum< IOwriteType, 5 > IOwriteTypeNames
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
const vectorField::subField faceCentres() const
Return face centres.