IPPL API Reference
Independent Parallel Particle Layer C++ API
Loading...
Searching...
No Matches
EvalFunctor.h
1// File EvalFunctor.h
2// Helper header defining the EvalFunctor struct
3// for the FEMPoissonSolver and the PreconditionedFEMPoissonSolver.
4// This EvalFunctor represents the action of the matrix A on a
5// vector x for the Poisson equation in its FEM formulation Ax=b.
6// This functor is passed to the LagrangeSpace in FEMPoissonSolver
7// to be used for matrix-free evaluation.
8
9#ifndef IPPL_EVALFUNCTOR_H
10#define IPPL_EVALFUNCTOR_H
11
12#include "FEM/FEMQuadratureData.h"
13
14namespace ippl {
15 template <typename Tlhs, unsigned Dim, unsigned numElemDOFs>
16 struct EvalFunctor {
18 const Tlhs absDetDPhi;
19
23
24 KOKKOS_FUNCTION auto operator()(
25 const size_t& i, const size_t& j,
26 const QuadratureData<Tlhs, Vector<Tlhs, Dim>, numElemDOFs>& qd) const {
27 return dot((DPhiInvT * qd.deriv_q[j]), (DPhiInvT * qd.deriv_q[i])).apply() * absDetDPhi;
28 }
29 };
30}
31
32#endif
Definition Vector.h:23
Definition Archive.h:20
KOKKOS_FUNCTION auto operator()(size_t i, size_t j, const QuadratureData< Vector< T, Dim >, Vector< T, Dim >, numElementDOFs > &qd) const
Returns the evaluation of (curl(b_i)*curl(b_j) + b_i*b_j)*absDetDPhi.
Definition FEMMaxwellDiffusionSolver.h:70
const T absDetDPhi
The determinant of the Jacobian.
Definition FEMMaxwellDiffusionSolver.h:44
const Vector< T, Dim > DPhiInvT
The inverse transpose Jacobian.
Definition FEMMaxwellDiffusionSolver.h:36
EvalFunctor(Vector< T, Dim > DPhiInvT, T absDetDPhi)
Constructor.
Definition FEMMaxwellDiffusionSolver.h:49