MFEM  v3.4 Finite element discretization library
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
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 /// Possible basis types. Note that not all elements can use all BasisType(s).
27 class BasisType
28 {
29 public:
30  enum
31  {
32  Invalid = -1,
33  GaussLegendre = 0, ///< Open type
34  GaussLobatto = 1, ///< Closed type
35  Positive = 2, ///< Bernstein polynomials
36  OpenUniform = 3, ///< Nodes: x_i = (i+1)/(n+1), i=0,...,n-1
37  ClosedUniform = 4, ///< Nodes: x_i = i/(n-1), i=0,...,n-1
38  OpenHalfUniform = 5, ///< Nodes: x_i = (i+1/2)/n, i=0,...,n-1
39  NumBasisTypes = 6 /**< Keep track of maximum types to prevent
40  hard-coding */
41  };
42  /** @brief If the input does not represents a valid BasisType, abort with an
43  error; otherwise return the input. */
44  static int Check(int b_type)
45  {
46  MFEM_VERIFY(0 <= b_type && b_type < NumBasisTypes,
47  "unknown BasisType: " << b_type);
48  return b_type;
49  }
50  /** @brief If the input does not represents a valid nodal BasisType, abort
51  with an error; otherwise return the input. */
52  static int CheckNodal(int b_type)
53  {
54  MFEM_VERIFY(Check(b_type) != Positive,
55  "invalid nodal BasisType: " << Name(b_type));
56  return b_type;
57  }
58  /** @brief Get the corresponding Quadrature1D constant, when that makes
59  sense; otherwise return Quadrature1D::Invalid. */
61  {
62  switch (b_type)
63  {
66  case Positive: return Quadrature1D::ClosedUniform; // <-----
70  }
72  }
73  /// Return the nodal BasisType corresponding to the Quadrature1D type.
74  static int GetNodalBasis(int qpt_type)
75  {
76  switch (qpt_type)
77  {
83  }
84  return Invalid;
85  }
86  /// Check and convert a BasisType constant to a string identifier.
87  static const char *Name(int b_type)
88  {
89  static const char *name[] =
90  {
91  "Gauss-Legendre", "Gauss-Lobatto", "Positive (Bernstein)",
92  "Open uniform", "Closed uniform", "Open half uniform"
93  };
94  return name[Check(b_type)];
95  }
96  /// Check and convert a BasisType constant to a char basis identifier.
97  static char GetChar(int b_type)
98  {
99  static const char ident[] = { 'g', 'G', 'P', 'u', 'U', 'o' };
100  return ident[Check(b_type)];
101  }
102  /// Convert char basis identifier to a BasisType constant.
103  static int GetType(char b_ident)
104  {
105  switch (b_ident)
106  {
107  case 'g': return GaussLegendre;
108  case 'G': return GaussLobatto;
109  case 'P': return Positive;
110  case 'u': return OpenUniform;
111  case 'U': return ClosedUniform;
112  case 'o': return OpenHalfUniform;
113  }
114  MFEM_ABORT("unknown BasisType identifier");
115  return -1;
116  }
117 };
118
119 // Base and derived classes for finite elements
120
121 /// Describes the space on each element
123 {
124 public:
125  enum
126  {
127  Pk, ///< Polynomials of order k
128  Qk, ///< Tensor products of polynomials of order k
129  rQk ///< Refined tensor products of polynomials of order k
130  };
131 };
132
133 class ElementTransformation;
134 class Coefficient;
135 class VectorCoefficient;
136 class MatrixCoefficient;
137 class KnotVector;
138
139 /// Abstract class for Finite Elements
141 {
142 protected:
143  int Dim, ///< Dimension of reference space
144  GeomType, ///< Geometry::Type of the reference element
147  mutable
148  int Dof, ///< Number of degrees of freedom
149  Order; ///< Order/degree of the shape functions
150  mutable int Orders[Geometry::MaxDim]; ///< Anisotropic orders
153  mutable DenseMatrix vshape; // Dof x Dim
154 #endif
155
156 public:
157  /// Enumeration for RangeType and DerivRangeType
158  enum { SCALAR, VECTOR };
159
160  /** @brief Enumeration for MapType: defines how reference functions are
161  mapped to physical space.
162
163  A reference function, uh(xh), can be mapped to a function, u(x), on a
164  general physical element in following ways:
165
166  VALUE u(x) = uh(xh)
167  INTEGRAL u(x) = (1/w) * uh(xh)
168  H_DIV u(x) = (J/w) * uh(xh)
169  H_CURL u(x) = J^{-t} * uh(xh) (square J)
170  H_CURL u(x) = J*(J^t*J)^{-1} * uh(xh) (general J)
171
172  where
173
174  x = T(xh) is the image of the reference point xh ("x hat"),
175  J = J(xh) is the Jacobian matrix of the transformation T, and
176  w = w(xh) = / det(J), for square J,
177  \ det(J^t*J)^{1/2}, for general J,
178  is the transformation weight factor.
179  */
180  enum { VALUE, ///< For scalar fields; preserves point values
181  INTEGRAL, ///< For scalar fields; preserves volume integrals
182  H_DIV, /**< For vector fields; preserves surface integrals of the
183  normal component */
184  H_CURL /**< For vector fields; preserves line integrals of the
185  tangential component */
186  };
187
188  /** @brief Enumeration for DerivType: defines which derivative method
189  is implemented.
190
191  Each FiniteElement class implements only one type of derivative. The
192  value returned by GetDerivType() indicates which derivative method is
193  implemented.
194  */
195  enum { NONE, ///< No derivatives implemented
196  GRAD, ///< Implements CalcDShape methods
197  DIV, ///< Implements CalcDivShape methods
198  CURL ///< Implements CalcCurlShape methods
199  };
200
201  /** Construct FiniteElement with given
202  @param D Reference space dimension
203  @param G Geometry type (of type Geometry::Type)
204  @param Do Number of degrees of freedom in the FiniteElement
205  @param O Order/degree of the FiniteElement
206  @param F FunctionSpace type of the FiniteElement
207  */
208  FiniteElement(int D, int G, int Do, int O, int F = FunctionSpace::Pk);
209
210  /// Returns the reference space dimension for the finite element
211  int GetDim() const { return Dim; }
212
213  /// Returns the Geometry::Type of the reference element
214  int GetGeomType() const { return GeomType; }
215
216  /// Returns the number of degrees of freedom in the finite element
217  int GetDof() const { return Dof; }
218
219  /** @brief Returns the order of the finite element. In the case of
220  anisotropic orders, returns the maximum order. */
221  int GetOrder() const { return Order; }
222
223  /** @brief Returns true if the FiniteElement basis *may be using* different
224  orders/degrees in different spatial directions. */
225  bool HasAnisotropicOrders() const { return Orders[0] != -1; }
226
227  /// Returns an array containing the anisotropic orders/degrees.
228  const int *GetAnisotropicOrders() const { return Orders; }
229
230  /// Returns the type of space on each element
231  int Space() const { return FuncSpace; }
232
233  int GetRangeType() const { return RangeType; }
234
235  int GetDerivRangeType() const { return DerivRangeType; }
236
237  int GetMapType() const { return MapType; }
238
239  int GetDerivType() const { return DerivType; }
240
241  int GetDerivMapType() const { return DerivMapType; }
242
243  /** @brief Evaluate the values of all shape functions of a scalar finite
244  element in reference space at the given point @a ip. */
245  /** The size (#Dof) of the result Vector @a shape must be set in advance. */
246  virtual void CalcShape(const IntegrationPoint &ip,
247  Vector &shape) const = 0;
248
249  /** @brief Evaluate the values of all shape functions of a scalar finite
250  element in physical space at the point described by @a Trans. */
251  /** The size (#Dof) of the result Vector @a shape must be set in advance. */
252  void CalcPhysShape(ElementTransformation &Trans, Vector &shape) const;
253
254  /** @brief Evaluate the gradients of all shape functions of a scalar finite
255  element in reference space at the given point @a ip. */
256  /** Each row of the result DenseMatrix @a dshape contains the derivatives of
257  one shape function. The size (#Dof x #Dim) of @a dshape must be set in
259  virtual void CalcDShape(const IntegrationPoint &ip,
260  DenseMatrix &dshape) const = 0;
261
262  /** @brief Evaluate the gradients of all shape functions of a scalar finite
263  element in physical space at the point described by @a Trans. */
264  /** Each row of the result DenseMatrix @a dshape contains the derivatives of
265  one shape function. The size (#Dof x SDim) of @a dshape must be set in
266  advance, where SDim >= #Dim is the physical space dimension as described
267  by @a Trans. */
269
270  const IntegrationRule & GetNodes() const { return Nodes; }
271
272  // virtual functions for finite elements on vector spaces
273
274  /** @brief Evaluate the values of all shape functions of a *vector* finite
275  element in reference space at the given point @a ip. */
276  /** Each row of the result DenseMatrix @a shape contains the components of
277  one vector shape function. The size (#Dof x #Dim) of @a shape must be set
279  virtual void CalcVShape(const IntegrationPoint &ip,
280  DenseMatrix &shape) const;
281
282  /** @brief Evaluate the values of all shape functions of a *vector* finite
283  element in physical space at the point described by @a Trans. */
284  /** Each row of the result DenseMatrix @a shape contains the components of
285  one vector shape function. The size (#Dof x SDim) of @a shape must be set
286  in advance, where SDim >= #Dim is the physical space dimension as
287  described by @a Trans. */
288  virtual void CalcVShape(ElementTransformation &Trans,
289  DenseMatrix &shape) const;
290
291  /// Equivalent to the CalcVShape() method with the same arguments.
293  { CalcVShape(Trans, shape); }
294
295  /** @brief Evaluate the divergence of all shape functions of a *vector*
296  finite element in reference space at the given point @a ip. */
297  /** The size (#Dof) of the result Vector @a divshape must be set in advance.
298  */
299  virtual void CalcDivShape(const IntegrationPoint &ip,
300  Vector &divshape) const;
301
302  /** @brief Evaluate the divergence of all shape functions of a *vector*
303  finite element in physical space at the point described by @a Trans. */
304  /** The size (#Dof) of the result Vector @a divshape must be set in advance.
305  */
306  void CalcPhysDivShape(ElementTransformation &Trans, Vector &divshape) const;
307
308  /** @brief Evaluate the curl of all shape functions of a *vector* finite
309  element in reference space at the given point @a ip. */
310  /** Each row of the result DenseMatrix @a curl_shape contains the components
311  of the curl of one vector shape function. The size (#Dof x CDim) of
312  @a curl_shape must be set in advance, where CDim = 3 for #Dim = 3 and
313  CDim = 1 for #Dim = 2. */
314  virtual void CalcCurlShape(const IntegrationPoint &ip,
315  DenseMatrix &curl_shape) const;
316
317  /** @brief Evaluate the curl of all shape functions of a *vector* finite
318  element in physical space at the point described by @a Trans. */
319  /** Each row of the result DenseMatrix @a curl_shape contains the components
320  of the curl of one vector shape function. The size (#Dof x CDim) of
321  @a curl_shape must be set in advance, where CDim = 3 for #Dim = 3 and
322  CDim = 1 for #Dim = 2. */
324  DenseMatrix &curl_shape) const;
325
326  virtual void GetFaceDofs(int face, int **dofs, int *ndofs) const;
327
328  /** each row of h contains the upper triangular part of the hessian
329  of one shape function; the order in 2D is {u_xx, u_xy, u_yy} */
330  virtual void CalcHessian (const IntegrationPoint &ip,
331  DenseMatrix &h) const;
332
333  /** @brief Return the local interpolation matrix @a I (Dof x Dof) where the
334  fine element is the image of the base geometry under the given
335  transformation. */
337  DenseMatrix &I) const;
338
339  /** @brief Return interpolation matrix, @a I, which maps dofs from a coarse
340  element, @a fe, to the fine dofs on @a this finite element. */
341  /** @a Trans represents the mapping from the reference element of @a this
342  element into a subset of the reference space of the element @a fe, thus
343  allowing the "coarse" FiniteElement to be different from the "fine"
344  FiniteElement as when h-refinement is combined with p-refinement or
345  p-derefinement. It is assumed that both finite elements use the same
346  MapType. */
347  virtual void GetTransferMatrix(const FiniteElement &fe,
349  DenseMatrix &I) const;
350
351  /** Given a coefficient and a transformation, compute its projection
352  (approximation) in the local finite dimensional space in terms
353  of the degrees of freedom. */
354  virtual void Project (Coefficient &coeff,
355  ElementTransformation &Trans, Vector &dofs) const;
356
357  /** Given a vector coefficient and a transformation, compute its
358  projection (approximation) in the local finite dimensional space
359  in terms of the degrees of freedom. (VectorFiniteElements) */
360  virtual void Project (VectorCoefficient &vc,
361  ElementTransformation &Trans, Vector &dofs) const;
362
363  /** Given a matrix coefficient and a transformation, compute an approximation
364  ("projection") in the local finite dimensional space in terms of the
365  degrees of freedom. For VectorFiniteElements, the rows of the coefficient
366  are projected in the vector space. */
367  virtual void ProjectMatrixCoefficient(
368  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const;
369
370  /** Compute a representation (up to multiplicative constant) for
371  the delta function at the vertex with the given index. */
372  virtual void ProjectDelta(int vertex, Vector &dofs) const;
373
374  /** Compute the embedding/projection matrix from the given FiniteElement
375  onto 'this' FiniteElement. The ElementTransformation is included to
376  support cases when the projection depends on it. */
377  virtual void Project(const FiniteElement &fe, ElementTransformation &Trans,
378  DenseMatrix &I) const;
379
380  /** Compute the discrete gradient matrix from the given FiniteElement onto
381  'this' FiniteElement. The ElementTransformation is included to support
382  cases when the matrix depends on it. */
383  virtual void ProjectGrad(const FiniteElement &fe,
386
387  /** Compute the discrete curl matrix from the given FiniteElement onto
388  'this' FiniteElement. The ElementTransformation is included to support
389  cases when the matrix depends on it. */
390  virtual void ProjectCurl(const FiniteElement &fe,
392  DenseMatrix &curl) const;
393
394  /** Compute the discrete divergence matrix from the given FiniteElement onto
395  'this' FiniteElement. The ElementTransformation is included to support
396  cases when the matrix depends on it. */
397  virtual void ProjectDiv(const FiniteElement &fe,
399  DenseMatrix &div) const;
400
401  virtual ~FiniteElement () { }
402
403  static bool IsClosedType(int b_type)
404  {
405  const int q_type = BasisType::GetQuadrature1D(b_type);
406  return ((q_type != Quadrature1D::Invalid) &&
408  }
409
410  static bool IsOpenType(int b_type)
411  {
412  const int q_type = BasisType::GetQuadrature1D(b_type);
413  return ((q_type != Quadrature1D::Invalid) &&
415  }
416
417  static int VerifyClosed(int b_type)
418  {
419  MFEM_VERIFY(IsClosedType(b_type),
420  "invalid closed basis type: " << b_type);
421  return b_type;
422  }
423  static int VerifyOpen(int b_type)
424  {
425  MFEM_VERIFY(IsOpenType(b_type), "invalid open basis type: " << b_type);
426  return b_type;
427  }
428  static int VerifyNodal(int b_type)
429  {
430  return BasisType::CheckNodal(b_type);
431  }
432 };
433
435 {
436 protected:
438  mutable Vector c_shape;
439 #endif
440
442  {
443  if (fe.GetRangeType() != SCALAR)
444  { mfem_error("'fe' must be a ScalarFiniteElement"); }
445  return static_cast<const ScalarFiniteElement &>(fe);
446  }
447
448 public:
449  ScalarFiniteElement(int D, int G, int Do, int O, int F = FunctionSpace::Pk)
451  : FiniteElement(D, G, Do, O, F)
453 #else
454  : FiniteElement(D, G, Do, O, F), c_shape(Dof)
456 #endif
457
458  void SetMapType(int M)
459  {
460  MFEM_VERIFY(M == VALUE || M == INTEGRAL, "unknown MapType");
461  MapType = M;
462  DerivType = (M == VALUE) ? GRAD : NONE;
463  }
464
465  /// Nodal interpolation.
467  DenseMatrix &I,
468  const ScalarFiniteElement &fine_fe) const;
469
470  /// "Interpolation" defined through local L2-projection.
471  /** If the "fine" elements cannot represent all basis functions of the
472  "coarse" element, then boundary values from different sub-elements are
473  generally different. */
475  DenseMatrix &I,
476  const ScalarFiniteElement &fine_fe) const;
477 };
478
480 {
481 protected:
482  void ProjectCurl_2D(const FiniteElement &fe,
484  DenseMatrix &curl) const;
485
486 public:
487  NodalFiniteElement(int D, int G, int Do, int O, int F = FunctionSpace::Pk)
488  : ScalarFiniteElement(D, G, Do, O, F) { }
489
491  DenseMatrix &I) const
492  { NodalLocalInterpolation(Trans, I, *this); }
493
494  virtual void GetTransferMatrix(const FiniteElement &fe,
495  ElementTransformation &Trans,
496  DenseMatrix &I) const
497  { CheckScalarFE(fe).NodalLocalInterpolation(Trans, I, *this); }
498
499  virtual void Project (Coefficient &coeff,
500  ElementTransformation &Trans, Vector &dofs) const;
501
502  virtual void Project (VectorCoefficient &vc,
503  ElementTransformation &Trans, Vector &dofs) const;
504
505  // (mc.height x mc.width) @ DOFs -> (Dof x mc.width x mc.height) in dofs
506  virtual void ProjectMatrixCoefficient(
507  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const;
508
509  virtual void Project(const FiniteElement &fe, ElementTransformation &Trans,
510  DenseMatrix &I) const;
511
512  virtual void ProjectGrad(const FiniteElement &fe,
513  ElementTransformation &Trans,
515
516  virtual void ProjectDiv(const FiniteElement &fe,
517  ElementTransformation &Trans,
518  DenseMatrix &div) const;
519 };
520
521
523 {
524 public:
525  PositiveFiniteElement(int D, int G, int Do, int O,
526  int F = FunctionSpace::Pk) :
527  ScalarFiniteElement(D, G, Do, O, F)
528  { }
529
531  DenseMatrix &I) const
532  { ScalarLocalInterpolation(Trans, I, *this); }
533
534  virtual void GetTransferMatrix(const FiniteElement &fe,
536  DenseMatrix &I) const
537  { CheckScalarFE(fe).ScalarLocalInterpolation(Trans, I, *this); }
538
540
541  // Low-order monotone "projection" (actually it is not a projection): the
542  // dofs are set to be the Coefficient values at the nodes.
543  virtual void Project(Coefficient &coeff,
544  ElementTransformation &Trans, Vector &dofs) const;
545
546  virtual void Project(const FiniteElement &fe, ElementTransformation &Trans,
547  DenseMatrix &I) const;
548 };
549
551 {
552  // Hide the scalar functions CalcShape and CalcDShape.
553 private:
554  /// Overrides the scalar CalcShape function to print an error.
555  virtual void CalcShape(const IntegrationPoint &ip,
556  Vector &shape) const;
557
558  /// Overrides the scalar CalcDShape function to print an error.
559  virtual void CalcDShape(const IntegrationPoint &ip,
560  DenseMatrix &dshape) const;
561
562 protected:
564  mutable DenseMatrix J, Jinv;
566 #endif
567  void SetDerivMembers();
568
570  DenseMatrix &shape) const;
571
573  DenseMatrix &shape) const;
574
575  void Project_RT(const double *nk, const Array<int> &d2n,
577  Vector &dofs) const;
578
579  // project the rows of the matrix coefficient in an RT space
581  const double *nk, const Array<int> &d2n,
582  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const;
583
584  void Project_RT(const double *nk, const Array<int> &d2n,
586  DenseMatrix &I) const;
587
588  // rotated gradient in 2D
589  void ProjectGrad_RT(const double *nk, const Array<int> &d2n,
592
593  // Compute the curl as a discrete operator from ND FE (fe) to ND FE (this).
594  // The natural FE for the range is RT, so this is an approximation.
595  void ProjectCurl_ND(const double *tk, const Array<int> &d2t,
597  DenseMatrix &curl) const;
598
599  void ProjectCurl_RT(const double *nk, const Array<int> &d2n,
601  DenseMatrix &curl) const;
602
603  void Project_ND(const double *tk, const Array<int> &d2t,
605  Vector &dofs) const;
606
607  // project the rows of the matrix coefficient in an ND space
609  const double *tk, const Array<int> &d2t,
610  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const;
611
612  void Project_ND(const double *tk, const Array<int> &d2t,
614  DenseMatrix &I) const;
615
616  void ProjectGrad_ND(const double *tk, const Array<int> &d2t,
619
621  const double *nk, const Array<int> &d2n,
623  DenseMatrix &I) const;
624
626  const double *tk, const Array<int> &d2t,
628  DenseMatrix &I) const;
629
631  {
632  if (fe.GetRangeType() != VECTOR)
633  { mfem_error("'fe' must be a VectorFiniteElement"); }
634  return static_cast<const VectorFiniteElement &>(fe);
635  }
636
637 public:
638  VectorFiniteElement (int D, int G, int Do, int O, int M,
639  int F = FunctionSpace::Pk) :
641  FiniteElement(D, G, Do, O, F)
642  { RangeType = VECTOR; MapType = M; SetDerivMembers(); }
643 #else
644  FiniteElement(D, G, Do, O, F), Jinv(D)
645  { RangeType = VECTOR; MapType = M; SetDerivMembers(); }
646 #endif
647 };
648
650 {
651 public:
653
654  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
655
656  virtual void CalcDShape(const IntegrationPoint &ip,
657  DenseMatrix &dshape) const;
658 };
659
660 /// Class for linear FE on interval
662 {
663 public:
664  /// Construct a linear FE on interval
666
667  /** virtual function which evaluates the values of all
668  shape functions at a given point ip and stores
669  them in the vector shape of dimension Dof (2) */
670  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
671
672  /** virtual function which evaluates the derivatives of all
673  shape functions at a given point ip and stores them in
674  the matrix dshape (Dof x Dim) (2 x 1) so that each row
675  contains the derivative of one shape function */
676  virtual void CalcDShape(const IntegrationPoint &ip,
677  DenseMatrix &dshape) const;
678 };
679
680 /// Class for linear FE on triangle
682 {
683 public:
684  /// Construct a linear FE on triangle
686
687  /** virtual function which evaluates the values of all
688  shape functions at a given point ip and stores
689  them in the vector shape of dimension Dof (3) */
690  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
691
692  /** virtual function which evaluates the values of all
693  partial derivatives of all shape functions at a given
694  point ip and stores them in the matrix dshape (Dof x Dim) (3 x 2)
695  so that each row contains the derivatives of one shape function */
696  virtual void CalcDShape(const IntegrationPoint &ip,
697  DenseMatrix &dshape) const;
698  virtual void ProjectDelta(int vertex, Vector &dofs) const
699  { dofs = 0.0; dofs(vertex) = 1.0; }
700 };
701
702 /// Class for bilinear FE on quadrilateral
704 {
705 public:
706  /// Construct a bilinear FE on quadrilateral
708
709  /** virtual function which evaluates the values of all
710  shape functions at a given point ip and stores
711  them in the vector shape of dimension Dof (4) */
712  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
713
714  /** virtual function which evaluates the values of all
715  partial derivatives of all shape functions at a given
716  point ip and stores them in the matrix dshape (Dof x Dim) (4 x 2)
717  so that each row contains the derivatives of one shape function */
718  virtual void CalcDShape(const IntegrationPoint &ip,
719  DenseMatrix &dshape) const;
720  virtual void CalcHessian (const IntegrationPoint &ip,
721  DenseMatrix &h) const;
722  virtual void ProjectDelta(int vertex, Vector &dofs) const
723  { dofs = 0.0; dofs(vertex) = 1.0; } // { dofs = 1.0; }
724 };
725
726 /// Class for linear FE on triangle with nodes at the 3 "Gaussian" points
728 {
729 public:
731  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
732  virtual void CalcDShape(const IntegrationPoint &ip,
733  DenseMatrix &dshape) const;
734  virtual void ProjectDelta(int vertex, Vector &dofs) const;
735 };
736
737 /// Class for bilinear FE on quad with nodes at the 4 Gaussian points
739 {
740 private:
741  static const double p[2];
742
743 public:
745  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
746  virtual void CalcDShape(const IntegrationPoint &ip,
747  DenseMatrix &dshape) const;
748  virtual void ProjectDelta(int vertex, Vector &dofs) const;
749 };
750
752 {
753 public:
755  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
756  virtual void CalcDShape(const IntegrationPoint &ip,
757  DenseMatrix &dshape) const;
758  virtual void ProjectDelta(int vertex, Vector &dofs) const
759  { dofs = 1.0; }
760 };
761
762 /// Class for quadratic FE on interval
764 {
765 public:
766  /// Construct a quadratic FE on interval
768
769  /** virtual function which evaluates the values of all
770  shape functions at a given point ip and stores
771  them in the vector shape of dimension Dof (3) */
772  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
773
774  /** virtual function which evaluates the derivatives of all
775  shape functions at a given point ip and stores them in
776  the matrix dshape (Dof x Dim) (3 x 1) so that each row
777  contains the derivative of one shape function */
778  virtual void CalcDShape(const IntegrationPoint &ip,
779  DenseMatrix &dshape) const;
780 };
781
783 {
784 public:
786  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
787  virtual void CalcDShape(const IntegrationPoint &ip,
788  DenseMatrix &dshape) const;
789 };
790
791 /// Class for quadratic FE on triangle
793 {
794 public:
795  /// Construct a quadratic FE on triangle
797
798  /** virtual function which evaluates the values of all
799  shape functions at a given point ip and stores
800  them in the vector shape of dimension Dof (6) */
801  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
802
803  /** virtual function which evaluates the values of all
804  partial derivatives of all shape functions at a given
805  point ip and stores them in the matrix dshape (Dof x Dim) (6 x 2)
806  so that each row contains the derivatives of one shape function */
807  virtual void CalcDShape(const IntegrationPoint &ip,
808  DenseMatrix &dshape) const;
809
810  virtual void CalcHessian (const IntegrationPoint &ip,
811  DenseMatrix &h) const;
812  virtual void ProjectDelta(int vertex, Vector &dofs) const;
813 };
814
815 /// Class for quadratic FE on triangle with nodes at the "Gaussian" points
817 {
818 private:
819  static const double p[2];
820  DenseMatrix A;
821  mutable DenseMatrix D;
822  mutable Vector pol;
823 public:
825  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
826  virtual void CalcDShape(const IntegrationPoint &ip,
827  DenseMatrix &dshape) const;
828  // virtual void ProjectDelta(int vertex, Vector &dofs) const;
829 };
830
833 {
834 public:
837
838  /** virtual function which evaluates the values of all
839  shape functions at a given point ip and stores
840  them in the vector shape of dimension Dof (9) */
841  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
842
843  /** virtual function which evaluates the values of all
844  partial derivatives of all shape functions at a given
845  point ip and stores them in the matrix dshape (Dof x Dim) (9 x 2)
846  so that each row contains the derivatives of one shape function */
847  virtual void CalcDShape(const IntegrationPoint &ip,
848  DenseMatrix &dshape) const;
849  virtual void ProjectDelta(int vertex, Vector &dofs) const;
850 };
851
853 {
854 public:
856  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
857  virtual void CalcDShape(const IntegrationPoint &ip,
858  DenseMatrix &dshape) const;
860  DenseMatrix &I) const;
862  virtual void Project(Coefficient &coeff, ElementTransformation &Trans,
863  Vector &dofs) const;
864  virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans,
865  Vector &dofs) const;
866  virtual void ProjectDelta(int vertex, Vector &dofs) const
867  { dofs = 0.; dofs(vertex) = 1.; }
868 };
869
870 /// Bi-quadratic element on quad with nodes at the 9 Gaussian points
872 {
873 public:
875  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
876  virtual void CalcDShape(const IntegrationPoint &ip,
877  DenseMatrix &dshape) const;
878  // virtual void ProjectDelta(int vertex, Vector &dofs) const { dofs = 1.; }
879 };
880
882 {
883 public:
885  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
886  virtual void CalcDShape(const IntegrationPoint &ip,
887  DenseMatrix &dshape) const;
888  virtual void CalcHessian (const IntegrationPoint &ip,
889  DenseMatrix &h) const;
890 };
891
893 {
894 public:
896
897  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
898
899  virtual void CalcDShape(const IntegrationPoint &ip,
900  DenseMatrix &dshape) const;
901 };
902
904 {
905 public:
907
908  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
909
910  virtual void CalcDShape(const IntegrationPoint &ip,
911  DenseMatrix &dshape) const;
912
913  virtual void CalcHessian (const IntegrationPoint &ip,
914  DenseMatrix &h) const;
915 };
916
917 /// Class for cubic FE on tetrahedron
919 {
920 public:
921  /// Construct a cubic FE on tetrahedron
923
924  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
925
926  virtual void CalcDShape(const IntegrationPoint &ip,
927  DenseMatrix &dshape) const;
928 };
929
930 /// Class for constant FE on triangle
932 {
933 public:
934  /// Construct P0 triangle finite element
936
937  /// evaluate shape function - constant 1
938  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
939
940  /// evaluate derivatives of shape function - constant 0
941  virtual void CalcDShape(const IntegrationPoint &ip,
942  DenseMatrix &dshape) const;
943  virtual void ProjectDelta(int vertex, Vector &dofs) const
944  { dofs(0) = 1.0; }
945 };
946
947
949 {
950 public:
952  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
953  virtual void CalcDShape(const IntegrationPoint &ip,
954  DenseMatrix &dshape) const;
955  virtual void ProjectDelta(int vertex, Vector &dofs) const
956  { dofs(0) = 1.0; }
957 };
958
959
960 /// Class for linear FE on tetrahedron
962 {
963 public:
964  /// Construct a linear FE on tetrahedron
966
967  /** virtual function which evaluates the values of all
968  shape functions at a given point ip and stores
969  them in the vector shape of dimension Dof (4) */
970  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
971
972  /** virtual function which evaluates the values of all
973  partial derivatives of all shape functions at a given
974  point ip and stores them in the matrix dshape (Dof x Dim) (4 x 3)
975  so that each row contains the derivatives of one shape function */
976  virtual void CalcDShape(const IntegrationPoint &ip,
977  DenseMatrix &dshape) const;
978
979  virtual void ProjectDelta(int vertex, Vector &dofs) const
980  { dofs = 0.0; dofs(vertex) = 1.0; }
981
982  virtual void GetFaceDofs(int face, int **dofs, int *ndofs) const;
983 };
984
985 /// Class for quadratic FE on tetrahedron
987 {
988 public:
989  /// Construct a quadratic FE on tetrahedron
991
992  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
993
994  virtual void CalcDShape(const IntegrationPoint &ip,
995  DenseMatrix &dshape) const;
996 };
997
998 /// Class for tri-linear FE on cube
1000 {
1001 public:
1002  /// Construct a tri-linear FE on cube
1004
1005  /** virtual function which evaluates the values of all
1006  shape functions at a given point ip and stores
1007  them in the vector shape of dimension Dof (8) */
1008  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1009
1010  /** virtual function which evaluates the values of all
1011  partial derivatives of all shape functions at a given
1012  point ip and stores them in the matrix dshape (Dof x Dim) (8 x 3)
1013  so that each row contains the derivatives of one shape function */
1014  virtual void CalcDShape(const IntegrationPoint &ip,
1015  DenseMatrix &dshape) const;
1016
1017  virtual void ProjectDelta(int vertex, Vector &dofs) const
1018  { dofs = 0.0; dofs(vertex) = 1.0; }
1019 };
1020
1021 /// Crouzeix-Raviart finite element on triangle
1023 {
1024 public:
1026  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1027  virtual void CalcDShape(const IntegrationPoint &ip,
1028  DenseMatrix &dshape) const;
1029  virtual void ProjectDelta(int vertex, Vector &dofs) const
1030  { dofs = 1.0; }
1031 };
1032
1033 /// Crouzeix-Raviart finite element on quadrilateral
1035 {
1036 public:
1038  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1039  virtual void CalcDShape(const IntegrationPoint &ip,
1040  DenseMatrix &dshape) const;
1041 };
1042
1044 {
1045 public:
1046  P0SegmentFiniteElement(int Ord = 0);
1047  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1048  virtual void CalcDShape(const IntegrationPoint &ip,
1049  DenseMatrix &dshape) const;
1050 };
1051
1053 {
1054 private:
1055  static const double nk[3][2];
1056
1057 public:
1059
1060  virtual void CalcVShape(const IntegrationPoint &ip,
1061  DenseMatrix &shape) const;
1062
1064  DenseMatrix &shape) const
1065  { CalcVShape_RT(Trans, shape); }
1066
1067  virtual void CalcDivShape(const IntegrationPoint &ip,
1068  Vector &divshape) const;
1069
1071  DenseMatrix &I) const;
1072
1073  using FiniteElement::Project;
1074
1075  virtual void Project (VectorCoefficient &vc,
1076  ElementTransformation &Trans, Vector &dofs) const;
1077 };
1078
1080 {
1081 private:
1082  static const double nk[4][2];
1083
1084 public:
1086
1087  virtual void CalcVShape(const IntegrationPoint &ip,
1088  DenseMatrix &shape) const;
1089
1091  DenseMatrix &shape) const
1092  { CalcVShape_RT(Trans, shape); }
1093
1094  virtual void CalcDivShape(const IntegrationPoint &ip,
1095  Vector &divshape) const;
1096
1098  DenseMatrix &I) const;
1099
1100  using FiniteElement::Project;
1101
1102  virtual void Project (VectorCoefficient &vc,
1103  ElementTransformation &Trans, Vector &dofs) const;
1104 };
1105
1107 {
1108 private:
1109  static const double nk[8][2];
1110
1111 public:
1113
1114  virtual void CalcVShape(const IntegrationPoint &ip,
1115  DenseMatrix &shape) const;
1116
1118  DenseMatrix &shape) const
1119  { CalcVShape_RT(Trans, shape); }
1120
1121  virtual void CalcDivShape(const IntegrationPoint &ip,
1122  Vector &divshape) const;
1123
1125  DenseMatrix &I) const;
1126
1127  using FiniteElement::Project;
1128
1129  virtual void Project (VectorCoefficient &vc,
1130  ElementTransformation &Trans, Vector &dofs) const;
1131 };
1132
1134 {
1135 private:
1136  static const double nk[12][2];
1137
1138 public:
1140
1141  virtual void CalcVShape(const IntegrationPoint &ip,
1142  DenseMatrix &shape) const;
1143
1145  DenseMatrix &shape) const
1146  { CalcVShape_RT(Trans, shape); }
1147
1148  virtual void CalcDivShape(const IntegrationPoint &ip,
1149  Vector &divshape) const;
1150
1152  DenseMatrix &I) const;
1153
1154  using FiniteElement::Project;
1155
1156  virtual void Project (VectorCoefficient &vc,
1157  ElementTransformation &Trans, Vector &dofs) const;
1158 };
1159
1161 {
1162 private:
1163  static const double M[15][15];
1164 public:
1166
1167  virtual void CalcVShape(const IntegrationPoint &ip,
1168  DenseMatrix &shape) const;
1169
1171  DenseMatrix &shape) const
1172  { CalcVShape_RT(Trans, shape); }
1173
1174  virtual void CalcDivShape(const IntegrationPoint &ip,
1175  Vector &divshape) const;
1176 };
1177
1179 {
1180 private:
1181  static const double nk[24][2];
1182  static const double pt[4];
1183  static const double dpt[3];
1184
1185 public:
1187
1188  virtual void CalcVShape(const IntegrationPoint &ip,
1189  DenseMatrix &shape) const;
1190
1192  DenseMatrix &shape) const
1193  { CalcVShape_RT(Trans, shape); }
1194
1195  virtual void CalcDivShape(const IntegrationPoint &ip,
1196  Vector &divshape) const;
1197
1199  DenseMatrix &I) const;
1200
1201  using FiniteElement::Project;
1202
1203  virtual void Project (VectorCoefficient &vc,
1204  ElementTransformation &Trans, Vector &dofs) const;
1205 };
1206
1207 /// Linear 1D element with nodes 1/3 and 2/3 (trace of RT1)
1209 {
1210 public:
1212  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1213  virtual void CalcDShape(const IntegrationPoint &ip,
1214  DenseMatrix &dshape) const;
1215 };
1216
1217 /// Quadratic 1D element with nodes the Gaussian points in [0,1] (trace of RT2)
1219 {
1220 public:
1222  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1223  virtual void CalcDShape(const IntegrationPoint &ip,
1224  DenseMatrix &dshape) const;
1225 };
1226
1228 {
1229 private:
1230  Vector rwk;
1232  mutable Vector rxxk;
1233 #endif
1234 public:
1235  Lagrange1DFiniteElement (int degree);
1236  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1237  virtual void CalcDShape(const IntegrationPoint &ip,
1238  DenseMatrix &dshape) const;
1239 };
1240
1242 {
1243 public:
1245  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1246  virtual void CalcDShape(const IntegrationPoint &ip,
1247  DenseMatrix &dshape) const;
1248 };
1249
1251 {
1252 public:
1253  P0TetFiniteElement ();
1254  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1255  virtual void CalcDShape(const IntegrationPoint &ip,
1256  DenseMatrix &dshape) const;
1257  virtual void ProjectDelta(int vertex, Vector &dofs) const
1258  { dofs(0) = 1.0; }
1259 };
1260
1262 {
1263 public:
1264  P0HexFiniteElement ();
1265  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1266  virtual void CalcDShape(const IntegrationPoint &ip,
1267  DenseMatrix &dshape) const;
1268  virtual void ProjectDelta(int vertex, Vector &dofs) const
1269  { dofs(0) = 1.0; }
1270 };
1271
1272 /// Tensor products of 1D FEs (only degree 2 is functional)
1274 {
1275 private:
1276  Lagrange1DFiniteElement * fe1d;
1277  int dof1d;
1278  int *I, *J, *K;
1280  mutable Vector shape1dx, shape1dy, shape1dz;
1281  mutable DenseMatrix dshape1dx, dshape1dy, dshape1dz;
1282 #endif
1283
1284 public:
1285  LagrangeHexFiniteElement (int degree);
1286  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1287  virtual void CalcDShape(const IntegrationPoint &ip,
1288  DenseMatrix &dshape) const;
1290 };
1291
1292
1293 /// Class for refined linear FE on interval
1295 {
1296 public:
1297  /// Construct a quadratic FE on interval
1299
1300  /** virtual function which evaluates the values of all
1301  shape functions at a given point ip and stores
1302  them in the vector shape of dimension Dof (3) */
1303  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1304
1305  /** virtual function which evaluates the derivatives of all
1306  shape functions at a given point ip and stores them in
1307  the matrix dshape (Dof x Dim) (3 x 1) so that each row
1308  contains the derivative of one shape function */
1309  virtual void CalcDShape(const IntegrationPoint &ip,
1310  DenseMatrix &dshape) const;
1311 };
1312
1313 /// Class for refined linear FE on triangle
1315 {
1316 public:
1317  /// Construct a quadratic FE on triangle
1319
1320  /** virtual function which evaluates the values of all
1321  shape functions at a given point ip and stores
1322  them in the vector shape of dimension Dof (6) */
1323  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1324
1325  /** virtual function which evaluates the values of all
1326  partial derivatives of all shape functions at a given
1327  point ip and stores them in the matrix dshape (Dof x Dim) (6 x 2)
1328  so that each row contains the derivatives of one shape function */
1329  virtual void CalcDShape(const IntegrationPoint &ip,
1330  DenseMatrix &dshape) const;
1331 };
1332
1333 /// Class for refined linear FE on tetrahedron
1335 {
1336 public:
1337  /// Construct a quadratic FE on tetrahedron
1339
1340  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1341
1342  virtual void CalcDShape(const IntegrationPoint &ip,
1343  DenseMatrix &dshape) const;
1344 };
1345
1346 /// Class for refined bi-linear FE on quadrilateral
1348 {
1349 public:
1352
1353  /** virtual function which evaluates the values of all
1354  shape functions at a given point ip and stores
1355  them in the vector shape of dimension Dof (9) */
1356  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1357
1358  /** virtual function which evaluates the values of all
1359  partial derivatives of all shape functions at a given
1360  point ip and stores them in the matrix dshape (Dof x Dim) (9 x 2)
1361  so that each row contains the derivatives of one shape function */
1362  virtual void CalcDShape(const IntegrationPoint &ip,
1363  DenseMatrix &dshape) const;
1364 };
1365
1366 /// Class for refined trilinear FE on a hexahedron
1368 {
1369 public:
1372
1373  /** virtual function which evaluates the values of all
1374  shape functions at a given point ip and stores
1375  them in the vector shape of dimension Dof (9) */
1376  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1377
1378  /** virtual function which evaluates the values of all
1379  partial derivatives of all shape functions at a given
1380  point ip and stores them in the matrix dshape (Dof x Dim) (9 x 2)
1381  so that each row contains the derivatives of one shape function */
1382  virtual void CalcDShape(const IntegrationPoint &ip,
1383  DenseMatrix &dshape) const;
1384 };
1385
1386
1388 {
1389 private:
1390  static const double tk[12][3];
1391
1392 public:
1394  virtual void CalcVShape(const IntegrationPoint &ip,
1395  DenseMatrix &shape) const;
1397  DenseMatrix &shape) const
1398  { CalcVShape_ND(Trans, shape); }
1399  virtual void CalcCurlShape(const IntegrationPoint &ip,
1400  DenseMatrix &curl_shape) const;
1402  DenseMatrix &I) const;
1403  using FiniteElement::Project;
1404  virtual void Project (VectorCoefficient &vc,
1405  ElementTransformation &Trans, Vector &dofs) const;
1406 };
1407
1408
1410 {
1411 private:
1412  static const double tk[6][3];
1413
1414 public:
1416  virtual void CalcVShape(const IntegrationPoint &ip,
1417  DenseMatrix &shape) const;
1419  DenseMatrix &shape) const
1420  { CalcVShape_ND(Trans, shape); }
1421  virtual void CalcCurlShape(const IntegrationPoint &ip,
1422  DenseMatrix &curl_shape) const;
1424  DenseMatrix &I) const;
1425  using FiniteElement::Project;
1426  virtual void Project (VectorCoefficient &vc,
1427  ElementTransformation &Trans, Vector &dofs) const;
1428 };
1429
1430
1432 {
1433 private:
1434  static const double nk[6][3];
1435
1436 public:
1438
1439  virtual void CalcVShape(const IntegrationPoint &ip,
1440  DenseMatrix &shape) const;
1441
1443  DenseMatrix &shape) const
1444  { CalcVShape_RT(Trans, shape); }
1445
1446  virtual void CalcDivShape(const IntegrationPoint &ip,
1447  Vector &divshape) const;
1448
1450  DenseMatrix &I) const;
1451
1452  using FiniteElement::Project;
1453
1454  virtual void Project (VectorCoefficient &vc,
1455  ElementTransformation &Trans, Vector &dofs) const;
1456 };
1457
1458
1460 {
1461 private:
1462  static const double nk[36][3];
1463
1464 public:
1466
1467  virtual void CalcVShape(const IntegrationPoint &ip,
1468  DenseMatrix &shape) const;
1469
1471  DenseMatrix &shape) const
1472  { CalcVShape_RT(Trans, shape); }
1473
1474  virtual void CalcDivShape(const IntegrationPoint &ip,
1475  Vector &divshape) const;
1476
1478  DenseMatrix &I) const;
1479
1480  using FiniteElement::Project;
1481
1482  virtual void Project (VectorCoefficient &vc,
1483  ElementTransformation &Trans, Vector &dofs) const;
1484 };
1485
1486
1488 {
1489 private:
1490  static const double nk[4][3];
1491
1492 public:
1494
1495  virtual void CalcVShape(const IntegrationPoint &ip,
1496  DenseMatrix &shape) const;
1497
1499  DenseMatrix &shape) const
1500  { CalcVShape_RT(Trans, shape); }
1501
1502  virtual void CalcDivShape(const IntegrationPoint &ip,
1503  Vector &divshape) const;
1504
1506  DenseMatrix &I) const;
1507
1508  using FiniteElement::Project;
1509
1510  virtual void Project (VectorCoefficient &vc,
1511  ElementTransformation &Trans, Vector &dofs) const;
1512 };
1513
1514
1516 {
1517 public:
1519  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1520  virtual void CalcDShape(const IntegrationPoint &ip,
1521  DenseMatrix &dshape) const;
1522 };
1523
1524
1525 class Poly_1D
1526 {
1527 public:
1529  {
1530  ChangeOfBasis = 0, // Use change of basis, O(p^2) Evals
1531  Barycentric = 1, // Use barycentric Lagrangian interpolation, O(p) Evals
1532  Positive = 2, // Fast evaluation of Bernstein polynomials
1533  NumEvalTypes = 3 // Keep count of the number of eval types
1534  };
1535
1536  class Basis
1537  {
1538  private:
1539  int etype;
1540  DenseMatrixInverse Ai;
1541  mutable Vector x, w;
1542
1543  public:
1544  /// Create a nodal or positive (Bernstein) basis
1545  Basis(const int p, const double *nodes, EvalType etype = Barycentric);
1546  void Eval(const double x, Vector &u) const;
1547  void Eval(const double x, Vector &u, Vector &d) const;
1548  };
1549
1550 private:
1551  typedef std::map< int, Array<double*>* > PointsMap;
1552  typedef std::map< int, Array<Basis*>* > BasisMap;
1553
1554  PointsMap points_container;
1555  BasisMap bases_container;
1556
1557  static Array2D<int> binom;
1558
1559  static void CalcMono(const int p, const double x, double *u);
1560  static void CalcMono(const int p, const double x, double *u, double *d);
1561
1562  static void CalcLegendre(const int p, const double x, double *u);
1563  static void CalcLegendre(const int p, const double x, double *u, double *d);
1564
1565  static void CalcChebyshev(const int p, const double x, double *u);
1566  static void CalcChebyshev(const int p, const double x, double *u, double *d);
1567
1569
1570 public:
1571  Poly_1D() { }
1572
1573  /** @brief Get a pointer to an array containing the binomial coefficients "p
1574  choose k" for k=0,...,p for the given p. */
1575  static const int *Binom(const int p);
1576
1577  /** @brief Get the coordinates of the points of the given BasisType,
1578  @a btype.
1579
1580  @param[in] p The polynomial degree; the number of points is p+1.
1581  @param[in] btype The BasisType.
1582
1583  @return A pointer to an array containing the p+1 coordinates of the
1584  points. Returns NULL if the BasisType has no associated set of
1585  points. */
1586  const double *GetPoints(const int p, const int btype);
1587  const double *OpenPoints(const int p,
1588  const int btype = BasisType::GaussLegendre)
1589  { return GetPoints(p, btype); }
1590  const double *ClosedPoints(const int p,
1591  const int btype = BasisType::GaussLobatto)
1592  { return GetPoints(p, btype); }
1593
1594  /** @brief Get a Poly_1D::Basis object of the given degree and BasisType,
1595  @a btype.
1596
1597  @param[in] p The polynomial degree of the basis.
1598  @param[in] btype The BasisType.
1599
1600  @return A reference to an object of type Poly_1D::Basis that represents
1601  the requested basis type. */
1602  Basis &GetBasis(const int p, const int btype);
1603
1604  // Evaluate the values of a hierarchical 1D basis at point x
1605  // hierarchical = k-th basis function is degree k polynomial
1606  static void CalcBasis(const int p, const double x, double *u)
1607  // { CalcMono(p, x, u); }
1608  // Bernstein basis is not hierarchical --> does not work for triangles
1609  // and tetrahedra
1610  // { CalcBernstein(p, x, u); }
1611  // { CalcLegendre(p, x, u); }
1612  { CalcChebyshev(p, x, u); }
1613
1614  // Evaluate the values and derivatives of a hierarchical 1D basis at point x
1615  static void CalcBasis(const int p, const double x, double *u, double *d)
1616  // { CalcMono(p, x, u, d); }
1617  // { CalcBernstein(p, x, u, d); }
1618  // { CalcLegendre(p, x, u, d); }
1619  { CalcChebyshev(p, x, u, d); }
1620
1621  // Evaluate a representation of a Delta function at point x
1622  static double CalcDelta(const int p, const double x)
1623  { return pow(x, (double) p); }
1624
1625  static void ChebyshevPoints(const int p, double *x);
1626
1627  /// Compute the terms in the expansion of the binomial (x + y)^p
1628  static void CalcBinomTerms(const int p, const double x, const double y,
1629  double *u);
1630  /** Compute the terms in the expansion of the binomial (x + y)^p and their
1631  derivatives with respect to x assuming that dy/dx = -1. */
1632  static void CalcBinomTerms(const int p, const double x, const double y,
1633  double *u, double *d);
1634  /** Compute the derivatives (w.r.t. x) of the terms in the expansion of the
1635  binomial (x + y)^p assuming that dy/dx = -1. */
1636  static void CalcDBinomTerms(const int p, const double x, const double y,
1637  double *d);
1638  static void CalcBernstein(const int p, const double x, double *u)
1639  { CalcBinomTerms(p, x, 1. - x, u); }
1640  static void CalcBernstein(const int p, const double x, double *u, double *d)
1641  { CalcBinomTerms(p, x, 1. - x, u, d); }
1642
1643  ~Poly_1D();
1644 };
1645
1646 extern Poly_1D poly1d;
1647
1649 {
1650 protected:
1651  int b_type;
1654
1655 public:
1657  {
1660  };
1661
1662  TensorBasisElement(const int dims, const int p, const int btype,
1663  const DofMapType dmtype);
1664
1665  int GetBasisType() const { return b_type; }
1666
1667  const Poly_1D::Basis& GetBasis1D() const { return basis1d; }
1668
1669  /** @brief Get an Array<int> that maps lexicographically ordered indices to
1670  the indices of the respective nodes/dofs/basis functions. If the dofs are
1671  ordered lexicographically, i.e. the mapping is identity, the returned
1672  Array will be empty. */
1673  const Array<int> &GetDofMap() const { return dof_map; }
1674
1676  {
1677  switch (dim)
1678  {
1679  case 1: return Geometry::SEGMENT;
1680  case 2: return Geometry::SQUARE;
1681  case 3: return Geometry::CUBE;
1682  default: MFEM_ABORT("invalid dimension: " << dim); return -1;
1683  }
1684  }
1685
1686  /// Return @a base raised to the power @a dim.
1687  static int Pow(int base, int dim)
1688  {
1689  switch (dim)
1690  {
1691  case 1: return base;
1692  case 2: return base*base;
1693  case 3: return base*base*base;
1694  default: MFEM_ABORT("invalid dimension: " << dim); return -1;
1695  }
1696  }
1697 };
1698
1700  public TensorBasisElement
1701 {
1702 public:
1703  NodalTensorFiniteElement(const int dims, const int p, const int btype,
1704  const DofMapType dmtype);
1705 };
1706
1708  public TensorBasisElement
1709 {
1710 public:
1711  PositiveTensorFiniteElement(const int dims, const int p,
1712  const DofMapType dmtype);
1713 };
1714
1716 {
1717 private:
1719  mutable Vector shape_x, dshape_x;
1720 #endif
1721
1722 public:
1723  H1_SegmentElement(const int p, const int btype = BasisType::GaussLobatto);
1724  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1725  virtual void CalcDShape(const IntegrationPoint &ip,
1726  DenseMatrix &dshape) const;
1727  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1728 };
1729
1730
1732 {
1733 private:
1735  mutable Vector shape_x, shape_y, dshape_x, dshape_y;
1736 #endif
1737
1738 public:
1740  const int btype = BasisType::GaussLobatto);
1741  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1742  virtual void CalcDShape(const IntegrationPoint &ip,
1743  DenseMatrix &dshape) const;
1744  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1745 };
1746
1747
1749 {
1750 private:
1752  mutable Vector shape_x, shape_y, shape_z, dshape_x, dshape_y, dshape_z;
1753 #endif
1754
1755 public:
1756  H1_HexahedronElement(const int p, const int btype = BasisType::GaussLobatto);
1757  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1758  virtual void CalcDShape(const IntegrationPoint &ip,
1759  DenseMatrix &dshape) const;
1760  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1761 };
1762
1764 {
1765 private:
1767  // This is to share scratch space between invocations, which helps
1768  // speed things up, but with OpenMP, we need one copy per thread.
1769  // Right now, we solve this by allocating this space within each function
1770  // call every time we call it. Alternatively, we should do some sort
1771  // thread private thing. Brunner, Jan 2014
1772  mutable Vector shape_x, dshape_x;
1773 #endif
1774
1775 public:
1776  H1Pos_SegmentElement(const int p);
1777  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1778  virtual void CalcDShape(const IntegrationPoint &ip,
1779  DenseMatrix &dshape) const;
1780  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1781 };
1782
1783
1785 {
1786 private:
1788  // See comment in H1Pos_SegmentElement
1789  mutable Vector shape_x, shape_y, dshape_x, dshape_y;
1790 #endif
1791
1792 public:
1794  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1795  virtual void CalcDShape(const IntegrationPoint &ip,
1796  DenseMatrix &dshape) const;
1797  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1798 };
1799
1800
1802 {
1803 private:
1805  // See comment in H1Pos_SegementElement.
1806  mutable Vector shape_x, shape_y, shape_z, dshape_x, dshape_y, dshape_z;
1807 #endif
1808
1809 public:
1810  H1Pos_HexahedronElement(const int p);
1811  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1812  virtual void CalcDShape(const IntegrationPoint &ip,
1813  DenseMatrix &dshape) const;
1814  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1815 };
1816
1817
1819 {
1820 private:
1822  mutable Vector shape_x, shape_y, shape_l, dshape_x, dshape_y, dshape_l, u;
1823  mutable DenseMatrix du;
1824 #endif
1825  DenseMatrixInverse Ti;
1826
1827 public:
1828  H1_TriangleElement(const int p, const int btype = BasisType::GaussLobatto);
1829  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1830  virtual void CalcDShape(const IntegrationPoint &ip,
1831  DenseMatrix &dshape) const;
1832 };
1833
1834
1836 {
1837 private:
1839  mutable Vector shape_x, shape_y, shape_z, shape_l;
1840  mutable Vector dshape_x, dshape_y, dshape_z, dshape_l, u;
1841  mutable DenseMatrix du;
1842 #endif
1843  DenseMatrixInverse Ti;
1844
1845 public:
1846  H1_TetrahedronElement(const int p,
1847  const int btype = BasisType::GaussLobatto);
1848  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1849  virtual void CalcDShape(const IntegrationPoint &ip,
1850  DenseMatrix &dshape) const;
1851 };
1852
1853
1855 {
1856 protected:
1860 #endif
1862
1863 public:
1864  H1Pos_TriangleElement(const int p);
1865
1866  // The size of shape is (p+1)(p+2)/2 (dof).
1867  static void CalcShape(const int p, const double x, const double y,
1868  double *shape);
1869
1870  // The size of dshape_1d is p+1; the size of dshape is (dof x dim).
1871  static void CalcDShape(const int p, const double x, const double y,
1872  double *dshape_1d, double *dshape);
1873
1874  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1875  virtual void CalcDShape(const IntegrationPoint &ip,
1876  DenseMatrix &dshape) const;
1877 };
1878
1879
1881 {
1882 protected:
1886 #endif
1888
1889 public:
1890  H1Pos_TetrahedronElement(const int p);
1891
1892  // The size of shape is (p+1)(p+2)(p+3)/6 (dof).
1893  static void CalcShape(const int p, const double x, const double y,
1894  const double z, double *shape);
1895
1896  // The size of dshape_1d is p+1; the size of dshape is (dof x dim).
1897  static void CalcDShape(const int p, const double x, const double y,
1898  const double z, double *dshape_1d, double *dshape);
1899
1900  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1901  virtual void CalcDShape(const IntegrationPoint &ip,
1902  DenseMatrix &dshape) const;
1903 };
1904
1905
1907 {
1908 private:
1910  mutable Vector shape_x, dshape_x;
1911 #endif
1912
1913 public:
1914  L2_SegmentElement(const int p, const int btype = BasisType::GaussLegendre);
1915  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1916  virtual void CalcDShape(const IntegrationPoint &ip,
1917  DenseMatrix &dshape) const;
1918  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1919 };
1920
1921
1923 {
1924 private:
1926  mutable Vector shape_x, dshape_x;
1927 #endif
1928
1929 public:
1930  L2Pos_SegmentElement(const int p);
1931  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1932  virtual void CalcDShape(const IntegrationPoint &ip,
1933  DenseMatrix &dshape) const;
1934  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1935 };
1936
1937
1939 {
1940 private:
1942  mutable Vector shape_x, shape_y, dshape_x, dshape_y;
1943 #endif
1944
1945 public:
1947  const int btype = BasisType::GaussLegendre);
1948  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1949  virtual void CalcDShape(const IntegrationPoint &ip,
1950  DenseMatrix &dshape) const;
1951  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1952  virtual void ProjectCurl(const FiniteElement &fe,
1954  DenseMatrix &curl) const
1955  { ProjectCurl_2D(fe, Trans, curl); }
1956 };
1957
1958
1960 {
1961 private:
1963  mutable Vector shape_x, shape_y, dshape_x, dshape_y;
1964 #endif
1965
1966 public:
1968  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1969  virtual void CalcDShape(const IntegrationPoint &ip,
1970  DenseMatrix &dshape) const;
1971  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1972 };
1973
1974
1976 {
1977 private:
1979  mutable Vector shape_x, shape_y, shape_z, dshape_x, dshape_y, dshape_z;
1980 #endif
1981
1982 public:
1983  L2_HexahedronElement(const int p,
1984  const int btype = BasisType::GaussLegendre);
1985  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1986  virtual void CalcDShape(const IntegrationPoint &ip,
1987  DenseMatrix &dshape) const;
1988  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1989 };
1990
1991
1993 {
1994 private:
1996  mutable Vector shape_x, shape_y, shape_z, dshape_x, dshape_y, dshape_z;
1997 #endif
1998
1999 public:
2000  L2Pos_HexahedronElement(const int p);
2001  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2002  virtual void CalcDShape(const IntegrationPoint &ip,
2003  DenseMatrix &dshape) const;
2004  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2005 };
2006
2007
2009 {
2010 private:
2012  mutable Vector shape_x, shape_y, shape_l, dshape_x, dshape_y, dshape_l, u;
2013  mutable DenseMatrix du;
2014 #endif
2015  DenseMatrixInverse Ti;
2016
2017 public:
2018  L2_TriangleElement(const int p,
2019  const int btype = BasisType::GaussLegendre);
2020  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2021  virtual void CalcDShape(const IntegrationPoint &ip,
2022  DenseMatrix &dshape) const;
2023  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2024  virtual void ProjectCurl(const FiniteElement &fe,
2026  DenseMatrix &curl) const
2027  { ProjectCurl_2D(fe, Trans, curl); }
2028 };
2029
2030
2032 {
2033 private:
2035  mutable Vector dshape_1d;
2036 #endif
2037
2038 public:
2039  L2Pos_TriangleElement(const int p);
2040  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2041  virtual void CalcDShape(const IntegrationPoint &ip,
2042  DenseMatrix &dshape) const;
2043  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2044 };
2045
2046
2048 {
2049 private:
2051  mutable Vector shape_x, shape_y, shape_z, shape_l;
2052  mutable Vector dshape_x, dshape_y, dshape_z, dshape_l, u;
2053  mutable DenseMatrix du;
2054 #endif
2055  DenseMatrixInverse Ti;
2056
2057 public:
2058  L2_TetrahedronElement(const int p,
2059  const int btype = BasisType::GaussLegendre);
2060  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2061  virtual void CalcDShape(const IntegrationPoint &ip,
2062  DenseMatrix &dshape) const;
2063  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2064 };
2065
2066
2068 {
2069 private:
2071  mutable Vector dshape_1d;
2072 #endif
2073
2074 public:
2075  L2Pos_TetrahedronElement(const int p);
2076  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2077  virtual void CalcDShape(const IntegrationPoint &ip,
2078  DenseMatrix &dshape) const;
2079  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2080 };
2081
2082
2084 {
2085 private:
2086  static const double nk[8];
2087
2088  Poly_1D::Basis &cbasis1d, &obasis1d;
2090  mutable Vector shape_cx, shape_ox, shape_cy, shape_oy;
2091  mutable Vector dshape_cx, dshape_cy;
2092 #endif
2093  Array<int> dof_map, dof2nk;
2094
2095 public:
2097  const int cb_type = BasisType::GaussLobatto,
2098  const int ob_type = BasisType::GaussLegendre);
2099  virtual void CalcVShape(const IntegrationPoint &ip,
2100  DenseMatrix &shape) const;
2102  DenseMatrix &shape) const
2103  { CalcVShape_RT(Trans, shape); }
2104  virtual void CalcDivShape(const IntegrationPoint &ip,
2105  Vector &divshape) const;
2107  DenseMatrix &I) const
2108  { LocalInterpolation_RT(*this, nk, dof2nk, Trans, I); }
2109  virtual void GetTransferMatrix(const FiniteElement &fe,
2111  DenseMatrix &I) const
2112  { LocalInterpolation_RT(CheckVectorFE(fe), nk, dof2nk, Trans, I); }
2113  using FiniteElement::Project;
2114  virtual void Project(VectorCoefficient &vc,
2115  ElementTransformation &Trans, Vector &dofs) const
2116  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
2118  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2119  { ProjectMatrixCoefficient_RT(nk, dof2nk, mc, T, dofs); }
2121  DenseMatrix &I) const
2122  { Project_RT(nk, dof2nk, fe, Trans, I); }
2123  // Gradient + rotation = Curl: H1 -> H(div)
2124  virtual void ProjectGrad(const FiniteElement &fe,
2128  // Curl = Gradient + rotation: H1 -> H(div)
2129  virtual void ProjectCurl(const FiniteElement &fe,
2131  DenseMatrix &curl) const
2132  { ProjectGrad_RT(nk, dof2nk, fe, Trans, curl); }
2133 };
2134
2135
2137 {
2138  static const double nk[18];
2139
2140  Poly_1D::Basis &cbasis1d, &obasis1d;
2142  mutable Vector shape_cx, shape_ox, shape_cy, shape_oy, shape_cz, shape_oz;
2143  mutable Vector dshape_cx, dshape_cy, dshape_cz;
2144 #endif
2145  Array<int> dof_map, dof2nk;
2146
2147 public:
2148  RT_HexahedronElement(const int p,
2149  const int cb_type = BasisType::GaussLobatto,
2150  const int ob_type = BasisType::GaussLegendre);
2151
2152  virtual void CalcVShape(const IntegrationPoint &ip,
2153  DenseMatrix &shape) const;
2155  DenseMatrix &shape) const
2156  { CalcVShape_RT(Trans, shape); }
2157  virtual void CalcDivShape(const IntegrationPoint &ip,
2158  Vector &divshape) const;
2160  DenseMatrix &I) const
2161  { LocalInterpolation_RT(*this, nk, dof2nk, Trans, I); }
2162  virtual void GetTransferMatrix(const FiniteElement &fe,
2164  DenseMatrix &I) const
2165  { LocalInterpolation_RT(CheckVectorFE(fe), nk, dof2nk, Trans, I); }
2166  using FiniteElement::Project;
2167  virtual void Project(VectorCoefficient &vc,
2168  ElementTransformation &Trans, Vector &dofs) const
2169  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
2171  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2172  { ProjectMatrixCoefficient_RT(nk, dof2nk, mc, T, dofs); }
2174  DenseMatrix &I) const
2175  { Project_RT(nk, dof2nk, fe, Trans, I); }
2176  virtual void ProjectCurl(const FiniteElement &fe,
2178  DenseMatrix &curl) const
2179  { ProjectCurl_RT(nk, dof2nk, fe, Trans, curl); }
2180 };
2181
2182
2184 {
2185  static const double nk[6], c;
2186
2188  mutable Vector shape_x, shape_y, shape_l;
2189  mutable Vector dshape_x, dshape_y, dshape_l;
2190  mutable DenseMatrix u;
2191  mutable Vector divu;
2192 #endif
2193  Array<int> dof2nk;
2194  DenseMatrixInverse Ti;
2195
2196 public:
2197  RT_TriangleElement(const int p);
2198  virtual void CalcVShape(const IntegrationPoint &ip,
2199  DenseMatrix &shape) const;
2201  DenseMatrix &shape) const
2202  { CalcVShape_RT(Trans, shape); }
2203  virtual void CalcDivShape(const IntegrationPoint &ip,
2204  Vector &divshape) const;
2206  DenseMatrix &I) const
2207  { LocalInterpolation_RT(*this, nk, dof2nk, Trans, I); }
2208  virtual void GetTransferMatrix(const FiniteElement &fe,
2210  DenseMatrix &I) const
2211  { LocalInterpolation_RT(CheckVectorFE(fe), nk, dof2nk, Trans, I); }
2212  using FiniteElement::Project;
2213  virtual void Project(VectorCoefficient &vc,
2214  ElementTransformation &Trans, Vector &dofs) const
2215  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
2217  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2218  { ProjectMatrixCoefficient_RT(nk, dof2nk, mc, T, dofs); }
2220  DenseMatrix &I) const
2221  { Project_RT(nk, dof2nk, fe, Trans, I); }
2222  // Gradient + rotation = Curl: H1 -> H(div)
2223  virtual void ProjectGrad(const FiniteElement &fe,
2227  // Curl = Gradient + rotation: H1 -> H(div)
2228  virtual void ProjectCurl(const FiniteElement &fe,
2230  DenseMatrix &curl) const
2231  { ProjectGrad_RT(nk, dof2nk, fe, Trans, curl); }
2232 };
2233
2234
2236 {
2237  static const double nk[12], c;
2238
2240  mutable Vector shape_x, shape_y, shape_z, shape_l;
2241  mutable Vector dshape_x, dshape_y, dshape_z, dshape_l;
2242  mutable DenseMatrix u;
2243  mutable Vector divu;
2244 #endif
2245  Array<int> dof2nk;
2246  DenseMatrixInverse Ti;
2247
2248 public:
2249  RT_TetrahedronElement(const int p);
2250  virtual void CalcVShape(const IntegrationPoint &ip,
2251  DenseMatrix &shape) const;
2253  DenseMatrix &shape) const
2254  { CalcVShape_RT(Trans, shape); }
2255  virtual void CalcDivShape(const IntegrationPoint &ip,
2256  Vector &divshape) const;
2258  DenseMatrix &I) const
2259  { LocalInterpolation_RT(*this, nk, dof2nk, Trans, I); }
2260  virtual void GetTransferMatrix(const FiniteElement &fe,
2262  DenseMatrix &I) const
2263  { LocalInterpolation_RT(CheckVectorFE(fe), nk, dof2nk, Trans, I); }
2264  using FiniteElement::Project;
2265  virtual void Project(VectorCoefficient &vc,
2266  ElementTransformation &Trans, Vector &dofs) const
2267  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
2269  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2270  { ProjectMatrixCoefficient_RT(nk, dof2nk, mc, T, dofs); }
2272  DenseMatrix &I) const
2273  { Project_RT(nk, dof2nk, fe, Trans, I); }
2274  virtual void ProjectCurl(const FiniteElement &fe,
2276  DenseMatrix &curl) const
2277  { ProjectCurl_RT(nk, dof2nk, fe, Trans, curl); }
2278 };
2279
2280
2282 {
2283  static const double tk[18];
2284
2285  Poly_1D::Basis &cbasis1d, &obasis1d;
2287  mutable Vector shape_cx, shape_ox, shape_cy, shape_oy, shape_cz, shape_oz;
2288  mutable Vector dshape_cx, dshape_cy, dshape_cz;
2289 #endif
2290  Array<int> dof_map, dof2tk;
2291
2292 public:
2293  ND_HexahedronElement(const int p,
2294  const int cb_type = BasisType::GaussLobatto,
2295  const int ob_type = BasisType::GaussLegendre);
2296
2297  virtual void CalcVShape(const IntegrationPoint &ip,
2298  DenseMatrix &shape) const;
2299
2301  DenseMatrix &shape) const
2302  { CalcVShape_ND(Trans, shape); }
2303
2304  virtual void CalcCurlShape(const IntegrationPoint &ip,
2305  DenseMatrix &curl_shape) const;
2306
2308  DenseMatrix &I) const
2309  { LocalInterpolation_ND(*this, tk, dof2tk, Trans, I); }
2310
2311  virtual void GetTransferMatrix(const FiniteElement &fe,
2313  DenseMatrix &I) const
2314  { LocalInterpolation_ND(CheckVectorFE(fe), tk, dof2tk, Trans, I); }
2315
2316  using FiniteElement::Project;
2317
2318  virtual void Project(VectorCoefficient &vc,
2319  ElementTransformation &Trans, Vector &dofs) const
2320  { Project_ND(tk, dof2tk, vc, Trans, dofs); }
2321
2323  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2324  { ProjectMatrixCoefficient_ND(tk, dof2tk, mc, T, dofs); }
2325
2326  virtual void Project(const FiniteElement &fe,
2328  DenseMatrix &I) const
2329  { Project_ND(tk, dof2tk, fe, Trans, I); }
2330
2331  virtual void ProjectGrad(const FiniteElement &fe,
2335
2336  virtual void ProjectCurl(const FiniteElement &fe,
2338  DenseMatrix &curl) const
2339  { ProjectCurl_ND(tk, dof2tk, fe, Trans, curl); }
2340 };
2341
2342
2344 {
2345  static const double tk[8];
2346
2347  Poly_1D::Basis &cbasis1d, &obasis1d;
2349  mutable Vector shape_cx, shape_ox, shape_cy, shape_oy;
2350  mutable Vector dshape_cx, dshape_cy;
2351 #endif
2352  Array<int> dof_map, dof2tk;
2353
2354 public:
2356  const int cb_type = BasisType::GaussLobatto,
2357  const int ob_type = BasisType::GaussLegendre);
2358  virtual void CalcVShape(const IntegrationPoint &ip,
2359  DenseMatrix &shape) const;
2361  DenseMatrix &shape) const
2362  { CalcVShape_ND(Trans, shape); }
2363  virtual void CalcCurlShape(const IntegrationPoint &ip,
2364  DenseMatrix &curl_shape) const;
2366  DenseMatrix &I) const
2367  { LocalInterpolation_ND(*this, tk, dof2tk, Trans, I); }
2368  virtual void GetTransferMatrix(const FiniteElement &fe,
2370  DenseMatrix &I) const
2371  { LocalInterpolation_ND(CheckVectorFE(fe), tk, dof2tk, Trans, I); }
2372  using FiniteElement::Project;
2373  virtual void Project(VectorCoefficient &vc,
2374  ElementTransformation &Trans, Vector &dofs) const
2375  { Project_ND(tk, dof2tk, vc, Trans, dofs); }
2377  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2378  { ProjectMatrixCoefficient_ND(tk, dof2tk, mc, T, dofs); }
2379  virtual void Project(const FiniteElement &fe,
2381  DenseMatrix &I) const
2382  { Project_ND(tk, dof2tk, fe, Trans, I); }
2383  virtual void ProjectGrad(const FiniteElement &fe,
2387 };
2388
2389
2391 {
2392  static const double tk[18], c;
2393
2395  mutable Vector shape_x, shape_y, shape_z, shape_l;
2396  mutable Vector dshape_x, dshape_y, dshape_z, dshape_l;
2397  mutable DenseMatrix u;
2398 #endif
2399  Array<int> dof2tk;
2400  DenseMatrixInverse Ti;
2401
2402 public:
2403  ND_TetrahedronElement(const int p);
2404  virtual void CalcVShape(const IntegrationPoint &ip,
2405  DenseMatrix &shape) const;
2407  DenseMatrix &shape) const
2408  { CalcVShape_ND(Trans, shape); }
2409  virtual void CalcCurlShape(const IntegrationPoint &ip,
2410  DenseMatrix &curl_shape) const;
2412  DenseMatrix &I) const
2413  { LocalInterpolation_ND(*this, tk, dof2tk, Trans, I); }
2414  virtual void GetTransferMatrix(const FiniteElement &fe,
2416  DenseMatrix &I) const
2417  { LocalInterpolation_ND(CheckVectorFE(fe), tk, dof2tk, Trans, I); }
2418  using FiniteElement::Project;
2419  virtual void Project(VectorCoefficient &vc,
2420  ElementTransformation &Trans, Vector &dofs) const
2421  { Project_ND(tk, dof2tk, vc, Trans, dofs); }
2423  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2424  { ProjectMatrixCoefficient_ND(tk, dof2tk, mc, T, dofs); }
2425  virtual void Project(const FiniteElement &fe,
2427  DenseMatrix &I) const
2428  { Project_ND(tk, dof2tk, fe, Trans, I); }
2429  virtual void ProjectGrad(const FiniteElement &fe,
2433
2434  virtual void ProjectCurl(const FiniteElement &fe,
2436  DenseMatrix &curl) const
2437  { ProjectCurl_ND(tk, dof2tk, fe, Trans, curl); }
2438 };
2439
2441 {
2442  static const double tk[8], c;
2443
2445  mutable Vector shape_x, shape_y, shape_l;
2446  mutable Vector dshape_x, dshape_y, dshape_l;
2447  mutable DenseMatrix u;
2448  mutable Vector curlu;
2449 #endif
2450  Array<int> dof2tk;
2451  DenseMatrixInverse Ti;
2452
2453 public:
2454  ND_TriangleElement(const int p);
2455  virtual void CalcVShape(const IntegrationPoint &ip,
2456  DenseMatrix &shape) const;
2458  DenseMatrix &shape) const
2459  { CalcVShape_ND(Trans, shape); }
2460  virtual void CalcCurlShape(const IntegrationPoint &ip,
2461  DenseMatrix &curl_shape) const;
2463  DenseMatrix &I) const
2464  { LocalInterpolation_ND(*this, tk, dof2tk, Trans, I); }
2465  virtual void GetTransferMatrix(const FiniteElement &fe,
2467  DenseMatrix &I) const
2468  { LocalInterpolation_ND(CheckVectorFE(fe), tk, dof2tk, Trans, I); }
2469  using FiniteElement::Project;
2470  virtual void Project(VectorCoefficient &vc,
2471  ElementTransformation &Trans, Vector &dofs) const
2472  { Project_ND(tk, dof2tk, vc, Trans, dofs); }
2474  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2475  { ProjectMatrixCoefficient_ND(tk, dof2tk, mc, T, dofs); }
2476  virtual void Project(const FiniteElement &fe,
2478  DenseMatrix &I) const
2479  { Project_ND(tk, dof2tk, fe, Trans, I); }
2480  virtual void ProjectGrad(const FiniteElement &fe,
2484 };
2485
2486
2488 {
2489  static const double tk[1];
2490
2491  Poly_1D::Basis &obasis1d;
2492  Array<int> dof2tk;
2493
2494 public:
2495  ND_SegmentElement(const int p, const int ob_type = BasisType::GaussLegendre);
2496  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
2497  { obasis1d.Eval(ip.x, shape); }
2498  virtual void CalcVShape(const IntegrationPoint &ip,
2499  DenseMatrix &shape) const;
2501  DenseMatrix &shape) const
2502  { CalcVShape_ND(Trans, shape); }
2503  // virtual void CalcCurlShape(const IntegrationPoint &ip,
2504  // DenseMatrix &curl_shape) const;
2506  DenseMatrix &I) const
2507  { LocalInterpolation_ND(*this, tk, dof2tk, Trans, I); }
2508  virtual void GetTransferMatrix(const FiniteElement &fe,
2510  DenseMatrix &I) const
2511  { LocalInterpolation_ND(CheckVectorFE(fe), tk, dof2tk, Trans, I); }
2512  using FiniteElement::Project;
2513  virtual void Project(VectorCoefficient &vc,
2514  ElementTransformation &Trans, Vector &dofs) const
2515  { Project_ND(tk, dof2tk, vc, Trans, dofs); }
2517  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2518  { ProjectMatrixCoefficient_ND(tk, dof2tk, mc, T, dofs); }
2519  virtual void Project(const FiniteElement &fe,
2521  DenseMatrix &I) const
2522  { Project_ND(tk, dof2tk, fe, Trans, I); }
2523  virtual void ProjectGrad(const FiniteElement &fe,
2527 };
2528
2529
2531 {
2532 protected:
2534  mutable const int *ijk;
2535  mutable int patch, elem;
2536  mutable Vector weights;
2537
2538 public:
2539  NURBSFiniteElement(int D, int G, int Do, int O, int F)
2540  : ScalarFiniteElement(D, G, Do, O, F)
2541  {
2542  ijk = NULL;
2543  patch = elem = -1;
2544  kv.SetSize(Dim);
2545  weights.SetSize(Dof);
2546  weights = 1.0;
2547  }
2548
2549  void Reset () const { patch = elem = -1; }
2550  void SetIJK (const int *IJK) const { ijk = IJK; }
2551  int GetPatch () const { return patch; }
2552  void SetPatch (int p) const { patch = p; }
2553  int GetElement () const { return elem; }
2554  void SetElement (int e) const { elem = e; }
2556  Vector &Weights () const { return weights; }
2557  /// Update the NURBSFiniteElement according to the currently set knot vectors
2558  virtual void SetOrder () const { }
2559 };
2560
2562 {
2563 protected:
2564  mutable Vector shape_x;
2565
2566 public:
2568  : NURBSFiniteElement(1, Geometry::SEGMENT, p + 1, p, FunctionSpace::Qk),
2569  shape_x(p + 1) { }
2570
2571  virtual void SetOrder() const;
2572  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2573  virtual void CalcDShape(const IntegrationPoint &ip,
2574  DenseMatrix &dshape) const;
2575 };
2576
2578 {
2579 protected:
2581
2582 public:
2584  : NURBSFiniteElement(2, Geometry::SQUARE, (p + 1)*(p + 1), p,
2585  FunctionSpace::Qk),
2586  u(Dof), shape_x(p + 1), shape_y(p + 1), dshape_x(p + 1), dshape_y(p + 1)
2587  { Orders[0] = Orders[1] = p; }
2588
2589  NURBS2DFiniteElement(int px, int py)
2590  : NURBSFiniteElement(2, Geometry::SQUARE, (px + 1)*(py + 1),
2591  std::max(px, py), FunctionSpace::Qk),
2592  u(Dof), shape_x(px + 1), shape_y(py + 1), dshape_x(px + 1),
2593  dshape_y(py + 1)
2594  { Orders[0] = px; Orders[1] = py; }
2595
2596  virtual void SetOrder() const;
2597  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2598  virtual void CalcDShape(const IntegrationPoint &ip,
2599  DenseMatrix &dshape) const;
2600 };
2601
2603 {
2604 protected:
2606
2607 public:
2609  : NURBSFiniteElement(3, Geometry::CUBE, (p + 1)*(p + 1)*(p + 1), p,
2610  FunctionSpace::Qk),
2611  u(Dof), shape_x(p + 1), shape_y(p + 1), shape_z(p + 1),
2612  dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1)
2613  { Orders[0] = Orders[1] = Orders[2] = p; }
2614
2615  NURBS3DFiniteElement(int px, int py, int pz)
2616  : NURBSFiniteElement(3, Geometry::CUBE, (px + 1)*(py + 1)*(pz + 1),
2617  std::max(std::max(px,py),pz), FunctionSpace::Qk),
2618  u(Dof), shape_x(px + 1), shape_y(py + 1), shape_z(pz + 1),
2619  dshape_x(px + 1), dshape_y(py + 1), dshape_z(pz + 1)
2620  { Orders[0] = px; Orders[1] = py; Orders[2] = pz; }
2621
2622  virtual void SetOrder() const;
2623  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2624  virtual void CalcDShape(const IntegrationPoint &ip,
2625  DenseMatrix &dshape) const;
2626 };
2627
2628 } // namespace mfem
2629
2630 #endif
Abstract class for Finite Elements.
Definition: fe.hpp:140
RefinedLinear3DFiniteElement()
Construct a quadratic FE on tetrahedron.
Definition: fe.cpp:4291
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:1498
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:1404
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:8260
ND_SegmentElement(const int p, const int ob_type=BasisType::GaussLegendre)
Definition: fe.cpp:10891
For scalar fields; preserves point values.
Definition: fe.hpp:180
DenseMatrix curlshape_J
Definition: fe.hpp:565
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:6090
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2167
int GetDim() const
Returns the reference space dimension for the finite element.
Definition: fe.hpp:211
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:7304
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.cpp:2928
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:1470
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:3869
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:1152
static void CalcBernstein(const int p, const double x, double *u, double *d)
Definition: fe.hpp:1640
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2129
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:1208
Quadratic 1D element with nodes the Gaussian points in [0,1] (trace of RT2)
Definition: fe.hpp:1218
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8650
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:10991
Linear3DFiniteElement()
Construct a linear FE on tetrahedron.
Definition: fe.cpp:2327
static int Check(int b_type)
If the input does not represents a valid BasisType, abort with an error; otherwise return the input...
Definition: fe.hpp:44
static double CalcDelta(const int p, const double x)
Definition: fe.hpp:1622
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.cpp:3110
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:2200
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.hpp:2257
No derivatives implemented.
Definition: fe.hpp:195
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8411
void ProjectMatrixCoefficient_RT(const double *nk, const Array< int > &d2n, MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.cpp:590
void ProjectMatrixCoefficient_ND(const double *tk, const Array< int > &d2t, MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.cpp:766
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:9824
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:40
RefinedBiLinear2DFiniteElement()
Definition: fe.cpp:4523
NodalTensorFiniteElement(const int dims, const int p, const int btype, const DofMapType dmtype)
Definition: fe.cpp:6876
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:1722
void LocalInterpolation_RT(const VectorFiniteElement &cfe, const double *nk, const Array< int > &d2n, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.cpp:860
L2Pos_TriangleElement(const int p)
Definition: fe.cpp:8794
Definition: fe.hpp:2383
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:1063
H1Pos_SegmentElement(const int p)
Definition: fe.cpp:7246
Basis(const int p, const double *nodes, EvalType etype=Barycentric)
Create a nodal or positive (Bernstein) basis.
Definition: fe.cpp:6195
int GetPatch() const
Definition: fe.hpp:2551
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2274
virtual void ProjectDiv(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &div) const
Definition: fe.cpp:171
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:955
static int GetNodalBasis(int qpt_type)
Return the nodal BasisType corresponding to the Quadrature1D type.
Definition: fe.hpp:74
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:5135
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:124
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:866
Array< const KnotVector * > kv
Definition: fe.hpp:2533
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:2565
NURBS2DFiniteElement(int px, int py)
Definition: fe.hpp:2589
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:61
Array< const KnotVector * > & KnotVectors() const
Definition: fe.hpp:2555
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:2344
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8833
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2434
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:2882
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:3162
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:1518
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:7284
FiniteElement(D, G, Do, O, F)
PositiveTensorFiniteElement(const int dims, const int p, const DofMapType dmtype)
Definition: fe.cpp:6885
int GetDerivMapType() const
Definition: fe.hpp:241
L2Pos_TetrahedronElement(const int p)
Definition: fe.cpp:8988
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.cpp:334
void CalcVShape_RT(ElementTransformation &Trans, DenseMatrix &shape) const
Definition: fe.cpp:547
void SetSize(int s)
Resize the vector to size s.
Definition: vector.hpp:328
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:9206
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.cpp:5197
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:3652
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:1073
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:295
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:1542
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Definition: fe.cpp:1900
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2228
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:1811
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:2647
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
evaluate derivatives of shape function - constant 0
Definition: fe.cpp:2298
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:1418
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:2300
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:962
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:6949
H1Pos_TetrahedronElement(const int p)
Definition: fe.cpp:7887
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:10924
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:8279
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.hpp:2106
LagrangeHexFiniteElement(int degree)
Definition: fe.cpp:3921
TensorBasisElement(const int dims, const int p, const int btype, const DofMapType dmtype)
Definition: fe.cpp:6676
L2_SegmentElement(const int p, const int btype=BasisType::GaussLegendre)
Definition: fe.cpp:8139
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...
Definition: fe.hpp:221
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:2660
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:3775
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:4083
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:2360
Data type dense matrix using column-major storage.
Definition: densemat.hpp:23
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:3727
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition: fe.hpp:2162
Definition: fe.cpp:397
void Reset() const
Definition: fe.hpp:2549
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2213
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition: fe.hpp:2260
Class for quadratic FE on triangle.
Definition: fe.hpp:792
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:10938
PositiveFiniteElement(int D, int G, int Do, int O, int F=FunctionSpace::Pk)
Definition: fe.hpp:525
Class for quadratic FE on interval.
Definition: fe.hpp:763
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:2101
Get the corresponding Quadrature1D constant, when that makes sense; otherwise return Quadrature1D::In...
Definition: fe.hpp:60
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:9680
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.cpp:5363
void ProjectCurl_ND(const double *tk, const Array< int > &d2t, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.cpp:692
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:2313
int Space() const
Returns the type of space on each element.
Definition: fe.hpp:231
virtual void SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
Definition: fe.cpp:10915
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:1971
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.cpp:111
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2173
RefinedTriLinear3DFiniteElement()
Definition: fe.cpp:4670
DenseMatrix vshape
Definition: fe.hpp:153
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:3908
NURBS3DFiniteElement(int px, int py, int pz)
Definition: fe.hpp:2615
Construct a quadratic FE on tetrahedron.
Definition: fe.cpp:2383
int GetMapType() const
Definition: fe.hpp:237
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 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:5713
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.cpp:5900
Tensor products of polynomials of order k.
Definition: fe.hpp:128
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:2759
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8953
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2336
void NodalLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I, const ScalarFiniteElement &fine_fe) const
Nodal interpolation.
Definition: fe.cpp:201
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:2023
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:9018
Polynomials of order k.
Definition: fe.hpp:127
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:2590
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:2582
static const char * Name(int b_type)
Check and convert a BasisType constant to a string identifier.
Definition: fe.hpp:87
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:8217
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:7001
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:1268
void ProjectCurl_RT(const double *nk, const Array< int > &d2n, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.cpp:730
H1Pos_HexahedronElement(const int p)
Definition: fe.cpp:7379
Definition: fe.cpp:155
static void CalcShape(const int p, const double x, const double y, const double z, double *shape)
Definition: fe.cpp:7989
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition: fe.hpp:494
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:8895
Implements CalcDivShape methods.
Definition: fe.hpp:197
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Definition: fe.cpp:1034
static int GetType(char b_ident)
Convert char basis identifier to a BasisType constant.
Definition: fe.hpp:103
int GetElement() const
Definition: fe.hpp:2553
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:7351
Linear2DFiniteElement()
Construct a linear FE on triangle.
Definition: fe.cpp:976
const double * ClosedPoints(const int p, const int btype=BasisType::GaussLobatto)
Definition: fe.hpp:1590
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2114
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:2440
static int CheckNodal(int b_type)
If the input does not represents a valid nodal BasisType, abort with an error; otherwise return the i...
Definition: fe.hpp:52
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2473
Class for refined bi-linear FE on quadrilateral.
Definition: fe.hpp:1347
Possible basis types. Note that not all elements can use all BasisType(s).
Definition: fe.hpp:27
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.cpp:6035
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:4859
H1_HexahedronElement(const int p, const int btype=BasisType::GaussLobatto)
Definition: fe.cpp:7091
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:10812
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:943
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:2043
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:75
L2Pos_HexahedronElement(const int p)
Definition: fe.cpp:8578
ND_TriangleElement(const int p)
Definition: fe.cpp:10731
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2024
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:9860
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition: fe.hpp:2508
static void CalcDShape(const int p, const double x, const double y, const double z, double *dshape_1d, double *dshape)
Definition: fe.cpp:8022
static void CalcBasis(const int p, const double x, double *u)
Definition: fe.hpp:1606
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:1090
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
evaluate shape function - constant 1
Definition: fe.cpp:2292
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Definition: fe.cpp:2071
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:6436
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Definition: fe.cpp:105
const double * GetPoints(const int p, const int btype)
Get the coordinates of the points of the given BasisType, btype.
Definition: fe.cpp:6601
H1Pos_TriangleElement(const int p)
Definition: fe.cpp:7742
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:3364
void SetMapType(int M)
Definition: fe.hpp:458
Cubic3DFiniteElement()
Construct a cubic FE on tetrahedron.
Definition: fe.cpp:2118
Linear1DFiniteElement()
Construct a linear FE on interval.
Definition: fe.cpp:955
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:4232
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:6023
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.cpp:1591
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.cpp:163
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:1209
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.hpp:2159
static void CalcShape(const int p, const double x, const double y, double *shape)
Definition: fe.cpp:7797
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:2613
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:2211
static const ScalarFiniteElement & CheckScalarFE(const FiniteElement &fe)
Definition: fe.hpp:441
int GetBasisType() const
Definition: fe.hpp:1665
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:3670
Implements CalcCurlShape methods.
Definition: fe.hpp:198
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:758
int Dof
Number of degrees of freedom.
Definition: fe.hpp:148
int dim
Definition: ex3.cpp:47
Class for bilinear FE on quad with nodes at the 4 Gaussian points.
Definition: fe.hpp:738
Class for refined linear FE on interval.
Definition: fe.hpp:1294
void SetIJK(const int *IJK) const
Definition: fe.hpp:2550
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
Class for refined linear FE on triangle.
Definition: fe.hpp:1314
Class for refined linear FE on tetrahedron.
Definition: fe.hpp:1334
void SetPatch(int p) const
Definition: fe.hpp:2552
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:1169
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:1180
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:1428
Class for constant FE on triangle.
Definition: fe.hpp:931
Definition: fe.hpp:2523
RefinedLinear1DFiniteElement()
Construct a quadratic FE on interval.
Definition: fe.cpp:4121
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:7161
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:7372
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2170
ND_HexahedronElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Definition: fe.cpp:9906
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:1695
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:8736
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:7520
Poly_1D::Basis & basis1d
Definition: fe.hpp:1653
static int GetTensorProductGeometry(int dim)
Definition: fe.hpp:1675
For scalar fields; preserves volume integrals.
Definition: fe.hpp:181
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2176
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:4148
VectorFiniteElement(int D, int G, int Do, int O, int M, int F=FunctionSpace::Pk)
Definition: fe.hpp:638
void mfem_error(const char *msg)
Function called when an error is encountered. Used by the macros MFEM_ABORT, MFEM_ASSERT, MFEM_VERIFY.
Definition: error.cpp:146
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:3303
static void ChebyshevPoints(const int p, double *x)
Definition: fe.cpp:6404
NURBSFiniteElement(int D, int G, int Do, int O, int F)
Definition: fe.hpp:2539
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:6160
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:3893
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:6001
Class for refined trilinear FE on a hexahedron.
Definition: fe.hpp:1367
ND_TetrahedronElement(const int p)
Definition: fe.cpp:10469
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:8822
const int * GetAnisotropicOrders() const
Returns an array containing the anisotropic orders/degrees.
Definition: fe.hpp:228
Class for quadratic FE on tetrahedron.
Definition: fe.hpp:986
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...
H1_QuadrilateralElement(const int p, const int btype=BasisType::GaussLobatto)
Definition: fe.cpp:6977
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:2406
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:949
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:2252
int GeomType
Geometry::Type of the reference element.
Definition: fe.hpp:143
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:1986
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.hpp:2411
const IntegrationRule & GetNodes() const
Definition: fe.hpp:270
Implements CalcDShape methods.
Definition: fe.hpp:196
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:5250
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:1250
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8493
static int VerifyOpen(int b_type)
Definition: fe.hpp:423
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:2418
Definition: fe.hpp:2124
Definition: fe.cpp:8348
const int * ijk
Definition: fe.hpp:2534
P0SegmentFiniteElement(int Ord=0)
Definition: fe.cpp:2553
static void CalcDShape(const int p, const double x, const double y, double *dshape_1d, double *dshape)
Definition: fe.cpp:7823
int GetDerivRangeType() const
Definition: fe.hpp:235
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:2905
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:11046
DenseMatrix curlshape
Definition: fe.hpp:565
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2419
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:1170
Class for linear FE on tetrahedron.
Definition: fe.hpp:961
H1_SegmentElement(const int p, const int btype=BasisType::GaussLobatto)
Definition: fe.cpp:6893
Class for linear FE on interval.
Definition: fe.hpp:661
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:9420
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:5301
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:189
Definition: fe.hpp:1034
Class for linear FE on triangle.
Definition: fe.hpp:681
Class for quadratic FE on triangle with nodes at the &quot;Gaussian&quot; points.
Definition: fe.hpp:816
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:8714
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:9159
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.hpp:2462
Nodes: x_i = i/(n-1), i=0,...,n-1.
Definition: fe.hpp:37
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:1850
L2_QuadrilateralElement(const int p, const int btype=BasisType::GaussLegendre)
Definition: fe.cpp:8241
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition: fe.hpp:2414
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.cpp:3562
Basis & GetBasis(const int p, const int btype)
Get a Poly_1D::Basis object of the given degree and BasisType, btype.
Definition: fe.cpp:6625
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.hpp:2365
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:1025
aka &quot;open half&quot; Newton-Cotes
Definition: intrules.hpp:278
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:2353
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:9494
const double * OpenPoints(const int p, const int btype=BasisType::GaussLegendre)
Definition: fe.hpp:1587
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:7683
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2216
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Definition: fe.cpp:1274
void ScalarLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I, const ScalarFiniteElement &fine_fe) const
&quot;Interpolation&quot; defined through local L2-projection.
Definition: fe.cpp:235
void SetElement(int e) const
Definition: fe.hpp:2554
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:1352
void ProjectGrad_ND(const double *tk, const Array< int > &d2t, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.cpp:839
L2_TetrahedronElement(const int p, const int btype=BasisType::GaussLegendre)
Definition: fe.cpp:8845
ScalarFiniteElement(int D, int G, int Do, int O, int F=FunctionSpace::Pk)
Definition: fe.hpp:449
void CalcPhysVShape(ElementTransformation &Trans, DenseMatrix &shape) const
Equivalent to the CalcVShape() method with the same arguments.
Definition: fe.hpp:292
static const int MaxDim
Definition: geom.hpp:35
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:8816
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2271
bool HasAnisotropicOrders() const
Returns true if the FiniteElement basis may be using different orders/degrees in different spatial di...
Definition: fe.hpp:225
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:1117
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:1952
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:11070
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:1366
int GetGeomType() const
Returns the Geometry::Type of the reference element.
Definition: fe.hpp:214
DenseMatrix m_dshape
Definition: fe.hpp:1859
int Dim
Dimension of reference space.
Definition: fe.hpp:143
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:10415
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:8372
IntegrationRule Nodes
Definition: fe.hpp:151
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2519
Array< int > dof_map
Definition: fe.hpp:1652
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:1236
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:8605
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:7264
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:7446
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:3614
int Orders[Geometry::MaxDim]
Anisotropic orders.
Definition: fe.hpp:150
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:10846
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:2774
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:4546
void LocalInterpolation_ND(const VectorFiniteElement &cfe, const double *tk, const Array< int > &d2t, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.cpp:899
Nodes: x_i = (i+1)/(n+1), i=0,...,n-1.
Definition: fe.hpp:36
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:401
ND_QuadrilateralElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Definition: fe.cpp:10277
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.cpp:2671
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Overrides the scalar CalcShape function to print an error.
Definition: fe.hpp:2496
void CalcVShape_ND(ElementTransformation &Trans, DenseMatrix &shape) const
Definition: fe.cpp:559
DenseMatrix Jinv
Definition: fe.hpp:564
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:1442
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2513
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8172
int GetDof() const
Returns the number of degrees of freedom in the finite element.
Definition: fe.hpp:217
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:7708
Definition: fe.hpp:832
Class for tri-linear FE on cube.
Definition: fe.hpp:999
Base class Coefficient that may optionally depend on time.
Definition: coefficient.hpp:31
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2516
static bool IsClosedType(int b_type)
Definition: fe.hpp:403
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:1120
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:1257
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:5331
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:9011
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:179
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:1029
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:987
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:4716
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:4413
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:943
static const int * Binom(const int p)
Get a pointer to an array containing the binomial coefficients &quot;p choose k&quot; for k=0,...,p for the given p.
Definition: fe.cpp:6387
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:3464
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:54
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:1055
H1_TetrahedronElement(const int p, const int btype=BasisType::GaussLobatto)
Definition: fe.cpp:7572
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2120
virtual void SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
Definition: fe.cpp:11027
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition: fe.hpp:2311
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:1396
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:8920
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:10124
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:2838
FiniteElement(int D, int G, int Do, int O, int F=FunctionSpace::Pk)
Definition: fe.cpp:25
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:1477
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:2498
Class for bilinear FE on quadrilateral.
Definition: fe.hpp:703
static int CheckOpen(int type)
If the Quadrature1D type is not open return Invalid; otherwise return type.
Definition: intrules.cpp:811
Refined tensor products of polynomials of order k.
Definition: fe.hpp:129
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.hpp:530
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2117
const Array< int > & GetDofMap() const
Get an Array&lt;int&gt; that maps lexicographically ordered indices to the indices of the respective nodes/...
Definition: fe.hpp:1673
Construct a quadratic FE on interval.
Definition: fe.cpp:1161
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:2500
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:7401
virtual void GetFaceDofs(int face, int **dofs, int *ndofs) const
Definition: fe.cpp:100
Class for linear FE on triangle with nodes at the 3 &quot;Gaussian&quot; points.
Definition: fe.hpp:727
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition: fe.hpp:2208
static char GetChar(int b_type)
Check and convert a BasisType constant to a char basis identifier.
Definition: fe.hpp:97
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:1109
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.hpp:2307
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:1191
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:1016
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:68
Definition: fe.cpp:7311
H1_TriangleElement(const int p, const int btype=BasisType::GaussLobatto)
Definition: fe.cpp:7453
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2470
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2422
Class for integration point with weight.
Definition: intrules.hpp:25
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:969
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8765
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.cpp:136
const Poly_1D::Basis & GetBasis1D() const
Definition: fe.hpp:1667
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:7422
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:8223
static bool IsOpenType(int b_type)
Definition: fe.hpp:410
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.hpp:490
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:2319
Definition: fe.hpp:871
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:1144
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:8626
void Project_RT(const double *nk, const Array< int > &d2n, VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:570
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:7116
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition: fe.hpp:534
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:1144
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2268
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:3278
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:10617
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:3038
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:10366
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:698
static int VerifyClosed(int b_type)
Definition: fe.hpp:417
Definition: fe.hpp:2480
virtual void ProjectDiv(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &div) const
Definition: fe.cpp:426
int DerivRangeType
Definition: fe.hpp:143
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.cpp:2786
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2376
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8234
RefinedLinear2DFiniteElement()
Construct a quadratic FE on triangle.
Definition: fe.cpp:4167
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:5955
void ProjectCurl_2D(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.cpp:276
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2373
Definition: fe.hpp:2331
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:4129
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:3857
Array< int > dof_map
Definition: fe.hpp:1861
RT_TetrahedronElement(const int p)
Definition: fe.cpp:9722
Nodes: x_i = (i+1/2)/n, i=0,...,n-1.
Definition: fe.hpp:38
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.cpp:5511
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:4062
Vector & Weights() const
Definition: fe.hpp:2556
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 GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition: fe.hpp:2109
Definition: fe.cpp:1381
virtual void GetFaceDofs(int face, int **dofs, int *ndofs) const
Definition: fe.cpp:2373
Tensor products of 1D FEs (only degree 2 is functional)
Definition: fe.hpp:1273
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:3075
P0TriangleFiniteElement()
Construct P0 triangle finite element.
Definition: fe.cpp:2285
static int VerifyNodal(int b_type)
Definition: fe.hpp:428
aka open Newton-Cotes
Definition: intrules.hpp:276
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2476
virtual void SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
Definition: fe.hpp:2558
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:2559
static int Pow(int base, int dim)
Return base raised to the power dim.
Definition: fe.hpp:1687
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2219
RT_TriangleElement(const int p)
Definition: fe.cpp:9569
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:6911
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:10907
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2318
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2322
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:10198
void Eval(const double x, Vector &u) const
Definition: fe.cpp:6253
L2Pos_SegmentElement(const int p)
Definition: fe.cpp:8196
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:4326
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:5566
Class for cubic FE on tetrahedron.
Definition: fe.hpp:918
Vector data type.
Definition: vector.hpp:48
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:5497
static void CalcBernstein(const int p, const double x, double *u)
Definition: fe.hpp:1638
virtual void SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
Definition: fe.cpp:10957
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2326
int GetDerivType() const
Definition: fe.hpp:239
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:7331
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:8469
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:1302
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:9647
Construct a quadratic FE on triangle.
Definition: fe.cpp:1219
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2379
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2265
Describes the space on each element.
Definition: fe.hpp:122
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:2514
Bernstein polynomials.
Definition: fe.hpp:35
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition: fe.cpp:117
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.hpp:2505
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:5416
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:8391
static const VectorFiniteElement & CheckVectorFE(const FiniteElement &fe)
Definition: fe.hpp:630
RT_HexahedronElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Definition: fe.cpp:9256
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:10659
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:3914
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:1620
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:995
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:2183
NodalFiniteElement(int D, int G, int Do, int O, int F=FunctionSpace::Pk)
Definition: fe.hpp:487
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:2624
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:7042
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:1017
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:5467
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:3682
RT_QuadrilateralElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Definition: fe.cpp:9045
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:722
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition: fe.hpp:2465
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:4597
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:10972
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition: fe.hpp:2368
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.hpp:2205
Definition: fe.hpp:2429
void Project_ND(const double *tk, const Array< int > &d2t, VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:749
int GetRangeType() const
Definition: fe.hpp:233
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
int Order
Order/degree of the shape functions.
Definition: fe.hpp:148
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:2980
static void CalcBasis(const int p, const double x, double *u, double *d)
Definition: fe.hpp:1615
A Class that defines 1-D numerical quadrature rules on [0,1].
Definition: intrules.hpp:245
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2425
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:3887
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:7137
Definition: fe.hpp:2223
L2_HexahedronElement(const int p, const int btype=BasisType::GaussLegendre)
Definition: fe.cpp:8426
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:7020
static void CalcDBinomTerms(const int p, const double x, const double y, double *d)
Definition: fe.cpp:6500
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:5080
TriLinear3DFiniteElement()
Construct a tri-linear FE on cube.
Definition: fe.cpp:2462
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:142
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:1199
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:8448
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:2154
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:4184
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:3643
aka closed Newton-Cotes
Definition: intrules.hpp:277
L2_TriangleElement(const int p, const int btype=BasisType::GaussLegendre)
Definition: fe.cpp:8669
BiLinear2DFiniteElement()
Construct a bilinear FE on quadrilateral.
Definition: fe.cpp:1003
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:2457
Poly_1D poly1d
Definition: fe.cpp:6672
Crouzeix-Raviart finite element on triangle.
Definition: fe.hpp:1022
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:6143
Lagrange1DFiniteElement(int degree)
Definition: fe.cpp:3695
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:2723
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:5836
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:9029
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8299
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:1065
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:979
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:7542
void ProjectGrad_RT(const double *nk, const Array< int > &d2n, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.cpp:665
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:458