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, std::optional< std::string > name=std::nullopt)
 
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 >
 LinearTransport ()=default
 
 LinearTransport (LinearTransport const &)=default
 
 LinearTransport (LinearTransport &&)=default
 
LinearTransportoperator= (LinearTransport const &)=default
 
LinearTransportoperator= (LinearTransport &&rhs)=default
 
 ~LinearTransport ()=default
 
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
 
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.
 

Static Public Attributes

static constexpr auto type = "Source"
 

Member Typedef Documentation

◆ PType

Constructor & Destructor Documentation

◆ Source()

impactx::elements::Source::Source ( std::string distribution,
std::string openpmd_path,
std::optional< std::string > name = std::nullopt )
inline

A particle source

Parameters
distributionMust read "openPMD" for this constructor
openpmd_pathpath to openPMD series as accepted by openPMD::Series
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)

◆ 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

◆ 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: