diff options
Diffstat (limited to 'Source/Particles/Collision')
-rw-r--r-- | Source/Particles/Collision/CollisionType.H | 6 | ||||
-rw-r--r-- | Source/Particles/Collision/CollisionType.cpp | 26 | ||||
-rw-r--r-- | Source/Particles/Collision/ComputeTemperature.H | 6 | ||||
-rw-r--r-- | Source/Particles/Collision/ElasticCollisionPerez.H | 6 | ||||
-rw-r--r-- | Source/Particles/Collision/ShuffleFisherYates.H | 6 | ||||
-rw-r--r-- | Source/Particles/Collision/UpdateMomentumPerezElastic.H | 6 |
6 files changed, 49 insertions, 7 deletions
diff --git a/Source/Particles/Collision/CollisionType.H b/Source/Particles/Collision/CollisionType.H index d020f47e8..29fdfb029 100644 --- a/Source/Particles/Collision/CollisionType.H +++ b/Source/Particles/Collision/CollisionType.H @@ -1,3 +1,9 @@ +/* Copyright 2019 Yinjian Zhao + * + * This file is part of WarpX. + * + * License: BSD-3-Clause-LBNL + */ #ifndef WARPX_PARTICLES_COLLISION_COLLISIONTYPE_H_ #define WARPX_PARTICLES_COLLISION_COLLISIONTYPE_H_ diff --git a/Source/Particles/Collision/CollisionType.cpp b/Source/Particles/Collision/CollisionType.cpp index b8014579d..1d384ed8c 100644 --- a/Source/Particles/Collision/CollisionType.cpp +++ b/Source/Particles/Collision/CollisionType.cpp @@ -1,3 +1,9 @@ +/* Copyright 2019 Yinjian Zhao + * + * This file is part of WarpX. + * + * License: BSD-3-Clause-LBNL + */ #include "CollisionType.H" #include "ShuffleFisherYates.H" #include "ElasticCollisionPerez.H" @@ -8,11 +14,9 @@ CollisionType::CollisionType( std::string const collision_name) { -#if defined WARPX_DIM_XZ - amrex::Abort("Collisions only work in 3D geometry for now."); -#elif defined WARPX_DIM_RZ + #if defined WARPX_DIM_RZ amrex::Abort("Collisions only work in Cartesian geometry for now."); -#endif + #endif // read collision species std::vector<std::string> collision_species; @@ -66,7 +70,7 @@ namespace { const auto dxi = geom.InvCellSizeArray(); const auto plo = geom.ProbLoArray(); - // Find particles that are in each cell ; + // Find particles that are in each cell; // results are stored in the object `bins`. ParticleBins bins; bins.build(np, particle_ptr, cbx, @@ -128,7 +132,11 @@ void CollisionType::doCoulombCollisionsWithinTile const Real dt = WarpX::GetInstance().getdt(lev); Geometry const& geom = WarpX::GetInstance().Geom(lev); - const Real dV = geom.CellSize(0)*geom.CellSize(1)*geom.CellSize(2); + #if (AMREX_SPACEDIM == 2) + auto dV = geom.CellSize(0) * geom.CellSize(1); + #elif (AMREX_SPACEDIM == 3) + auto dV = geom.CellSize(0) * geom.CellSize(1) * geom.CellSize(2); + #endif // Loop over cells amrex::ParallelFor( n_cells, @@ -200,7 +208,11 @@ void CollisionType::doCoulombCollisionsWithinTile const Real dt = WarpX::GetInstance().getdt(lev); Geometry const& geom = WarpX::GetInstance().Geom(lev); - const Real dV = geom.CellSize(0)*geom.CellSize(1)*geom.CellSize(2); + #if (AMREX_SPACEDIM == 2) + auto dV = geom.CellSize(0) * geom.CellSize(1); + #elif (AMREX_SPACEDIM == 3) + auto dV = geom.CellSize(0) * geom.CellSize(1) * geom.CellSize(2); + #endif // Loop over cells amrex::ParallelFor( n_cells, diff --git a/Source/Particles/Collision/ComputeTemperature.H b/Source/Particles/Collision/ComputeTemperature.H index 770510d74..81cb14dad 100644 --- a/Source/Particles/Collision/ComputeTemperature.H +++ b/Source/Particles/Collision/ComputeTemperature.H @@ -1,3 +1,9 @@ +/* Copyright 2019-2020 Andrew Myers, Yinjian Zhao + * + * This file is part of WarpX. + * + * License: BSD-3-Clause-LBNL + */ #ifndef WARPX_PARTICLES_COLLISION_COMPUTE_TEMPERATURE_H_ #define WARPX_PARTICLES_COLLISION_COMPUTE_TEMPERATURE_H_ diff --git a/Source/Particles/Collision/ElasticCollisionPerez.H b/Source/Particles/Collision/ElasticCollisionPerez.H index 8e16d95cc..b1fa64300 100644 --- a/Source/Particles/Collision/ElasticCollisionPerez.H +++ b/Source/Particles/Collision/ElasticCollisionPerez.H @@ -1,3 +1,9 @@ +/* Copyright 2019 Yinjian Zhao + * + * This file is part of WarpX. + * + * License: BSD-3-Clause-LBNL + */ #ifndef WARPX_PARTICLES_COLLISION_ELASTIC_COLLISION_PEREZ_H_ #define WARPX_PARTICLES_COLLISION_ELASTIC_COLLISION_PEREZ_H_ diff --git a/Source/Particles/Collision/ShuffleFisherYates.H b/Source/Particles/Collision/ShuffleFisherYates.H index 621e654d6..614b44d37 100644 --- a/Source/Particles/Collision/ShuffleFisherYates.H +++ b/Source/Particles/Collision/ShuffleFisherYates.H @@ -1,3 +1,9 @@ +/* Copyright 2019 Yinjian Zhao + * + * This file is part of WarpX. + * + * License: BSD-3-Clause-LBNL + */ #ifndef WARPX_PARTICLES_COLLISION_SHUFFLE_FISHER_YATES_H_ #define WARPX_PARTICLES_COLLISION_SHUFFLE_FISHER_YATES_H_ diff --git a/Source/Particles/Collision/UpdateMomentumPerezElastic.H b/Source/Particles/Collision/UpdateMomentumPerezElastic.H index 948e8b075..05c8cd227 100644 --- a/Source/Particles/Collision/UpdateMomentumPerezElastic.H +++ b/Source/Particles/Collision/UpdateMomentumPerezElastic.H @@ -1,3 +1,9 @@ +/* Copyright 2019 Yinjian Zhao + * + * This file is part of WarpX. + * + * License: BSD-3-Clause-LBNL + */ #ifndef WARPX_PARTICLES_COLLISION_UPDATE_MOMENTUM_PEREZ_ELASTIC_H_ #define WARPX_PARTICLES_COLLISION_UPDATE_MOMENTUM_PEREZ_ELASTIC_H_ |