12 #include "../general/forall.hpp"
25 const int ne = fes.
GetNE();
26 if (ne == 0) {
return; }
28 auto A =
Reshape(ea_data_tmp.Read(), dofs, dofs, ne);
32 for (
int i = 0; i < dofs; i++)
34 for (
int j = 0; j < dofs; j++)
36 const double a = A(i, j, e);
45 const int ne = fes.
GetNE();
46 if (ne == 0) {
return; }
51 for (
int i = 0; i < dofs; i++)
53 for (
int j = i+1; j < dofs; j++)
55 const double aij = A(i, j, e);
56 const double aji = A(j, i, e);
71 if (nf == 0) {
return; }
79 auto A_int =
Reshape(ea_data_int_tmp.Read(), faceDofs, faceDofs, 2, nf);
80 auto A_ext =
Reshape(ea_data_ext_tmp.Read(), faceDofs, faceDofs, 2, nf);
85 for (
int i = 0; i < faceDofs; i++)
87 for (
int j = 0; j < faceDofs; j++)
89 const double a_int0 = A_int(i, j, 0,
f);
90 const double a_int1 = A_int(i, j, 1,
f);
91 const double a_ext0 = A_ext(i, j, 0,
f);
92 const double a_ext1 = A_ext(i, j, 1,
f);
93 AT_int(j, i, 0,
f) += a_int0;
94 AT_int(j, i, 1,
f) += a_int1;
95 AT_ext(j, i, 0,
f) += a_ext1;
96 AT_ext(j, i, 1,
f) += a_ext0;
110 for (
int i = 0; i < faceDofs; i++)
112 for (
int j = i+1; j < faceDofs; j++)
114 const double aij_int0 = A_int(i, j, 0,
f);
115 const double aij_int1 = A_int(i, j, 1,
f);
116 const double aji_int0 = A_int(j, i, 0,
f);
117 const double aji_int1 = A_int(j, i, 1,
f);
118 A_int(j, i, 0,
f) = aij_int0;
119 A_int(j, i, 1,
f) = aij_int1;
120 A_int(i, j, 0,
f) = aji_int0;
121 A_int(i, j, 1,
f) = aji_int1;
124 for (
int i = 0; i < faceDofs; i++)
126 for (
int j = 0; j < faceDofs; j++)
128 const double aij_ext0 = A_ext(i, j, 0,
f);
129 const double aji_ext1 = A_ext(j, i, 1,
f);
130 A_ext(j, i, 1,
f) = aij_ext0;
131 A_ext(i, j, 0,
f) = aji_ext1;
143 if (nf == 0) {
return; }
150 auto A_bdr =
Reshape(ea_data_bdr_tmp.Read(), faceDofs, faceDofs, nf);
154 for (
int i = 0; i < faceDofs; i++)
156 for (
int j = 0; j < faceDofs; j++)
158 const double a_bdr = A_bdr(i, j,
f);
159 AT_bdr(j, i,
f) += a_bdr;
172 for (
int i = 0; i < faceDofs; i++)
174 for (
int j = i+1; j < faceDofs; j++)
176 const double aij_bdr = A_bdr(i, j,
f);
177 const double aji_bdr = A_bdr(j, i,
f);
178 A_bdr(j, i,
f) = aij_bdr;
179 A_bdr(i, j,
f) = aji_bdr;
int GetNFbyType(FaceType type) const
Returns the number of faces according to the requested type.
const FiniteElement * GetTraceElement(int i, Geometry::Type geom_type) const
Return the trace element from element 'i' to the given 'geom_type'.
virtual void AssembleEABoundaryFaces(const FiniteElementSpace &fes, Vector &ea_data_bdr, const bool add)
virtual void AssembleEA(const FiniteElementSpace &fes, Vector &emat, const bool add)
Method defining element assembly.
int Size() const
Returns the size of the vector.
Geometry::Type GetFaceBaseGeometry(int i) const
void add(const Vector &v1, const Vector &v2, Vector &v)
int GetNE() const
Returns number of elements in the mesh.
double f(const Vector &xvec)
Mesh * GetMesh() const
Returns the mesh.
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
int GetDof() const
Returns the number of degrees of freedom in the finite element.
virtual void AssembleEAInteriorFaces(const FiniteElementSpace &fes, Vector &ea_data_int, Vector &ea_data_ext, const bool add)
virtual double * ReadWrite(bool on_dev=true)
Shortcut for mfem::ReadWrite(vec.GetMemory(), vec.Size(), on_dev).
virtual const FiniteElement * GetFE(int i) const
Returns pointer to the FiniteElement in the FiniteElementCollection associated with i'th element in t...
MFEM_HOST_DEVICE DeviceTensor< sizeof...(Dims), T > Reshape(T *ptr, Dims...dims)
Wrap a pointer as a DeviceTensor with automatically deduced template parameters.