34 const int qorder = test_order + trial_order - 1;
36 const int nquad = ir.
Size();
38 Vector pa_data(nquad * nf);
44 const int q = idx % nquad;
45 const int f = idx / nquad;
46 d_pa_data(q,
f) = d_w[q];
52 const int ndof_face = trial_face_el.
GetDof();
55 const int d1d = maps->ndof;
56 const int q1d = maps->nqpt;
58 Vector mass_emat(ndof_face*ndof_face*nf);
64 internal::EAMassAssemble1D(nf, B, pa_data, mass_emat,
false, d1d, q1d);
68 internal::EAMassAssemble2D(nf, B, pa_data, mass_emat,
false, d1d, q1d);
72 MFEM_ABORT(
"Unknown kernel.");
76 const int n_faces_per_el = 2*
dim;
79 Array<int> face_maps(ndof_face * n_faces_per_el);
80 for (
int lf_i = 0; lf_i < n_faces_per_el; ++lf_i)
84 for (
int i = 0; i < ndof_face; ++i)
86 face_maps[i + lf_i*ndof_face] = face_map[i];
105 const int ndof_vol = test_el.
GetDof();
106 const auto d_face_maps =
Reshape(face_maps.
Read(), ndof_face, n_faces_per_el);
107 const auto d_face_info =
Reshape(face_info.
Read(), 2, 2, nf);
116 d_emat = emat.
Write();
117 mfem::forall(emat.
Size(), [=] MFEM_HOST_DEVICE (
int i) { d_emat[i] = 0.0; });
120 const auto face_mats =
Reshape(mass_emat.
Read(), ndof_face, ndof_face, nf);
121 auto el_mats =
Reshape(d_emat, ndof_vol, ndof_face, 2, nf);
123 auto permute_face = [=] MFEM_HOST_DEVICE(
int local_face_id,
int orient,
124 int size1d,
int index)
128 return internal::PermuteFace2D(local_face_id, orient, size1d,
index);
132 return internal::PermuteFace3D(local_face_id, orient, size1d,
index);
138 MFEM_FOREACH_THREAD(el_i, z, 2)
140 const int lf_i = d_face_info(0, el_i,
f);
141 const int orient = d_face_info(1, el_i,
f);
143 MFEM_FOREACH_THREAD(i_lex, x, ndof_face)
146 const int i_face = permute_face(lf_i, orient, d1d, i_lex);
148 const int i = d_face_maps(i_lex, lf_i);
149 MFEM_FOREACH_THREAD(j, y, ndof_face)
151 el_mats(i, j, el_i,
f) += face_mats(i_face, j,
f);
int Size() const
Return the logical size of the array.
const T * Read(bool on_dev=true) const
Shortcut for mfem::Read(a.GetMemory(), a.Size(), on_dev).
@ TENSOR
Tensor product representation using 1D matrices/tensors with dimensions using 1D number of quadrature...
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
virtual const FiniteElement * GetFE(int i) const
Returns pointer to the FiniteElement in the FiniteElementCollection associated with i'th element in t...
const FiniteElement * GetFaceElement(int i) const
Returns pointer to the FiniteElement in the FiniteElementCollection associated with i'th face in the ...
Mesh * GetMesh() const
Returns the mesh.
virtual int GetMaxElementOrder() const
Return the maximum polynomial order over all elements.
Abstract class for all finite elements.
virtual const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
Return a DofToQuad structure corresponding to the given IntegrationRule using the given DofToQuad::Mo...
virtual void GetFaceMap(const int face_id, Array< int > &face_map) const
Return the mapping from lexicographic face DOFs to lexicographic element DOFs for the given local fac...
int GetDof() const
Returns the number of degrees of freedom in the finite element.
Class for an integration rule - an Array of IntegrationPoint.
const Array< real_t > & GetWeights() const
Return the quadrature weights in a contiguous array.
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
const IntegrationRule * IntRule
int GetNumFaces() const
Return the number of faces (3D), edges (2D) or vertices (1D).
Geometry::Type GetFaceGeometry(int i) const
Return the Geometry::Type associated with face i.
virtual int GetNFbyType(FaceType type) const
Returns the number of faces according to the requested type, does not count master nonconforming face...
int Dimension() const
Dimension of the reference space used within the elements.
FaceInformation GetFaceInformation(int f) const
void AssembleEAInteriorFaces(const FiniteElementSpace &trial_fes, const FiniteElementSpace &test_fes, Vector &emat, const bool add=true) override
Method defining element assembly for mixed trace integrators.
virtual const real_t * Read(bool on_dev=true) const
Shortcut for mfem::Read(vec.GetMemory(), vec.Size(), on_dev).
virtual real_t * ReadWrite(bool on_dev=true)
Shortcut for mfem::ReadWrite(vec.GetMemory(), vec.Size(), on_dev).
int Size() const
Returns the size of the vector.
virtual real_t * Write(bool on_dev=true)
Shortcut for mfem::Write(vec.GetMemory(), vec.Size(), on_dev).
int index(int i, int j, int nx, int ny)
void add(const Vector &v1, const Vector &v2, Vector &v)
MFEM_HOST_DEVICE DeviceTensor< sizeof...(Dims), T > Reshape(T *ptr, Dims... dims)
Wrap a pointer as a DeviceTensor with automatically deduced template parameters.
void forall_3D(int N, int X, int Y, int Z, lambda &&body)
std::function< real_t(const Vector &)> f(real_t mass_coeff)
void forall(int N, lambda &&body)
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)