Skip to content

Commit

Permalink
Set GRDzhadzha as dependency and debugged examples/tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaunFell committed Sep 5, 2024
1 parent 0d1300e commit bee6cf7
Show file tree
Hide file tree
Showing 35 changed files with 308 additions and 213 deletions.
8 changes: 4 additions & 4 deletions Examples/EMMinkowski/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ src_dirs := $(GRCHOMBO_SOURCE)/utils \
$(GRCHOMBO_SOURCE)/BoxUtils \
$(GRCHOMBO_SOURCE)/TaggingCriteria \
$(GRCHOMBO_SOURCE)/GRChomboCore \
$(GRCHOMBO_SOURCE)/AMRInterpolator \
$(GRDZHADZHA_SOURCE)/Background \
$(GRDZHADZHA_SOURCE)/Matter \
$(GRCHOMBO_SOURCE)/AMRInterpolator \
$(GRBoondi_SOURCE)/Background \
$(GRBoondi_SOURCE)/Matter \
$(GRBoondi_SOURCE)/Diagnostics \
$(GRBoondi_SOURCE)/Core \
$(GRBoondi_SOURCE)/utils
$(GRBoondi_SOURCE)/utils \
$(GRDZHADZHA_SOURCE)/Background \
$(GRDZHADZHA_SOURCE)/Matter

include $(CHOMBO_HOME)/mk/Make.test
18 changes: 9 additions & 9 deletions Examples/EMMinkowski/params.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
verbosity = 1

# location / naming of output files
output_path = "/pfs/work7/workspace/scratch/hd_pb293-WS_GRBoondi/testing/TEST_EMFIELD_MAXMINS"
output_path = "/mnt/DataDrive/Data_Store/GRBoondi/EMMinkowski"

#filename prefixes for checkpoint files and plot files
chk_prefix = "GeneralizedProca_"
plot_prefix = "GeneralizedProcap_"
chk_prefix = "EMMinkowski_"
plot_prefix = "EMMinkowskip_"

#file to restart the simulation from
#restart_file = GeneralizedProca_000003.3d.hdf5
Expand All @@ -20,7 +20,7 @@ plot_prefix = "GeneralizedProcap_"
checkpoint_interval = 100
# set to 0 to turn off plot files (except at t=0 and t=stop_time)
# set to -1 to never ever print plotfiles
plot_interval = 20
plot_interval = 1

#plot variable names must match those in the DiagnosticVariables::DiagnosticVariables namespace
num_plot_vars = 4
Expand Down Expand Up @@ -53,10 +53,10 @@ activate_tagging_diagnostic = 0
##################################################

#max level is the number of additional refinement levels. So max_level=4 --> 5 total levels
max_level = 4
max_level = 3

#Since we use fixed grid tagging, we dont ever need to regrid
regrid_interval = 0 0 0 0
regrid_interval = 0 0 0

################################################## Initial Data parameters
##################################################
Expand All @@ -76,7 +76,7 @@ z_damping = 1.0
##################################################

N_full = 32
L_full = 64
L_full = 32

# Max and min box sizes
max_box_size = 32
Expand Down Expand Up @@ -169,9 +169,9 @@ diagnostic_excision_vars = rho rhoE rhoJ rhoLinMom sourceLinMom
################################################## Extraction
##################################################

activate_extraction = 1 # extraction of surface quantities
activate_extraction = 0 # extraction of surface quantities
activate_integration = 1 # integration of densities
activate_minmax = 1 # extraction of minimum and maximum values
activate_minmax = 0 # extraction of minimum and maximum values

num_extraction_radii = 2
extraction_radii = 1.6 30
Expand Down
8 changes: 4 additions & 4 deletions Examples/NonLinearProcaKerrBH/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ src_dirs := $(GRCHOMBO_SOURCE)/utils \
$(GRCHOMBO_SOURCE)/BoxUtils \
$(GRCHOMBO_SOURCE)/TaggingCriteria \
$(GRCHOMBO_SOURCE)/GRChomboCore \
$(GRCHOMBO_SOURCE)/AMRInterpolator \
$(GRDZHADZHA_SOURCE)/Background \
$(GRDZHADZHA_SOURCE)/Matter \
$(GRCHOMBO_SOURCE)/AMRInterpolator \
$(GRBoondi_SOURCE)/Background \
$(GRBoondi_SOURCE)/Matter \
$(GRBoondi_SOURCE)/Diagnostics \
$(GRBoondi_SOURCE)/Core \
$(GRBoondi_SOURCE)/Lagrangians \
$(GRBoondi_SOURCE)/utils
$(GRBoondi_SOURCE)/utils \
$(GRDZHADZHA_SOURCE)/Background \
$(GRDZHADZHA_SOURCE)/Matter

