Peano
Loading...
Searching...
No Matches
CCZ4SBH_FD4.cpp
Go to the documentation of this file.
1// This file is part of the ExaHyPE2 project. For conditions of distribution and
2// use, please see the copyright notice at www.peano-framework.org
3#include "CCZ4SBH_FD4.h"
4
5#include "exahype2/RefinementControl.h"
6#include "repositories/SolverRepository.h"
7
8tarch::logging::Log benchmarks::exahype2::ccz4::CCZ4SBH_FD4::_log("benchmarks::exahype2::ccz4::CCZ4SBH_FD4");
9
11
13 if (twoPunctures == nullptr) {
15
16 // first we set the parameter. TODO:find a way to read parameter from python script
17 // int swi=0;//0--single black hole, 1--BBH hoc, 2--BBH rotation, 3--GW150914
18
19 twoPunctures->par_b = 1.0;
20 twoPunctures->center_offset[0] = -1.0;
23 twoPunctures->target_M_plus = 1.0; // adm mass
24 twoPunctures->par_P_plus[0] = 0.0;
25 twoPunctures->par_P_plus[1] = 0.0;
26 twoPunctures->par_P_plus[2] = 0.0; // linear momentum
27 twoPunctures->par_S_plus[0] = 0.0;
28 twoPunctures->par_S_plus[1] = 0.0;
29 twoPunctures->par_S_plus[2] = 0.0; // spin
30 twoPunctures->target_M_minus = 0.0; // adm mass
31 twoPunctures->par_P_minus[0] = 0.0;
32 twoPunctures->par_P_minus[1] = 0.0;
33 twoPunctures->par_P_minus[2] = 0.0; // linear momentum
34 twoPunctures->par_S_minus[0] = 0.0;
35 twoPunctures->par_S_minus[1] = 0.0;
36 twoPunctures->par_S_minus[2] = 0.0; // spin
37 twoPunctures->grid_setup_method = "evaluation"; // evaluation or Taylor expansion
39
41
42 // then solve the equation
44 }
45}
46
48 const double* NOALIAS Q, // Q[59+0]
49 const tarch::la::Vector<DIMENSIONS, double>& volumeX,
50 const tarch::la::Vector<DIMENSIONS, double>& meshCellH,
51 double t
52) {
53 return tarch::la::norm2(volumeX) - std::sqrt(DIMENSIONS)*meshCellH(0) < BlackHoleFVRegion
54 ? ::exahype2::RefinementCommand::Refine
55 : ::exahype2::RefinementCommand::Keep;
56}
57
59
61 double* NOALIAS Q,
62 const tarch::la::Vector<DIMENSIONS, double>& meshCellCentre,
63 const tarch::la::Vector<DIMENSIONS, double>& meshCellH
64) {
66}
67
69 double globalMinTimeStamp, double globalMaxTimeStamp, double globalMinTimeStepSize, double globalMaxTimeStepSize
70) {
71 AbstractCCZ4SBH_FD4::startTimeStep(
72 globalMinTimeStamp, globalMaxTimeStamp, globalMinTimeStepSize, globalMaxTimeStepSize
73 );
74
75#if defined(CoupleWithFV)
76 if (isFirstGridSweepOfTimeStep()) {
77 double fvTimeStepSize = repositories::instanceOfCCZ4SBH_FV.getAdmissibleTimeStepSize();
78 double newTimeStepSize = std::min(fvTimeStepSize, _admissibleTimeStepSize);
79 if (tarch::la::smaller(newTimeStepSize, fvTimeStepSize)) {
80 logInfo(
81 "startTimeStep(...)",
82 "reduce admissible time step size from dt_{dg}="
83 << _admissibleTimeStepSize << " vs dt_{fv}=" << fvTimeStepSize << " to dt=" << newTimeStepSize
84 << " (previously reported time step sizes for this step are invalid)"
85 );
86 }
87 _admissibleTimeStepSize = newTimeStepSize;
88 repositories::instanceOfCCZ4SBH_FV.reduceAdmissibleTimeStepSize(newTimeStepSize);
89 }
90#endif
91}
static tarch::logging::Log _log
Definition CCZ4SBH_FD4.h:27
virtual void initialCondition(double *NOALIAS Q, const tarch::la::Vector< DIMENSIONS, double > &meshCellCentre, const tarch::la::Vector< DIMENSIONS, double > &meshCellH) override
CCZ4SBH_FD4()
Initialise the two punctures object if required.
virtual::exahype2::RefinementCommand refinementCriterion(const double *NOALIAS Q, const tarch::la::Vector< DIMENSIONS, double > &meshCellCentre, const tarch::la::Vector< DIMENSIONS, double > &meshCellH, double t) override
Refinement criterion.
virtual void startTimeStep(double globalMinTimeStamp, double globalMaxTimeStamp, double globalMinTimeStepSize, double globalMaxTimeStepSize) override
Start a new time step.
void ApplyTwoPunctures(double *NOALIAS Q, const tarch::la::Vector< DIMENSIONS, double > &X, double t, TP::TwoPunctures *tp, bool low_res)
TP::TwoPunctures * twoPunctures
Definition CCZ4SBH_FV.h:16
double par_S_plus[3]
std::string grid_setup_method
double par_P_plus[3]
double par_S_minus[3]
double center_offset[3]
double target_M_minus
double par_P_minus[3]