WarpX
Loading...
Searching...
No Matches
WarpXFaceExtensions.cpp File Reference

Enumerations

enum class  FieldType
 

Functions

template<class T>
AMREX_GPU_DEVICE AMREX_FORCE_INLINE constexpr T GetNeigh (const amrex::Array4< T > &arr, const int i, const int j, const int k, const int i_n, const int j_n, const int dim)
 Get the value of arr in the neighbor (i_n, j_n) on the plane with normal 'dim'.
 
template<class T>
AMREX_GPU_DEVICE AMREX_FORCE_INLINE constexpr void SetNeigh (const amrex::Array4< T > &arr, const T val, const int i, const int j, const int k, const int i_n, const int j_n, const int dim)
 Set the value of arr in the neighbor (i_n, j_n) on the plane with normal 'dim'.
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE int ComputeNBorrowOneFaceExtension (const amrex::Dim3 cell, const amrex::Real S_ext, const amrex::Array4< amrex::Real > &S_red, const amrex::Array4< int > &flag_info_face, const amrex::Array4< int > &flag_ext_face, const int idim)
 For the face of cell pointing in direction idim, return the number of faces we need to intrude with the one-way extension. Returns only one or zero: one if the face can be extended with the the one-way extension, zeros if it can't.
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE int ComputeNBorrowEightFacesExtension (const amrex::Dim3 cell, const amrex::Real S_ext, const amrex::Array4< amrex::Real > &S_red, const amrex::Array4< amrex::Real > &S, const amrex::Array4< int > &flag_info_face, const int idim)
 For the face of cell pointing in direction idim, return the number of faces we need to intrude with the eight-ways extension.
 

Enumeration Type Documentation

◆ FieldType

enum class warpx::fields::FieldType : int
strong

Unique identifiers for WarpX scalar and vector fields.

These are implemented as amrex::MultiFab (one or one per component "direction", respectively) and stored in the ablastr::fields::MultiFabRegister .

Function Documentation

◆ ComputeNBorrowEightFacesExtension()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE int ComputeNBorrowEightFacesExtension ( const amrex::Dim3 cell,
const amrex::Real S_ext,
const amrex::Array4< amrex::Real > & S_red,
const amrex::Array4< amrex::Real > & S,
const amrex::Array4< int > & flag_info_face,
int idim )

For the face of cell pointing in direction idim, return the number of faces we need to intrude with the eight-ways extension.

Parameters
[in]cellDim3 storing the indices of the face to extended
[in]S_extamount of area needed for the extension
[in]S_redArray4 storing the amount of area each face can still give away
[in]SArray4 storing the area of face
[in]flag_info_faceArray4 storing face information
[in]idimnormal direction to the face in consideration (0 for x, 1 for y, 2 for z)

◆ ComputeNBorrowOneFaceExtension()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE int ComputeNBorrowOneFaceExtension ( const amrex::Dim3 cell,
const amrex::Real S_ext,
const amrex::Array4< amrex::Real > & S_red,
const amrex::Array4< int > & flag_info_face,
const amrex::Array4< int > & flag_ext_face,
int idim )

For the face of cell pointing in direction idim, return the number of faces we need to intrude with the one-way extension. Returns only one or zero: one if the face can be extended with the the one-way extension, zeros if it can't.

Parameters
[in]cellDim3 storing the indices of the face to extended
[in]S_extamount of area needed for the extension
[in]S_redArray4 storing the amount of area each face can still give away
[in]flag_info_faceArray4 storing face information
[in]flag_ext_faceArray4 storing face information
[in]idimnormal direction to the face in consideration (0 for x, 1 for y, 2 for z)

◆ GetNeigh()

template<class T>
AMREX_GPU_DEVICE AMREX_FORCE_INLINE constexpr T GetNeigh ( const amrex::Array4< T > & arr,
const int i,
const int j,
const int k,
const int i_n,
const int j_n,
const int dim )
constexpr

Get the value of arr in the neighbor (i_n, j_n) on the plane with normal 'dim'.

  I.E. If dim==0 it return arr(i, j + i_n, k + j_n),
       if dim==1 it return arr(i + i_n, j, k + j_n),
       if dim==2 it return arr(i + i_n, j + j_n, k)
Parameters
[in]arrdata To be accessed
[in]i,j,kthe indices of the "center" cell
[in]i_nthe offset of the neighbor in the first direction
[in]j_nthe offset of the neighbor in the second direction
[in]dimnormal direction to the plane in consideration (0 for x, 1 for y, 2 for z)

◆ SetNeigh()

template<class T>
AMREX_GPU_DEVICE AMREX_FORCE_INLINE constexpr void SetNeigh ( const amrex::Array4< T > & arr,
const T val,
const int i,
const int j,
const int k,
const int i_n,
const int j_n,
const int dim )
constexpr

Set the value of arr in the neighbor (i_n, j_n) on the plane with normal 'dim'.

  I.E. If dim==0 it return arr(i, j + i_n, k + j_n),
       if dim==1 it return arr(i + i_n, j, k + j_n),
       if dim==2 it return arr(i + i_n, j + j_n, k)
Parameters
[in]arrdata to be modified
[in]valthe value to be set
[in]i,j,kthe indices of the "center" cell
[in]i_nthe offset of the neighbor in the first direction
[in]j_nthe offset of the neighbor in the second direction
[in]dimnormal direction to the plane in consideration (0 for x, 1 for y, 2 for z)