Skip to content

Commit

Permalink
Cleaned up RF a bit, added some couts to SFL, added trace free test t…
Browse files Browse the repository at this point in the history
…o RF and took out randomisation
  • Loading branch information
the-florist committed Jul 3, 2024
1 parent 1c5d896 commit 93744bb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions Examples/ScalarField/ScalarFieldLevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ void ScalarFieldLevel::initialData()

pfield.clear_data();
pout() << "Calculating position ICs ended.\n";
cout << "Trace-free condition passed for position.\n";

/*RandomField vfield(m_p.random_field_params, m_p.initial_params, "velocity");
Expand Down
12 changes: 6 additions & 6 deletions Examples/ScalarField/params.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
verbosity = 0

# location / naming of output files
output_path = "/nfs/st01/hpc-gr-epss/eaf49/" # convergence-tests/4th-order-stencils/one-mode/N256" # Main path for all files. Must exist!
output_path = "/home/eaf49/rds/hpc-work/dump" # Main path for all files. Must exist!
chk_prefix = ScalarField_
plot_prefix = ScalarFieldp_
# restart_file = ScalarField_001000.3d.hdf5
Expand All @@ -16,9 +16,9 @@ plot_prefix = ScalarFieldp_
checkpoint_interval = 500
# 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 = -1
num_plot_vars = 8
plot_vars = h11 h12 h13 h22 h23 h33 Ham Mom
plot_interval = 100
num_plot_vars = 6
plot_vars = h11 h12 h13 h22 h23 h33

# subpaths - specific directories for hdf5, pout, extraction data
# (these are created at runtime)
Expand All @@ -44,8 +44,8 @@ m_pl = 1.0
scalar_amplitude = 10.0
scalar_velocity = -0.00162845913015181
scalar_mass = 0.01
tensor_amplitude = 1.e-4
N_fine = 128
tensor_amplitude = 1.

#################################################
# Grid parameters
Expand Down Expand Up @@ -125,7 +125,7 @@ extrapolating_vars = phi Pi

# dt will be dx*dt_multiplier on each grid level
dt_multiplier = 0.25
stop_time = 40
stop_time = 10
max_steps = 2

# Spatial derivative order (only affects CCZ4 RHS)
Expand Down
2 changes: 1 addition & 1 deletion Source/InitialConditions/ScalarFields/RandomField.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class RandomField
int flip_index(int I, int N);
int invert_index(int I, int N);
int invert_index_with_sign(int I, int N);
double find_rayleigh_factor(double km, std::string spec_type, int comp);
double find_rayleigh_factor(double km, std::string spec_type, double uniform_draw);
void apply_symmetry_rules(int i, int j, int k, double field[][2], int N);
void calc_transferse_vectors(int x, int y, int z, int N, double MHat[3], double NHat[3], double a = 0.);
void Test_norm(double vec[]);
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 @@ -385,7 +385,7 @@ inline void RandomField::apply_symmetry_rules(int i, int j, int k, double field[
}
}

inline double RandomField::find_rayleigh_factor(double km, std::string spec_type, int comp)
inline double RandomField::find_rayleigh_factor(double km, std::string spec_type, double uniform_draw)
{
if(km < 1.e-12) { return 0.; } // P(k=0), for m=0

Expand Down

0 comments on commit 93744bb

Please sign in to comment.