WarpX
FieldAccessorFunctors.H
Go to the documentation of this file.
1 #ifndef WARPX_FIELD_ACCESSOR_FUNCTORS_H
2 #define WARPX_FIELD_ACCESSOR_FUNCTORS_H
3 #include "WarpX.H"
9 {
10  AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
11  FieldAccessorMacroscopic ( amrex::Array4<amrex::Real const> const a_field,
12  amrex::Array4<amrex::Real const> const a_parameter )
13  : m_field(a_field), m_parameter(a_parameter) {}
14 
26  AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
27  amrex::Real operator() (int const i, int const j,
28  int const k, int const ncomp) const noexcept
29  {
30  return ( m_field(i, j, k, ncomp) / m_parameter(i, j, k, 0) ) ;
31  }
32 private:
34  amrex::Array4<amrex::Real const> const m_field;
36  amrex::Array4<amrex::Real const> const m_parameter;
37 };
38 
39 
40 #endif
amrex::Array4< amrex::Real const > const m_field
Definition: FieldAccessorFunctors.H:34
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE FieldAccessorMacroscopic(amrex::Array4< amrex::Real const > const a_field, amrex::Array4< amrex::Real const > const a_parameter)
Definition: FieldAccessorFunctors.H:11
i
Definition: check_interp_points_and_weights.py:171
Functor that returns the division of the source m_field Array4 value by macroparameter, m_parameter value at the respective (i,j,k,ncomp).
Definition: FieldAccessorFunctors.H:8
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_parameters(i,j,k,ncomp))
Definition: FieldAccessorFunctors.H:27
amrex::Array4< amrex::Real const > const m_parameter
Definition: FieldAccessorFunctors.H:36