Skip to content

Commit

Permalink
Setting inner_r and outer_r vars + excision of diagnostic variables o…
Browse files Browse the repository at this point in the history
…nly if activate_extraction=true
  • Loading branch information
dinatraykova committed Jan 17, 2025
1 parent f7e27b5 commit 907b725
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 28 deletions.
16 changes: 10 additions & 6 deletions Examples/BoostedBHComplexScalar/BoostedBHScalarLevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void BoostedBHScalarLevel::specificPostTimeStep()
disable_simd());

// At any level, but after the timestep on the minimum extraction level
int min_level = m_p.extraction_params.min_extraction_level();
int min_level = 0.;
bool calculate_diagnostics = at_level_timestep_multiple(min_level);
if (calculate_diagnostics)
{
Expand All @@ -80,16 +80,20 @@ void BoostedBHScalarLevel::specificPostTimeStep()
m_state_diagnostics, SKIP_GHOST_CELLS);

// excise within/outside specified radii, no simd
BoxLoops::loop(
ExcisionDiagnostics<ScalarFieldWithPotential, BoostedBH>(
m_dx, m_p.center, boosted_bh, m_p.inner_r, m_p.outer_r),
m_state_diagnostics, m_state_diagnostics, SKIP_GHOST_CELLS,
disable_simd());
if (m_p.activate_extraction == 1)
{
BoxLoops::loop(
ExcisionDiagnostics<ScalarFieldWithPotential, BoostedBH>(
m_dx, m_p.center, boosted_bh, m_p.inner_r, m_p.outer_r),
m_state_diagnostics, m_state_diagnostics, SKIP_GHOST_CELLS,
disable_simd());
}
}

// write out the integral after each timestep on the min_level
if (m_p.activate_extraction == 1)
{
min_level = m_p.extraction_params.min_extraction_level();
if (m_level == min_level)
{
bool first_step = (m_time == m_dt);
Expand Down
22 changes: 14 additions & 8 deletions Examples/BoostedBHComplexScalar/SimulationParameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ class SimulationParameters : public FixedBGSimulationParametersBase
pp.load("bh_center", bg_params.center, center);

// Volume extraction radii
pp.load("inner_r", inner_r, extraction_params.extraction_radii[0]);
pp.load("outer_r", outer_r, extraction_params.extraction_radii[1]);
if (activate_extraction)
{
pp.load("inner_r", inner_r, extraction_params.extraction_radii[0]);
pp.load("outer_r", outer_r, extraction_params.extraction_radii[1]);
}
}

void check_params()
Expand All @@ -46,12 +49,15 @@ class SimulationParameters : public FixedBGSimulationParametersBase
initial_params.mass < 0.2 / coarsest_dx / dt_multiplier,
"oscillations of scalar field do not appear to be "
"resolved on coarsest level");
warn_parameter("inner_r", inner_r,
extraction_params.extraction_radii[0] == inner_r,
"should be equal to first extraction radius");
warn_parameter("outer_r", outer_r,
extraction_params.extraction_radii[1] == outer_r,
"should be equal to second extraction radius");
if (activate_extraction)
{
warn_parameter("inner_r", inner_r,
extraction_params.extraction_radii[0] == inner_r,
"should be equal to first extraction radius");
warn_parameter("outer_r", outer_r,
extraction_params.extraction_radii[1] == outer_r,
"should be equal to second extraction radius");
}
warn_parameter("bh_mass", bg_params.mass, bg_params.mass >= 0.0,
"should be >= 0.0");
FOR(idir)
Expand Down
16 changes: 10 additions & 6 deletions Examples/KerrBHScalarField/KerrBHScalarLevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void KerrBHScalarLevel::specificPostTimeStep()
disable_simd());

// At any level, but after the min_level timestep
int min_level = m_p.extraction_params.min_extraction_level();
int min_level = 0.;
bool calculate_diagnostics = at_level_timestep_multiple(min_level);
if (calculate_diagnostics)
{
Expand All @@ -94,16 +94,20 @@ void KerrBHScalarLevel::specificPostTimeStep()
m_state_diagnostics, SKIP_GHOST_CELLS);

// excise within/outside specified radii, no simd
BoxLoops::loop(
ExcisionDiagnostics<ScalarFieldWithPotential, KerrSchild>(
m_dx, m_p.center, kerr_bh, m_p.inner_r, m_p.outer_r),
m_state_diagnostics, m_state_diagnostics, SKIP_GHOST_CELLS,
disable_simd());
if (m_p.activate_extraction == 1)
{
BoxLoops::loop(
ExcisionDiagnostics<ScalarFieldWithPotential, KerrSchild>(
m_dx, m_p.center, kerr_bh, m_p.inner_r, m_p.outer_r),
m_state_diagnostics, m_state_diagnostics, SKIP_GHOST_CELLS,
disable_simd());
}
}

// write out the integral after each timestep on minimum level
if (m_p.activate_extraction == 1)
{
min_level = m_p.extraction_params.min_extraction_level();
if (m_level == min_level)
{
bool first_step = (m_time == m_dt);
Expand Down
22 changes: 14 additions & 8 deletions Examples/KerrBHScalarField/SimulationParameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ class SimulationParameters : public FixedBGSimulationParametersBase
pp.load("bh_center", bg_params.center, center);

// Volume extraction radii
pp.load("inner_r", inner_r, extraction_params.extraction_radii[0]);
pp.load("outer_r", outer_r, extraction_params.extraction_radii[1]);
if (activate_extraction)
{
pp.load("inner_r", inner_r, extraction_params.extraction_radii[0]);
pp.load("outer_r", outer_r, extraction_params.extraction_radii[1]);
}
}

void check_params()
Expand All @@ -50,12 +53,15 @@ class SimulationParameters : public FixedBGSimulationParametersBase
"resolved on coarsest level");
warn_parameter("bh_mass", bg_params.mass, bg_params.mass >= 0.0,
"should be >= 0.0");
warn_parameter("inner_r", inner_r,
extraction_params.extraction_radii[0] == inner_r,
"should be equal to first extraction radius");
warn_parameter("outer_r", outer_r,
extraction_params.extraction_radii[1] == outer_r,
"should be equal to second extraction radius");
if (activate_extraction)
{
warn_parameter("inner_r", inner_r,
extraction_params.extraction_radii[0] == inner_r,
"should be equal to first extraction radius");
warn_parameter("outer_r", outer_r,
extraction_params.extraction_radii[1] == outer_r,
"should be equal to second extraction radius");
}
check_parameter("bh_spin", bg_params.spin,
std::abs(bg_params.spin) <= bg_params.mass,
"must satisfy |a| <= M = " +
Expand Down

0 comments on commit 907b725

Please sign in to comment.