WarpX
Loading...
Searching...
No Matches
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 <AMReX_Array.H>
12#include <AMReX_Extension.H>
13#include <AMReX_Gpu.H>
14
20{
23 amrex::Array4<amrex::Real> const& a_parameter)
24 : m_field(a_field), m_parameter(a_parameter) {}
25
38 amrex::Real operator() (int const i, int const j,
39 int const k, int const ncomp) const noexcept
40 {
41 return ( m_field(i, j, k, ncomp) / m_parameter(i, j, k) ) ;
42 }
43private:
48};
49
50
51#endif
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
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:22
amrex::Array4< amrex::Real const > m_parameter
Definition FieldAccessorFunctors.H:47
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:38
amrex::Array4< amrex::Real const > m_field
Definition FieldAccessorFunctors.H:45