43 #ifndef meshRefinement_H 44 #define meshRefinement_H 63 class polyDistributionMap;
64 class decompositionMethod;
65 class refinementSurfaces;
66 class refinementFeatures;
67 class refinementRegions;
69 class fvMeshDistribute;
70 class searchableSurface;
74 class localPointRegion;
167 const scalar mergeDistance_;
170 const bool overwrite_;
173 const word oldInstance_;
209 void calcNeighbourData
216 void updateIntersections(
const labelList& changedFaces);
236 const label exposedPatchi
245 static bool markForRefine
247 const label markValue,
248 const label nAllowRefine,
255 void markFeatureCellLevel
263 label markFeatureRefinement
266 const label nAllowRefine,
273 label markInternalDistanceToFeatureRefinement
275 const label nAllowRefine,
281 label markInternalRefinement
283 const label nAllowRefine,
296 label markSurfaceRefinement
298 const label nAllowRefine,
310 const scalar tol = 1
e-6
316 label markSurfaceCurvatureRefinement
318 const scalar curvature,
319 const label nAllowRefine,
329 const scalar planarCos,
330 const label nAllowRefine,
332 const label surfaceLevel,
334 const vector& surfaceNormal,
347 label markProximityRefinement
349 const scalar curvature,
350 const label nAllowRefine,
363 const bool allowBoundary,
369 void getBafflePatches
384 const label ownPatch,
385 const label nbrPatch,
393 void markBoundaryFace
420 const scalar minFaceArea,
421 const scalar maxNonOrtho,
428 const scalar volFraction,
444 const bool removeEdgeConnectedCells,
456 labelList markFacesOnProblemCellsGeometric
470 const scalar freeStandingAngle
480 void findCellZoneGeometric
491 void findCellZoneInsideWalk
500 bool calcRegionToZone
502 const label surfZoneI,
503 const label ownRegion,
504 const label neiRegion,
511 void findCellZoneTopo
521 void makeConsistentFaceIndex
528 void handleSnapProblems
531 const bool useTopologicalSnapDetection,
532 const bool removeEdgeConnectedCells,
554 void calcPatchNumMasterFaces
571 void consistentOrientation
623 return mergeDistance_;
665 return surfaceIndex_;
670 return surfaceIndex_;
679 return userFaceData_;
684 return userFaceData_;
699 const bool keepZoneFaces,
700 const bool keepBaffles,
786 const scalar curvature,
787 const scalar planarAngle,
789 const bool featureRefinement,
790 const bool featureDistanceRefinement,
791 const bool internalRefinement,
792 const bool surfaceRefinement,
793 const bool curvatureRefinement,
794 const bool gapRefinement,
795 const label maxGlobalCells,
796 const label maxLocalCells
809 const scalar maxLoadUnbalance
819 const scalar maxLoadUnbalance
828 const bool handleSnapProblems,
832 const bool useTopologicalSnapDetection,
833 const bool removeEdgeConnectedCells,
837 const bool mergeFreeStanding,
838 const scalar freeStandingAngle,
851 const label nBufferLayers,
898 const bool allowFreeStandingZoneFaces
919 const point& location
997 const scalar concaveCos,
1031 const scalar minCos,
1135 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.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
void checkZoneFaces() const
Debug helper: check faceZones are not on processor patches.
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.
autoPtr< polyTopoChangeMap > createBaffles(const labelList &ownPatch, const labelList &nbrPatch)
Create baffle for every internal face where ownPatch != -1.
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...
autoPtr< polyTopoChangeMap > zonify(const List< point > &insidePoints, const bool allowFreeStandingZoneFaces)
Put faces/cells into zones according to surface specification.
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.
void topoChange(const polyTopoChangeMap &, const labelList &changedFaces)
Update for external change to mesh. changedFaces are in new mesh.
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< polyTopoChangeMap > splitFaces(const labelList &splitFaces, const labelPairList &splits)
Split faces into two.
autoPtr< polyTopoChangeMap > dupNonManifoldPoints()
Find boundary points that connect to more than one cell.
labelList intersectedFaces() const
Get faces with intersection.
static writeType writeLevel()
Get/set write level.
autoPtr< polyTopoChangeMap > createZoneBaffles(const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, List< labelPair > &)
Create baffles for faces straddling zoned surfaces. Return.
Encapsulates queries for volume refinement ('refine all cells within shell').
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.
autoPtr< polyTopoChangeMap > splitMesh(const label nBufferLayers, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const refinementParameters::cellSelectionPoints &selectionPoints)
Split off (with optional buffer layers) unreachable areas.
autoPtr< polyDistributionMap > balanceAndRefine(const string &msg, decompositionMethod &decomposer, fvMeshDistribute &distributor, const labelList &cellsToRefine, const scalar maxLoadUnbalance)
Balance before refining some cells.
labelList collectFaces(const labelList &candidateFaces, const labelHashSet &set) const
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.
meshRefinement(fvMesh &mesh, const dictionary &refineDict, const scalar mergeDistance, const bool overwrite, refinementSurfaces &, const refinementFeatures &, const refinementRegions &)
Construct from components.
labelList refineCandidates(const List< point > &insidePoints, 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.
Encapsulates queries for features.
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.
autoPtr< polyTopoChangeMap > refine(const labelList &cellsToRefine)
Refine some cells.
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)
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.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Simple container to keep together snap specific information.
autoPtr< polyDistributionMap > refineAndBalance(const string &msg, decompositionMethod &decomposer, fvMeshDistribute &distributor, const labelList &cellsToRefine, const scalar maxLoadUnbalance)
Refine some cells and rebalance.
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.
Container with cells to refine. Refinement given as single direction.
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.
autoPtr< polyTopoChangeMap > doRemovePoints(removePoints &pointRemover, const boolList &pointCanBeDeleted)
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 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.
autoPtr< polyDistributionMap > balance(const bool keepZoneFaces, const bool keepBaffles, const scalarField &cellWeights, decompositionMethod &decomposer, fvMeshDistribute &distributor)
Redecompose according to cell count.
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 refinementParameters::cellSelectionPoints &selectionPoints)
Split off unreachable areas of mesh.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
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.
scalar mergeDistance() const
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
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.
void distribute(const polyDistributionMap &)
Update local numbering for mesh redistribution.
static T gAverage(const PackedBoolList &isMasterElem, const UList< T > &values)
Helper: calculate average.
autoPtr< polyTopoChangeMap > splitMeshRegions(const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const refinementParameters::cellSelectionPoints &selectionPoints)
Split mesh according to selectionPoints.
void storeData(const labelList &pointsToStore, const labelList &facesToStore, const labelList &cellsToStore)
Signal points/face/cells for which to store data.
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.
static void findRegions(const polyMesh &, labelList &cellRegion, const vector &perturbVec, const refinementParameters::cellSelectionPoints &selectionPoints)
Find regions points are in and update cellRegion.
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.
autoPtr< polyTopoChangeMap > mergeBaffles(const List< labelPair > &)
Merge baffles. Gets pairs of faces.
void dumpIntersections(const fileName &prefix) const
Debug: Write intersection information to OBJ format.
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.
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.
Class to hold the points to select cells inside and outside.
autoPtr< polyTopoChangeMap > doRestorePoints(removePoints &pointRemover, const labelList &facesToRestore)