From f44fde71eb7013cec7bcc2769d3ac12531b5c68b Mon Sep 17 00:00:00 2001 From: "L. Diana Amorim" Date: Thu, 25 Jun 2020 09:31:33 -0700 Subject: [small] Inject Particles from openPMD in RZ (#1113) * Added description of singleparticle particle injection style * Revert "Added description of singleparticle particle injection style" This reverts commit f02d842c935311458024da6e661950742de24f63. * Tried to inject particles only in simulation Box * Added Todo for multiple levels of mesh refinement * Explain todo better * Added x and y_shifts and replaced cascading ifs by bools and continue * Replaced cascading ifs by bools and continue * Replaced TODO by FIXME as reviewer suggested * Made the insidebounds function use box limits as defaults * Fixed identation issue * Fixed identation issue * Fixed identation issue * Added to Docs the default for xmin,xmax and other dirs * Fix missing y and z dirs * Update Source/Initialization/PlasmaInjector.cpp * Fixed PlasmaInjector limits with periodic condition * Removed check if 3D because now ylims are +/-inf * Restored if to check for y velocity also in 2D/RZ * Fixed Docs to recent changes * Update Source/Initialization/PlasmaInjector.cpp * Fix extra bracket * Added information about RZ geometry for openPMD external file * Fix to issue without periodic boundaries * Added variable rz_take_absolute, to allow to inject x<0 particles in RZ * Fix to declaration of addplasmafromfile rz_take_absolute * Fix to declaration of addplasmafromfile rz_take_absolute * Fixed documentation to include rz_take_absolute option * Fix merging conflict * Final fix to xmax=inf in RZ * In RZ particles are injected in x,y,z * Fixed remaining rz_take_absolute * Converted (x,y,z) to (r,0,z) * Fixed bounds limits (r,z) but injection is in 3D * Re-fix to insideBounds() * AMReX assert of periodic in RZ * Removed Assert -> went to PR 1115 by @dpgrote * Fixed issues pointed out by reviewer @dpgrote * Undo changes for future PR * Undo changes for future PR --- Source/Particles/PhysicalParticleContainer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/Particles/PhysicalParticleContainer.cpp') diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index 12e18e4f4..88498b954 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -239,7 +239,7 @@ PhysicalParticleContainer::AddGaussianBeam ( npart /= 4; } for (long i = 0; i < npart; ++i) { -#if (defined WARPX_DIM_3D) || (WARPX_DIM_RZ) +#if (defined WARPX_DIM_3D) || (defined WARPX_DIM_RZ) const Real weight = q_tot/(npart*charge); const Real x = distx(mt); const Real y = disty(mt); @@ -328,7 +328,7 @@ PhysicalParticleContainer::AddPlasmaFromFile(ParticleReal q_tot, double const momentum_unit_x = ps["momentum"]["x"].unitSI(); std::shared_ptr ptr_uz = ps["momentum"]["z"].loadChunk(); double const momentum_unit_z = ps["momentum"]["z"].unitSI(); -# ifdef WARPX_DIM_3D +# ifndef WARPX_DIM_XZ std::shared_ptr ptr_y = ps["position"]["y"].loadChunk(); double const position_unit_y = ps["position"]["y"].unitSI(); # endif @@ -361,10 +361,10 @@ PhysicalParticleContainer::AddPlasmaFromFile(ParticleReal q_tot, for (auto i = decltype(npart){0}; iinsideBounds(x, y, z)) { ParticleReal const ux = ptr_ux.get()[i]*momentum_unit_x/PhysConst::m_e; -- cgit v1.2.3 mework-preact Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
AgeCommit message (Expand)AuthorFilesLines
2022-04-26fix: replace serialize-javascript & random-bytes with custom internal modulesGravatar Okiki 7-215/+521
2022-04-26[ci] release (#3182)create-astro@0.10.0astro@1.0.0-beta.18@astrojs/vercel@0.1.4@astrojs/tailwind@0.2.1@astrojs/svelte@0.1.2@astrojs/netlify@0.3.3Gravatar github-actions[bot] 54-146/+130
2022-04-26[ci] formatGravatar matthewp 1-1/+1
2022-04-26fix(vercel): `trailingSlash` fix for non-html pages (#3185)Gravatar Juan Martín Seery 2-29/+42
2022-04-26Prevent watcher from running during the build (#3207)Gravatar Matthew Phillips 2-0/+9
2022-04-26Fix lockfile (#3210)Gravatar Juan Martín Seery 1-6/+0
2022-04-26Add missing is:raw in AstroBuiltinAttributes (#3209)Gravatar Erika 2-0/+6
2022-04-26Feat: support `astro add` without npm installing (#3183)Gravatar Ben Holmes 6-30/+49
2022-04-26Add Astro attributes to svg elements (#3205)Gravatar Erika 2-1/+9
2022-04-26[ci] formatGravatar bholmesdev 2-9/+9
2022-04-26Feat: `create astro` add install step (#3190)Gravatar Ben Holmes 7-162/+299
2022-04-26[ci] collect statsGravatar FredKSchott 1-0/+1
2022-04-25fix(markdown): file.url fixes (#3198)Gravatar Juan Martín Seery 11-10/+149
2022-04-25[ci] collect statsGravatar FredKSchott 1-0/+1
2022-04-24add vite to licenseGravatar Fred K. Schott 2-24/+29
2022-04-24feat(markdown): Improved types (#3191)Gravatar Juan Martín Seery 3-6/+47
2022-04-24[ci] collect statsGravatar FredKSchott 1-0/+1
2022-04-23[ci] collect statsGravatar FredKSchott 1-0/+1