Skip to content

Commit

Permalink
move phi declaration to initial conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
psharda committed Jan 12, 2024
1 parent a389fb1 commit f4c6bec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/simulation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,14 @@ template <typename problem_t> void AMRSimulation<problem_t>::setInitialCondition
ReadCheckpointFile();
}

phi.resize(finest_level + 1);
const int nghost = 1;
const int ncomp = 1;
for (int lev = 0; lev <= finest_level; ++lev) {
phi[lev].define(grids[lev], dmap[lev], ncomp, nghost);
phi[lev].setVal(0); // set initial guess to zero
}

// abort if amrex.async_out=1, it is currently broken
if (amrex::AsyncOut::UseAsyncOut()) {
amrex::Print() << "[ERROR] [FATAL] AsyncOut is currently broken! If you want to "
Expand Down Expand Up @@ -913,7 +921,6 @@ template <typename problem_t> void AMRSimulation<problem_t>::ellipticSolveAllLev
}

// solve Poisson equation with open b.c. using the method of James (1977)
phi.resize(finest_level + 1);
amrex::Vector<amrex::MultiFab> rhs(finest_level + 1);
const int nghost = 1;
const int ncomp = 1;
Expand Down

0 comments on commit f4c6bec

Please sign in to comment.