Skip to content

Commit

Permalink
Revert "reference test set up"
Browse files Browse the repository at this point in the history
This reverts commit d0c97b3.
  • Loading branch information
Llibert Areste Salo committed May 7, 2024
1 parent d0c97b3 commit b77315a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 68 deletions.
72 changes: 18 additions & 54 deletions Examples/KerrBH4dST/KerrBH4dSTLevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
*/

#include "KerrBH4dSTLevel.hpp"
#include "AMRReductions.hpp"
#include "BoxLoops.hpp"
#include "ChiTaggingCriterion.hpp"
#include "ComputePack.hpp"
#include "FixedGridsTaggingCriterion.hpp"
#include "InitialScalarData.hpp"
#include "ModifiedCCZ4RHS.hpp"
#include "ModifiedGravityConstraints.hpp"
Expand All @@ -16,7 +15,6 @@
#include "RhoDiagnostics.hpp"
#include "SetValue.hpp"
#include "SixthOrderDerivatives.hpp"
#include "SmallDataIO.hpp"
#include "TraceARemoval.hpp"

// Initial data
Expand Down Expand Up @@ -84,7 +82,11 @@ void KerrBH4dSTLevel::prePlotLevel()
ModifiedGravityConstraints<FourDerivScalarTensorWithCouplingAndPotential>
constraints(fdst, m_dx, m_p.center, m_p.G_Newton, c_Ham,
Interval(c_Mom1, c_Mom3));
BoxLoops::loop(constraints, m_state_new, m_state_diagnostics,
RhoDiagnostics<FourDerivScalarTensorWithCouplingAndPotential>
rho_diagnostics(fdst, m_dx, m_p.center);
auto compute_pack = make_compute_pack(constraints, rho_diagnostics);

BoxLoops::loop(compute_pack, m_state_new, m_state_diagnostics,
EXCLUDE_GHOST_CELLS);
}
#endif /* CH_USE_HDF5 */
Expand Down Expand Up @@ -132,73 +134,35 @@ void KerrBH4dSTLevel::specificUpdateODE(GRLevelData &a_soln,

void KerrBH4dSTLevel::preTagCells()
{
// we don't need any ghosts filled for the fixed grids tagging criterion
// used here so don't fill any
// We only use chi in the tagging criterion so only fill the ghosts for chi
fillAllGhosts(VariableType::evolution, Interval(c_chi, c_chi));
}

void KerrBH4dSTLevel::computeTaggingCriterion(FArrayBox &tagging_criterion,
const FArrayBox &current_state)
{
BoxLoops::loop(FixedGridsTaggingCriterion(m_dx, m_level, m_p.L, m_p.center),
current_state, tagging_criterion);
BoxLoops::loop(ChiTaggingCriterion(m_dx), current_state, tagging_criterion);
}

void KerrBH4dSTLevel::specificPostTimeStep()
{
CH_TIME("KerrBHLevel::specificPostTimeStep");

bool first_step =
(m_time == 0.); // this form is used when 'specificPostTimeStep' was
// called during setup at t=0 from Main
// // bool first_step = (m_time == m_dt); // if not
// called in Main

fillAllGhosts();
CouplingAndPotential coupling_and_potential(
m_p.coupling_and_potential_params);
FourDerivScalarTensorWithCouplingAndPotential fdst(coupling_and_potential,
m_p.G_Newton);
ModifiedPunctureGauge modified_puncture_gauge(m_p.modified_ccz4_params);
RhoDiagnostics<FourDerivScalarTensorWithCouplingAndPotential>
rho_diagnostics(fdst, m_dx, m_p.center);
BoxLoops::loop(rho_diagnostics, m_state_new, m_state_diagnostics,
EXCLUDE_GHOST_CELLS);

if (m_p.calculate_diagnostic_norms)
#ifdef USE_AHFINDER
// if print is on and there are Diagnostics to write, calculate them!
if (m_bh_amr.m_ah_finder.need_diagnostics(m_dt, m_time))
{
CouplingAndPotential coupling_and_potential(
m_p.coupling_and_potential_params);
FourDerivScalarTensorWithCouplingAndPotential fdst(
coupling_and_potential, m_p.G_Newton);
fillAllGhosts();
BoxLoops::loop(ModifiedGravityConstraints<
FourDerivScalarTensorWithCouplingAndPotential>(
fdst, m_dx, m_p.center, m_p.G_Newton, c_Ham,
Interval(c_Mom1, c_Mom3)),
m_state_new, m_state_diagnostics, EXCLUDE_GHOST_CELLS);
if (m_level == 0)
{
AMRReductions<VariableType::diagnostic> amr_reductions(m_gr_amr);
bool normalise_by_volume = true;
double L2_Ham = amr_reductions.norm(c_Ham, 2, normalise_by_volume);
double L2_Mom = amr_reductions.norm(Interval(c_Mom1, c_Mom3), 2,
normalise_by_volume);
double L2_rho_phi =
amr_reductions.norm(c_rho_phi, 2, normalise_by_volume);
SmallDataIO diagnostics_file(m_p.data_path + "diagnostic_norms",
m_dt, m_time, m_restart_time,
SmallDataIO::APPEND, first_step);
diagnostics_file.remove_duplicate_time_data();
if (first_step)
{
diagnostics_file.write_header_line(
{"L^2_Ham", "L^2_Mom", "L^2_rho_phi"});
}
diagnostics_file.write_time_data_line({L2_Ham, L2_Mom, L2_rho_phi});
}
ModifiedGravityConstraints<
FourDerivScalarTensorWithCouplingAndPotential>
constraints(fdst, m_dx, m_p.center, m_p.G_Newton, c_Ham,
Interval(c_Mom1, c_Mom3));
BoxLoops::loop(constraints, m_state_new, m_state_diagnostics,
EXCLUDE_GHOST_CELLS);
}

#ifdef USE_AHFINDER
if (m_p.AH_activate && m_level == m_p.AH_params.level_to_run)
m_bh_amr.m_ah_finder.solve(m_dt, m_time, m_restart_time);
#endif
Expand Down
5 changes: 0 additions & 5 deletions Examples/KerrBH4dST/SimulationParameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ class SimulationParameters : public ModifiedGravitySimulationParametersBase<
/// Read parameters from the parameter file
void read_params(GRParmParse &pp)
{
// Do we want diagnostic norm calculation?
pp.load("calculate_diagnostic_norms", calculate_diagnostic_norms,
false);

// Coupling and potential
pp.load("lambda_GB", coupling_and_potential_params.lambda_GB, 0.);
pp.load("quadratic_factor",
Expand Down Expand Up @@ -83,7 +79,6 @@ class SimulationParameters : public ModifiedGravitySimulationParametersBase<
}
}

bool calculate_diagnostic_norms;
double G_Newton;
InitialScalarData::params_t initial_params;
CouplingAndPotential::params_t coupling_and_potential_params;
Expand Down
16 changes: 7 additions & 9 deletions Examples/KerrBH4dST/params.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ verbosity = 0
# output_path = "" # Main path for all files. Must exist!
chk_prefix = KerrBH4dST_
plot_prefix = KerrBH4dSTp_
# restart_file = hdf5/KerrBH4dST_000200.3d.hdf5
# restart_file = hdf5/KerrBH4dST_000060.3d.hdf5

# HDF5files are written every dt = L/N*dt_multiplier*checkpoint_interval
checkpoint_interval = 50
Expand Down Expand Up @@ -38,12 +38,12 @@ print_progress_only_to_rank_0 = 1

# Change the gravitational constant of the Universe!
# Default is 1.0, for standard geometric units
G_Newton = 0.01989436788648692 # set 16*pi*G=1 in order to match the notation in arXiv:2306.14966
G_Newton = 1.

# Scalar field initial data
scalar_amplitude = 0.00001
scalar_width = 0.5
scalar_r0 = 20. # we set the Gaussian pulse far away so that it reaches the BH when the gauge has settled
scalar_r0 = 30. # we set the Gaussian pulse far away so that it reaches the BH when the gauge has settled
scalar_mass = 0.

kerr_mass = 1.0
Expand All @@ -60,8 +60,8 @@ kerr_spin = 0.8
# NB - if you have a non-cubic grid, you can specify 'N1' or 'N1_full',
# 'N2' or 'N2_full' and 'N3' or 'N3_full' ( then dx_coarsest = L/N(max) )
# NB - the N values need to be multiples of the block_factor
N_full = 128
L_full = 128
N_full = 192
L_full = 256

# Maximum number of times you can regrid above coarsest level
max_level = 6 # There are (max_level+1) grids, so min is zero
Expand Down Expand Up @@ -124,7 +124,7 @@ nonzero_asymptotic_values = 1.0 1.0 1.0 1.0 1.0

# dt will be dx*dt_multiplier on each grid level
dt_multiplier = 0.25
stop_time = 100.0
stop_time = 150.0
# max_steps = 100

# Spatial derivative order (only affects CCZ4 RHS)
Expand Down Expand Up @@ -156,14 +156,12 @@ b0 = 0.4
lambda_GB = -10.
cutoff_GB = 0.05 # excision with chi; dependent on the spin (see fig. C1 in arXiv:2112.10567)
factor_GB = 100.0
quadratic_factor = 200.
quadratic_factor = 20000.
quartic_factor = 0.

# coefficient for KO numerical dissipation
sigma = 2.0

calculate_diagnostic_norms = 1

# min_chi = 1.e-4
# min_lapse = 1.e-4

Expand Down

0 comments on commit b77315a

Please sign in to comment.