Skip to content

Commit

Permalink
Compiles and passes checks
Browse files Browse the repository at this point in the history
  • Loading branch information
SeppeStaelens committed Oct 18, 2024
1 parent 14e21d3 commit fc78553
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
12 changes: 7 additions & 5 deletions Source/CCZ4/IntegratedMovingPunctureGauge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,16 @@ class IntegratedMovingPunctureGauge
}
}


// Add the matter terms to the rhs of the gauge equations
// For the IMP gauge, this function should do nothing
template <class data_t, template <typename> class vars_t>
inline void rhs_gauge_add_matter_terms(vars_t<data_t> &matter_rhs,
const vars_t<data_t> &matter_vars, emtensor_t<data_t> emtensor, Tensor<2, data_t, 3> h_UU)
{
// WHY -B^i in rhs.shift, in the function above?
inline void rhs_gauge_add_matter_terms(vars_t<data_t> &matter_rhs,
const vars_t<data_t> &matter_vars,
Tensor<2, data_t, 3> h_UU,
const emtensor_t<data_t> emtensor,
const double G_Newton) const
{
// no changes as B should remain constant
}
};

Expand Down
29 changes: 16 additions & 13 deletions Source/CCZ4/MovingPunctureGauge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "DimensionDefinitions.hpp"
#include "Tensor.hpp"
#include "EMTensor.hpp"

/// This is an example of a gauge class that can be used in the CCZ4RHS compute
/// class
Expand Down Expand Up @@ -69,20 +68,24 @@ class MovingPunctureGauge
// Add the matter terms to the rhs of the gauge equations
// For the MP gauge, this only changes the rhs of B through the rhs of Gamma
template <class data_t, template <typename> class vars_t>
inline void rhs_gauge_add_matter_terms(vars_t<data_t> &matter_rhs,
const vars_t<data_t> &matter_vars, emtensor_t<data_t> emtensor, Tensor<2, data_t, 3> h_UU)
{
FOR(i)
{
data_t matter_term_Gamma = 0.0;
FOR(j)
inline void rhs_gauge_add_matter_terms(vars_t<data_t> &matter_rhs,
const vars_t<data_t> &matter_vars,
Tensor<2, data_t, 3> h_UU,
const emtensor_t<data_t> emtensor,
const double G_Newton) const
{
FOR(i)
{
matter_term_Gamma += -16.0 * M_PI * m_G_Newton * matter_vars.lapse *
h_UU[i][j] * emtensor.Si[j];
}
data_t matter_term_Gamma = 0.0;
FOR(j)
{
matter_term_Gamma += -16.0 * M_PI * G_Newton *
matter_vars.lapse * h_UU[i][j] *
emtensor.Si[j];
}

matter_rhs.B[i] += matter_term_Gamma;
}
matter_rhs.B[i] += matter_term_Gamma;
}
}
};

Expand Down
3 changes: 2 additions & 1 deletion Source/Matter/MatterCCZ4RHS.impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ void MatterCCZ4RHS<matter_t, gauge_t, deriv_t>::add_emtensor_rhs(
}

// Add matter contribution to RHS of gauge evolution
m_gauge.rhs_gauge_add_matter_terms(matter_rhs, matter_vars, emtensor, h_UU);
this->m_gauge.rhs_gauge_add_matter_terms(matter_rhs, matter_vars, h_UU,
emtensor, m_G_Newton);
}

#endif /* MATTERCCZ4RHS_IMPL_HPP_ */

0 comments on commit fc78553

Please sign in to comment.