74 return m_pCells [cellId].m_noSolidLayer_[solver];
88 return m_pCells [cellId].m_coordinates_[dim];
94 return m_pCells [cellId].m_childIds_[position];
111 return m_pCells [cellId].m_nghbrIds_[position];
116 return m_pCells [cellId].b_solverAffiliation_[solver];
120 return m_pCells [cellId].b_solverAffiliation_[solver];
125 return m_pCells [cellId].b_solverBoundary_[solver];
129 return m_pCells [cellId].b_solverBoundary_[solver];
134 return m_pCells [cellId].b_solverToRefine_[solver];
138 return m_pCells [cellId].b_solverToRefine_[solver];
197 std::vector<std::vector<MInt>>& haloCellIdsPerDomain);
199 std::vector<std::vector<MInt>>& haloCellIdsPerDomain);
233 const MFloat*
const leftCoord,
234 const MFloat*
const rightCoord,
235 const MFloat*
const leftNormal,
236 const MFloat*
const rightNormal,
237 const MFloat*
const normalDifforigAB,
241 const MFloat*
const leftCoord,
242 const MFloat*
const rightCoord,
243 const MFloat*
const normalDiffAB,
244 const MFloat*
const normalDiffBA,
246 const MFloat innerRadius);
void communicateDouble(MFloatScratchSpace &recvBuffer, MIntScratchSpace &noCellsToReceive, MFloatScratchSpace &sendBuffer, MIntScratchSpace &noCellsToSend)
Communicates an array of double values.
void findChildLevelNeighbors(MInt **offsets, MInt level_)
updates the children of a given level
MBool isInsideSlicedCone(const MFloat *const pointCoord, const MFloat *const leftCoord, const MFloat *const rightCoord, const MFloat *const leftNormal, const MFloat *const rightNormal, const MFloat *const normalDifforigAB, const MFloat leftR, const MFloat rightR)
checks if point (cell) is inside a sliced cone
void updateOffsets(MInt gridLevel)
updates the offsets
MFloat m_partitionCellWorkloadThreshold
GridgenCell< nDim > * m_pCells
MInt nghborStencil(MInt, MInt)
SolverRefinement * m_solverRefinement
void communicateInt(MIntScratchSpace &recvBuffer, MIntScratchSpace &noCellsToReceive, MIntScratchSpace &sendBuffer, MIntScratchSpace &noCellsToSend)
Communicates an array of int values.
void traverseDFGlobalId(MInt parentId, MLong *globalId_, MLongScratchSpace &partitionCellList, MFloatScratchSpace &workloadPerCell, MFloat *currentWorkload, MFloatScratchSpace &weight, MFloatScratchSpace &workload, MInt *j)
recursively traverses the octree
MInt m_t_createComputationalGrid
void checkMemoryAvailability(MInt stage, MInt level_)
void markInsideOutside(MInt **offsets, MInt level_)
marks inside and outside cells
MInt * m_noPartitionCellsPerDomain
MBool isInsideCylinder(const MFloat *const pointCoord, const MFloat *const leftCoord, const MFloat *const rightCoord, const MFloat *const normalDiffAB, const MFloat *const normalDiffBA, const MFloat radius, const MFloat innerRadius)
checks if point (cell) is inside a cylinder
void copyCell(MInt from, MInt to)
moves a cell from one location in the collector to another
void communicateLong(MLongScratchSpace &recvBuffer, MIntScratchSpace &noCellsToReceive, MLongScratchSpace &sendBuffer, MIntScratchSpace &noCellsToSend)
Communicates an array of int values.
void saveGridDomain(MInt level_, MInt tag)
degugging function writing the grid in serial
MFloat & a_coordinate(const MInt cellId, const MInt dim)
Returns the coordinate of the cell cellId for dimension dim.
Collector< GridgenCell< nDim > > * m_cells
static void quickSort(T *globalIdArray, MInt *lookup, MInt startindex, MInt endindex)
sorts a list of integers and updates a second one
MInt ** m_haloCellOffsets
MLong m_partitionCellOffspringThreshold
MInt m_initialRefinementLevelSerial
void deleteCoarseSolidCellsSerial()
performs deleting solid cells lower than maxRefinementLevel
void markSolverAffiliation(MInt level_)
marks cells without solver affiliation as outside cells
MInt getLastNonWindowCell(MInt no_consider, MInt last)
MBool m_weightSolverUniformLevel
const MFloat & a_coordinate(const MInt cellId, const MInt dim) const
Returns the coordinate of the cell cellId for dimension dim.
void markLocalCylinder(MInt level_, MInt patch, MInt solver, MString patchStr)
marks cells that lie in a cylinder-type patch
MBool m_writeCoordinatesToGridFile
std::vector< MFloat > m_multiSolverBoundingBox
const MInt & a_noSolidLayer(const MInt cellId, const MInt solver) const
Returns the solid layer of the cell cellId.
void markLocalFlatCone(MInt level_, MInt patch, MInt solver)
void refineComputationalGrid(MInt lvl)
refines cells of the computational grid that are marked for refinement
void markLocalBox(MInt level_, MInt patch, MInt solver)
marks cells that lie in a box-type patch
MInt m_maxUniformRefinementLevel
void initMembers()
initializes the member variables
MString m_targetGridFileName
MChar a_isSolverBoundary(const MInt cellId, const MInt solver) const
Multisolver grid: does a cell belong to a certain solver.
MInt getAdjacentGridCells(MInt cellId, MInt *adjacentCells)
Retrieves all direct and diagonal neighboring cells of the given cell.
MLong & a_globalId(const MInt cellId)
Returns the globalId of the cell cellId.
void propagationStep(MInt cellId, MInt rfnDistance, MInt finalDistance, MInt solver)
recursivley marks the cells with a distance
void updateHaloOffsets(MInt l, MInt noHalos, MInt *rfnCountHalosDom)
updates the offsets of the halos
void markLocalRectangleAngled(MInt level_, MInt patch, MInt solver)
marks cells that lie in a rectangular-angled-type patch
MChar a_isInSolver(const MInt cellId, const MInt solver) const
Multisolver grid: does a cell belong to a certain solver.
void checkNeighborhood(MInt level_)
checks if the neighborhood is correct
MInt * m_noBndIdsPerSolver
MLong & a_parentId(const MInt cellId)
Returns the parent of the cell cellId.
void communicateIntToNeighbors(MIntScratchSpace &recvMem, MIntScratchSpace &noCellsToReceive, MIntScratchSpace &sendMem, MIntScratchSpace &noCellsToSend, MInt noVar)
Communicates Int values, with a variable nmbr of variables to the Neighbors.
void createComputationalMultisolverGrid()
refinement > minLevel is processed in createComputationalMultisolverGrid
const MLong & a_neighborId(const MInt cellId, const MInt position) const
Returns the neighbor id of the cell cellId position.
MFloat * m_centerOfGravity
void performCutOff(MInt **offsets, MInt level_, MBool deleteMode=false)
performs a cut-off defined by the properties
MLong & a_childId(const MInt cellId, const MInt position)
Returns the child id of the cell cellId position.
MBool m_writeGridInformation
void deleteCellReferences(MInt cell, MInt pos)
deletes the references of a given cell
void initGeometry()
initializes the geometry
MChar a_isToRefineForSolver(const MInt cellId, const MInt solver) const
Multisolver grid: does a cell belong to a certain solver.
MChar & a_isToRefineForSolver(const MInt cellId, const MInt solver)
Multisolver grid: does a cell belong to a certain solver.
MInt & a_noChildren(const MInt cellId)
Returns the no. of children of the cell cellId.
MInt & a_noSolidLayer(const MInt cellId, const MInt solver)
Returns the solid layer of the cell cellId.
MFloat * m_geometryExtents
MString m_parallelGeomFileName
MBool m_hasMultiSolverBoundingBox
GeometryRoot * m_geometry
MBool m_checkGridLbValidity
std::vector< std::tuple< MInt, MLong, MFloat > > m_partitionCellList
MInt & a_refinementDistance(const MInt cellId)
Returns rfnDistance of the cell cellId position.
void deleteOutsideCellsSerial(MInt level_)
deletes the cells outside of the geometry
void markLocalRadius(MInt level_, MInt patch, MInt solver)
marks cells that lie in a sphere-type patch
void markBndForSolverRefinement(MInt level_, MInt solver)
MInt m_keepOutsideBndryCellChildren
void checkNeighborhoodDistance(MInt level_)
checks if the distance between neighboring cells is alright
void checkNeighborhoodIntegrity(MInt level_)
checks if the neighborhood relation of the cells is alright
void excludeInsideOutside(MInt **offsets, MInt level_, MInt solver)
excludes obvious non solver affiliated cells from the inside outside flooding
void reorderCellsHilbert()
reorders the cells after Hilbert id
void swapCells(MInt cellId1, MInt cellId2)
swaps two cells in memory
void updateGlobalIdsReferences()
updates the references of all cells to use the global-ids
MString m_gridOutputFileName
void dynamicLoadBalancing()
Rebalances the grid dynamicaly while grid building.
void determineRankOffsets(MIntScratchSpace &offsets)
void readSolverProperties(MInt solver)
void findHaloAndWindowCells(std::vector< std::vector< MInt > > &winCellIdsPerDomain, std::vector< std::vector< MInt > > &haloCellIdsPerDomain)
find window cells using the known halo cells
void saveGrid()
writes the grid to file in parallel
MInt m_multiSolverMinLevel
void createSolidCellLayer(MInt cellId, MInt solidLayer, MInt finalLayer_)
const MInt & a_level(const MInt cellId) const
Returns the level of the cell cellId.
void deleteOutsideCellsParallel(MInt level_)
deletes outside cells in parallel mode
MInt * m_rfnCountHalosDom
MInt * m_noHaloCellsOnLevel
void checkLBRefinementValidity()
checks if this is a valid mesh also for LB computations
void keepOutsideBndryCellChildrenSerial(MInt *offsets, MInt level_)
const MInt & a_noChildren(const MInt cellId) const
Returns the no. of children of the cell cellId.
MBool pointIsInsideSolver(MFloat *coordinates, MInt solver)
void markLocalCartesianWedge(MInt level_, MInt patch, MInt solver)
void writeGridInformationPar()
writes a pseudo solution file with some grid information
const MLong & a_parentId(const MInt cellId) const
Returns the parent of the cell cellId.
void markLocalCone(MInt level_, MInt patch, MInt solver)
marks cells that lie in a cone-type patch with a smooth hat
const MLong & a_childId(const MInt cellId, const MInt position) const
Returns the child id of the cell cellId position.
MChar & a_hasProperty(const MInt cellId, const MInt p)
Returns property p of the cell cellId.
void markPatchForSolverRefinement(MInt level_, MInt solver)
void markLocalHat(MInt level_, MInt patch, MInt solver)
marks cells that lie in a cone-type patch with a smooth hat
MInt m_t_createInitialGrid
void communicateHaloGlobalIds(MInt level)
communicate the global ids of the halo cells.
MInt * m_noCellsPerDomain
void createStartGrid()
creates the start grid
MBool m_hasBeenLoadBalanced
MBool pointIsInside(MFloat *coordinates)
checks if a given point is inside the geometry
const MLong & a_globalId(const MInt cellId) const
Returns the globalId of the cell cellId.
void collectHaloChildren(MInt parentId, std::vector< MInt > *cellIdsPerDomain)
recursively traverse the tree depth-first and collect halo cells
void refineGridPatch(MInt **offsets, MInt level_, MBool halo)
refines the grid on a given level for a provided patch
void markLocalSolverRefinement(MInt level_, MInt solver)
void gridAlignCutOff()
aligns the cutOffCoordinates with the grid
MInt & a_level(const MInt cellId)
Returns the level of the cell cellId.
void collectWindowChildren(MInt parentId, std::vector< MInt > *cellIdsPerDomain)
recursively traverse the tree depth-first and collect window cells
void floodCells(std::stack< MInt > *fillStack, MChar marker)
floods cells
void readProperties()
reads necessary properties from the property file
void findHaloAndWindowCellsKD(std::vector< std::vector< MInt > > &winCellIdsPerDomain, std::vector< std::vector< MInt > > &haloCellIdsPerDomain)
finds halo and window cells using a kd tree
std::vector< MFloat > m_multiSolverCenterOfGravity
MChar & a_isInSolver(const MInt cellId, const MInt solver)
Multisolver grid: does a cell belong to a certain solver.
MChar a_hasProperty(const MInt cellId, const MInt p) const
Returns property p of the cell cellId.
void refineCell(MInt id, MInt *currentChildId)
refines a single cell
void markSolverForRefinement(MInt level_, MInt solver)
MInt m_t_updateInterRankNeighbors
void reorderGlobalIdsDF()
reorders the globalIds depth-first
void propagateDistance(MInt level_, MInt distance, std::vector< MInt > &rfnBoundaryGroup, MInt solver)
propagates the distance away from the boundary
Geometry< nDim > * m_STLgeometry
void concludeSolverRefinement(MInt level_)
void parallelizeGrid()
parallize the present grid
std::map< MInt, MInt > m_cellIdLUT
void checkLoadBalance(MInt in_level)
checks if a dynamic load balancing is needed.
MLong m_noTotalPartitionCells
MFloat m_multiSolverLengthLevel0
MLong & a_neighborId(const MInt cellId, const MInt position)
Returns the neighbor id of the cell cellId position.
void markBndDistance(MInt level_, MInt solver)
marks cells that lie in a certain distance to the boundary
void updateInterRankNeighbors()
updates the neighbors on the neighboring ranks
MBool checkCellForCut(MInt id)
checks if a cell has a cut with the geometry
void deleteCoarseSolidCellsParallel()
performs deleting solid cells lower than maxRefinementLevel
MInt ** m_haloCellOffsetsLevel
void keepOutsideBndryCellChildrenParallel(MInt level_)
void refineGrid(MInt **offsets, MInt level_, MBool halo)
refines the grid on a given level
MChar & a_isSolverBoundary(const MInt cellId, const MInt solver)
Multisolver grid: does a cell belong to a certain solver.
void setCellWeights(MFloatScratchSpace &weight)
sets the cell weights according to the box system
void writeGridInformation(MInt level_, MInt tag)
debugging function writing debug info to a file
void createInitialGrid()
creates the initial grid
const MInt & a_refinementDistance(const MInt cellId) const
Returns rfnDistance of the cell cellId position.
void writeParallelGeometry()
void markLocalSlicedCone(MInt level_, MInt patch, MInt solver, MString patchStr)
marks cells that lie in a sliced cone-type patch
This class is a ScratchSpace.
std::basic_string< char > MString
MInt * localMinBoundaryThreshold
MInt * localBndRfnMinLvlDiff
MInt * localRfnBoundaryIds
MFloat * localBndRfnDistance
MInt maxUniformRefinementLevel
MInt noLocalRfnBoundaryIds
MFloat ** localRfnPatchProperties
MInt * localRfnLevelPropertiesOffset
std::vector< MString > cutOffMethods
MInt noPatchesPerLevel(MInt addLevel)
MInt noLocalPatchRfnLvls()
MFloat ** cutOffCoordinates
MInt * noLocalRfnPatchProperties
std::vector< MString > localRfnLevelMethods