From 45ef533c39a55d05afbb9872659963d19b79f463 Mon Sep 17 00:00:00 2001 From: Prabhat Kumar <89051199+prkkumar@users.noreply.github.com> Date: Fri, 19 Nov 2021 00:31:18 -0800 Subject: 1D3V Cartesian Support (#2307) * Build System: Add 1D Geometry * test PR * test PR * 1D cartesian yee algorithm * fixed typo * Fixes for PML * 1D support related multiple changes * Fix compilation * change 1D to 1D_Z * 1D Field Gather and typo fix * 1D Charge Deposition * Particle Pusher * multiple changes related to 1D * 1D diagnostics and initialization * PlasmaInjector and PEC fixes for 1D * clean-up delete diags file * mobility 1D laser particle and bilinear filter * deleted diags files * update laser particle weight formula * delete diags files * Azure: Add 1D Cartesian Runner * 1D fixes for FieldProbe * Update Docs/source/developers/dimensionality.rst Co-authored-by: Remi Lehe * 1d laser injection and langmuir test input files * 1d tests * clean up : delete print statements * analyse simulation result for laser injection and Langmuir tests * EOL * delete input files for which there are no automated tests * delete input files for which there are no automated tests * add ignore_unused to remove warnings * remove space * Fix compilation issues * fix error : macro name must be an identifier * Small bug fix * cleanup Python script for analysis * bug fix * bug fix * Update ParticleProbe: Check 1D in-domain * Update Source/Make.WarpX * Update .azure-pipelines.yml * Add USE_OPENPMD=FALSE to .azure-pipeline.yml * resolve conflict * resolve conflict * fix typo * Correct out-of-bound access * Fix Particle BC in WarpXParticleContainer and correct path to checksumAPI in python analysis scripts * EOL * Fix bug : accessing out of bound index of cell in 1D * remove 1d test for cartesian3d * Fix CI check * Slight style change * Address review comments * Fix GPU compilation Filter.cpp * Fix CI * Fix Indentation * Address review comments * More consistent ifdef for dimension bigger than 1 * Update Examples/Tests/Langmuir/analysis_langmuir_multi_1d.py Co-authored-by: Axel Huebl * Update GNUmakefile Co-authored-by: Axel Huebl * Update Regression/prepare_file_ci.py Co-authored-by: Axel Huebl * Update Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CartesianCKCAlgorithm.H Co-authored-by: Axel Huebl * Update Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CartesianNodalAlgorithm.H Co-authored-by: Axel Huebl * Update Source/Filter/Filter.cpp Co-authored-by: Axel Huebl * Update Source/Filter/Filter.cpp Co-authored-by: Axel Huebl * Update Source/Filter/Filter.cpp Co-authored-by: Axel Huebl * Update Source/Filter/Filter.cpp Co-authored-by: Axel Huebl * Update Source/Initialization/PlasmaInjector.cpp Co-authored-by: Axel Huebl * Update Source/Initialization/PlasmaInjector.cpp Co-authored-by: Axel Huebl * add comment inline to explain twice push_back * Add amrex::Abort for NCIGodfreyFilter Co-authored-by: Axel Huebl Co-authored-by: Prabhat Kumar Co-authored-by: Remi Lehe Co-authored-by: Remi Lehe --- .../CartesianNodalAlgorithm.H | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CartesianNodalAlgorithm.H') diff --git a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CartesianNodalAlgorithm.H b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CartesianNodalAlgorithm.H index 5c1d68687..01d83804b 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CartesianNodalAlgorithm.H +++ b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CartesianNodalAlgorithm.H @@ -74,8 +74,13 @@ struct CartesianNodalAlgorithm { int const i, int const j, int const k, int const ncomp=0 ) { using namespace amrex; +#if (defined WARPX_DIM_1D_Z) + ignore_unused(i, j, k, coefs_x, ncomp, F); + return 0._rt; // 1D Cartesian: derivative along x is 0 +#else Real const inv_dx = coefs_x[0]; return 0.5_rt*inv_dx*( F(i+1,j,k,ncomp) - F(i-1,j,k,ncomp) ); +#endif } /** @@ -88,8 +93,14 @@ struct CartesianNodalAlgorithm { amrex::Real const * const coefs_x, int const n_coefs_x, int const i, int const j, int const k, int const ncomp=0 ) { + using namespace amrex; +#if (defined WARPX_DIM_1D_Z) + ignore_unused(i, j, k, coefs_x, n_coefs_x, ncomp, F); + return 0._rt; // 1D Cartesian: derivative along x is 0 +#else return UpwardDx( F, coefs_x, n_coefs_x, i, j, k ,ncomp); // For CartesianNodalAlgorithm, UpwardDx and DownwardDx are equivalent +#endif } /** @@ -106,9 +117,9 @@ struct CartesianNodalAlgorithm { #if defined WARPX_DIM_3D Real const inv_dy = coefs_y[0]; return 0.5_rt*inv_dy*( F(i,j+1,k,ncomp) - F(i,j-1,k,ncomp) ); -#elif (defined WARPX_DIM_XZ) +#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_1D_Z) ignore_unused(i, j, k, coefs_y, ncomp, F); - return 0._rt; // 2D Cartesian: derivative along y is 0 + return 0._rt; // 1D and 2D Cartesian: derivative along y is 0 #endif } @@ -142,6 +153,8 @@ struct CartesianNodalAlgorithm { return 0.5_rt*inv_dz*( F(i,j,k+1,ncomp) - F(i,j,k-1,ncomp) ); #elif (defined WARPX_DIM_XZ) return 0.5_rt*inv_dz*( F(i,j+1,k,ncomp) - F(i,j-1,k,ncomp) ); +#elif (defined WARPX_DIM_1D_Z) + return 0.5_rt*inv_dz*( F(i+1,j,k,ncomp) - F(i-1,j,k,ncomp) ); #endif } -- cgit v1.2.3