WarpX
Public Member Functions | Public Attributes | List of all members
SmartCreate Struct Reference

This is a functor for performing a "smart create" that works in both host and device code. More...

#include <SmartCreate.H>

Public Member Functions

template<typename PartData >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void operator() (PartData &prt, const int i_prt, amrex::RandomEngine const &engine, const amrex::Real x=0.0, const amrex::Real y=0.0, const amrex::Real z=0.0, const int cpu=0, const int id=0) const noexcept
 

Public Attributes

const InitializationPolicym_policy_real
 
const InitializationPolicym_policy_int
 
const int m_weight_index = 0
 

Detailed Description

This is a functor for performing a "smart create" that works in both host and device code.

A "smart" create does the following: First, it initializes the position, cpuid and id of the particle (in most cases IDs should be initialized using setNewParticleIDs after their creation). Then, it initializes all the other components according to initialization policies.

You don't create this directly - use the SmartCreateFactory object below.

Member Function Documentation

◆ operator()()

template<typename PartData >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void SmartCreate::operator() ( PartData &  prt,
const int  i_prt,
amrex::RandomEngine const &  engine,
const amrex::Real  x = 0.0,
const amrex::Real  y = 0.0,
const amrex::Real  z = 0.0,
const int  cpu = 0,
const int  id = 0 
) const
inlinenoexcept

Member Data Documentation

◆ m_policy_int

const InitializationPolicy* SmartCreate::m_policy_int

◆ m_policy_real

const InitializationPolicy* SmartCreate::m_policy_real

◆ m_weight_index

const int SmartCreate::m_weight_index = 0

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