WarpX
Filter.H
Go to the documentation of this file.
1 /* Copyright 2019 Maxence Thevenet, Weiqun Zhang
2  *
3  * This file is part of WarpX.
4  *
5  * License: BSD-3-Clause-LBNL
6  */
7 #include <AMReX_Dim3.H>
8 #include <AMReX_GpuContainers.H>
9 #include <AMReX_IntVect.H>
10 #include <AMReX_REAL.H>
11 
12 #include <AMReX_BaseFwd.H>
13 
14 #ifndef WARPX_FILTER_H_
15 #define WARPX_FILTER_H_
16 
17 class Filter
18 {
19 public:
20  Filter () = default;
21 
22  // Apply stencil on MultiFab.
23  // Guard cells are handled inside this function
24  void ApplyStencil(amrex::MultiFab& dstmf,
25  const amrex::MultiFab& srcmf, int lev, int scomp=0,
26  int dcomp=0, int ncomp=10000);
27 
28  // Apply stencil on a FabArray.
29  void ApplyStencil (amrex::FArrayBox& dstfab,
30  const amrex::FArrayBox& srcfab, const amrex::Box& tbx,
31  int scomp=0, int dcomp=0, int ncomp=10000);
32 
33  // public for cuda
34  void DoFilter(const amrex::Box& tbx,
36  amrex::Array4<amrex::Real > const& dst,
37  int scomp, int dcomp, int ncomp);
38 
39  // In 2D, stencil_length_each_dir = {length(stencil_x), length(stencil_z)}
41 
42 protected:
43  // Stencil along each direction.
44  // in 2D, stencil_y is not initialized.
46  // Length of each stencil.
47  // In 2D, slen = {length(stencil_x), length(stencil_z), 1}
49 
50 private:
51 
52 };
53 #endif // #ifndef WARPX_FILTER_H_
Definition: Filter.H:18
Filter()=default
void ApplyStencil(amrex::MultiFab &dstmf, const amrex::MultiFab &srcmf, int lev, int scomp=0, int dcomp=0, int ncomp=10000)
Definition: Filter.cpp:202
amrex::Gpu::DeviceVector< amrex::Real > stencil_y
Definition: Filter.H:45
amrex::Gpu::DeviceVector< amrex::Real > stencil_x
Definition: Filter.H:45
amrex::Gpu::DeviceVector< amrex::Real > stencil_z
Definition: Filter.H:45
amrex::Dim3 slen
Definition: Filter.H:48
void DoFilter(const amrex::Box &tbx, amrex::Array4< amrex::Real const > const &tmp, amrex::Array4< amrex::Real > const &dst, int scomp, int dcomp, int ncomp)
Definition: Filter.cpp:272
amrex::IntVect stencil_length_each_dir
Definition: Filter.H:40