43 #ifndef meshRefinement_H 44 #define meshRefinement_H 62 class mapDistributePolyMesh;
63 class decompositionMethod;
64 class refinementSurfaces;
65 class refinementFeatures;
68 class fvMeshDistribute;
69 class searchableSurface;
73 class localPointRegion;
166 const scalar mergeDistance_;
169 const bool overwrite_;
172 const word oldInstance_;
200 template<
class GeoField>
201 static void addPatchFields(
fvMesh&,
const word& patchFieldType);
204 template<
class GeoField>
216 void calcNeighbourData
223 void updateIntersections(
const labelList& changedFaces);
243 const label exposedPatchi
252 static bool markForRefine
254 const label markValue,
255 const label nAllowRefine,
262 void markFeatureCellLevel
270 label markFeatureRefinement
273 const label nAllowRefine,
280 label markInternalDistanceToFeatureRefinement
282 const label nAllowRefine,
288 label markInternalRefinement
290 const label nAllowRefine,
303 label markSurfaceRefinement
305 const label nAllowRefine,
317 const scalar tol = 1
e-6
323 label markSurfaceCurvatureRefinement
325 const scalar curvature,
326 const label nAllowRefine,
336 const scalar planarCos,
337 const label nAllowRefine,
339 const label surfaceLevel,
341 const vector& surfaceNormal,
354 label markProximityRefinement
356 const scalar curvature,
357 const label nAllowRefine,
370 const bool allowBoundary,
376 void getBafflePatches
391 const label ownPatch,
392 const label neiPatch,
400 void markBoundaryFace
427 const scalar minFaceArea,
428 const scalar maxNonOrtho,
435 const scalar volFraction,
445 const bool removeEdgeConnectedCells,
457 labelList markFacesOnProblemCellsGeometric
471 const scalar freeStandingAngle
481 void findCellZoneGeometric
492 void findCellZoneInsideWalk
501 bool calcRegionToZone
503 const label surfZoneI,
504 const label ownRegion,
505 const label neiRegion,
512 void findCellZoneTopo
514 const point& keepPoint,
522 void makeConsistentFaceIndex
529 void handleSnapProblems
532 const bool useTopologicalSnapDetection,
533 const bool removeEdgeConnectedCells,
555 void calcPatchNumMasterFaces
572 void consistentOrientation
625 return mergeDistance_;
667 return surfaceIndex_;
672 return surfaceIndex_;
681 return userFaceData_;
686 return userFaceData_;
701 const bool keepZoneFaces,
702 const bool keepBaffles,
788 const scalar curvature,
789 const scalar planarAngle,
791 const bool featureRefinement,
792 const bool featureDistanceRefinement,
793 const bool internalRefinement,
794 const bool surfaceRefinement,
795 const bool curvatureRefinement,
796 const bool gapRefinement,
797 const label maxGlobalCells,
798 const label maxLocalCells
811 const scalar maxLoadUnbalance
821 const scalar maxLoadUnbalance
830 const bool handleSnapProblems,
834 const bool useTopologicalSnapDetection,
835 const bool removeEdgeConnectedCells,
839 const bool mergeFreeStanding,
840 const scalar freeStandingAngle,
846 const point& keepPoint
853 const label nBufferLayers,
856 const point& keepPoint
896 const point& keepPoint,
897 const bool allowFreeStandingZoneFaces
907 const label insertPatchi,
939 const point& keepPoint
999 const scalar concaveCos,
1033 const scalar minCos,
1137 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...
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
const shellSurfaces & shells() const
Reference to refinement shells (regions)
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.
autoPtr< mapPolyMesh > createBaffles(const labelList &ownPatch, const labelList &neiPatch)
Create baffle for every internal face where ownPatch != -1.
labelList intersectedFaces() const
Get faces with intersection.
static writeType writeLevel()
Get/set write level.
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...
static label addPatch(fvMesh &, const word &name, const dictionary &)
Helper:add patch to mesh. Update all registered fields.
Mesh representing a set of points created from polyMesh.
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.
static label appendPatch(fvMesh &, const label insertPatchi, const word &, const dictionary &)
Helper:append patch to end of mesh.
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.
Encapsulates queries for volume refinement ('refine all cells within shell').
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.
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 data, solver performance 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.
label mergePatchFacesUndo(const scalar minCos, const scalar concaveCos, const labelList &patchIDs, const dictionary &motionDict, const labelList &preserveFaces)
Merge coplanar faces. preserveFaces is != -1 for faces.
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
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.
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.