ARTEMIS
Source
FieldSolver
FiniteDifferenceSolver
FiniteDifferenceAlgorithms
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
"
12
#include "
FieldSolver/FiniteDifferenceSolver/MacroscopicProperties/MacroscopicProperties.H
"
13
14
#include <
AMReX_Array.H
>
15
16
21
struct
FieldAccessorMacroscopic
22
{
23
AMREX_GPU_HOST_DEVICE
AMREX_FORCE_INLINE
24
FieldAccessorMacroscopic
(
amrex::Array4<amrex::Real const>
const
a_field,
25
amrex::Array4<amrex::Real>
const
& a_parameter)
26
:
m_field
(a_field),
m_parameter
(a_parameter) {}
27
39
AMREX_GPU_HOST_DEVICE
AMREX_FORCE_INLINE
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
:
47
amrex::Array4<amrex::Real const>
const
m_field
;
49
amrex::Array4<amrex::Real const>
const
m_parameter
;
50
};
51
52
53
#endif
AMReX_Array.H
AMREX_FORCE_INLINE
#define AMREX_FORCE_INLINE
AMREX_GPU_HOST_DEVICE
#define AMREX_GPU_HOST_DEVICE
MacroscopicProperties.H
WarpX.H
check_interp_points_and_weights.i
i
Definition:
check_interp_points_and_weights.py:174
FieldAccessorMacroscopic
Functor that returns the division of the source m_field Array4 value by macroparameter obtained using...
Definition:
FieldAccessorFunctors.H:22
FieldAccessorMacroscopic::m_field
amrex::Array4< amrex::Real const > const m_field
Definition:
FieldAccessorFunctors.H:47
FieldAccessorMacroscopic::FieldAccessorMacroscopic
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
FieldAccessorMacroscopic::operator()
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
FieldAccessorMacroscopic::m_parameter
amrex::Array4< amrex::Real const > const m_parameter
Definition:
FieldAccessorFunctors.H:49
amrex::Array4
Generated by
1.9.1