diff --git a/Examples/ScalarField/ScalarFieldLevel.cpp b/Examples/ScalarField/ScalarFieldLevel.cpp index 49d043da6..5a1215b16 100644 --- a/Examples/ScalarField/ScalarFieldLevel.cpp +++ b/Examples/ScalarField/ScalarFieldLevel.cpp @@ -187,6 +187,7 @@ void ScalarFieldLevel::specificPostTimeStep() double mass = m_p.potential_params.scalar_mass; AMRReductions amr_reductions(m_gr_amr); + AMRReductions amr_evo_reductions(m_gr_amr); double vol = amr_reductions.get_domain_volume(); BoxLoops::loop(MeansVars(m_dx, m_p.grid_params, m_p.data_path), m_state_new, m_state_diagnostics, FILL_GHOST_CELLS); @@ -198,7 +199,7 @@ void ScalarFieldLevel::specificPostTimeStep() double a = 1./sqrt(amr_reductions.sum(c_a)/vol); double H = -amr_reductions.sum(c_H)/vol/3.; - double hambar = amr_reductions.sum(c_Ham)/vol; + //double hambar = amr_reductions.sum(c_Ham)/vol; double hamabspbpSum = amr_reductions.sum(c_Ham_abs_pbp)/vol; double mombar = amr_reductions.sum(c_Mom)/vol; double habsbar = amr_reductions.sum(c_Ham_abs_terms)/vol; @@ -213,11 +214,13 @@ void ScalarFieldLevel::specificPostTimeStep() //Calculates variances double phivar = amr_reductions.sum(c_sf2)/vol - phibar*phibar; - double chivar = amr_reductions.sum(c_ch2)/vol - c_a*c_a; + double chivar = amr_reductions.sum(c_ch2)/vol - pow(amr_reductions.sum(c_a)/vol, 2.); //Calculates gauge quantities - double lapse = amr_reductions.sum(c_lapse)/vol; - double shift[3] = {amr_reductions.sum(c_shift1)/vol, amr_reductions.sum(c_shift2)/vol, amr_reductions.sum(c_shift3)/vol}; + double lapse = amr_evo_reductions.sum(c_lapse)/vol; + double shift[3] = {amr_evo_reductions.sum(c_shift1)/vol, + amr_evo_reductions.sum(c_shift2)/vol, + amr_evo_reductions.sum(c_shift3)/vol}; //Prints all that out into the data/ directory SmallDataIO means_file(m_p.data_path+"means_file", m_dt, m_time, m_restart_time, SmallDataIO::APPEND, first_step, ".dat"); @@ -225,9 +228,10 @@ void ScalarFieldLevel::specificPostTimeStep() if(first_step) { - means_file.write_header_line({"Scalar field mean","Scalar field variance","Pi mean","Scale factor","Conformal factor variance","Hubble factor", - "Kinetic ED","Potential ED","First SRP","Second SRP","Avg Ham constr","Avg |Ham| constr (point by point)","Avg Mom constr", - "Avg Ham abs term","Avg Mom abs term","Avg lapse"}); + means_file.write_header_line({"SF mean ","SF variance ","Pi mean ","a ","chi variance ","H ", + "First SRP ","Second SRP ","|H| pbp norm ","M ","MAbs ","lapse ","shift 1 ","shift 2 ","shift 3"}); // "Kinetic ED ","Potential ED ", "Avg |Ham| constr (point by point) ","Avg Mom constr ", + //"Avg Ham abs term ","Avg Mom abs term ", } - means_file.write_time_data_line({phibar, phivar, pibar, a, chivar, H, kinb, potb, epsilon, delta, hambar, hamabspbpSum, mombar, habsbar, mabsbar, lapse}); + means_file.write_time_data_line({phibar, phivar, pibar, a, chivar, H, epsilon, delta, hamabspbpSum/habsbar, mombar, mabsbar, lapse, + shift[0], shift[1], shift[2]}); // kinb, potb, } diff --git a/Examples/ScalarField/params.txt b/Examples/ScalarField/params.txt index 54bb328e8..d07f8469b 100644 --- a/Examples/ScalarField/params.txt +++ b/Examples/ScalarField/params.txt @@ -7,7 +7,7 @@ verbosity = 0 # location / naming of output files -output_path = "/home/eaf49/rds/hpc-work/hdf5-beta-check" # 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_002000.3d.hdf5 @@ -17,8 +17,8 @@ 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 = 100 -num_plot_vars = 11 -plot_vars = chi h11 h12 h13 h22 h23 h33 Ham Mom Ham_abs_terms Mom_abs_terms lapse shift1 shift2 shift3 +num_plot_vars = 15 +plot_vars = chi Ham Mom 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) diff --git a/Source/InitialConditions/ScalarFields/RandomField.impl.hpp b/Source/InitialConditions/ScalarFields/RandomField.impl.hpp index 56b508d21..8c4d3e0c9 100644 --- a/Source/InitialConditions/ScalarFields/RandomField.impl.hpp +++ b/Source/InitialConditions/ScalarFields/RandomField.impl.hpp @@ -13,18 +13,13 @@ inline RandomField::RandomField(InitialScalarData::params_t a_params, std::string a_spec_type) : m_params(a_params), m_spec_type(a_spec_type) { -<<<<<<< HEAD - kstar = 16.*(2.*M_PI/m_params.L); - epsilon = 0.5; -======= N = m_params.N; debug = false; - kstar = 32.*(2.*M_PI/m_params.L); - epsilon = 0.05; ->>>>>>> IC-feature + kstar = 16.*(2.*M_PI/m_params.L); + epsilon = 0.5; H0 = -3.0*sqrt((8.0 * M_PI/3.0/m_params.m_pl/m_params.m_pl) *(0.5*m_params.velocity*m_params.velocity + 0.5*pow(m_params.m * m_params.amplitude, 2.0))); - norm = pow(m_params.N, 3.); + norm = pow(N, 3.); calc_spectrum(); } @@ -88,19 +83,19 @@ void RandomField::compute(Cell current_cell) const else if(m_spec_type == "velocity") { - /*current_cell.store_vars(0., c_A11); + current_cell.store_vars(0., c_A11); current_cell.store_vars(0., c_A12); current_cell.store_vars(0., c_A13); current_cell.store_vars(0., c_A22); current_cell.store_vars(0., c_A23); - current_cell.store_vars(0., c_A33);*/ + current_cell.store_vars(0., c_A33); - current_cell.store_vars(-m_params.A * hx[0][r], c_A11); + /*current_cell.store_vars(-m_params.A * hx[0][r], c_A11); current_cell.store_vars(-m_params.A * hx[1][r], c_A12); current_cell.store_vars(-m_params.A * hx[2][r], c_A13); current_cell.store_vars(-m_params.A * hx[4][r], c_A22); current_cell.store_vars(-m_params.A * hx[5][r], c_A23); - current_cell.store_vars(-m_params.A * hx[8][r], c_A33); + current_cell.store_vars(-m_params.A * hx[8][r], c_A33);*/ } else { MayDay::Error("RandomField: Spec type entered is not a viable option."); } @@ -256,7 +251,7 @@ void RandomField::calc_spectrum() } hkprint.close(); - //MayDay::Error("Printed file for comparison with stand-alone IC generator."); + MayDay::Error("Printed file for comparison with stand-alone IC generator."); pout() << "Moving to configuration space.\n";