include $(CHOMBO_HOME)/mk/Make.test
8 changes: 4 additions & 4 deletions Examples/NonLinearProcaKerrBH/InitialConditions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This example sets the initial data to be a uniform magnetic field
#include "ADMProcaVars.hpp"
#include "BaseProcaField.hpp"
#include "Cell.hpp"
#include "KerrSchild.hpp" //background class
#include "KerrSchildNew.hpp" //background class
#include "L2_simp.hpp"
#include "ProcaField.hpp" //for proca parameters
#include "Tensor.hpp"
Expand All @@ -31,19 +31,19 @@ class Initial_Proca_Conditions
template <class data_t>
using MetricVars = typename ADMFixedBGVars::Vars<data_t>;

using KerrParams = KerrSchild::params_t;
using KerrParams = KerrSchildNew::params_t;

const params_t m_params; // initial amplitude
const ProcaField::params_t m_matter_params; // Proca mass and coupling
const KerrParams m_Kerr_params; // black hole parameters

KerrSchild m_background;
KerrSchildNew m_background;
double m_dx;

public:
Initial_Proca_Conditions(double a_dx, params_t a_params,
ProcaField::params_t a_matter_params,
KerrParams a_Kerr_params, KerrSchild a_background)
KerrParams a_Kerr_params, KerrSchildNew a_background)
: m_dx{a_dx}, m_params{a_params}, m_matter_params{a_matter_params},
m_Kerr_params{a_Kerr_params}, m_background(a_background){};

Expand Down
22 changes: 11 additions & 11 deletions Examples/NonLinearProcaKerrBH/NonlinearProcaFieldLevel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
#include "BoxLoops.hpp"
#include "ExcisionEvolution.hpp"
#include "InitialConditions.hpp"
#include "KerrSchild.hpp"
#include "KerrSchildNew.hpp"
#include "ProcaField.hpp"
#include "UserVariables.hpp"

// constraint tagging
#include "CustomTaggingCriterion.hpp"
#include "SecondClassConstraint.hpp"

