diff options
author | 2020-01-31 05:06:40 -0800 | |
---|---|---|
committer | 2020-01-31 05:06:40 -0800 | |
commit | 9b82385969d325a9b8101868f5323335c8015106 (patch) | |
tree | b2266c52df3dfc503d1c3a8e7234c135c2083a41 /Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms | |
parent | cd10ae533fd1fc8d4621ff0e44f95eb4c40636bb (diff) | |
download | WarpX-9b82385969d325a9b8101868f5323335c8015106.tar.gz WarpX-9b82385969d325a9b8101868f5323335c8015106.tar.zst WarpX-9b82385969d325a9b8101868f5323335c8015106.zip |
Add `const` anotations
Diffstat (limited to 'Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms')
4 files changed, 32 insertions, 32 deletions
diff --git a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CKCAlgorithm.H b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CKCAlgorithm.H index 263e525c4..5f15af899 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CKCAlgorithm.H +++ b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CKCAlgorithm.H @@ -103,10 +103,10 @@ struct CKCAlgorithm { amrex::Real const* coefs_x, int const n_coefs_x, int const i, int const j, int const k ) { - amrex::Real alphax = coefs_x[1]; - amrex::Real betaxy = coefs_x[2]; - amrex::Real betaxz = coefs_x[3]; - amrex::Real gammax = coefs_x[4]; + amrex::Real const alphax = coefs_x[1]; + amrex::Real const betaxy = coefs_x[2]; + amrex::Real const betaxz = coefs_x[3]; + amrex::Real const gammax = coefs_x[4]; # if defined WARPX_DIM_3D return alphax * (F(i+1,j ,k ) - F(i, j, k )) + betaxy * (F(i+1,j+1,k ) - F(i ,j+1,k ) @@ -132,7 +132,7 @@ struct CKCAlgorithm { amrex::Real const* coefs_x, int const n_coefs_x, int const i, int const j, int const k ) { - amrex::Real inv_dx = coefs_x[0]; + amrex::Real const inv_dx = coefs_x[0]; return inv_dx*( F(i,j,k) - F(i-1,j,k) ); }; @@ -145,10 +145,10 @@ struct CKCAlgorithm { int const i, int const j, int const k ) { # if defined WARPX_DIM_3D - amrex::Real alphay = coefs_y[1]; - amrex::Real betayz = coefs_y[2]; - amrex::Real betayx = coefs_y[3]; - amrex::Real gammay = coefs_y[4]; + amrex::Real const alphay = coefs_y[1]; + amrex::Real const betayz = coefs_y[2]; + amrex::Real const betayx = coefs_y[3]; + amrex::Real const gammay = coefs_y[4]; return alphay * (F(i ,j+1,k ) - F(i ,j ,k )) + betayx * (F(i+1,j+1,k ) - F(i+1,j ,k ) + F(i-1,j+1,k ) - F(i-1,j ,k )) @@ -172,7 +172,7 @@ struct CKCAlgorithm { int const i, int const j, int const k ) { # if defined WARPX_DIM_3D - amrex::Real inv_dy = coefs_y[0]; + amrex::Real const inv_dy = coefs_y[0]; return inv_dy*( F(i,j,k) - F(i,j-1,k) ); # elif (defined WARPX_DIM_XZ) return 0; // 2D Cartesian: derivative along y is 0 @@ -187,10 +187,10 @@ struct CKCAlgorithm { amrex::Real const* coefs_z, int const n_coefs_z, int const i, int const j, int const k ) { - amrex::Real alphaz = coefs_z[1]; - amrex::Real betazx = coefs_z[2]; - amrex::Real betazy = coefs_z[3]; - amrex::Real gammaz = coefs_z[4]; + amrex::Real const alphaz = coefs_z[1]; + amrex::Real const betazx = coefs_z[2]; + amrex::Real const betazy = coefs_z[3]; + amrex::Real const gammaz = coefs_z[4]; # if defined WARPX_DIM_3D return alphaz * (F(i ,j ,k+1) - F(i ,j ,k )) + betazx * (F(i+1,j ,k+1) - F(i+1,j ,k ) @@ -216,7 +216,7 @@ struct CKCAlgorithm { amrex::Real const* coefs_z, int const n_coefs_z, int const i, int const j, int const k ) { - amrex::Real inv_dz = coefs_z[0]; + amrex::Real const inv_dz = coefs_z[0]; # if defined WARPX_DIM_3D return inv_dz*( F(i,j,k) - F(i,j,k-1) ); # elif (defined WARPX_DIM_XZ) diff --git a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CylindricalYeeAlgorithm.H b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CylindricalYeeAlgorithm.H index a305ae21c..fcd1a7778 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CylindricalYeeAlgorithm.H +++ b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CylindricalYeeAlgorithm.H @@ -37,7 +37,7 @@ struct CylindricalYeeAlgorithm { amrex::Real const* coefs_r, int const n_coefs_r, int const i, int const j, int const k, int const comp ) { - amrex::Real inv_dr = coefs_r[0]; + amrex::Real const inv_dr = coefs_r[0]; return 1./r * inv_dr*( (r+0.5*dr)*F(i+1,j,k,comp) - (r-0.5*dr)*F(i,j,k,comp) ); }; @@ -49,7 +49,7 @@ struct CylindricalYeeAlgorithm { amrex::Real const* coefs_r, int const n_coefs_r, int const i, int const j, int const k, int const comp ) { - amrex::Real inv_dr = coefs_r[0]; + amrex::Real const inv_dr = coefs_r[0]; return inv_dr*( F(i+1,j,k,comp) - F(i,j,k,comp) ); }; @@ -61,7 +61,7 @@ struct CylindricalYeeAlgorithm { amrex::Real const* coefs_r, int const n_coefs_r, int const i, int const j, int const k, int const comp ) { - amrex::Real inv_dr = coefs_r[0]; + amrex::Real const inv_dr = coefs_r[0]; return inv_dr*( F(i,j,k,comp) - F(i-1,j,k,comp) ); }; @@ -73,7 +73,7 @@ struct CylindricalYeeAlgorithm { amrex::Real const* coefs_z, int const n_coefs_z, int const i, int const j, int const k, int const comp ) { - amrex::Real inv_dz = coefs_z[0]; + amrex::Real const inv_dz = coefs_z[0]; return inv_dz*( F(i,j+1,k,comp) - F(i,j,k,comp) ); }; @@ -85,7 +85,7 @@ struct CylindricalYeeAlgorithm { amrex::Real const* coefs_z, int const n_coefs_z, int const i, int const j, int const k, int const comp ) { - amrex::Real inv_dz = coefs_z[0]; + amrex::Real const inv_dz = coefs_z[0]; return inv_dz*( F(i,j,k,comp) - F(i,j-1,k,comp) ); }; diff --git a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/NodalAlgorithm.H b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/NodalAlgorithm.H index 46ed8b7c7..c040a7846 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/NodalAlgorithm.H +++ b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/NodalAlgorithm.H @@ -39,7 +39,7 @@ struct NodalAlgorithm { amrex::Real const* coefs_x, int const n_coefs_x, int const i, int const j, int const k ) { - amrex::Real inv_dx = coefs_x[0]; + amrex::Real const inv_dx = coefs_x[0]; return 0.5*inv_dx*( F(i+1,j,k) - F(i-1,j,k) ); }; @@ -53,7 +53,7 @@ struct NodalAlgorithm { amrex::Real const* coefs_x, int const n_coefs_x, int const i, int const j, int const k ) { - amrex::Real inv_dx = coefs_x[0]; + amrex::Real const inv_dx = coefs_x[0]; return 0.5*inv_dx*( F(i+1,j,k) - F(i-1,j,k) ); }; @@ -68,7 +68,7 @@ struct NodalAlgorithm { int const i, int const j, int const k ) { # if defined WARPX_DIM_3D - amrex::Real inv_dy = coefs_y[0]; + amrex::Real const inv_dy = coefs_y[0]; return 0.5*inv_dy*( F(i,j+1,k) - F(i,j-1,k) ); # elif (defined WARPX_DIM_XZ) return 0; // 2D Cartesian: derivative along y is 0 @@ -86,7 +86,7 @@ struct NodalAlgorithm { int const i, int const j, int const k ) { # if defined WARPX_DIM_3D - amrex::Real inv_dy = coefs_y[0]; + amrex::Real const inv_dy = coefs_y[0]; return 0.5*inv_dy*( F(i,j+1,k) - F(i,j-1,k) ); # elif (defined WARPX_DIM_XZ) return 0; // 2D Cartesian: derivative along y is 0 @@ -103,7 +103,7 @@ struct NodalAlgorithm { amrex::Real const* coefs_z, int const n_coefs_z, int const i, int const j, int const k ) { - amrex::Real inv_dz = coefs_z[0]; + amrex::Real const inv_dz = coefs_z[0]; # if defined WARPX_DIM_3D return 0.5*inv_dz*( F(i,j,k+1) - F(i,j,k-1) ); # elif (defined WARPX_DIM_XZ) @@ -121,7 +121,7 @@ struct NodalAlgorithm { amrex::Real const* coefs_z, int const n_coefs_z, int const i, int const j, int const k ) { - amrex::Real inv_dz = coefs_z[0]; + amrex::Real const inv_dz = coefs_z[0]; # if defined WARPX_DIM_3D return 0.5*inv_dz*( F(i,j,k+1) - F(i,j,k-1) ); # elif (defined WARPX_DIM_XZ) diff --git a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/YeeAlgorithm.H b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/YeeAlgorithm.H index d3900b4f1..0ad9c6345 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/YeeAlgorithm.H +++ b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/YeeAlgorithm.H @@ -37,7 +37,7 @@ struct YeeAlgorithm { amrex::Real const* coefs_x, int const n_coefs_x, int const i, int const j, int const k ) { - amrex::Real inv_dx = coefs_x[0]; + amrex::Real const inv_dx = coefs_x[0]; return inv_dx*( F(i+1,j,k) - F(i,j,k) ); }; @@ -49,7 +49,7 @@ struct YeeAlgorithm { amrex::Real const* coefs_x, int const n_coefs_x, int const i, int const j, int const k ) { - amrex::Real inv_dx = coefs_x[0]; + amrex::Real const inv_dx = coefs_x[0]; return inv_dx*( F(i,j,k) - F(i-1,j,k) ); }; @@ -62,7 +62,7 @@ struct YeeAlgorithm { int const i, int const j, int const k ) { #if defined WARPX_DIM_3D - amrex::Real inv_dy = coefs_y[0]; + amrex::Real const inv_dy = coefs_y[0]; return inv_dy*( F(i,j+1,k) - F(i,j,k) ); #elif (defined WARPX_DIM_XZ) return 0; // 2D Cartesian: derivative along y is 0 @@ -78,7 +78,7 @@ struct YeeAlgorithm { int const i, int const j, int const k ) { #if defined WARPX_DIM_3D - amrex::Real inv_dy = coefs_y[0]; + amrex::Real const inv_dy = coefs_y[0]; return inv_dy*( F(i,j,k) - F(i,j-1,k) ); #elif (defined WARPX_DIM_XZ) return 0; // 2D Cartesian: derivative along y is 0 @@ -93,7 +93,7 @@ struct YeeAlgorithm { amrex::Real const* coefs_z, int const n_coefs_z, int const i, int const j, int const k ) { - amrex::Real inv_dz = coefs_z[0]; + amrex::Real const inv_dz = coefs_z[0]; #if defined WARPX_DIM_3D return inv_dz*( F(i,j,k+1) - F(i,j,k) ); #elif (defined WARPX_DIM_XZ) @@ -109,7 +109,7 @@ struct YeeAlgorithm { amrex::Real const* coefs_z, int const n_coefs_z, int const i, int const j, int const k ) { - amrex::Real inv_dz = coefs_z[0]; + amrex::Real const inv_dz = coefs_z[0]; #if defined WARPX_DIM_3D return inv_dz*( F(i,j,k) - F(i,j,k-1) ); #elif (defined WARPX_DIM_XZ) |