WarpX
ParticleBuffer.H
Go to the documentation of this file.
1 /* Copyright 2021 Andrew Myers
2  *
3  * This file is part of WarpX.
4  *
5  * License: BSD-3-Clause-LBNL
6  */
7 #ifndef PARTICLEBUFFER_H_
8 #define PARTICLEBUFFER_H_
9 
11 #include "WarpX.H"
12 
13 #include <AMReX_AmrParticles.H>
14 
15 namespace ParticleBuffer {
16  template <template<class> class Allocator>
17  using BufferType = amrex::AmrParticleContainer<0, 0, PIdx::nattribs, 0, Allocator>;
18 
19  template <template<class> class Allocator>
21  {
23  // add runtime real comps to tmp
24  for (int ic = 0; ic < pc->NumRuntimeRealComps(); ++ic) { tmp.AddRealComp(false); }
25 
26  // add runtime int comps to tmp
27  for (int ic = 0; ic < pc->NumRuntimeIntComps(); ++ic) { tmp.AddIntComp(false); }
28 
29  return tmp;
30  }
31 }
32 
33 #endif /*PARTICLEBUFFER_H_*/
BufferType< Allocator > getTmpPC(const WarpXParticleContainer *pc)
Definition: ParticleBuffer.H:20
amrex::AmrParticleContainer< 0, 0, PIdx::nattribs, 0, Allocator > BufferType
Definition: ParticleBuffer.H:17
static WarpX & GetInstance()
Definition: WarpX.cpp:200
Definition: ParticleBuffer.H:15
Definition: WarpXParticleContainer.H:110