Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excise diagnostics only if activate extraction is set to true #29

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading