ImpactX
Loading...
Searching...
No Matches
impactx::elements::Source Struct Reference

#include <Source.H>

Inheritance diagram for impactx::elements::Source:
impactx::elements::mixin::Named impactx::elements::mixin::LinearTransport< Source > impactx::elements::mixin::Thin impactx::elements::mixin::NoFinalize

Public Types

using PType = ImpactXParticleContainer::ParticleType

Public Member Functions

 Source (std::string distribution, std::string openpmd_path, bool active_once=DEFAULT_active_once, std::optional< std::string > name=DEFAULT_name)
void reverse ()
void operator() (ImpactXParticleContainer &pc, int step, int period)
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 transport_map (RefPart const &AMREX_RESTRICT refpart) const
Public Member Functions inherited from impactx::elements::mixin::Named
AMREX_GPU_HOST void set_name (std::string const &new_name)
AMREX_GPU_HOST Named (std::optional< std::string > name)
AMREX_GPU_HOST_DEVICE ~Named ()
AMREX_GPU_HOST Named (Named const &other)
AMREX_GPU_HOST Namedoperator= (Named const &other)
AMREX_GPU_HOST_DEVICE Named (Named &&other) noexcept
AMREX_GPU_HOST_DEVICE Namedoperator= (Named &&other) noexcept
AMREX_FORCE_INLINE std::string name () const
AMREX_FORCE_INLINE bool has_name () const
Public Member Functions inherited from impactx::elements::mixin::LinearTransport< Source >
AMREX_GPU_HOST AMREX_FORCE_INLINE void operator() (Map6x6 &AMREX_RESTRICT cm, RefPart const &AMREX_RESTRICT ref) const
Public Member Functions inherited from impactx::elements::mixin::Thin
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void operator() (RefPart &AMREX_RESTRICT refpart) const
void reverse ()
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int nslice () const
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal ds () const
Public Member Functions inherited from impactx::elements::mixin::NoFinalize
void finalize ()

Public Attributes

std::string m_distribution
std::string m_series_name
 Distribution type of particles in the source.
bool m_active_once = true
 openPMD filename

Static Public Attributes

static constexpr auto type = "Source"
static constexpr bool DEFAULT_active_once = true
Static Public Attributes inherited from impactx::elements::mixin::Named
static constexpr std::nullopt_t DEFAULT_name = std::nullopt
Static Public Attributes inherited from impactx::elements::mixin::LinearTransport< Source >
static constexpr bool has_linear_transport

Member Typedef Documentation

◆ PType

Constructor & Destructor Documentation

◆ Source()

impactx::elements::Source::Source ( std::string distribution,
std::string openpmd_path,
bool active_once = DEFAULT_active_once,
std::optional< std::string > name = DEFAULT_name )
inline

A particle source

Parameters
distributionMust read "openPMD" for this constructor
openpmd_pathpath to openPMD series as accepted by openPMD::Series
active_onceinject particles only for the first lattice period
namea user defined and not necessarily unique name of the element

Member Function Documentation

◆ operator()()

void impactx::elements::Source::operator() ( ImpactXParticleContainer & pc,
int step,
int period )

Initialize/Load particles.

Particles are relative to the reference particle.

Parameters
[in,out]pcparticle container to push
[in]stepglobal step for diagnostics
[in]periodfor periodic lattices, this is the current period (turn or cycle)

◆ reverse()

void impactx::elements::Source::reverse ( )
inline

Reverse the element (not supported for Source)

◆ transport_map()

AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 impactx::elements::Source::transport_map ( RefPart const &AMREX_RESTRICT refpart) const
inline

This function returns the linear transport map.

Parameters
[in]refpartreference particle
Returns
6x6 transport matrix

Member Data Documentation

◆ DEFAULT_active_once

bool impactx::elements::Source::DEFAULT_active_once = true
staticconstexpr

◆ m_active_once

bool impactx::elements::Source::m_active_once = true

openPMD filename

◆ m_distribution

std::string impactx::elements::Source::m_distribution

◆ m_series_name

std::string impactx::elements::Source::m_series_name

Distribution type of particles in the source.

◆ type

auto impactx::elements::Source::type = "Source"
staticconstexpr

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