99 void Foam::meshRefinement::calcNeighbourData
110 if (neiLevel.size() != nBoundaryFaces || neiCc.size() != nBoundaryFaces)
113 << nBoundaryFaces <<
" neiLevel:" << neiLevel.size()
135 neiLevel[bFacei] = cellLevel[faceCells[i]];
136 neiCc[bFacei] = cellCentres[faceCells[i]];
140 else if (addedPatchIDSet.found(
patchi))
150 const vector fn = faceAreas[i]/(
mag(faceAreas[i]) + vSmall);
152 const label own = faceCells[i];
153 const label ownLevel = cellLevel[own];
157 scalar d = ((faceCentres[i] - cellCentres[own]) & fn);
158 if (faceLevel > ownLevel)
163 neiLevel[bFacei] = faceLevel;
165 neiCc[bFacei] = faceCentres[i] + d*fn;
173 neiLevel[bFacei] = cellLevel[faceCells[i]];
174 neiCc[bFacei] = faceCentres[i];
186 void Foam::meshRefinement::updateIntersections(
const labelList& changedFaces)
188 const pointField& cellCentres = mesh_.cellCentres();
194 label nMasterFaces = 0;
195 forAll(isMasterFace, facei)
197 if (isMasterFace.get(facei) == 1)
202 reduce(nMasterFaces, sumOp<label>());
204 label nChangedFaces = 0;
207 if (isMasterFace.get(changedFaces[i]) == 1)
212 reduce(nChangedFaces, sumOp<label>());
214 Info<<
"Edge intersection testing:" <<
nl
215 <<
" Number of edges : " << nMasterFaces <<
nl
216 <<
" Number of edges to retest : " << nChangedFaces
222 labelList neiLevel(mesh_.nFaces() - mesh_.nInternalFaces());
223 pointField neiCc(mesh_.nFaces() - mesh_.nInternalFaces());
224 calcNeighbourData(neiLevel, neiCc);
232 const label facei = changedFaces[i];
233 const label own = mesh_.faceOwner()[facei];
235 start[i] = cellCentres[own];
236 if (mesh_.isInternalFace(facei))
238 end[i] = cellCentres[mesh_.faceNeighbour()[facei]];
242 end[i] = neiCc[facei-mesh_.nInternalFaces()];
258 surfaces_.findHigherIntersection
271 surfaceIndex_[changedFaces[i]] = surfaceHit[i];
278 const label nHits = countHits();
281 Info<<
" Number of intersected edges : " << nTotHits <<
endl;
284 setInstance(mesh_.facesInstance());
303 Pout<<
"Checking field " << msg <<
endl;
322 const scalar& minVal = minFld[pointi];
323 const scalar& maxVal = maxFld[pointi];
324 if (
mag(minVal-maxVal) > small)
327 <<
" minFld:" << minVal <<
nl
328 <<
" maxFld:" << maxVal <<
nl
350 Pout<<
"Checking field " << msg <<
endl;
357 point(great, great, great)
369 const point& minVal = minFld[pointi];
370 const point& maxVal = maxFld[pointi];
371 if (
mag(minVal-maxVal) > small)
374 <<
" minFld:" << minVal <<
nl
375 <<
" maxFld:" << maxVal <<
nl
384 Pout<<
"meshRefinement::checkData() : Checking refinement structure."
386 meshCutter_.checkMesh();
388 Pout<<
"meshRefinement::checkData() : Checking refinement levels."
390 meshCutter_.checkRefinementLevels(1,
labelList(0));
393 label nBnd = mesh_.nFaces() - mesh_.nInternalFaces();
395 Pout<<
"meshRefinement::checkData() : Checking synchronisation."
405 mesh_.nInternalFaces()
418 testSyncBoundaryFaceList
421 "testing faceCentres : ",
431 calcNeighbourData(neiLevel, neiCc);
439 start[facei] = mesh_.cellCentres()[mesh_.faceOwner()[facei]];
441 if (mesh_.isInternalFace(facei))
443 end[facei] = mesh_.cellCentres()[mesh_.faceNeighbour()[facei]];
447 end[facei] = neiCc[facei-mesh_.nInternalFaces()];
463 surfaces_.findHigherIntersection
479 mesh_.nInternalFaces()
487 if (surfaceIndex_[facei] != surfaceHit[facei])
489 if (mesh_.isInternalFace(facei))
492 <<
"Internal face:" << facei
493 <<
" fc:" << mesh_.faceCentres()[facei]
494 <<
" cached surfaceIndex_:" << surfaceIndex_[facei]
495 <<
" current:" << surfaceHit[facei]
497 << mesh_.cellCentres()[mesh_.faceOwner()[facei]]
499 << mesh_.cellCentres()[mesh_.faceNeighbour()[facei]]
505 != neiHit[facei-mesh_.nInternalFaces()]
509 <<
"Boundary face:" << facei
510 <<
" fc:" << mesh_.faceCentres()[facei]
511 <<
" cached surfaceIndex_:" << surfaceIndex_[facei]
512 <<
" current:" << surfaceHit[facei]
514 << mesh_.cellCentres()[mesh_.faceOwner()[facei]]
515 <<
" end:" << end[facei]
525 mesh_.nFaces() - mesh_.nInternalFaces(),
526 mesh_.nInternalFaces()
529 labelList neiBoundarySurface(boundarySurface);
537 testSyncBoundaryFaceList
540 "testing surfaceIndex() : ",
548 Pout<<
"meshRefinement::checkData() : Counting duplicate faces."
556 identityMap(mesh_.nFaces() - mesh_.nInternalFaces())
557 + mesh_.nInternalFaces()
567 if (duplicateFace[i] != -1)
573 Pout<<
"meshRefinement::checkData() : Found " << nDup
574 <<
" duplicate pairs of faces." <<
endl;
581 meshCutter_.setInstance(inst);
582 surfaceIndex_.instance() = inst;
609 mesh_.topoChange(map);
612 mesh_.setInstance(
name());
613 setInstance(mesh_.facesInstance());
621 map().reverseFaceMap(),
628 topoChange(map, newExposedFaces);
644 const label facei = splitFaces[i];
645 const face&
f = mesh_.faces()[facei];
650 label nVerts = split[1] - split[0];
678 const label own = mesh_.faceOwner()[facei];
681 if (facei >= mesh_.nInternalFaces())
683 patchi = mesh_.boundaryMesh().whichPatch(facei);
687 nei = mesh_.faceNeighbour()[facei];
692 Pout<<
"face:" << facei <<
" verts:" <<
f
693 <<
" split into f0:" << f0
694 <<
" f1:" << f1 <<
endl;
724 mesh_.topoChange(map);
727 mesh_.setInstance(
name());
728 setInstance(mesh_.facesInstance());
731 const labelList& oldToNew = map().reverseFaceMap();
738 label oldFacei = map().faceMap()[facei];
739 if (oldToNew[oldFacei] != facei)
742 newSplitFaces[sz++] = facei;
746 topoChange(map, newSplitFaces);
1103 const scalar mergeDistance,
1111 mergeDistance_(mergeDistance),
1113 oldInstance_(
mesh.pointsInstance()),
1114 surfaces_(surfaces),
1115 features_(features),
1127 mesh_.facesInstance(),
1159 forAll(surfaceIndex_, facei)
1161 if (surfaceIndex_[facei] >= 0 && isMasterFace.
get(facei) == 1)
1316 const bool keepZoneFaces,
1317 const bool keepBaffles,
1334 label nUnblocked = 0;
1348 specifiedProcessorFaces,
1354 if (keepZoneFaces || keepBaffles)
1367 surfaces().surfZones();
1376 const word& fzName = surfZones[surfi].faceZoneName();
1381 const faceZone& fZone = fZones[fzName];
1385 const label facei = fZone[i];
1386 if (blockedFace[facei])
1390 mesh_.isInternalFace(facei)
1394 blockedFace[facei] =
false;
1417 Info<<
"Found " << nUnblocked
1418 <<
" zoned faces to keep together." <<
endl;
1424 boolList separatedCoupledFace(mesh_.nFaces(),
false);
1425 selectSeparatedCoupledFaces(separatedCoupledFace);
1427 label nSeparated = 0;
1428 forAll(separatedCoupledFace, facei)
1430 if (separatedCoupledFace[facei])
1432 if (blockedFace[facei])
1434 blockedFace[facei] =
false;
1440 Info<<
"Found " << nSeparated
1441 <<
" separated coupled faces to keep together." <<
endl;
1443 nUnblocked += nSeparated;
1449 const label nBnd = mesh_.nFaces() - mesh_.nInternalFaces();
1451 labelList coupledFace(mesh_.nFaces(), -1);
1469 const labelPair& baffle = allCouples[i];
1477 forAll(coupledFace, facei)
1479 if (coupledFace[facei] != -1 && facei < coupledFace[facei])
1481 couples[nCpl++] =
labelPair(facei, coupledFace[facei]);
1490 Info<<
"Found " << nCouples <<
" baffles to keep together."
1545 blockedFace[baffle.
first()] =
false;
1546 blockedFace[baffle.
second()] =
false;
1554 specifiedProcessorFaces,
1562 Pout<<
"Wanted distribution:" << nProcCells <<
endl;
1567 Pout<<
"Wanted resulting decomposition:" <<
endl;
1568 forAll(nProcCells, proci)
1570 Pout<<
" " << proci <<
'\t' << nProcCells[proci] <<
endl;
1584 mesh_.setInstance(
name());
1585 setInstance(mesh_.facesInstance());
1594 label nBoundaryFaces = 0;
1596 forAll(surfaceIndex_, facei)
1598 if (surfaceIndex_[facei] != -1)
1607 forAll(surfaceIndex_, facei)
1609 if (surfaceIndex_[facei] != -1)
1611 surfaceFaces[nBoundaryFaces++] = facei;
1614 return surfaceFaces;
1620 const faceList& faces = mesh_.faces();
1624 label nBoundaryPoints = 0;
1626 forAll(surfaceIndex_, facei)
1628 if (surfaceIndex_[facei] != -1)
1630 const face&
f = faces[facei];
1634 if (isBoundaryPoint.
set(
f[fp], 1u))
1671 labelList boundaryPoints(nBoundaryPoints);
1672 nBoundaryPoints = 0;
1673 forAll(isBoundaryPoint, pointi)
1675 if (isBoundaryPoint.
get(pointi) == 1u)
1677 boundaryPoints[nBoundaryPoints++] = pointi;
1681 return boundaryPoints;
1700 nFaces += pp.
size();
1715 addressing[nFaces++] = meshFacei++;
1741 pointPatches.
size(),
1742 slipPointPatchVectorField::typeName
1747 patchFieldTypes[adaptPatchIDs[i]] =
1748 fixedValuePointPatchVectorField::typeName;
1753 if (isA<processorPointPatch>(pointPatches[
patchi]))
1755 patchFieldTypes[
patchi] = calculatedPointPatchVectorField::typeName;
1757 else if (isA<cyclicPointPatch>(pointPatches[
patchi]))
1759 patchFieldTypes[
patchi] = cyclicSlipPointPatchVectorField::typeName;
1769 "pointDisplacement",
1798 <<
"faceZones are not synchronised on processors." <<
nl
1799 <<
"Processor " << proci <<
" has faceZones "
1800 << zoneNames[proci] <<
nl
1802 <<
" has faceZones "
1816 const faceZone& fZone = fZones[zonei];
1824 if (faceToZone[bFacei] == -1)
1826 faceToZone[bFacei] = zonei;
1828 else if (faceToZone[bFacei] == zonei)
1831 <<
"Face " << fZone[i] <<
" in zone "
1833 <<
" is twice in zone!"
1845 if (faceToZone[i] != neiFaceToZone[i])
1849 <<
" is in zone " << faceToZone[i]
1850 <<
", its coupled face is in zone " << neiFaceToZone[i]
1875 const edge&
e = edges[edgei];
1881 pts[meshPoints[
e[1]]]
1882 - pts[meshPoints[
e[0]]]
1885 edgeWeights[edgei] = 1.0/eMag;
1901 forAll(invSumWeight, pointi)
1903 scalar w = invSumWeight[pointi];
1907 invSumWeight[pointi] = 1.0/w;
1940 if (isA<processorPolyPatch>(pp))
1948 patchDict.set(
"nFaces", 0);
1949 patchDict.set(
"startFace", 0);
1960 mesh_.addPatch(
patchi, ppPtr());
1964 meshedPatches_.append(
name);
1973 mesh_.addedPatches();
1982 forAll(meshedPatches_, i)
1989 <<
"Problem : did not find patch " << meshedPatches_[i]
1990 <<
endl <<
"Valid patches are " <<
patches.names()
2018 selected[cpp.
start() + i] =
true;
2030 const vector& perturbVec,
2031 const point& location
2038 regioni = cellRegion[celli];
2048 regioni = cellRegion[celli];
2061 const vector& perturbVec,
2068 if (selectionPoints.
outside().size())
2072 selectedCells =
true;
2079 const label regioni = findRegion
2088 forAll(cellRegion, celli)
2090 if (cellRegion[celli] == regioni)
2092 selectedCells[celli] =
false;
2103 const label regioni = findRegion
2108 selectionPoints.
inside()[i]
2112 forAll(cellRegion, celli)
2114 if (cellRegion[celli] == regioni)
2116 selectedCells[celli] =
true;
2122 forAll(selectedCells, celli)
2124 if (!selectedCells[celli])
2126 cellRegion[celli] = -1;
2140 (void)mesh_.tetBasePtIs();
2145 boolList blockedFace(mesh_.nFaces(),
false);
2146 selectSeparatedCoupledFaces(blockedFace);
2163 forAll(cellRegion, celli)
2165 if (cellRegion[celli] == -1)
2167 cellsToRemove.
append(celli);
2174 cellsToRemove.
size(),
2180 label nCellsToKeep = mesh_.nCells() - cellsToRemove.
size();
2183 Info<<
"Keeping all cells in regions containing any point in "
2185 <<
"Selected for keeping : " << nCellsToKeep <<
" cells." <<
endl;
2197 const label nExposedFaces =
2203 label defaultPatch = 0;
2204 if (globalToMasterPatch.
size())
2206 defaultPatch = globalToMasterPatch[0];
2210 <<
"Removing non-reachable cells exposes "
2211 << nExposedFaces <<
" internal or coupled faces." <<
endl
2212 <<
" These get put into patch " << defaultPatch <<
endl;
2214 exposedPatch.
setSize(exposedFaces.
size(), defaultPatch);
2217 return doRemoveCells
2239 meshCutter_.distribute(map);
2265 geometry[i].distribute
2276 geometry[i].instance() = geometry[i].time().name();
2294 topoChange(map, changedFaces, dummyMap, dummyMap, dummyMap);
2306 meshCutter_.storeData
2327 meshCutter_.topoChange
2339 updateIntersections(changedFaces);
2344 labelList& data = userFaceData_[i].second();
2346 if (userFaceData_[i].
first() == KEEPALL)
2351 else if (userFaceData_[i].
first() == MASTERONLY)
2356 forAll(newFaceData, facei)
2362 newFaceData[facei] = data[oldFacei];
2382 if (reverseFaceMap[oldFacei] != facei)
2385 reverseFaceMap[oldFacei] = -1;
2392 forAll(newFaceData, facei)
2398 if (reverseFaceMap[oldFacei] == facei)
2400 newFaceData[facei] = data[oldFacei];
2413 mesh_.setInstance(
name());
2416 bool writeOk = mesh_.write();
2433 s.instance() !=
s.time().system()
2434 &&
s.instance() !=
s.time().caseSystem()
2435 &&
s.instance() !=
s.time().constant()
2436 &&
s.instance() !=
s.time().caseConstant()
2440 s.instance() =
s.time().name();
2441 writeOk = writeOk &&
s.write();
2458 forAll(meshPoints, pointi)
2474 forAll(meshPoints, pointi)
2478 isPatchMasterPoint[pointi] =
true;
2482 return isPatchMasterPoint;
2497 myEdges[edgei] = globalEdges.
toGlobal(edgei);
2513 if (myEdges[edgei] == globalEdges.
toGlobal(edgei))
2515 isMasterEdge[edgei] =
true;
2519 return isMasterEdge;
2531 <<
" : cells(local):" << mesh_.nCells()
2532 <<
" faces(local):" << mesh_.nFaces()
2533 <<
" points(local):" << mesh_.nPoints()
2539 label nMasterFaces = 0;
2542 if (isMasterFace[i])
2549 label nMasterPoints = 0;
2550 forAll(isMeshMasterPoint, i)
2552 if (isMeshMasterPoint[i])
2568 const labelList& cellLevel = meshCutter_.cellLevel();
2574 nCells[cellLevel[celli]]++;
2580 Info<<
"Cells per refinement level:" <<
endl;
2583 Info<<
" " << leveli <<
'\t' << nCells[leveli]
2592 if (overwrite_ && mesh_.time().timeIndex() == 0)
2594 return oldInstance_;
2598 return mesh_.time().name();
2613 mesh_.time().name(),
2623 const labelList& cellLevel = meshCutter_.cellLevel();
2625 forAll(volRefLevel, celli)
2627 volRefLevel[celli] = cellLevel[celli];
2630 volRefLevel.
write();
2642 mesh_.time().name(),
2652 const labelList& pointLevel = meshCutter_.pointLevel();
2654 forAll(pointRefLevel, pointi)
2656 pointRefLevel[pointi] = pointLevel[pointi];
2659 pointRefLevel.
write();
2667 const pointField& cellCentres = mesh_.cellCentres();
2669 OFstream str(prefix +
"_edges.obj");
2671 Pout<<
"meshRefinement::dumpIntersections :"
2672 <<
" Writing cellcentre-cellcentre intersections to file "
2680 labelList neiLevel(mesh_.nFaces() - mesh_.nInternalFaces());
2681 pointField neiCc(mesh_.nFaces() - mesh_.nInternalFaces());
2682 calcNeighbourData(neiLevel, neiCc);
2684 labelList intersectionFaces(intersectedFaces());
2690 forAll(intersectionFaces, i)
2692 const label facei = intersectionFaces[i];
2693 start[i] = cellCentres[mesh_.faceOwner()[facei]];
2695 if (mesh_.isInternalFace(facei))
2697 end[i] = cellCentres[mesh_.faceNeighbour()[facei]];
2701 end[i] = neiCc[facei-mesh_.nInternalFaces()];
2707 const vectorField smallVec(rootSmall*(end-start));
2716 surfaces_.findAnyIntersection
2724 forAll(intersectionFaces, i)
2726 if (surfaceHit[i] != -1)
2734 str <<
"l " << vertI-2 <<
' ' << vertI-1 <<
nl
2735 <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
2751 if (writeFlags & WRITEMESH)
2756 if (writeFlags && !(writeFlags & NOWRITEREFINEMENT))
2758 meshCutter_.write();
2759 surfaceIndex_.write();
2762 if (writeFlags & WRITELEVELS)
2764 dumpRefinementLevel();
2767 if (debugFlags & OBJINTERSECTIONS && prefix.size())
2769 dumpIntersections(prefix);
2782 writeLevel_ = flags;
2788 return outputLevel_;
2794 outputLevel_ = flags;
#define forAll(list, i)
Loop across all elements in list.
static pointMesh & New(const word &name, const polyMesh &mesh)
Construct and return the named DemandDrivenMeshObject.
wordList toc() const
Return the table of contents.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
SubField< vector > subField
Declare type of subField.
Generic GeometricField class.
static tmp< GeometricField< Type, pointMesh, Field > > New(const word &name, const Internal &, const PtrList< Patch > &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
A List with indirect addressing.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
Initialise the NamedEnum HashTable from the static list of names.
const fileName & name() const
Return the name of the stream.
void set(const PackedList< 1 > &)
Set specified bits.
label size() const
Number of entries.
unsigned int get(const label) const
Get value at index I.
const Type & second() const
Return second.
const Type & first() const
Return first.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
A List obtained as a section of another List.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
label size() const
Return the number of elements in the UList.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
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)
label size() const
Return the number of elements in the UPtrList.
const word & name() const
Return name.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
void clear()
Delete object (if the pointer is valid) and set pointer to.
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational d...
virtual const transformer & transform() const =0
Return transformation between the coupled patches.
Abstract base class for decomposition.
virtual labelList decompose(const pointField &points, const scalarField &pointWeights)
Return for every coordinate the wanted processor number.
void setConstraints(const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections)
Helper: extract constraints:
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
T lookupOrDefault(const word &, const T &, const bool writeDefault=writeOptionalEntries > 0) const
Find and return a T, if not found return the given default.
Base class for statistical distributions.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Named list of face indices representing a sub-set of the mesh faces.
A face is a list of labels corresponding to mesh vertices.
A class for handling file names.
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
autoPtr< polyDistributionMap > distribute(const labelList &dist)
Send cells to neighbours according to distribution.
static labelList countCells(const labelList &)
Helper function: count cells per processor in wanted distribution.
Mesh data needed to do the Finite Volume discretisation.
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.
Various mesh related information for a parallel run. Upon construction, constructs all info using par...
label nTotalCells() const
Return total number of cells in decomposed mesh.
Calculates points shared by more than two processor patches or cyclic patches.
scalar level0EdgeLength() const
Typical edge length between unrefined points.
const labelIOList & cellLevel() const
label faceLevel(const label facei) const
Gets level such that the face has four points <= level.
static labelList findDuplicateFaces(const primitiveMesh &, const labelList &)
Helper routine to find baffles (two boundary faces using the.
static labelPairList findDuplicateFacePairs(const polyMesh &)
Helper routine to find all baffles (two boundary faces.
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
autoPtr< polyTopoChangeMap > splitMeshRegions(const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const refinementParameters::cellSelectionPoints &selectionPoints)
Split mesh according to selectionPoints.
labelList intersectedFaces() const
Get faces with intersection.
labelList intersectedPoints() const
Get points on surfaces with intersection and boundary faces.
meshRefinement(fvMesh &mesh, const dictionary &refineDict, const scalar mergeDistance, const bool overwrite, refinementSurfaces &, const refinementFeatures &, const refinementRegions &)
Construct from components.
static void testSyncPointList(const string &msg, const polyMesh &mesh, const List< scalar > &fld)
void checkData()
Debugging: check that all faces still obey start()>end()
const refinementSurfaces & surfaces() const
Reference to surface search engines.
void topoChange(const polyTopoChangeMap &, const labelList &changedFaces)
Update for external change to mesh. changedFaces are in new mesh.
word name() const
Replacement for Time::name() : return oldInstance (if.
static const NamedEnum< IOwriteType, 5 > IOwriteTypeNames
void printMeshInfo(const bool, const string &) const
Print some mesh stats.
void distribute(const polyDistributionMap &)
Update local numbering for mesh redistribution.
void dumpRefinementLevel() const
Write refinement level as volScalarFields for postprocessing.
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)
label countHits() const
Count number of intersections (local)
static const NamedEnum< IOdebugType, 5 > IOdebugTypeNames
labelList meshedPatches() const
Get patchIDs for patches added in addMeshedPatch.
static void checkCoupledFaceZones(const polyMesh &)
Helper function: check that face zones are synced.
label addMeshedPatch(const word &name, const dictionary &)
Add patch originating from meshing. Update meshedPatches_.
void selectSeparatedCoupledFaces(boolList &) const
Select coupled faces that are not collocated.
static tmp< pointVectorField > makeDisplacementField(const pointMesh &pMesh, const labelList &adaptPatchIDs)
Helper function to make a pointVectorField with correct.
static const NamedEnum< IOoutputType, 1 > IOoutputTypeNames
static PackedBoolList getMasterEdges(const polyMesh &mesh, const labelList &meshEdges)
Determine master edge for subset of edges. If coupled.
static PackedBoolList getMasterPoints(const polyMesh &mesh, const labelList &meshPoints)
Determine master point for subset of points. If coupled.
autoPtr< polyDistributionMap > balance(const bool keepZoneFaces, const bool keepBaffles, const scalarField &cellWeights, decompositionMethod &decomposer, fvMeshDistribute &distributor)
Redecompose according to cell count.
static autoPtr< indirectPrimitivePatch > makePatch(const polyMesh &, const labelList &)
Create patch from set of patches.
void storeData(const labelList &pointsToStore, const labelList &facesToStore, const labelList &cellsToStore)
Signal points/face/cells for which to store data.
bool write() const
Write mesh and all data.
void setInstance(const fileName &)
Set instance of all local IOobjects.
autoPtr< polyTopoChangeMap > splitFaces(const labelList &splitFaces, const labelPairList &splits)
Split faces into two.
static label findRegion(const polyMesh &, const labelList &cellRegion, const vector &perturbVec, const point &location)
Find region point is in. Uses optional perturbation to re-test.
static writeType writeLevel()
Get/set write level.
static void findRegions(const polyMesh &, labelList &cellRegion, const vector &perturbVec, const refinementParameters::cellSelectionPoints &selectionPoints)
Find regions points are in and update cellRegion.
void dumpIntersections(const fileName &prefix) const
Debug: Write intersection information to OBJ format.
static outputType outputLevel()
Get/set output level.
void addedMeshedPatches()
Complete adding patches originating from meshing.
Mesh representing a set of points created from polyMesh.
const pointBoundaryMesh & boundary() const
Return reference to boundary mesh.
label findIndex(const word &patchName) const
Find patch index given a name.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
void distributeFaceData(List< T > &lst) const
Distribute list of face data.
Mesh consisting of general polyhedral cells.
virtual const faceList & faces() const
Return raw faces.
label findCell(const point &p, const cellDecomposition=CELL_TETS) const
Find cell enclosing this location and return index.
const faceZoneList & faceZones() const
Return face zones.
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.
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.
label start() const
Return start label of this patch in the polyMesh face list.
static bool constraintType(const word &pt)
Return true if the given type is a constraint type.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const labelList & reverseFaceMap() const
Reverse face map.
const labelList & faceMap() const
Old face map.
Direct mesh changes based on v1.3 polyTopoChange syntax.
autoPtr< polyTopoChangeMap > changeMesh(polyMesh &mesh, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Inplace changes mesh without change of patches.
void modifyFace(const face &f, const label facei, const label own, const label nei, const bool flipFaceFlux, const label patchID)
Modify vertices or cell of face.
label addFace(const face &f, const label own, const label nei, const label masterFaceID, const bool flipFaceFlux, const label patchID)
Add face to cells and return new face index.
label nInternalFaces() const
const vectorField & cellCentres() const
Encapsulates queries for features.
Class to hold the points to select cells inside and outside.
const List< point > & outside() const
Return the points outside the surface region to deselect cells.
const List< point > & inside() const
Return the points inside the surface regions to selected cells.
Encapsulates queries for volume refinement ('refine all cells within shell').
Container for data on surfaces used for surface-driven refinement. Contains all the data about the le...
void setMinLevelFields(const refinementRegions &shells, const scalar level0EdgeLength, const bool extendedRefinementSpan)
Calculate the refinement level for every element.
virtual bool write(const bool write=true) const
Write using setting from DB.
This class separates the mesh into distinct unconnected regions, each of which is then given a label ...
Given list of cells to remove insert all the topology changes.
void setRefinement(const labelList &cellsToRemove, const labelList &facesToExpose, const labelList &patchIDs, polyTopoChange &) const
Play commands into polyTopoChange to remove cells.
void topoChange(const polyTopoChangeMap &)
Force recalculation of locally stored data on topological change.
labelList getExposedFaces(const labelList &cellsToRemove) const
Get labels of exposed faces.
Container for searchableSurfaces.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
A class for managing temporary objects.
Standard boundBox + extra functionality for use in octree.
treeBoundBox extend(const scalar s) const
Return asymmetrically extended bounding box, with guaranteed.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#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
#define WarningInFunction
Report a warning using Foam::Warning.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Pair< label > labelPair
Label pair.
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
const dimensionSet dimless
ListType renumber(const labelUList &oldToNew, const ListType &)
Renumber the values (not the indices) of a list.
const dimensionSet dimLength
labelList second(const UList< labelPair > &p)
vectorField pointField
pointField is a vectorField.
vector point
Point is a vector.
void mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
labelList first(const UList< labelPair > &p)
Vector< scalar > vector
A scalar version of the templated Vector.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
defineTypeNameAndDebug(combustionModel, 0)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Field< vector > vectorField
Specialisation of Field<T> for vector.
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.
prefixOSstream Pout(cout, "Pout")
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
static const label labelMax
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
UList< label > labelUList
Type gMax(const FieldField< Field, Type > &f)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
List< treeBoundBox > meshBb(1, treeBoundBox(boundBox(coarseMesh.points(), false)).extend(1e-3))