WarpX
Functions
FilterCreateTransformFromFAB.H File Reference
#include "Particles/ParticleCreation/DefaultInitialization.H"
#include <AMReX_REAL.H>
#include <AMReX_TypeTraits.H>

Go to the source code of this file.

Functions

template<int N, typename DstPC , typename DstTile , typename FAB , typename Index , typename CreateFunc1 , typename CreateFunc2 , typename TransFunc , amrex::EnableIf_t< std::is_integral< Index >::value, int > foo = 0>
Index filterCreateTransformFromFAB (DstPC &pc1, DstPC &pc2, DstTile &dst1, DstTile &dst2, const amrex::Box box, const FAB *src_FAB, const Index *mask, const Index dst1_index, const Index dst2_index, CreateFunc1 &&create1, CreateFunc2 &&create2, TransFunc &&transform, const amrex::Geometry &geom_lev_zero) noexcept
 Apply a filter on a list of FABs, then create and apply a transform operation to the particles depending on the output of the filter. More...
 
template<int N, typename DstPC , typename DstTile , typename FABs , typename Index , typename FilterFunc , typename CreateFunc1 , typename CreateFunc2 , typename TransFunc >
Index filterCreateTransformFromFAB (DstPC &pc1, DstPC &pc2, DstTile &dst1, DstTile &dst2, const amrex::Box box, const FABs &src_FABs, const Index dst1_index, const Index dst2_index, FilterFunc &&filter, CreateFunc1 &&create1, CreateFunc2 &&create2, TransFunc &&transform, const amrex::Geometry &geom_lev_zero) noexcept
 Apply a filter on a list of FABs, then create and apply a transform operation to the particles depending on the output of the filter. More...
 

Function Documentation

◆ filterCreateTransformFromFAB() [1/2]

template<int N, typename DstPC , typename DstTile , typename FAB , typename Index , typename CreateFunc1 , typename CreateFunc2 , typename TransFunc , amrex::EnableIf_t< std::is_integral< Index >::value, int > foo = 0>
Index filterCreateTransformFromFAB ( DstPC &  pc1,
DstPC &  pc2,
DstTile &  dst1,
DstTile &  dst2,
const amrex::Box  box,
const FAB src_FAB,
const Index *  mask,
const Index  dst1_index,
const Index  dst2_index,
CreateFunc1 &&  create1,
CreateFunc2 &&  create2,
TransFunc &&  transform,
const amrex::Geometry geom_lev_zero 
)
noexcept

Apply a filter on a list of FABs, then create and apply a transform operation to the particles depending on the output of the filter.

This version of the function takes as inputs a mask and a FAB that can be used in the transform function, both of which can be obtained using another version of filterCreateTransformFromFAB that takes a filter function as input.

Template Parameters
Nnumber of particles created in the dst(s) in each cell
DstTilethe dst particle tile type
FABthe src FAB type
Indexthe index type, e.g. unsigned int
CreateFunc1the create function type for dst1
CreateFunc2the create function type for dst2
TransFuncthe transform function type
Parameters
[in,out]dst1the first destination tile
[in,out]dst2the second destination tile
[in]boxthe box where the particles are created
[in]src_FABA FAB defined on box that is used in the transform function
[in]maskpointer to the mask: 1 means create, 0 means don't create
[in]dst1_indexthe location at which to starting writing the result to dst1
[in]dst2_indexthe location at which to starting writing the result to dst2
[in]create1callable that defines what will be done for the create step for dst1.
[in]create2callable that defines what will be done for the create step for dst2.
[in]transformcallable that defines the transformation to apply on dst1 and dst2.
[in]geom_lev_zerothe geometry object associated to level zero
Returns
num_added the number of particles that were written to dst1 and dst2.

◆ filterCreateTransformFromFAB() [2/2]

template<int N, typename DstPC , typename DstTile , typename FABs , typename Index , typename FilterFunc , typename CreateFunc1 , typename CreateFunc2 , typename TransFunc >
Index filterCreateTransformFromFAB ( DstPC &  pc1,
DstPC &  pc2,
DstTile &  dst1,
DstTile &  dst2,
const amrex::Box  box,
const FABs &  src_FABs,
const Index  dst1_index,
const Index  dst2_index,
FilterFunc &&  filter,
CreateFunc1 &&  create1,
CreateFunc2 &&  create2,
TransFunc &&  transform,
const amrex::Geometry geom_lev_zero 
)
noexcept

Apply a filter on a list of FABs, then create and apply a transform operation to the particles depending on the output of the filter.

This version of the function takes as input a filter functor (and an array of FABs that can be used in the filter functor), uses it to obtain a mask and a FAB and then calls another version of filterCreateTransformFromFAB that takes the mask and the FAB as inputs.

Template Parameters
Nnumber of particles created in the dst(s) in each cell
DstTilethe dst particle tile type
FABsthe src array of Array4 type
Indexthe index type, e.g. unsigned int
FilterFuncthe filter function type
CreateFunc1the create function type for dst1
CreateFunc2the create function type for dst2
TransFuncthe transform function type
Parameters
[in,out]dst1the first destination tile
[in,out]dst2the second destination tile
[in]boxthe box where the particles are created
[in]src_FABsA collection of source data, e.g. a class with Array4 to the EM fields, defined on box on which the filter operation is applied
[in]dst1_indexthe location at which to starting writing the result to dst1
[in]dst2_indexthe location at which to starting writing the result to dst2
[in]filtera callable returning a value > 0 if particles are to be created in the considered cell.
[in]create1callable that defines what will be done for the create step for dst1.
[in]create2callable that defines what will be done for the create step for dst2.
[in]transformcallable that defines the transformation to apply on dst1 and dst2.
[in]geom_lev_zerothe geometry object associated to level zero
Returns
num_added the number of particles that were written to dst1 and dst2.