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];
212 void Foam::meshRefinement::updateIntersections(
const labelList& changedFaces)
214 const pointField& cellCentres = mesh_.cellCentres();
220 label nMasterFaces = 0;
221 forAll(isMasterFace, facei)
223 if (isMasterFace.
get(facei) == 1)
230 label nChangedFaces = 0;
233 if (isMasterFace.
get(changedFaces[i]) == 1)
240 Info<<
"Edge intersection testing:" <<
nl 241 <<
" Number of edges : " << nMasterFaces <<
nl 242 <<
" Number of edges to retest : " << nChangedFaces
248 labelList neiLevel(mesh_.nFaces()-mesh_.nInternalFaces());
249 pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces());
250 calcNeighbourData(neiLevel, neiCc);
258 label facei = changedFaces[i];
259 label own = mesh_.faceOwner()[facei];
261 start[i] = cellCentres[own];
262 if (mesh_.isInternalFace(facei))
264 end[i] = cellCentres[mesh_.faceNeighbour()[facei]];
268 end[i] = neiCc[facei-mesh_.nInternalFaces()];
284 surfaces_.findHigherIntersection
297 surfaceIndex_[changedFaces[i]] = surfaceHit[i];
304 label nHits = countHits();
307 Info<<
" Number of intersected edges : " << nTotHits <<
endl;
310 setInstance(mesh_.facesInstance());
325 <<
"fld size:" << fld.
size() <<
" mesh points:" << mesh.
nPoints()
329 Pout<<
"Checking field " << msg <<
endl;
348 const scalar& minVal = minFld[pointi];
349 const scalar& maxVal = maxFld[pointi];
350 if (
mag(minVal-maxVal) > SMALL)
353 <<
" minFld:" << minVal <<
nl 354 <<
" maxFld:" << maxVal <<
nl 372 <<
"fld size:" << fld.
size() <<
" mesh points:" << mesh.
nPoints()
376 Pout<<
"Checking field " << msg <<
endl;
383 point(GREAT, GREAT, GREAT)
395 const point& minVal = minFld[pointi];
396 const point& maxVal = maxFld[pointi];
397 if (
mag(minVal-maxVal) > SMALL)
400 <<
" minFld:" << minVal <<
nl 401 <<
" maxFld:" << maxVal <<
nl 410 Pout<<
"meshRefinement::checkData() : Checking refinement structure." 412 meshCutter_.checkMesh();
414 Pout<<
"meshRefinement::checkData() : Checking refinement levels." 416 meshCutter_.checkRefinementLevels(1,
labelList(0));
419 label nBnd = mesh_.nFaces()-mesh_.nInternalFaces();
421 Pout<<
"meshRefinement::checkData() : Checking synchronization." 431 mesh_.nInternalFaces()
444 testSyncBoundaryFaceList
447 "testing faceCentres : ",
457 calcNeighbourData(neiLevel, neiCc);
465 start[facei] = mesh_.cellCentres()[mesh_.faceOwner()[facei]];
467 if (mesh_.isInternalFace(facei))
469 end[facei] = mesh_.cellCentres()[mesh_.faceNeighbour()[facei]];
473 end[facei] = neiCc[facei-mesh_.nInternalFaces()];
489 surfaces_.findHigherIntersection
505 mesh_.nInternalFaces()
513 if (surfaceIndex_[facei] != surfaceHit[facei])
515 if (mesh_.isInternalFace(facei))
518 <<
"Internal face:" << facei
519 <<
" fc:" << mesh_.faceCentres()[facei]
520 <<
" cached surfaceIndex_:" << surfaceIndex_[facei]
521 <<
" current:" << surfaceHit[facei]
523 << mesh_.cellCentres()[mesh_.faceOwner()[facei]]
525 << mesh_.cellCentres()[mesh_.faceNeighbour()[facei]]
531 != neiHit[facei-mesh_.nInternalFaces()]
535 <<
"Boundary face:" << facei
536 <<
" fc:" << mesh_.faceCentres()[facei]
537 <<
" cached surfaceIndex_:" << surfaceIndex_[facei]
538 <<
" current:" << surfaceHit[facei]
540 << mesh_.cellCentres()[mesh_.faceOwner()[facei]]
541 <<
" end:" << end[facei]
551 mesh_.nFaces()-mesh_.nInternalFaces(),
552 mesh_.nInternalFaces()
555 labelList neiBoundarySurface(boundarySurface);
563 testSyncBoundaryFaceList
566 "testing surfaceIndex() : ",
574 Pout<<
"meshRefinement::checkData() : Counting duplicate faces." 582 identity(mesh_.nFaces()-mesh_.nInternalFaces())
583 + mesh_.nInternalFaces()
593 if (duplicateFace[i] != -1)
599 Pout<<
"meshRefinement::checkData() : Found " << nDup
600 <<
" duplicate pairs of faces." <<
endl;
607 meshCutter_.setInstance(inst);
608 surfaceIndex_.instance() = inst;
637 mesh_.updateMesh(map);
640 if (map().hasMotionPoints())
642 mesh_.movePoints(map().preMotionPoints());
652 setInstance(mesh_.facesInstance());
660 map().reverseFaceMap(),
667 updateMesh(map, newExposedFaces);
684 label facei = splitFaces[i];
685 const face&
f = mesh_.faces()[facei];
691 label nVerts = split[1]-split[0];
719 label own = mesh_.faceOwner()[facei];
722 if (facei >= mesh_.nInternalFaces())
724 patchi = mesh_.boundaryMesh().whichPatch(facei);
728 nei = mesh_.faceNeighbour()[facei];
731 label zoneI = mesh_.faceZones().whichZone(facei);
732 bool zoneFlip =
false;
735 const faceZone& fz = mesh_.faceZones()[zoneI];
740 Pout<<
"face:" << facei <<
" verts:" << f
741 <<
" split into f0:" << f0
777 mesh_.updateMesh(map);
780 if (map().hasMotionPoints())
782 mesh_.movePoints(map().preMotionPoints());
792 setInstance(mesh_.facesInstance());
795 const labelList& oldToNew = map().reverseFaceMap();
802 label oldFacei = map().faceMap()[facei];
803 if (oldToNew[oldFacei] != facei)
806 newSplitFaces[sz++] = facei;
810 updateMesh(map, newSplitFaces);
1164 Foam::meshRefinement::meshRefinement
1167 const scalar mergeDistance,
1168 const bool overwrite,
1175 mergeDistance_(mergeDistance),
1176 overwrite_(overwrite),
1178 surfaces_(surfaces),
1179 features_(features),
1191 mesh_.facesInstance(),
1203 updateIntersections(
identity(mesh_.nFaces()));
1216 forAll(surfaceIndex_, facei)
1218 if (surfaceIndex_[facei] >= 0 && isMasterFace.
get(facei) == 1)
1373 const bool keepZoneFaces,
1374 const bool keepBaffles,
1396 label nUnblocked = 0;
1410 specifiedProcessorFaces,
1416 if (keepZoneFaces || keepBaffles)
1438 const word& fzName = surfZones[surfI].faceZoneName();
1443 const faceZone& fZone = fZones[fzName];
1447 label facei = fZone[i];
1448 if (blockedFace[facei])
1452 mesh_.isInternalFace(facei)
1456 blockedFace[facei] =
false;
1479 Info<<
"Found " << nUnblocked
1480 <<
" zoned faces to keep together." <<
endl;
1486 boolList separatedCoupledFace(mesh_.nFaces(),
false);
1487 selectSeparatedCoupledFaces(separatedCoupledFace);
1489 label nSeparated = 0;
1490 forAll(separatedCoupledFace, facei)
1492 if (separatedCoupledFace[facei])
1494 if (blockedFace[facei])
1496 blockedFace[facei] =
false;
1502 Info<<
"Found " << nSeparated
1503 <<
" separated coupled faces to keep together." <<
endl;
1505 nUnblocked += nSeparated;
1511 label nBnd = mesh_.nFaces()-mesh_.nInternalFaces();
1513 labelList coupledFace(mesh_.nFaces(), -1);
1531 const labelPair& baffle = allCouples[i];
1539 forAll(coupledFace, facei)
1541 if (coupledFace[facei] != -1 && facei < coupledFace[facei])
1543 couples[nCpl++] =
labelPair(facei, coupledFace[facei]);
1552 Info<<
"Found " << nCouples <<
" baffles to keep together." 1607 blockedFace[baffle.
first()] =
false;
1608 blockedFace[baffle.
second()] =
false;
1616 specifiedProcessorFaces,
1624 Pout<<
"Wanted distribution:" << nProcCells <<
endl;
1629 Pout<<
"Wanted resulting decomposition:" <<
endl;
1630 forAll(nProcCells, proci)
1632 Pout<<
" " << proci <<
'\t' << nProcCells[proci] <<
endl;
1644 setInstance(mesh_.facesInstance());
1654 label nBoundaryFaces = 0;
1656 forAll(surfaceIndex_, facei)
1658 if (surfaceIndex_[facei] != -1)
1667 forAll(surfaceIndex_, facei)
1669 if (surfaceIndex_[facei] != -1)
1671 surfaceFaces[nBoundaryFaces++] = facei;
1674 return surfaceFaces;
1681 const faceList& faces = mesh_.faces();
1685 label nBoundaryPoints = 0;
1687 forAll(surfaceIndex_, facei)
1689 if (surfaceIndex_[facei] != -1)
1691 const face&
f = faces[facei];
1695 if (isBoundaryPoint.set(f[fp], 1u))
1732 labelList boundaryPoints(nBoundaryPoints);
1733 nBoundaryPoints = 0;
1734 forAll(isBoundaryPoint, pointi)
1736 if (isBoundaryPoint.get(pointi) == 1u)
1738 boundaryPoints[nBoundaryPoints++] = pointi;
1742 return boundaryPoints;
1759 const polyPatch& pp = patches[patchIDs[i]];
1761 nFaces += pp.size();
1770 const polyPatch& pp = patches[patchIDs[i]];
1776 addressing[nFaces++] = meshFacei++;
1805 pointPatches.
size(),
1806 slipPointPatchVectorField::typeName
1811 patchFieldTypes[adaptPatchIDs[i]] =
1812 fixedValuePointPatchVectorField::typeName;
1817 if (isA<processorPointPatch>(pointPatches[
patchi]))
1819 patchFieldTypes[
patchi] = calculatedPointPatchVectorField::typeName;
1821 else if (isA<cyclicPointPatch>(pointPatches[patchi]))
1823 patchFieldTypes[
patchi] = cyclicSlipPointPatchVectorField::typeName;
1835 "pointDisplacement",
1869 <<
"faceZones are not synchronised on processors." <<
nl 1870 <<
"Processor " << proci <<
" has faceZones " 1871 << zoneNames[proci] <<
nl 1873 <<
" has faceZones " 1887 const faceZone& fZone = fZones[zoneI];
1895 if (faceToZone[bFacei] == -1)
1897 faceToZone[bFacei] = zoneI;
1899 else if (faceToZone[bFacei] == zoneI)
1902 <<
"Face " << fZone[i] <<
" in zone " 1904 <<
" is twice in zone!" 1910 <<
"Face " << fZone[i] <<
" in zone " 1912 <<
" is also in zone " 1913 << fZones[faceToZone[bFacei]].
name()
1925 if (faceToZone[i] != neiFaceToZone[i])
1929 <<
" is in zone " << faceToZone[i]
1930 <<
", its coupled face is in zone " << neiFaceToZone[i]
1955 const edge&
e = edges[edgeI];
1961 pts[meshPoints[e[1]]]
1962 - pts[meshPoints[e[0]]]
1965 edgeWeights[edgeI] = 1.0/eMag;
1981 forAll(invSumWeight, pointi)
1983 scalar w = invSumWeight[pointi];
1987 invSumWeight[pointi] = 1.0/w;
1996 const label insertPatchi,
1997 const word& patchName,
2011 polyPatches.
setSize(patchi+1);
2029 polyPatches[patchi],
2034 addPatchFields<volScalarField>
2039 addPatchFields<volVectorField>
2044 addPatchFields<volSphericalTensorField>
2049 addPatchFields<volSymmTensorField>
2054 addPatchFields<volTensorField>
2062 addPatchFields<surfaceScalarField>
2067 addPatchFields<surfaceVectorField>
2072 addPatchFields<surfaceSphericalTensorField>
2077 addPatchFields<surfaceSymmTensorField>
2082 addPatchFields<surfaceTensorField>
2095 const word& patchName,
2111 label insertPatchi = polyPatches.
size();
2114 forAll(polyPatches, patchi)
2118 if (isA<processorPolyPatch>(pp))
2121 startFacei = pp.
start();
2127 patchDict.
set(
"nFaces", 0);
2128 patchDict.
set(
"startFace", startFacei);
2133 label addedPatchi = appendPatch(mesh, insertPatchi, patchName, patchDict);
2139 for (
label i = 0; i < insertPatchi; i++)
2144 for (
label i = insertPatchi; i < addedPatchi; i++)
2149 oldToNew[addedPatchi] = insertPatchi;
2152 polyPatches.
reorder(oldToNew,
true);
2155 reorderPatchFields<volScalarField>(
mesh, oldToNew);
2156 reorderPatchFields<volVectorField>(
mesh, oldToNew);
2157 reorderPatchFields<volSphericalTensorField>(
mesh, oldToNew);
2158 reorderPatchFields<volSymmTensorField>(
mesh, oldToNew);
2159 reorderPatchFields<volTensorField>(
mesh, oldToNew);
2160 reorderPatchFields<surfaceScalarField>(
mesh, oldToNew);
2161 reorderPatchFields<surfaceVectorField>(
mesh, oldToNew);
2162 reorderPatchFields<surfaceSphericalTensorField>(
mesh, oldToNew);
2163 reorderPatchFields<surfaceSymmTensorField>(
mesh, oldToNew);
2164 reorderPatchFields<surfaceTensorField>(
mesh, oldToNew);
2166 return insertPatchi;
2181 return mesh_.boundaryMesh().findPatchID(name);
2211 meshedPatches_.append(name);
2223 forAll(meshedPatches_, i)
2230 <<
"Problem : did not find patch " << meshedPatches_[i]
2231 <<
endl <<
"Valid patches are " << patches.
names()
2251 if (isA<coupledPolyPatch>(patches[
patchi]))
2262 selected[cpp.
start()+i] =
true;
2274 const vector& perturbVec,
2282 regionI = cellToRegion[celli];
2289 celli = mesh.
findCell(p+perturbVec);
2292 regionI = cellToRegion[celli];
2304 const point& keepPoint
2308 (void)mesh_.tetBasePtIs();
2313 boolList blockedFace(mesh_.nFaces(),
false);
2314 selectSeparatedCoupledFaces(blockedFace);
2318 label regionI = findRegion
2322 mergeDistance_*
vector(1,1,1),
2329 <<
"Point " << keepPoint
2330 <<
" is not inside the mesh." <<
nl 2331 <<
"Bounding box of the mesh:" << mesh_.bounds()
2340 forAll(cellRegion, celli)
2342 if (cellRegion[celli] != regionI)
2344 cellsToRemove.
append(celli);
2347 cellsToRemove.shrink();
2349 label nCellsToKeep = mesh_.nCells() - cellsToRemove.
size();
2352 Info<<
"Keeping all cells in region " << regionI
2353 <<
" containing point " << keepPoint <<
endl 2354 <<
"Selected for keeping : " 2356 <<
" cells." <<
endl;
2374 label defaultPatch = 0;
2375 if (globalToMasterPatch.
size())
2377 defaultPatch = globalToMasterPatch[0];
2381 <<
"Removing non-reachable cells exposes " 2382 << nExposedFaces <<
" internal or coupled faces." << endl
2383 <<
" These get put into patch " << defaultPatch <<
endl;
2384 exposedPatch.setSize(exposedFaces.
size(), defaultPatch);
2387 return doRemoveCells
2404 meshCutter_.distribute(map);
2433 geometry[i].distribute
2441 if (faceMap.
valid())
2444 geometry[i].instance() = geometry[i].time().timeName();
2463 updateMesh(map, changedFaces, dummyMap, dummyMap, dummyMap);
2475 meshCutter_.storeData
2496 meshCutter_.updateMesh
2508 updateIntersections(changedFaces);
2515 if (userFaceData_[i].first() == KEEPALL)
2520 else if (userFaceData_[i].first() == MASTERONLY)
2525 forAll(newFaceData, facei)
2531 newFaceData[facei] = data[oldFacei];
2551 if (reverseFaceMap[oldFacei] != facei)
2554 reverseFaceMap[oldFacei] = -1;
2561 forAll(newFaceData, facei)
2567 if (reverseFaceMap[oldFacei] == facei)
2569 newFaceData[facei] = data[oldFacei];
2583 && meshCutter_.write()
2584 && surfaceIndex_.write();
2610 writeOk = writeOk && s.
write();
2627 forAll(meshPoints, pointi)
2643 forAll(meshPoints, pointi)
2647 isPatchMasterPoint[pointi] =
true;
2651 return isPatchMasterPoint;
2666 myEdges[edgeI] = globalEdges.toGlobal(edgeI);
2682 if (myEdges[edgeI] == globalEdges.toGlobal(edgeI))
2684 isMasterEdge[edgeI] =
true;
2688 return isMasterEdge;
2700 <<
" : cells(local):" << mesh_.nCells()
2701 <<
" faces(local):" << mesh_.nFaces()
2702 <<
" points(local):" << mesh_.nPoints()
2708 label nMasterFaces = 0;
2711 if (isMasterFace[i])
2718 label nMasterPoints = 0;
2719 forAll(isMeshMasterPoint, i)
2721 if (isMeshMasterPoint[i])
2737 const labelList& cellLevel = meshCutter_.cellLevel();
2743 nCells[cellLevel[celli]]++;
2749 Info<<
"Cells per refinement level:" <<
endl;
2752 Info<<
" " << levelI <<
'\t' << nCells[levelI]
2761 if (overwrite_ && mesh_.time().timeIndex() == 0)
2763 return oldInstance_;
2767 return mesh_.time().timeName();
2782 mesh_.time().timeName(),
2792 const labelList& cellLevel = meshCutter_.cellLevel();
2794 forAll(volRefLevel, celli)
2796 volRefLevel[celli] = cellLevel[celli];
2799 volRefLevel.write();
2811 mesh_.time().timeName(),
2821 const labelList& pointLevel = meshCutter_.pointLevel();
2823 forAll(pointRefLevel, pointi)
2825 pointRefLevel[pointi] = pointLevel[pointi];
2828 pointRefLevel.write();
2836 const pointField& cellCentres = mesh_.cellCentres();
2838 OFstream str(prefix +
"_edges.obj");
2840 Pout<<
"meshRefinement::dumpIntersections :" 2841 <<
" Writing cellcentre-cellcentre intersections to file " 2849 labelList neiLevel(mesh_.nFaces()-mesh_.nInternalFaces());
2850 pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces());
2851 calcNeighbourData(neiLevel, neiCc);
2853 labelList intersectionFaces(intersectedFaces());
2859 forAll(intersectionFaces, i)
2861 label facei = intersectionFaces[i];
2862 start[i] = cellCentres[mesh_.faceOwner()[facei]];
2864 if (mesh_.isInternalFace(facei))
2866 end[i] = cellCentres[mesh_.faceNeighbour()[facei]];
2870 end[i] = neiCc[facei-mesh_.nInternalFaces()];
2876 const vectorField smallVec(ROOTSMALL*(end-start));
2885 surfaces_.findAnyIntersection
2893 forAll(intersectionFaces, i)
2895 if (surfaceHit[i] != -1)
2903 str <<
"l " << vertI-2 <<
' ' << vertI-1 <<
nl 2904 <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
2920 if (writeFlags & WRITEMESH)
2924 if (writeFlags & WRITELEVELS)
2926 dumpRefinementLevel();
2928 if (debugFlags & OBJINTERSECTIONS && prefix.size())
2930 dumpIntersections(prefix);
2943 writeLevel_ = flags;
2949 return outputLevel_;
2955 outputLevel_ = flags;
const vectorField::subField faceAreas() const
Return face normals.
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.
cachedRandom rndGen(label(0),-1)
const Time & time() const
Return time.
This class separates the mesh into distinct unconnected regions, each of which is then given a label ...
label countHits() const
Count number of intersections (local)
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.
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.
List< treeBoundBox > meshBb(1, treeBoundBox(boundBox(coarseMesh.points(), false)).extend(rndGen, 1e-3))
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
IOoutputType
Enumeration for what to output.
A class for handling file names.
void setRefinement(const labelList &cellsToRemove, const labelList &facesToExpose, const labelList &patchIDs, polyTopoChange &) const
Play commands into polyTopoChange to remove cells.
errorManipArg< error, int > exit(error &err, const int errNo=1)
wordList names() const
Return a list of patch names.
const boolList & flipMap() const
Return face flip map.
A face is a list of labels corresponding to mesh vertices.
const double e
Elementary charge.
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.
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.
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.
static const NamedEnum< IOwriteType, 4 > IOwriteTypeNames
const Type & second() const
Return second.
treeBoundBox extend(Random &, const scalar s) const
Return slightly wider bounding box.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static writeType writeLevel()
Get/set write level.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
const Type & first() const
Return first.
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...
void distributeFaceData(List< T > &lst) const
Distribute list of face data.
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.
fileName caseSystem() const
Return system name for the case.
void selectSeparatedCoupledFaces(boolList &) const
Select coupled faces that are not collocated.
Pre-declare related SubField type.
PrimitivePatch< face, IndirectList, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.
Initialise the NamedEnum HashTable from the static list of names.
const pointBoundaryMesh & boundary() const
Return reference to boundary mesh.
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
void dumpRefinementLevel() const
Write refinement level as volScalarFields for postprocessing.
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.
virtual const pointField & points() const
Return raw points.
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.
Mesh representing a set of points created from polyMesh.
fileName caseConstant() const
Return constant name for the case.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
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.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
bool write() const
Write mesh and all data.
void clear()
Delete object (if the pointer is valid) and set pointer to NULL.
void distribute(const mapDistributePolyMesh &)
Update local numbering for mesh redistribution.
const word & name() const
Return name.
virtual bool separated() const
Are the planes separated.
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))
An ordered pair of two objects of type <T> with first() and second() elements.
label start() const
Return start label of this patch in the polyMesh face list.
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.
const labelList & reverseFaceMap() const
Reverse face map.
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)
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
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.
const Time & time() const
Return time.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
wordList names() const
Return a list of zone 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:
labelList intersectedPoints() const
Get points on surfaces with intersection and boundary faces.
bool set(const label) const
Is element set.
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.
const word & constant() const
Return constant name.
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').
virtual bool parallel() const
Are the cyclic planes parallel.
autoPtr< mapDistributePolyMesh > balance(const bool keepZoneFaces, const bool keepBaffles, const scalarField &cellWeights, decompositionMethod &decomposer, fvMeshDistribute &distributor)
Redecompose according to cell count.
labelList getExposedFaces(const labelList &cellsToRemove) const
Get labels of exposed 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.
errorManip< error > abort(error &err)
bool valid() const
Return true if the autoPtr valid (ie, the pointer is set).
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Simple random number generator.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
bool found(const Key &) const
Return true if hashedEntry is found in table.
prefixOSstream Pout(cout,"Pout")
void checkData()
Debugging: check that all faces still obey start()>end()
Type gMax(const FieldField< Field, Type > &f)
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_.
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 occurence 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.
void updateMesh(const mapPolyMesh &, const labelList &changedFaces)
Update for external change to mesh. changedFaces are in new mesh.
void printMeshInfo(const bool, const string &) const
Print some mesh stats.
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?
static label nProcs(const label communicator=0)
Number of processes in parallel run.
const PtrList< surfaceZonesInfo > & surfZones() const
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.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
#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)
const labelUList & faceCells() const
Return face-cell addressing.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
const fileName & pointsInstance() const
Return the current instance directory for points.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
Mesh data needed to do the Finite Volume discretisation.
Direct mesh changes based on v1.3 polyTopoChange syntax.
void dumpIntersections(const fileName &prefix) const
Debug: Write intersection information to OBJ format.
virtual bool write() const
Write using setting from DB.
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.
Standard boundBox + extra functionality for use in octree.
const labelList & faceMap() const
Old face map.
dimensioned< scalar > mag(const dimensioned< Type > &)
const faceZoneMesh & faceZones() const
Return face zone mesh.
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...
Mesh consisting of general polyhedral cells.
static const Vector< scalar > zero
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.
const vectorField::subField faceCentres() const
Return face centres.
const word & system() const
Return system name.
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.
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 const faceList & faces() const
Return raw faces.
static labelList countCells(const labelList &)
Helper function: count cells per processor in wanted distribution.
label findPatchID(const word &patchName) const
Find patch index given a name.
label size() const
Number of entries.
labelList meshedPatches() const
Get patchIDs for patches added in addMeshedPatch.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
labelList intersectedFaces() const
Get faces with intersection.
const fileName & instance() const
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
label nTotalCells() const
Return total number of cells in decomposed mesh.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
label nInternalFaces() const
A List with indirect addressing.
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.
const fileName & name() const
Return the name of the stream.
const word & name() const
Return name.
word timeName() const
Replacement for Time::timeName() : return oldInstance (if.
label size() const
Return the number of elements in the UPtrList.
unsigned int get(const label) const
Get value at index I.