122 void Foam::meshRefinement::calcNeighbourData
133 if (neiLevel.size() != nBoundaryFaces || neiCc.size() != nBoundaryFaces)
136 << nBoundaryFaces <<
" neiLevel:" << neiLevel.size()
158 neiLevel[bFacei] = cellLevel[faceCells[i]];
159 neiCc[bFacei] = cellCentres[faceCells[i]];
163 else if (addedPatchIDSet.found(
patchi))
173 const vector fn = faceAreas[i]/(
mag(faceAreas[i]) + vSmall);
175 const label own = faceCells[i];
176 const label ownLevel = cellLevel[own];
180 scalar d = ((faceCentres[i] - cellCentres[own]) & fn);
181 if (faceLevel > ownLevel)
186 neiLevel[bFacei] = faceLevel;
188 neiCc[bFacei] = faceCentres[i] + d*fn;
196 neiLevel[bFacei] = cellLevel[faceCells[i]];
197 neiCc[bFacei] = faceCentres[i];
209 void Foam::meshRefinement::updateIntersections(
const labelList& changedFaces)
211 const pointField& cellCentres = mesh_.cellCentres();
217 label nMasterFaces = 0;
218 forAll(isMasterFace, facei)
220 if (isMasterFace.get(facei) == 1)
225 reduce(nMasterFaces, sumOp<label>());
227 label nChangedFaces = 0;
230 if (isMasterFace.get(changedFaces[i]) == 1)
235 reduce(nChangedFaces, sumOp<label>());
237 Info<<
"Edge intersection testing:" <<
nl
238 <<
" Number of edges : " << nMasterFaces <<
nl
239 <<
" Number of edges to retest : " << nChangedFaces
245 labelList neiLevel(mesh_.nFaces() - mesh_.nInternalFaces());
246 pointField neiCc(mesh_.nFaces() - mesh_.nInternalFaces());
247 calcNeighbourData(neiLevel, neiCc);
255 const label facei = changedFaces[i];
256 const label own = mesh_.faceOwner()[facei];
258 start[i] = cellCentres[own];
259 if (mesh_.isInternalFace(facei))
261 end[i] = cellCentres[mesh_.faceNeighbour()[facei]];
265 end[i] = neiCc[facei-mesh_.nInternalFaces()];
281 surfaces_.findHigherIntersection
294 surfaceIndex_[changedFaces[i]] = surfaceHit[i];
301 const label nHits = countHits();
304 Info<<
" Number of intersected edges : " << nTotHits <<
endl;
307 setInstance(mesh_.facesInstance());
322 <<
"fld size:" <<
fld.size() <<
" mesh points:" << mesh.
nPoints()
326 Pout<<
"Checking field " << msg <<
endl;
345 const scalar& minVal = minFld[pointi];
346 const scalar& maxVal = maxFld[pointi];
347 if (
mag(minVal-maxVal) > small)
350 <<
" minFld:" << minVal <<
nl
351 <<
" maxFld:" << maxVal <<
nl
369 <<
"fld size:" <<
fld.size() <<
" mesh points:" << mesh.
nPoints()
373 Pout<<
"Checking field " << msg <<
endl;
380 point(great, great, great)
392 const point& minVal = minFld[pointi];
393 const point& maxVal = maxFld[pointi];
394 if (
mag(minVal-maxVal) > small)
397 <<
" minFld:" << minVal <<
nl
398 <<
" maxFld:" << maxVal <<
nl
407 Pout<<
"meshRefinement::checkData() : Checking refinement structure."
409 meshCutter_.checkMesh();
411 Pout<<
"meshRefinement::checkData() : Checking refinement levels."
413 meshCutter_.checkRefinementLevels(1,
labelList(0));
416 label nBnd = mesh_.nFaces() - mesh_.nInternalFaces();
418 Pout<<
"meshRefinement::checkData() : Checking synchronisation."
428 mesh_.nInternalFaces()
441 testSyncBoundaryFaceList
444 "testing faceCentres : ",
454 calcNeighbourData(neiLevel, neiCc);
462 start[facei] = mesh_.cellCentres()[mesh_.faceOwner()[facei]];
464 if (mesh_.isInternalFace(facei))
466 end[facei] = mesh_.cellCentres()[mesh_.faceNeighbour()[facei]];
470 end[facei] = neiCc[facei-mesh_.nInternalFaces()];
486 surfaces_.findHigherIntersection
502 mesh_.nInternalFaces()
510 if (surfaceIndex_[facei] != surfaceHit[facei])
512 if (mesh_.isInternalFace(facei))
515 <<
"Internal face:" << facei
516 <<
" fc:" << mesh_.faceCentres()[facei]
517 <<
" cached surfaceIndex_:" << surfaceIndex_[facei]
518 <<
" current:" << surfaceHit[facei]
520 << mesh_.cellCentres()[mesh_.faceOwner()[facei]]
522 << mesh_.cellCentres()[mesh_.faceNeighbour()[facei]]
528 != neiHit[facei-mesh_.nInternalFaces()]
532 <<
"Boundary face:" << facei
533 <<
" fc:" << mesh_.faceCentres()[facei]
534 <<
" cached surfaceIndex_:" << surfaceIndex_[facei]
535 <<
" current:" << surfaceHit[facei]
537 << mesh_.cellCentres()[mesh_.faceOwner()[facei]]
538 <<
" end:" << end[facei]
548 mesh_.nFaces() - mesh_.nInternalFaces(),
549 mesh_.nInternalFaces()
552 labelList neiBoundarySurface(boundarySurface);
560 testSyncBoundaryFaceList
563 "testing surfaceIndex() : ",
571 Pout<<
"meshRefinement::checkData() : Counting duplicate faces."
579 identityMap(mesh_.nFaces() - mesh_.nInternalFaces())
580 + mesh_.nInternalFaces()
590 if (duplicateFace[i] != -1)
596 Pout<<
"meshRefinement::checkData() : Found " << nDup
597 <<
" duplicate pairs of faces." <<
endl;
604 meshCutter_.setInstance(inst);
605 surfaceIndex_.instance() = inst;
632 mesh_.topoChange(map);
635 mesh_.setInstance(
name());
636 setInstance(mesh_.facesInstance());
644 map().reverseFaceMap(),
651 topoChange(map, newExposedFaces);
667 const label facei = splitFaces[i];
668 const face&
f = mesh_.faces()[facei];
673 label nVerts = split[1] - split[0];
701 const label own = mesh_.faceOwner()[facei];
704 if (facei >= mesh_.nInternalFaces())
706 patchi = mesh_.boundaryMesh().whichPatch(facei);
710 nei = mesh_.faceNeighbour()[facei];
715 Pout<<
"face:" << facei <<
" verts:" <<
f
716 <<
" split into f0:" << f0
717 <<
" f1:" << f1 <<
endl;
747 mesh_.topoChange(map);
750 mesh_.setInstance(
name());
751 setInstance(mesh_.facesInstance());
754 const labelList& oldToNew = map().reverseFaceMap();
761 label oldFacei = map().faceMap()[facei];
762 if (oldToNew[oldFacei] != facei)
765 newSplitFaces[sz++] = facei;
769 topoChange(map, newSplitFaces);
1126 const scalar mergeDistance,
1127 const bool overwrite,
1134 mergeDistance_(mergeDistance),
1135 overwrite_(overwrite),
1136 oldInstance_(mesh.pointsInstance()),
1137 surfaces_(surfaces),
1138 features_(features),
1150 mesh_.facesInstance(),
1182 forAll(surfaceIndex_, facei)
1184 if (surfaceIndex_[facei] >= 0 && isMasterFace.
get(facei) == 1)
1339 const bool keepZoneFaces,
1340 const bool keepBaffles,
1357 label nUnblocked = 0;
1371 specifiedProcessorFaces,
1377 if (keepZoneFaces || keepBaffles)
1390 surfaces().surfZones();
1399 const word& fzName = surfZones[surfi].faceZoneName();
1404 const faceZone& fZone = fZones[fzName];
1408 const label facei = fZone[i];
1409 if (blockedFace[facei])
1413 mesh_.isInternalFace(facei)
1417 blockedFace[facei] =
false;
1440 Info<<
"Found " << nUnblocked
1441 <<
" zoned faces to keep together." <<
endl;
1447 boolList separatedCoupledFace(mesh_.nFaces(),
false);
1448 selectSeparatedCoupledFaces(separatedCoupledFace);
1450 label nSeparated = 0;
1451 forAll(separatedCoupledFace, facei)
1453 if (separatedCoupledFace[facei])
1455 if (blockedFace[facei])
1457 blockedFace[facei] =
false;
1463 Info<<
"Found " << nSeparated
1464 <<
" separated coupled faces to keep together." <<
endl;
1466 nUnblocked += nSeparated;
1472 const label nBnd = mesh_.nFaces() - mesh_.nInternalFaces();
1474 labelList coupledFace(mesh_.nFaces(), -1);
1492 const labelPair& baffle = allCouples[i];
1500 forAll(coupledFace, facei)
1502 if (coupledFace[facei] != -1 && facei < coupledFace[facei])
1504 couples[nCpl++] =
labelPair(facei, coupledFace[facei]);
1513 Info<<
"Found " << nCouples <<
" baffles to keep together."
1568 blockedFace[baffle.
first()] =
false;
1569 blockedFace[baffle.
second()] =
false;
1577 specifiedProcessorFaces,
1585 Pout<<
"Wanted distribution:" << nProcCells <<
endl;
1590 Pout<<
"Wanted resulting decomposition:" <<
endl;
1591 forAll(nProcCells, proci)
1593 Pout<<
" " << proci <<
'\t' << nProcCells[proci] <<
endl;
1607 mesh_.setInstance(
name());
1608 setInstance(mesh_.facesInstance());
1617 label nBoundaryFaces = 0;
1619 forAll(surfaceIndex_, facei)
1621 if (surfaceIndex_[facei] != -1)
1630 forAll(surfaceIndex_, facei)
1632 if (surfaceIndex_[facei] != -1)
1634 surfaceFaces[nBoundaryFaces++] = facei;
1637 return surfaceFaces;
1643 const faceList& faces = mesh_.faces();
1647 label nBoundaryPoints = 0;
1649 forAll(surfaceIndex_, facei)
1651 if (surfaceIndex_[facei] != -1)
1653 const face&
f = faces[facei];
1657 if (isBoundaryPoint.
set(
f[fp], 1u))
1694 labelList boundaryPoints(nBoundaryPoints);
1695 nBoundaryPoints = 0;
1696 forAll(isBoundaryPoint, pointi)
1698 if (isBoundaryPoint.
get(pointi) == 1u)
1700 boundaryPoints[nBoundaryPoints++] = pointi;
1704 return boundaryPoints;
1723 nFaces += pp.
size();
1738 addressing[nFaces++] = meshFacei++;
1764 pointPatches.
size(),
1765 slipPointPatchVectorField::typeName
1770 patchFieldTypes[adaptPatchIDs[i]] =
1771 fixedValuePointPatchVectorField::typeName;
1776 if (isA<processorPointPatch>(pointPatches[
patchi]))
1778 patchFieldTypes[
patchi] = calculatedPointPatchVectorField::typeName;
1780 else if (isA<cyclicPointPatch>(pointPatches[
patchi]))
1782 patchFieldTypes[
patchi] = cyclicSlipPointPatchVectorField::typeName;
1792 "pointDisplacement",
1821 <<
"faceZones are not synchronised on processors." <<
nl
1822 <<
"Processor " << proci <<
" has faceZones "
1823 << zoneNames[proci] <<
nl
1825 <<
" has faceZones "
1839 const faceZone& fZone = fZones[zonei];
1847 if (faceToZone[bFacei] == -1)
1849 faceToZone[bFacei] = zonei;
1851 else if (faceToZone[bFacei] == zonei)
1854 <<
"Face " << fZone[i] <<
" in zone "
1856 <<
" is twice in zone!"
1868 if (faceToZone[i] != neiFaceToZone[i])
1872 <<
" is in zone " << faceToZone[i]
1873 <<
", its coupled face is in zone " << neiFaceToZone[i]
1898 const edge&
e = edges[edgei];
1904 pts[meshPoints[
e[1]]]
1905 - pts[meshPoints[
e[0]]]
1908 edgeWeights[edgei] = 1.0/eMag;
1924 forAll(invSumWeight, pointi)
1926 scalar w = invSumWeight[pointi];
1930 invSumWeight[pointi] = 1.0/w;
1963 if (isA<processorPolyPatch>(pp))
1971 patchDict.
set(
"nFaces", 0);
1972 patchDict.
set(
"startFace", 0);
1994 meshedPatches_.append(
name);
2006 forAll(meshedPatches_, i)
2013 <<
"Problem : did not find patch " << meshedPatches_[i]
2014 <<
endl <<
"Valid patches are " <<
patches.names()
2042 selected[cpp.
start() + i] =
true;
2054 const vector& perturbVec,
2055 const point& location
2062 regioni = cellRegion[celli];
2069 celli = mesh.
findCell(location + perturbVec);
2072 regioni = cellRegion[celli];
2085 const vector& perturbVec,
2092 if (selectionPoints.
outside().size())
2096 selectedCells =
true;
2103 const label regioni = findRegion
2112 forAll(cellRegion, celli)
2114 if (cellRegion[celli] == regioni)
2116 selectedCells[celli] =
false;
2127 const label regioni = findRegion
2132 selectionPoints.
inside()[i]
2136 forAll(cellRegion, celli)
2138 if (cellRegion[celli] == regioni)
2140 selectedCells[celli] =
true;
2146 forAll(selectedCells, celli)
2148 if (!selectedCells[celli])
2150 cellRegion[celli] = -1;
2164 (void)mesh_.tetBasePtIs();
2169 boolList blockedFace(mesh_.nFaces(),
false);
2170 selectSeparatedCoupledFaces(blockedFace);
2187 forAll(cellRegion, celli)
2189 if (cellRegion[celli] == -1)
2191 cellsToRemove.
append(celli);
2198 cellsToRemove.
size(),
2204 label nCellsToKeep = mesh_.nCells() - cellsToRemove.
size();
2207 Info<<
"Keeping all cells in regions containing any point in "
2209 <<
"Selected for keeping : " << nCellsToKeep <<
" cells." <<
endl;
2221 const label nExposedFaces =
2227 label defaultPatch = 0;
2228 if (globalToMasterPatch.
size())
2230 defaultPatch = globalToMasterPatch[0];
2234 <<
"Removing non-reachable cells exposes "
2235 << nExposedFaces <<
" internal or coupled faces." <<
endl
2236 <<
" These get put into patch " << defaultPatch <<
endl;
2238 exposedPatch.
setSize(exposedFaces.
size(), defaultPatch);
2241 return doRemoveCells
2263 meshCutter_.distribute(map);
2289 geometry[i].distribute
2300 geometry[i].instance() = geometry[i].time().name();
2318 topoChange(map, changedFaces, dummyMap, dummyMap, dummyMap);
2330 meshCutter_.storeData
2351 meshCutter_.topoChange
2363 updateIntersections(changedFaces);
2368 labelList& data = userFaceData_[i].second();
2370 if (userFaceData_[i].
first() == KEEPALL)
2375 else if (userFaceData_[i].
first() == MASTERONLY)
2380 forAll(newFaceData, facei)
2386 newFaceData[facei] = data[oldFacei];
2406 if (reverseFaceMap[oldFacei] != facei)
2409 reverseFaceMap[oldFacei] = -1;
2416 forAll(newFaceData, facei)
2422 if (reverseFaceMap[oldFacei] == facei)
2424 newFaceData[facei] = data[oldFacei];
2437 mesh_.setInstance(
name());
2440 bool writeOk = mesh_.write();
2457 s.instance() !=
s.time().system()
2458 &&
s.instance() !=
s.time().caseSystem()
2459 &&
s.instance() !=
s.time().constant()
2460 &&
s.instance() !=
s.time().caseConstant()
2464 s.instance() =
s.time().name();
2465 writeOk = writeOk &&
s.write();
2482 forAll(meshPoints, pointi)
2498 forAll(meshPoints, pointi)
2502 isPatchMasterPoint[pointi] =
true;
2506 return isPatchMasterPoint;
2521 myEdges[edgei] = globalEdges.
toGlobal(edgei);
2537 if (myEdges[edgei] == globalEdges.
toGlobal(edgei))
2539 isMasterEdge[edgei] =
true;
2543 return isMasterEdge;
2555 <<
" : cells(local):" << mesh_.nCells()
2556 <<
" faces(local):" << mesh_.nFaces()
2557 <<
" points(local):" << mesh_.nPoints()
2563 label nMasterFaces = 0;
2566 if (isMasterFace[i])
2573 label nMasterPoints = 0;
2574 forAll(isMeshMasterPoint, i)
2576 if (isMeshMasterPoint[i])
2592 const labelList& cellLevel = meshCutter_.cellLevel();
2598 nCells[cellLevel[celli]]++;
2604 Info<<
"Cells per refinement level:" <<
endl;
2607 Info<<
" " << leveli <<
'\t' << nCells[leveli]
2616 if (overwrite_ && mesh_.time().timeIndex() == 0)
2618 return oldInstance_;
2622 return mesh_.time().name();
2637 mesh_.time().name(),
2647 const labelList& cellLevel = meshCutter_.cellLevel();
2649 forAll(volRefLevel, celli)
2651 volRefLevel[celli] = cellLevel[celli];
2654 volRefLevel.
write();
2666 mesh_.time().name(),
2676 const labelList& pointLevel = meshCutter_.pointLevel();
2678 forAll(pointRefLevel, pointi)
2680 pointRefLevel[pointi] = pointLevel[pointi];
2683 pointRefLevel.
write();
2691 const pointField& cellCentres = mesh_.cellCentres();
2693 OFstream str(prefix +
"_edges.obj");
2695 Pout<<
"meshRefinement::dumpIntersections :"
2696 <<
" Writing cellcentre-cellcentre intersections to file "
2704 labelList neiLevel(mesh_.nFaces() - mesh_.nInternalFaces());
2705 pointField neiCc(mesh_.nFaces() - mesh_.nInternalFaces());
2706 calcNeighbourData(neiLevel, neiCc);
2708 labelList intersectionFaces(intersectedFaces());
2714 forAll(intersectionFaces, i)
2716 const label facei = intersectionFaces[i];
2717 start[i] = cellCentres[mesh_.faceOwner()[facei]];
2719 if (mesh_.isInternalFace(facei))
2721 end[i] = cellCentres[mesh_.faceNeighbour()[facei]];
2725 end[i] = neiCc[facei-mesh_.nInternalFaces()];
2731 const vectorField smallVec(rootSmall*(end-start));
2740 surfaces_.findAnyIntersection
2748 forAll(intersectionFaces, i)
2750 if (surfaceHit[i] != -1)
2758 str <<
"l " << vertI-2 <<
' ' << vertI-1 <<
nl
2759 <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
2775 if (writeFlags & WRITEMESH)
2780 if (writeFlags && !(writeFlags & NOWRITEREFINEMENT))
2782 meshCutter_.write();
2783 surfaceIndex_.write();
2786 if (writeFlags & WRITELEVELS)
2788 dumpRefinementLevel();
2791 if (debugFlags & OBJINTERSECTIONS && prefix.size())
2793 dumpIntersections(prefix);
2806 writeLevel_ = flags;
2812 return outputLevel_;
2818 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, pointPatchField, pointMesh > > New(const word &name, const Internal &, const PtrList< pointPatchField< Type >> &, 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 keyword definitions, which are a keyword followed by any number of values (e....
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T, if not found return the given default.
void set(entry *)
Assign a new entry, overwrite any existing entry.
Base class for statistical distributions.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A subset of mesh faces organised as a primitive patch.
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.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
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.
IOwriteType
Enumeration for what to write.
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.
IOoutputType
Enumeration for what to output.
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.
IOdebugType
Enumeration for what to debug.
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.
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.
const vectorField & cellCentres() const
label nInternalFaces() 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.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
Container for searchableSurfaces.
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.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
gmvFile<< "tracers "<< particles.size()<< nl;{ pointField positions(particles.size());label particlei=0;forAllConstIter(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(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
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.name(), 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.
word name(const bool)
Return a word representation of a bool.
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.
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)
dimensioned< scalar > mag(const dimensioned< Type > &)
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)
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))