Particles

Initialization

The following operations can be applied in the picongpu::particles::InitPipeline inside speciesInitialization.param:

CreateDensity

template <typename T_DensityFunctor, typename T_PositionFunctor, typename T_SpeciesType = bmpl::_1>
struct picongpu::particles::CreateDensity

create density based on a normalized profile and a position profile

constructor with current time step of density and position profile is called after the density profile is created fillAllGaps() is called

Template Parameters
  • T_DensityFunctor: unary lambda functor with profile description
  • T_PositionFunctor: unary lambda functor with position description
  • T_SpeciesType: type of the used species

DeriveSpecies

template <typename T_SrcSpeciesType, typename T_DestSpeciesType = bmpl::_1>
struct picongpu::particles::DeriveSpecies

derive species out of a another species

after the species is derived fillAllGaps() on T_DestSpeciesType is called copy all attributes from the source species except particleId to the destination species

Template Parameters
  • T_SrcSpeciesType: source species
  • T_DestSpeciesType: destination species

Inherits from picongpu::particles::ManipulateDeriveSpecies< manipulators::NoneImpl, T_SrcSpeciesType, T_DestSpeciesType >

Manipulate

template <typename T_Functor, typename T_SpeciesType = bmpl::_1>
struct picongpu::particles::Manipulate

run a user defined functor for every particle

  • constructor with current time step is called for the functor on the host side
  • Warning
    fillAllGaps() is not called
    Template Parameters
    • T_Functor: unary lambda functor
    • T_SpeciesType: type of the used species

ManipulateDeriveSpecies

template <typename T_ManipulateFunctor, typename T_SrcSpeciesType, typename T_DestSpeciesType = bmpl::_1>
struct picongpu::particles::ManipulateDeriveSpecies

derive species out of a another species

after the species is derived fillAllGaps() on T_DestSpeciesType is called copy all attributes from the source species except particleId to the destination species

See
src/picongpu/include/particles/manipulators
Template Parameters
  • T_ManipulateFunctor: a pseudo-binary functor accepting two particle species: destination and source,
Template Parameters
  • T_SrcSpeciesType: source species
  • T_DestSpeciesType: destination species

FillAllGaps

template <typename T_SpeciesType = bmpl::_1>
struct picongpu::particles::FillAllGaps

call method fill all gaps of a species

Template Parameters
  • T_SpeciesType: type of the species

Manipulation

Some of the particle operations above can further take the following functors as arguments to manipulate attributes of particle species:

AssignImpl

struct picongpu::particles::manipulators::AssignImpl

CopyAttribute

using picongpu::particles::manipulators::CopyAttribute = typedef FreeImpl< detail::CopyAttributeFunctor< T_DestAttribute, T_SrcAttribute > >

copy a particle source attribute to a destination attribute

This is an unary functor and operates on one particle.

Template Parameters
  • T_DestAttribute: type of the destination attribute e.g. momentumPrev1
  • T_SrcAttribute: type of the source attribute e.g. momentum

DensityWeighting

struct picongpu::particles::manipulators::DensityWeighting

DriftImpl

template <typename T_ParamClass, typename T_ValueFunctor, typename T_SpeciesType>
struct picongpu::particles::manipulators::DriftImpl

Inherits from T_ValueFunctor

FreeImpl

template <typename T_Functor>
struct picongpu::particles::manipulators::FreeImpl

generic manipulator to create user defined manipulators

Template Parameters
  • T_Functor: user defined functor
    • must implement void operator()(ParticleType) or void operator()(ParticleType1, ParticleType2)
    • optional: can implement one host side constructor T_Functor() or T_Functor(uint32_t currentTimeStep)

Inherits from T_Functor

FreeRngImpl

template <typename T_Functor, typename T_Distribution, typename T_SpeciesType>
struct picongpu::particles::manipulators::FreeRngImpl

call simple free user defined functor and provide a random number generator

example: add

#include "nvidia/rng/distributions/Uniform_float.hpp"

struct RandomXFunctor
{
    template< typename T_Rng, typename T_Particle >
    DINLINE void operator()( T_Rng& rng, T_Particle& particle )
    {
        particle[ position_ ].x() = rng();
    }
};

typedef FreeRngImpl<
   RandomXFunctor,
   nvidia::rng::distributions::Uniform_float
> RandomXPos;
particles::Manipulate< RandomXPos, SPECIES_NAME >
to InitPipeline in speciesInitialization.param
Template Parameters
  • T_Functor: user defined unary functor
  • T_Distribution: random number distribution
  • T_SpeciesType: type of the species that shall be manipulated

Inherits from T_Functor

IfRelativeGlobalPositionImpl

template <typename T_ParamClass, typename T_Functor, typename T_SpeciesType>
struct picongpu::particles::manipulators::IfRelativeGlobalPositionImpl

Inherits from T_Functor

ProtonTimesWeighting

struct picongpu::particles::manipulators::ProtonTimesWeighting

RandomPositionImpl

template <typename T_SpeciesType>
struct picongpu::particles::manipulators::RandomPositionImpl

Change the in cell position.

This functor changes the in-cell position of each particle of a species

example: add

typedef particles::manipulators::RandomPositionImpl<> RandomPosition;
particles::Manipulate<RandomPosition,SPECIES_NAME>
to InitPipeline in speciesInitialization.param
Template Parameters
  • T_SpeciesType: type of the species that shall be manipulated

SetAttributeImpl

template <typename T_ParamClass, typename T_ValueFunctor, typename T_SpeciesType>
struct picongpu::particles::manipulators::SetAttributeImpl

Inherits from T_ValueFunctor

TemperatureImpl

template <typename T_ParamClass, typename T_ValueFunctor, typename T_SpeciesType>
struct picongpu::particles::manipulators::TemperatureImpl

Inherits from T_ValueFunctor