// Inherits from BaseProcaFieldLevel with background = KerrSchild and matter =
// Inherits from BaseProcaFieldLevel with background = KerrSchildNew and matter =
// ProcaField
class ProcaFieldLevel : public BaseProcaFieldLevel<KerrSchild, ProcaField>
class ProcaFieldLevel : public BaseProcaFieldLevel<KerrSchildNew, ProcaField>
{
public:
// inherit constructor from base class (note: BaseProcaFieldLevel itself
Expand All @@ -26,7 +26,7 @@ class ProcaFieldLevel : public BaseProcaFieldLevel<KerrSchild, ProcaField>
virtual void initialData() override
{

KerrSchild kerr_schild(m_p.background_params, m_dx);
KerrSchildNew kerr_schild(m_p.background_params, m_dx);

// Initialize the initial conditions class
Initial_Proca_Conditions initial_conditions(
Expand All @@ -38,7 +38,7 @@ class ProcaFieldLevel : public BaseProcaFieldLevel<KerrSchild, ProcaField>
INCLUDE_GHOST_CELLS);

// Excise within horizon
ExcisionEvolution<ProcaField, KerrSchild> excisor(
ExcisionEvolution<ProcaField, KerrSchildNew> excisor(
m_dx, m_p.center, m_p.evolution_excision_width, kerr_schild);

// Loop over box cells and excise cells within horizon
Expand Down Expand Up @@ -114,7 +114,7 @@ class ProcaFieldLevel : public BaseProcaFieldLevel<KerrSchild, ProcaField>

// Check for naked singularities!
// Note: This error check is already present in the constructor for
// the KerrSchild class.
// the KerrSchildNew class.
// We check it here and use a different error message
// related to the black hole evolution code above
if ((m_p.background_params.spin > m_p.background_params.mass) ||
Expand Down Expand Up @@ -152,13 +152,13 @@ class ProcaFieldLevel : public BaseProcaFieldLevel<KerrSchild, ProcaField>
virtual void additionalPrePlotLevel() override
{
// Initialize the background class
KerrSchild kerr_schild(m_p.background_params, m_dx);
KerrSchildNew kerr_schild(m_p.background_params, m_dx);

// Initialize the Proca field class
ProcaField proca_field(kerr_schild, m_p.matter_params);

// Initialize the constraint class, to be computed on the grid
SecondClassConstraint<KerrSchild> constraint(m_dx, m_p.center,
SecondClassConstraint<KerrSchildNew> constraint(m_dx, m_p.center,
kerr_schild, proca_field);

// Loop over the box cells and compute the constraint on the grid
Expand All @@ -179,13 +179,13 @@ class ProcaFieldLevel : public BaseProcaFieldLevel<KerrSchild, ProcaField>
// We dont need any derivatives, so no need to populate ghost cells

// Initialize the background class
KerrSchild kerr_schild(m_p.background_params, m_dx);
KerrSchildNew kerr_schild(m_p.background_params, m_dx);

// Initialize the Proca field class
ProcaField proca_field(kerr_schild, m_p.matter_params);

// Initialize the constraint class, to be computed on the grid
SecondClassConstraint<KerrSchild> constraint(
SecondClassConstraint<KerrSchildNew> constraint(
m_dx, m_p.center, kerr_schild, proca_field);

// Loop over the box cells and compute the constraint on the grid
Expand All @@ -195,7 +195,7 @@ class ProcaFieldLevel : public BaseProcaFieldLevel<KerrSchild, ProcaField>
const std::vector<int> vars_to_excise =
DiagnosticVariables::convert_pairs_to_enum(
m_p.diagnostic_excision_vars);
ExcisionDiagnostics<ProcaField, KerrSchild> excisor(
ExcisionDiagnostics<ProcaField, KerrSchildNew> excisor(
kerr_schild, m_dx, m_p.center, m_p.diagnostic_inner_boundary,
m_p.diagnostic_outer_boundary, vars_to_excise);

Expand Down
32 changes: 16 additions & 16 deletions Examples/NonLinearProcaKerrBH/ProcaField.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ This class adds the simplest L2 lagrangian to the base equations of motion
#include "ADMFixedBGVars.hpp"
#include "ADMProcaVars.hpp"
#include "BaseProcaField.hpp"
#include "KerrSchild.hpp"
#include "KerrSchildNew.hpp"
#include "L2_simp.hpp"
#include "NonlinearG2.hpp"

// Note: base class BaseProcaField uses CRTP, so pass ProcaField itself as
// template argument
class ProcaField : public BaseProcaField<KerrSchild, ProcaField>
class ProcaField : public BaseProcaField<KerrSchildNew, ProcaField>
{

protected:
public:
template <class data_t>
using MatterVars = typename ADMProcaVars::Vars<data_t>;
using Vars = typename ADMProcaVars::Vars<data_t>;

template <class data_t>
using MatterVarsD2 = typename ADMProcaVars::Diff2Vars<data_t>;
using Diff2Vars = typename ADMProcaVars::Diff2Vars<data_t>;

template <class data_t>
using MetricVars = typename ADMFixedBGVars::template Vars<data_t>;
Expand All @@ -37,13 +37,13 @@ class ProcaField : public BaseProcaField<KerrSchild, ProcaField>
double self_interaction;
};

KerrSchild m_background;
KerrSchildNew m_background;
params_t m_params;
L2_t m_L2;
NonlinearG2 m_G2;

ProcaField(KerrSchild a_background, params_t a_params)
: BaseProcaField<KerrSchild, ProcaField>(a_background),
ProcaField(KerrSchildNew a_background, params_t a_params)
: BaseProcaField<KerrSchildNew, ProcaField>(a_background),
m_background(a_background), m_params(a_params)
{
// set up the L2 lagrangian
Expand All @@ -63,10 +63,10 @@ class ProcaField : public BaseProcaField<KerrSchild, ProcaField>
void compute_emtensor_modification(
emtensor_t<data_t>
&base_emtensor, // pass by reference to allow modifications
const MatterVars<data_t> &vars, const MetricVars<data_t> &metric_vars,
const MatterVars<Tensor<1, data_t>> &d1,
const MatterVarsD2<Tensor<2, data_t>> &d2, // 2nd derivs
const MatterVars<data_t> &advec // value of the beta^i d_i(var) terms
const Vars<data_t> &vars, const MetricVars<data_t> &metric_vars,
const Vars<Tensor<1, data_t>> &d1,
const Diff2Vars<Tensor<2, data_t>> &d2, // 2nd derivs
const Vars<data_t> &advec // value of the beta^i d_i(var) terms
) const
{
m_L2.compute_emtensor_modification(base_emtensor, vars, metric_vars, d1,
Expand All @@ -76,11 +76,11 @@ class ProcaField : public BaseProcaField<KerrSchild, ProcaField>
template <class data_t, template <typename> class rhs_vars_t>
void matter_rhs_modification(
rhs_vars_t<data_t> &total_rhs, // RHS terms for all vars
const MatterVars<data_t> &matter_vars, // the value fo the variables
const Vars<data_t> &matter_vars, // the value fo the variables
const MetricVars<data_t> &metric_vars,
const MatterVars<Tensor<1, data_t>> &d1, // value of 1st derivs
const MatterVarsD2<Tensor<2, data_t>> &d2, // 2nd derivs
const MatterVars<data_t> &advec // value of the beta^i d_i(var) terms
const Vars<Tensor<1, data_t>> &d1, // value of 1st derivs
const Diff2Vars<Tensor<2, data_t>> &d2, // 2nd derivs
const Vars<data_t> &advec // value of the beta^i d_i(var) terms
) const
{
// add modifications coming from L2 lagrangian
Expand Down
4 changes: 2 additions & 2 deletions Examples/NonLinearProcaKerrBH/SimulationParameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define SIMULATIONPARAMETERS_HPP_

#include "InitialConditions.hpp"
#include "KerrSchild.hpp"
#include "KerrSchildNew.hpp"
#include "L2_simp.hpp"
#include "ProcaField.hpp"
#include "ProcaSimulationParameters.hpp"
Expand Down Expand Up @@ -50,7 +50,7 @@ class SimulationParameters : public ProcaSimulationParameters
}

// parameters of kerr bh
KerrSchild::params_t background_params;
KerrSchildNew::params_t background_params;

// initial conditions parameters
Initial_Proca_Conditions::params_t initial_conditions_params;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@
verbosity = 0

# location / naming of output files
output_path = "/pfs/work7/workspace/scratch/hd_pb293-WS_GRChombo/testing/GRMilijun_NonlinearProcaKerrBH_23332201"
output_path = "/mnt/DataDrive/Data_Store/GRBoondi/NonlinearProca"

#filename prefixes for checkpoint files and plot files
chk_prefix = "GeneralizedProca_"
plot_prefix = "GeneralizedProcap_"

#file to restart the simulation from
#restart_file = GeneralizedProca_000003.3d.hdf5
run_initial_posttimestep = 1

# HDF5files are written every dt = L/N*dt_multiplier*checkpoint_interval
checkpoint_interval = 100
# set to 0 to turn off plot files (except at t=0 and t=stop_time)
# set to -1 to never ever print plotfiles
plot_interval = 20
plot_interval = 1

#plot variable names must match those in the DiagnosticVariables::DiagnosticVariables namespace
num_plot_vars = 7
Expand Down Expand Up @@ -48,11 +49,11 @@ activate_gnn_tagging = 1
################################################# AMR levels
##################################################

max_level = 4
max_level = 3

#Since we use fixed grid tagging, we dont ever need to regrid
regrid_interval = 0 10 2 1
regrid_threshold = 0.005
regrid_interval = 0 0 0
regrid_threshold = 0

################################################## Initial Data parameters
##################################################
Expand Down Expand Up @@ -80,12 +81,12 @@ z_damping = 1.0
################################################## Grid parameters
##################################################

N_full = 240
L_full = 96
N_full = 32
L_full = 32

# Max and min box sizes
max_box_size = 40
min_box_size = 40
max_box_size = 32
min_box_size = 32

block_factor = 8

Expand Down Expand Up @@ -174,7 +175,7 @@ diagnostic_excision_vars = rho rhoE rhoJ rhoLinMom sourceLinMom
################################################## Extraction
##################################################

activate_extraction = 1 # extraction of fluxes
activate_extraction = 0 # extraction of fluxes
activate_integration = 1 # integration of densities

num_extraction_radii = 2
Expand Down
6 changes: 3 additions & 3 deletions Examples/ProcaKerrBH/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ src_dirs := $(GRCHOMBO_SOURCE)/utils \
$(GRCHOMBO_SOURCE)/TaggingCriteria \
$(GRCHOMBO_SOURCE)/GRChomboCore \
$(GRCHOMBO_SOURCE)/AMRInterpolator \
$(GRDZHADZHA_SOURCE)/Background \
$(GRDZHADZHA_SOURCE)/Matter \
$(GRBoondi_SOURCE)/Background \
$(GRBoondi_SOURCE)/Matter \
$(GRBoondi_SOURCE)/Diagnostics \
$(GRBoondi_SOURCE)/Core \
$(GRBoondi_SOURCE)/Lagrangians \
$(GRBoondi_SOURCE)/utils
$(GRBoondi_SOURCE)/utils \
$(GRDZHADZHA_SOURCE)/Background \
$(GRDZHADZHA_SOURCE)/Matter

include $(CHOMBO_HOME)/mk/Make.test
Loading

0 comments on commit bee6cf7

Please sign in to comment.