ARTEMIS
FieldAccessorFunctors.H
Go to the documentation of this file.
1 /* Copyright 2020 Revathi Jambunathan
2  *
3  * This file is part of WarpX.
4  *
5  * License: BSD-3-Clause-LBNL
6  */
7 
8 #ifndef WARPX_FIELD_ACCESSOR_FUNCTORS_H
9 #define WARPX_FIELD_ACCESSOR_FUNCTORS_H
10 
11 #include "WarpX.H"
13 
14 #include <AMReX_Array.H>
15 
16 
22 {
25  amrex::Array4<amrex::Real> const& a_parameter)
26  : m_field(a_field), m_parameter(a_parameter) {}
27 
40  amrex::Real operator() (int const i, int const j,
41  int const k, int const ncomp) const noexcept
42  {
43  return ( m_field(i, j, k, ncomp) / m_parameter(i, j, k) ) ;
44  }
45 private:
50 };
51 
52 
53 #endif
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
i
Definition: check_interp_points_and_weights.py:174
Functor that returns the division of the source m_field Array4 value by macroparameter obtained using...
Definition: FieldAccessorFunctors.H:22
amrex::Array4< amrex::Real const > const m_field
Definition: FieldAccessorFunctors.H:47
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE FieldAccessorMacroscopic(amrex::Array4< amrex::Real const > const a_field, amrex::Array4< amrex::Real > const &a_parameter)
Definition: FieldAccessorFunctors.H:24
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real operator()(int const i, int const j, int const k, int const ncomp) const noexcept
return field value at (i,j,k,ncomp) scaled by (1/m_getParameter(x,y,z))
Definition: FieldAccessorFunctors.H:40
amrex::Array4< amrex::Real const > const m_parameter
Definition: FieldAccessorFunctors.H:49