aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms
diff options
context:
space:
mode:
Diffstat (limited to 'Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms')
-rw-r--r--Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/FieldAccessorFunctors.H28
1 files changed, 7 insertions, 21 deletions
diff --git a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/FieldAccessorFunctors.H b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/FieldAccessorFunctors.H
index c6cb7f9db..8b39296f9 100644
--- a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/FieldAccessorFunctors.H
+++ b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/FieldAccessorFunctors.H
@@ -16,20 +16,14 @@
/**
* \brief Functor that returns the division of the source m_field Array4 value
- by macroparameter obtained using functor, m_getParameter,
- at the respective (i,j,k,ncomp).
+ by macroparameter obtained using m_parameter, at the respective (i,j,k).
*/
-template< typename T_GetMacroparameter>
struct FieldAccessorMacroscopic
{
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
FieldAccessorMacroscopic ( amrex::Array4<amrex::Real const> const a_field,
- T_GetMacroparameter const& a_getParameter,
- amrex::GpuArray<int,3> const& a_field_stag,
- amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> const a_domain_lo,
- amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> const a_dx )
- : m_field(a_field), m_getParameter(a_getParameter), m_field_stag(a_field_stag),
- m_domain_lo(a_domain_lo), m_dx(a_dx) {}
+ amrex::Array4<amrex::Real> const& a_parameter)
+ : m_field(a_field), m_parameter(a_parameter) {}
/**
* \brief return field value at (i,j,k,ncomp) scaled by (1/m_getParameter(x,y,z))
@@ -38,7 +32,7 @@ struct FieldAccessorMacroscopic
* \param[in] j index along y of the Array4, m_field and m_parameter.
* \param[in] k index along z of the Array4, m_field and m_parameter.
* \param[in] ncomp index along fourth component of the Array4, containing field-data
- to be returned after dividing by the macroparameter.
+ * to be returned after dividing by the macroparameter.
*
* \return m_field/m_getParameter(x,y,z) at (i,j,k,ncomp)
*/
@@ -46,21 +40,13 @@ struct FieldAccessorMacroscopic
amrex::Real operator() (int const i, int const j,
int const k, int const ncomp) const noexcept
{
- amrex::Real x, y, z;
- WarpXUtilAlgo::getCellCoordinates(i, j, k, m_field_stag, m_domain_lo, m_dx, x, y, z);
- return ( m_field(i, j, k, ncomp) / m_getParameter(x, y, z) ) ;
+ return ( m_field(i, j, k, ncomp) / m_parameter(i, j, k) ) ;
}
private:
/** Array4 of the source field to be scaled and returned by the operator() */
amrex::Array4<amrex::Real const> const m_field;
- /** Functor object to return the macroparameter at a given position on the grid.*/
- T_GetMacroparameter const m_getParameter;
- /** Staggering of the field multifab, m_field */
- amrex::GpuArray<int,3> const m_field_stag;
- /** Lower physical coordinates of the simulation domain. */
- amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> const m_domain_lo;
- /** Cell-size array */
- amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> const m_dx;
+ /** Array4 of the macroscopic parameter used to divide m_field in the operator() */
+ amrex::Array4<amrex::Real const> const m_parameter;
};