Skip to content

Commit

Permalink
Improvements: Add GRDzhadzha as dependency (#20)
Browse files Browse the repository at this point in the history
* Removed redundant code and added GRDzhadzha as dependency

* changing variable structs to match GRDzhadzha name definitions

* Set GRDzhadzha as dependency and debugged examples/tests

* update CI workflows to include GRDzhadzha checkout

* clang format

* Removed redundant code
Renamed Matter folder to ProcaFields
Moved FluxExtraction code to Diagnostics folder
Renamed DefaultBackground class to Minkowski

* Renamed Matter folder in GNUMakeFiles to ProcaFields

* renamed all instances of KerrSchildNew to KerrSchild
Renamed DefaultBackground file to Minkowski

* clang format

* clang format
  • Loading branch information
ShaunFell authored Oct 2, 2024
1 parent f00b31f commit 4f6a7d1
Show file tree
Hide file tree
Showing 111 changed files with 365 additions and 6,137 deletions.
11 changes: 5 additions & 6 deletions Examples/EMMinkowski/EMFieldLevel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ Example of defining a level class that sets simple initial conditions

#include "BaseProcaFieldLevel.hpp"
#include "BoxLoops.hpp"
#include "DefaultBackground.hpp"
#include "ExcisionEvolution.hpp"
#include "InitialConditions.hpp"
#include "Minkowski.hpp"
#include "ProcaField.hpp"
#include "UserVariables.hpp"

// Inherits from BaseProcaFieldLevel with background = DefaultBackground and
// Inherits from BaseProcaFieldLevel with background = Minkowski and
// matter = Default
class EMFieldLevel : public BaseProcaFieldLevel<DefaultBackground, ProcaField>
class EMFieldLevel : public BaseProcaFieldLevel<Minkowski, ProcaField>
{
public:
// inherit constructor from base class
Expand All @@ -34,9 +34,8 @@ class EMFieldLevel : public BaseProcaFieldLevel<DefaultBackground, ProcaField>
INCLUDE_GHOST_CELLS);

// Excise within horizon
DefaultBackground kerr_schild(m_p.background_params, m_dx);
ExcisionEvolution<BaseProcaField<DefaultBackground, ProcaField>,
DefaultBackground>
Minkowski kerr_schild(m_p.background_params, m_dx);
ExcisionEvolution<BaseProcaField<Minkowski, ProcaField>, Minkowski>
excisor(m_dx, m_p.center, m_p.evolution_excision_width,
kerr_schild);

Expand Down
8 changes: 5 additions & 3 deletions Examples/EMMinkowski/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ src_dirs := $(GRCHOMBO_SOURCE)/utils \
$(GRCHOMBO_SOURCE)/BoxUtils \
$(GRCHOMBO_SOURCE)/TaggingCriteria \
$(GRCHOMBO_SOURCE)/GRChomboCore \
$(GRCHOMBO_SOURCE)/AMRInterpolator \
$(GRCHOMBO_SOURCE)/AMRInterpolator \
$(GRBoondi_SOURCE)/Background \
$(GRBoondi_SOURCE)/Matter \
$(GRBoondi_SOURCE)/ProcaFields \
$(GRBoondi_SOURCE)/Diagnostics \
$(GRBoondi_SOURCE)/Core \
$(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/EMMinkowski/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 "DefaultBackground.hpp" //background class
#include "Minkowski.hpp" //background class
#include "Tensor.hpp"
#include "TensorAlgebra.hpp"

Expand All @@ -24,15 +24,15 @@ class Initial_EM_Conditions

protected:
const params_t m_params;
const DefaultBackground::params_t m_Kerr_params;
const Minkowski::params_t m_Kerr_params;
const double m_dx;

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

public:
Initial_EM_Conditions(const double a_dx, params_t a_params,
const DefaultBackground::params_t a_Kerr_params)
const Minkowski::params_t a_Kerr_params)
: m_params{a_params}, m_dx{a_dx}, m_Kerr_params{a_Kerr_params} {};

template <class data_t> void compute(Cell<data_t> current_cell) const
Expand Down
14 changes: 7 additions & 7 deletions Examples/EMMinkowski/ProcaField.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ This class adds the simplest L2 lagrangian to the base equations of motion
#include "ADMFixedBGVars.hpp"
#include "ADMProcaVars.hpp"
#include "BaseProcaField.hpp"
#include "DefaultBackground.hpp"
#include "Minkowski.hpp"

// Note: base class BaseProcaField uses CRTP, so pass ProcaField itself as
// template argument
class ProcaField : public BaseProcaField<DefaultBackground, ProcaField>
class ProcaField : public BaseProcaField<Minkowski, ProcaField>
{
protected:
template <class data_t>
using MatterVars = typename ADMProcaVars::MatterVars<data_t>;
using MatterVars = typename ADMProcaVars::Vars<data_t>;

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

template <class data_t>
using MetricVars = typename ADMFixedBGVars::template Vars<data_t>;
Expand All @@ -28,10 +28,10 @@ class ProcaField : public BaseProcaField<DefaultBackground, ProcaField>
{
};

DefaultBackground m_background;
Minkowski m_background;

ProcaField(DefaultBackground a_background, params_t a_params)
: BaseProcaField<DefaultBackground, ProcaField>(a_background),
ProcaField(Minkowski a_background, params_t a_params)
: BaseProcaField<Minkowski, ProcaField>(a_background),
m_background(a_background){};

template <class data_t>
Expand Down
4 changes: 2 additions & 2 deletions Examples/EMMinkowski/SimulationParameters.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef SIMULATIONPARAMETERS_HPP_
#define SIMULATIONPARAMETERS_HPP_

#include "DefaultBackground.hpp"
#include "InitialConditions.hpp"
#include "Minkowski.hpp"
#include "ProcaField.hpp"
#include "ProcaSimulationParameters.hpp"

Expand All @@ -25,7 +25,7 @@ class SimulationParameters : public ProcaSimulationParameters
}

// parameters of kerr bh
DefaultBackground::params_t background_params;
Minkowski::params_t background_params;

// initial conditions parameters
Initial_EM_Conditions::params_t initial_conditions_params;
Expand Down
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: 5 additions & 3 deletions Examples/NonLinearProcaKerrBH/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ src_dirs := $(GRCHOMBO_SOURCE)/utils \
$(GRCHOMBO_SOURCE)/BoxUtils \
$(GRCHOMBO_SOURCE)/TaggingCriteria \
$(GRCHOMBO_SOURCE)/GRChomboCore \
$(GRCHOMBO_SOURCE)/AMRInterpolator \
$(GRCHOMBO_SOURCE)/AMRInterpolator \
$(GRBoondi_SOURCE)/Background \
$(GRBoondi_SOURCE)/Matter \
$(GRBoondi_SOURCE)/ProcaFields \
$(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
2 changes: 1 addition & 1 deletion Examples/NonLinearProcaKerrBH/InitialConditions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Initial_Proca_Conditions

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

template <class data_t>
using MetricVars = typename ADMFixedBGVars::Vars<data_t>;
Expand Down
2 changes: 1 addition & 1 deletion Examples/NonLinearProcaKerrBH/NonlinearG2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class NonlinearG2
protected:
params_t m_params;

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

template <class data_t>
using MetricVars = typename ADMFixedBGVars::template Vars<data_t>;
Expand Down
4 changes: 2 additions & 2 deletions Examples/NonLinearProcaKerrBH/NonlinearProcaFieldLevel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "CustomTaggingCriterion.hpp"
#include "SecondClassConstraint.hpp"

// Inherits from BaseProcaFieldLevel with background = KerrSchild and matter =
// ProcaField
// Inherits from BaseProcaFieldLevel with background = KerrSchild and matter
// = ProcaField
class ProcaFieldLevel : public BaseProcaFieldLevel<KerrSchild, ProcaField>
{
public:
Expand Down
25 changes: 12 additions & 13 deletions Examples/NonLinearProcaKerrBH/ProcaField.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ This class adds the simplest L2 lagrangian to the base equations of motion
class ProcaField : public BaseProcaField<KerrSchild, ProcaField>
{

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

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

template <class data_t>
using MetricVars = typename ADMFixedBGVars::template Vars<data_t>;
Expand Down Expand Up @@ -63,10 +62,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 @@ -75,12 +74,12 @@ 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
rhs_vars_t<data_t> &total_rhs, // RHS terms for all vars
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
2 changes: 1 addition & 1 deletion Examples/NonLinearProcaKerrBH/SecondClassConstraint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ template <class background_t> class SecondClassConstraint

// typename the matter variables
template <class data_t>
using MatterVars = typename ADMProcaVars::MatterVars<data_t>;
using MatterVars = typename ADMProcaVars::Vars<data_t>;

// typename the metric variables
template <class data_t>
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: 4 additions & 2 deletions Examples/ProcaKerrBH/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ src_dirs := $(GRCHOMBO_SOURCE)/utils \
$(GRCHOMBO_SOURCE)/GRChomboCore \
$(GRCHOMBO_SOURCE)/AMRInterpolator \
$(GRBoondi_SOURCE)/Background \
$(GRBoondi_SOURCE)/Matter \
$(GRBoondi_SOURCE)/ProcaFields \
$(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
2 changes: 1 addition & 1 deletion Examples/ProcaKerrBH/InitialConditions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Initial_Proca_Conditions

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

template <class data_t>
using MetricVars = typename ADMFixedBGVars::Vars<data_t>;
Expand Down
Loading

0 comments on commit 4f6a7d1

Please sign in to comment.