WarpX
Functions
WarpXFaceExtensions.cpp File Reference
#include "WarpXFaceInfoBox.H"
#include "Utils/TextMsg.H"
#include "WarpX.H"
#include <ablastr/warn_manager/WarnManager.H>
#include <AMReX_Scan.H>
#include <AMReX_iMultiFab.H>
#include <AMReX_MultiFab.H>

Functions

template<class T >
AMREX_GPU_DEVICE constexpr AMREX_FORCE_INLINEGetNeigh (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'. More...
 
template<class T >
AMREX_GPU_DEVICE constexpr AMREX_FORCE_INLINE 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'. More...
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real ComputeSStab (const int i, const int j, const int k, const amrex::Array4< const amrex::Real > lx, const amrex::Array4< const amrex::Real > ly, const amrex::Array4< const amrex::Real > lz, const amrex::Real dx, const amrex::Real dy, const amrex::Real dz, const int dim)
 Compute the minimal area for stability for the face i, j, k with normal 'dim'. More...
 
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. More...
 
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. More...
 

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)

◆ ComputeSStab()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real ComputeSStab ( const int  i,
const int  j,
const int  k,
const amrex::Array4< const amrex::Real >  lx,
const amrex::Array4< const amrex::Real >  ly,
const amrex::Array4< const amrex::Real >  lz,
const amrex::Real  dx,
const amrex::Real  dy,
const amrex::Real  dz,
const int  dim 
)

Compute the minimal area for stability for the face i, j, k with normal 'dim'.

Parameters
[in]i,j,kthe indices of the cell
[in]lx,ly,lzarrays containing the edge lengths
[in]dx,dy,dzthe mesh with in each direction
[in]dimnormal direction to the plane in consideration (0 for x, 1 for y, 2 for z)

◆ GetNeigh()

template<class T >
AMREX_GPU_DEVICE constexpr AMREX_FORCE_INLINE 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 constexpr AMREX_FORCE_INLINE 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)