Skip to content

Commit

Permalink
Fixedgrids and fixed propagation speed lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
dinatraykova committed Oct 22, 2024
1 parent 2d4fb94 commit 92036dd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Examples/Fluid_Kerr_IDfromFile/PerfectFluid.impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ void PerfectFluid<eos_t>::add_matter_rhs(
data_t divshift = TensorAlgebra::compute_trace(d1.shift);
data_t chi_regularised = simd_max(vars.chi, 1e-6);
data_t advec_chi = 0.;
double lambda = simd_max(sqrt(2. / vars.lapse),
1 / (vars.lapse * sqrt(chi_regularised)));
double lambda = 1.; //simd_max(sqrt(2. / vars.lapse),
// 1 / (vars.lapse * sqrt(chi_regularised)));
FOR(i) advec_chi += vars.shift[i] * d1.chi[i] / chi_regularised;
rhs.D = source.D /*+ vars.D * (vars.lapse * vars.K - divshift +
GR_SPACEDIM / 2. * advec_chi)*/
Expand Down
24 changes: 14 additions & 10 deletions Examples/Fluid_Kerr_IDfromFile/PerfectFluidLevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#include "NewMatterConstraints.hpp"

// For tag cells
// #include "FixedGridsTaggingCriterion.hpp"
#include "ChiTaggingCriterion.hpp"
#include "FixedGridsTaggingCriterion.hpp"
//#include "ChiTaggingCriterion.hpp"

// Problem specific includes
#include "ComputePack.hpp"
Expand All @@ -38,7 +38,8 @@ void PerfectFluidLevel::specificAdvance()
{
// Enforce trace free A_ij and positive chi and alpha
BoxLoops::loop(make_compute_pack(TraceARemoval(), PositiveChiAndAlpha(),
PositiveDensity()),
PositiveDensity(m_p.min_D),
PrimitiveRecovery()),
m_state_new, m_state_new, INCLUDE_GHOST_CELLS,
disable_simd());

Expand Down Expand Up @@ -70,22 +71,22 @@ void PerfectFluidLevel::initialData()
// Things to do before outputting a checkpoint file
void PerfectFluidLevel::prePlotLevel()
{
fillAllGhosts();
fillAllGhosts();
EoS eos;
PerfectFluidEoS perfect_fluid(m_dx, m_p.lambda, eos);
BoxLoops::loop(
MatterConstraints<PerfectFluidEoS>(perfect_fluid, m_dx, m_p.G_Newton,
c_Ham, Interval(c_Mom1, c_Mom3)),
m_state_new, m_state_diagnostics, EXCLUDE_GHOST_CELLS, disable_simd());
}
}
#endif

// Things to do in RHS update, at each RK4 step
void PerfectFluidLevel::specificEvalRHS(GRLevelData &a_soln, GRLevelData &a_rhs,
const double a_time)
{
// Enforce trace free A_ij and positive chi and alpha
BoxLoops::loop(make_compute_pack(TraceARemoval(), PositiveDensity(),
BoxLoops::loop(make_compute_pack(TraceARemoval(), PositiveDensity(m_p.min_D),
PositiveChiAndAlpha(),
PrimitiveRecovery()),
a_soln, a_soln, INCLUDE_GHOST_CELLS /*, disable_simd()*/);
Expand Down Expand Up @@ -120,7 +121,7 @@ void PerfectFluidLevel::specificUpdateODE(GRLevelData &a_soln,
const GRLevelData &a_rhs, Real a_dt)
{
// Enforce trace free A_ij
BoxLoops::loop(make_compute_pack(TraceARemoval(), PositiveDensity(),
BoxLoops::loop(make_compute_pack(TraceARemoval(), PositiveDensity(m_p.min_D),
PositiveChiAndAlpha(),
PrimitiveRecovery()),
a_soln, a_soln, INCLUDE_GHOST_CELLS /*, disable_simd()*/);
Expand All @@ -129,13 +130,16 @@ void PerfectFluidLevel::specificUpdateODE(GRLevelData &a_soln,
void PerfectFluidLevel::preTagCells()
{
// We only use chi in the tagging criterion so only fill the ghosts for chi
fillAllGhosts(VariableType::evolution, Interval(c_chi, c_chi));
//fillAllGhosts(VariableType::evolution, Interval(c_chi, c_chi));
}

void PerfectFluidLevel::computeTaggingCriterion(
FArrayBox &tagging_criterion, const FArrayBox &current_state,
const FArrayBox &current_state_diagnostics)
{
BoxLoops::loop(ChiTaggingCriterion(m_dx), current_state, tagging_criterion,
disable_simd());
//BoxLoops::loop(ChiTaggingCriterion(m_dx), current_state, tagging_criterion,
// disable_simd());
BoxLoops::loop(
FixedGridsTaggingCriterion(m_dx, m_level, 2.0 * m_p.L, m_p.center),
current_state, tagging_criterion);
}

0 comments on commit 92036dd

Please sign in to comment.