ImpactX
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
impactx::Programmable Struct Reference

#include <Programmable.H>

Public Types

using PType = ImpactXParticleContainer::ParticleType
 

Public Member Functions

 Programmable (amrex::ParticleReal ds=0.0, int nslice=1)
 
void operator() (ImpactXParticleContainer &pc, int step) const
 
void operator() (ImpactXParticleContainer::iterator &pti, RefPart &ref_part) const
 
void operator() (RefPart &refpart) const
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int nslice () const
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal ds () const
 

Public Attributes

amrex::ParticleReal m_ds = 0.0
 
int m_nslice = 1
 segment length in m More...
 
bool m_threadsafe = false
 number of slices used for the application of space charge More...
 
std::function< void(ImpactXParticleContainer *, int)> m_push
 
std::function< void(ImpactXParticleContainer::iterator *, RefPart &)> m_beam_particles
 hook for push of whole container More...
 
std::function< void(RefPart &)> m_ref_particle
 hook for beam particles More...
 

Static Public Attributes

static constexpr auto name = "Programmable"
 

Member Typedef Documentation

◆ PType

Constructor & Destructor Documentation

◆ Programmable()

impactx::Programmable::Programmable ( amrex::ParticleReal  ds = 0.0,
int  nslice = 1 
)
inline

This element can be programmed

Member Function Documentation

◆ ds()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal impactx::Programmable::ds ( ) const
inline

Return the segment length

Returns
value in meters

◆ nslice()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int impactx::Programmable::nslice ( ) const
inline

Number of slices used for the application of space charge

Returns
positive integer

◆ operator()() [1/3]

void impactx::Programmable::operator() ( ImpactXParticleContainer pc,
int  step 
) const

Push all particles relative to the reference particle

Parameters
[in,out]pcparticle container to push
[in]stepglobal step for diagnostics

◆ operator()() [2/3]

void impactx::Programmable::operator() ( ImpactXParticleContainer::iterator pti,
RefPart ref_part 
) const

Push all particles relative to the reference particle

◆ operator()() [3/3]

void impactx::Programmable::operator() ( RefPart refpart) const

This pushes the reference particle.

Parameters
[in,out]refpartreference particle

Member Data Documentation

◆ m_beam_particles

std::function<void(ImpactXParticleContainer::iterator *, RefPart &)> impactx::Programmable::m_beam_particles

hook for push of whole container

◆ m_ds

amrex::ParticleReal impactx::Programmable::m_ds = 0.0

◆ m_nslice

int impactx::Programmable::m_nslice = 1

segment length in m

◆ m_push

std::function<void(ImpactXParticleContainer *, int)> impactx::Programmable::m_push

◆ m_ref_particle

std::function<void(RefPart &)> impactx::Programmable::m_ref_particle

hook for beam particles

◆ m_threadsafe

bool impactx::Programmable::m_threadsafe = false

number of slices used for the application of space charge

Allow threading via OpenMP for the particle iterator loop

This will only affect threading if the OMP backend is active.

The default value is false to do the safe thing by default. Users must opt-in their guarantee that their code is thread-safe.

◆ name

constexpr auto impactx::Programmable::name = "Programmable"
static

The documentation for this struct was generated from the following files: