-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enforceBC works for all levels (#566)
* enforceBC is level-agnostic * doc
- Loading branch information
1 parent
fd43359
commit 0cf2735
Showing
4 changed files
with
48 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#ifndef HIPACE_GETDOMAINLEV_H_ | ||
#define HIPACE_GETDOMAINLEV_H_ | ||
|
||
#include <AMReX.H> | ||
|
||
namespace | ||
{ | ||
amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> GetDomainLev ( | ||
const amrex::Geometry& gm, const amrex::Box& box, bool is_lo, int lev) | ||
{ | ||
if (lev == 0) { | ||
return is_lo ? gm.ProbLoArray() : gm.ProbHiArray(); | ||
} else { | ||
const auto dx = gm.CellSizeArray(); | ||
const amrex::IntVect& small = box.smallEnd(); | ||
const amrex::IntVect& big = box.bigEnd(); | ||
const auto plo = gm.ProbLoArray(); | ||
if (is_lo) { | ||
return {{AMREX_D_DECL(plo[0]+(small[0]+0.5)*dx[0], | ||
plo[1]+(small[1]+0.5)*dx[1], | ||
plo[2]+(small[2]+0.5)*dx[2])}}; | ||
} else { | ||
return {{AMREX_D_DECL(plo[0]+(big[0]+0.5)*dx[0], | ||
plo[1]+(big[1]+0.5)*dx[1], | ||
plo[2]+(big[2]+0.5)*dx[2])}}; | ||
} | ||
} | ||
} | ||
} | ||
|
||
#endif // HIPACE_GETANDSETPOSITION_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters