Skip to content

Commit

Permalink
clang-formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaunFell committed Apr 15, 2024
1 parent d9ceb0c commit 44d8b7e
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 34 deletions.
39 changes: 34 additions & 5 deletions Source/Background/KerrdeSitter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class KerrdeSitter

// lapse
data_t lapse_2{(delta_r * delta_theta * rho2) /
(2 * Theta * Theta * Gamma)};
(Theta * Theta * Gamma)};
metric_vars.lapse = sqrt(lapse_2);

// shift
Expand Down Expand Up @@ -222,11 +222,11 @@ class KerrdeSitter

metric_vars.gamma[i][j] = 0;

FOR1(k)
FOR2(k, l)
{
metric_vars.gamma[i][j] += jacobian_BL_to_Cart[i][k] *
jacobian_BL_to_Cart[j][k] *
spherical_gamma[k][j];
metric_vars.gamma[i][j] += jacobian_BL_to_Cart[k][i] *
jacobian_BL_to_Cart[l][j] *
spherical_gamma[k][l];
}
}
}
Expand Down Expand Up @@ -298,6 +298,35 @@ class KerrdeSitter
{
metric_vars.K += gamma_UU[i][j] * metric_vars.K_tensor[i][j];
}

// debugging
std::cout << "spherical_shift: " << spherical_shift[0] << " "
<< spherical_shift[1] << " " << spherical_shift[2]
<< std::endl;
std::cout << "cart_to_spherical_jacobian:" << jacobian_Cart_to_BL[0][0]
<< " " << jacobian_Cart_to_BL[0][1] << " "
<< jacobian_Cart_to_BL[0][2] << "\n "
<< jacobian_Cart_to_BL[1][0] << " "
<< jacobian_Cart_to_BL[1][1] << " "
<< jacobian_Cart_to_BL[1][2] << "\n "
<< jacobian_Cart_to_BL[2][0] << " "
<< jacobian_Cart_to_BL[2][1] << " "
<< jacobian_Cart_to_BL[2][2] << std::endl;
std::cout << "spherical_gamma:" << spherical_gamma[0][0] << " "
<< spherical_gamma[0][1] << " " << spherical_gamma[0][2]
<< "\n " << spherical_gamma[1][0] << " "
<< spherical_gamma[1][1] << " " << spherical_gamma[1][2]
<< "\n " << spherical_gamma[2][0] << " "
<< spherical_gamma[2][1] << " " << spherical_gamma[2][2]
<< std::endl;

std::cout << "gamma: " << metric_vars.gamma[0][0] << " "
<< metric_vars.gamma[0][1] << " " << metric_vars.gamma[0][2]
<< "\n " << metric_vars.gamma[1][0] << " "
<< metric_vars.gamma[1][1] << " " << metric_vars.gamma[1][2]
<< "\n " << metric_vars.gamma[2][0] << " "
<< metric_vars.gamma[2][1] << " " << metric_vars.gamma[2][2]
<< std::endl;
}

// Ultimate values referenced from arXiv:1011.0479v1
Expand Down
58 changes: 29 additions & 29 deletions tests/KdS_test/Main_Tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ int main(int argc, char *argv[])
// initialize the kerr params and the kerr object
KerrdeSitter::params_t kerr_params;
kerr_params.mass = 1.4;
kerr_params.spin = 0.5;
kerr_params.cosmo_constant = 0.05;
kerr_params.spin = 0.9;
kerr_params.cosmo_constant = 0.001;
// kerr_params.center = {0.0, 0.0, 0.0};
KerrdeSitter kerr_init(kerr_params, dx);
std::cout << tab << " kerr mass = " << kerr_params.mass
Expand All @@ -70,13 +70,10 @@ int main(int argc, char *argv[])
<< " kerr cosmo_constant = " << kerr_params.cosmo_constant
<< std::endl;

// instantiate the metric variables
ADMFixedBGVars::Vars<double> metric_vars;

// Discriminant test
double Q{KerrdeSitter::discriminant<double>(kerr_params)};
std::cout << tab << "Q = " << Q << std::endl;
double mathematica_result_Q{0.06545710954780744};
double mathematica_result_Q{0.006037383095635};
if (abs(Q - mathematica_result_Q) > ERR)
{
std::cout << tab << "Discriminant test failed" << std::endl;
Expand All @@ -86,32 +83,35 @@ int main(int argc, char *argv[])
std::cout << tab << "Discriminant test passed" << std::endl;
}

// Horizon test
double outer_horizon{kerr_init.outer_horizon<double>()};
std::cout << tab << "outer_horizon = " << outer_horizon
// Metric variable tests
std::cout << "Metric variable tests: " << std::endl;
// instantiate the metric variables
ADMFixedBGVars::Vars<double> metric_vars;

IntVect mv_intvec;
mv_intvec[0] = 10000;
mv_intvec[1] = 10000;
mv_intvec[2] = 10000;

Box box(IntVect(0, 0, 0), IntVect(8, 8, 8));
FArrayBox fab_in(box, 3);
FArrayBox fab_out(box, 3);
auto box_pointers = BoxPointers{fab_in, fab_out};
Cell<double> current_cell(mv_intvec, box_pointers);
Coordinates<double> coords_metricvars(current_cell, dx,
kerr_params.center);

std::cout << "coords: " << coords_metricvars.x << " "
<< coords_metricvars.y << " " << coords_metricvars.z
<< std::endl;
double mathematica_result_rp{3.389205056073611};
if (abs(outer_horizon - mathematica_result_rp) > ERR)
{
std::cout << tab << "Outer horizon test failed" << std::endl;
}
else
{
std::cout << tab << "Outer horizon test passed" << std::endl;
}

double inner_horizon{kerr_init.inner_horizon<double>()};
std::cout << tab << "inner_horizon = " << inner_horizon
kerr_init.compute_metric_background(metric_vars, coords_metricvars);

std::cout << "lapse: " << metric_vars.lapse << std::endl;

std::cout << "shift: " << metric_vars.shift[0] << " "
<< metric_vars.shift[1] << " " << metric_vars.shift[2]
<< std::endl;
double mathematica_result_rm{0.0923162767495491};
if (abs(inner_horizon - mathematica_result_rm) > ERR)
{
std::cout << tab << "Inner horizon test failed" << std::endl;
}
else
{
std::cout << tab << "Inner horizon test passed" << std::endl;
}

} // end of kerr tests
}
Expand Down

0 comments on commit 44d8b7e

Please sign in to comment.