Skip to content

Commit

Permalink
Added rescaled Ham diagnostic
Browse files Browse the repository at this point in the history
  • Loading branch information
the-florist committed Jul 30, 2024
1 parent dfcbca5 commit 6b72d71
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
8 changes: 4 additions & 4 deletions Examples/ScalarField/ConstraintStatistics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ class ConstraintStatistics
CH_TIME("ConstraintStatistics::compute");

data_t Ham = current_cell.load_vars(c_Ham);
data_t HamAbs = current_cell.load_vars(c_Ham_abs_terms);
data_t HamAbsAAD = abs(HamAbs - m_Ham_abs_mean);
data_t HamAbs = current_cell.load_vars(c_Ham_abs);
data_t HamResc = Ham/m_Ham_abs_mean;
data_t HamAbsAAD = abs(HamAbs - m_Ham_abs_mean);
data_t HamVar = pow(Ham - m_Ham_mean, 2.);
data_t HamNorm = Ham/m_Ham_abs_mean;
data_t HamNormSq = HamNorm*HamNorm;
Expand All @@ -37,8 +38,7 @@ class ConstraintStatistics
data_t MomAAD = abs(Mom - m_Mom_mean);

//store class (Vars) variables as diagnostic variables on the grid
current_cell.store_vars(HamNorm, c_Ham_norm);
current_cell.store_vars(HamNormSq, c_Ham_norm_sq);
current_cell.store_vars(HamResc, c_Ham_rescaled);
current_cell.store_vars(HamVar, c_Ham_var);
current_cell.store_vars(HamAbsAAD, c_Ham_abs_AAD);
current_cell.store_vars(MomAAD, c_Mom_AAD);
Expand Down
6 changes: 2 additions & 4 deletions Examples/ScalarField/DiagnosticVariables.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ enum
c_Ham_abs_terms,
c_Mom_abs_terms,

c_Ham_norm,
c_Ham_norm_sq,
c_Ham_rescaled,
c_Ham_var,
c_Ham_abs_AAD,
c_Mom_AAD,
Expand All @@ -37,8 +36,7 @@ static const std::array<std::string, NUM_DIAGNOSTIC_VARS> variable_names = {
"Ham_abs_terms",
"Mom_abs_terms",

"HamNorm",
"HamNormSq",
"HamRescaled",
"HamVar",
"HamAbsAAD",
"MomAAD"};
Expand Down
10 changes: 5 additions & 5 deletions Examples/ScalarField/params.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
verbosity = 0

# location / naming of output files
output_path = "/nfs/st01/hpc-gr-epss/eaf49/" # random-seed-test/config4" # Main path for all files. Must exist!
output_path = "/home/eaf49/rds/hpc-work/printing-Aij" # Main path for all files. Must exist!
chk_prefix = ScalarField_
plot_prefix = ScalarFieldp_
# restart_file = ScalarField_001000.3d.hdf5
restart_file = ScalarField_002100.3d.hdf5

# HDF5files are written every dt = L/N*dt_multiplier*checkpoint_interval
checkpoint_interval = 300
# 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 = 80
num_plot_vars = 1
plot_vars = Ham
num_plot_vars = 12
plot_vars = h11 h12 h13 h22 h23 h33 A11 A12 A13 A22 A23 A33

# subpaths - specific directories for hdf5, pout, extraction data
# (these are created at runtime)
Expand Down Expand Up @@ -126,7 +126,7 @@ extrapolating_vars = phi Pi
# dt will be dx*dt_multiplier on each grid level
dt_multiplier = 0.25
stop_time = 40
max_steps = 5
max_steps = 3500

# Spatial derivative order (only affects CCZ4 RHS)
max_spatial_derivative_order = 4 # can be 4 or 6
Expand Down
2 changes: 1 addition & 1 deletion Source/InitialConditions/ScalarFields/RandomField.impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ inline void RandomField::clear_data()
inline void RandomField::calc_spectrum()
{
int N = m_params.Nf;
std::string printdir = "/nfs/st01/hpc-gr-epss/eaf49/";
std::string printdir = "/home/eaf49/rds/hpc-work/";
int pair = 1;

// Setting the lut that maps polarisation vectors to
Expand Down

0 comments on commit 6b72d71

Please sign in to comment.