12 #ifndef MFEM_TEMPLATE_ELEMENT_TRANSFORMATION
13 #define MFEM_TEMPLATE_ELEMENT_TRANSFORMATION
15 #include "../config/tconfig.hpp"
17 #include "../mesh/element.hpp"
30 template <
typename Mesh_t,
typename IR,
typename real_t =
double>
54 template <
typename coeff_t,
typename kernel_t>
struct Get
69 template<
int EvalOps,
int NE>
struct Result;
72 static const int sdim = Mesh_t::space_dim;
73 static const int dofs = FE_type::dofs;
74 static const int qpts = IR::qpts;
77 #ifdef MFEM_TEMPLATE_ELTRANS_HAS_NODE_DOFS
89 inline MFEM_ALWAYS_INLINE
92 for (
int i = 0; i < NE; i++)
104 nodes(mesh.Nodes.GetData()),
105 elements(mesh.m_mesh.GetElementsArray())
109 template<
int EvalOps,
int NE>
110 inline MFEM_ALWAYS_INLINE
116 #ifdef MFEM_TEMPLATE_ENABLE_SERIALIZE
117 template<
int EvalOps,
int NE>
118 inline MFEM_ALWAYS_INLINE
121 F.EvalSerialized(el, *
this, nodeData);
127 static const int ne = NE;
132 inline MFEM_ALWAYS_INLINE
138 #ifdef MFEM_TEMPLATE_ENABLE_SERIALIZE
139 inline MFEM_ALWAYS_INLINE
145 static const int ne = NE;
146 #ifdef MFEM_TEMPLATE_ELTRANS_RESULT_HAS_NODES
154 #ifdef MFEM_TEMPLATE_ELTRANS_RESULT_HAS_NODES
158 inline MFEM_ALWAYS_INLINE
161 #ifdef MFEM_TEMPLATE_ELTRANS_HAS_NODE_DOFS
162 MFEM_STATIC_ASSERT(NE == 1,
"only NE == 1 is supported");
164 #elif !defined(MFEM_TEMPLATE_ELTRANS_RESULT_HAS_NODES)
167 T.
fes.SetElement(el);
169 nodes_dof.
layout, nodes_dof);
174 #ifdef MFEM_TEMPLATE_ENABLE_SERIALIZE
175 inline MFEM_ALWAYS_INLINE
178 T.
evaluator.Calc(nodes_dof_t::layout.merge_23(),
179 &nodeData[el*nodes_dof_t::size],
180 x.layout.merge_23(), x);
186 static const int ne = NE;
187 #ifdef MFEM_TEMPLATE_ELTRANS_RESULT_HAS_NODES
195 #ifdef MFEM_TEMPLATE_ELTRANS_RESULT_HAS_NODES
199 inline MFEM_ALWAYS_INLINE
202 #ifdef MFEM_TEMPLATE_ELTRANS_HAS_NODE_DOFS
203 MFEM_STATIC_ASSERT(NE == 1,
"only NE == 1 is supported");
205 #elif !defined(MFEM_TEMPLATE_ELTRANS_RESULT_HAS_NODES)
208 T.
fes.SetElement(el);
210 nodes_dof.
layout, nodes_dof);
212 Jt.
layout.merge_34(), Jt);
215 #ifdef MFEM_TEMPLATE_ENABLE_SERIALIZE
216 inline MFEM_ALWAYS_INLINE
219 T.
evaluator.CalcGrad(nodes_dof_t::layout.merge_23(),
220 &nodeData[el*nodes_dof_t::size],
221 Jt.layout.merge_34(), Jt);
227 static const int ne = NE;
230 #ifdef MFEM_TEMPLATE_ELTRANS_RESULT_HAS_NODES
238 #ifdef MFEM_TEMPLATE_ELTRANS_RESULT_HAS_NODES
242 inline MFEM_ALWAYS_INLINE
245 #ifdef MFEM_TEMPLATE_ELTRANS_HAS_NODE_DOFS
246 MFEM_STATIC_ASSERT(NE == 1,
"only NE == 1 is supported");
248 #elif !defined(MFEM_TEMPLATE_ELTRANS_RESULT_HAS_NODES)
251 T.
fes.SetElement(el);
253 nodes_dof.
layout, nodes_dof);
257 Jt.
layout.merge_34(), Jt);
260 #ifdef MFEM_TEMPLATE_ENABLE_SERIALIZE
261 inline MFEM_ALWAYS_INLINE
264 T.
evaluator.Calc(nodes_dof_t::layout.merge_23(),
265 &nodeData[el*nodes_dof_t::size],
266 x.layout.merge_23(), x);
267 T.
evaluator.CalcGrad(nodes_dof_t::layout.merge_23(),
268 &nodeData[el*nodes_dof_t::size],
269 Jt.layout.merge_34(), Jt);
275 static const int ne = NE;
276 #ifdef MFEM_TEMPLATE_ELTRANS_RESULT_HAS_NODES
284 #ifdef MFEM_TEMPLATE_ELTRANS_RESULT_HAS_NODES
289 inline MFEM_ALWAYS_INLINE
292 #ifdef MFEM_TEMPLATE_ELTRANS_HAS_NODE_DOFS
293 MFEM_STATIC_ASSERT(NE == 1,
"only NE == 1 is supported");
295 #elif !defined(MFEM_TEMPLATE_ELTRANS_RESULT_HAS_NODES)
298 T.
fes.SetElement(el);
300 nodes_dof.
layout, nodes_dof);
302 Jt.
layout.merge_34(), Jt);
306 #ifdef MFEM_TEMPLATE_ENABLE_SERIALIZE
307 inline MFEM_ALWAYS_INLINE
310 T.
evaluator.CalcGrad(nodes_dof_t::layout.merge_23(),
311 &nodeData[el*nodes_dof_t::size],
312 Jt.layout.merge_34(), Jt);
319 static const int ne = NE;
320 #ifdef MFEM_TEMPLATE_ELTRANS_RESULT_HAS_NODES
328 #ifdef MFEM_TEMPLATE_ELTRANS_RESULT_HAS_NODES
333 inline MFEM_ALWAYS_INLINE
336 #ifdef MFEM_TEMPLATE_ELTRANS_HAS_NODE_DOFS
337 MFEM_STATIC_ASSERT(NE == 1,
"only NE == 1 is supported");
339 #elif !defined(MFEM_TEMPLATE_ELTRANS_RESULT_HAS_NODES)
342 T.
fes.SetElement(el);
344 nodes_dof.
layout, nodes_dof);
346 Jt.
layout.merge_34(), Jt);
350 #ifdef MFEM_TEMPLATE_ENABLE_SERIALIZE
351 inline MFEM_ALWAYS_INLINE
354 T.
evaluator.CalcGrad(nodes_dof_t::layout.merge_23(),
355 &nodeData[el*nodes_dof_t::size],
356 Jt.layout.merge_34(), Jt);
365 #endif // MFEM_TEMPLATE_ELEMENT_TRANSFORMATION
static const layout_type layout
int GetAttribute() const
Return element's attribute.
Abstract data type element.