Skip to content

Commit

Permalink
Constify: DownwardD* (ECP-WarpX#5234)
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l authored Sep 9, 2024
1 parent 9c5c723 commit 10d1615
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
struct CartesianCKCAlgorithm {

static void InitializeStencilCoefficients (
std::array<amrex::Real,3>& cell_size,
std::array<amrex::Real, 3>& cell_size,
amrex::Vector<amrex::Real>& stencil_coefs_x,
amrex::Vector<amrex::Real>& stencil_coefs_y,
amrex::Vector<amrex::Real>& stencil_coefs_z ) {
Expand Down Expand Up @@ -129,7 +129,7 @@ struct CartesianCKCAlgorithm {
* Perform derivative along x on a cell-centered grid, from a nodal field `F` */
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real UpwardDx (
amrex::Array4<amrex::Real> const& F,
amrex::Array4<amrex::Real const> const& F,
amrex::Real const * const coefs_x, int const /*n_coefs_x*/,
int const i, int const j, int const k, int const ncomp=0 ) {

Expand Down Expand Up @@ -186,7 +186,7 @@ struct CartesianCKCAlgorithm {
* Perform derivative along y on a cell-centered grid, from a nodal field `F` */
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real UpwardDy (
amrex::Array4<amrex::Real> const& F,
amrex::Array4<amrex::Real const> const& F,
amrex::Real const * const coefs_y, int const n_coefs_y,
int const i, int const j, int const k, int const ncomp=0 ) {

Expand Down Expand Up @@ -244,7 +244,7 @@ struct CartesianCKCAlgorithm {
* Perform derivative along z on a cell-centered grid, from a nodal field `F` */
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real UpwardDz (
amrex::Array4<amrex::Real> const& F,
amrex::Array4<amrex::Real const> const& F,
amrex::Real const * const coefs_z, int const n_coefs_z,
int const i, int const j, int const k, int const ncomp=0 ) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct CartesianNodalAlgorithm {
* account the staggering; but for `CartesianNodalAlgorithm`, they are equivalent) */
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real UpwardDx (
amrex::Array4<amrex::Real> const& F,
amrex::Array4<amrex::Real const> const& F,
amrex::Real const * const coefs_x, int const /*n_coefs_x*/,
int const i, int const j, int const k, int const ncomp=0 ) {

Expand All @@ -89,7 +89,7 @@ struct CartesianNodalAlgorithm {
* account the staggering; but for `CartesianNodalAlgorithm`, they are equivalent) */
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real DownwardDx (
amrex::Array4<amrex::Real> const& F,
amrex::Array4<amrex::Real const> const& F,
amrex::Real const * const coefs_x, int const n_coefs_x,
int const i, int const j, int const k, int const ncomp=0 ) {

Expand All @@ -109,7 +109,7 @@ struct CartesianNodalAlgorithm {
* account the staggering; but for `CartesianNodalAlgorithm`, they are equivalent) */
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real UpwardDy (
amrex::Array4<amrex::Real> const& F,
amrex::Array4<amrex::Real const> const& F,
amrex::Real const * const coefs_y, int const /*n_coefs_y*/,
int const i, int const j, int const k, int const ncomp=0 ) {

Expand All @@ -129,7 +129,7 @@ struct CartesianNodalAlgorithm {
* account the staggering; but for `CartesianNodalAlgorithm`, they are equivalent) */
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real DownwardDy (
amrex::Array4<amrex::Real> const& F,
amrex::Array4<amrex::Real const> const& F,
amrex::Real const * const coefs_y, int const n_coefs_y,
int const i, int const j, int const k, int const ncomp=0 ) {

Expand All @@ -143,7 +143,7 @@ struct CartesianNodalAlgorithm {
* account the staggering; but for `CartesianNodalAlgorithm`, they are equivalent) */
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real UpwardDz (
amrex::Array4<amrex::Real> const& F,
amrex::Array4<amrex::Real const> const& F,
amrex::Real const * const coefs_z, int const /*n_coefs_z*/,
int const i, int const j, int const k, int const ncomp=0 ) {

Expand All @@ -164,7 +164,7 @@ struct CartesianNodalAlgorithm {
* account the staggering; but for `CartesianNodalAlgorithm`, they are equivalent) */
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real DownwardDz (
amrex::Array4<amrex::Real> const& F,
amrex::Array4<amrex::Real const> const& F,
amrex::Real const * const coefs_z, int const n_coefs_z,
int const i, int const j, int const k, int const ncomp=0 ) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ struct CartesianYeeAlgorithm {
* Perform derivative along x on a cell-centered grid, from a nodal field `F`*/
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real UpwardDx (
amrex::Array4<amrex::Real> const& F,
amrex::Array4<amrex::Real const> const& F,
amrex::Real const * const coefs_x, int const /*n_coefs_x*/,
int const i, int const j, int const k, int const ncomp=0 ) {

Expand Down Expand Up @@ -123,7 +123,7 @@ struct CartesianYeeAlgorithm {
* Perform derivative along y on a cell-centered grid, from a nodal field `F`*/
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real UpwardDy (
amrex::Array4<amrex::Real> const& F,
amrex::Array4<amrex::Real const> const& F,
amrex::Real const * const coefs_y, int const n_coefs_y,
int const i, int const j, int const k, int const ncomp=0 ) {

Expand Down Expand Up @@ -189,7 +189,7 @@ struct CartesianYeeAlgorithm {
* Perform derivative along z on a cell-centered grid, from a nodal field `F`*/
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real UpwardDz (
amrex::Array4<amrex::Real> const& F,
amrex::Array4<amrex::Real const> const& F,
amrex::Real const * const coefs_z, int const /*n_coefs_z*/,
int const i, int const j, int const k, int const ncomp=0 ) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct CylindricalYeeAlgorithm {
* The input parameter `r` is given at the cell-centered position */
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real UpwardDrr_over_r (
amrex::Array4<amrex::Real> const& F,
amrex::Array4<amrex::Real const> const& F,
amrex::Real const r, amrex::Real const dr,
amrex::Real const * const coefs_r, int const n_coefs_r,
int const i, int const j, int const k, int const comp ) {
Expand All @@ -92,7 +92,7 @@ struct CylindricalYeeAlgorithm {
* The input parameter `r` is given at the cell-centered position */
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real DownwardDrr_over_r (
amrex::Array4<amrex::Real> const& F,
amrex::Array4<amrex::Real const> const& F,
amrex::Real const r, amrex::Real const dr,
amrex::Real const * const coefs_r, int const n_coefs_r,
int const i, int const j, int const k, int const comp ) {
Expand All @@ -108,7 +108,7 @@ struct CylindricalYeeAlgorithm {
* Perform derivative along r on a cell-centered grid, from a nodal field `F` */
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real UpwardDr (
amrex::Array4<amrex::Real> const& F,
amrex::Array4<amrex::Real const> const& F,
amrex::Real const * const coefs_r, int const n_coefs_r,
int const i, int const j, int const k, int const comp ) {

Expand All @@ -123,7 +123,7 @@ struct CylindricalYeeAlgorithm {
* Perform derivative along r on a nodal grid, from a cell-centered field `F` */
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real DownwardDr (
amrex::Array4<amrex::Real> const& F,
amrex::Array4<amrex::Real const> const& F,
amrex::Real const * const coefs_r, int const n_coefs_r,
int const i, int const j, int const k, int const comp ) {

Expand Down Expand Up @@ -156,7 +156,7 @@ struct CylindricalYeeAlgorithm {
* Perform derivative along z on a cell-centered grid, from a nodal field `F` */
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real UpwardDz (
amrex::Array4<amrex::Real> const& F,
amrex::Array4<amrex::Real const> const& F,
amrex::Real const * const coefs_z, int const n_coefs_z,
int const i, int const j, int const k, int const comp ) {

Expand All @@ -170,7 +170,7 @@ struct CylindricalYeeAlgorithm {
* Perform derivative along z on a nodal grid, from a cell-centered field `F` */
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real DownwardDz (
amrex::Array4<amrex::Real> const& F,
amrex::Array4<amrex::Real const> const& F,
amrex::Real const * const coefs_z, int const n_coefs_z,
int const i, int const j, int const k, int const comp ) {

Expand Down

0 comments on commit 10d1615

Please sign in to comment.