10#include "exahype2/RefinementControl.h"
11#include "peano4/datamanagement/FaceMarker.h"
12#include "repositories/SolverRepository.h"
13#include "tarch/multicore/Lock.h"
22 if (twoPunctures ==
nullptr) {
61 const tarch::la::Vector<DIMENSIONS, double>& volumeCentre,
62 const tarch::la::Vector<DIMENSIONS, double>& volumeH
73 const peano4::datamanagement::CellMarker& marker
75 return isCellOverlappingWithBHImpactArea(marker.getX(), marker.getH());
79 const peano4::datamanagement::CellMarker& marker
81 if (isCellOverlappingWithBHImpactArea(marker)) {
83 for (
int d = 0; d < DIMENSIONS; d++) {
84 tarch::la::Vector<DIMENSIONS, double> neighbourCellCentre = marker.getX();
86 neighbourCellCentre(d) = marker.getX()(d) - marker.getH()(d);
87 result &= isCellOverlappingWithBHImpactArea(neighbourCellCentre, marker.getH());
89 neighbourCellCentre(d) = marker.getX()(d) + marker.getH()(d);
90 result &= isCellOverlappingWithBHImpactArea(neighbourCellCentre, marker.getH());
99 const peano4::datamanagement::CellMarker& marker,
102 if (isCellOverlappingWithBHImpactArea(marker)) {
103 const int normal = faceNumber % DIMENSIONS;
104 tarch::la::Vector<DIMENSIONS, double> adjacentCellCentre = marker.getX();
105 adjacentCellCentre(normal) += faceNumber >= DIMENSIONS ? marker.getH()(normal) : -marker.getH()(normal);
106 return isCellOverlappingWithBHImpactArea(adjacentCellCentre, marker.getH());
113 const peano4::datamanagement::FaceMarker& marker
115 const int normal = marker.getSelectedFaceNumber() % DIMENSIONS;
117 tarch::la::Vector<DIMENSIONS, double> leftCellCentre = marker.getX();
118 tarch::la::Vector<DIMENSIONS, double> rightCellCentre = marker.getX();
120 leftCellCentre(normal) -= 0.5 * marker.getH()(normal);
121 rightCellCentre(normal) += 0.5 * marker.getH()(normal);
123 return isCellOverlappingWithBHImpactArea(leftCellCentre, marker.getH())
124 and isCellOverlappingWithBHImpactArea(rightCellCentre, marker.getH());
128 const peano4::datamanagement::FaceMarker& marker
130 const int normal = marker.getSelectedFaceNumber() % DIMENSIONS;
132 tarch::la::Vector<DIMENSIONS, double> leftCellCentre = marker.getX();
133 tarch::la::Vector<DIMENSIONS, double> rightCellCentre = marker.getX();
135 leftCellCentre(normal) -= 0.5 * marker.getH()(normal);
136 rightCellCentre(normal) += 0.5 * marker.getH()(normal);
138 return isCellOverlappingWithBHImpactArea(leftCellCentre, marker.getH())
139 or isCellOverlappingWithBHImpactArea(rightCellCentre, marker.getH());
143 const tarch::la::Vector<DIMENSIONS, double>& cellCentre,
144 const tarch::la::Vector<DIMENSIONS, double>& cellH
146 return tarch::la::norm2(cellCentre) - tarch::la::norm2(0.5 * cellH) < BlackHoleFVRegion;
150 double globalMinTimeStamp,
151 double globalMaxTimeStamp,
152 double globalMinTimeStepSize,
153 double globalMaxTimeStepSize
156 startTimeStep(globalMinTimeStamp, globalMaxTimeStamp, globalMinTimeStepSize, globalMaxTimeStepSize);
158 _numberOfPatches = 0;
162 AbstractCCZ4SBH_FV::finishTimeStep();
164 logInfo(
"finishTimeStep()",
"number of patches on this rank=" << _numberOfPatches);
168 tarch::multicore::Lock lock(_semaphore);
constexpr double timeStepSize
virtual void startTimeStep(double globalMinTimeStamp, double globalMaxTimeStamp, double globalMinTimeStepSize, double globalMaxTimeStepSize) override
Call superclass and after that report/maintain _numberOfPatches.
void incNumberOfPatches()
static bool areBothAdjacentCellsOverlappingWithBHImpactArea(const peano4::datamanagement::FaceMarker &marker)
Check two adjacent octants.
void reduceAdmissibleTimeStepSize(double timeStepSize)
Overwrite limiters time step size.
static bool isCellOverlappingWithBHImpactArea(const peano4::datamanagement::CellMarker &marker)
Is octant area overlapping with BH impact area.
virtual void initialCondition(double *NOALIAS Q, const tarch::la::Vector< DIMENSIONS, double > &volumeCentre, const tarch::la::Vector< DIMENSIONS, double > &volumeH) override
static bool areAllFaceConnectedCellsOverlappingWithBHImpactArea(const peano4::datamanagement::CellMarker &marker)
static tarch::multicore::BooleanSemaphore _semaphore
static bool isOneAdjacentCellOverlappingWithBHImpactArea(const peano4::datamanagement::FaceMarker &marker)
CCZ4SBH_FV()
Initialise the two punctures object if required.
virtual void finishTimeStep() override
Call superclass and after that report/maintain _numberOfPatches.
static tarch::logging::Log _log
void ApplyTwoPunctures(double *NOALIAS Q, const tarch::la::Vector< DIMENSIONS, double > &X, double t, TP::TwoPunctures *tp, bool low_res)
void prepareTwoPunctures()
TP::TwoPunctures * twoPunctures
std::string grid_setup_method