Skip to content

Commit

Permalink
GetLorentzFactor modified to take both Mesh and Meshblock
Browse files Browse the repository at this point in the history
  • Loading branch information
mari2895 committed Jan 12, 2024
1 parent 2520b98 commit c480616
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/phoebus_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ TaskListStatus PhoebusDriver::MonteCarloStep() {
for (int ib = 0; ib < num_partitions; ++ib) {
auto &base = pmesh->mesh_data.GetOrAdd("base", ib);
auto &sc0 = pmesh->mesh_data.GetOrAdd("base", ib);
auto &tl = sync_region_lb[ib];
auto &tl = sync_region[ib];
auto apply_four_force =
tl.AddTask(none, radiation::ApplyRadiationFourForce, sc0.get(), dt);
}
Expand Down
16 changes: 12 additions & 4 deletions src/phoebus_utils/relativity_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,22 @@ GetLorentzFactor(const Real vcon[Geometry::NDSPACE],
*
* RETURN - Lorentz factor in normal observer frame
*/
template <typename CoordinateSystem_t>
KOKKOS_INLINE_FUNCTION Real GetLorentzFactor(const Real vcon[Geometry::NDSPACE],
const Geometry::CoordSysMeshBlock &system,
CellLocation loc, const int k, const int j,
const int i) {
const CoordinateSystem_t &system,
CellLocation loc, const int b, const int k,
const int j, const int i) {
Real gamma[Geometry::NDSPACE][Geometry::NDSPACE];
system.Metric(loc, k, j, i, gamma);
system.Metric(loc, b, k, j, i, gamma);
return GetLorentzFactor(vcon, gamma);
}
template <typename CoordinateSystem_t>
KOKKOS_INLINE_FUNCTION Real GetLorentzFactor(const Real vcon[Geometry::NDSPACE],
const CoordinateSystem_t &system,
CellLocation loc, const int k, const int j,
const int i) {
return GetLorentzFactor(vcon, system, loc, 0, k, j, i);
}

/*
* Calculate the coordinate frame four-velocity from the normal observer three-velocity
Expand Down

0 comments on commit c480616

Please sign in to comment.