43 #ifndef meshRefinement_H 44 #define meshRefinement_H 62 class mapDistributePolyMesh;
63 class decompositionMethod;
64 class refinementSurfaces;
65 class refinementFeatures;
66 class refinementRegions;
68 class fvMeshDistribute;
69 class searchableSurface;
73 class localPointRegion;
166 const scalar mergeDistance_;
169 const bool overwrite_;
172 const word oldInstance_;
208 void calcNeighbourData
215 void updateIntersections(
const labelList& changedFaces);
235 const label exposedPatchi
244 static bool markForRefine
246 const label markValue,
247 const label nAllowRefine,
254 void markFeatureCellLevel
262 label markFeatureRefinement
265 const label nAllowRefine,
272 label markInternalDistanceToFeatureRefinement
274 const label nAllowRefine,
280 label markInternalRefinement
282 const label nAllowRefine,
295 label markSurfaceRefinement
297 const label nAllowRefine,
309 const scalar tol = 1
e-6
315 label markSurfaceCurvatureRefinement
317 const scalar curvature,
318 const label nAllowRefine,
328 const scalar planarCos,
329 const label nAllowRefine,
331 const label surfaceLevel,
333 const vector& surfaceNormal,
346 label markProximityRefinement
348 const scalar curvature,
349 const label nAllowRefine,
362 const bool allowBoundary,
368 void getBafflePatches
383 const label ownPatch,
384 const label nbrPatch,
392 void markBoundaryFace
419 const scalar minFaceArea,
420 const scalar maxNonOrtho,
427 const scalar volFraction,
437 const bool removeEdgeConnectedCells,
449 labelList markFacesOnProblemCellsGeometric
463 const scalar freeStandingAngle
473 void findCellZoneGeometric
484 void findCellZoneInsideWalk
493 bool calcRegionToZone
495 const label surfZoneI,
496 const label ownRegion,
497 const label neiRegion,
504 void findCellZoneTopo
506 const point& keepPoint,
514 void makeConsistentFaceIndex
521 void handleSnapProblems
524 const bool useTopologicalSnapDetection,
525 const bool removeEdgeConnectedCells,
547 void calcPatchNumMasterFaces
564 void consistentOrientation
614 return mergeDistance_;
656 return surfaceIndex_;
661 return surfaceIndex_;
670 return userFaceData_;
675 return userFaceData_;
690 const bool keepZoneFaces,
691 const bool keepBaffles,
777 const scalar curvature,
778 const scalar planarAngle,
780 const bool featureRefinement,
781 const bool featureDistanceRefinement,
782 const bool internalRefinement,
783 const bool surfaceRefinement,
784 const bool curvatureRefinement,
785 const bool gapRefinement,
786 const label maxGlobalCells,
787 const label maxLocalCells
800 const scalar maxLoadUnbalance
810 const scalar maxLoadUnbalance
819 const bool handleSnapProblems,
823 const bool useTopologicalSnapDetection,
824 const bool removeEdgeConnectedCells,
828 const bool mergeFreeStanding,
829 const scalar freeStandingAngle,
835 const point& keepPoint
842 const label nBufferLayers,
845 const point& keepPoint
885 const point& keepPoint,
886 const bool allowFreeStandingZoneFaces
915 const point& keepPoint
975 const scalar concaveCos,
1009 const scalar minCos,
1113 template<
class Enum>
const labelList & surfaceIndex() const
Per start-end edge the index of the surface hit.
void printMeshInfo(const bool, const string &) const
Print some mesh stats.
const refinementSurfaces & surfaces() const
Reference to surface search engines.
void checkZoneFaces() const
Debug helper: check faceZones are not on processor patches.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
IOoutputType
Enumeration for what to output.
A class for handling file names.
const List< Tuple2< mapType, labelList > > & userFaceData() const
Additional face data that is maintained across.
labelList refineCandidates(const pointField &keepPoints, const scalar curvature, const scalar planarAngle, const bool featureRefinement, const bool featureDistanceRefinement, const bool internalRefinement, const bool surfaceRefinement, const bool curvatureRefinement, const bool gapRefinement, const label maxGlobalCells, const label maxLocalCells) const
Calculate list of cells to refine.
autoPtr< mapDistributePolyMesh > balanceAndRefine(const string &msg, decompositionMethod &decomposer, fvMeshDistribute &distributor, const labelList &cellsToRefine, const scalar maxLoadUnbalance)
Balance before refining some cells.
const word & oldInstance() const
(points)instance of mesh upon construction
label countHits() const
Count number of intersections (local)
A list of keyword definitions, which are a keyword followed by any number of values (e...
IOdebugType
Enumeration for what to debug.
bool overwrite() const
Overwrite the mesh?
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
label mergePatchFacesUndo(const scalar minCos, const scalar concaveCos, const labelHashSet &patchIDs, const dictionary &motionDict, const labelList &preserveFaces)
Merge coplanar faces. preserveFaces is != -1 for faces.
static label findRegion(const polyMesh &, const labelList &cellRegion, const vector &perturbVec, const point &p)
Find region point is in. Uses optional perturbation to re-test.
static const NamedEnum< IOoutputType, 1 > IOoutputTypeNames
void operator=(const meshRefinement &)=delete
Disallow default bitwise assignment.
Given list of cells to remove insert all the topology changes.
autoPtr< mapPolyMesh > createZoneBaffles(const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, List< labelPair > &)
Create baffles for faces straddling zoned surfaces. Return.
labelList intersectedFaces() const
Get faces with intersection.
static writeType writeLevel()
Get/set write level.
Encapsulates queries for volume refinement ('refine all cells within shell').
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
void baffleAndSplitMesh(const bool handleSnapProblems, const snapParameters &snapParams, const bool useTopologicalSnapDetection, const bool removeEdgeConnectedCells, const scalarField &perpendicularAngle, const bool mergeFreeStanding, const scalar freeStandingAngle, const dictionary &motionDict, Time &runTime, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const point &keepPoint)
Split off unreachable areas of mesh.
autoPtr< mapPolyMesh > splitMesh(const label nBufferLayers, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const point &keepPoint)
Split off (with optional buffer layers) unreachable areas.
set value to -1 any face that was refined
labelList intersectedPoints() const
Get points on surfaces with intersection and boundary faces.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
labelList collectFaces(const labelList &candidateFaces, const labelHashSet &set) const
autoPtr< mapPolyMesh > splitMeshRegions(const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const point &keepPoint)
Split mesh. Keep part containing point.
Takes mesh with 'baffles' (= boundary faces sharing points). Determines for selected points on bounda...
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
const fvMesh & mesh() const
Reference to mesh.
IOwriteType
Enumeration for what to write.
Container for data on surfaces used for surface-driven refinement. Contains all the data about the le...
Mesh representing a set of points created from polyMesh.
label mergeEdgesUndo(const scalar minCos, const dictionary &motionDict)
Merge edges, maintain mesh quality. Return global number.
autoPtr< mapPolyMesh > mergeBaffles(const List< labelPair > &)
Merge baffles. Gets pairs of faces.
Encapsulates queries for features.
void distribute(const mapDistributePolyMesh &)
Update local numbering for mesh redistribution.
static void updateList(const labelList &newToOld, const T &nullValue, List< T > &elems)
Helper: reorder list according to map.
A list of faces which address into the list of points.
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
ClassName("meshRefinement")
Runtime type information.
static void weightedSum(const polyMesh &mesh, const PackedBoolList &isMasterEdge, const labelList &meshPoints, const edgeList &edges, const scalarField &edgeWeights, const Field< Type > &data, Field< Type > &sum)
Helper: weighted sum (over all subset of mesh points) by.
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)
autoPtr< mapDistributePolyMesh > refineAndBalance(const string &msg, decompositionMethod &decomposer, fvMeshDistribute &distributor, const labelList &cellsToRefine, const scalar maxLoadUnbalance)
Refine some cells and rebalance.
autoPtr< mapPolyMesh > splitFaces(const labelList &splitFaces, const labelPairList &splits)
Split faces into two.
Refinement of (split) hexes using polyTopoChange.
A class for handling words, derived from string.
static PackedBoolList getMasterEdges(const polyMesh &mesh, const labelList &meshEdges)
Determine master edge for subset of edges. If coupled.
Simple container to keep together snap specific information.
static const NamedEnum< IOdebugType, 5 > IOdebugTypeNames
static void checkCoupledFaceZones(const polyMesh &)
Helper function: check that face zones are synced.
void testSyncBoundaryFaceList(const scalar mergeDistance, const string &, const UList< T > &, const UList< T > &) const
Compare two lists over all boundary faces.
Abstract base class for decomposition.
autoPtr< mapDistributePolyMesh > balance(const bool keepZoneFaces, const bool keepBaffles, const scalarField &cellWeights, decompositionMethod &decomposer, fvMeshDistribute &distributor)
Redecompose according to cell count.
Container with cells to refine. Refinement given as single direction.
autoPtr< mapPolyMesh > doRemovePoints(removePoints &pointRemover, const boolList &pointCanBeDeleted)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const refinementFeatures & features() const
Reference to feature edge mesh.
word timeName() const
Replacement for Time::timeName() : return oldInstance (if.
mapType
Enumeration for how the userdata is to be mapped upon refinement.
const hexRef8 & meshCutter() const
Reference to meshcutting engine.
autoPtr< mapPolyMesh > createBaffles(const labelList &ownPatch, const labelList &nbrPatch)
Create baffle for every internal face where ownPatch != -1.
void checkData()
Debugging: check that all faces still obey start()>end()
static int readFlags(const Enum &namedEnum, const wordList &)
Helper: convert wordList into bit pattern using provided.
Database for solution and other reduced data.
label addMeshedPatch(const word &name, const dictionary &)
Add patch originating from meshing. Update meshedPatches_.
labelList meshedPatches() const
Get patchIDs for patches added in addMeshedPatch.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
autoPtr< mapPolyMesh > doRestorePoints(removePoints &pointRemover, const labelList &facesToRestore)
static autoPtr< indirectPrimitivePatch > makePatch(const polyMesh &, const labelList &)
Create patch from set of patches.
static outputType outputLevel()
Get/set output level.
word name(const complex &)
Return a string representation of a complex.
void updateMesh(const mapPolyMesh &, const labelList &changedFaces)
Update for external change to mesh. changedFaces are in new mesh.
scalar mergeDistance() const
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
autoPtr< mapPolyMesh > refine(const labelList &cellsToRefine)
Refine some cells.
void setInstance(const fileName &)
Set instance of all local IOobjects.
static void collectAndPrint(const UList< point > &points, const UList< T > &data)
Print list according to (collected and) sorted coordinate.
autoPtr< mapPolyMesh > dupNonManifoldPoints()
Find boundary points that connect to more than one cell.
static T gAverage(const PackedBoolList &isMasterElem, const UList< T > &values)
Helper: calculate average.
void storeData(const labelList &pointsToStore, const labelList &facesToStore, const labelList &cellsToStore)
Signal points/face/cells for which to store data.
autoPtr< mapPolyMesh > zonify(const point &keepPoint, const bool allowFreeStandingZoneFaces)
Put faces/cells into zones according to surface specification.
static void testSyncPointList(const string &msg, const polyMesh &mesh, const List< scalar > &fld)
have slaves (upon refinement) from master
labelList growFaceCellFace(const labelHashSet &set) const
const refinementRegions & shells() const
Reference to refinement shells (regions)
Mesh data needed to do the Finite Volume discretisation.
Direct mesh changes based on v1.3 polyTopoChange syntax.
void selectSeparatedCoupledFaces(boolList &) const
Select coupled faces that are not collocated.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
const doubleScalar e
Elementary charge.
Removes selected points from mesh and updates faces using these points.
Mesh consisting of general polyhedral cells.
bool isGap(const scalar, const vector &, const vector &, const vector &, const vector &) const
Is local topology a small gap?
Contains information about location on a triSurface.
bool write() const
Write mesh and all data.
meshRefinement(fvMesh &mesh, const scalar mergeDistance, const bool overwrite, const refinementSurfaces &, const refinementFeatures &, const refinementRegions &)
Construct from components.
static tmp< pointVectorField > makeDisplacementField(const pointMesh &pMesh, const labelList &adaptPatchIDs)
Helper function to make a pointVectorField with correct.
A class for managing temporary objects.
static PackedBoolList getMasterPoints(const polyMesh &mesh, const labelList &meshPoints)
Determine master point for subset of points. If coupled.
void dumpIntersections(const fileName &prefix) const
Debug: Write intersection information to OBJ format.
void dumpRefinementLevel() const
Write refinement level as volScalarFields for postprocessing.
bool isNormalGap(const scalar, const vector &, const vector &, const vector &, const vector &) const
Is local topology a small gap normal to the test vector.
static const NamedEnum< IOwriteType, 5 > IOwriteTypeNames
A HashTable to objects of type <T> with a label key.