WarpX
Enumerations | Functions
ParticleIO.H File Reference
#include "Particles/WarpXParticleContainer.H"
#include "Particles/Pusher/GetAndSetPosition.H"
#include "Particles/PinnedMemoryParticleContainer.H"
#include <ablastr/particles/NodalFieldGather.H>
#include <AMReX_AmrParticles.H>
#include <AMReX_ParIter.H>
#include <AMReX_Gpu.H>
#include <AMReX_REAL.H>

Go to the source code of this file.

Enumerations

enum class  ConvertDirection { WarpX_to_SI , SI_to_WarpX }
 

Functions

template<typename T_ParticleContainer >
void particlesConvertUnits (ConvertDirection convert_direction, T_ParticleContainer *pc, amrex::ParticleReal const mass)
 
void storePhiOnParticles (PinnedMemoryParticleContainer &tmp, int electrostatic_solver_id, bool is_full_diagnostic)
 

Enumeration Type Documentation

◆ ConvertDirection

enum ConvertDirection
strong
Enumerator
WarpX_to_SI 
SI_to_WarpX 

Function Documentation

◆ particlesConvertUnits()

template<typename T_ParticleContainer >
void particlesConvertUnits ( ConvertDirection  convert_direction,
T_ParticleContainer *  pc,
amrex::ParticleReal const  mass 
)

Convert particle momentum to/from SI

Particle momentum is defined as gamma*velocity, which is neither SI mass*gamma*velocity nor normalized gamma*velocity/c. This converts momentum to SI units (or vice-versa) to write SI data to file. Photons are a special case, since particle momentum is defined as (photon_energy/(m_e * c) ) * u, where u is the photon direction (a unit vector).

Template Parameters
T_ParticleContainera WarpX particle container or AmrParticleContainer
Parameters
convert_directionconvert to or from SI
pcthe particle container to manipulate
massthe particle rest mass to use for conversion

◆ storePhiOnParticles()

void storePhiOnParticles ( PinnedMemoryParticleContainer tmp,
int  electrostatic_solver_id,
bool  is_full_diagnostic 
)

Gathers phi (electrostatic potential) from a MultiFab to the macroparticles. Adds a runtime component of the particle container to store it.

Parameters
tmpthe particle container on which to store the gathered field
electrostatic_solver_idthe type of electrostatic solver used
is_full_diagnosticwhether this diagnostic is a full diagnostic