17#define ENSURE_VALID_GCELLID(gCellId) \
19 ASSERT(gCellId >= 0 && gCellId < m_maxNoCells, \
20 "gCellId " << gCellId << " out-of-bounds [0, " << m_maxNoCells << ") m_cells.size: " << m_cells.size()); \
23#define ENSURE_VALID_DIM(dim) \
25 ASSERT(dim >= 0 && dim < nDim, "dim " << dim << " out-of-bounds [0, " << nDim << ")"); \
28#define ENSURE_VALID_DIR(dir) \
30 ASSERT(dir >= 0 && dir < 2 * nDim, "dir " << dir << " out-of-bounds [0, " << 2 * nDim << ")"); \
33#define ENSURE_VALID_SET(set) \
35 ASSERT(set >= 0 && set < m_maxNoSets, "set " << set << " out-of-bounds [0," << m_maxNoSets << ")"); \
44 r[0] = (p[1] * q[2]) - (q[1] * p[2]);
45 r[1] = (p[2] * q[0]) - (q[2] * p[0]);
46 r[2] = (p[0] * q[1]) - (q[0] * p[1]);
52 MFloat v[3][3] = {{F0, F0, F0}, {F0, F0, F0}, {F0, F0, F0}};
53 MInt noVertices = nDim_;
55 for(
MInt i = 0; i < noVertices; i++) {
56 for(
MInt j = 0; j < nDim_; j++) {
62 IF_CONSTEXPR(nDim_ == 2) {
64 MFloat dx = v[1][0] - v[0][0];
65 if(
approx(dx, 0.0, MFloatEps))
66 theta_rad = 3.141592654 / 2.0;
68 theta_rad = atan((v[1][1] - v[0][1]) / dx);
70 tr[0][0] = cos(theta_rad);
71 tr[0][1] = sin(theta_rad);
73 tr[1][0] = -sin(theta_rad);
74 tr[1][1] = cos(theta_rad);
88 for(
MInt i = 0; i < 3; i++) {
94 for(
MInt i = 0; i < 3; i++) {
95 xn[i] = v[1][i] - v[0][i];
99 MFloat mag = sqrt(pow(xn[0], 2) + pow(xn[1], 2) + pow(xn[2], 2));
108 tr[0][0] =
dot(xn, xm);
109 tr[0][1] =
dot(xn, ym);
110 tr[0][2] =
dot(xn, zm);
111 tr[1][0] =
dot(yn, xm);
112 tr[1][1] =
dot(yn, ym);
113 tr[1][2] =
dot(yn, zm);
114 tr[2][0] =
dot(zn, xm);
115 tr[2][1] =
dot(zn, ym);
116 tr[2][2] =
dot(zn, zm);
123 for(
MInt i = 0; i < 3; i++) {
125 for(
MInt j = 0; j < 3; j++) {
126 r[i] += tr[i][j] * q[j];
137 MFloat vv[3][3] = {{F0, F0, F0}, {F0, F0, F0}, {F0, F0, F0}};
142 for(
MInt i = 0; i < noVertices; i++)
143 for(
MInt j = 0; j < nDim_; j++) {
148 MFloat ro[3] = {0.0, 0.0, 0.0}, uv[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, quv[2] = {0.0, 0.0};
149 for(
MInt i = 0; i < noVertices; i++) {
151 for(
MInt j = 0; j < nDim_ - 1; j++) {
152 uv[(nDim_ - 1) * i + j] = ro[j];
158 for(
MInt j = 0; j < nDim_ - 1; j++)
162 for(
MInt j = 0; j < nDim_ - 1; j++) {
163 for(
MInt i = 0; i < noVertices; i++)
164 uv[(nDim_ - 1) * i + j] -= quv[j];
168 IF_CONSTEXPR(nDim_ == 2) {
169 MInt SH = 0, NSH = 0;
173 else if(
approx(uv[0], 0.0, MFloatEps))
180 else if(
approx(uv[1], 0.0, MFloatEps))
185 if((SH != NSH) || (SH == 0) || (NSH == 0))
return 1;
190 for(
MInt i = 0; i < noVertices; i++) {
191 MInt ni = (i + 1) % 3;
193 MInt SH = 0, NSH = 0;
195 if(uv[i * 2 + 1] > 0)
197 else if(
approx(uv[i * 2 + 1], 0.0, MFloatEps))
202 if(uv[ni * 2 + 1] > 0)
204 else if(
approx(uv[ni * 2 + 1], 0.0, MFloatEps))
210 if(SH == 0 && NSH == 0) {
214 else if((SH == 0 &&
approx(uv[i * 2 + 0], 0.0, MFloatEps))
215 || (NSH == 0 &&
approx(uv[ni * 2 + 0], 0.0, MFloatEps))) {
218 }
else if(
approx((uv[i * 2 + 0]
219 - uv[i * 2 + 1] * (uv[ni * 2 + 0] - uv[i * 2 + 0]) / (uv[ni * 2 + 1] - uv[i * 2 + 1])),
225 if((uv[i * 2 + 0] > 0) && (uv[ni * 2 + 0] > 0))
227 else if((uv[i * 2 + 0] > 0) || (uv[ni * 2 + 0] > 0)) {
229 if((uv[i * 2 + 0] - uv[i * 2 + 1] * (uv[ni * 2 + 0] - uv[i * 2 + 0]) / (uv[ni * 2 + 1] - uv[i * 2 + 1]))
270template <MInt nDim_,
class SysEqn>
273template <MInt nDim_,
class SysEqn>
276template <MInt nDim_,
class SysEqn>
279template <RansMethod _>
285template <MInt nDim_,
class RANSModel>
351 using Grid =
typename CartesianSolver::Grid;
355 using CartesianSolver::grid;
363 using CartesianSolver::disableDlbTimers;
364 using CartesianSolver::domainId;
365 using CartesianSolver::domainOffset;
366 using CartesianSolver::enableDlbTimers;
367 using CartesianSolver::exchangeData;
368 using CartesianSolver::haloCellId;
369 using CartesianSolver::isActive;
370 using CartesianSolver::m_freeIndices;
371 using CartesianSolver::m_initFromRestartFile;
372 using CartesianSolver::m_maxNoSets;
373 using CartesianSolver::m_restart;
374 using CartesianSolver::m_restartFile;
375 using CartesianSolver::m_restartInterval;
376 using CartesianSolver::m_restartTimeStep;
377 using CartesianSolver::m_solutionInterval;
378 using CartesianSolver::m_solverId;
379 using CartesianSolver::m_useNonSpecifiedRestartFile;
380 using CartesianSolver::maxLevel;
381 using CartesianSolver::maxNoGridCells;
382 using CartesianSolver::maxRefinementLevel;
383 using CartesianSolver::maxUniformRefinementLevel;
384 using CartesianSolver::minLevel;
385 using CartesianSolver::mpiComm;
386 using CartesianSolver::neighborDomain;
387 using CartesianSolver::noDomains;
388 using CartesianSolver::noHaloCells;
389 using CartesianSolver::noNeighborDomains;
390 using CartesianSolver::noWindowCells;
391 using CartesianSolver::outputDir;
392 using CartesianSolver::readSolverSamplingVarNames;
393 using CartesianSolver::restartDir;
394 using CartesianSolver::returnIdleRecord;
395 using CartesianSolver::returnLoadRecord;
396 using CartesianSolver::solverId;
397 using CartesianSolver::solverMethod;
398 using CartesianSolver::startLoadTimer;
399 using CartesianSolver::stopLoadTimer;
400 using CartesianSolver::updateDomainInfo;
401 using CartesianSolver::windowCellId;
412#ifdef MAIA_TIMER_FUNCTION
413 TERMM_IF_COND(!allTimings,
"FIXME: reduced timings mode not yet supported by LS.");
414 static const MInt noAdditionTimers = 7;
415 return 2 + noAdditionTimers;
448 ENSURE_VALID_GCELLID(cellId);
452 ENSURE_VALID_GCELLID(cellId);
460 ENSURE_VALID_SET(set);
466 ENSURE_VALID_DIM(dim);
467 ENSURE_VALID_SET(set);
468 ENSURE_VALID_GCELLID(cellId);
473 ENSURE_VALID_DIM(dim);
474 ENSURE_VALID_SET(set);
475 ENSURE_VALID_GCELLID(cellId);
480 ENSURE_VALID_GCELLID(cellId);
481 ENSURE_VALID_SET(set);
485 ENSURE_VALID_GCELLID(cellId);
486 ENSURE_VALID_SET(set);
491 ENSURE_VALID_GCELLID(cellId);
492 ENSURE_VALID_SET(set);
496 ENSURE_VALID_GCELLID(cellId);
497 ENSURE_VALID_SET(set);
502 ENSURE_VALID_GCELLID(cellId);
503 ENSURE_VALID_SET(set);
508 ENSURE_VALID_GCELLID(cellId);
509 ENSURE_VALID_SET(set);
514 ENSURE_VALID_GCELLID(cellId);
515 ENSURE_VALID_SET(set);
520 ENSURE_VALID_GCELLID(cellId);
521 ENSURE_VALID_SET(set);
527 ENSURE_VALID_GCELLID(cellId);
528 ENSURE_VALID_SET(set);
534 ENSURE_VALID_GCELLID(cellId);
535 ENSURE_VALID_SET(set);
543 ENSURE_VALID_DIM(dim);
544 ENSURE_VALID_SET(set);
545 ENSURE_VALID_GCELLID(cellId);
550 ENSURE_VALID_DIM(dim);
551 ENSURE_VALID_SET(set);
552 ENSURE_VALID_GCELLID(cellId);
557 ENSURE_VALID_GCELLID(cellId);
561 ENSURE_VALID_GCELLID(cellId);
566 ENSURE_VALID_GCELLID(cellId);
570 ENSURE_VALID_GCELLID(cellId);
575 ENSURE_VALID_SET(set);
576 ENSURE_VALID_GCELLID(cellId);
581 ENSURE_VALID_SET(set);
582 ENSURE_VALID_GCELLID(cellId);
588 ENSURE_VALID_GCELLID(cellId);
593 ENSURE_VALID_GCELLID(cellId);
599 ENSURE_VALID_SET(set);
600 ENSURE_VALID_GCELLID(cellId);
605 ENSURE_VALID_SET(set);
606 ENSURE_VALID_GCELLID(cellId);
612 ENSURE_VALID_SET(set);
613 ENSURE_VALID_GCELLID(cellId);
618 ENSURE_VALID_SET(set);
619 ENSURE_VALID_GCELLID(cellId);
625 ENSURE_VALID_SET(set);
626 ENSURE_VALID_GCELLID(cellId);
632 ENSURE_VALID_SET(set);
633 ENSURE_VALID_GCELLID(cellId);
640 ENSURE_VALID_DIM(dim);
641 ENSURE_VALID_SET(set);
642 ENSURE_VALID_GCELLID(cellId);
647 ENSURE_VALID_DIM(dim);
648 ENSURE_VALID_SET(set);
649 ENSURE_VALID_GCELLID(cellId);
655 ENSURE_VALID_SET(set);
656 ENSURE_VALID_GCELLID(cellId);
661 ENSURE_VALID_SET(set);
662 ENSURE_VALID_GCELLID(cellId);
668 ENSURE_VALID_SET(set);
669 ENSURE_VALID_GCELLID(cellId);
674 ENSURE_VALID_SET(set);
675 ENSURE_VALID_GCELLID(cellId);
716 ENSURE_VALID_GCELLID(gCellId);
717 return grid().tree().parent(gCellId);
722 ENSURE_VALID_GCELLID(gCellId);
723 return grid().tree().noChildren(gCellId);
728 ENSURE_VALID_GCELLID(gCellId);
729 return grid().tree().child(gCellId, pos);
735 ENSURE_VALID_DIM(dim);
736 ENSURE_VALID_GCELLID(gCellId);
737 return grid().tree().coordinate(gCellId, dim);
742 ENSURE_VALID_DIR(dir);
743 ENSURE_VALID_GCELLID(gCellId);
745 if(
grid().tree().neighbor(gCellId, dir) > -1) {
746 return grid().tree().neighbor(gCellId, dir);
752 mTerm(1, AT_,
"Return of the neighborId should have happend by now!");
759 ENSURE_VALID_DIR(dir);
760 ENSURE_VALID_SET(set);
761 ENSURE_VALID_GCELLID(cellId);
773 ENSURE_VALID_DIR(dir);
774 ENSURE_VALID_GCELLID(gCellId);
776 return grid().tree().hasNeighbor(gCellId, dir);
781 ENSURE_VALID_GCELLID(gCellId);
786 ENSURE_VALID_GCELLID(gCellId);
791 ENSURE_VALID_GCELLID(gCellId);
792 return grid().tree().globalId(gCellId);
800 ENSURE_VALID_GCELLID(gCellId);
801 return grid().tree().isLeafCell(gCellId);
806 ENSURE_VALID_GCELLID(gCellId);
811 ENSURE_VALID_GCELLID(gCellId);
818 ENSURE_VALID_GCELLID(gCellId);
819 return grid().tree().level(gCellId);
826 ENSURE_VALID_SET(set);
827 ENSURE_VALID_GCELLID(cellId);
832 ENSURE_VALID_GCELLID(cellId);
833 ENSURE_VALID_SET(set);
840 if(
grid().hasInactiveRanks()) {
843 "MPI_IN_PLACE",
"m_forceAdaptation");
1202 std::vector<MFloat>& sensorWeight,
1203 std::vector<std::bitset<64>>& sensorCellFlag,
1204 std::vector<MInt>& sensorSolverId)
override;
1209 void sensorInterface(std::vector<std::vector<MFloat>>& sensors, std::vector<std::bitset<64>>& sensorCellFlag,
1210 std::vector<MFloat>& sensorWeight,
MInt sensorOffset,
MInt sen)
override;
1237 void balance(
const MInt*
const noCellsToReceiveByDomain,
const MInt*
const noCellsToSendByDomain,
1238 const MInt*
const targetDomainsByCell,
const MInt oldNoCells)
override;
1271 }
else if(dataId == 1) {
1273 }
else if(dataId < 5) {
1277 else if(dataId > 2) {
1281 TERMM(1,
"solverCelldataType: invalid data id for !m_reconstructOldG && m_LsRotate");
1287 TERMM(1,
"solverCelldataType: invalid data id");
1296 MInt*
const data)
override;
1298 MFloat*
const data)
override;
1365 MBool printPosition =
false);
1397 MFloat sphereRadiusFactor = F5);
1407 template <
typename T>
1433 template <MBool currentLevelSet>
1435 template <
typename T>
1439#undef ENSURE_VALID_GCELLID
1440#undef ENSURE_VALID_DIM
1441#undef ENSURE_VALID_DIR
1442#undef ENSURE_VALID_SET
GridCell
Grid cell Property Labels.
MInt PointInsideTriangle(GeometryElement< nDim_ > *el, MFloat q[3], MFloat tr[3][3])
void transformationmatrix(GeometryElement< nDim_ > *el, MFloat tr[3][3])
void rotation(const MFloat q[3], MFloat r[3], MFloat tr[3][3])
MFloat dot(const MFloat p[3], const MFloat q[3])
void cross(const MFloat p[3], const MFloat q[3], MFloat r[3])
MInt getContainingCellHalo(MFloat *point)
MInt * m_initGFieldFromSTLBndCndIds
MFloat & a_oldLevelSetFunctionG(const MInt cellId, const MInt set)
Returns the old levelSetFunction of the cell cellId.
MFloat a_oldLevelSetFunctionG(const MInt cellId, const MInt set) const
Returns the old levelSetFunction of the cell cellId.
MInt a_bodyIdG(const MInt cellId, const MInt set) const
Returns bodyId of the cell cellId for set set.
void initializeIntegrationScheme_semiLagrange()
void updateAllLowerGridLevels(MInt mode=-1)
void reInitSolver(const MBool)
MBool m_useCorrectedBurningVelocity
MInt m_noInterpolationRegions
void identifyBodies(MInt mode=0)
sets a_bodyIdG(gCells,set) for all sets exept for the collected levelset (this is done in buildCollec...
MInt a_localId(const MLong gGlobalId)
MFloat ** m_gReceiveBuffers
void removeChilds(const MInt) override
Coarsen the given cell.
MBool a_isHalo(const MInt gCellId) const
Returns IsHalo of the cell cellId.
void shiftOldLevelSetField(MInt dir, MInt set, MInt body)
void exchangeAllLevelSetData()
void resizeGridMap() override
Swap the given cells.
MFloat a_meanCoord(const MInt dir) const
MFloat & a_curvatureG(const MInt cellId, const MInt set)
Returns curvature of the cell cellId for set set.
void setUpPotentialGapCells()
Set up cells, that may be tagged as gap cells during the solver run! Initialises the arrays,...
void postAdaptation() override
post adaptation for split adaptation within the adaptation loop
MBool finalizeLevelSet_(const MInt t_levelSet, const MInt t_output)
void setUpBodyToSetTable()
void getLoadQuantities(MInt *const loadQuantities) const override
void restartLocalizedLevelSetCG()
MFloat m_static_computeBodyProperties_initialBodyCenter[s_maxNoEmbeddedBodies *3]
MBool a_regridTriggerG(const MInt cellId) const
maia::ls::cell::BitsetType::reference a_nearGapG(const MInt cellId)
MInt c_neighborId(const MInt gCellId, const MInt dir) const
MFloat m_static_identifyBodies_initialInsidePoints[s_maxNoEmbeddedBodies *3]
constexpr MInt a_bandBndryCellId(MInt id, MInt set) const
MFloat * m_semiLagrange_xRot_ref
MBool m_static_setUpPotentialGapCells_first
MInt m_noInitGFieldFromSTLBndCndIds
MInt checkSecondLayerCells(std::vector< MInt > &diag2Cells, std::map< MInt, std::vector< MInt > > &dirCode, MFloat *point)
std::map< MInt, MInt > m_refinedCells
MFloat * m_semiLagrange_xShift_ref
maia::ls::cell::BitsetType::reference a_regridTriggerG(const MInt cellId)
typename maia::grid::tree::Tree< nDim_ >::Cell Cell
MBool m_writeOutAllCorrectedBurningVelocity
MInt * m_globalRcvOffsets
void setSensors(std::vector< std::vector< MFloat > > &sensors, std::vector< MFloat > &sensorWeight, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MInt > &sensorSolverId) override
set solver sensors for split adaptation within the adaptation loop
void regionGrowing(MInt cellId, MInt region)
MFloat m_static_computeBodyProperties_rotAngle
MFloat & a_levelSetFunctionSlope(const MInt cellId, const MInt dim, const MInt set)
Returns ls-FunctionSlope of the cell cellId for set dim set.
MFloat secondOrderEikonalSolver(MFloat *q, const MInt *nghbrs, MInt cellListSize, MInt maxIterations, MInt set)
MFloat m_static_computeBodyProperties_freqFactor[s_maxNoEmbeddedBodies]
void computeCurvature(MInt mode=-1)
static constexpr const MInt m_noCorners
typename CartesianSolver::Grid Grid
MFloat m_static_computeBodyProperties_Strouhal
void postTimeStep() override
void getCellDataDlb(const MInt dataId, const MInt oldNoCells, const MInt *const bufferIdToCellId, MInt *const data) override
Return solver data for DLB.
MBool m_filterFlameTubeEdges
MFloat m_static_computeBodyProperties_liftEndAngle2[s_maxNoEmbeddedBodies]
MBool semiLagrangeTimeStep()
constexpr MInt a_internalBandCellId(MInt id, MInt set) const
MBool m_useLocalMarksteinLength
MFloat m_static_crankAngle_Strouhal
MInt getCurrentTimeStep() const override
MFloat m_weightMulitSolverFactor
constexpr MInt a_noGBndryCells(MInt set) const
MFloat m_flameRadiusOffset
MFloat getCellLoad(const MInt cellId, const MFloat *const weights) const override
MFloat m_static_identifyBodies_shiftTime
MBool m_writeOutAllNormalVectors
void resetExtensionVelocity()
typename CartesianSolver::GridProxy GridProxy
MFloat * m_bodyAngularVelocity
MFloat crankAngle(const MFloat, const MInt)
MInt a_maxGCellLevel(const MInt set=-1) const
void determineSteadyFlameLength()
std::vector< MFloat > m_minGapWidth
void determinePropagationSpeed()
std::vector< MInt > m_newCells
MBool m_hyperbolicCurvature
MFloat m_sphereRadiusLimit
MFloat m_relaxationFactor
void finalizeLevelSetInitialization()
void globalToLocalIdsContainingCells()
MInt noVariables() const override
Return the number of variables.
maia::ls::cell::BitsetTypeSet::reference a_isGZeroCell(const MInt cellId, const MInt set)
MFloat m_static_computeBodyProperties_liftStartAngle2[s_maxNoEmbeddedBodies]
MBool a_nearGapG(const MInt cellId) const
void exchangeLeafDataLS()
MInt ** m_setToBodiesTable
MInt & a_potentialGapCell(const MInt id)
Returns the potential gap cellcellId.
MPI_Request * mpi_request
MFloat m_static_setUpPotentialGapCells_radius[s_maxNoEmbeddedBodies]
void exchangeIntBuffers(MInt *, MInt *, MInt, MInt)
MBool m_determineG0CellsMode
void spatiallyAdaptiveCorrectionFromSTL()
this function does a correction based on the curvature of the geometry. The high curvature regions ar...
MFloat m_dampingDistanceFlameBaseExtVel
void preTimeStep() override
MBool a_wasGZeroCell(const MInt cellId, const MInt set) const
void extendVelocity(const MInt set)
MInt noInternalCells() const override
Return the number of internal cells within this solver.
MBool m_highOrderDeltaFunction
MFloat m_yOffsetFlameTube
void initializeGField()
Initializes the solver values with the values of the undisturbed flow The values are given by the pro...
void resetSolver() override
Reset the solver/solver for load balancing.
MInt noSolverTimers(const MBool allTimings) override
void resetContainingGCells()
MFloat m_static_computeBodyProperties_circleStartAngle[s_maxNoEmbeddedBodies]
void rotateLevelSet(MInt returnMode, MFloat *cellData, MInt body, const MFloat *xCoord, const MFloat *xCenter, const MFloat *angle)
LsControlPoint< nDim > m_gCtrlPnt
MFloat & a_levelSetFunctionG(const MInt cellId, const MInt set)
Returns levelSetFunction of the cell cellId.
MInt * m_noInterpTimeSteps
void initLocalizedLevelSetCG()
void computeBodyPropertiesForced(MInt returnMode, MFloat *bodyData, MInt body, MFloat time, MBool printPosition=false)
returns a specific property of the specifuec body used to provide a unique function for both level-se...
void processRotatingLevelSet(MFloat &phi, MInt &cellId, MInt &domId, MFloat *point, MInt set)
void determineMinMaxMeanInterfacePosition()
MBool m_GWithReConstruction
MFloat c_cellLengthAtCell(const MInt gCellId) const
MBool prepareRestart(MBool, MBool &) override
Prepare the solvers for a grid-restart.
MBool a_isBndryCellG(const MInt cellId) const
void initializeGControlPoint()
this function is used to initialize the control point.
void getDomainDecompositionInformation(std::vector< std::pair< MString, MInt > > &domainInfo) override
MBool solutionStep() override
constexpr MInt a_bandCellId(MInt id, MInt set) const
MBool m_writeReinitializationStatistics
MFloat firstOrderEikonalSolver(MInt cellListSize, MInt maxIterations, MInt set)
void computeLevelSetRHS()
MInt a_potentialGapCellClose(const MInt id) const
Returns the potential gap cell closecellId.
MFloat m_realRadiusFlameTube
CHECKNORMAL< nDim > * m_checkNormal
MBool a_isGZeroCell(const MInt cellId, const MInt set) const
void setInterfaceList(MIntScratchSpace &interfaceCells)
MFloat m_extVelConvergence
void initializeIntegrationScheme()
MFloat m_reinitThresholdAvg
MInt m_static_setUpPotentialGapCells_bodyClose[s_maxNoEmbeddedBodies]
void computeZeroLevelSetArcLength()
MFloat cellVolumeAtCell(const MInt gCellId) const
MFloat m_static_computeBodyProperties_liftEndAngle1[s_maxNoEmbeddedBodies]
MFloat m_static_computeBodyProperties_temperature[s_maxNoEmbeddedBodies]
MBool inCell(MInt cellId, MFloat *point)
void swapProxy(const MInt cellId0, const MInt cellId1) override
Swap the given cells.
MFloat * m_semiLagrange_xRot_STL
MString m_gapReinitMethod
MFloat m_reinitConvergence
maia::ls::cell::BitsetType::reference a_isHalo(const MInt gCellId)
Returns IsHalo of the cell cellId.
MInt a_domainId(const MLong gGlobalId)
MInt cellOutside(const MFloat *, const MInt, const MInt) override
Check whether cell is outside the fluid domain.
void allocateLevelSetMemory()
void computeExtensionVelocityGEQUPVMarksteinOpt(MFloat *FfluidDensity, MInt set)
MInt * m_globalSndOffsets
std::vector< MFloat > m_minGapWidthDt1
std::vector< MInt > * m_G0Cells
MFloat * m_maxFlameFrontPosition
MInt a_level(const MInt gCellId) const
Returns the level of the gcell gCellId.
void exchangeDataLS(T *data, const MInt dataSize=1)
void determineMinMaxMeanRegionInterfacePosition(MFloat xRegN, MFloat xRegP, MFloat yRegN, MFloat yRegP, MInt set)
MString m_currentGridFileName
MFloat & a_meanCoord(const MInt dir)
MBool m_static_computeBodyProperties_first
MInt hyperbolicExtensionOpt(MFloat *q, MInt *cellList, MInt cellListSize, MFloat convergenceCriterion, MInt set)
MInt noLoadTypes() const override
void setGCellBndryProperty()
void levelSetReinitialization(MInt mode=1)
MFloat m_static_setUpPotentialGapCells_normal[s_maxNoEmbeddedBodies *3]
void updateLowerGridLevels(MInt mode=-1)
void levelSetRestriction()
MInt m_maintenanceIterations
std::array< MInt, Timers::_count > m_timers
constexpr MInt a_noG0Cells(MInt set) const
MBool m_buildCollectedLevelSetFunction
void levelSetGapCorrect()
MFloat m_marksteinLengthPercentage
std::map< MInt, MInt > m_oldG0Cells
void initializeCollectedLevelSet(MInt mode)
MFloat m_static_computeBodyProperties_omega
MFloat m_initialFlameHeight
void initAzimuthalExchange()
MInt a_secondBodyId(const MInt cellId) const
Returns secondBodyId of the cell cellId for set set.
MFloat a_levelSetFunctionG(const MInt cellId, const MInt set) const
Returns levelSetFunction of the cell cellId.
void resetOutsideCells(MInt mode=-1)
void exchangeLs(MFloat *, MInt, MInt)
MBool levelSetReinitializationTrigger()
MBool m_initialRefinement
void applyLevelSetBoundaryConditions()
MBool * m_computeSet_backup
void computeNormalVectorsPeriodic()
void finalizeInitSolver() override
MInt m_static_setUpPotentialGapCells_noGapRegionsClose
void rotateSTL(MInt direction, MInt body, MFloat *center)
maia::ls::cell::BitsetTypeSet::reference a_wasGZeroCell(const MInt cellId, const MInt set)
void updateContainingGCells(MInt mode=0)
void levelSetHighOrderConstrainedReinitialization(MInt methodId, MInt startSet, MInt endSet, MInt gapMode)
void buildMultipleLevelSet(MInt mode=1)
MInt c_noChildren(const MInt gCellId) const
void computeCurvaturePeriodic()
MFloat m_static_setUpPotentialGapCells_heightClose[s_maxNoEmbeddedBodies]
MFloat m_static_computeBodyProperties_liftStartAngle1[s_maxNoEmbeddedBodies]
void swapCells(const MInt, const MInt) override
Swap the given cells.
void exchangeBuffersGlobal(T *sendBuffer, T *receiveBuffer, MInt *, MInt *, MInt *, MInt *, MInt, MInt offset=1)
void prepareAdaptation() override
prepare adaptation for split adaptation before the adaptation loop
void generateListOfGExchangeCellsCG()
MFloat m_static_computeBodyProperties_mu2[s_maxNoEmbeddedBodies]
constexpr MInt a_gBndryCellId(MInt id, MInt set) const
MInt determineLevelSetSignFromSTL(MFloat *target, MInt set)
this function checks if the "target" coordinates is inside(return 1) or outside (return -1) STL and r...
MBool m_writeOutAllExtensionVelocities
MBool m_writeOutAllLevelSetFunctions
MFloat & a_normalVectorG(const MInt cellId, const MInt dim, const MInt set)
Returns normalVector of the cell cellId for index n.
void writeRestartFile(const MBool, const MBool, const MString, MInt *recalcIdTree) override
MInt m_loadBalancingReinitStage
MFloat timeStep() const
Returns the timeStep.
void fastBuildLevelSetTubeCG()
MInt m_rotatingReinitTrigger
static constexpr MInt nDim
void removeCell(const MInt) override
Remove the given cell.
void reBuildCollectedLevelSet(MInt mode)
MInt m_intermediateReinitIterations
static constexpr MInt s_maxNoEmbeddedBodies
MFloat a_levelSetRHS(const MInt cellId, const MInt set) const
Returns ls-RHS of the cell cellId for set set.
void levelSetGapRecorrect()
MFloat m_static_setUpPotentialGapCells_centerClose[s_maxNoEmbeddedBodies *3]
void localToGlobalIdsContainingCells()
MFloat interpolateLevelSet(MInt *interpolationCells, MFloat *point, MInt referenceSet)
MInt cellDataTypeDlb(const MInt dataId) const override
MFloat m_yOffsetFlameTube2
MInt a_hasNeighbor(const MInt gCellId, const MInt dir) const
Returns noNeighborIds of the gcell CellId variables varId.
std::vector< MInt > * m_gBndryCells
void a_resetPropertiesSolver(const MInt cellId)
Returns property p of the cell cellId.
void readLevelSetProperties()
MInt noCellDataDlb() const override
Methods to inquire solver data information.
virtual void writeRestartLevelSetFileCG(MBool, const MString &, const MString &)
MFloat a_flameSpeedG(const MInt cellId, const MInt set) const
Returns flameSpeed of the cell cellId for index n.
MFloat ** m_correctedDistances
void balance(const MInt *const noCellsToReceiveByDomain, const MInt *const noCellsToSendByDomain, const MInt *const targetDomainsByCell, const MInt oldNoCells) override
MFloat computeDistanceFromSTL(MFloat *target, MInt *closestElement, MFloat *closestPoint, MInt set, MFloat sphereRadiusFactor=F5)
void localToGlobalIds() override
std::vector< MInt > m_bodiesToCompute
MBool m_writeOutAllCurvatures
MFloat fifthOrderEikonalSolver(MInt cellListSize, MInt maxIterations, MInt *crCells, MInt noCRCells, MFloat *factors, MInt crMode, MInt set)
void setUpLevelSetInterpolationStencil(MInt cellId, MInt *interpolationCells, MInt position)
MFloat m_radiusFlameTube2
void reIntAfterRestart(MBool) override
MFloat m_xOffsetFlameTube2
MBool a_inBandG(const MInt cellId, const MInt set) const
void updateBndryCellList()
MFloat * m_minFlameFrontPosition
void prepareGlobalComm(MInt *noCellsToDom)
MFloat c_cellLengthAtLevel(const MInt level) const
constexpr MInt a_noBandBndryCells(MInt set) const
MBool m_fourthOrderNormalCurvatureComputation
MInt setUpLevelSetInterpolationStencil(MInt cellId, MInt *interpolationCells, MFloat *point)
void buildCollectedLevelSet(MInt mode=1)
void allocateRotatingLs()
MBool a_isGBoundaryCellG(const MInt cellId, const MInt set) const
maia::ls::cell::BitsetType::reference a_isBndryCellG(const MInt cellId)
MFloat & a_levelSetRHS(const MInt cellId, const MInt set)
Returns ls-RHS of the cell cellId for set set.
MFloat m_periodicDistance
void sensorInterface(std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen) override
MFloat * m_bodyAngularAcceleration
constexpr MInt a_noBandCells(MInt set) const
MBool m_static_identifyBodies_first
void resetOldOutsideCells()
virtual void saveSolverSolution(const MBool, const MBool)
maia::ls::cell::BitsetTypeSet::reference a_hasPositiveSign(const MInt cellId, const MInt set)
Returns the hasPositiveSigncellId for the setset.
MBool m_maintainOuterBandLayers
maia::ls::cell::BitsetTypeSet::reference a_isGBoundaryCellG(const MInt cellId, const MInt set)
MInt m_levelSetBoundaryCondition
void saveRestartFile(const MBool, MInt *)
MInt a_bandNghbrIdsG(const MInt cellId, const MInt dir, const MInt set) const
Returns bandNeighborId of the cell cellId for index n.
void getCellDataDlb(const MInt dataId, const MInt oldNoCells, const MInt *const bufferIdToCellId, MFloat *const data) override
MLong c_globalId(const MInt gCellId) const
MFloat a_curvatureG(const MInt cellId, const MInt set) const
Returns curvature of the cell cellId for set set.
MInt loadLevelSetGridFlowVarsParCG(const MChar *fileName)
MFloat a_extensionVelocityG(const MInt cellId, const MInt dim, const MInt set) const
Returns fExt of the cell cellId for index n.
MFloat m_steadyFlameAngle
void copyWindowToHaloIds()
void buildLevelSetTube(MInt mode=-1)
MFloat & a_gapWidth(const MInt id)
Returns the gap widthcellId.
MFloat m_xOffsetFlameTube
void balancePre() override
std::vector< MInt > * m_internalBandCells
MFloat a_levelSetFunctionSlope(const MInt cellId, const MInt dim, const MInt set) const
Returns ls-FunctionSlope of the cell cellId for set dim set.
MFloat a_normalVectorG(const MInt cellId, const MInt dim, const MInt set) const
Returns normalVector of the cell cellId for index n.
MInt & a_potentialGapCellClose(const MInt id)
Returns the potential gap cell closecellId.
MInt & a_containingDomain(const MInt cellId, const MInt body)
Returns the containing DomaincellId.
void finalizeAdaptation() override
finalize adaptation for split sadptation after the adaptation loop
MFloat m_static_computeBodyProperties_mu[s_maxNoEmbeddedBodies]
void refineCell(const MInt) override
Refine the given cell.
MFloat & a_flameSpeedG(const MInt cellId, const MInt set)
Returns flameSpeed of the cell cellId for index n.
maia::ls::cell::BitsetTypeSet::reference a_inBandG(const MInt cellId, const MInt set)
MFloat m_static_crankAngle_initialCad
MFloat m_curvatureDampFactor
MBool m_GFieldFromSTLInitCheck
MFloat a_gapWidth(const MInt id) const
Returns the gap widthcellId.
MInt cellDataSizeDlb(const MInt dataId, const MInt gridCellId) override
void getSolverTimings(std::vector< std::pair< MString, MFloat > > &solverTimings, const MBool allTimings) override
std::map< MInt, MInt > m_swapIds
MInt getContainingCell(MFloat *point)
MBool levelSetAdaptationTrigger()
void rotateSTL(MInt direction)
MFloat m_static_computeBodyProperties_amplitude[s_maxNoEmbeddedBodies]
MBool a_isWindow(const MInt gCellId) const
Returns IsWindow of the cell cellId.
MBool forceAdaptation() override
Returns the levelSet-Adaptation-forcing.
MBool m_writeOutAllFlameSpeeds
MFloat m_referenceVelocity
MInt c_parentId(const MInt gCellId) const
void reconstructOldGField()
void maintainOuterBandLayers(MInt order, MInt startSet, MInt endSet)
MFloat m_static_setUpPotentialGapCells_normalClose[s_maxNoEmbeddedBodies *3]
void finalizeBalance() override
MBool m_static_createBaseGgrid_firstRun
MFloat m_static_computeBodyProperties_normal[s_maxNoEmbeddedBodies *3]
MInt & a_secondBodyId(const MInt cellId)
Returns secondBodyId of the cell cellId for set set.
void determinePeriodicDistance()
MFloat m_static_setUpPotentialGapCells_height[s_maxNoEmbeddedBodies]
typename maia::CartesianSolver< nDim, LsCartesianSolver > CartesianSolver
constexpr MInt a_noInternalBandCells(MInt set) const
MInt * m_cellIsInDiffRegion
std::vector< MInt > * m_bandCells
MFloat c_coordinate(const MInt gCellId, const MInt dim) const
Returns the coordinate of the cell cellId for direction dim.
void setChildRegions(MInt cellId, MInt region)
MBool m_adaptationSinceLastRestart
MInt a_bandLayer(MInt id, MInt set) const
MInt m_static_computeBodyProperties_bodyToFunction[s_maxNoEmbeddedBodies]
void reinitBand(MInt startSet, MInt endSet)
constexpr MInt a_G0CellId(MInt id, MInt set) const
MInt c_childId(const MInt gCellId, const MInt pos) const
MLong & a_containingCell(const MInt cellId, const MInt body)
Returns the containing cellcellId.
MFloat & a_extensionVelocityG(const MInt cellId, const MInt dim, const MInt set)
Returns fExt of the cell cellId for index n.
MInt a_potentialGapCell(const MInt id) const
Returns the potential gap cellcellId.
MFloat m_filterFlameTubeEdgesDistance
MInt a_containingDomain(const MInt cellId, const MInt body) const
Returns the containing DomaincellId.
void setCellDataDlb(const MInt dataId, const MFloat *const data) override
void getContainingCellFromNeighbor(MInt body, MInt cellId, MFloat *xCoord, MFloat *xOld)
MInt a_internalBandLayer(MInt id, MInt set) const
void constructGFieldFromSTL(MInt ConstructFlag)
Used for initializing G field into the domain. ConstructFlag == 0: only reinitialization part will be...
MInt & a_bodyIdG(const MInt cellId, const MInt set)
Returns bodyId of the cell cellId for set set.
void setBandNewArrivals(MInt computingSet=-1)
void createGgridCG(MBool=false)
MBool m_interpolateFlowFieldToFlameFront
maia::ls::cell::BitsetType::reference a_isWindow(const MInt gCellId)
Returns IsWindow of the cell cellId.
MBool _levelSetSolutionStep()
MInt m_minReinitializationSteps
MInt ** m_intReceiveBuffers
void setCellDataDlb(const MInt dataId, const MInt *const data) override
Set solver data for DLB.
void determineG0Cells(MInt computingSet=-1)
void balancePost() override
MString m_currentFileName
void determineBandCells(MInt mode=-1)
void levelSetConstrainedReinitialization(MInt methodId, MInt startSet, MInt endSet, MInt gapMode)
MInt a_levelSetSign(const MInt cellId, const MInt set)
Returns the signed (MInt) version of hasPositiveSigncellId for the setset.
MFloat interpolateOldLevelSet(MInt *interpolationCells, MFloat *point, MInt referenceSet)
MFloat m_static_setUpPotentialGapCells_center[s_maxNoEmbeddedBodies *3]
MLong a_containingCell(const MInt cellId, const MInt body) const
Returns the containing cellcellId.
MFloat m_static_setUpPotentialGapCells_radiusClose[s_maxNoEmbeddedBodies]
MBool a_hasPositiveSign(const MInt cellId, const MInt set) const
Returns the hasPositiveSigncellId for the setset.
MBool m_static_semiLagrangeTimeStep_firstTime
MBool c_isLeafCell(const MInt gCellId) const
MInt getContainingCell(MInt startCell, MFloat *point, MInt set=-1)
MBool m_firstSolutionExchange
MFloat * m_meanFlameFrontPosition
MBool hasSplitBalancing() const override
Return if load balancing for solver is split into multiple methods or implemented in balance()
MFloat & a_correctedBurningVelocity(const MInt cellId, const MInt set)
Returns corrected burning velocity of the cell cellId for set set.
void getDefaultWeights(MFloat *weights, std::vector< MString > &names) const override
MFloat correctedBurningVelocity(const MInt cellId, const MInt set) const
Returns corrected burning velocity of the cell cellId for set set.
void computeNormalVectorsAtFront()
void computeNormalVectors(MInt mode=-1)
void initSolver() override
void computeGCellTimeStep()
MFloat m_dampingDistanceFlameBase
CHECKNORMAL< nDim > & checkNormal() const
MInt & a_internalBandLayer(MInt id, MInt set)
MFloat m_steadyFlameLength
MFloat m_reinitConvergenceReset
MBool localGapCellsExist()
Geom & geometry() const
Access the solver's geometry.
typename GCellCollector::BitsetType::reference PropertyReference
std::vector< MInt > * m_bandBndryCells
std::set< std::pair< MFloat, MFloat > > * m_forcedMotionInput
static constexpr const MInt m_noDirs
MFloat time() const override
Return the time.
MString m_levelSetDiscretizationScheme
void setCellWeights(MFloat *) override
Set cell weights.
MInt & a_bandLayer(MInt id, MInt set)
void limitWeights(MFloat *) override
MFloat * m_localMarksteinLength
MFloat reduceData(const MInt, MFloat *data, const MInt dataBlockSize=1)
MBool m_GFieldInitFromSTL
MInt * m_internalBandLayer
This class is a ScratchSpace.
void startLoadTimer(const MString name)
MPI_Comm mpiComm() const
Return the MPI communicator used by this solver.
void stopLoadTimer(const MString &name)
constexpr GridProxy & grid() const
MBool isActive() const override
constexpr MInt size() const
Return size (i.e., currently used number of nodes)
void append(const MInt count)
Append nodes to end of tree.
void resetProperties(const MInt id)
Reset all properties.
MFloat & oldGFunction(const MInt id, const MInt set)
MInt & bodyId(const MInt id, const MInt set)
MFloat & correctedBurningVelocity(const MInt id, const MInt set)
MFloat & curvature(const MInt id, const MInt set)
MInt & containingDomain(const MInt id, const MInt body)
MFloat & gFunction(const MInt id, const MInt set)
Accessors.
MBool inBand(const MInt id, const MInt set) const
MFloat & normalVector(const MInt id, const MInt dim, const MInt set)
MInt & secondBodyId(const MInt id)
MInt & potentialGapCellClose(const MInt id)
MFloat & fExt(const MInt id, const MInt dim, const MInt set)
MBool regridTrigger(const MInt id) const
properties:
MFloat & levelSetRHS(const MInt id, const MInt set)
BitsetType::reference hasProperty(const MInt id, const LsCell p)
Accessor for properties.
MBool nearGap(const MInt id) const
MBool hasPositiveSign(const MInt id, const MInt set) const
MLong & containingCell(const MInt id, const MInt body)
MBool wasGZero(const MInt id, const MInt set) const
MInt & potentialGapCell(const MInt id)
MBool isGBndryCell(const MInt id, const MInt set) const
MBool isBndryG(const MInt id) const
MFloat & gapWidth(const MInt id)
MBool isGZero(const MInt id, const MInt set) const
MFloat & levelSetFunctionSlope(const MInt id, const MInt dim, const MInt set)
void resetExtensionVelocity()
void mTerm(const MInt errorCode, const MString &location, const MString &message)
MBool approx(const T &, const U &, const T)
std::basic_string< char > MString
int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, const MString &name, const MString &sndvarname, const MString &rcvvarname)
same as MPI_Allreduce
Namespace for auxiliary functions/classes.