MFEM  v4.6.0
Finite element discretization library
fe_rt.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
2 // at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3 // LICENSE and NOTICE for details. LLNL-CODE-806117.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability visit https://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the BSD-3 license. We welcome feedback and contributions, see file
10 // CONTRIBUTING.md for details.
11 
12 #ifndef MFEM_FE_RT
13 #define MFEM_FE_RT
14 
15 #include "fe_base.hpp"
16 #include "fe_h1.hpp"
17 #include "fe_l2.hpp"
18 
19 namespace mfem
20 {
21 
22 /// Arbitrary order Raviart-Thomas elements in 2D on a square
24 {
25 private:
26  static const double nk[8];
27 
28 #ifndef MFEM_THREAD_SAFE
29  mutable Vector shape_cx, shape_ox, shape_cy, shape_oy;
30  mutable Vector dshape_cx, dshape_cy;
31 #endif
32  Array<int> dof2nk;
33  const double *cp;
34 
35 public:
36  /** @brief Construct the RT_QuadrilateralElement of order @a p and closed and
37  open BasisType @a cb_type and @a ob_type */
38  RT_QuadrilateralElement(const int p,
39  const int cb_type = BasisType::GaussLobatto,
40  const int ob_type = BasisType::GaussLegendre);
41  virtual void CalcVShape(const IntegrationPoint &ip,
42  DenseMatrix &shape) const;
43  virtual void CalcVShape(ElementTransformation &Trans,
44  DenseMatrix &shape) const
45  { CalcVShape_RT(Trans, shape); }
46  virtual void CalcDivShape(const IntegrationPoint &ip,
47  Vector &divshape) const;
49  DenseMatrix &I) const
50  { LocalInterpolation_RT(*this, nk, dof2nk, Trans, I); }
52  DenseMatrix &R) const
53  { LocalRestriction_RT(nk, dof2nk, Trans, R); }
54  virtual void GetTransferMatrix(const FiniteElement &fe,
55  ElementTransformation &Trans,
56  DenseMatrix &I) const
57  { LocalInterpolation_RT(CheckVectorFE(fe), nk, dof2nk, Trans, I); }
59  virtual void Project(VectorCoefficient &vc,
60  ElementTransformation &Trans, Vector &dofs) const
61  {
62  if (obasis1d.IsIntegratedType()) { ProjectIntegrated(vc, Trans, dofs); }
63  else { Project_RT(nk, dof2nk, vc, Trans, dofs); }
64  }
65  virtual void ProjectFromNodes(Vector &vc, ElementTransformation &Trans,
66  Vector &dofs) const
67  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
69  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
70  { ProjectMatrixCoefficient_RT(nk, dof2nk, mc, T, dofs); }
71  virtual void Project(const FiniteElement &fe, ElementTransformation &Trans,
72  DenseMatrix &I) const
73  { Project_RT(nk, dof2nk, fe, Trans, I); }
74  // Gradient + rotation = Curl: H1 -> H(div)
75  virtual void ProjectGrad(const FiniteElement &fe,
76  ElementTransformation &Trans,
77  DenseMatrix &grad) const
78  { ProjectGrad_RT(nk, dof2nk, fe, Trans, grad); }
79  // Curl = Gradient + rotation: H1 -> H(div)
80  virtual void ProjectCurl(const FiniteElement &fe,
81  ElementTransformation &Trans,
82  DenseMatrix &curl) const
83  { ProjectGrad_RT(nk, dof2nk, fe, Trans, curl); }
84 
85  virtual void GetFaceMap(const int face_id, Array<int> &face_map) const;
86 
87 protected:
89  Vector &dofs) const;
90 };
91 
92 
93 /// Arbitrary order Raviart-Thomas elements in 3D on a cube
95 {
96  static const double nk[18];
97 
98 #ifndef MFEM_THREAD_SAFE
99  mutable Vector shape_cx, shape_ox, shape_cy, shape_oy, shape_cz, shape_oz;
100  mutable Vector dshape_cx, dshape_cy, dshape_cz;
101 #endif
102  Array<int> dof2nk;
103  const double *cp;
104 
105 public:
106  /** @brief Construct the RT_HexahedronElement of order @a p and closed and
107  open BasisType @a cb_type and @a ob_type */
108  RT_HexahedronElement(const int p,
109  const int cb_type = BasisType::GaussLobatto,
110  const int ob_type = BasisType::GaussLegendre);
111 
112  virtual void CalcVShape(const IntegrationPoint &ip,
113  DenseMatrix &shape) const;
114  virtual void CalcVShape(ElementTransformation &Trans,
115  DenseMatrix &shape) const
116  { CalcVShape_RT(Trans, shape); }
117  virtual void CalcDivShape(const IntegrationPoint &ip,
118  Vector &divshape) const;
120  DenseMatrix &I) const
121  { LocalInterpolation_RT(*this, nk, dof2nk, Trans, I); }
123  DenseMatrix &R) const
124  { LocalRestriction_RT(nk, dof2nk, Trans, R); }
125  virtual void GetTransferMatrix(const FiniteElement &fe,
126  ElementTransformation &Trans,
127  DenseMatrix &I) const
128  { LocalInterpolation_RT(CheckVectorFE(fe), nk, dof2nk, Trans, I); }
130  virtual void Project(VectorCoefficient &vc,
131  ElementTransformation &Trans, Vector &dofs) const
132  {
133  if (obasis1d.IsIntegratedType()) { ProjectIntegrated(vc, Trans, dofs); }
134  else { Project_RT(nk, dof2nk, vc, Trans, dofs); }
135  }
137  Vector &dofs) const
138  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
140  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
141  { ProjectMatrixCoefficient_RT(nk, dof2nk, mc, T, dofs); }
142  virtual void Project(const FiniteElement &fe, ElementTransformation &Trans,
143  DenseMatrix &I) const
144  { Project_RT(nk, dof2nk, fe, Trans, I); }
145  virtual void ProjectCurl(const FiniteElement &fe,
146  ElementTransformation &Trans,
147  DenseMatrix &curl) const
148  { ProjectCurl_RT(nk, dof2nk, fe, Trans, curl); }
149 
150  /// @brief Return the mapping from lexicographically ordered face DOFs to
151  /// lexicographically ordered element DOFs corresponding to local face
152  /// @a face_id.
153  virtual void GetFaceMap(const int face_id, Array<int> &face_map) const;
154 
155 protected:
157  ElementTransformation &Trans,
158  Vector &dofs) const;
159 };
160 
161 
162 /// Arbitrary order Raviart-Thomas elements in 2D on a triangle
164 {
165  static const double nk[6], c;
166 
167 #ifndef MFEM_THREAD_SAFE
168  mutable Vector shape_x, shape_y, shape_l;
169  mutable Vector dshape_x, dshape_y, dshape_l;
170  mutable DenseMatrix u;
171  mutable Vector divu;
172 #endif
173  Array<int> dof2nk;
175 
176 public:
177  /// Construct the RT_TriangleElement of order @a p
178  RT_TriangleElement(const int p);
179  virtual void CalcVShape(const IntegrationPoint &ip,
180  DenseMatrix &shape) const;
181  virtual void CalcVShape(ElementTransformation &Trans,
182  DenseMatrix &shape) const
183  { CalcVShape_RT(Trans, shape); }
184  virtual void CalcDivShape(const IntegrationPoint &ip,
185  Vector &divshape) const;
187  DenseMatrix &I) const
188  { LocalInterpolation_RT(*this, nk, dof2nk, Trans, I); }
190  DenseMatrix &R) const
191  { LocalRestriction_RT(nk, dof2nk, Trans, R); }
192  virtual void GetTransferMatrix(const FiniteElement &fe,
193  ElementTransformation &Trans,
194  DenseMatrix &I) const
195  { LocalInterpolation_RT(CheckVectorFE(fe), nk, dof2nk, Trans, I); }
197  virtual void Project(VectorCoefficient &vc,
198  ElementTransformation &Trans, Vector &dofs) const
199  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
201  Vector &dofs) const
202  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
204  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
205  { ProjectMatrixCoefficient_RT(nk, dof2nk, mc, T, dofs); }
206  virtual void Project(const FiniteElement &fe, ElementTransformation &Trans,
207  DenseMatrix &I) const
208  { Project_RT(nk, dof2nk, fe, Trans, I); }
209  // Gradient + rotation = Curl: H1 -> H(div)
210  virtual void ProjectGrad(const FiniteElement &fe,
211  ElementTransformation &Trans,
212  DenseMatrix &grad) const
213  { ProjectGrad_RT(nk, dof2nk, fe, Trans, grad); }
214  // Curl = Gradient + rotation: H1 -> H(div)
215  virtual void ProjectCurl(const FiniteElement &fe,
216  ElementTransformation &Trans,
217  DenseMatrix &curl) const
218  { ProjectGrad_RT(nk, dof2nk, fe, Trans, curl); }
219 };
220 
221 
222 /// Arbitrary order Raviart-Thomas elements in 3D on a tetrahedron
224 {
225  static const double nk[12], c;
226 
227 #ifndef MFEM_THREAD_SAFE
228  mutable Vector shape_x, shape_y, shape_z, shape_l;
229  mutable Vector dshape_x, dshape_y, dshape_z, dshape_l;
230  mutable DenseMatrix u;
231  mutable Vector divu;
232 #endif
233  Array<int> dof2nk;
235 
236 public:
237  /// Construct the RT_TetrahedronElement of order @a p
238  RT_TetrahedronElement(const int p);
239  virtual void CalcVShape(const IntegrationPoint &ip,
240  DenseMatrix &shape) const;
241  virtual void CalcVShape(ElementTransformation &Trans,
242  DenseMatrix &shape) const
243  { CalcVShape_RT(Trans, shape); }
244  virtual void CalcDivShape(const IntegrationPoint &ip,
245  Vector &divshape) const;
247  DenseMatrix &I) const
248  { LocalInterpolation_RT(*this, nk, dof2nk, Trans, I); }
250  DenseMatrix &R) const
251  { LocalRestriction_RT(nk, dof2nk, Trans, R); }
252  virtual void GetTransferMatrix(const FiniteElement &fe,
253  ElementTransformation &Trans,
254  DenseMatrix &I) const
255  { LocalInterpolation_RT(CheckVectorFE(fe), nk, dof2nk, Trans, I); }
257  virtual void Project(VectorCoefficient &vc,
258  ElementTransformation &Trans, Vector &dofs) const
259  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
261  Vector &dofs) const
262  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
264  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
265  { ProjectMatrixCoefficient_RT(nk, dof2nk, mc, T, dofs); }
266  virtual void Project(const FiniteElement &fe, ElementTransformation &Trans,
267  DenseMatrix &I) const
268  { Project_RT(nk, dof2nk, fe, Trans, I); }
269  virtual void ProjectCurl(const FiniteElement &fe,
270  ElementTransformation &Trans,
271  DenseMatrix &curl) const
272  { ProjectCurl_RT(nk, dof2nk, fe, Trans, curl); }
273 };
274 
276 {
277  static const double nk[15];
278 
279 #ifndef MFEM_THREAD_SAFE
280  mutable Vector tl2_shape;
281  mutable Vector sh1_shape;
282  mutable DenseMatrix trt_shape;
283  mutable Vector sl2_shape;
284  mutable DenseMatrix sh1_dshape;
285  mutable Vector trt_dshape;
286 #endif
287  Array<int> dof2nk, t_dof, s_dof;
288 
289  // The RT_Wedge is implemented as the sum of tensor products of
290  // lower dimensional basis funcgtions.
291  // Specifically: L2TriangleFE x H1SegmentFE + RTTriangle x L2SegmentFE
292  L2_TriangleElement L2TriangleFE;
293  RT_TriangleElement RTTriangleFE;
294  H1_SegmentElement H1SegmentFE;
295  L2_SegmentElement L2SegmentFE;
296 
297 public:
298  RT_WedgeElement(const int p);
299  virtual void CalcVShape(const IntegrationPoint &ip,
300  DenseMatrix &shape) const;
301  virtual void CalcVShape(ElementTransformation &Trans,
302  DenseMatrix &shape) const
303  { CalcVShape_RT(Trans, shape); }
304  virtual void CalcDivShape(const IntegrationPoint &ip,
305  Vector &divshape) const;
307  DenseMatrix &I) const
308  { LocalInterpolation_RT(*this, nk, dof2nk, Trans, I); }
310  DenseMatrix &R) const
311  { LocalRestriction_RT(nk, dof2nk, Trans, R); }
312  virtual void GetTransferMatrix(const FiniteElement &fe,
313  ElementTransformation &Trans,
314  DenseMatrix &I) const
315  { LocalInterpolation_RT(CheckVectorFE(fe), nk, dof2nk, Trans, I); }
317  virtual void Project(VectorCoefficient &vc,
318  ElementTransformation &Trans, Vector &dofs) const
319  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
321  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
322  { ProjectMatrixCoefficient_RT(nk, dof2nk, mc, T, dofs); }
323  virtual void Project(const FiniteElement &fe, ElementTransformation &Trans,
324  DenseMatrix &I) const
325  { Project_RT(nk, dof2nk, fe, Trans, I); }
326  virtual void ProjectCurl(const FiniteElement &fe,
327  ElementTransformation &Trans,
328  DenseMatrix &curl) const
329  { ProjectCurl_RT(nk, dof2nk, fe, Trans, curl); }
330 };
331 
332 
333 /// Arbitrary order, three component, Raviart-Thomas elements in 1D on a segment
334 /** RT_R1D_SegmentElement provides a representation of a three component
335  Raviart-Thomas basis where the vector components vary along only one
336  dimension.
337 */
339 {
340  static const double nk[9];
341 #ifndef MFEM_THREAD_SAFE
342  mutable Vector shape_cx, shape_ox;
343  mutable Vector dshape_cx;
344 #endif
345  Array<int> dof_map, dof2nk;
346 
347  Poly_1D::Basis &cbasis1d, &obasis1d;
348 
349 public:
350  /** @brief Construct the RT_R1D_SegmentElement of order @a p and closed and
351  open BasisType @a cb_type and @a ob_type */
352  RT_R1D_SegmentElement(const int p,
353  const int cb_type = BasisType::GaussLobatto,
354  const int ob_type = BasisType::GaussLegendre);
355 
356  virtual void CalcVShape(const IntegrationPoint &ip,
357  DenseMatrix &shape) const;
358 
359  virtual void CalcVShape(ElementTransformation &Trans,
360  DenseMatrix &shape) const;
361 
362  virtual void CalcDivShape(const IntegrationPoint &ip,
363  Vector &divshape) const;
364 
366 
367  virtual void Project(VectorCoefficient &vc,
368  ElementTransformation &Trans, Vector &dofs) const;
369 
370  virtual void Project(const FiniteElement &fe,
371  ElementTransformation &Trans,
372  DenseMatrix &I) const;
373 
374  virtual void ProjectCurl(const FiniteElement &fe,
375  ElementTransformation &Trans,
376  DenseMatrix &curl) const;
377 };
378 
379 
380 /** RT_R2D_SegmentElement provides a representation of a 3D Raviart-Thomas
381  basis where the vector field is assumed constant in the third dimension.
382 */
384 {
385  static const double nk[2];
386 #ifndef MFEM_THREAD_SAFE
387  mutable Vector shape_ox;
388 #endif
389  Array<int> dof_map, dof2nk;
390 
391  Poly_1D::Basis &obasis1d;
392 
393 private:
394  void LocalInterpolation(const VectorFiniteElement &cfe,
395  ElementTransformation &Trans,
396  DenseMatrix &I) const;
397 
398 public:
399  /** @brief Construct the RT_R2D_SegmentElement of order @a p and open
400  BasisType @a ob_type */
401  RT_R2D_SegmentElement(const int p,
402  const int ob_type = BasisType::GaussLegendre);
403 
404  virtual void CalcVShape(const IntegrationPoint &ip,
405  DenseMatrix &shape) const;
406 
407  virtual void CalcVShape(ElementTransformation &Trans,
408  DenseMatrix &shape) const;
409 
410  virtual void CalcDivShape(const IntegrationPoint &ip,
411  Vector &div_shape) const;
412 
414  DenseMatrix &I) const
415  { LocalInterpolation(*this, Trans, I); }
416 
418  DenseMatrix &R) const
419  { MFEM_ABORT("method is not overloaded"); }
420 
421  virtual void GetTransferMatrix(const FiniteElement &fe,
422  ElementTransformation &Trans,
423  DenseMatrix &I) const
424  { LocalInterpolation(CheckVectorFE(fe), Trans, I); }
425 };
426 
428 {
429 protected:
430  const double *nk;
432 
433  RT_R2D_FiniteElement(int p, Geometry::Type G, int Do, const double *nk_fe);
434 
435 private:
436  void LocalInterpolation(const VectorFiniteElement &cfe,
437  ElementTransformation &Trans,
438  DenseMatrix &I) const;
439 
440 public:
442 
443  virtual void CalcVShape(ElementTransformation &Trans,
444  DenseMatrix &shape) const;
445 
447  DenseMatrix &I) const
448  { LocalInterpolation(*this, Trans, I); }
449 
450  virtual void GetLocalRestriction(ElementTransformation &Trans,
451  DenseMatrix &R) const;
452 
453  virtual void GetTransferMatrix(const FiniteElement &fe,
454  ElementTransformation &Trans,
455  DenseMatrix &I) const
456  { LocalInterpolation(CheckVectorFE(fe), Trans, I); }
457 
459 
460  virtual void Project(VectorCoefficient &vc,
461  ElementTransformation &Trans, Vector &dofs) const;
462 
463  virtual void Project(const FiniteElement &fe, ElementTransformation &Trans,
464  DenseMatrix &I) const;
465 
466  virtual void ProjectCurl(const FiniteElement &fe,
467  ElementTransformation &Trans,
468  DenseMatrix &curl) const;
469 };
470 
471 /// Arbitrary order Raviart-Thomas 3D elements in 2D on a triangle
473 {
474 private:
475  static const double nk_t[12];
476 
477 #ifndef MFEM_THREAD_SAFE
478  mutable DenseMatrix rt_shape;
479  mutable Vector l2_shape;
480  mutable Vector rt_dshape;
481 #endif
482 
483  RT_TriangleElement RT_FE;
484  L2_TriangleElement L2_FE;
485 
486 public:
487  /** @brief Construct the RT_R2D_TriangleElement of order @a p */
488  RT_R2D_TriangleElement(const int p);
489 
491 
492  virtual void CalcVShape(const IntegrationPoint &ip,
493  DenseMatrix &shape) const;
494 
495  virtual void CalcDivShape(const IntegrationPoint &ip,
496  Vector &divshape) const;
497 };
498 
499 /// Arbitrary order Raviart-Thomas 3D elements in 2D on a square
501 {
502 private:
503  static const double nk_q[15];
504 
505 #ifndef MFEM_THREAD_SAFE
506  mutable Vector shape_cx, shape_ox, shape_cy, shape_oy;
507  mutable Vector dshape_cx, dshape_cy;
508 #endif
509 
510  Poly_1D::Basis &cbasis1d, &obasis1d;
511 
512 public:
513  /** @brief Construct the RT_QuadrilateralElement of order @a p and closed and
514  open BasisType @a cb_type and @a ob_type */
515  RT_R2D_QuadrilateralElement(const int p,
516  const int cb_type = BasisType::GaussLobatto,
517  const int ob_type = BasisType::GaussLegendre);
518 
520 
521  virtual void CalcVShape(const IntegrationPoint &ip,
522  DenseMatrix &shape) const;
523  virtual void CalcDivShape(const IntegrationPoint &ip,
524  Vector &divshape) const;
525 };
526 
527 
528 } // namespace mfem
529 
530 #endif
Abstract class for all finite elements.
Definition: fe_base.hpp:233
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
Definition: fe_rt.hpp:249
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Compute the discrete gradient matrix from the given FiniteElement onto &#39;this&#39; FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
Definition: fe_rt.hpp:210
bool IsIntegratedType() const
Returns true if the basis is "integrated", false otherwise.
Definition: fe_base.hpp:1023
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Given a matrix coefficient and a transformation, compute an approximation ("projection") in the local...
Definition: fe_rt.hpp:139
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
Definition: fe_rt.cpp:492
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Given a matrix coefficient and a transformation, compute an approximation ("projection") in the local...
Definition: fe_rt.hpp:68
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
Definition: fe_rt.cpp:582
virtual void CalcVShape(ElementTransformation &Trans, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in physical space at the point ...
Definition: fe_rt.hpp:241
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
Definition: fe_rt.hpp:189
Arbitrary order L2 elements in 2D on a triangle.
Definition: fe_l2.hpp:108
Base class for vector Coefficients that optionally depend on time and space.
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe_rt.hpp:48
void ProjectMatrixCoefficient_RT(const double *nk, const Array< int > &d2n, MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Project the rows of the matrix coefficient in an RT space.
Definition: fe_base.cpp:1017
void ProjectGrad_RT(const double *nk, const Array< int > &d2n, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe_base.cpp:1120
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
Definition: fe_rt.cpp:1001
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
Definition: fe_rt.hpp:197
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
Definition: fe_rt.cpp:142
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
Definition: fe_rt.hpp:130
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition: fe_rt.hpp:453
Data type dense matrix using column-major storage.
Definition: densemat.hpp:23
Arbitrary order, three component, Raviart-Thomas elements in 1D on a segment.
Definition: fe_rt.hpp:338
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe_rt.hpp:186
void CalcVShape_RT(ElementTransformation &Trans, DenseMatrix &shape) const
Definition: fe_base.cpp:957
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &div_shape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
Definition: fe_rt.cpp:1609
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
Definition: fe_rt.cpp:1727
Intermediate class for finite elements whose basis functions return vector values.
Definition: fe_base.hpp:788
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...
Definition: fe_rt.cpp:301
virtual void CalcVShape(ElementTransformation &Trans, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in physical space at the point ...
Definition: fe_rt.cpp:1668
const double * nk
Definition: fe_rt.hpp:430
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Compute the discrete curl matrix from the given FiniteElement onto &#39;this&#39; FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
Definition: fe_rt.cpp:1887
RT_WedgeElement(const int p)
Definition: fe_rt.cpp:1082
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
Definition: fe_rt.cpp:1377
Arbitrary order Raviart-Thomas 3D elements in 2D on a triangle.
Definition: fe_rt.hpp:472
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Given a coefficient and a transformation, compute its projection (approximation) in the local finite ...
Definition: fe_base.cpp:126
Arbitrary order Raviart-Thomas 3D elements in 2D on a square.
Definition: fe_rt.hpp:500
virtual void CalcVShape(ElementTransformation &Trans, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in physical space at the point ...
Definition: fe_rt.hpp:181
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
Definition: fe_rt.cpp:824
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
Definition: fe_rt.cpp:2160
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
Definition: fe_rt.hpp:51
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition: fe_rt.hpp:312
Array< int > dof_map
Definition: fe_rt.hpp:431
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
Definition: fe_rt.cpp:1200
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Given a matrix coefficient and a transformation, compute an approximation ("projection") in the local...
Definition: fe_rt.hpp:263
virtual void GetFaceMap(const int face_id, Array< int > &face_map) const
Return the mapping from lexicographically ordered face DOFs to lexicographically ordered element DOFs...
Definition: fe_rt.cpp:711
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Compute the discrete gradient matrix from the given FiniteElement onto &#39;this&#39; FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
Definition: fe_rt.hpp:75
Arbitrary order L2 elements in 1D on a segment.
Definition: fe_l2.hpp:21
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition: fe_rt.hpp:252
RT_R1D_SegmentElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the RT_R1D_SegmentElement of order p and closed and open BasisType cb_type and ob_type...
Definition: fe_rt.cpp:1269
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
Definition: fe_rt.cpp:1323
RT_R2D_FiniteElement(int p, Geometry::Type G, int Do, const double *nk_fe)
Definition: fe_rt.cpp:1656
virtual void CalcVShape(ElementTransformation &Trans, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in physical space at the point ...
Definition: fe_rt.hpp:114
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Given a matrix coefficient and a transformation, compute an approximation ("projection") in the local...
Definition: fe_rt.hpp:203
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe_rt.hpp:119
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
Definition: fe_rt.cpp:1573
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Compute the embedding/projection matrix from the given FiniteElement onto &#39;this&#39; FiniteElement. The ElementTransformation is included to support cases when the projection depends on it.
Definition: fe_rt.hpp:266
virtual void ProjectFromNodes(Vector &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector of values at the finite element nodes and a transformation, compute its projection (ap...
Definition: fe_rt.hpp:260
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
Definition: fe_rt.cpp:2008
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Compute the embedding/projection matrix from the given FiniteElement onto &#39;this&#39; FiniteElement. The ElementTransformation is included to support cases when the projection depends on it.
Definition: fe_rt.hpp:206
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
Definition: fe_rt.cpp:1235
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
Definition: fe_rt.cpp:1037
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe_rt.hpp:306
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition: fe_rt.hpp:421
RT_R2D_TriangleElement(const int p)
Construct the RT_R2D_TriangleElement of order p.
Definition: fe_rt.cpp:1911
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
Definition: fe_rt.cpp:1775
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
Definition: fe_rt.hpp:122
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Compute the embedding/projection matrix from the given FiniteElement onto &#39;this&#39; FiniteElement. The ElementTransformation is included to support cases when the projection depends on it.
Definition: fe_rt.hpp:142
void LocalInterpolation_RT(const VectorFiniteElement &cfe, const double *nk, const Array< int > &d2n, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe_base.cpp:1400
Arbitrary order Raviart-Thomas elements in 3D on a tetrahedron.
Definition: fe_rt.hpp:223
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Compute the embedding/projection matrix from the given FiniteElement onto &#39;this&#39; FiniteElement. The ElementTransformation is included to support cases when the projection depends on it.
Definition: fe_rt.hpp:71
RT_R2D_QuadrilateralElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the RT_QuadrilateralElement of order p and closed and open BasisType cb_type and ob_type...
Definition: fe_rt.cpp:2034
void Project_RT(const double *nk, const Array< int > &d2n, VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Project a vector coefficient onto the RT basis functions.
Definition: fe_base.cpp:980
RT_R2D_SegmentElement(const int p, const int ob_type=BasisType::GaussLegendre)
Construct the RT_R2D_SegmentElement of order p and open BasisType ob_type.
Definition: fe_rt.cpp:1545
Base class for Matrix Coefficients that optionally depend on time and space.
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Given a matrix coefficient and a transformation, compute an approximation ("projection") in the local...
Definition: fe_rt.hpp:320
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Compute the discrete curl matrix from the given FiniteElement onto &#39;this&#39; FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
Definition: fe_rt.hpp:145
Arbitrary order Raviart-Thomas elements in 2D on a triangle.
Definition: fe_rt.hpp:163
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
Definition: fe_rt.hpp:59
virtual void ProjectFromNodes(Vector &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector of values at the finite element nodes and a transformation, compute its projection (ap...
Definition: fe_rt.hpp:200
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
Definition: fe_rt.hpp:417
virtual void ProjectFromNodes(Vector &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector of values at the finite element nodes and a transformation, compute its projection (ap...
Definition: fe_rt.hpp:65
Class for integration point with weight.
Definition: intrules.hpp:31
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
Definition: fe_rt.cpp:857
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe_rt.hpp:246
Arbitrary order Raviart-Thomas elements in 2D on a square.
Definition: fe_rt.hpp:23
void ProjectCurl_RT(const double *nk, const Array< int > &d2n, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe_base.cpp:1185
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Compute the discrete curl matrix from the given FiniteElement onto &#39;this&#39; FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
Definition: fe_rt.hpp:269
Arbitrary order H1 elements in 1D.
Definition: fe_h1.hpp:21
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Compute the discrete curl matrix from the given FiniteElement onto &#39;this&#39; FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
Definition: fe_rt.cpp:1522
RT_TetrahedronElement(const int p)
Construct the RT_TetrahedronElement of order p.
Definition: fe_rt.cpp:899
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
Definition: fe_base.cpp:40
Class for evaluating 1D nodal, positive (Bernstein), or integrated (Gerritsma) bases.
Definition: fe_base.hpp:978
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition: fe_rt.hpp:54
RT_TriangleElement(const int p)
Construct the RT_TriangleElement of order p.
Definition: fe_rt.cpp:746
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
Definition: fe_rt.cpp:203
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition: fe_rt.hpp:192
Vector data type.
Definition: vector.hpp:58
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition: fe_rt.hpp:125
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe_rt.hpp:446
void LocalRestriction_RT(const double *nk, const Array< int > &d2n, ElementTransformation &Trans, DenseMatrix &R) const
Definition: fe_base.cpp:1526
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Compute the embedding/projection matrix from the given FiniteElement onto &#39;this&#39; FiniteElement. The ElementTransformation is included to support cases when the projection depends on it.
Definition: fe_rt.hpp:323
virtual void CalcVShape(ElementTransformation &Trans, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in physical space at the point ...
Definition: fe_rt.hpp:301
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
Definition: fe_rt.cpp:1979
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
Definition: fe_rt.cpp:1410
virtual void ProjectFromNodes(Vector &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector of values at the finite element nodes and a transformation, compute its projection (ap...
Definition: fe_rt.hpp:136
static const VectorFiniteElement & CheckVectorFE(const FiniteElement &fe)
Definition: fe_base.hpp:949
RT_HexahedronElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the RT_HexahedronElement of order p and closed and open BasisType cb_type and ob_type...
Definition: fe_rt.cpp:326
void ProjectIntegrated(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe_rt.cpp:258
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
Definition: fe_rt.hpp:309
void ProjectIntegrated(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe_rt.cpp:661
RT_QuadrilateralElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Construct the RT_QuadrilateralElement of order p and closed and open BasisType cb_type and ob_type...
Definition: fe_rt.cpp:26
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Compute the discrete curl matrix from the given FiniteElement onto &#39;this&#39; FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
Definition: fe_rt.hpp:215
Arbitrary order Raviart-Thomas elements in 3D on a cube.
Definition: fe_rt.hpp:94
virtual void CalcVShape(ElementTransformation &Trans, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in physical space at the point ...
Definition: fe_rt.hpp:43
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Compute the discrete curl matrix from the given FiniteElement onto &#39;this&#39; FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
Definition: fe_rt.hpp:80
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Compute the discrete curl matrix from the given FiniteElement onto &#39;this&#39; FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
Definition: fe_rt.hpp:326
virtual void CalcDivShape(const IntegrationPoint &ip, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in reference space at the g...
Definition: fe_rt.cpp:2217
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
Definition: fe_rt.hpp:317
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Given a vector coefficient and a transformation, compute its projection (approximation) in the local ...
Definition: fe_rt.hpp:257
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe_rt.hpp:413