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 if (map().hasMotionPoints())
637 mesh_.movePoints(map().preMotionPoints());
646 mesh_.setInstance(
name());
647 setInstance(mesh_.facesInstance());
655 map().reverseFaceMap(),
662 topoChange(map, newExposedFaces);
678 const label facei = splitFaces[i];
679 const face&
f = mesh_.faces()[facei];
684 label nVerts = split[1] - split[0];
712 const label own = mesh_.faceOwner()[facei];
715 if (facei >= mesh_.nInternalFaces())
717 patchi = mesh_.boundaryMesh().whichPatch(facei);
721 nei = mesh_.faceNeighbour()[facei];
724 const label zonei = mesh_.faceZones().whichZone(facei);
725 bool zoneFlip =
false;
728 const faceZone& fz = mesh_.faceZones()[zonei];
735 Pout<<
"face:" << facei <<
" verts:" <<
f
736 <<
" split into f0:" << f0
737 <<
" f1:" << f1 <<
endl;
774 mesh_.topoChange(map);
777 if (map().hasMotionPoints())
779 mesh_.movePoints(map().preMotionPoints());
788 mesh_.setInstance(
name());
789 setInstance(mesh_.facesInstance());
792 const labelList& oldToNew = map().reverseFaceMap();
799 label oldFacei = map().faceMap()[facei];
800 if (oldToNew[oldFacei] != facei)
803 newSplitFaces[sz++] = facei;
807 topoChange(map, newSplitFaces);
1164 const scalar mergeDistance,
1165 const bool overwrite,
1172 mergeDistance_(mergeDistance),
1173 overwrite_(overwrite),
1174 oldInstance_(mesh.pointsInstance()),
1175 surfaces_(surfaces),
1176 features_(features),
1188 mesh_.facesInstance(),
1220 forAll(surfaceIndex_, facei)
1222 if (surfaceIndex_[facei] >= 0 && isMasterFace.
get(facei) == 1)
1377 const bool keepZoneFaces,
1378 const bool keepBaffles,
1395 label nUnblocked = 0;
1409 specifiedProcessorFaces,
1415 if (keepZoneFaces || keepBaffles)
1428 surfaces().surfZones();
1437 const word& fzName = surfZones[surfi].faceZoneName();
1442 const faceZone& fZone = fZones[fzName];
1446 const label facei = fZone[i];
1447 if (blockedFace[facei])
1451 mesh_.isInternalFace(facei)
1455 blockedFace[facei] =
false;
1478 Info<<
"Found " << nUnblocked
1479 <<
" zoned faces to keep together." <<
endl;
1485 boolList separatedCoupledFace(mesh_.nFaces(),
false);
1486 selectSeparatedCoupledFaces(separatedCoupledFace);
1488 label nSeparated = 0;
1489 forAll(separatedCoupledFace, facei)
1491 if (separatedCoupledFace[facei])
1493 if (blockedFace[facei])
1495 blockedFace[facei] =
false;
1501 Info<<
"Found " << nSeparated
1502 <<
" separated coupled faces to keep together." <<
endl;
1504 nUnblocked += nSeparated;
1510 const label nBnd = mesh_.nFaces() - mesh_.nInternalFaces();
1512 labelList coupledFace(mesh_.nFaces(), -1);
1530 const labelPair& baffle = allCouples[i];
1538 forAll(coupledFace, facei)
1540 if (coupledFace[facei] != -1 && facei < coupledFace[facei])
1542 couples[nCpl++] =
labelPair(facei, coupledFace[facei]);
1551 Info<<
"Found " << nCouples <<
" baffles to keep together."
1606 blockedFace[baffle.
first()] =
false;
1607 blockedFace[baffle.
second()] =
false;
1615 specifiedProcessorFaces,
1623 Pout<<
"Wanted distribution:" << nProcCells <<
endl;
1628 Pout<<
"Wanted resulting decomposition:" <<
endl;
1629 forAll(nProcCells, proci)
1631 Pout<<
" " << proci <<
'\t' << nProcCells[proci] <<
endl;
1645 mesh_.setInstance(
name());
1646 setInstance(mesh_.facesInstance());
1655 label nBoundaryFaces = 0;
1657 forAll(surfaceIndex_, facei)
1659 if (surfaceIndex_[facei] != -1)
1668 forAll(surfaceIndex_, facei)
1670 if (surfaceIndex_[facei] != -1)
1672 surfaceFaces[nBoundaryFaces++] = facei;
1675 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;
1761 nFaces += pp.size();
1776 addressing[nFaces++] = meshFacei++;
1802 pointPatches.
size(),
1803 slipPointPatchVectorField::typeName
1808 patchFieldTypes[adaptPatchIDs[i]] =
1809 fixedValuePointPatchVectorField::typeName;
1814 if (isA<processorPointPatch>(pointPatches[
patchi]))
1816 patchFieldTypes[
patchi] = calculatedPointPatchVectorField::typeName;
1818 else if (isA<cyclicPointPatch>(pointPatches[
patchi]))
1820 patchFieldTypes[
patchi] = cyclicSlipPointPatchVectorField::typeName;
1830 "pointDisplacement",
1859 <<
"faceZones are not synchronised on processors." <<
nl
1860 <<
"Processor " << proci <<
" has faceZones "
1861 << zoneNames[proci] <<
nl
1863 <<
" has faceZones "
1877 const faceZone& fZone = fZones[zonei];
1885 if (faceToZone[bFacei] == -1)
1887 faceToZone[bFacei] = zonei;
1889 else if (faceToZone[bFacei] == zonei)
1892 <<
"Face " << fZone[i] <<
" in zone "
1894 <<
" is twice in zone!"
1900 <<
"Face " << fZone[i] <<
" in zone "
1902 <<
" is also in zone "
1903 << fZones[faceToZone[bFacei]].
name()
1915 if (faceToZone[i] != neiFaceToZone[i])
1919 <<
" is in zone " << faceToZone[i]
1920 <<
", its coupled face is in zone " << neiFaceToZone[i]
1945 const edge&
e = edges[edgei];
1951 pts[meshPoints[
e[1]]]
1952 - pts[meshPoints[
e[0]]]
1955 edgeWeights[edgei] = 1.0/eMag;
1971 forAll(invSumWeight, pointi)
1973 scalar w = invSumWeight[pointi];
1977 invSumWeight[pointi] = 1.0/w;
2010 if (isA<processorPolyPatch>(pp))
2018 patchDict.
set(
"nFaces", 0);
2019 patchDict.
set(
"startFace", 0);
2041 meshedPatches_.append(
name);
2053 forAll(meshedPatches_, i)
2060 <<
"Problem : did not find patch " << meshedPatches_[i]
2061 <<
endl <<
"Valid patches are " <<
patches.names()
2089 selected[cpp.
start() + i] =
true;
2101 const vector& perturbVec,
2102 const point& location
2109 regioni = cellRegion[celli];
2116 celli = mesh.
findCell(location + perturbVec);
2119 regioni = cellRegion[celli];
2132 const vector& perturbVec,
2139 if (selectionPoints.
outside().size())
2143 selectedCells =
true;
2150 const label regioni = findRegion
2159 forAll(cellRegion, celli)
2161 if (cellRegion[celli] == regioni)
2163 selectedCells[celli] =
false;
2174 const label regioni = findRegion
2179 selectionPoints.
inside()[i]
2183 forAll(cellRegion, celli)
2185 if (cellRegion[celli] == regioni)
2187 selectedCells[celli] =
true;
2193 forAll(selectedCells, celli)
2195 if (!selectedCells[celli])
2197 cellRegion[celli] = -1;
2211 (void)mesh_.tetBasePtIs();
2216 boolList blockedFace(mesh_.nFaces(),
false);
2217 selectSeparatedCoupledFaces(blockedFace);
2234 forAll(cellRegion, celli)
2236 if (cellRegion[celli] == -1)
2238 cellsToRemove.
append(celli);
2245 cellsToRemove.
size(),
2251 label nCellsToKeep = mesh_.nCells() - cellsToRemove.
size();
2254 Info<<
"Keeping all cells in regions containing any point in "
2256 <<
"Selected for keeping : " << nCellsToKeep <<
" cells." <<
endl;
2268 const label nExposedFaces =
2274 label defaultPatch = 0;
2275 if (globalToMasterPatch.
size())
2277 defaultPatch = globalToMasterPatch[0];
2281 <<
"Removing non-reachable cells exposes "
2282 << nExposedFaces <<
" internal or coupled faces." <<
endl
2283 <<
" These get put into patch " << defaultPatch <<
endl;
2285 exposedPatch.
setSize(exposedFaces.
size(), defaultPatch);
2288 return doRemoveCells
2310 meshCutter_.distribute(map);
2336 geometry[i].distribute
2347 geometry[i].instance() = geometry[i].time().name();
2365 topoChange(map, changedFaces, dummyMap, dummyMap, dummyMap);
2377 meshCutter_.storeData
2398 meshCutter_.topoChange
2410 updateIntersections(changedFaces);
2417 if (userFaceData_[i].
first() == KEEPALL)
2422 else if (userFaceData_[i].
first() == MASTERONLY)
2427 forAll(newFaceData, facei)
2433 newFaceData[facei] =
data[oldFacei];
2453 if (reverseFaceMap[oldFacei] != facei)
2456 reverseFaceMap[oldFacei] = -1;
2463 forAll(newFaceData, facei)
2469 if (reverseFaceMap[oldFacei] == facei)
2471 newFaceData[facei] =
data[oldFacei];
2483 bool writeOk = mesh_.write();
2500 s.instance() !=
s.time().system()
2501 &&
s.instance() !=
s.time().caseSystem()
2502 &&
s.instance() !=
s.time().constant()
2503 &&
s.instance() !=
s.time().caseConstant()
2507 s.instance() =
s.time().name();
2508 writeOk = writeOk &&
s.write();
2525 forAll(meshPoints, pointi)
2541 forAll(meshPoints, pointi)
2545 isPatchMasterPoint[pointi] =
true;
2549 return isPatchMasterPoint;
2564 myEdges[edgei] = globalEdges.
toGlobal(edgei);
2580 if (myEdges[edgei] == globalEdges.
toGlobal(edgei))
2582 isMasterEdge[edgei] =
true;
2586 return isMasterEdge;
2598 <<
" : cells(local):" << mesh_.nCells()
2599 <<
" faces(local):" << mesh_.nFaces()
2600 <<
" points(local):" << mesh_.nPoints()
2606 label nMasterFaces = 0;
2609 if (isMasterFace[i])
2616 label nMasterPoints = 0;
2617 forAll(isMeshMasterPoint, i)
2619 if (isMeshMasterPoint[i])
2635 const labelList& cellLevel = meshCutter_.cellLevel();
2641 nCells[cellLevel[celli]]++;
2647 Info<<
"Cells per refinement level:" <<
endl;
2650 Info<<
" " << leveli <<
'\t' << nCells[leveli]
2659 if (overwrite_ && mesh_.time().timeIndex() == 0)
2661 return oldInstance_;
2665 return mesh_.time().name();
2680 mesh_.time().name(),
2690 const labelList& cellLevel = meshCutter_.cellLevel();
2692 forAll(volRefLevel, celli)
2694 volRefLevel[celli] = cellLevel[celli];
2697 volRefLevel.
write();
2709 mesh_.time().name(),
2719 const labelList& pointLevel = meshCutter_.pointLevel();
2721 forAll(pointRefLevel, pointi)
2723 pointRefLevel[pointi] = pointLevel[pointi];
2726 pointRefLevel.
write();
2734 const pointField& cellCentres = mesh_.cellCentres();
2736 OFstream str(prefix +
"_edges.obj");
2738 Pout<<
"meshRefinement::dumpIntersections :"
2739 <<
" Writing cellcentre-cellcentre intersections to file "
2747 labelList neiLevel(mesh_.nFaces() - mesh_.nInternalFaces());
2748 pointField neiCc(mesh_.nFaces() - mesh_.nInternalFaces());
2749 calcNeighbourData(neiLevel, neiCc);
2751 labelList intersectionFaces(intersectedFaces());
2757 forAll(intersectionFaces, i)
2759 const label facei = intersectionFaces[i];
2760 start[i] = cellCentres[mesh_.faceOwner()[facei]];
2762 if (mesh_.isInternalFace(facei))
2764 end[i] = cellCentres[mesh_.faceNeighbour()[facei]];
2768 end[i] = neiCc[facei-mesh_.nInternalFaces()];
2774 const vectorField smallVec(rootSmall*(end-start));
2783 surfaces_.findAnyIntersection
2791 forAll(intersectionFaces, i)
2793 if (surfaceHit[i] != -1)
2801 str <<
"l " << vertI-2 <<
' ' << vertI-1 <<
nl
2802 <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
2818 if (writeFlags & WRITEMESH)
2823 if (writeFlags && !(writeFlags & NOWRITEREFINEMENT))
2825 meshCutter_.write();
2826 surfaceIndex_.write();
2829 if (writeFlags & WRITELEVELS)
2831 dumpRefinementLevel();
2834 if (debugFlags & OBJINTERSECTIONS && prefix.size())
2836 dumpIntersections(prefix);
2849 writeLevel_ = flags;
2855 return outputLevel_;
2861 outputLevel_ = flags;
#define forAll(list, i)
Loop across all elements in list.
static pointMesh & New(const polyMesh &mesh)
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 >> &)
Return a temporary field constructed from name,.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const word & name() const
Return name.
A List with indirect addressing.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
wordList names() const
Return a list of zone names.
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 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.
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.
Database for solution and other reduced data.
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....
void transfer(dictionary &)
Transfer the contents of the argument and annul the argument.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
void set(entry *)
Assign a new entry, overwrite any existing entry.
Accumulating histogram of values. Specified bin resolution automatic generation of bins.
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.
const boolList & flipMap() const
Return face flip map.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
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 whichPatch(const label faceIndex) const
Return patch index for a given face label.
label findPatchID(const word &patchName) const
Find patch index given a name.
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.
const meshFaceZones & faceZones() const
Return face zones.
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 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 inflate, 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, const label zoneID, const bool zoneFlip)
Modify vertices or cell of face.
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 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 asymetrically extended bounding box, with guaranteed.
A class for handling words, derived from string.
const word & name() const
Return name.
#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.
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.
word name(const complex &)
Return a string representation of a complex.
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))