Skip to content

Commit

Permalink
fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Sep 10, 2024
1 parent 1217e8a commit cef2675
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/gravity/Gravity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,8 @@ Gravity::get_old_grav_vector(int level, MultiFab& grav_vector, Real time)
MultiFab grav(grids[level], dmap[level], AMREX_SPACEDIM, ng);
grav.setVal(0.0,ng);

const Geometry& geom = parent->Geom(level);

if (gravity::gravity_type == "ConstantGrav") {

if (AMREX_SPACEDIM == 2 && geom.Coord() == 2) {
Expand All @@ -899,7 +901,6 @@ Gravity::get_old_grav_vector(int level, MultiFab& grav_vector, Real time)

} else if (gravity::gravity_type == "PoissonGrav") {

const Geometry& geom = parent->Geom(level);
amrex::average_face_to_cellcenter(grav, amrex::GetVecOfConstPtrs(grad_phi_prev[level]), geom);
grav.mult(-1.0, ng); // g = - grad(phi)

Expand Down Expand Up @@ -956,6 +957,7 @@ Gravity::get_new_grav_vector(int level, MultiFab& grav_vector, Real time)

MultiFab grav(grids[level],dmap[level],AMREX_SPACEDIM,ng);
grav.setVal(0.0,ng);
const Geometry& geom = parent->Geom(level);

if (gravity::gravity_type == "ConstantGrav") {

Expand All @@ -976,7 +978,6 @@ Gravity::get_new_grav_vector(int level, MultiFab& grav_vector, Real time)

} else if (gravity::gravity_type == "PoissonGrav") {

const Geometry& geom = parent->Geom(level);
amrex::average_face_to_cellcenter(grav, amrex::GetVecOfConstPtrs(grad_phi_curr[level]), geom);
grav.mult(-1.0, ng); // g = - grad(phi)

Expand Down

0 comments on commit cef2675

Please sign in to comment.