MFEM  v3.3
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
fe.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3 // reserved. See file COPYRIGHT for details.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability see http://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the GNU Lesser General Public License (as published by the Free
10 // Software Foundation) version 2.1 dated February 1999.
11 
12 #ifndef MFEM_FE
13 #define MFEM_FE
14 
15 #include "../config/config.hpp"
16 #include "../general/array.hpp"
17 #include "../linalg/linalg.hpp"
18 #include "intrules.hpp"
19 #include "geom.hpp"
20 
21 #include <map>
22 
23 namespace mfem
24 {
25 
26 // Base and derived classes for finite elements
27 
28 /// Describes the space on each element
30 {
31 public:
32  enum
33  {
34  Pk, ///< Polynomials of order k
35  Qk, ///< Tensor products of polynomials of order k
36  rQk ///< Refined tensor products of polynomials of order k
37  };
38 };
39 
40 class ElementTransformation;
41 class Coefficient;
42 class VectorCoefficient;
43 class KnotVector;
44 
45 /// Abstract class for Finite Elements
47 {
48 protected:
49  int Dim, ///< Dimension of reference space
50  GeomType, ///< Geometry::Type of the reference element
51  Dof, ///< Number of degrees of freedom
52  Order, ///< Order/degree of the shape functions
56 #ifndef MFEM_THREAD_SAFE
57  mutable DenseMatrix vshape; // Dof x Dim
58 #endif
59 
60 public:
61  /// Enumeration for RangeType and DerivRangeType
62  enum { SCALAR, VECTOR };
63 
64  /** @brief Enumeration for MapType: defines how reference functions are
65  mapped to physical space.
66 
67  A reference function, `uh(xh)`, can be mapped to a function, `u(x)`, on a
68  general physical element in following ways:
69 
70  VALUE u(x) = uh(xh)
71  INTEGRAL u(x) = (1/w) * uh(xh)
72  H_DIV u(x) = (J/w) * uh(xh)
73  H_CURL u(x) = J^{-t} * uh(xh) (square J)
74  H_CURL u(x) = J*(J^t*J)^{-1} * uh(xh) (general J)
75 
76  where
77 
78  x = T(xh) is the image of the reference point xh ("x hat"),
79  J = J(xh) is the Jacobian matrix of the transformation T, and
80  w = w(xh) = / det(J), for square J,
81  \ det(J^t*J)^{1/2}, for general J,
82  is the transformation weight factor.
83  */
84  enum { VALUE, ///< For scalar fields; preserves point values
85  INTEGRAL, ///< For scalar fields; preserves volume integrals
86  H_DIV, /**< For vector fields; preserves surface integrals of the
87  normal component */
88  H_CURL /**< For vector fields; preserves line integrals of the
89  tangential component */
90  };
91 
92  /** @brief Enumeration for DerivType: defines which derivative method
93  is implemented.
94 
95  Each FiniteElement class implements only one type of derivative. The
96  value returned by GetDerivType() indicates which derivative method is
97  implemented.
98  */
99  enum { NONE, ///< No derivatives implemented
100  GRAD, ///< Implements CalcDShape methods
101  DIV, ///< Implements CalcDivShape methods
102  CURL ///< Implements CalcCurlShape methods
103  };
104 
105  /** Construct FiniteElement with given
106  @param D Reference space dimension
107  @param G Geometry type (of type Geometry::Type)
108  @param Do Number of degrees of freedom in the FiniteElement
109  @param O Order/degree of the FiniteElement
110  @param F FunctionSpace type of the FiniteElement
111  */
112  FiniteElement(int D, int G, int Do, int O, int F = FunctionSpace::Pk);
113 
114  /// Returns the reference space dimension for the finite element
115  int GetDim() const { return Dim; }
116 
117  /// Returns the Geometry::Type of the reference element
118  int GetGeomType() const { return GeomType; }
119 
120  /// Returns the number of degrees of freedom in the finite element
121  int GetDof() const { return Dof; }
122 
123  /// Returns the order of the finite element
124  int GetOrder() const { return Order; }
125 
126  /// Returns the type of space on each element
127  int Space() const { return FuncSpace; }
128 
129  int GetRangeType() const { return RangeType; }
130 
131  int GetDerivRangeType() const { return DerivRangeType; }
132 
133  int GetMapType() const { return MapType; }
134 
135  int GetDerivType() const { return DerivType; }
136 
137  int GetDerivMapType() const { return DerivMapType; }
138 
139  /** @brief Evaluate the values of all shape functions of a scalar finite
140  element in reference space at the given point @a ip. */
141  /** The size (#Dof) of the result Vector @a shape must be set in advance. */
142  virtual void CalcShape(const IntegrationPoint &ip,
143  Vector &shape) const = 0;
144 
145  /** @brief Evaluate the values of all shape functions of a scalar finite
146  element in physical space at the point described by @a Trans. */
147  /** The size (#Dof) of the result Vector @a shape must be set in advance. */
148  void CalcPhysShape(ElementTransformation &Trans, Vector &shape) const;
149 
150  /** @brief Evaluate the gradients of all shape functions of a scalar finite
151  element in reference space at the given point @a ip. */
152  /** Each row of the result DenseMatrix @a dshape contains the derivatives of
153  one shape function. The size (#Dof x #Dim) of @a dshape must be set in
154  advance. */
155  virtual void CalcDShape(const IntegrationPoint &ip,
156  DenseMatrix &dshape) const = 0;
157 
158  /** @brief Evaluate the gradients of all shape functions of a scalar finite
159  element in physical space at the point described by @a Trans. */
160  /** Each row of the result DenseMatrix @a dshape contains the derivatives of
161  one shape function. The size (#Dof x SDim) of @a dshape must be set in
162  advance, where SDim >= #Dim is the physical space dimension as described
163  by @a Trans. */
165 
166  const IntegrationRule & GetNodes() const { return Nodes; }
167 
168  // virtual functions for finite elements on vector spaces
169 
170  /** @brief Evaluate the values of all shape functions of a *vector* finite
171  element in reference space at the given point @a ip. */
172  /** Each row of the result DenseMatrix @a shape contains the components of
173  one vector shape function. The size (#Dof x #Dim) of @a shape must be set
174  in advance. */
175  virtual void CalcVShape(const IntegrationPoint &ip,
176  DenseMatrix &shape) const;
177 
178  /** @brief Evaluate the values of all shape functions of a *vector* finite
179  element in physical space at the point described by @a Trans. */
180  /** Each row of the result DenseMatrix @a shape contains the components of
181  one vector shape function. The size (#Dof x SDim) of @a shape must be set
182  in advance, where SDim >= #Dim is the physical space dimension as
183  described by @a Trans. */
184  virtual void CalcVShape(ElementTransformation &Trans,
185  DenseMatrix &shape) const;
186 
187  /// Equivalent to the CalcVShape() method with the same arguments.
189  { CalcVShape(Trans, shape); }
190 
191  /** @brief Evaluate the divergence of all shape functions of a *vector*
192  finite element in reference space at the given point @a ip. */
193  /** The size (#Dof) of the result Vector @a divshape must be set in advance.
194  */
195  virtual void CalcDivShape(const IntegrationPoint &ip,
196  Vector &divshape) const;
197 
198  /** @brief Evaluate the divergence of all shape functions of a *vector*
199  finite element in physical space at the point described by @a Trans. */
200  /** The size (#Dof) of the result Vector @a divshape must be set in advance.
201  */
202  void CalcPhysDivShape(ElementTransformation &Trans, Vector &divshape) const;
203 
204  /** @brief Evaluate the curl of all shape functions of a *vector* finite
205  element in reference space at the given point @a ip. */
206  /** Each row of the result DenseMatrix @a curl_shape contains the components
207  of the curl of one vector shape function. The size (#Dof x CDim) of
208  @a curl_shape must be set in advance, where CDim = 3 for #Dim = 3 and
209  CDim = 1 for #Dim = 2. */
210  virtual void CalcCurlShape(const IntegrationPoint &ip,
211  DenseMatrix &curl_shape) const;
212 
213  /** @brief Evaluate the curl of all shape functions of a *vector* finite
214  element in physical space at the point described by @a Trans. */
215  /** Each row of the result DenseMatrix @a curl_shape contains the components
216  of the curl of one vector shape function. The size (#Dof x CDim) of
217  @a curl_shape must be set in advance, where CDim = 3 for #Dim = 3 and
218  CDim = 1 for #Dim = 2. */
220  DenseMatrix &curl_shape) const;
221 
222  virtual void GetFaceDofs(int face, int **dofs, int *ndofs) const;
223 
224  /** each row of h contains the upper triangular part of the hessian
225  of one shape function; the order in 2D is {u_xx, u_xy, u_yy} */
226  virtual void CalcHessian (const IntegrationPoint &ip,
227  DenseMatrix &h) const;
228 
229  /** Return the local interpolation matrix I (Dof x Dof) where the
230  fine element is the image of the base geometry under the given
231  transformation. */
233  DenseMatrix &I) const;
234 
235  /** Given a coefficient and a transformation, compute its projection
236  (approximation) in the local finite dimensional space in terms
237  of the degrees of freedom. */
238  virtual void Project (Coefficient &coeff,
239  ElementTransformation &Trans, Vector &dofs) const;
240 
241  /** Given a vector coefficient and a transformation, compute its
242  projection (approximation) in the local finite dimensional space
243  in terms of the degrees of freedom. (VectorFiniteElements) */
244  virtual void Project (VectorCoefficient &vc,
245  ElementTransformation &Trans, Vector &dofs) const;
246 
247  /** Compute a representation (up to multiplicative constant) for
248  the delta function at the vertex with the given index. */
249  virtual void ProjectDelta(int vertex, Vector &dofs) const;
250 
251  /** Compute the embedding/projection matrix from the given FiniteElement
252  onto 'this' FiniteElement. The ElementTransformation is included to
253  support cases when the projection depends on it. */
254  virtual void Project(const FiniteElement &fe, ElementTransformation &Trans,
255  DenseMatrix &I) const;
256 
257  /** Compute the discrete gradient matrix from the given FiniteElement onto
258  'this' FiniteElement. The ElementTransformation is included to support
259  cases when the matrix depends on it. */
260  virtual void ProjectGrad(const FiniteElement &fe,
262  DenseMatrix &grad) const;
263 
264  /** Compute the discrete curl matrix from the given FiniteElement onto
265  'this' FiniteElement. The ElementTransformation is included to support
266  cases when the matrix depends on it. */
267  virtual void ProjectCurl(const FiniteElement &fe,
269  DenseMatrix &curl) const;
270 
271  /** Compute the discrete divergence matrix from the given FiniteElement onto
272  'this' FiniteElement. The ElementTransformation is included to support
273  cases when the matrix depends on it. */
274  virtual void ProjectDiv(const FiniteElement &fe,
276  DenseMatrix &div) const;
277 
278  virtual ~FiniteElement () { }
279 
280  static int VerifyClosed(int pt_type)
281  {
282  int cp_type = Quadrature1D::CheckClosed(pt_type);
283  MFEM_VERIFY(cp_type != Quadrature1D::Invalid,
284  "invalid closed point type: " << pt_type);
285  return cp_type;
286  }
287  static int VerifyOpen(int pt_type)
288  {
289  int op_type = Quadrature1D::CheckOpen(pt_type);
290  MFEM_VERIFY(op_type != Quadrature1D::Invalid,
291  "invalid open point type: " << pt_type);
292  return op_type;
293  }
294 };
295 
297 {
298 public:
299  ScalarFiniteElement(int D, int G, int Do, int O, int F = FunctionSpace::Pk)
300  : FiniteElement(D, G, Do, O, F)
302 
303  void SetMapType(int M)
304  {
305  MFEM_VERIFY(M == VALUE || M == INTEGRAL, "unknown MapType");
306  MapType = M;
307  DerivType = (M == VALUE) ? GRAD : NONE;
308  }
309 };
310 
312 {
313 protected:
315  DenseMatrix &I,
316  const NodalFiniteElement &fine_fe) const;
317 
318  void ProjectCurl_2D(const FiniteElement &fe,
319  ElementTransformation &Trans,
320  DenseMatrix &curl) const;
321 
322 #ifndef MFEM_THREAD_SAFE
323  mutable Vector c_shape;
324 #endif
325 
326 public:
327 #ifdef MFEM_THREAD_SAFE
328  NodalFiniteElement(int D, int G, int Do, int O, int F = FunctionSpace::Pk)
329  : ScalarFiniteElement(D, G, Do, O, F) { }
330 #else
331  NodalFiniteElement(int D, int G, int Do, int O, int F = FunctionSpace::Pk)
332  : ScalarFiniteElement(D, G, Do, O, F), c_shape(Do) { }
333 #endif
334 
336  DenseMatrix &I) const
337  { NodalLocalInterpolation (Trans, I, *this); }
338 
339  virtual void Project (Coefficient &coeff,
340  ElementTransformation &Trans, Vector &dofs) const;
341 
342  virtual void Project (VectorCoefficient &vc,
343  ElementTransformation &Trans, Vector &dofs) const;
344 
345  virtual void Project(const FiniteElement &fe, ElementTransformation &Trans,
346  DenseMatrix &I) const;
347 
348  virtual void ProjectGrad(const FiniteElement &fe,
349  ElementTransformation &Trans,
350  DenseMatrix &grad) const;
351 
352  virtual void ProjectDiv(const FiniteElement &fe,
353  ElementTransformation &Trans,
354  DenseMatrix &div) const;
355 };
356 
357 
359 {
360 protected:
362  DenseMatrix &I,
363  const PositiveFiniteElement &fine_fe) const;
364 
365 public:
366  PositiveFiniteElement(int D, int G, int Do, int O,
367  int F = FunctionSpace::Pk) :
368  ScalarFiniteElement(D, G, Do, O, F)
369  { }
370 
372  DenseMatrix &I) const
373  { PositiveLocalInterpolation(Trans, I, *this); }
374 
376 
377  // Low-order monotone "projection" (actually it is not a projection): the
378  // dofs are set to be the Coefficient values at the nodes.
379  virtual void Project(Coefficient &coeff,
380  ElementTransformation &Trans, Vector &dofs) const;
381 
382  virtual void Project(const FiniteElement &fe, ElementTransformation &Trans,
383  DenseMatrix &I) const;
384 };
385 
387 {
388  // Hide the scalar functions CalcShape and CalcDShape.
389 private:
390  /// Overrides the scalar CalcShape function to print an error.
391  virtual void CalcShape(const IntegrationPoint &ip,
392  Vector &shape) const;
393 
394  /// Overrides the scalar CalcDShape function to print an error.
395  virtual void CalcDShape(const IntegrationPoint &ip,
396  DenseMatrix &dshape) const;
397 
398 protected:
399 #ifndef MFEM_THREAD_SAFE
400  mutable DenseMatrix J, Jinv;
402 #endif
403  void SetDerivMembers();
404 
406  DenseMatrix &shape) const;
407 
409  DenseMatrix &shape) const;
410 
411  void Project_RT(const double *nk, const Array<int> &d2n,
413  Vector &dofs) const;
414 
415  void Project_RT(const double *nk, const Array<int> &d2n,
417  DenseMatrix &I) const;
418 
419  // rotated gradient in 2D
420  void ProjectGrad_RT(const double *nk, const Array<int> &d2n,
422  DenseMatrix &grad) const;
423 
424  // Compute the curl as a discrete operator from ND FE (fe) to ND FE (this).
425  // The natural FE for the range is RT, so this is an approximation.
426  void ProjectCurl_ND(const double *tk, const Array<int> &d2t,
428  DenseMatrix &curl) const;
429 
430  void ProjectCurl_RT(const double *nk, const Array<int> &d2n,
432  DenseMatrix &curl) const;
433 
434  void Project_ND(const double *tk, const Array<int> &d2t,
436  Vector &dofs) const;
437 
438  void Project_ND(const double *tk, const Array<int> &d2t,
440  DenseMatrix &I) const;
441 
442  void ProjectGrad_ND(const double *tk, const Array<int> &d2t,
444  DenseMatrix &grad) const;
445 
446  void LocalInterpolation_RT(const double *nk, const Array<int> &d2n,
448  DenseMatrix &I) const;
449 
450  void LocalInterpolation_ND(const double *tk, const Array<int> &d2t,
452  DenseMatrix &I) const;
453 
454 public:
455  VectorFiniteElement (int D, int G, int Do, int O, int M,
456  int F = FunctionSpace::Pk) :
457 #ifdef MFEM_THREAD_SAFE
458  FiniteElement(D, G, Do, O, F)
459  { RangeType = VECTOR; MapType = M; SetDerivMembers(); }
460 #else
461  FiniteElement(D, G, Do, O, F), Jinv(D)
462  { RangeType = VECTOR; MapType = M; SetDerivMembers(); }
463 #endif
464 };
465 
467 {
468 public:
470 
471  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
472 
473  virtual void CalcDShape(const IntegrationPoint &ip,
474  DenseMatrix &dshape) const;
475 };
476 
477 /// Class for linear FE on interval
479 {
480 public:
481  /// Construct a linear FE on interval
483 
484  /** virtual function which evaluates the values of all
485  shape functions at a given point ip and stores
486  them in the vector shape of dimension Dof (2) */
487  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
488 
489  /** virtual function which evaluates the derivatives of all
490  shape functions at a given point ip and stores them in
491  the matrix dshape (Dof x Dim) (2 x 1) so that each row
492  contains the derivative of one shape function */
493  virtual void CalcDShape(const IntegrationPoint &ip,
494  DenseMatrix &dshape) const;
495 };
496 
497 /// Class for linear FE on triangle
499 {
500 public:
501  /// Construct a linear FE on triangle
503 
504  /** virtual function which evaluates the values of all
505  shape functions at a given point ip and stores
506  them in the vector shape of dimension Dof (3) */
507  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
508 
509  /** virtual function which evaluates the values of all
510  partial derivatives of all shape functions at a given
511  point ip and stores them in the matrix dshape (Dof x Dim) (3 x 2)
512  so that each row contains the derivatives of one shape function */
513  virtual void CalcDShape(const IntegrationPoint &ip,
514  DenseMatrix &dshape) const;
515  virtual void ProjectDelta(int vertex, Vector &dofs) const
516  { dofs = 0.0; dofs(vertex) = 1.0; }
517 };
518 
519 /// Class for bilinear FE on quadrilateral
521 {
522 public:
523  /// Construct a bilinear FE on quadrilateral
525 
526  /** virtual function which evaluates the values of all
527  shape functions at a given point ip and stores
528  them in the vector shape of dimension Dof (4) */
529  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
530 
531  /** virtual function which evaluates the values of all
532  partial derivatives of all shape functions at a given
533  point ip and stores them in the matrix dshape (Dof x Dim) (4 x 2)
534  so that each row contains the derivatives of one shape function */
535  virtual void CalcDShape(const IntegrationPoint &ip,
536  DenseMatrix &dshape) const;
537  virtual void CalcHessian (const IntegrationPoint &ip,
538  DenseMatrix &h) const;
539  virtual void ProjectDelta(int vertex, Vector &dofs) const
540  { dofs = 0.0; dofs(vertex) = 1.0; } // { dofs = 1.0; }
541 };
542 
543 /// Class for linear FE on triangle with nodes at the 3 "Gaussian" points
545 {
546 public:
548  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
549  virtual void CalcDShape(const IntegrationPoint &ip,
550  DenseMatrix &dshape) const;
551  virtual void ProjectDelta(int vertex, Vector &dofs) const;
552 };
553 
554 /// Class for bilinear FE on quad with nodes at the 4 Gaussian points
556 {
557 private:
558  static const double p[2];
559 
560 public:
562  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
563  virtual void CalcDShape(const IntegrationPoint &ip,
564  DenseMatrix &dshape) const;
565  virtual void ProjectDelta(int vertex, Vector &dofs) const;
566 };
567 
569 {
570 public:
572  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
573  virtual void CalcDShape(const IntegrationPoint &ip,
574  DenseMatrix &dshape) const;
575  virtual void ProjectDelta(int vertex, Vector &dofs) const
576  { dofs = 1.0; }
577 };
578 
579 /// Class for quadratic FE on interval
581 {
582 public:
583  /// Construct a quadratic FE on interval
585 
586  /** virtual function which evaluates the values of all
587  shape functions at a given point ip and stores
588  them in the vector shape of dimension Dof (3) */
589  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
590 
591  /** virtual function which evaluates the derivatives of all
592  shape functions at a given point ip and stores them in
593  the matrix dshape (Dof x Dim) (3 x 1) so that each row
594  contains the derivative of one shape function */
595  virtual void CalcDShape(const IntegrationPoint &ip,
596  DenseMatrix &dshape) const;
597 };
598 
600 {
601 public:
603  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
604  virtual void CalcDShape(const IntegrationPoint &ip,
605  DenseMatrix &dshape) const;
606 };
607 
608 /// Class for quadratic FE on triangle
610 {
611 public:
612  /// Construct a quadratic FE on triangle
614 
615  /** virtual function which evaluates the values of all
616  shape functions at a given point ip and stores
617  them in the vector shape of dimension Dof (6) */
618  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
619 
620  /** virtual function which evaluates the values of all
621  partial derivatives of all shape functions at a given
622  point ip and stores them in the matrix dshape (Dof x Dim) (6 x 2)
623  so that each row contains the derivatives of one shape function */
624  virtual void CalcDShape(const IntegrationPoint &ip,
625  DenseMatrix &dshape) const;
626 
627  virtual void CalcHessian (const IntegrationPoint &ip,
628  DenseMatrix &h) const;
629  virtual void ProjectDelta(int vertex, Vector &dofs) const;
630 };
631 
632 /// Class for quadratic FE on triangle with nodes at the "Gaussian" points
634 {
635 private:
636  static const double p[2];
637  DenseMatrix A;
638  mutable DenseMatrix D;
639  mutable Vector pol;
640 public:
642  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
643  virtual void CalcDShape(const IntegrationPoint &ip,
644  DenseMatrix &dshape) const;
645  // virtual void ProjectDelta(int vertex, Vector &dofs) const;
646 };
647 
648 /// Class for bi-quadratic FE on quadrilateral
650 {
651 public:
652  /// Construct a biquadratic FE on quadrilateral
654 
655  /** virtual function which evaluates the values of all
656  shape functions at a given point ip and stores
657  them in the vector shape of dimension Dof (9) */
658  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
659 
660  /** virtual function which evaluates the values of all
661  partial derivatives of all shape functions at a given
662  point ip and stores them in the matrix dshape (Dof x Dim) (9 x 2)
663  so that each row contains the derivatives of one shape function */
664  virtual void CalcDShape(const IntegrationPoint &ip,
665  DenseMatrix &dshape) const;
666  virtual void ProjectDelta(int vertex, Vector &dofs) const;
667 };
668 
670 {
671 public:
673  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
674  virtual void CalcDShape(const IntegrationPoint &ip,
675  DenseMatrix &dshape) const;
677  DenseMatrix &I) const;
679  virtual void Project(Coefficient &coeff, ElementTransformation &Trans,
680  Vector &dofs) const;
681  virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans,
682  Vector &dofs) const;
683  virtual void ProjectDelta(int vertex, Vector &dofs) const
684  { dofs = 0.; dofs(vertex) = 1.; }
685 };
686 
687 /// Bi-quadratic element on quad with nodes at the 9 Gaussian points
689 {
690 public:
692  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
693  virtual void CalcDShape(const IntegrationPoint &ip,
694  DenseMatrix &dshape) const;
695  // virtual void ProjectDelta(int vertex, Vector &dofs) const { dofs = 1.; }
696 };
697 
699 {
700 public:
702  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
703  virtual void CalcDShape(const IntegrationPoint &ip,
704  DenseMatrix &dshape) const;
705  virtual void CalcHessian (const IntegrationPoint &ip,
706  DenseMatrix &h) const;
707 };
708 
710 {
711 public:
713 
714  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
715 
716  virtual void CalcDShape(const IntegrationPoint &ip,
717  DenseMatrix &dshape) const;
718 };
719 
721 {
722 public:
724 
725  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
726 
727  virtual void CalcDShape(const IntegrationPoint &ip,
728  DenseMatrix &dshape) const;
729 
730  virtual void CalcHessian (const IntegrationPoint &ip,
731  DenseMatrix &h) const;
732 };
733 
734 /// Class for cubic FE on tetrahedron
736 {
737 public:
738  /// Construct a cubic FE on tetrahedron
740 
741  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
742 
743  virtual void CalcDShape(const IntegrationPoint &ip,
744  DenseMatrix &dshape) const;
745 };
746 
747 /// Class for constant FE on triangle
749 {
750 public:
751  /// Construct P0 triangle finite element
753 
754  /// evaluate shape function - constant 1
755  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
756 
757  /// evaluate derivatives of shape function - constant 0
758  virtual void CalcDShape(const IntegrationPoint &ip,
759  DenseMatrix &dshape) const;
760  virtual void ProjectDelta(int vertex, Vector &dofs) const
761  { dofs(0) = 1.0; }
762 };
763 
764 
766 {
767 public:
769  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
770  virtual void CalcDShape(const IntegrationPoint &ip,
771  DenseMatrix &dshape) const;
772  virtual void ProjectDelta(int vertex, Vector &dofs) const
773  { dofs(0) = 1.0; }
774 };
775 
776 
777 /// Class for linear FE on tetrahedron
779 {
780 public:
781  /// Construct a linear FE on tetrahedron
783 
784  /** virtual function which evaluates the values of all
785  shape functions at a given point ip and stores
786  them in the vector shape of dimension Dof (4) */
787  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
788 
789  /** virtual function which evaluates the values of all
790  partial derivatives of all shape functions at a given
791  point ip and stores them in the matrix dshape (Dof x Dim) (4 x 3)
792  so that each row contains the derivatives of one shape function */
793  virtual void CalcDShape(const IntegrationPoint &ip,
794  DenseMatrix &dshape) const;
795 
796  virtual void ProjectDelta(int vertex, Vector &dofs) const
797  { dofs = 0.0; dofs(vertex) = 1.0; }
798 
799  virtual void GetFaceDofs(int face, int **dofs, int *ndofs) const;
800 };
801 
802 /// Class for quadratic FE on tetrahedron
804 {
805 public:
806  /// Construct a quadratic FE on tetrahedron
808 
809  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
810 
811  virtual void CalcDShape(const IntegrationPoint &ip,
812  DenseMatrix &dshape) const;
813 };
814 
815 /// Class for tri-linear FE on cube
817 {
818 public:
819  /// Construct a tri-linear FE on cube
821 
822  /** virtual function which evaluates the values of all
823  shape functions at a given point ip and stores
824  them in the vector shape of dimension Dof (8) */
825  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
826 
827  /** virtual function which evaluates the values of all
828  partial derivatives of all shape functions at a given
829  point ip and stores them in the matrix dshape (Dof x Dim) (8 x 3)
830  so that each row contains the derivatives of one shape function */
831  virtual void CalcDShape(const IntegrationPoint &ip,
832  DenseMatrix &dshape) const;
833 
834  virtual void ProjectDelta(int vertex, Vector &dofs) const
835  { dofs = 0.0; dofs(vertex) = 1.0; }
836 };
837 
838 /// Crouzeix-Raviart finite element on triangle
840 {
841 public:
843  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
844  virtual void CalcDShape(const IntegrationPoint &ip,
845  DenseMatrix &dshape) const;
846  virtual void ProjectDelta(int vertex, Vector &dofs) const
847  { dofs = 1.0; }
848 };
849 
850 /// Crouzeix-Raviart finite element on quadrilateral
852 {
853 public:
855  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
856  virtual void CalcDShape(const IntegrationPoint &ip,
857  DenseMatrix &dshape) const;
858 };
859 
861 {
862 public:
863  P0SegmentFiniteElement(int Ord = 0);
864  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
865  virtual void CalcDShape(const IntegrationPoint &ip,
866  DenseMatrix &dshape) const;
867 };
868 
870 {
871 private:
872  static const double nk[3][2];
873 
874 public:
876 
877  virtual void CalcVShape(const IntegrationPoint &ip,
878  DenseMatrix &shape) const;
879 
881  DenseMatrix &shape) const
882  { CalcVShape_RT(Trans, shape); }
883 
884  virtual void CalcDivShape(const IntegrationPoint &ip,
885  Vector &divshape) const;
886 
888  DenseMatrix &I) const;
889 
891 
892  virtual void Project (VectorCoefficient &vc,
893  ElementTransformation &Trans, Vector &dofs) const;
894 };
895 
897 {
898 private:
899  static const double nk[4][2];
900 
901 public:
903 
904  virtual void CalcVShape(const IntegrationPoint &ip,
905  DenseMatrix &shape) const;
906 
908  DenseMatrix &shape) const
909  { CalcVShape_RT(Trans, shape); }
910 
911  virtual void CalcDivShape(const IntegrationPoint &ip,
912  Vector &divshape) const;
913 
915  DenseMatrix &I) const;
916 
918 
919  virtual void Project (VectorCoefficient &vc,
920  ElementTransformation &Trans, Vector &dofs) const;
921 };
922 
924 {
925 private:
926  static const double nk[8][2];
927 
928 public:
930 
931  virtual void CalcVShape(const IntegrationPoint &ip,
932  DenseMatrix &shape) const;
933 
935  DenseMatrix &shape) const
936  { CalcVShape_RT(Trans, shape); }
937 
938  virtual void CalcDivShape(const IntegrationPoint &ip,
939  Vector &divshape) const;
940 
942  DenseMatrix &I) const;
943 
945 
946  virtual void Project (VectorCoefficient &vc,
947  ElementTransformation &Trans, Vector &dofs) const;
948 };
949 
951 {
952 private:
953  static const double nk[12][2];
954 
955 public:
957 
958  virtual void CalcVShape(const IntegrationPoint &ip,
959  DenseMatrix &shape) const;
960 
962  DenseMatrix &shape) const
963  { CalcVShape_RT(Trans, shape); }
964 
965  virtual void CalcDivShape(const IntegrationPoint &ip,
966  Vector &divshape) const;
967 
969  DenseMatrix &I) const;
970 
972 
973  virtual void Project (VectorCoefficient &vc,
974  ElementTransformation &Trans, Vector &dofs) const;
975 };
976 
978 {
979 private:
980  static const double M[15][15];
981 public:
983 
984  virtual void CalcVShape(const IntegrationPoint &ip,
985  DenseMatrix &shape) const;
986 
988  DenseMatrix &shape) const
989  { CalcVShape_RT(Trans, shape); }
990 
991  virtual void CalcDivShape(const IntegrationPoint &ip,
992  Vector &divshape) const;
993 };
994 
996 {
997 private:
998  static const double nk[24][2];
999  static const double pt[4];
1000  static const double dpt[3];
1001 
1002 public:
1004 
1005  virtual void CalcVShape(const IntegrationPoint &ip,
1006  DenseMatrix &shape) const;
1007 
1009  DenseMatrix &shape) const
1010  { CalcVShape_RT(Trans, shape); }
1011 
1012  virtual void CalcDivShape(const IntegrationPoint &ip,
1013  Vector &divshape) const;
1014 
1016  DenseMatrix &I) const;
1017 
1018  using FiniteElement::Project;
1019 
1020  virtual void Project (VectorCoefficient &vc,
1021  ElementTransformation &Trans, Vector &dofs) const;
1022 };
1023 
1024 /// Linear 1D element with nodes 1/3 and 2/3 (trace of RT1)
1026 {
1027 public:
1029  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1030  virtual void CalcDShape(const IntegrationPoint &ip,
1031  DenseMatrix &dshape) const;
1032 };
1033 
1034 /// Quadratic 1D element with nodes the Gaussian points in [0,1] (trace of RT2)
1036 {
1037 public:
1039  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1040  virtual void CalcDShape(const IntegrationPoint &ip,
1041  DenseMatrix &dshape) const;
1042 };
1043 
1045 {
1046 private:
1047  Vector rwk;
1048 #ifndef MFEM_THREAD_SAFE
1049  mutable Vector rxxk;
1050 #endif
1051 public:
1052  Lagrange1DFiniteElement (int degree);
1053  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1054  virtual void CalcDShape(const IntegrationPoint &ip,
1055  DenseMatrix &dshape) const;
1056 };
1057 
1059 {
1060 public:
1062  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1063  virtual void CalcDShape(const IntegrationPoint &ip,
1064  DenseMatrix &dshape) const;
1065 };
1066 
1068 {
1069 public:
1070  P0TetFiniteElement ();
1071  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1072  virtual void CalcDShape(const IntegrationPoint &ip,
1073  DenseMatrix &dshape) const;
1074  virtual void ProjectDelta(int vertex, Vector &dofs) const
1075  { dofs(0) = 1.0; }
1076 };
1077 
1079 {
1080 public:
1081  P0HexFiniteElement ();
1082  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1083  virtual void CalcDShape(const IntegrationPoint &ip,
1084  DenseMatrix &dshape) const;
1085  virtual void ProjectDelta(int vertex, Vector &dofs) const
1086  { dofs(0) = 1.0; }
1087 };
1088 
1089 /// Tensor products of 1D FEs (only degree 2 is functional)
1091 {
1092 private:
1093  Lagrange1DFiniteElement * fe1d;
1094  int dof1d;
1095  int *I, *J, *K;
1096 #ifndef MFEM_THREAD_SAFE
1097  mutable Vector shape1dx, shape1dy, shape1dz;
1098  mutable DenseMatrix dshape1dx, dshape1dy, dshape1dz;
1099 #endif
1100 
1101 public:
1102  LagrangeHexFiniteElement (int degree);
1103  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1104  virtual void CalcDShape(const IntegrationPoint &ip,
1105  DenseMatrix &dshape) const;
1107 };
1108 
1109 
1110 /// Class for refined linear FE on interval
1112 {
1113 public:
1114  /// Construct a quadratic FE on interval
1116 
1117  /** virtual function which evaluates the values of all
1118  shape functions at a given point ip and stores
1119  them in the vector shape of dimension Dof (3) */
1120  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1121 
1122  /** virtual function which evaluates the derivatives of all
1123  shape functions at a given point ip and stores them in
1124  the matrix dshape (Dof x Dim) (3 x 1) so that each row
1125  contains the derivative of one shape function */
1126  virtual void CalcDShape(const IntegrationPoint &ip,
1127  DenseMatrix &dshape) const;
1128 };
1129 
1130 /// Class for refined linear FE on triangle
1132 {
1133 public:
1134  /// Construct a quadratic FE on triangle
1136 
1137  /** virtual function which evaluates the values of all
1138  shape functions at a given point ip and stores
1139  them in the vector shape of dimension Dof (6) */
1140  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1141 
1142  /** virtual function which evaluates the values of all
1143  partial derivatives of all shape functions at a given
1144  point ip and stores them in the matrix dshape (Dof x Dim) (6 x 2)
1145  so that each row contains the derivatives of one shape function */
1146  virtual void CalcDShape(const IntegrationPoint &ip,
1147  DenseMatrix &dshape) const;
1148 };
1149 
1150 /// Class for refined linear FE on tetrahedron
1152 {
1153 public:
1154  /// Construct a quadratic FE on tetrahedron
1156 
1157  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1158 
1159  virtual void CalcDShape(const IntegrationPoint &ip,
1160  DenseMatrix &dshape) const;
1161 };
1162 
1163 /// Class for refined bi-linear FE on quadrilateral
1165 {
1166 public:
1167  /// Construct a biquadratic FE on quadrilateral
1169 
1170  /** virtual function which evaluates the values of all
1171  shape functions at a given point ip and stores
1172  them in the vector shape of dimension Dof (9) */
1173  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1174 
1175  /** virtual function which evaluates the values of all
1176  partial derivatives of all shape functions at a given
1177  point ip and stores them in the matrix dshape (Dof x Dim) (9 x 2)
1178  so that each row contains the derivatives of one shape function */
1179  virtual void CalcDShape(const IntegrationPoint &ip,
1180  DenseMatrix &dshape) const;
1181 };
1182 
1183 /// Class for refined trilinear FE on a hexahedron
1185 {
1186 public:
1187  /// Construct a biquadratic FE on quadrilateral
1189 
1190  /** virtual function which evaluates the values of all
1191  shape functions at a given point ip and stores
1192  them in the vector shape of dimension Dof (9) */
1193  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1194 
1195  /** virtual function which evaluates the values of all
1196  partial derivatives of all shape functions at a given
1197  point ip and stores them in the matrix dshape (Dof x Dim) (9 x 2)
1198  so that each row contains the derivatives of one shape function */
1199  virtual void CalcDShape(const IntegrationPoint &ip,
1200  DenseMatrix &dshape) const;
1201 };
1202 
1203 
1205 {
1206 private:
1207  static const double tk[12][3];
1208 
1209 public:
1211  virtual void CalcVShape(const IntegrationPoint &ip,
1212  DenseMatrix &shape) const;
1214  DenseMatrix &shape) const
1215  { CalcVShape_ND(Trans, shape); }
1216  virtual void CalcCurlShape(const IntegrationPoint &ip,
1217  DenseMatrix &curl_shape) const;
1219  DenseMatrix &I) const;
1220  using FiniteElement::Project;
1221  virtual void Project (VectorCoefficient &vc,
1222  ElementTransformation &Trans, Vector &dofs) const;
1223 };
1224 
1225 
1227 {
1228 private:
1229  static const double tk[6][3];
1230 
1231 public:
1233  virtual void CalcVShape(const IntegrationPoint &ip,
1234  DenseMatrix &shape) const;
1236  DenseMatrix &shape) const
1237  { CalcVShape_ND(Trans, shape); }
1238  virtual void CalcCurlShape(const IntegrationPoint &ip,
1239  DenseMatrix &curl_shape) const;
1241  DenseMatrix &I) const;
1242  using FiniteElement::Project;
1243  virtual void Project (VectorCoefficient &vc,
1244  ElementTransformation &Trans, Vector &dofs) const;
1245 };
1246 
1247 
1249 {
1250 private:
1251  static const double nk[6][3];
1252 
1253 public:
1255 
1256  virtual void CalcVShape(const IntegrationPoint &ip,
1257  DenseMatrix &shape) const;
1258 
1260  DenseMatrix &shape) const
1261  { CalcVShape_RT(Trans, shape); }
1262 
1263  virtual void CalcDivShape(const IntegrationPoint &ip,
1264  Vector &divshape) const;
1265 
1267  DenseMatrix &I) const;
1268 
1269  using FiniteElement::Project;
1270 
1271  virtual void Project (VectorCoefficient &vc,
1272  ElementTransformation &Trans, Vector &dofs) const;
1273 };
1274 
1275 
1277 {
1278 private:
1279  static const double nk[36][3];
1280 
1281 public:
1283 
1284  virtual void CalcVShape(const IntegrationPoint &ip,
1285  DenseMatrix &shape) const;
1286 
1288  DenseMatrix &shape) const
1289  { CalcVShape_RT(Trans, shape); }
1290 
1291  virtual void CalcDivShape(const IntegrationPoint &ip,
1292  Vector &divshape) const;
1293 
1295  DenseMatrix &I) const;
1296 
1297  using FiniteElement::Project;
1298 
1299  virtual void Project (VectorCoefficient &vc,
1300  ElementTransformation &Trans, Vector &dofs) const;
1301 };
1302 
1303 
1305 {
1306 private:
1307  static const double nk[4][3];
1308 
1309 public:
1311 
1312  virtual void CalcVShape(const IntegrationPoint &ip,
1313  DenseMatrix &shape) const;
1314 
1316  DenseMatrix &shape) const
1317  { CalcVShape_RT(Trans, shape); }
1318 
1319  virtual void CalcDivShape(const IntegrationPoint &ip,
1320  Vector &divshape) const;
1321 
1323  DenseMatrix &I) const;
1324 
1325  using FiniteElement::Project;
1326 
1327  virtual void Project (VectorCoefficient &vc,
1328  ElementTransformation &Trans, Vector &dofs) const;
1329 };
1330 
1331 
1333 {
1334 public:
1336  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1337  virtual void CalcDShape(const IntegrationPoint &ip,
1338  DenseMatrix &dshape) const;
1339 };
1340 
1341 
1342 class Poly_1D
1343 {
1344 public:
1345  class Basis
1346  {
1347  private:
1348  int mode; /* 0 - use change of basis, O(p^2) Evals
1349  1 - use barycentric Lagrangian interpolation, O(p) Evals */
1350  DenseMatrixInverse Ai;
1351  mutable Vector x, w;
1352 
1353  public:
1354  Basis(const int p, const double *nodes, const int _mode = 1);
1355  void Eval(const double x, Vector &u) const;
1356  void Eval(const double x, Vector &u, Vector &d) const;
1357  };
1358 
1359 private:
1360  std::map< int, Array<double*>* > points_container;
1361  std::map< int, Array<Basis*>* > bases_container;
1362 
1363  static Array2D<int> binom;
1364 
1365  static void CalcMono(const int p, const double x, double *u);
1366  static void CalcMono(const int p, const double x, double *u, double *d);
1367 
1368  static void CalcLegendre(const int p, const double x, double *u);
1369  static void CalcLegendre(const int p, const double x, double *u, double *d);
1370 
1371  static void CalcChebyshev(const int p, const double x, double *u);
1372  static void CalcChebyshev(const int p, const double x, double *u, double *d);
1373 
1374  QuadratureFunctions1D quad_func;
1375 
1376 public:
1377  Poly_1D() { }
1378 
1379  /** @brief Get a poiner to an array containing the binomial coefficients "p
1380  choose k" for k=0,...,p for the given p. */
1381  static const int *Binom(const int p);
1382 
1383  /** @brief Get the coordinates of the points of the given Quadrature1D type.
1384  @param p the polynomial degree; the number of points is `p+1`.
1385  @param type the Quadrature1D type.
1386  @return a pointer to an array containing the `p+1` coordiantes of the
1387  quadrature points. */
1388  const double *GetPoints(const int p, const int type);
1389  const double *OpenPoints(const int p,
1390  const int type = Quadrature1D::GaussLegendre)
1391  { return GetPoints(p, type); }
1392  const double *ClosedPoints(const int p,
1393  const int type = Quadrature1D::GaussLobatto)
1394  { return GetPoints(p, type); }
1395 
1396  /** @brief Get a Poly_1D::Basis object of the given degree and Quadrature1D
1397  type.
1398  @param p the polynomial degree of the basis.
1399  @param type the Quadrature1D type.
1400  @return a reference to an object of type Poly_1D::Basis that represents
1401  the requested nodal basis. */
1402  Basis &GetBasis(const int p, const int type);
1403  Basis &OpenBasis(const int p,
1404  const int type = Quadrature1D::GaussLegendre)
1405  { return GetBasis(p, type); }
1406  Basis &ClosedBasis(const int p,
1407  const int type = Quadrature1D::GaussLobatto)
1408  { return GetBasis(p, type); }
1409 
1410  // Evaluate the values of a hierarchical 1D basis at point x
1411  // hierarchical = k-th basis function is degree k polynomial
1412  static void CalcBasis(const int p, const double x, double *u)
1413  // { CalcMono(p, x, u); }
1414  // Bernstein basis is not hierarchical --> does not work for triangles
1415  // and tetrahedra
1416  // { CalcBernstein(p, x, u); }
1417  // { CalcLegendre(p, x, u); }
1418  { CalcChebyshev(p, x, u); }
1419 
1420  // Evaluate the values and derivatives of a hierarchical 1D basis at point x
1421  static void CalcBasis(const int p, const double x, double *u, double *d)
1422  // { CalcMono(p, x, u, d); }
1423  // { CalcBernstein(p, x, u, d); }
1424  // { CalcLegendre(p, x, u, d); }
1425  { CalcChebyshev(p, x, u, d); }
1426 
1427  // Evaluate a representation of a Delta function at point x
1428  static double CalcDelta(const int p, const double x)
1429  { return pow(x, (double) p); }
1430 
1431  static void ChebyshevPoints(const int p, double *x);
1432 
1433  /// Compute the terms in the expansion of the binomial (x + y)^p
1434  static void CalcBinomTerms(const int p, const double x, const double y,
1435  double *u);
1436  /** Compute the terms in the expansion of the binomial (x + y)^p and their
1437  derivatives with respect to x assuming that dy/dx = -1. */
1438  static void CalcBinomTerms(const int p, const double x, const double y,
1439  double *u, double *d);
1440  /** Compute the derivatives (w.r.t. x) of the terms in the expansion of the
1441  binomial (x + y)^p assuming that dy/dx = -1. */
1442  static void CalcDBinomTerms(const int p, const double x, const double y,
1443  double *d);
1444  static void CalcBernstein(const int p, const double x, double *u)
1445  { CalcBinomTerms(p, x, 1. - x, u); }
1446  static void CalcBernstein(const int p, const double x, double *u, double *d)
1447  { CalcBinomTerms(p, x, 1. - x, u, d); }
1448 
1449  ~Poly_1D();
1450 };
1451 
1452 extern Poly_1D poly1d;
1453 
1454 
1456 {
1457 private:
1458  int pt_type;
1459  Poly_1D::Basis &basis1d;
1460 #ifndef MFEM_THREAD_SAFE
1461  mutable Vector shape_x, dshape_x;
1462 #endif
1463  Array<int> dof_map;
1464 
1465 public:
1466  H1_SegmentElement(const int p, const int type = Quadrature1D::GaussLobatto);
1467  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1468  virtual void CalcDShape(const IntegrationPoint &ip,
1469  DenseMatrix &dshape) const;
1470  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1471  const Array<int> &GetDofMap() const { return dof_map; }
1472 };
1473 
1474 
1476 {
1477 private:
1478  int pt_type;
1479  Poly_1D::Basis &basis1d;
1480 #ifndef MFEM_THREAD_SAFE
1481  mutable Vector shape_x, shape_y, dshape_x, dshape_y;
1482 #endif
1483  Array<int> dof_map;
1484 
1485 public:
1486  H1_QuadrilateralElement(const int p,
1487  const int type = Quadrature1D::GaussLobatto);
1488  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1489  virtual void CalcDShape(const IntegrationPoint &ip,
1490  DenseMatrix &dshape) const;
1491  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1492  const Array<int> &GetDofMap() const { return dof_map; }
1493 };
1494 
1495 
1497 {
1498 private:
1499  int pt_type;
1500  Poly_1D::Basis &basis1d;
1501 #ifndef MFEM_THREAD_SAFE
1502  mutable Vector shape_x, shape_y, shape_z, dshape_x, dshape_y, dshape_z;
1503 #endif
1504  Array<int> dof_map;
1505 
1506 public:
1507  H1_HexahedronElement(const int p, const int type = Quadrature1D::GaussLobatto);
1508  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1509  virtual void CalcDShape(const IntegrationPoint &ip,
1510  DenseMatrix &dshape) const;
1511  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1512  const Array<int> &GetDofMap() const { return dof_map; }
1513 };
1514 
1516 {
1517 private:
1518 #ifndef MFEM_THREAD_SAFE
1519  // This is to share scratch space between invocations, which helps
1520  // speed things up, but with OpenMP, we need one copy per thread.
1521  // Right now, we solve this by allocating this space within each function
1522  // call every time we call it. Alternatively, we should do some sort
1523  // thread private thing. Brunner, Jan 2014
1524  mutable Vector shape_x, dshape_x;
1525 #endif
1526  Array<int> dof_map;
1527 
1528 public:
1529  H1Pos_SegmentElement(const int p);
1530  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1531  virtual void CalcDShape(const IntegrationPoint &ip,
1532  DenseMatrix &dshape) const;
1533  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1534  const Array<int> &GetDofMap() const { return dof_map; }
1535 };
1536 
1537 
1539 {
1540 private:
1541 #ifndef MFEM_THREAD_SAFE
1542  // See comment in H1Pos_SegmentElement
1543  mutable Vector shape_x, shape_y, dshape_x, dshape_y;
1544 #endif
1545  Array<int> dof_map;
1546 
1547 public:
1548  H1Pos_QuadrilateralElement(const int p);
1549  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1550  virtual void CalcDShape(const IntegrationPoint &ip,
1551  DenseMatrix &dshape) const;
1552  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1553  const Array<int> &GetDofMap() const { return dof_map; }
1554 };
1555 
1556 
1558 {
1559 private:
1560 #ifndef MFEM_THREAD_SAFE
1561  // See comment in H1Pos_SegementElement.
1562  mutable Vector shape_x, shape_y, shape_z, dshape_x, dshape_y, dshape_z;
1563 #endif
1564  Array<int> dof_map;
1565 
1566 public:
1567  H1Pos_HexahedronElement(const int p);
1568  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1569  virtual void CalcDShape(const IntegrationPoint &ip,
1570  DenseMatrix &dshape) const;
1571  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1572  const Array<int> &GetDofMap() const { return dof_map; }
1573 };
1574 
1575 
1577 {
1578 private:
1579 #ifndef MFEM_THREAD_SAFE
1580  mutable Vector shape_x, shape_y, shape_l, dshape_x, dshape_y, dshape_l, u;
1581  mutable DenseMatrix du;
1582 #endif
1583  DenseMatrixInverse Ti;
1584 
1585 public:
1586  H1_TriangleElement(const int p, const int type = Quadrature1D::GaussLobatto);
1587  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1588  virtual void CalcDShape(const IntegrationPoint &ip,
1589  DenseMatrix &dshape) const;
1590 };
1591 
1592 
1594 {
1595 private:
1596 #ifndef MFEM_THREAD_SAFE
1597  mutable Vector shape_x, shape_y, shape_z, shape_l;
1598  mutable Vector dshape_x, dshape_y, dshape_z, dshape_l, u;
1599  mutable DenseMatrix du;
1600 #endif
1601  DenseMatrixInverse Ti;
1602 
1603 public:
1604  H1_TetrahedronElement(const int p,
1605  const int type = Quadrature1D::GaussLobatto);
1606  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1607  virtual void CalcDShape(const IntegrationPoint &ip,
1608  DenseMatrix &dshape) const;
1609 };
1610 
1611 
1613 {
1614 protected:
1615 #ifndef MFEM_THREAD_SAFE
1618 #endif
1620 
1621 public:
1622  H1Pos_TriangleElement(const int p);
1623 
1624  // The size of shape is (p+1)(p+2)/2 (dof).
1625  static void CalcShape(const int p, const double x, const double y,
1626  double *shape);
1627 
1628  // The size of dshape_1d is p+1; the size of dshape is (dof x dim).
1629  static void CalcDShape(const int p, const double x, const double y,
1630  double *dshape_1d, double *dshape);
1631 
1632  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1633  virtual void CalcDShape(const IntegrationPoint &ip,
1634  DenseMatrix &dshape) const;
1635 };
1636 
1637 
1639 {
1640 protected:
1641 #ifndef MFEM_THREAD_SAFE
1644 #endif
1646 
1647 public:
1648  H1Pos_TetrahedronElement(const int p);
1649 
1650  // The size of shape is (p+1)(p+2)(p+3)/6 (dof).
1651  static void CalcShape(const int p, const double x, const double y,
1652  const double z, double *shape);
1653 
1654  // The size of dshape_1d is p+1; the size of dshape is (dof x dim).
1655  static void CalcDShape(const int p, const double x, const double y,
1656  const double z, double *dshape_1d, double *dshape);
1657 
1658  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1659  virtual void CalcDShape(const IntegrationPoint &ip,
1660  DenseMatrix &dshape) const;
1661 };
1662 
1663 
1665 {
1666 private:
1667  int type;
1668  Poly_1D::Basis &basis1d;
1669 #ifndef MFEM_THREAD_SAFE
1670  mutable Vector shape_x, dshape_x;
1671 #endif
1672 
1673 public:
1674  L2_SegmentElement(const int p, const int type = Quadrature1D::GaussLegendre);
1675  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1676  virtual void CalcDShape(const IntegrationPoint &ip,
1677  DenseMatrix &dshape) const;
1678  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1679 };
1680 
1681 
1683 {
1684 private:
1685 #ifndef MFEM_THREAD_SAFE
1686  mutable Vector shape_x, dshape_x;
1687 #endif
1688 
1689 public:
1690  L2Pos_SegmentElement(const int p);
1691  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1692  virtual void CalcDShape(const IntegrationPoint &ip,
1693  DenseMatrix &dshape) const;
1694  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1695 };
1696 
1697 
1699 {
1700 private:
1701  int type;
1702  Poly_1D::Basis &basis1d;
1703 #ifndef MFEM_THREAD_SAFE
1704  mutable Vector shape_x, shape_y, dshape_x, dshape_y;
1705 #endif
1706 
1707 public:
1708  L2_QuadrilateralElement(const int p,
1709  const int _type = Quadrature1D::GaussLegendre);
1710  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1711  virtual void CalcDShape(const IntegrationPoint &ip,
1712  DenseMatrix &dshape) const;
1713  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1714  virtual void ProjectCurl(const FiniteElement &fe,
1716  DenseMatrix &curl) const
1717  { ProjectCurl_2D(fe, Trans, curl); }
1718 };
1719 
1720 
1722 {
1723 private:
1724 #ifndef MFEM_THREAD_SAFE
1725  mutable Vector shape_x, shape_y, dshape_x, dshape_y;
1726 #endif
1727 
1728 public:
1729  L2Pos_QuadrilateralElement(const int p);
1730  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1731  virtual void CalcDShape(const IntegrationPoint &ip,
1732  DenseMatrix &dshape) const;
1733  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1734 };
1735 
1736 
1738 {
1739 private:
1740  int type;
1741  Poly_1D::Basis &basis1d;
1742 #ifndef MFEM_THREAD_SAFE
1743  mutable Vector shape_x, shape_y, shape_z, dshape_x, dshape_y, dshape_z;
1744 #endif
1745 
1746 public:
1747  L2_HexahedronElement(const int p,
1748  const int _type = Quadrature1D::GaussLegendre);
1749  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1750  virtual void CalcDShape(const IntegrationPoint &ip,
1751  DenseMatrix &dshape) const;
1752  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1753 };
1754 
1755 
1757 {
1758 private:
1759 #ifndef MFEM_THREAD_SAFE
1760  mutable Vector shape_x, shape_y, shape_z, dshape_x, dshape_y, dshape_z;
1761 #endif
1762 
1763 public:
1764  L2Pos_HexahedronElement(const int p);
1765  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1766  virtual void CalcDShape(const IntegrationPoint &ip,
1767  DenseMatrix &dshape) const;
1768  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1769 };
1770 
1771 
1773 {
1774 private:
1775 #ifndef MFEM_THREAD_SAFE
1776  mutable Vector shape_x, shape_y, shape_l, dshape_x, dshape_y, dshape_l, u;
1777  mutable DenseMatrix du;
1778 #endif
1779  DenseMatrixInverse Ti;
1780 
1781 public:
1782  L2_TriangleElement(const int p,
1783  const int type = Quadrature1D::GaussLegendre);
1784  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1785  virtual void CalcDShape(const IntegrationPoint &ip,
1786  DenseMatrix &dshape) const;
1787  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1788  virtual void ProjectCurl(const FiniteElement &fe,
1790  DenseMatrix &curl) const
1791  { ProjectCurl_2D(fe, Trans, curl); }
1792 };
1793 
1794 
1796 {
1797 private:
1798 #ifndef MFEM_THREAD_SAFE
1799  mutable Vector dshape_1d;
1800 #endif
1801 
1802 public:
1803  L2Pos_TriangleElement(const int p);
1804  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1805  virtual void CalcDShape(const IntegrationPoint &ip,
1806  DenseMatrix &dshape) const;
1807  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1808 };
1809 
1810 
1812 {
1813 private:
1814 #ifndef MFEM_THREAD_SAFE
1815  mutable Vector shape_x, shape_y, shape_z, shape_l;
1816  mutable Vector dshape_x, dshape_y, dshape_z, dshape_l, u;
1817  mutable DenseMatrix du;
1818 #endif
1819  DenseMatrixInverse Ti;
1820 
1821 public:
1822  L2_TetrahedronElement(const int p,
1823  const int type = Quadrature1D::GaussLegendre);
1824  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1825  virtual void CalcDShape(const IntegrationPoint &ip,
1826  DenseMatrix &dshape) const;
1827  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1828 };
1829 
1830 
1832 {
1833 private:
1834 #ifndef MFEM_THREAD_SAFE
1835  mutable Vector dshape_1d;
1836 #endif
1837 
1838 public:
1839  L2Pos_TetrahedronElement(const int p);
1840  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1841  virtual void CalcDShape(const IntegrationPoint &ip,
1842  DenseMatrix &dshape) const;
1843  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1844 };
1845 
1846 
1848 {
1849 private:
1850  static const double nk[8];
1851 
1852  Poly_1D::Basis &cbasis1d, &obasis1d;
1853 #ifndef MFEM_THREAD_SAFE
1854  mutable Vector shape_cx, shape_ox, shape_cy, shape_oy;
1855  mutable Vector dshape_cx, dshape_cy;
1856 #endif
1857  Array<int> dof_map, dof2nk;
1858 
1859 public:
1860  RT_QuadrilateralElement(const int p,
1861  const int cp_type = Quadrature1D::GaussLobatto,
1862  const int op_type = Quadrature1D::GaussLegendre);
1863  virtual void CalcVShape(const IntegrationPoint &ip,
1864  DenseMatrix &shape) const;
1866  DenseMatrix &shape) const
1867  { CalcVShape_RT(Trans, shape); }
1868  virtual void CalcDivShape(const IntegrationPoint &ip,
1869  Vector &divshape) const;
1871  DenseMatrix &I) const
1872  { LocalInterpolation_RT(nk, dof2nk, Trans, I); }
1873  using FiniteElement::Project;
1874  virtual void Project(VectorCoefficient &vc,
1875  ElementTransformation &Trans, Vector &dofs) const
1876  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
1878  DenseMatrix &I) const
1879  { Project_RT(nk, dof2nk, fe, Trans, I); }
1880  // Gradient + rotation = Curl: H1 -> H(div)
1881  virtual void ProjectGrad(const FiniteElement &fe,
1883  DenseMatrix &grad) const
1884  { ProjectGrad_RT(nk, dof2nk, fe, Trans, grad); }
1885  // Curl = Gradient + rotation: H1 -> H(div)
1886  virtual void ProjectCurl(const FiniteElement &fe,
1888  DenseMatrix &curl) const
1889  { ProjectGrad_RT(nk, dof2nk, fe, Trans, curl); }
1890 };
1891 
1892 
1894 {
1895  static const double nk[18];
1896 
1897  Poly_1D::Basis &cbasis1d, &obasis1d;
1898 #ifndef MFEM_THREAD_SAFE
1899  mutable Vector shape_cx, shape_ox, shape_cy, shape_oy, shape_cz, shape_oz;
1900  mutable Vector dshape_cx, dshape_cy, dshape_cz;
1901 #endif
1902  Array<int> dof_map, dof2nk;
1903 
1904 public:
1905  RT_HexahedronElement(const int p,
1906  const int cp_type = Quadrature1D::GaussLobatto,
1907  const int op_type = Quadrature1D::GaussLegendre);
1908 
1909  virtual void CalcVShape(const IntegrationPoint &ip,
1910  DenseMatrix &shape) const;
1912  DenseMatrix &shape) const
1913  { CalcVShape_RT(Trans, shape); }
1914  virtual void CalcDivShape(const IntegrationPoint &ip,
1915  Vector &divshape) const;
1917  DenseMatrix &I) const
1918  { LocalInterpolation_RT(nk, dof2nk, Trans, I); }
1919  using FiniteElement::Project;
1920  virtual void Project(VectorCoefficient &vc,
1921  ElementTransformation &Trans, Vector &dofs) const
1922  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
1924  DenseMatrix &I) const
1925  { Project_RT(nk, dof2nk, fe, Trans, I); }
1926  virtual void ProjectCurl(const FiniteElement &fe,
1928  DenseMatrix &curl) const
1929  { ProjectCurl_RT(nk, dof2nk, fe, Trans, curl); }
1930 };
1931 
1932 
1934 {
1935  static const double nk[6], c;
1936 
1937 #ifndef MFEM_THREAD_SAFE
1938  mutable Vector shape_x, shape_y, shape_l;
1939  mutable Vector dshape_x, dshape_y, dshape_l;
1940  mutable DenseMatrix u;
1941  mutable Vector divu;
1942 #endif
1943  Array<int> dof2nk;
1944  DenseMatrixInverse Ti;
1945 
1946 public:
1947  RT_TriangleElement(const int p);
1948  virtual void CalcVShape(const IntegrationPoint &ip,
1949  DenseMatrix &shape) const;
1951  DenseMatrix &shape) const
1952  { CalcVShape_RT(Trans, shape); }
1953  virtual void CalcDivShape(const IntegrationPoint &ip,
1954  Vector &divshape) const;
1956  DenseMatrix &I) const
1957  { LocalInterpolation_RT(nk, dof2nk, Trans, I); }
1958  using FiniteElement::Project;
1959  virtual void Project(VectorCoefficient &vc,
1960  ElementTransformation &Trans, Vector &dofs) const
1961  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
1963  DenseMatrix &I) const
1964  { Project_RT(nk, dof2nk, fe, Trans, I); }
1965  // Gradient + rotation = Curl: H1 -> H(div)
1966  virtual void ProjectGrad(const FiniteElement &fe,
1968  DenseMatrix &grad) const
1969  { ProjectGrad_RT(nk, dof2nk, fe, Trans, grad); }
1970  // Curl = Gradient + rotation: H1 -> H(div)
1971  virtual void ProjectCurl(const FiniteElement &fe,
1973  DenseMatrix &curl) const
1974  { ProjectGrad_RT(nk, dof2nk, fe, Trans, curl); }
1975 };
1976 
1977 
1979 {
1980  static const double nk[12], c;
1981 
1982 #ifndef MFEM_THREAD_SAFE
1983  mutable Vector shape_x, shape_y, shape_z, shape_l;
1984  mutable Vector dshape_x, dshape_y, dshape_z, dshape_l;
1985  mutable DenseMatrix u;
1986  mutable Vector divu;
1987 #endif
1988  Array<int> dof2nk;
1989  DenseMatrixInverse Ti;
1990 
1991 public:
1992  RT_TetrahedronElement(const int p);
1993  virtual void CalcVShape(const IntegrationPoint &ip,
1994  DenseMatrix &shape) const;
1996  DenseMatrix &shape) const
1997  { CalcVShape_RT(Trans, shape); }
1998  virtual void CalcDivShape(const IntegrationPoint &ip,
1999  Vector &divshape) const;
2001  DenseMatrix &I) const
2002  { LocalInterpolation_RT(nk, dof2nk, Trans, I); }
2003  using FiniteElement::Project;
2004  virtual void Project(VectorCoefficient &vc,
2005  ElementTransformation &Trans, Vector &dofs) const
2006  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
2008  DenseMatrix &I) const
2009  { Project_RT(nk, dof2nk, fe, Trans, I); }
2010  virtual void ProjectCurl(const FiniteElement &fe,
2012  DenseMatrix &curl) const
2013  { ProjectCurl_RT(nk, dof2nk, fe, Trans, curl); }
2014 };
2015 
2016 
2018 {
2019  static const double tk[18];
2020 
2021  Poly_1D::Basis &cbasis1d, &obasis1d;
2022 #ifndef MFEM_THREAD_SAFE
2023  mutable Vector shape_cx, shape_ox, shape_cy, shape_oy, shape_cz, shape_oz;
2024  mutable Vector dshape_cx, dshape_cy, dshape_cz;
2025 #endif
2026  Array<int> dof_map, dof2tk;
2027 
2028 public:
2029  ND_HexahedronElement(const int p,
2030  const int cp_type = Quadrature1D::GaussLobatto,
2031  const int op_type = Quadrature1D::GaussLegendre);
2032 
2033  virtual void CalcVShape(const IntegrationPoint &ip,
2034  DenseMatrix &shape) const;
2035 
2037  DenseMatrix &shape) const
2038  { CalcVShape_ND(Trans, shape); }
2039 
2040  virtual void CalcCurlShape(const IntegrationPoint &ip,
2041  DenseMatrix &curl_shape) const;
2042 
2044  DenseMatrix &I) const
2045  { LocalInterpolation_ND(tk, dof2tk, Trans, I); }
2046 
2047  using FiniteElement::Project;
2048 
2049  virtual void Project(VectorCoefficient &vc,
2050  ElementTransformation &Trans, Vector &dofs) const
2051  { Project_ND(tk, dof2tk, vc, Trans, dofs); }
2052 
2053  virtual void Project(const FiniteElement &fe,
2055  DenseMatrix &I) const
2056  { Project_ND(tk, dof2tk, fe, Trans, I); }
2057 
2058  virtual void ProjectGrad(const FiniteElement &fe,
2060  DenseMatrix &grad) const
2061  { ProjectGrad_ND(tk, dof2tk, fe, Trans, grad); }
2062 
2063  virtual void ProjectCurl(const FiniteElement &fe,
2065  DenseMatrix &curl) const
2066  { ProjectCurl_ND(tk, dof2tk, fe, Trans, curl); }
2067 };
2068 
2069 
2071 {
2072  static const double tk[8];
2073 
2074  Poly_1D::Basis &cbasis1d, &obasis1d;
2075 #ifndef MFEM_THREAD_SAFE
2076  mutable Vector shape_cx, shape_ox, shape_cy, shape_oy;
2077  mutable Vector dshape_cx, dshape_cy;
2078 #endif
2079  Array<int> dof_map, dof2tk;
2080 
2081 public:
2082  ND_QuadrilateralElement(const int p,
2083  const int cp_type = Quadrature1D::GaussLobatto,
2084  const int op_type = Quadrature1D::GaussLegendre);
2085  virtual void CalcVShape(const IntegrationPoint &ip,
2086  DenseMatrix &shape) const;
2088  DenseMatrix &shape) const
2089  { CalcVShape_ND(Trans, shape); }
2090  virtual void CalcCurlShape(const IntegrationPoint &ip,
2091  DenseMatrix &curl_shape) const;
2093  DenseMatrix &I) const
2094  { LocalInterpolation_ND(tk, dof2tk, Trans, I); }
2095  using FiniteElement::Project;
2096  virtual void Project(VectorCoefficient &vc,
2097  ElementTransformation &Trans, Vector &dofs) const
2098  { Project_ND(tk, dof2tk, vc, Trans, dofs); }
2099  virtual void Project(const FiniteElement &fe,
2101  DenseMatrix &I) const
2102  { Project_ND(tk, dof2tk, fe, Trans, I); }
2103  virtual void ProjectGrad(const FiniteElement &fe,
2105  DenseMatrix &grad) const
2106  { ProjectGrad_ND(tk, dof2tk, fe, Trans, grad); }
2107 };
2108 
2109 
2111 {
2112  static const double tk[18], c;
2113 
2114 #ifndef MFEM_THREAD_SAFE
2115  mutable Vector shape_x, shape_y, shape_z, shape_l;
2116  mutable Vector dshape_x, dshape_y, dshape_z, dshape_l;
2117  mutable DenseMatrix u;
2118 #endif
2119  Array<int> dof2tk;
2120  DenseMatrixInverse Ti;
2121 
2122 public:
2123  ND_TetrahedronElement(const int p);
2124  virtual void CalcVShape(const IntegrationPoint &ip,
2125  DenseMatrix &shape) const;
2127  DenseMatrix &shape) const
2128  { CalcVShape_ND(Trans, shape); }
2129  virtual void CalcCurlShape(const IntegrationPoint &ip,
2130  DenseMatrix &curl_shape) const;
2132  DenseMatrix &I) const
2133  { LocalInterpolation_ND(tk, dof2tk, Trans, I); }
2134  using FiniteElement::Project;
2135  virtual void Project(VectorCoefficient &vc,
2136  ElementTransformation &Trans, Vector &dofs) const
2137  { Project_ND(tk, dof2tk, vc, Trans, dofs); }
2138  virtual void Project(const FiniteElement &fe,
2140  DenseMatrix &I) const
2141  { Project_ND(tk, dof2tk, fe, Trans, I); }
2142  virtual void ProjectGrad(const FiniteElement &fe,
2144  DenseMatrix &grad) const
2145  { ProjectGrad_ND(tk, dof2tk, fe, Trans, grad); }
2146 
2147  virtual void ProjectCurl(const FiniteElement &fe,
2149  DenseMatrix &curl) const
2150  { ProjectCurl_ND(tk, dof2tk, fe, Trans, curl); }
2151 };
2152 
2154 {
2155  static const double tk[8], c;
2156 
2157 #ifndef MFEM_THREAD_SAFE
2158  mutable Vector shape_x, shape_y, shape_l;
2159  mutable Vector dshape_x, dshape_y, dshape_l;
2160  mutable DenseMatrix u;
2161  mutable Vector curlu;
2162 #endif
2163  Array<int> dof2tk;
2164  DenseMatrixInverse Ti;
2165 
2166 public:
2167  ND_TriangleElement(const int p);
2168  virtual void CalcVShape(const IntegrationPoint &ip,
2169  DenseMatrix &shape) const;
2171  DenseMatrix &shape) const
2172  { CalcVShape_ND(Trans, shape); }
2173  virtual void CalcCurlShape(const IntegrationPoint &ip,
2174  DenseMatrix &curl_shape) const;
2176  DenseMatrix &I) const
2177  { LocalInterpolation_ND(tk, dof2tk, Trans, I); }
2178  using FiniteElement::Project;
2179  virtual void Project(VectorCoefficient &vc,
2180  ElementTransformation &Trans, Vector &dofs) const
2181  { Project_ND(tk, dof2tk, vc, Trans, dofs); }
2182  virtual void Project(const FiniteElement &fe,
2184  DenseMatrix &I) const
2185  { Project_ND(tk, dof2tk, fe, Trans, I); }
2186  virtual void ProjectGrad(const FiniteElement &fe,
2188  DenseMatrix &grad) const
2189  { ProjectGrad_ND(tk, dof2tk, fe, Trans, grad); }
2190 };
2191 
2192 
2194 {
2195  static const double tk[1];
2196 
2197  Poly_1D::Basis &obasis1d;
2198  Array<int> dof2tk;
2199 
2200 public:
2201  ND_SegmentElement(const int p,
2202  const int op_type = Quadrature1D::GaussLegendre );
2203  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
2204  { obasis1d.Eval(ip.x, shape); }
2205  virtual void CalcVShape(const IntegrationPoint &ip,
2206  DenseMatrix &shape) const;
2208  DenseMatrix &shape) const
2209  { CalcVShape_ND(Trans, shape); }
2210  // virtual void CalcCurlShape(const IntegrationPoint &ip,
2211  // DenseMatrix &curl_shape) const;
2213  DenseMatrix &I) const
2214  { LocalInterpolation_ND(tk, dof2tk, Trans, I); }
2215  using FiniteElement::Project;
2216  virtual void Project(VectorCoefficient &vc,
2217  ElementTransformation &Trans, Vector &dofs) const
2218  { Project_ND(tk, dof2tk, vc, Trans, dofs); }
2219  virtual void Project(const FiniteElement &fe,
2221  DenseMatrix &I) const
2222  { Project_ND(tk, dof2tk, fe, Trans, I); }
2223  virtual void ProjectGrad(const FiniteElement &fe,
2225  DenseMatrix &grad) const
2226  { ProjectGrad_ND(tk, dof2tk, fe, Trans, grad); }
2227 };
2228 
2229 
2231 {
2232 protected:
2234  mutable int *ijk, patch, elem;
2235  mutable Vector weights;
2236 
2237 public:
2238  NURBSFiniteElement(int D, int G, int Do, int O, int F)
2239  : ScalarFiniteElement(D, G, Do, O, F)
2240  {
2241  ijk = NULL;
2242  patch = elem = -1;
2243  kv.SetSize(Dim);
2244  weights.SetSize(Dof);
2245  weights = 1.0;
2246  }
2247 
2248  void Reset () const { patch = elem = -1; }
2249  void SetIJK (int *IJK) const { ijk = IJK; }
2250  int GetPatch () const { return patch; }
2251  void SetPatch (int p) const { patch = p; }
2252  int GetElement () const { return elem; }
2253  void SetElement (int e) const { elem = e; }
2254  Array <KnotVector*> &KnotVectors() const { return kv; }
2255  Vector &Weights () const { return weights; }
2256 };
2257 
2259 {
2260 protected:
2261  mutable Vector shape_x;
2262 
2263 public:
2265  : NURBSFiniteElement(1, Geometry::SEGMENT, p + 1, p, FunctionSpace::Qk),
2266  shape_x(p + 1) { }
2267 
2268  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2269  virtual void CalcDShape(const IntegrationPoint &ip,
2270  DenseMatrix &dshape) const;
2271 };
2272 
2274 {
2275 protected:
2277 
2278 public:
2280  : NURBSFiniteElement(2, Geometry::SQUARE, (p + 1)*(p + 1), p,
2281  FunctionSpace::Qk), u(Dof),
2282  shape_x(p + 1), shape_y(p + 1), dshape_x(p + 1), dshape_y(p + 1) { }
2283 
2284  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2285  virtual void CalcDShape(const IntegrationPoint &ip,
2286  DenseMatrix &dshape) const;
2287 };
2288 
2290 {
2291 protected:
2293 
2294 public:
2296  : NURBSFiniteElement(3, Geometry::CUBE, (p + 1)*(p + 1)*(p + 1), p,
2297  FunctionSpace::Qk), u(Dof),
2298  shape_x(p + 1), shape_y(p + 1), shape_z(p + 1),
2299  dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1) { }
2300 
2301  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2302  virtual void CalcDShape(const IntegrationPoint &ip,
2303  DenseMatrix &dshape) const;
2304 };
2305 
2306 } // namespace mfem
2307 
2308 #endif
Abstract class for Finite Elements.
Definition: fe.hpp:46
RefinedLinear3DFiniteElement()
Construct a quadratic FE on tetrahedron.
Definition: fe.cpp:4186
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.hpp:1315
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:1303
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:8201
DenseMatrix curlshape_J
Definition: fe.hpp:401
const Array< int > & GetDofMap() const
Definition: fe.hpp:1534
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:5985
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:1920
int GetDim() const
Returns the reference space dimension for the finite element.
Definition: fe.hpp:115
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:7101
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.cpp:2827
L2_SegmentElement(const int p, const int type=Quadrature1D::GaussLegendre)
Definition: fe.cpp:8075
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.hpp:1287
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:3764
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:1051
static void CalcBernstein(const int p, const double x, double *u, double *d)
Definition: fe.hpp:1446
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:1886
Class for an integration rule - an Array of IntegrationPoint.
Definition: intrules.hpp:83
Linear 1D element with nodes 1/3 and 2/3 (trace of RT1)
Definition: fe.hpp:1025
Quadratic 1D element with nodes the Gaussian points in [0,1] (trace of RT2)
Definition: fe.hpp:1035
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8596
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:10914
Linear3DFiniteElement()
Construct a linear FE on tetrahedron.
Definition: fe.cpp:2226
static double CalcDelta(const int p, const double x)
Definition: fe.hpp:1428
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.cpp:3009
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.hpp:1950
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2000
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8353
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.cpp:9770
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.cpp:38
RefinedBiLinear2DFiniteElement()
Construct a biquadratic FE on quadrilateral.
Definition: fe.cpp:4418
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:1621
L2Pos_TriangleElement(const int p)
Definition: fe.cpp:8740
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:2103
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.hpp:880
H1Pos_SegmentElement(const int p)
Definition: fe.cpp:7039
int GetPatch() const
Definition: fe.hpp:2250
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2010
virtual void ProjectDiv(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &div) const
Definition: fe.cpp:156
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:772
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
Definition: fe.cpp:5030
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:115
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:683
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:2464
void CalcPhysDivShape(ElementTransformation &Trans, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in physical space at the po...
Definition: fe.cpp:59
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:2243
const double * OpenPoints(const int p, const int type=Quadrature1D::GaussLegendre)
Definition: fe.hpp:1389
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8779
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2147
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.cpp:2781
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:3061
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:1417
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:7081
FiniteElement(D, G, Do, O, F)
int GetDerivMapType() const
Definition: fe.hpp:137
L2Pos_TetrahedronElement(const int p)
Definition: fe.cpp:8934
Array< KnotVector * > kv
Definition: fe.hpp:2233
void CalcVShape_RT(ElementTransformation &Trans, DenseMatrix &shape) const
Definition: fe.cpp:508
L2_TriangleElement(const int p, const int type=Quadrature1D::GaussLegendre)
Definition: fe.cpp:8615
void SetSize(int s)
Resize the vector to size s.
Definition: vector.hpp:310
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.cpp:9152
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.cpp:5092
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:3551
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:972
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:237
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:1441
void LocalInterpolation_ND(const double *tk, const Array< int > &d2t, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.cpp:801
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Definition: fe.cpp:1799
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:1971
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:1710
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.cpp:2546
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
evaluate derivatives of shape function - constant 0
Definition: fe.cpp:2197
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.hpp:1235
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.hpp:2036
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:861
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:6601
H1Pos_TetrahedronElement(const int p)
Definition: fe.cpp:7823
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:10862
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:8220
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:1870
LagrangeHexFiniteElement(int degree)
Definition: fe.cpp:3816
int GetOrder() const
Returns the order of the finite element.
Definition: fe.hpp:124
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.cpp:2559
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:3672
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:3978
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.hpp:2087
Data type dense matrix using column-major storage.
Definition: densemat.hpp:22
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:3626
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.cpp:319
void Reset() const
Definition: fe.hpp:2248
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:1959
Polynomials of order k.
Definition: fe.hpp:34
Class for quadratic FE on triangle.
Definition: fe.hpp:609
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:10876
PositiveFiniteElement(int D, int G, int Do, int O, int F=FunctionSpace::Pk)
Definition: fe.hpp:366
Class for quadratic FE on interval.
Definition: fe.hpp:580
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.hpp:1865
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.cpp:9626
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.cpp:5258
void ProjectCurl_ND(const double *tk, const Array< int > &d2t, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.cpp:625
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:2212
int Space() const
Returns the type of space on each element.
Definition: fe.hpp:127
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:1870
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.cpp:109
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:1923
RefinedTriLinear3DFiniteElement()
Construct a biquadratic FE on quadrilateral.
Definition: fe.cpp:4565
DenseMatrix vshape
Definition: fe.hpp:57
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:3803
Quadratic3DFiniteElement()
Construct a quadratic FE on tetrahedron.
Definition: fe.cpp:2282
int GetMapType() const
Definition: fe.hpp:133
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:8093
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.cpp:5608
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.cpp:5795
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.cpp:2658
const Array< int > & GetDofMap() const
Definition: fe.hpp:1512
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8899
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2063
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:1922
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:8964
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:2489
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:2481
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:8155
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:6689
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:1085
void ProjectCurl_RT(const double *nk, const Array< int > &d2n, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.cpp:663
H1Pos_HexahedronElement(const int p)
Definition: fe.cpp:7211
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.cpp:140
static void CalcShape(const int p, const double x, const double y, const double z, double *shape)
Definition: fe.cpp:7925
H1_SegmentElement(const int p, const int type=Quadrature1D::GaussLobatto)
Definition: fe.cpp:6539
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:8841
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Definition: fe.cpp:933
H1_TetrahedronElement(const int p, const int type=Quadrature1D::GaussLobatto)
Definition: fe.cpp:7508
int GetElement() const
Definition: fe.hpp:2252
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:7183
Linear2DFiniteElement()
Construct a linear FE on triangle.
Definition: fe.cpp:875
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:1874
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:2339
Class for refined bi-linear FE on quadrilateral.
Definition: fe.hpp:1164
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.cpp:5930
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:4754
L2_QuadrilateralElement(const int p, const int _type=Quadrature1D::GaussLegendre)
Definition: fe.cpp:8179
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.cpp:10758
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:842
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:1942
void CalcPhysCurlShape(ElementTransformation &Trans, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in physical space at the point de...
Definition: fe.cpp:73
L2Pos_HexahedronElement(const int p)
Definition: fe.cpp:8523
ND_TriangleElement(const int p)
Definition: fe.cpp:10677
RT_QuadrilateralElement(const int p, const int cp_type=Quadrature1D::GaussLobatto, const int op_type=Quadrature1D::GaussLegendre)
Definition: fe.cpp:8991
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:1788
const double * GetPoints(const int p, const int type)
Get the coordinates of the points of the given Quadrature1D type.
Definition: fe.cpp:6468
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.cpp:9806
Implements CalcDivShape methods.
Definition: fe.hpp:101
static void CalcDShape(const int p, const double x, const double y, const double z, double *dshape_1d, double *dshape)
Definition: fe.cpp:7958
static void CalcBasis(const int p, const double x, double *u)
Definition: fe.hpp:1412
H1_HexahedronElement(const int p, const int type=Quadrature1D::GaussLobatto)
Definition: fe.cpp:6779
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.hpp:907
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
evaluate shape function - constant 1
Definition: fe.cpp:2191
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Definition: fe.cpp:1970
static void CalcBinomTerms(const int p, const double x, const double y, double *u)
Compute the terms in the expansion of the binomial (x + y)^p.
Definition: fe.cpp:6303
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Definition: fe.cpp:103
H1Pos_TriangleElement(const int p)
Definition: fe.cpp:7678
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.cpp:3263
void SetMapType(int M)
Definition: fe.hpp:303
static int VerifyOpen(int pt_type)
Definition: fe.hpp:287
Cubic3DFiniteElement()
Construct a cubic FE on tetrahedron.
Definition: fe.cpp:2017
Linear1DFiniteElement()
Construct a linear FE on interval.
Definition: fe.cpp:854
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:4127
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.cpp:5918
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.cpp:1490
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.cpp:148
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:1108
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:1916
static void CalcShape(const int p, const double x, const double y, double *shape)
Definition: fe.cpp:7733
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:2512
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:2110
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:3569
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:575
int Dof
Number of degrees of freedom.
Definition: fe.hpp:49
Class for bilinear FE on quad with nodes at the 4 Gaussian points.
Definition: fe.hpp:555
Class for refined linear FE on interval.
Definition: fe.hpp:1111
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:8099
Class for refined linear FE on triangle.
Definition: fe.hpp:1131
Class for refined linear FE on tetrahedron.
Definition: fe.hpp:1151
void SetPatch(int p) const
Definition: fe.hpp:2251
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:1068
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:1079
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:1327
Class for constant FE on triangle.
Definition: fe.hpp:748
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:2223
RefinedLinear1DFiniteElement()
Construct a quadratic FE on interval.
Definition: fe.cpp:4016
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:6954
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:7204
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:1594
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:8682
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:7456
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:1926
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:4043
VectorFiniteElement(int D, int G, int Do, int O, int M, int F=FunctionSpace::Pk)
Definition: fe.hpp:455
void LocalInterpolation_RT(const double *nk, const Array< int > &d2n, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.cpp:767
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.cpp:3202
static void ChebyshevPoints(const int p, double *x)
Definition: fe.cpp:6271
NURBSFiniteElement(int D, int G, int Do, int O, int F)
Definition: fe.hpp:2238
Implements CalcDShape methods.
Definition: fe.hpp:100
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:6055
const Array< int > & GetDofMap() const
Definition: fe.hpp:1492
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:3788
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.cpp:5896
Class for refined trilinear FE on a hexahedron.
Definition: fe.hpp:1184
ND_TetrahedronElement(const int p)
Definition: fe.cpp:10415
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:8768
int DerivMapType
Definition: fe.hpp:49
Class for quadratic FE on tetrahedron.
Definition: fe.hpp:803
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const =0
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
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.hpp:2126
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:848
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.hpp:1995
For scalar fields; preserves point values.
Definition: fe.hpp:84
int GeomType
Geometry::Type of the reference element.
Definition: fe.hpp:49
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:1885
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2131
const IntegrationRule & GetNodes() const
Definition: fe.hpp:166
For scalar fields; preserves volume integrals.
Definition: fe.hpp:85
Refined tensor products of polynomials of order k.
Definition: fe.hpp:36
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:5145
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:1149
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8438
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:2317
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:1881
L2Pos_QuadrilateralElement(const int p)
Definition: fe.cpp:8289
P0SegmentFiniteElement(int Ord=0)
Definition: fe.cpp:2452
static void CalcDShape(const int p, const double x, const double y, double *dshape_1d, double *dshape)
Definition: fe.cpp:7759
int GetDerivRangeType() const
Definition: fe.hpp:131
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.cpp:2804
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:10949
Implements CalcCurlShape methods.
Definition: fe.hpp:102
DenseMatrix curlshape
Definition: fe.hpp:401
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2135
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.hpp:987
Class for linear FE on tetrahedron.
Definition: fe.hpp:778
Class for linear FE on interval.
Definition: fe.hpp:478
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.cpp:9366
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.cpp:5196
void CalcPhysDShape(ElementTransformation &Trans, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in physical space at the poi...
Definition: fe.cpp:174
Crouzeix-Raviart finite element on quadrilateral.
Definition: fe.hpp:851
Class for linear FE on triangle.
Definition: fe.hpp:498
Class for quadratic FE on triangle with nodes at the &quot;Gaussian&quot; points.
Definition: fe.hpp:633
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:8660
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.cpp:9105
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2175
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:1749
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.cpp:3461
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2092
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:924
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:2252
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.cpp:9440
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:7619
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Definition: fe.cpp:1173
void SetElement(int e) const
Definition: fe.hpp:2253
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:1251
void ProjectGrad_ND(const double *tk, const Array< int > &d2t, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.cpp:746
ScalarFiniteElement(int D, int G, int Do, int O, int F=FunctionSpace::Pk)
Definition: fe.hpp:299
void CalcPhysVShape(ElementTransformation &Trans, DenseMatrix &shape) const
Equivalent to the CalcVShape() method with the same arguments.
Definition: fe.hpp:188
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:8762
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2007
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.hpp:934
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:1714
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:10973
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:1265
int GetGeomType() const
Returns the Geometry::Type of the reference element.
Definition: fe.hpp:118
DenseMatrix m_dshape
Definition: fe.hpp:1617
int Dim
Dimension of reference space.
Definition: fe.hpp:49
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
Definition: fe.cpp:10361
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:8314
IntegrationRule Nodes
Definition: fe.hpp:55
const Array< int > & GetDofMap() const
Definition: fe.hpp:1572
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2219
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:1135
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:8551
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:7061
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:7382
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:3513
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
Definition: fe.cpp:10792
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.cpp:2673
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:4441
static int CheckClosed(int type)
If the Quadrature1D type is not closed return Invalid; otherwise return type.
Definition: intrules.cpp:799
virtual ~FiniteElement()
Definition: fe.hpp:278
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.cpp:2570
const Array< int > & GetDofMap() const
Definition: fe.hpp:1553
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Overrides the scalar CalcShape function to print an error.
Definition: fe.hpp:2203
void CalcVShape_ND(ElementTransformation &Trans, DenseMatrix &shape) const
Definition: fe.cpp:520
DenseMatrix Jinv
Definition: fe.hpp:400
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.hpp:1259
No derivatives implemented.
Definition: fe.hpp:99
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2216
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8110
int GetDof() const
Returns the number of degrees of freedom in the finite element.
Definition: fe.hpp:121
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:7644
Class for bi-quadratic FE on quadrilateral.
Definition: fe.hpp:649
Class for tri-linear FE on cube.
Definition: fe.hpp:816
Base class Coefficient that may optionally depend on time.
Definition: coefficient.hpp:31
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:1019
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:1074
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
Definition: fe.cpp:5226
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:8957
void CalcPhysShape(ElementTransformation &Trans, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in physical space at the point ...
Definition: fe.cpp:164
Basis & OpenBasis(const int p, const int type=Quadrature1D::GaussLegendre)
Definition: fe.hpp:1403
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:846
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:886
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:4611
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:4308
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:760
static const int * Binom(const int p)
Get a poiner to an array containing the binomial coefficients &quot;p choose k&quot; for k=0,...,p for the given p.
Definition: fe.cpp:6254
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.cpp:3363
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.cpp:52
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:954
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:1877
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.hpp:1213
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:8866
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.cpp:10070
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:2737
FiniteElement(int D, int G, int Do, int O, int F=FunctionSpace::Pk)
Definition: fe.cpp:24
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:1376
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:2397
Class for bilinear FE on quadrilateral.
Definition: fe.hpp:520
static int CheckOpen(int type)
If the Quadrature1D type is not open return Invalid; otherwise return type.
Definition: intrules.cpp:811
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:371
ND_HexahedronElement(const int p, const int cp_type=Quadrature1D::GaussLobatto, const int op_type=Quadrature1D::GaussLegendre)
Definition: fe.cpp:9852
Quad1DFiniteElement()
Construct a quadratic FE on interval.
Definition: fe.cpp:1060
RT_HexahedronElement(const int p, const int cp_type=Quadrature1D::GaussLobatto, const int op_type=Quadrature1D::GaussLegendre)
Definition: fe.cpp:9202
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.hpp:2207
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:7337
virtual void GetFaceDofs(int face, int **dofs, int *ndofs) const
Definition: fe.cpp:98
Class for linear FE on triangle with nodes at the 3 &quot;Gaussian&quot; points.
Definition: fe.hpp:544
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:1008
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2043
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.hpp:1008
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:915
Basis & ClosedBasis(const int p, const int type=Quadrature1D::GaussLobatto)
Definition: fe.hpp:1406
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
Definition: fe.cpp:66
H1Pos_QuadrilateralElement(const int p)
Definition: fe.cpp:7108
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2179
Array< KnotVector * > & KnotVectors() const
Definition: fe.hpp:2254
Class for integration point with weight.
Definition: intrules.hpp:25
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:868
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8711
Basis & GetBasis(const int p, const int type)
Get a Poly_1D::Basis object of the given degree and Quadrature1D type.
Definition: fe.cpp:6489
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:7358
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:8161
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:335
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:2218
Bi-quadratic element on quad with nodes at the 9 Gaussian points.
Definition: fe.hpp:688
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.hpp:961
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:8572
void Project_RT(const double *nk, const Array< int > &d2n, VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:531
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:6909
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:1043
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.cpp:3177
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.cpp:10563
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.cpp:2937
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.cpp:10312
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:515
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:2186
virtual void ProjectDiv(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &div) const
Definition: fe.cpp:348
static int VerifyClosed(int pt_type)
Definition: fe.hpp:280
int DerivRangeType
Definition: fe.hpp:49
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.cpp:2685
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8172
RefinedLinear2DFiniteElement()
Construct a quadratic FE on triangle.
Definition: fe.cpp:4062
void NodalLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I, const NodalFiniteElement &fine_fe) const
Definition: fe.cpp:185
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:5850
void ProjectCurl_2D(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.cpp:218
void SetIJK(int *IJK) const
Definition: fe.hpp:2249
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2096
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:2058
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:4024
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:3752
Array< int > dof_map
Definition: fe.hpp:1619
RT_TetrahedronElement(const int p)
Definition: fe.cpp:9668
ND_QuadrilateralElement(const int p, const int cp_type=Quadrature1D::GaussLobatto, const int op_type=Quadrature1D::GaussLegendre)
Definition: fe.cpp:10223
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.cpp:5406
L2_TetrahedronElement(const int p, const int type=Quadrature1D::GaussLegendre)
Definition: fe.cpp:8791
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:3957
Vector & Weights() const
Definition: fe.hpp:2255
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:6582
BiQuad2DFiniteElement()
Construct a biquadratic FE on quadrilateral.
Definition: fe.cpp:1280
virtual void GetFaceDofs(int face, int **dofs, int *ndofs) const
Definition: fe.cpp:2272
Tensor products of 1D FEs (only degree 2 is functional)
Definition: fe.hpp:1090
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.cpp:2974
P0TriangleFiniteElement()
Construct P0 triangle finite element.
Definition: fe.cpp:2184
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2182
const double * ClosedPoints(const int p, const int type=Quadrature1D::GaussLobatto)
Definition: fe.hpp:1392
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:2458
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:1962
RT_TriangleElement(const int p)
Definition: fe.cpp:9515
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:6563
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.cpp:10853
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2049
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
Definition: fe.cpp:10144
void Eval(const double x, Vector &u) const
Definition: fe.cpp:6140
L2Pos_SegmentElement(const int p)
Definition: fe.cpp:8134
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:4221
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:5461
Class for cubic FE on tetrahedron.
Definition: fe.hpp:735
Vector data type.
Definition: vector.hpp:36
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.cpp:5392
static void CalcBernstein(const int p, const double x, double *u)
Definition: fe.hpp:1444
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2053
int GetDerivType() const
Definition: fe.hpp:135
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:7163
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:8414
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:1201
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.cpp:9593
Quad2DFiniteElement()
Construct a quadratic FE on triangle.
Definition: fe.cpp:1118
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2099
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2004
Describes the space on each element.
Definition: fe.hpp:29
H1_QuadrilateralElement(const int p, const int type=Quadrature1D::GaussLobatto)
Definition: fe.cpp:6629
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:2413
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2212
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:5311
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:8333
void PositiveLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I, const PositiveFiniteElement &fine_fe) const
Definition: fe.cpp:379
virtual void CalcCurlShape(const IntegrationPoint &ip, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in reference space at the given p...
Definition: fe.cpp:10605
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:3809
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:1519
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:894
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:2082
NodalFiniteElement(int D, int G, int Do, int O, int F=FunctionSpace::Pk)
Definition: fe.hpp:328
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:2523
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:6730
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:834
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.cpp:5362
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:3581
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:539
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:4492
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const =0
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:10895
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:1955
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:2142
void Project_ND(const double *tk, const Array< int > &d2t, VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:682
int GetRangeType() const
Definition: fe.hpp:129
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:997
int Order
Order/degree of the shape functions.
Definition: fe.hpp:49
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:2879
H1_TriangleElement(const int p, const int type=Quadrature1D::GaussLobatto)
Definition: fe.cpp:7389
static void CalcBasis(const int p, const double x, double *u, double *d)
Definition: fe.hpp:1421
A Class that defines 1-D numerical quadrature rules on [0,1].
Definition: intrules.hpp:235
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2138
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:3782
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:6930
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:1966
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:6708
Basis(const int p, const double *nodes, const int _mode=1)
Definition: fe.cpp:6090
static void CalcDBinomTerms(const int p, const double x, const double y, double *d)
Definition: fe.cpp:6367
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.cpp:4975
Tensor products of polynomials of order k.
Definition: fe.hpp:35
TriLinear3DFiniteElement()
Construct a tri-linear FE on cube.
Definition: fe.cpp:2361
ND_SegmentElement(const int p, const int op_type=Quadrature1D::GaussLegendre)
Definition: fe.cpp:10837
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:127
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:1098
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:8393
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.hpp:1911
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:4079
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:3542
BiLinear2DFiniteElement()
Construct a bilinear FE on quadrilateral.
Definition: fe.cpp:902
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.hpp:2170
L2_HexahedronElement(const int p, const int _type=Quadrature1D::GaussLegendre)
Definition: fe.cpp:8368
Poly_1D poly1d
Definition: fe.cpp:6535
Crouzeix-Raviart finite element on triangle.
Definition: fe.hpp:839
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
Definition: fe.cpp:6038
Lagrange1DFiniteElement(int degree)
Definition: fe.cpp:3594
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:2622
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.cpp:5731
const Array< int > & GetDofMap() const
Definition: fe.hpp:1471
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8975
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8240
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:964
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:796
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:7478
void ProjectGrad_RT(const double *nk, const Array< int > &d2n, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.cpp:598
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:419