MFEM  v4.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
fe.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3 // reserved. See file COPYRIGHT for details.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability see http://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the GNU Lesser General Public License (as published by the Free
10 // Software Foundation) version 2.1 dated February 1999.
11 
12 #ifndef MFEM_FE
13 #define MFEM_FE
14 
15 #include "../config/config.hpp"
16 #include "../general/array.hpp"
17 #include "../linalg/linalg.hpp"
18 #include "intrules.hpp"
19 #include "geom.hpp"
20 
21 #include <map>
22 
23 namespace mfem
24 {
25 
26 /// 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. */
60  static int GetQuadrature1D(int b_type)
61  {
62  switch (b_type)
63  {
66  case Positive: return Quadrature1D::ClosedUniform; // <-----
70  }
71  return Quadrature1D::Invalid;
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 
120 /** @brief Structure representing the matrices/tensors needed to evaluate (in
121  reference space) the values, gradients, divergences, or curls of a
122  FiniteElement at a the quadrature points of a given IntegrationRule. */
123 /** Object of this type are typically created and owned by the respective
124  FiniteElement object. */
126 {
127 public:
128  /// The FiniteElement that created and owns this object.
129  /** This pointer is not owned. */
130  const class FiniteElement *FE;
131 
132  /** @brief IntegrationRule that defines the quadrature points at which the
133  basis functions of the #FE are evaluated. */
134  /** This pointer is not owned. */
136 
137  /// Type of data stored in the arrays #B, #Bt, #G, and #Gt.
138  enum Mode
139  {
140  /** @brief Full multidimensional representation which does not use tensor
141  product structure. The ordering of the degrees of freedom is as
142  defined by #FE */
144 
145  /** @brief Tensor product representation using 1D matrices/tensors with
146  dimensions using 1D number of quadrature points and degrees of
147  freedom. */
148  /** When representing a vector-valued FiniteElement, two DofToQuad objects
149  are used to describe the "closed" and "open" 1D basis functions
150  (TODO). */
152  };
153 
154  /// Describes the contents of the #B, #Bt, #G, and #Gt arrays, see #Mode.
156 
157  /** @brief Number of degrees of freedom = number of basis functions. When
158  #mode is TENSOR, this is the 1D number. */
159  int ndof;
160 
161  /** @brief Number of quadrature points. When #mode is TENSOR, this is the 1D
162  number. */
163  int nqpt;
164 
165  /// Basis functions evaluated at quadrature points.
166  /** The storage layout is column-major with dimensions:
167  - #nqpt x #ndof, for scalar elements, or
168  - #nqpt x dim x #ndof, for vector elements, (TODO)
169 
170  where
171 
172  - dim = dimension of the finite element reference space when #mode is
173  FULL, and dim = 1 when #mode is TENSOR. */
175 
176  /// Transpose of #B.
177  /** The storage layout is column-major with dimensions:
178  - #ndof x #nqpt, for scalar elements, or
179  - #ndof x #nqpt x dim, for vector elements (TODO). */
181 
182  /** @brief Gradients/divergences/curls of basis functions evaluated at
183  quadrature points. */
184  /** The storage layout is column-major with dimensions:
185  - #nqpt x dim x #ndof, for scalar elements, or
186  - #nqpt x #ndof, for H(div) vector elements (TODO), or
187  - #nqpt x cdim x #ndof, for H(curl) vector elements (TODO),
188 
189  where
190 
191  - dim = dimension of the finite element reference space when #mode is
192  FULL, and 1 when #mode is TENSOR,
193  - cdim = 1/1/3 in 1D/2D/3D, respectively, when #mode is FULL, and cdim =
194  1 when #mode is TENSOR. */
196 
197  /// Transpose of #G.
198  /** The storage layout is column-major with dimensions:
199  - #ndof x #nqpt x dim, for scalar elements, or
200  - #ndof x #nqpt, for H(div) vector elements (TODO), or
201  - #ndof x #nqpt x cdim, for H(curl) vector elements (TODO). */
203 };
204 
205 
206 /// Describes the space on each element
208 {
209 public:
210  enum
211  {
212  Pk, ///< Polynomials of order k
213  Qk, ///< Tensor products of polynomials of order k
214  rQk ///< Refined tensor products of polynomials of order k
215  };
216 };
217 
218 class ElementTransformation;
219 class Coefficient;
220 class VectorCoefficient;
221 class MatrixCoefficient;
222 class KnotVector;
223 
224 
225 // Base and derived classes for finite elements
226 
227 
228 /// Abstract class for Finite Elements
230 {
231 protected:
232  int Dim; ///< Dimension of reference space
233  Geometry::Type GeomType; ///< Geometry::Type of the reference element
236  mutable
237  int Dof, ///< Number of degrees of freedom
238  Order; ///< Order/degree of the shape functions
239  mutable int Orders[Geometry::MaxDim]; ///< Anisotropic orders
241 #ifndef MFEM_THREAD_SAFE
242  mutable DenseMatrix vshape; // Dof x Dim
243 #endif
244  /// Container for all DofToQuad objects created by the FiniteElement.
245  /** Multiple DofToQuad objects may be needed when different quadrature rules
246  or different DofToQuad::Mode are used. */
248 
249 public:
250  /// Enumeration for RangeType and DerivRangeType
251  enum { SCALAR, VECTOR };
252 
253  /** @brief Enumeration for MapType: defines how reference functions are
254  mapped to physical space.
255 
256  A reference function, `uh(xh)`, can be mapped to a function, `u(x)`, on a
257  general physical element in following ways:
258 
259  VALUE u(x) = uh(xh)
260  INTEGRAL u(x) = (1/w) * uh(xh)
261  H_DIV u(x) = (J/w) * uh(xh)
262  H_CURL u(x) = J^{-t} * uh(xh) (square J)
263  H_CURL u(x) = J*(J^t*J)^{-1} * uh(xh) (general J)
264 
265  where
266 
267  x = T(xh) is the image of the reference point xh ("x hat"),
268  J = J(xh) is the Jacobian matrix of the transformation T, and
269  w = w(xh) = / det(J), for square J,
270  \ det(J^t*J)^{1/2}, for general J,
271  is the transformation weight factor.
272  */
273  enum { VALUE, ///< For scalar fields; preserves point values
274  INTEGRAL, ///< For scalar fields; preserves volume integrals
275  H_DIV, /**< For vector fields; preserves surface integrals of the
276  normal component */
277  H_CURL /**< For vector fields; preserves line integrals of the
278  tangential component */
279  };
280 
281  /** @brief Enumeration for DerivType: defines which derivative method
282  is implemented.
283 
284  Each FiniteElement class implements only one type of derivative. The
285  value returned by GetDerivType() indicates which derivative method is
286  implemented.
287  */
288  enum { NONE, ///< No derivatives implemented
289  GRAD, ///< Implements CalcDShape methods
290  DIV, ///< Implements CalcDivShape methods
291  CURL ///< Implements CalcCurlShape methods
292  };
293 
294  /** Construct FiniteElement with given
295  @param D Reference space dimension
296  @param G Geometry type (of type Geometry::Type)
297  @param Do Number of degrees of freedom in the FiniteElement
298  @param O Order/degree of the FiniteElement
299  @param F FunctionSpace type of the FiniteElement
300  */
301  FiniteElement(int D, Geometry::Type G, int Do, int O,
302  int F = FunctionSpace::Pk);
303 
304  /// Returns the reference space dimension for the finite element
305  int GetDim() const { return Dim; }
306 
307  /// Returns the Geometry::Type of the reference element
308  Geometry::Type GetGeomType() const { return GeomType; }
309 
310  /// Returns the number of degrees of freedom in the finite element
311  int GetDof() const { return Dof; }
312 
313  /** @brief Returns the order of the finite element. In the case of
314  anisotropic orders, returns the maximum order. */
315  int GetOrder() const { return Order; }
316 
317  /** @brief Returns true if the FiniteElement basis *may be using* different
318  orders/degrees in different spatial directions. */
319  bool HasAnisotropicOrders() const { return Orders[0] != -1; }
320 
321  /// Returns an array containing the anisotropic orders/degrees.
322  const int *GetAnisotropicOrders() const { return Orders; }
323 
324  /// Returns the type of space on each element
325  int Space() const { return FuncSpace; }
326 
327  int GetRangeType() const { return RangeType; }
328 
329  int GetDerivRangeType() const { return DerivRangeType; }
330 
331  int GetMapType() const { return MapType; }
332 
333  int GetDerivType() const { return DerivType; }
334 
335  int GetDerivMapType() const { return DerivMapType; }
336 
337  /** @brief Evaluate the values of all shape functions of a scalar finite
338  element in reference space at the given point @a ip. */
339  /** The size (#Dof) of the result Vector @a shape must be set in advance. */
340  virtual void CalcShape(const IntegrationPoint &ip,
341  Vector &shape) const = 0;
342 
343  /** @brief Evaluate the values of all shape functions of a scalar finite
344  element in physical space at the point described by @a Trans. */
345  /** The size (#Dof) of the result Vector @a shape must be set in advance. */
346  void CalcPhysShape(ElementTransformation &Trans, Vector &shape) const;
347 
348  /** @brief Evaluate the gradients of all shape functions of a scalar finite
349  element in reference space at the given point @a ip. */
350  /** Each row of the result DenseMatrix @a dshape contains the derivatives of
351  one shape function. The size (#Dof x #Dim) of @a dshape must be set in
352  advance. */
353  virtual void CalcDShape(const IntegrationPoint &ip,
354  DenseMatrix &dshape) const = 0;
355 
356  /** @brief Evaluate the gradients of all shape functions of a scalar finite
357  element in physical space at the point described by @a Trans. */
358  /** Each row of the result DenseMatrix @a dshape contains the derivatives of
359  one shape function. The size (#Dof x SDim) of @a dshape must be set in
360  advance, where SDim >= #Dim is the physical space dimension as described
361  by @a Trans. */
363 
364  const IntegrationRule & GetNodes() const { return Nodes; }
365 
366  // virtual functions for finite elements on vector spaces
367 
368  /** @brief Evaluate the values of all shape functions of a *vector* finite
369  element in reference space at the given point @a ip. */
370  /** Each row of the result DenseMatrix @a shape contains the components of
371  one vector shape function. The size (#Dof x #Dim) of @a shape must be set
372  in advance. */
373  virtual void CalcVShape(const IntegrationPoint &ip,
374  DenseMatrix &shape) const;
375 
376  /** @brief Evaluate the values of all shape functions of a *vector* finite
377  element in physical space at the point described by @a Trans. */
378  /** Each row of the result DenseMatrix @a shape contains the components of
379  one vector shape function. The size (#Dof x SDim) of @a shape must be set
380  in advance, where SDim >= #Dim is the physical space dimension as
381  described by @a Trans. */
382  virtual void CalcVShape(ElementTransformation &Trans,
383  DenseMatrix &shape) const;
384 
385  /// Equivalent to the CalcVShape() method with the same arguments.
387  { CalcVShape(Trans, shape); }
388 
389  /** @brief Evaluate the divergence of all shape functions of a *vector*
390  finite element in reference space at the given point @a ip. */
391  /** The size (#Dof) of the result Vector @a divshape must be set in advance.
392  */
393  virtual void CalcDivShape(const IntegrationPoint &ip,
394  Vector &divshape) const;
395 
396  /** @brief Evaluate the divergence of all shape functions of a *vector*
397  finite element in physical space at the point described by @a Trans. */
398  /** The size (#Dof) of the result Vector @a divshape must be set in advance.
399  */
400  void CalcPhysDivShape(ElementTransformation &Trans, Vector &divshape) const;
401 
402  /** @brief Evaluate the curl of all shape functions of a *vector* finite
403  element in reference space at the given point @a ip. */
404  /** Each row of the result DenseMatrix @a curl_shape contains the components
405  of the curl of one vector shape function. The size (#Dof x CDim) of
406  @a curl_shape must be set in advance, where CDim = 3 for #Dim = 3 and
407  CDim = 1 for #Dim = 2. */
408  virtual void CalcCurlShape(const IntegrationPoint &ip,
409  DenseMatrix &curl_shape) const;
410 
411  /** @brief Evaluate the curl of all shape functions of a *vector* finite
412  element in physical space at the point described by @a Trans. */
413  /** Each row of the result DenseMatrix @a curl_shape contains the components
414  of the curl of one vector shape function. The size (#Dof x CDim) of
415  @a curl_shape must be set in advance, where CDim = 3 for #Dim = 3 and
416  CDim = 1 for #Dim = 2. */
418  DenseMatrix &curl_shape) const;
419 
420  virtual void GetFaceDofs(int face, int **dofs, int *ndofs) const;
421 
422  /** each row of h contains the upper triangular part of the hessian
423  of one shape function; the order in 2D is {u_xx, u_xy, u_yy} */
424  virtual void CalcHessian (const IntegrationPoint &ip,
425  DenseMatrix &h) const;
426 
427  /** @brief Return the local interpolation matrix @a I (Dof x Dof) where the
428  fine element is the image of the base geometry under the given
429  transformation. */
431  DenseMatrix &I) const;
432 
433  /** @brief Return a local restriction matrix @a R (Dof x Dof) mapping fine
434  dofs to coarse dofs.
435 
436  The fine element is the image of the base geometry under the given
437  transformation, @a Trans.
438 
439  The assumption in this method is that a subset of the coarse dofs can be
440  expressed only in terms of the dofs of the given fine element.
441 
442  Rows in @a R corresponding to coarse dofs that cannot be expressed in
443  terms of the fine dofs will be marked as invalid by setting the first
444  entry (column 0) in the row to infinity().
445 
446  This method assumes that the dimensions of @a R are set before it is
447  called. */
449  DenseMatrix &R) const;
450 
451  /** @brief Return interpolation matrix, @a I, which maps dofs from a coarse
452  element, @a fe, to the fine dofs on @a this finite element. */
453  /** @a Trans represents the mapping from the reference element of @a this
454  element into a subset of the reference space of the element @a fe, thus
455  allowing the "coarse" FiniteElement to be different from the "fine"
456  FiniteElement as when h-refinement is combined with p-refinement or
457  p-derefinement. It is assumed that both finite elements use the same
458  MapType. */
459  virtual void GetTransferMatrix(const FiniteElement &fe,
461  DenseMatrix &I) const;
462 
463  /** Given a coefficient and a transformation, compute its projection
464  (approximation) in the local finite dimensional space in terms
465  of the degrees of freedom. */
466  virtual void Project (Coefficient &coeff,
467  ElementTransformation &Trans, Vector &dofs) const;
468 
469  /** Given a vector coefficient and a transformation, compute its
470  projection (approximation) in the local finite dimensional space
471  in terms of the degrees of freedom. (VectorFiniteElements) */
472  virtual void Project (VectorCoefficient &vc,
473  ElementTransformation &Trans, Vector &dofs) const;
474 
475  /** Given a matrix coefficient and a transformation, compute an approximation
476  ("projection") in the local finite dimensional space in terms of the
477  degrees of freedom. For VectorFiniteElements, the rows of the coefficient
478  are projected in the vector space. */
479  virtual void ProjectMatrixCoefficient(
480  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const;
481 
482  /** Compute a representation (up to multiplicative constant) for
483  the delta function at the vertex with the given index. */
484  virtual void ProjectDelta(int vertex, Vector &dofs) const;
485 
486  /** Compute the embedding/projection matrix from the given FiniteElement
487  onto 'this' FiniteElement. The ElementTransformation is included to
488  support cases when the projection depends on it. */
489  virtual void Project(const FiniteElement &fe, ElementTransformation &Trans,
490  DenseMatrix &I) const;
491 
492  /** Compute the discrete gradient matrix from the given FiniteElement onto
493  'this' FiniteElement. The ElementTransformation is included to support
494  cases when the matrix depends on it. */
495  virtual void ProjectGrad(const FiniteElement &fe,
497  DenseMatrix &grad) const;
498 
499  /** Compute the discrete curl matrix from the given FiniteElement onto
500  'this' FiniteElement. The ElementTransformation is included to support
501  cases when the matrix depends on it. */
502  virtual void ProjectCurl(const FiniteElement &fe,
504  DenseMatrix &curl) const;
505 
506  /** Compute the discrete divergence matrix from the given FiniteElement onto
507  'this' FiniteElement. The ElementTransformation is included to support
508  cases when the matrix depends on it. */
509  virtual void ProjectDiv(const FiniteElement &fe,
511  DenseMatrix &div) const;
512 
513  /** Return a DofToQuad structure corresponding to the given IntegrationRule
514  using the given DofToQuad::Mode. */
515  /** See the documentation for DofToQuad for more details. */
516  virtual const DofToQuad &GetDofToQuad(const IntegrationRule &ir,
517  DofToQuad::Mode mode) const;
518 
519  virtual ~FiniteElement();
520 
521  static bool IsClosedType(int b_type)
522  {
523  const int q_type = BasisType::GetQuadrature1D(b_type);
524  return ((q_type != Quadrature1D::Invalid) &&
526  }
527 
528  static bool IsOpenType(int b_type)
529  {
530  const int q_type = BasisType::GetQuadrature1D(b_type);
531  return ((q_type != Quadrature1D::Invalid) &&
533  }
534 
535  static int VerifyClosed(int b_type)
536  {
537  MFEM_VERIFY(IsClosedType(b_type),
538  "invalid closed basis type: " << b_type);
539  return b_type;
540  }
541  static int VerifyOpen(int b_type)
542  {
543  MFEM_VERIFY(IsOpenType(b_type), "invalid open basis type: " << b_type);
544  return b_type;
545  }
546  static int VerifyNodal(int b_type)
547  {
548  return BasisType::CheckNodal(b_type);
549  }
550 };
551 
553 {
554 protected:
555 #ifndef MFEM_THREAD_SAFE
556  mutable Vector c_shape;
557 #endif
558 
560  {
561  if (fe.GetRangeType() != SCALAR)
562  { mfem_error("'fe' must be a ScalarFiniteElement"); }
563  return static_cast<const ScalarFiniteElement &>(fe);
564  }
565 
566  const DofToQuad &GetTensorDofToQuad(const class TensorBasisElement &tb,
567  const IntegrationRule &ir,
568  DofToQuad::Mode mode) const;
569 
570 public:
572  int F = FunctionSpace::Pk)
573 #ifdef MFEM_THREAD_SAFE
574  : FiniteElement(D, G, Do, O, F)
576 #else
577  : FiniteElement(D, G, Do, O, F), c_shape(Dof)
579 #endif
580 
581  void SetMapType(int M)
582  {
583  MFEM_VERIFY(M == VALUE || M == INTEGRAL, "unknown MapType");
584  MapType = M;
585  DerivType = (M == VALUE) ? GRAD : NONE;
586  }
587 
588  /// Nodal interpolation.
590  DenseMatrix &I,
591  const ScalarFiniteElement &fine_fe) const;
592 
593  /// "Interpolation" defined through local L2-projection.
594  /** If the "fine" elements cannot represent all basis functions of the
595  "coarse" element, then boundary values from different sub-elements are
596  generally different. */
598  DenseMatrix &I,
599  const ScalarFiniteElement &fine_fe) const;
600 
601  virtual const DofToQuad &GetDofToQuad(const IntegrationRule &ir,
602  DofToQuad::Mode mode) const;
603 };
604 
606 {
607 protected:
608  void ProjectCurl_2D(const FiniteElement &fe,
610  DenseMatrix &curl) const;
611 
612 public:
614  int F = FunctionSpace::Pk)
615  : ScalarFiniteElement(D, G, Do, O, F) { }
616 
618  DenseMatrix &I) const
619  { NodalLocalInterpolation(Trans, I, *this); }
620 
621  virtual void GetLocalRestriction(ElementTransformation &Trans,
622  DenseMatrix &R) const;
623 
624  virtual void GetTransferMatrix(const FiniteElement &fe,
625  ElementTransformation &Trans,
626  DenseMatrix &I) const
627  { CheckScalarFE(fe).NodalLocalInterpolation(Trans, I, *this); }
628 
629  virtual void Project (Coefficient &coeff,
630  ElementTransformation &Trans, Vector &dofs) const;
631 
632  virtual void Project (VectorCoefficient &vc,
633  ElementTransformation &Trans, Vector &dofs) const;
634 
635  // (mc.height x mc.width) @ DOFs -> (Dof x mc.width x mc.height) in dofs
636  virtual void ProjectMatrixCoefficient(
637  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const;
638 
639  virtual void Project(const FiniteElement &fe, ElementTransformation &Trans,
640  DenseMatrix &I) const;
641 
642  virtual void ProjectGrad(const FiniteElement &fe,
643  ElementTransformation &Trans,
644  DenseMatrix &grad) const;
645 
646  virtual void ProjectDiv(const FiniteElement &fe,
647  ElementTransformation &Trans,
648  DenseMatrix &div) const;
649 };
650 
651 
653 {
654 public:
656  int F = FunctionSpace::Pk) :
657  ScalarFiniteElement(D, G, Do, O, F)
658  { }
659 
661  DenseMatrix &I) const
662  { ScalarLocalInterpolation(Trans, I, *this); }
663 
664  virtual void GetTransferMatrix(const FiniteElement &fe,
666  DenseMatrix &I) const
667  { CheckScalarFE(fe).ScalarLocalInterpolation(Trans, I, *this); }
668 
670 
671  // Low-order monotone "projection" (actually it is not a projection): the
672  // dofs are set to be the Coefficient values at the nodes.
673  virtual void Project(Coefficient &coeff,
674  ElementTransformation &Trans, Vector &dofs) const;
675 
676  virtual void Project (VectorCoefficient &vc,
677  ElementTransformation &Trans, Vector &dofs) const;
678 
679  virtual void Project(const FiniteElement &fe, ElementTransformation &Trans,
680  DenseMatrix &I) const;
681 };
682 
684 {
685  // Hide the scalar functions CalcShape and CalcDShape.
686 private:
687  /// Overrides the scalar CalcShape function to print an error.
688  virtual void CalcShape(const IntegrationPoint &ip,
689  Vector &shape) const;
690 
691  /// Overrides the scalar CalcDShape function to print an error.
692  virtual void CalcDShape(const IntegrationPoint &ip,
693  DenseMatrix &dshape) const;
694 
695 protected:
696 #ifndef MFEM_THREAD_SAFE
697  mutable DenseMatrix J, Jinv;
699 #endif
700  void SetDerivMembers();
701 
703  DenseMatrix &shape) const;
704 
706  DenseMatrix &shape) const;
707 
708  void Project_RT(const double *nk, const Array<int> &d2n,
710  Vector &dofs) const;
711 
712  // project the rows of the matrix coefficient in an RT space
714  const double *nk, const Array<int> &d2n,
715  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const;
716 
717  void Project_RT(const double *nk, const Array<int> &d2n,
719  DenseMatrix &I) const;
720 
721  // rotated gradient in 2D
722  void ProjectGrad_RT(const double *nk, const Array<int> &d2n,
724  DenseMatrix &grad) const;
725 
726  // Compute the curl as a discrete operator from ND FE (fe) to ND FE (this).
727  // The natural FE for the range is RT, so this is an approximation.
728  void ProjectCurl_ND(const double *tk, const Array<int> &d2t,
730  DenseMatrix &curl) const;
731 
732  void ProjectCurl_RT(const double *nk, const Array<int> &d2n,
734  DenseMatrix &curl) const;
735 
736  void Project_ND(const double *tk, const Array<int> &d2t,
738  Vector &dofs) const;
739 
740  // project the rows of the matrix coefficient in an ND space
742  const double *tk, const Array<int> &d2t,
743  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const;
744 
745  void Project_ND(const double *tk, const Array<int> &d2t,
747  DenseMatrix &I) const;
748 
749  void ProjectGrad_ND(const double *tk, const Array<int> &d2t,
751  DenseMatrix &grad) const;
752 
754  const double *nk, const Array<int> &d2n,
756  DenseMatrix &I) const;
757 
759  const double *tk, const Array<int> &d2t,
761  DenseMatrix &I) const;
762 
763  void LocalRestriction_RT(const double *nk, const Array<int> &d2n,
765  DenseMatrix &R) const;
766 
767  void LocalRestriction_ND(const double *tk, const Array<int> &d2t,
769  DenseMatrix &R) const;
770 
772  {
773  if (fe.GetRangeType() != VECTOR)
774  { mfem_error("'fe' must be a VectorFiniteElement"); }
775  return static_cast<const VectorFiniteElement &>(fe);
776  }
777 
778 public:
779  VectorFiniteElement (int D, Geometry::Type G, int Do, int O, int M,
780  int F = FunctionSpace::Pk) :
781 #ifdef MFEM_THREAD_SAFE
782  FiniteElement(D, G, Do, O, F)
783  { RangeType = VECTOR; MapType = M; SetDerivMembers(); }
784 #else
785  FiniteElement(D, G, Do, O, F), Jinv(D)
786  { RangeType = VECTOR; MapType = M; SetDerivMembers(); }
787 #endif
788 };
789 
791 {
792 public:
794 
795  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
796 
797  virtual void CalcDShape(const IntegrationPoint &ip,
798  DenseMatrix &dshape) const;
799 };
800 
801 /// Class for linear FE on interval
803 {
804 public:
805  /// Construct a linear FE on interval
807 
808  /** virtual function which evaluates the values of all
809  shape functions at a given point ip and stores
810  them in the vector shape of dimension Dof (2) */
811  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
812 
813  /** virtual function which evaluates the derivatives of all
814  shape functions at a given point ip and stores them in
815  the matrix dshape (Dof x Dim) (2 x 1) so that each row
816  contains the derivative of one shape function */
817  virtual void CalcDShape(const IntegrationPoint &ip,
818  DenseMatrix &dshape) const;
819 };
820 
821 /// Class for linear FE on triangle
823 {
824 public:
825  /// Construct a linear FE on triangle
827 
828  /** virtual function which evaluates the values of all
829  shape functions at a given point ip and stores
830  them in the vector shape of dimension Dof (3) */
831  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
832 
833  /** virtual function which evaluates the values of all
834  partial derivatives of all shape functions at a given
835  point ip and stores them in the matrix dshape (Dof x Dim) (3 x 2)
836  so that each row contains the derivatives of one shape function */
837  virtual void CalcDShape(const IntegrationPoint &ip,
838  DenseMatrix &dshape) const;
839  virtual void ProjectDelta(int vertex, Vector &dofs) const
840  { dofs = 0.0; dofs(vertex) = 1.0; }
841 };
842 
843 /// Class for bilinear FE on quadrilateral
845 {
846 public:
847  /// Construct a bilinear FE on quadrilateral
849 
850  /** virtual function which evaluates the values of all
851  shape functions at a given point ip and stores
852  them in the vector shape of dimension Dof (4) */
853  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
854 
855  /** virtual function which evaluates the values of all
856  partial derivatives of all shape functions at a given
857  point ip and stores them in the matrix dshape (Dof x Dim) (4 x 2)
858  so that each row contains the derivatives of one shape function */
859  virtual void CalcDShape(const IntegrationPoint &ip,
860  DenseMatrix &dshape) const;
861  virtual void CalcHessian (const IntegrationPoint &ip,
862  DenseMatrix &h) const;
863  virtual void ProjectDelta(int vertex, Vector &dofs) const
864  { dofs = 0.0; dofs(vertex) = 1.0; } // { dofs = 1.0; }
865 };
866 
867 /// Class for linear FE on triangle with nodes at the 3 "Gaussian" points
869 {
870 public:
872  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
873  virtual void CalcDShape(const IntegrationPoint &ip,
874  DenseMatrix &dshape) const;
875  virtual void ProjectDelta(int vertex, Vector &dofs) const;
876 };
877 
878 /// Class for bilinear FE on quad with nodes at the 4 Gaussian points
880 {
881 private:
882  static const double p[2];
883 
884 public:
886  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
887  virtual void CalcDShape(const IntegrationPoint &ip,
888  DenseMatrix &dshape) const;
889  virtual void ProjectDelta(int vertex, Vector &dofs) const;
890 };
891 
893 {
894 public:
896  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
897  virtual void CalcDShape(const IntegrationPoint &ip,
898  DenseMatrix &dshape) const;
899  virtual void ProjectDelta(int vertex, Vector &dofs) const
900  { dofs = 1.0; }
901 };
902 
903 /// Class for quadratic FE on interval
905 {
906 public:
907  /// Construct a quadratic FE on interval
909 
910  /** virtual function which evaluates the values of all
911  shape functions at a given point ip and stores
912  them in the vector shape of dimension Dof (3) */
913  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
914 
915  /** virtual function which evaluates the derivatives of all
916  shape functions at a given point ip and stores them in
917  the matrix dshape (Dof x Dim) (3 x 1) so that each row
918  contains the derivative of one shape function */
919  virtual void CalcDShape(const IntegrationPoint &ip,
920  DenseMatrix &dshape) const;
921 };
922 
924 {
925 public:
927  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
928  virtual void CalcDShape(const IntegrationPoint &ip,
929  DenseMatrix &dshape) const;
930 };
931 
932 /// Class for quadratic FE on triangle
934 {
935 public:
936  /// Construct a quadratic FE on triangle
938 
939  /** virtual function which evaluates the values of all
940  shape functions at a given point ip and stores
941  them in the vector shape of dimension Dof (6) */
942  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
943 
944  /** virtual function which evaluates the values of all
945  partial derivatives of all shape functions at a given
946  point ip and stores them in the matrix dshape (Dof x Dim) (6 x 2)
947  so that each row contains the derivatives of one shape function */
948  virtual void CalcDShape(const IntegrationPoint &ip,
949  DenseMatrix &dshape) const;
950 
951  virtual void CalcHessian (const IntegrationPoint &ip,
952  DenseMatrix &h) const;
953  virtual void ProjectDelta(int vertex, Vector &dofs) const;
954 };
955 
956 /// Class for quadratic FE on triangle with nodes at the "Gaussian" points
958 {
959 private:
960  static const double p[2];
961  DenseMatrix A;
962  mutable DenseMatrix D;
963  mutable Vector pol;
964 public:
966  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
967  virtual void CalcDShape(const IntegrationPoint &ip,
968  DenseMatrix &dshape) const;
969  // virtual void ProjectDelta(int vertex, Vector &dofs) const;
970 };
971 
972 /// Class for bi-quadratic FE on quadrilateral
974 {
975 public:
976  /// Construct a biquadratic FE on quadrilateral
978 
979  /** virtual function which evaluates the values of all
980  shape functions at a given point ip and stores
981  them in the vector shape of dimension Dof (9) */
982  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
983 
984  /** virtual function which evaluates the values of all
985  partial derivatives of all shape functions at a given
986  point ip and stores them in the matrix dshape (Dof x Dim) (9 x 2)
987  so that each row contains the derivatives of one shape function */
988  virtual void CalcDShape(const IntegrationPoint &ip,
989  DenseMatrix &dshape) const;
990  virtual void ProjectDelta(int vertex, Vector &dofs) const;
991 };
992 
994 {
995 public:
997  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
998  virtual void CalcDShape(const IntegrationPoint &ip,
999  DenseMatrix &dshape) const;
1001  DenseMatrix &I) const;
1002  using FiniteElement::Project;
1003  virtual void Project(Coefficient &coeff, ElementTransformation &Trans,
1004  Vector &dofs) const;
1005  virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans,
1006  Vector &dofs) const;
1007  virtual void ProjectDelta(int vertex, Vector &dofs) const
1008  { dofs = 0.; dofs(vertex) = 1.; }
1009 };
1010 
1011 /// Bi-quadratic element on quad with nodes at the 9 Gaussian points
1013 {
1014 public:
1016  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1017  virtual void CalcDShape(const IntegrationPoint &ip,
1018  DenseMatrix &dshape) const;
1019  // virtual void ProjectDelta(int vertex, Vector &dofs) const { dofs = 1.; }
1020 };
1021 
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 CalcHessian (const IntegrationPoint &ip,
1030  DenseMatrix &h) const;
1031 };
1032 
1034 {
1035 public:
1037 
1038  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1039 
1040  virtual void CalcDShape(const IntegrationPoint &ip,
1041  DenseMatrix &dshape) const;
1042 };
1043 
1045 {
1046 public:
1048 
1049  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1050 
1051  virtual void CalcDShape(const IntegrationPoint &ip,
1052  DenseMatrix &dshape) const;
1053 
1054  virtual void CalcHessian (const IntegrationPoint &ip,
1055  DenseMatrix &h) const;
1056 };
1057 
1058 /// Class for cubic FE on tetrahedron
1060 {
1061 public:
1062  /// Construct a cubic FE on tetrahedron
1064 
1065  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1066 
1067  virtual void CalcDShape(const IntegrationPoint &ip,
1068  DenseMatrix &dshape) const;
1069 };
1070 
1071 /// Class for constant FE on triangle
1073 {
1074 public:
1075  /// Construct P0 triangle finite element
1077 
1078  /// evaluate shape function - constant 1
1079  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1080 
1081  /// evaluate derivatives of shape function - constant 0
1082  virtual void CalcDShape(const IntegrationPoint &ip,
1083  DenseMatrix &dshape) const;
1084  virtual void ProjectDelta(int vertex, Vector &dofs) const
1085  { dofs(0) = 1.0; }
1086 };
1087 
1088 
1090 {
1091 public:
1093  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1094  virtual void CalcDShape(const IntegrationPoint &ip,
1095  DenseMatrix &dshape) const;
1096  virtual void ProjectDelta(int vertex, Vector &dofs) const
1097  { dofs(0) = 1.0; }
1098 };
1099 
1100 
1101 /// Class for linear FE on tetrahedron
1103 {
1104 public:
1105  /// Construct a linear FE on tetrahedron
1107 
1108  /** virtual function which evaluates the values of all
1109  shape functions at a given point ip and stores
1110  them in the vector shape of dimension Dof (4) */
1111  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1112 
1113  /** virtual function which evaluates the values of all
1114  partial derivatives of all shape functions at a given
1115  point ip and stores them in the matrix dshape (Dof x Dim) (4 x 3)
1116  so that each row contains the derivatives of one shape function */
1117  virtual void CalcDShape(const IntegrationPoint &ip,
1118  DenseMatrix &dshape) const;
1119 
1120  virtual void ProjectDelta(int vertex, Vector &dofs) const
1121  { dofs = 0.0; dofs(vertex) = 1.0; }
1122 
1123  virtual void GetFaceDofs(int face, int **dofs, int *ndofs) const;
1124 };
1125 
1126 /// Class for quadratic FE on tetrahedron
1128 {
1129 public:
1130  /// Construct a quadratic FE on tetrahedron
1132 
1133  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1134 
1135  virtual void CalcDShape(const IntegrationPoint &ip,
1136  DenseMatrix &dshape) const;
1137 };
1138 
1139 /// Class for tri-linear FE on cube
1141 {
1142 public:
1143  /// Construct a tri-linear FE on cube
1145 
1146  /** virtual function which evaluates the values of all
1147  shape functions at a given point ip and stores
1148  them in the vector shape of dimension Dof (8) */
1149  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1150 
1151  /** virtual function which evaluates the values of all
1152  partial derivatives of all shape functions at a given
1153  point ip and stores them in the matrix dshape (Dof x Dim) (8 x 3)
1154  so that each row contains the derivatives of one shape function */
1155  virtual void CalcDShape(const IntegrationPoint &ip,
1156  DenseMatrix &dshape) const;
1157 
1158  virtual void ProjectDelta(int vertex, Vector &dofs) const
1159  { dofs = 0.0; dofs(vertex) = 1.0; }
1160 };
1161 
1162 
1163 /// Crouzeix-Raviart finite element on triangle
1165 {
1166 public:
1168  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1169  virtual void CalcDShape(const IntegrationPoint &ip,
1170  DenseMatrix &dshape) const;
1171  virtual void ProjectDelta(int vertex, Vector &dofs) const
1172  { dofs = 1.0; }
1173 };
1174 
1175 /// Crouzeix-Raviart finite element on quadrilateral
1177 {
1178 public:
1180  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1181  virtual void CalcDShape(const IntegrationPoint &ip,
1182  DenseMatrix &dshape) const;
1183 };
1184 
1186 {
1187 public:
1188  P0SegmentFiniteElement(int Ord = 0);
1189  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1190  virtual void CalcDShape(const IntegrationPoint &ip,
1191  DenseMatrix &dshape) const;
1192 };
1193 
1195 {
1196 private:
1197  static const double nk[3][2];
1198 
1199 public:
1201 
1202  virtual void CalcVShape(const IntegrationPoint &ip,
1203  DenseMatrix &shape) const;
1204 
1206  DenseMatrix &shape) const
1207  { CalcVShape_RT(Trans, shape); }
1208 
1209  virtual void CalcDivShape(const IntegrationPoint &ip,
1210  Vector &divshape) const;
1211 
1213  DenseMatrix &I) const;
1214 
1215  using FiniteElement::Project;
1216 
1217  virtual void Project (VectorCoefficient &vc,
1218  ElementTransformation &Trans, Vector &dofs) const;
1219 };
1220 
1222 {
1223 private:
1224  static const double nk[4][2];
1225 
1226 public:
1228 
1229  virtual void CalcVShape(const IntegrationPoint &ip,
1230  DenseMatrix &shape) const;
1231 
1233  DenseMatrix &shape) const
1234  { CalcVShape_RT(Trans, shape); }
1235 
1236  virtual void CalcDivShape(const IntegrationPoint &ip,
1237  Vector &divshape) const;
1238 
1240  DenseMatrix &I) const;
1241 
1242  using FiniteElement::Project;
1243 
1244  virtual void Project (VectorCoefficient &vc,
1245  ElementTransformation &Trans, Vector &dofs) const;
1246 };
1247 
1249 {
1250 private:
1251  static const double nk[8][2];
1252 
1253 public:
1255 
1256  virtual void CalcVShape(const IntegrationPoint &ip,
1257  DenseMatrix &shape) const;
1258 
1260  DenseMatrix &shape) const
1261  { CalcVShape_RT(Trans, shape); }
1262 
1263  virtual void CalcDivShape(const IntegrationPoint &ip,
1264  Vector &divshape) const;
1265 
1267  DenseMatrix &I) const;
1268 
1269  using FiniteElement::Project;
1270 
1271  virtual void Project (VectorCoefficient &vc,
1272  ElementTransformation &Trans, Vector &dofs) const;
1273 };
1274 
1276 {
1277 private:
1278  static const double nk[12][2];
1279 
1280 public:
1282 
1283  virtual void CalcVShape(const IntegrationPoint &ip,
1284  DenseMatrix &shape) const;
1285 
1287  DenseMatrix &shape) const
1288  { CalcVShape_RT(Trans, shape); }
1289 
1290  virtual void CalcDivShape(const IntegrationPoint &ip,
1291  Vector &divshape) const;
1292 
1294  DenseMatrix &I) const;
1295 
1296  using FiniteElement::Project;
1297 
1298  virtual void Project (VectorCoefficient &vc,
1299  ElementTransformation &Trans, Vector &dofs) const;
1300 };
1301 
1303 {
1304 private:
1305  static const double M[15][15];
1306 public:
1308 
1309  virtual void CalcVShape(const IntegrationPoint &ip,
1310  DenseMatrix &shape) const;
1311 
1313  DenseMatrix &shape) const
1314  { CalcVShape_RT(Trans, shape); }
1315 
1316  virtual void CalcDivShape(const IntegrationPoint &ip,
1317  Vector &divshape) const;
1318 };
1319 
1321 {
1322 private:
1323  static const double nk[24][2];
1324  static const double pt[4];
1325  static const double dpt[3];
1326 
1327 public:
1329 
1330  virtual void CalcVShape(const IntegrationPoint &ip,
1331  DenseMatrix &shape) const;
1332 
1334  DenseMatrix &shape) const
1335  { CalcVShape_RT(Trans, shape); }
1336 
1337  virtual void CalcDivShape(const IntegrationPoint &ip,
1338  Vector &divshape) const;
1339 
1341  DenseMatrix &I) const;
1342 
1343  using FiniteElement::Project;
1344 
1345  virtual void Project (VectorCoefficient &vc,
1346  ElementTransformation &Trans, Vector &dofs) const;
1347 };
1348 
1349 /// Linear 1D element with nodes 1/3 and 2/3 (trace of RT1)
1351 {
1352 public:
1354  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1355  virtual void CalcDShape(const IntegrationPoint &ip,
1356  DenseMatrix &dshape) const;
1357 };
1358 
1359 /// Quadratic 1D element with nodes the Gaussian points in [0,1] (trace of RT2)
1361 {
1362 public:
1364  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1365  virtual void CalcDShape(const IntegrationPoint &ip,
1366  DenseMatrix &dshape) const;
1367 };
1368 
1370 {
1371 private:
1372  Vector rwk;
1373 #ifndef MFEM_THREAD_SAFE
1374  mutable Vector rxxk;
1375 #endif
1376 public:
1377  Lagrange1DFiniteElement (int degree);
1378  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1379  virtual void CalcDShape(const IntegrationPoint &ip,
1380  DenseMatrix &dshape) const;
1381 };
1382 
1384 {
1385 public:
1387  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1388  virtual void CalcDShape(const IntegrationPoint &ip,
1389  DenseMatrix &dshape) const;
1390 };
1391 
1393 {
1394 public:
1395  P0TetFiniteElement ();
1396  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1397  virtual void CalcDShape(const IntegrationPoint &ip,
1398  DenseMatrix &dshape) const;
1399  virtual void ProjectDelta(int vertex, Vector &dofs) const
1400  { dofs(0) = 1.0; }
1401 };
1402 
1404 {
1405 public:
1406  P0HexFiniteElement ();
1407  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1408  virtual void CalcDShape(const IntegrationPoint &ip,
1409  DenseMatrix &dshape) const;
1410  virtual void ProjectDelta(int vertex, Vector &dofs) const
1411  { dofs(0) = 1.0; }
1412 };
1413 
1414 /// Tensor products of 1D FEs (only degree 2 is functional)
1416 {
1417 private:
1418  Lagrange1DFiniteElement * fe1d;
1419  int dof1d;
1420  int *I, *J, *K;
1421 #ifndef MFEM_THREAD_SAFE
1422  mutable Vector shape1dx, shape1dy, shape1dz;
1423  mutable DenseMatrix dshape1dx, dshape1dy, dshape1dz;
1424 #endif
1425 
1426 public:
1427  LagrangeHexFiniteElement (int degree);
1428  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1429  virtual void CalcDShape(const IntegrationPoint &ip,
1430  DenseMatrix &dshape) const;
1432 };
1433 
1434 
1435 /// Class for refined linear FE on interval
1437 {
1438 public:
1439  /// Construct a quadratic FE on interval
1441 
1442  /** virtual function which evaluates the values of all
1443  shape functions at a given point ip and stores
1444  them in the vector shape of dimension Dof (3) */
1445  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1446 
1447  /** virtual function which evaluates the derivatives of all
1448  shape functions at a given point ip and stores them in
1449  the matrix dshape (Dof x Dim) (3 x 1) so that each row
1450  contains the derivative of one shape function */
1451  virtual void CalcDShape(const IntegrationPoint &ip,
1452  DenseMatrix &dshape) const;
1453 };
1454 
1455 /// Class for refined linear FE on triangle
1457 {
1458 public:
1459  /// Construct a quadratic FE on triangle
1461 
1462  /** virtual function which evaluates the values of all
1463  shape functions at a given point ip and stores
1464  them in the vector shape of dimension Dof (6) */
1465  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1466 
1467  /** virtual function which evaluates the values of all
1468  partial derivatives of all shape functions at a given
1469  point ip and stores them in the matrix dshape (Dof x Dim) (6 x 2)
1470  so that each row contains the derivatives of one shape function */
1471  virtual void CalcDShape(const IntegrationPoint &ip,
1472  DenseMatrix &dshape) const;
1473 };
1474 
1475 /// Class for refined linear FE on tetrahedron
1477 {
1478 public:
1479  /// Construct a quadratic FE on tetrahedron
1481 
1482  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1483 
1484  virtual void CalcDShape(const IntegrationPoint &ip,
1485  DenseMatrix &dshape) const;
1486 };
1487 
1488 /// Class for refined bi-linear FE on quadrilateral
1490 {
1491 public:
1492  /// Construct a biquadratic FE on quadrilateral
1494 
1495  /** virtual function which evaluates the values of all
1496  shape functions at a given point ip and stores
1497  them in the vector shape of dimension Dof (9) */
1498  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1499 
1500  /** virtual function which evaluates the values of all
1501  partial derivatives of all shape functions at a given
1502  point ip and stores them in the matrix dshape (Dof x Dim) (9 x 2)
1503  so that each row contains the derivatives of one shape function */
1504  virtual void CalcDShape(const IntegrationPoint &ip,
1505  DenseMatrix &dshape) const;
1506 };
1507 
1508 /// Class for refined trilinear FE on a hexahedron
1510 {
1511 public:
1512  /// Construct a biquadratic FE on quadrilateral
1514 
1515  /** virtual function which evaluates the values of all
1516  shape functions at a given point ip and stores
1517  them in the vector shape of dimension Dof (9) */
1518  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1519 
1520  /** virtual function which evaluates the values of all
1521  partial derivatives of all shape functions at a given
1522  point ip and stores them in the matrix dshape (Dof x Dim) (9 x 2)
1523  so that each row contains the derivatives of one shape function */
1524  virtual void CalcDShape(const IntegrationPoint &ip,
1525  DenseMatrix &dshape) const;
1526 };
1527 
1528 
1530 {
1531 private:
1532  static const double tk[12][3];
1533 
1534 public:
1536  virtual void CalcVShape(const IntegrationPoint &ip,
1537  DenseMatrix &shape) const;
1539  DenseMatrix &shape) const
1540  { CalcVShape_ND(Trans, shape); }
1541  virtual void CalcCurlShape(const IntegrationPoint &ip,
1542  DenseMatrix &curl_shape) const;
1544  DenseMatrix &I) const;
1545  using FiniteElement::Project;
1546  virtual void Project (VectorCoefficient &vc,
1547  ElementTransformation &Trans, Vector &dofs) const;
1548 };
1549 
1550 
1552 {
1553 private:
1554  static const double tk[6][3];
1555 
1556 public:
1558  virtual void CalcVShape(const IntegrationPoint &ip,
1559  DenseMatrix &shape) const;
1561  DenseMatrix &shape) const
1562  { CalcVShape_ND(Trans, shape); }
1563  virtual void CalcCurlShape(const IntegrationPoint &ip,
1564  DenseMatrix &curl_shape) const;
1566  DenseMatrix &I) const;
1567  using FiniteElement::Project;
1568  virtual void Project (VectorCoefficient &vc,
1569  ElementTransformation &Trans, Vector &dofs) const;
1570 };
1571 
1572 
1574 {
1575 private:
1576  static const double nk[6][3];
1577 
1578 public:
1580 
1581  virtual void CalcVShape(const IntegrationPoint &ip,
1582  DenseMatrix &shape) const;
1583 
1585  DenseMatrix &shape) const
1586  { CalcVShape_RT(Trans, shape); }
1587 
1588  virtual void CalcDivShape(const IntegrationPoint &ip,
1589  Vector &divshape) const;
1590 
1592  DenseMatrix &I) const;
1593 
1594  using FiniteElement::Project;
1595 
1596  virtual void Project (VectorCoefficient &vc,
1597  ElementTransformation &Trans, Vector &dofs) const;
1598 };
1599 
1600 
1602 {
1603 private:
1604  static const double nk[36][3];
1605 
1606 public:
1608 
1609  virtual void CalcVShape(const IntegrationPoint &ip,
1610  DenseMatrix &shape) const;
1611 
1613  DenseMatrix &shape) const
1614  { CalcVShape_RT(Trans, shape); }
1615 
1616  virtual void CalcDivShape(const IntegrationPoint &ip,
1617  Vector &divshape) const;
1618 
1620  DenseMatrix &I) const;
1621 
1622  using FiniteElement::Project;
1623 
1624  virtual void Project (VectorCoefficient &vc,
1625  ElementTransformation &Trans, Vector &dofs) const;
1626 };
1627 
1628 
1630 {
1631 private:
1632  static const double nk[4][3];
1633 
1634 public:
1636 
1637  virtual void CalcVShape(const IntegrationPoint &ip,
1638  DenseMatrix &shape) const;
1639 
1641  DenseMatrix &shape) const
1642  { CalcVShape_RT(Trans, shape); }
1643 
1644  virtual void CalcDivShape(const IntegrationPoint &ip,
1645  Vector &divshape) const;
1646 
1648  DenseMatrix &I) const;
1649 
1650  using FiniteElement::Project;
1651 
1652  virtual void Project (VectorCoefficient &vc,
1653  ElementTransformation &Trans, Vector &dofs) const;
1654 };
1655 
1656 
1658 {
1659 public:
1661  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1662  virtual void CalcDShape(const IntegrationPoint &ip,
1663  DenseMatrix &dshape) const;
1664 };
1665 
1666 
1667 class Poly_1D
1668 {
1669 public:
1671  {
1672  ChangeOfBasis = 0, // Use change of basis, O(p^2) Evals
1673  Barycentric = 1, // Use barycentric Lagrangian interpolation, O(p) Evals
1674  Positive = 2, // Fast evaluation of Bernstein polynomials
1675  NumEvalTypes = 3 // Keep count of the number of eval types
1676  };
1677 
1678  class Basis
1679  {
1680  private:
1681  int etype;
1682  DenseMatrixInverse Ai;
1683  mutable Vector x, w;
1684 
1685  public:
1686  /// Create a nodal or positive (Bernstein) basis
1687  Basis(const int p, const double *nodes, EvalType etype = Barycentric);
1688  void Eval(const double x, Vector &u) const;
1689  void Eval(const double x, Vector &u, Vector &d) const;
1690  };
1691 
1692 private:
1693  typedef std::map< int, Array<double*>* > PointsMap;
1694  typedef std::map< int, Array<Basis*>* > BasisMap;
1695 
1696  PointsMap points_container;
1697  BasisMap bases_container;
1698 
1699  static Array2D<int> binom;
1700 
1701  static void CalcMono(const int p, const double x, double *u);
1702  static void CalcMono(const int p, const double x, double *u, double *d);
1703 
1704  static void CalcLegendre(const int p, const double x, double *u);
1705  static void CalcLegendre(const int p, const double x, double *u, double *d);
1706 
1707  static void CalcChebyshev(const int p, const double x, double *u);
1708  static void CalcChebyshev(const int p, const double x, double *u, double *d);
1709  static void CalcChebyshev(const int p, const double x, double *u, double *d,
1710  double *dd);
1711 
1712  QuadratureFunctions1D quad_func;
1713 
1714 public:
1715  Poly_1D() { }
1716 
1717  /** @brief Get a pointer to an array containing the binomial coefficients "p
1718  choose k" for k=0,...,p for the given p. */
1719  static const int *Binom(const int p);
1720 
1721  /** @brief Get the coordinates of the points of the given BasisType,
1722  @a btype.
1723 
1724  @param[in] p The polynomial degree; the number of points is `p+1`.
1725  @param[in] btype The BasisType.
1726 
1727  @return A pointer to an array containing the `p+1` coordinates of the
1728  points. Returns NULL if the BasisType has no associated set of
1729  points. */
1730  const double *GetPoints(const int p, const int btype);
1731  const double *OpenPoints(const int p,
1732  const int btype = BasisType::GaussLegendre)
1733  { return GetPoints(p, btype); }
1734  const double *ClosedPoints(const int p,
1735  const int btype = BasisType::GaussLobatto)
1736  { return GetPoints(p, btype); }
1737 
1738  /** @brief Get a Poly_1D::Basis object of the given degree and BasisType,
1739  @a btype.
1740 
1741  @param[in] p The polynomial degree of the basis.
1742  @param[in] btype The BasisType.
1743 
1744  @return A reference to an object of type Poly_1D::Basis that represents
1745  the requested basis type. */
1746  Basis &GetBasis(const int p, const int btype);
1747 
1748  // Evaluate the values of a hierarchical 1D basis at point x
1749  // hierarchical = k-th basis function is degree k polynomial
1750  static void CalcBasis(const int p, const double x, double *u)
1751  // { CalcMono(p, x, u); }
1752  // Bernstein basis is not hierarchical --> does not work for triangles
1753  // and tetrahedra
1754  // { CalcBernstein(p, x, u); }
1755  // { CalcLegendre(p, x, u); }
1756  { CalcChebyshev(p, x, u); }
1757 
1758  // Evaluate the values and derivatives of a hierarchical 1D basis at point x
1759  static void CalcBasis(const int p, const double x, double *u, double *d)
1760  // { CalcMono(p, x, u, d); }
1761  // { CalcBernstein(p, x, u, d); }
1762  // { CalcLegendre(p, x, u, d); }
1763  { CalcChebyshev(p, x, u, d); }
1764 
1765  // Evaluate the values, derivatives and second derivatives of a hierarchical 1D basis at point x
1766  static void CalcBasis(const int p, const double x, double *u, double *d,
1767  double *dd)
1768  // { CalcMono(p, x, u, d); }
1769  // { CalcBernstein(p, x, u, d); }
1770  // { CalcLegendre(p, x, u, d); }
1771  { CalcChebyshev(p, x, u, d, dd); }
1772 
1773  // Evaluate a representation of a Delta function at point x
1774  static double CalcDelta(const int p, const double x)
1775  { return pow(x, (double) p); }
1776 
1777  static void ChebyshevPoints(const int p, double *x);
1778 
1779  /// Compute the terms in the expansion of the binomial (x + y)^p
1780  static void CalcBinomTerms(const int p, const double x, const double y,
1781  double *u);
1782  /** Compute the terms in the expansion of the binomial (x + y)^p and their
1783  derivatives with respect to x assuming that dy/dx = -1. */
1784  static void CalcBinomTerms(const int p, const double x, const double y,
1785  double *u, double *d);
1786  /** Compute the derivatives (w.r.t. x) of the terms in the expansion of the
1787  binomial (x + y)^p assuming that dy/dx = -1. */
1788  static void CalcDBinomTerms(const int p, const double x, const double y,
1789  double *d);
1790  static void CalcBernstein(const int p, const double x, double *u)
1791  { CalcBinomTerms(p, x, 1. - x, u); }
1792  static void CalcBernstein(const int p, const double x, double *u, double *d)
1793  { CalcBinomTerms(p, x, 1. - x, u, d); }
1794 
1795  ~Poly_1D();
1796 };
1797 
1798 extern Poly_1D poly1d;
1799 
1801 {
1802 protected:
1803  int b_type;
1806 
1807 public:
1809  {
1812  };
1813 
1814  TensorBasisElement(const int dims, const int p, const int btype,
1815  const DofMapType dmtype);
1816 
1817  int GetBasisType() const { return b_type; }
1818 
1819  const Poly_1D::Basis& GetBasis1D() const { return basis1d; }
1820 
1821  /** @brief Get an Array<int> that maps lexicographically ordered indices to
1822  the indices of the respective nodes/dofs/basis functions. If the dofs are
1823  ordered lexicographically, i.e. the mapping is identity, the returned
1824  Array will be empty. */
1825  const Array<int> &GetDofMap() const { return dof_map; }
1826 
1828  {
1829  switch (dim)
1830  {
1831  case 1: return Geometry::SEGMENT;
1832  case 2: return Geometry::SQUARE;
1833  case 3: return Geometry::CUBE;
1834  default:
1835  MFEM_ABORT("invalid dimension: " << dim);
1836  return Geometry::INVALID;
1837  }
1838  }
1839 
1840  /// Return @a base raised to the power @a dim.
1841  static int Pow(int base, int dim)
1842  {
1843  switch (dim)
1844  {
1845  case 1: return base;
1846  case 2: return base*base;
1847  case 3: return base*base*base;
1848  default: MFEM_ABORT("invalid dimension: " << dim); return -1;
1849  }
1850  }
1851 };
1852 
1854  public TensorBasisElement
1855 {
1856 public:
1857  NodalTensorFiniteElement(const int dims, const int p, const int btype,
1858  const DofMapType dmtype);
1859 
1861  DofToQuad::Mode mode) const
1862  {
1863  return (mode == DofToQuad::FULL) ?
1865  ScalarFiniteElement::GetTensorDofToQuad(*this, ir, mode);
1866  }
1867 };
1868 
1870  public TensorBasisElement
1871 {
1872 public:
1873  PositiveTensorFiniteElement(const int dims, const int p,
1874  const DofMapType dmtype);
1875 
1877  DofToQuad::Mode mode) const
1878  {
1879  return (mode == DofToQuad::FULL) ?
1881  ScalarFiniteElement::GetTensorDofToQuad(*this, ir, mode);
1882  }
1883 };
1884 
1886 {
1887 private:
1888 #ifndef MFEM_THREAD_SAFE
1889  mutable Vector shape_x, dshape_x;
1890 #endif
1891 
1892 public:
1893  H1_SegmentElement(const int p, const int btype = BasisType::GaussLobatto);
1894  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1895  virtual void CalcDShape(const IntegrationPoint &ip,
1896  DenseMatrix &dshape) const;
1897  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1898 };
1899 
1900 
1902 {
1903 private:
1904 #ifndef MFEM_THREAD_SAFE
1905  mutable Vector shape_x, shape_y, dshape_x, dshape_y;
1906 #endif
1907 
1908 public:
1909  H1_QuadrilateralElement(const int p,
1910  const int btype = BasisType::GaussLobatto);
1911  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1912  virtual void CalcDShape(const IntegrationPoint &ip,
1913  DenseMatrix &dshape) const;
1914  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1915 };
1916 
1917 
1919 {
1920 private:
1921 #ifndef MFEM_THREAD_SAFE
1922  mutable Vector shape_x, shape_y, shape_z, dshape_x, dshape_y, dshape_z;
1923 #endif
1924 
1925 public:
1926  H1_HexahedronElement(const int p, const int btype = BasisType::GaussLobatto);
1927  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1928  virtual void CalcDShape(const IntegrationPoint &ip,
1929  DenseMatrix &dshape) const;
1930  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1931 };
1932 
1934 {
1935 private:
1936 #ifndef MFEM_THREAD_SAFE
1937  // This is to share scratch space between invocations, which helps
1938  // speed things up, but with OpenMP, we need one copy per thread.
1939  // Right now, we solve this by allocating this space within each function
1940  // call every time we call it. Alternatively, we should do some sort
1941  // thread private thing. Brunner, Jan 2014
1942  mutable Vector shape_x, dshape_x;
1943 #endif
1944 
1945 public:
1946  H1Pos_SegmentElement(const int p);
1947  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1948  virtual void CalcDShape(const IntegrationPoint &ip,
1949  DenseMatrix &dshape) const;
1950  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1951 };
1952 
1953 
1955 {
1956 private:
1957 #ifndef MFEM_THREAD_SAFE
1958  // See comment in H1Pos_SegmentElement
1959  mutable Vector shape_x, shape_y, dshape_x, dshape_y;
1960 #endif
1961 
1962 public:
1963  H1Pos_QuadrilateralElement(const int p);
1964  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1965  virtual void CalcDShape(const IntegrationPoint &ip,
1966  DenseMatrix &dshape) const;
1967  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1968 };
1969 
1970 
1972 {
1973 private:
1974 #ifndef MFEM_THREAD_SAFE
1975  // See comment in H1Pos_SegementElement.
1976  mutable Vector shape_x, shape_y, shape_z, dshape_x, dshape_y, dshape_z;
1977 #endif
1978 
1979 public:
1980  H1Pos_HexahedronElement(const int p);
1981  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1982  virtual void CalcDShape(const IntegrationPoint &ip,
1983  DenseMatrix &dshape) const;
1984  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1985 };
1986 
1987 
1989 {
1990 private:
1991 #ifndef MFEM_THREAD_SAFE
1992  mutable Vector shape_x, shape_y, shape_l, dshape_x, dshape_y, dshape_l, u;
1993  mutable Vector ddshape_x, ddshape_y, ddshape_l;
1994  mutable DenseMatrix du, ddu;
1995 #endif
1996  DenseMatrixInverse Ti;
1997 
1998 public:
1999  H1_TriangleElement(const int p, const int btype = BasisType::GaussLobatto);
2000  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2001  virtual void CalcDShape(const IntegrationPoint &ip,
2002  DenseMatrix &dshape) const;
2003  virtual void CalcHessian(const IntegrationPoint &ip,
2004  DenseMatrix &ddshape) const;
2005 };
2006 
2007 
2009 {
2010 private:
2011 #ifndef MFEM_THREAD_SAFE
2012  mutable Vector shape_x, shape_y, shape_z, shape_l;
2013  mutable Vector dshape_x, dshape_y, dshape_z, dshape_l, u;
2014  mutable Vector ddshape_x, ddshape_y, ddshape_z, ddshape_l;
2015  mutable DenseMatrix du, ddu;
2016 #endif
2017  DenseMatrixInverse Ti;
2018 
2019 public:
2020  H1_TetrahedronElement(const int p,
2021  const int btype = BasisType::GaussLobatto);
2022  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2023  virtual void CalcDShape(const IntegrationPoint &ip,
2024  DenseMatrix &dshape) const;
2025  virtual void CalcHessian(const IntegrationPoint &ip,
2026  DenseMatrix &ddshape) const;
2027 };
2028 
2029 
2031 {
2032 protected:
2033 #ifndef MFEM_THREAD_SAFE
2036 #endif
2038 
2039 public:
2040  H1Pos_TriangleElement(const int p);
2041 
2042  // The size of shape is (p+1)(p+2)/2 (dof).
2043  static void CalcShape(const int p, const double x, const double y,
2044  double *shape);
2045 
2046  // The size of dshape_1d is p+1; the size of dshape is (dof x dim).
2047  static void CalcDShape(const int p, const double x, const double y,
2048  double *dshape_1d, double *dshape);
2049 
2050  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2051  virtual void CalcDShape(const IntegrationPoint &ip,
2052  DenseMatrix &dshape) const;
2053 };
2054 
2055 
2057 {
2058 protected:
2059 #ifndef MFEM_THREAD_SAFE
2062 #endif
2064 
2065 public:
2066  H1Pos_TetrahedronElement(const int p);
2067 
2068  // The size of shape is (p+1)(p+2)(p+3)/6 (dof).
2069  static void CalcShape(const int p, const double x, const double y,
2070  const double z, double *shape);
2071 
2072  // The size of dshape_1d is p+1; the size of dshape is (dof x dim).
2073  static void CalcDShape(const int p, const double x, const double y,
2074  const double z, double *dshape_1d, double *dshape);
2075 
2076  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2077  virtual void CalcDShape(const IntegrationPoint &ip,
2078  DenseMatrix &dshape) const;
2079 };
2080 
2081 
2083 {
2084 private:
2085 #ifndef MFEM_THREAD_SAFE
2086  mutable Vector t_shape, s_shape;
2087  mutable DenseMatrix t_dshape, s_dshape;
2088 #endif
2089  Array<int> t_dof, s_dof;
2090 
2091  H1_TriangleElement TriangleFE;
2092  H1_SegmentElement SegmentFE;
2093 
2094 public:
2095  H1_WedgeElement(const int p,
2096  const int btype = BasisType::GaussLobatto);
2097  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2098  virtual void CalcDShape(const IntegrationPoint &ip,
2099  DenseMatrix &dshape) const;
2100 };
2101 
2102 /// Class for linear FE on wedge
2104 {
2105 public:
2106  /// Construct a linear FE on wedge
2108 };
2109 
2110 /// Class for quadratic FE on wedge
2112 {
2113 public:
2114  /// Construct a quadratic FE on wedge
2116 };
2117 
2118 /// Class for cubic FE on wedge
2120 {
2121 public:
2122  /// Construct a cubic FE on wedge
2124 };
2125 
2127 {
2128 protected:
2129 #ifndef MFEM_THREAD_SAFE
2132 #endif
2134 
2137 
2138 public:
2139  H1Pos_WedgeElement(const int p);
2140 
2141  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2142  virtual void CalcDShape(const IntegrationPoint &ip,
2143  DenseMatrix &dshape) const;
2144 };
2145 
2146 
2148 {
2149 private:
2150 #ifndef MFEM_THREAD_SAFE
2151  mutable Vector shape_x, dshape_x;
2152 #endif
2153 
2154 public:
2155  L2_SegmentElement(const int p, const int btype = BasisType::GaussLegendre);
2156  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2157  virtual void CalcDShape(const IntegrationPoint &ip,
2158  DenseMatrix &dshape) const;
2159  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2160 };
2161 
2162 
2164 {
2165 private:
2166 #ifndef MFEM_THREAD_SAFE
2167  mutable Vector shape_x, dshape_x;
2168 #endif
2169 
2170 public:
2171  L2Pos_SegmentElement(const int p);
2172  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2173  virtual void CalcDShape(const IntegrationPoint &ip,
2174  DenseMatrix &dshape) const;
2175  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2176 };
2177 
2178 
2180 {
2181 private:
2182 #ifndef MFEM_THREAD_SAFE
2183  mutable Vector shape_x, shape_y, dshape_x, dshape_y;
2184 #endif
2185 
2186 public:
2187  L2_QuadrilateralElement(const int p,
2188  const int btype = BasisType::GaussLegendre);
2189  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2190  virtual void CalcDShape(const IntegrationPoint &ip,
2191  DenseMatrix &dshape) const;
2192  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2193  virtual void ProjectCurl(const FiniteElement &fe,
2195  DenseMatrix &curl) const
2196  { ProjectCurl_2D(fe, Trans, curl); }
2197 };
2198 
2199 
2201 {
2202 private:
2203 #ifndef MFEM_THREAD_SAFE
2204  mutable Vector shape_x, shape_y, dshape_x, dshape_y;
2205 #endif
2206 
2207 public:
2208  L2Pos_QuadrilateralElement(const int p);
2209  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2210  virtual void CalcDShape(const IntegrationPoint &ip,
2211  DenseMatrix &dshape) const;
2212  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2213 };
2214 
2215 
2217 {
2218 private:
2219 #ifndef MFEM_THREAD_SAFE
2220  mutable Vector shape_x, shape_y, shape_z, dshape_x, dshape_y, dshape_z;
2221 #endif
2222 
2223 public:
2224  L2_HexahedronElement(const int p,
2225  const int btype = BasisType::GaussLegendre);
2226  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2227  virtual void CalcDShape(const IntegrationPoint &ip,
2228  DenseMatrix &dshape) const;
2229  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2230 };
2231 
2232 
2234 {
2235 private:
2236 #ifndef MFEM_THREAD_SAFE
2237  mutable Vector shape_x, shape_y, shape_z, dshape_x, dshape_y, dshape_z;
2238 #endif
2239 
2240 public:
2241  L2Pos_HexahedronElement(const int p);
2242  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2243  virtual void CalcDShape(const IntegrationPoint &ip,
2244  DenseMatrix &dshape) const;
2245  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2246 };
2247 
2248 
2250 {
2251 private:
2252 #ifndef MFEM_THREAD_SAFE
2253  mutable Vector shape_x, shape_y, shape_l, dshape_x, dshape_y, dshape_l, u;
2254  mutable DenseMatrix du;
2255 #endif
2256  DenseMatrixInverse Ti;
2257 
2258 public:
2259  L2_TriangleElement(const int p,
2260  const int btype = BasisType::GaussLegendre);
2261  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2262  virtual void CalcDShape(const IntegrationPoint &ip,
2263  DenseMatrix &dshape) const;
2264  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2265  virtual void ProjectCurl(const FiniteElement &fe,
2267  DenseMatrix &curl) const
2268  { ProjectCurl_2D(fe, Trans, curl); }
2269 };
2270 
2271 
2273 {
2274 private:
2275 #ifndef MFEM_THREAD_SAFE
2276  mutable Vector dshape_1d;
2277 #endif
2278 
2279 public:
2280  L2Pos_TriangleElement(const int p);
2281  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2282  virtual void CalcDShape(const IntegrationPoint &ip,
2283  DenseMatrix &dshape) const;
2284  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2285 };
2286 
2287 
2289 {
2290 private:
2291 #ifndef MFEM_THREAD_SAFE
2292  mutable Vector shape_x, shape_y, shape_z, shape_l;
2293  mutable Vector dshape_x, dshape_y, dshape_z, dshape_l, u;
2294  mutable DenseMatrix du;
2295 #endif
2296  DenseMatrixInverse Ti;
2297 
2298 public:
2299  L2_TetrahedronElement(const int p,
2300  const int btype = BasisType::GaussLegendre);
2301  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2302  virtual void CalcDShape(const IntegrationPoint &ip,
2303  DenseMatrix &dshape) const;
2304  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2305 };
2306 
2307 
2309 {
2310 private:
2311 #ifndef MFEM_THREAD_SAFE
2312  mutable Vector dshape_1d;
2313 #endif
2314 
2315 public:
2316  L2Pos_TetrahedronElement(const int p);
2317  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2318  virtual void CalcDShape(const IntegrationPoint &ip,
2319  DenseMatrix &dshape) const;
2320  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2321 };
2322 
2323 
2325 {
2326 private:
2327 #ifndef MFEM_THREAD_SAFE
2328  mutable Vector t_shape, s_shape;
2329  mutable DenseMatrix t_dshape, s_dshape;
2330 #endif
2331  Array<int> t_dof, s_dof;
2332 
2333  L2_TriangleElement TriangleFE;
2334  L2_SegmentElement SegmentFE;
2335 
2336 public:
2337  L2_WedgeElement(const int p,
2338  const int btype = BasisType::GaussLegendre);
2339  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2340  virtual void CalcDShape(const IntegrationPoint &ip,
2341  DenseMatrix &dshape) const;
2342 };
2343 
2345 {
2346 public:
2348 };
2349 
2351 {
2352 protected:
2353 #ifndef MFEM_THREAD_SAFE
2356 #endif
2358 
2361 
2362 public:
2363  L2Pos_WedgeElement(const int p);
2364 
2365  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2366  virtual void CalcDShape(const IntegrationPoint &ip,
2367  DenseMatrix &dshape) const;
2368 };
2369 
2370 
2372 {
2373 private:
2374  static const double nk[8];
2375 
2376  Poly_1D::Basis &cbasis1d, &obasis1d;
2377 #ifndef MFEM_THREAD_SAFE
2378  mutable Vector shape_cx, shape_ox, shape_cy, shape_oy;
2379  mutable Vector dshape_cx, dshape_cy;
2380 #endif
2381  Array<int> dof_map, dof2nk;
2382 
2383 public:
2384  RT_QuadrilateralElement(const int p,
2385  const int cb_type = BasisType::GaussLobatto,
2386  const int ob_type = BasisType::GaussLegendre);
2387  virtual void CalcVShape(const IntegrationPoint &ip,
2388  DenseMatrix &shape) const;
2390  DenseMatrix &shape) const
2391  { CalcVShape_RT(Trans, shape); }
2392  virtual void CalcDivShape(const IntegrationPoint &ip,
2393  Vector &divshape) const;
2395  DenseMatrix &I) const
2396  { LocalInterpolation_RT(*this, nk, dof2nk, Trans, I); }
2398  DenseMatrix &R) const
2399  { LocalRestriction_RT(nk, dof2nk, Trans, R); }
2400  virtual void GetTransferMatrix(const FiniteElement &fe,
2402  DenseMatrix &I) const
2403  { LocalInterpolation_RT(CheckVectorFE(fe), nk, dof2nk, Trans, I); }
2404  using FiniteElement::Project;
2405  virtual void Project(VectorCoefficient &vc,
2406  ElementTransformation &Trans, Vector &dofs) const
2407  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
2409  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2410  { ProjectMatrixCoefficient_RT(nk, dof2nk, mc, T, dofs); }
2412  DenseMatrix &I) const
2413  { Project_RT(nk, dof2nk, fe, Trans, I); }
2414  // Gradient + rotation = Curl: H1 -> H(div)
2415  virtual void ProjectGrad(const FiniteElement &fe,
2417  DenseMatrix &grad) const
2418  { ProjectGrad_RT(nk, dof2nk, fe, Trans, grad); }
2419  // Curl = Gradient + rotation: H1 -> H(div)
2420  virtual void ProjectCurl(const FiniteElement &fe,
2422  DenseMatrix &curl) const
2423  { ProjectGrad_RT(nk, dof2nk, fe, Trans, curl); }
2424 };
2425 
2426 
2428 {
2429  static const double nk[18];
2430 
2431  Poly_1D::Basis &cbasis1d, &obasis1d;
2432 #ifndef MFEM_THREAD_SAFE
2433  mutable Vector shape_cx, shape_ox, shape_cy, shape_oy, shape_cz, shape_oz;
2434  mutable Vector dshape_cx, dshape_cy, dshape_cz;
2435 #endif
2436  Array<int> dof_map, dof2nk;
2437 
2438 public:
2439  RT_HexahedronElement(const int p,
2440  const int cb_type = BasisType::GaussLobatto,
2441  const int ob_type = BasisType::GaussLegendre);
2442 
2443  virtual void CalcVShape(const IntegrationPoint &ip,
2444  DenseMatrix &shape) const;
2446  DenseMatrix &shape) const
2447  { CalcVShape_RT(Trans, shape); }
2448  virtual void CalcDivShape(const IntegrationPoint &ip,
2449  Vector &divshape) const;
2451  DenseMatrix &I) const
2452  { LocalInterpolation_RT(*this, nk, dof2nk, Trans, I); }
2454  DenseMatrix &R) const
2455  { LocalRestriction_RT(nk, dof2nk, Trans, R); }
2456  virtual void GetTransferMatrix(const FiniteElement &fe,
2458  DenseMatrix &I) const
2459  { LocalInterpolation_RT(CheckVectorFE(fe), nk, dof2nk, Trans, I); }
2460  using FiniteElement::Project;
2461  virtual void Project(VectorCoefficient &vc,
2462  ElementTransformation &Trans, Vector &dofs) const
2463  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
2465  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2466  { ProjectMatrixCoefficient_RT(nk, dof2nk, mc, T, dofs); }
2468  DenseMatrix &I) const
2469  { Project_RT(nk, dof2nk, fe, Trans, I); }
2470  virtual void ProjectCurl(const FiniteElement &fe,
2472  DenseMatrix &curl) const
2473  { ProjectCurl_RT(nk, dof2nk, fe, Trans, curl); }
2474 };
2475 
2476 
2478 {
2479  static const double nk[6], c;
2480 
2481 #ifndef MFEM_THREAD_SAFE
2482  mutable Vector shape_x, shape_y, shape_l;
2483  mutable Vector dshape_x, dshape_y, dshape_l;
2484  mutable DenseMatrix u;
2485  mutable Vector divu;
2486 #endif
2487  Array<int> dof2nk;
2488  DenseMatrixInverse Ti;
2489 
2490 public:
2491  RT_TriangleElement(const int p);
2492  virtual void CalcVShape(const IntegrationPoint &ip,
2493  DenseMatrix &shape) const;
2495  DenseMatrix &shape) const
2496  { CalcVShape_RT(Trans, shape); }
2497  virtual void CalcDivShape(const IntegrationPoint &ip,
2498  Vector &divshape) const;
2500  DenseMatrix &I) const
2501  { LocalInterpolation_RT(*this, nk, dof2nk, Trans, I); }
2503  DenseMatrix &R) const
2504  { LocalRestriction_RT(nk, dof2nk, Trans, R); }
2505  virtual void GetTransferMatrix(const FiniteElement &fe,
2507  DenseMatrix &I) const
2508  { LocalInterpolation_RT(CheckVectorFE(fe), nk, dof2nk, Trans, I); }
2509  using FiniteElement::Project;
2510  virtual void Project(VectorCoefficient &vc,
2511  ElementTransformation &Trans, Vector &dofs) const
2512  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
2514  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2515  { ProjectMatrixCoefficient_RT(nk, dof2nk, mc, T, dofs); }
2517  DenseMatrix &I) const
2518  { Project_RT(nk, dof2nk, fe, Trans, I); }
2519  // Gradient + rotation = Curl: H1 -> H(div)
2520  virtual void ProjectGrad(const FiniteElement &fe,
2522  DenseMatrix &grad) const
2523  { ProjectGrad_RT(nk, dof2nk, fe, Trans, grad); }
2524  // Curl = Gradient + rotation: H1 -> H(div)
2525  virtual void ProjectCurl(const FiniteElement &fe,
2527  DenseMatrix &curl) const
2528  { ProjectGrad_RT(nk, dof2nk, fe, Trans, curl); }
2529 };
2530 
2531 
2533 {
2534  static const double nk[12], c;
2535 
2536 #ifndef MFEM_THREAD_SAFE
2537  mutable Vector shape_x, shape_y, shape_z, shape_l;
2538  mutable Vector dshape_x, dshape_y, dshape_z, dshape_l;
2539  mutable DenseMatrix u;
2540  mutable Vector divu;
2541 #endif
2542  Array<int> dof2nk;
2543  DenseMatrixInverse Ti;
2544 
2545 public:
2546  RT_TetrahedronElement(const int p);
2547  virtual void CalcVShape(const IntegrationPoint &ip,
2548  DenseMatrix &shape) const;
2550  DenseMatrix &shape) const
2551  { CalcVShape_RT(Trans, shape); }
2552  virtual void CalcDivShape(const IntegrationPoint &ip,
2553  Vector &divshape) const;
2555  DenseMatrix &I) const
2556  { LocalInterpolation_RT(*this, nk, dof2nk, Trans, I); }
2558  DenseMatrix &R) const
2559  { LocalRestriction_RT(nk, dof2nk, Trans, R); }
2560  virtual void GetTransferMatrix(const FiniteElement &fe,
2562  DenseMatrix &I) const
2563  { LocalInterpolation_RT(CheckVectorFE(fe), nk, dof2nk, Trans, I); }
2564  using FiniteElement::Project;
2565  virtual void Project(VectorCoefficient &vc,
2566  ElementTransformation &Trans, Vector &dofs) const
2567  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
2569  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2570  { ProjectMatrixCoefficient_RT(nk, dof2nk, mc, T, dofs); }
2572  DenseMatrix &I) const
2573  { Project_RT(nk, dof2nk, fe, Trans, I); }
2574  virtual void ProjectCurl(const FiniteElement &fe,
2576  DenseMatrix &curl) const
2577  { ProjectCurl_RT(nk, dof2nk, fe, Trans, curl); }
2578 };
2579 
2580 
2582 {
2583  static const double tk[18];
2584 
2585  Poly_1D::Basis &cbasis1d, &obasis1d;
2586 #ifndef MFEM_THREAD_SAFE
2587  mutable Vector shape_cx, shape_ox, shape_cy, shape_oy, shape_cz, shape_oz;
2588  mutable Vector dshape_cx, dshape_cy, dshape_cz;
2589 #endif
2590  Array<int> dof_map, dof2tk;
2591 
2592 public:
2593  ND_HexahedronElement(const int p,
2594  const int cb_type = BasisType::GaussLobatto,
2595  const int ob_type = BasisType::GaussLegendre);
2596 
2597  virtual void CalcVShape(const IntegrationPoint &ip,
2598  DenseMatrix &shape) const;
2599 
2601  DenseMatrix &shape) const
2602  { CalcVShape_ND(Trans, shape); }
2603 
2604  virtual void CalcCurlShape(const IntegrationPoint &ip,
2605  DenseMatrix &curl_shape) const;
2606 
2608  DenseMatrix &I) const
2609  { LocalInterpolation_ND(*this, tk, dof2tk, Trans, I); }
2610 
2612  DenseMatrix &R) const
2613  { LocalRestriction_ND(tk, dof2tk, Trans, R); }
2614 
2615  virtual void GetTransferMatrix(const FiniteElement &fe,
2617  DenseMatrix &I) const
2618  { LocalInterpolation_ND(CheckVectorFE(fe), tk, dof2tk, Trans, I); }
2619 
2620  using FiniteElement::Project;
2621 
2622  virtual void Project(VectorCoefficient &vc,
2623  ElementTransformation &Trans, Vector &dofs) const
2624  { Project_ND(tk, dof2tk, vc, Trans, dofs); }
2625 
2627  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2628  { ProjectMatrixCoefficient_ND(tk, dof2tk, mc, T, dofs); }
2629 
2630  virtual void Project(const FiniteElement &fe,
2632  DenseMatrix &I) const
2633  { Project_ND(tk, dof2tk, fe, Trans, I); }
2634 
2635  virtual void ProjectGrad(const FiniteElement &fe,
2637  DenseMatrix &grad) const
2638  { ProjectGrad_ND(tk, dof2tk, fe, Trans, grad); }
2639 
2640  virtual void ProjectCurl(const FiniteElement &fe,
2642  DenseMatrix &curl) const
2643  { ProjectCurl_ND(tk, dof2tk, fe, Trans, curl); }
2644 };
2645 
2646 
2648 {
2649  static const double tk[8];
2650 
2651  Poly_1D::Basis &cbasis1d, &obasis1d;
2652 #ifndef MFEM_THREAD_SAFE
2653  mutable Vector shape_cx, shape_ox, shape_cy, shape_oy;
2654  mutable Vector dshape_cx, dshape_cy;
2655 #endif
2656  Array<int> dof_map, dof2tk;
2657 
2658 public:
2659  ND_QuadrilateralElement(const int p,
2660  const int cb_type = BasisType::GaussLobatto,
2661  const int ob_type = BasisType::GaussLegendre);
2662  virtual void CalcVShape(const IntegrationPoint &ip,
2663  DenseMatrix &shape) const;
2665  DenseMatrix &shape) const
2666  { CalcVShape_ND(Trans, shape); }
2667  virtual void CalcCurlShape(const IntegrationPoint &ip,
2668  DenseMatrix &curl_shape) const;
2670  DenseMatrix &I) const
2671  { LocalInterpolation_ND(*this, tk, dof2tk, Trans, I); }
2673  DenseMatrix &R) const
2674  { LocalRestriction_ND(tk, dof2tk, Trans, R); }
2675  virtual void GetTransferMatrix(const FiniteElement &fe,
2677  DenseMatrix &I) const
2678  { LocalInterpolation_ND(CheckVectorFE(fe), tk, dof2tk, Trans, I); }
2679  using FiniteElement::Project;
2680  virtual void Project(VectorCoefficient &vc,
2681  ElementTransformation &Trans, Vector &dofs) const
2682  { Project_ND(tk, dof2tk, vc, Trans, dofs); }
2684  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2685  { ProjectMatrixCoefficient_ND(tk, dof2tk, mc, T, dofs); }
2686  virtual void Project(const FiniteElement &fe,
2688  DenseMatrix &I) const
2689  { Project_ND(tk, dof2tk, fe, Trans, I); }
2690  virtual void ProjectGrad(const FiniteElement &fe,
2692  DenseMatrix &grad) const
2693  { ProjectGrad_ND(tk, dof2tk, fe, Trans, grad); }
2694 };
2695 
2696 
2698 {
2699  static const double tk[18], c;
2700 
2701 #ifndef MFEM_THREAD_SAFE
2702  mutable Vector shape_x, shape_y, shape_z, shape_l;
2703  mutable Vector dshape_x, dshape_y, dshape_z, dshape_l;
2704  mutable DenseMatrix u;
2705 #endif
2706  Array<int> dof2tk;
2707  DenseMatrixInverse Ti;
2708 
2709 public:
2710  ND_TetrahedronElement(const int p);
2711  virtual void CalcVShape(const IntegrationPoint &ip,
2712  DenseMatrix &shape) const;
2714  DenseMatrix &shape) const
2715  { CalcVShape_ND(Trans, shape); }
2716  virtual void CalcCurlShape(const IntegrationPoint &ip,
2717  DenseMatrix &curl_shape) const;
2719  DenseMatrix &I) const
2720  { LocalInterpolation_ND(*this, tk, dof2tk, Trans, I); }
2722  DenseMatrix &R) const
2723  { LocalRestriction_ND(tk, dof2tk, Trans, R); }
2724  virtual void GetTransferMatrix(const FiniteElement &fe,
2726  DenseMatrix &I) const
2727  { LocalInterpolation_ND(CheckVectorFE(fe), tk, dof2tk, Trans, I); }
2728  using FiniteElement::Project;
2729  virtual void Project(VectorCoefficient &vc,
2730  ElementTransformation &Trans, Vector &dofs) const
2731  { Project_ND(tk, dof2tk, vc, Trans, dofs); }
2733  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2734  { ProjectMatrixCoefficient_ND(tk, dof2tk, mc, T, dofs); }
2735  virtual void Project(const FiniteElement &fe,
2737  DenseMatrix &I) const
2738  { Project_ND(tk, dof2tk, fe, Trans, I); }
2739  virtual void ProjectGrad(const FiniteElement &fe,
2741  DenseMatrix &grad) const
2742  { ProjectGrad_ND(tk, dof2tk, fe, Trans, grad); }
2743 
2744  virtual void ProjectCurl(const FiniteElement &fe,
2746  DenseMatrix &curl) const
2747  { ProjectCurl_ND(tk, dof2tk, fe, Trans, curl); }
2748 };
2749 
2751 {
2752  static const double tk[8], c;
2753 
2754 #ifndef MFEM_THREAD_SAFE
2755  mutable Vector shape_x, shape_y, shape_l;
2756  mutable Vector dshape_x, dshape_y, dshape_l;
2757  mutable DenseMatrix u;
2758  mutable Vector curlu;
2759 #endif
2760  Array<int> dof2tk;
2761  DenseMatrixInverse Ti;
2762 
2763 public:
2764  ND_TriangleElement(const int p);
2765  virtual void CalcVShape(const IntegrationPoint &ip,
2766  DenseMatrix &shape) const;
2768  DenseMatrix &shape) const
2769  { CalcVShape_ND(Trans, shape); }
2770  virtual void CalcCurlShape(const IntegrationPoint &ip,
2771  DenseMatrix &curl_shape) const;
2773  DenseMatrix &I) const
2774  { LocalInterpolation_ND(*this, tk, dof2tk, Trans, I); }
2776  DenseMatrix &R) const
2777  { LocalRestriction_ND(tk, dof2tk, Trans, R); }
2778  virtual void GetTransferMatrix(const FiniteElement &fe,
2780  DenseMatrix &I) const
2781  { LocalInterpolation_ND(CheckVectorFE(fe), tk, dof2tk, Trans, I); }
2782  using FiniteElement::Project;
2783  virtual void Project(VectorCoefficient &vc,
2784  ElementTransformation &Trans, Vector &dofs) const
2785  { Project_ND(tk, dof2tk, vc, Trans, dofs); }
2787  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2788  { ProjectMatrixCoefficient_ND(tk, dof2tk, mc, T, dofs); }
2789  virtual void Project(const FiniteElement &fe,
2791  DenseMatrix &I) const
2792  { Project_ND(tk, dof2tk, fe, Trans, I); }
2793  virtual void ProjectGrad(const FiniteElement &fe,
2795  DenseMatrix &grad) const
2796  { ProjectGrad_ND(tk, dof2tk, fe, Trans, grad); }
2797 };
2798 
2799 
2801 {
2802  static const double tk[1];
2803 
2804  Poly_1D::Basis &obasis1d;
2805  Array<int> dof2tk;
2806 
2807 public:
2808  ND_SegmentElement(const int p, const int ob_type = BasisType::GaussLegendre);
2809  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
2810  { obasis1d.Eval(ip.x, shape); }
2811  virtual void CalcVShape(const IntegrationPoint &ip,
2812  DenseMatrix &shape) const;
2814  DenseMatrix &shape) const
2815  { CalcVShape_ND(Trans, shape); }
2816  // virtual void CalcCurlShape(const IntegrationPoint &ip,
2817  // DenseMatrix &curl_shape) const;
2819  DenseMatrix &I) const
2820  { LocalInterpolation_ND(*this, tk, dof2tk, Trans, I); }
2822  DenseMatrix &R) const
2823  { LocalRestriction_ND(tk, dof2tk, Trans, R); }
2824  virtual void GetTransferMatrix(const FiniteElement &fe,
2826  DenseMatrix &I) const
2827  { LocalInterpolation_ND(CheckVectorFE(fe), tk, dof2tk, Trans, I); }
2828  using FiniteElement::Project;
2829  virtual void Project(VectorCoefficient &vc,
2830  ElementTransformation &Trans, Vector &dofs) const
2831  { Project_ND(tk, dof2tk, vc, Trans, dofs); }
2833  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2834  { ProjectMatrixCoefficient_ND(tk, dof2tk, mc, T, dofs); }
2835  virtual void Project(const FiniteElement &fe,
2837  DenseMatrix &I) const
2838  { Project_ND(tk, dof2tk, fe, Trans, I); }
2839  virtual void ProjectGrad(const FiniteElement &fe,
2841  DenseMatrix &grad) const
2842  { ProjectGrad_ND(tk, dof2tk, fe, Trans, grad); }
2843 };
2844 
2845 
2847 {
2848 protected:
2850  mutable const int *ijk;
2851  mutable int patch, elem;
2852  mutable Vector weights;
2853 
2854 public:
2855  NURBSFiniteElement(int D, Geometry::Type G, int Do, int O, int F)
2856  : ScalarFiniteElement(D, G, Do, O, F)
2857  {
2858  ijk = NULL;
2859  patch = elem = -1;
2860  kv.SetSize(Dim);
2861  weights.SetSize(Dof);
2862  weights = 1.0;
2863  }
2864 
2865  void Reset () const { patch = elem = -1; }
2866  void SetIJK (const int *IJK) const { ijk = IJK; }
2867  int GetPatch () const { return patch; }
2868  void SetPatch (int p) const { patch = p; }
2869  int GetElement () const { return elem; }
2870  void SetElement (int e) const { elem = e; }
2872  Vector &Weights () const { return weights; }
2873  /// Update the NURBSFiniteElement according to the currently set knot vectors
2874  virtual void SetOrder () const { }
2875 };
2876 
2878 {
2879 protected:
2880  mutable Vector shape_x;
2881 
2882 public:
2884  : NURBSFiniteElement(1, Geometry::SEGMENT, p + 1, p, FunctionSpace::Qk),
2885  shape_x(p + 1) { }
2886 
2887  virtual void SetOrder() const;
2888  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2889  virtual void CalcDShape(const IntegrationPoint &ip,
2890  DenseMatrix &dshape) const;
2891 };
2892 
2894 {
2895 protected:
2897 
2898 public:
2900  : NURBSFiniteElement(2, Geometry::SQUARE, (p + 1)*(p + 1), p,
2901  FunctionSpace::Qk),
2902  u(Dof), shape_x(p + 1), shape_y(p + 1), dshape_x(p + 1), dshape_y(p + 1)
2903  { Orders[0] = Orders[1] = p; }
2904 
2905  NURBS2DFiniteElement(int px, int py)
2906  : NURBSFiniteElement(2, Geometry::SQUARE, (px + 1)*(py + 1),
2907  std::max(px, py), FunctionSpace::Qk),
2908  u(Dof), shape_x(px + 1), shape_y(py + 1), dshape_x(px + 1),
2909  dshape_y(py + 1)
2910  { Orders[0] = px; Orders[1] = py; }
2911 
2912  virtual void SetOrder() const;
2913  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2914  virtual void CalcDShape(const IntegrationPoint &ip,
2915  DenseMatrix &dshape) const;
2916 };
2917 
2919 {
2920 protected:
2922 
2923 public:
2925  : NURBSFiniteElement(3, Geometry::CUBE, (p + 1)*(p + 1)*(p + 1), p,
2926  FunctionSpace::Qk),
2927  u(Dof), shape_x(p + 1), shape_y(p + 1), shape_z(p + 1),
2928  dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1)
2929  { Orders[0] = Orders[1] = Orders[2] = p; }
2930 
2931  NURBS3DFiniteElement(int px, int py, int pz)
2932  : NURBSFiniteElement(3, Geometry::CUBE, (px + 1)*(py + 1)*(pz + 1),
2933  std::max(std::max(px,py),pz), FunctionSpace::Qk),
2934  u(Dof), shape_x(px + 1), shape_y(py + 1), shape_z(pz + 1),
2935  dshape_x(px + 1), dshape_y(py + 1), dshape_z(pz + 1)
2936  { Orders[0] = px; Orders[1] = py; Orders[2] = pz; }
2937 
2938  virtual void SetOrder() const;
2939  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2940  virtual void CalcDShape(const IntegrationPoint &ip,
2941  DenseMatrix &dshape) const;
2942 };
2943 
2944 } // namespace mfem
2945 
2946 #endif
Implements CalcDivShape methods.
Definition: fe.hpp:290
Abstract class for Finite Elements.
Definition: fe.hpp:229
RefinedLinear3DFiniteElement()
Construct a quadratic FE on tetrahedron.
Definition: fe.cpp:4550
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:1640
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:1662
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:8921
ND_SegmentElement(const int p, const int ob_type=BasisType::GaussLegendre)
Definition: fe.cpp:11728
Tensor products of polynomials of order k.
Definition: fe.hpp:213
DenseMatrix curlshape_J
Definition: fe.hpp:698
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:6349
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2461
int GetDim() const
Returns the reference space dimension for the finite element.
Definition: fe.hpp:305
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:7591
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:3187
ScalarFiniteElement(int D, Geometry::Type G, int Do, int O, int F=FunctionSpace::Pk)
Definition: fe.hpp:571
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:1612
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:4128
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:1410
static void CalcBernstein(const int p, const double x, double *u, double *d)
Definition: fe.hpp:1792
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2420
Class for an integration rule - an Array of IntegrationPoint.
Definition: intrules.hpp:85
L2Pos_WedgeElement(const int p)
Definition: fe.cpp:9791
Linear 1D element with nodes 1/3 and 2/3 (trace of RT1)
Definition: fe.hpp:1350
Quadratic 1D element with nodes the Gaussian points in [0,1] (trace of RT2)
Definition: fe.hpp:1360
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:9311
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:11828
Linear3DFiniteElement()
Construct a linear FE on tetrahedron.
Definition: fe.cpp:2585
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:1774
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:3369
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:2494
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:2554
For scalar fields; preserves volume integrals.
Definition: fe.hpp:274
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:9072
void ProjectMatrixCoefficient_RT(const double *nk, const Array< int > &d2n, MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.cpp:764
void ProjectMatrixCoefficient_ND(const double *tk, const Array< int > &d2t, MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.cpp:940
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:10661
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()
Construct a biquadratic FE on quadrilateral.
Definition: fe.cpp:4782
NodalTensorFiniteElement(const int dims, const int p, const int btype, const DofMapType dmtype)
Definition: fe.cpp:7163
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:1980
void LocalInterpolation_RT(const VectorFiniteElement &cfe, const double *nk, const Array< int > &d2n, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.cpp:1034
L2Pos_TriangleElement(const int p)
Definition: fe.cpp:9455
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:2690
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:1205
H1Pos_SegmentElement(const int p)
Definition: fe.cpp:7533
Basis(const int p, const double *nodes, EvalType etype=Barycentric)
Create a nodal or positive (Bernstein) basis.
Definition: fe.cpp:6454
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
Definition: fe.hpp:2821
Tensor product representation using 1D matrices/tensors with dimensions using 1D number of quadrature...
Definition: fe.hpp:151
int GetPatch() const
Definition: fe.hpp:2867
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2574
virtual void ProjectDiv(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &div) const
Definition: fe.cpp:177
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:1096
Geometry::Type GeomType
Geometry::Type of the reference element.
Definition: fe.hpp:233
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:5394
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:130
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:1007
Array< const KnotVector * > kv
Definition: fe.hpp:2849
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:2824
NURBS2DFiniteElement(int px, int py)
Definition: fe.hpp:2905
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:2871
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:2602
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:9494
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2744
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:3141
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:3421
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:1776
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:7571
FiniteElement(D, G, Do, O, F)
PositiveTensorFiniteElement(const int dims, const int p, const DofMapType dmtype)
Definition: fe.cpp:7172
int GetDerivMapType() const
Definition: fe.hpp:335
L2Pos_TetrahedronElement(const int p)
Definition: fe.cpp:9649
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
Definition: fe.hpp:2397
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:8774
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.cpp:490
void CalcVShape_RT(ElementTransformation &Trans, DenseMatrix &shape) const
Definition: fe.cpp:721
void SetSize(int s)
Resize the vector to size s.
Definition: vector.hpp:400
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:10043
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:5456
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:3911
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:1331
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:451
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:1800
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Definition: fe.cpp:2158
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2525
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:2069
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:2906
FiniteElement(int D, Geometry::Type G, int Do, int O, int F=FunctionSpace::Pk)
Definition: fe.cpp:25
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
Definition: fe.hpp:2775
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
evaluate derivatives of shape function - constant 0
Definition: fe.cpp:2556
H1Pos_SegmentElement SegmentFE
Definition: fe.hpp:2136
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:1560
BiQuadratic3DFiniteElement()
Construct a quadratic FE on wedge.
Definition: fe.hpp:2115
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:2600
const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
Definition: fe.hpp:1876
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:1220
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:7236
H1Pos_TetrahedronElement(const int p)
Definition: fe.cpp:8260
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:11761
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:8940
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:2394
LagrangeHexFiniteElement(int degree)
Definition: fe.cpp:4180
TensorBasisElement(const int dims, const int p, const int btype, const DofMapType dmtype)
Definition: fe.cpp:6963
Bernstein polynomials.
Definition: fe.hpp:35
L2_SegmentElement(const int p, const int btype=BasisType::GaussLegendre)
Definition: fe.cpp:8800
aka closed Newton-Cotes
Definition: intrules.hpp:287
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...
Definition: fe.hpp:315
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:2919
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:4034
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:4342
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:2664
Data type dense matrix using column-major storage.
Definition: densemat.hpp:23
int nqpt
Number of quadrature points. When mode is TENSOR, this is the 1D number.
Definition: fe.hpp:163
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:3986
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:2456
Array< double > Gt
Transpose of G.
Definition: fe.hpp:202
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.cpp:553
void Reset() const
Definition: fe.hpp:2865
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2510
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:2560
Class for quadratic FE on triangle.
Definition: fe.hpp:933
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:11775
int ndof
Number of degrees of freedom = number of basis functions. When mode is TENSOR, this is the 1D number...
Definition: fe.hpp:159
Class for quadratic FE on interval.
Definition: fe.hpp:904
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:2389
static int GetQuadrature1D(int b_type)
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:10517
VectorFiniteElement(int D, Geometry::Type G, int Do, int O, int M, int F=FunctionSpace::Pk)
Definition: fe.hpp:779
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:9853
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:5622
void ProjectCurl_ND(const double *tk, const Array< int > &d2t, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.cpp:866
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:2571
int Space() const
Returns the type of space on each element.
Definition: fe.hpp:325
virtual void SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
Definition: fe.cpp:11752
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:2229
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:2467
RefinedTriLinear3DFiniteElement()
Construct a biquadratic FE on quadrilateral.
Definition: fe.cpp:4929
DenseMatrix vshape
Definition: fe.hpp:242
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:4167
NURBS3DFiniteElement(int px, int py, int pz)
Definition: fe.hpp:2931
Quadratic3DFiniteElement()
Construct a quadratic FE on tetrahedron.
Definition: fe.cpp:2641
int GetMapType() const
Definition: fe.hpp:331
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 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:5972
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:6159
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:3018
aka open Newton-Cotes
Definition: intrules.hpp:286
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:9614
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2640
void NodalLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I, const ScalarFiniteElement &fine_fe) const
Nodal interpolation.
Definition: fe.cpp:223
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:2281
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:9679
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:2849
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:2841
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:8878
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:7288
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:1410
Class for cubic FE on wedge.
Definition: fe.hpp:2119
void ProjectCurl_RT(const double *nk, const Array< int > &d2n, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.cpp:904
H1Pos_HexahedronElement(const int p)
Definition: fe.cpp:7666
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.cpp:161
static void CalcShape(const int p, const double x, const double y, const double z, double *shape)
Definition: fe.cpp:8362
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:624
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:9556
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Definition: fe.cpp:1292
static int GetType(char b_ident)
Convert char basis identifier to a BasisType constant.
Definition: fe.hpp:103
int GetElement() const
Definition: fe.hpp:2869
PositiveFiniteElement(int D, Geometry::Type G, int Do, int O, int F=FunctionSpace::Pk)
Definition: fe.hpp:655
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:7638
Linear2DFiniteElement()
Construct a linear FE on triangle.
Definition: fe.cpp:1234
const double * ClosedPoints(const int p, const int btype=BasisType::GaussLobatto)
Definition: fe.hpp:1734
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2405
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:2698
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:2786
Class for refined bi-linear FE on quadrilateral.
Definition: fe.hpp:1489
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:6294
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:5118
H1_HexahedronElement(const int p, const int btype=BasisType::GaussLobatto)
Definition: fe.cpp:7378
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:11649
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:1201
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:2301
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:9239
ND_TriangleElement(const int p)
Definition: fe.cpp:11568
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2265
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:10697
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:2824
static void CalcDShape(const int p, const double x, const double y, const double z, double *dshape_1d, double *dshape)
Definition: fe.cpp:8395
static void CalcBasis(const int p, const double x, double *u)
Definition: fe.hpp:1750
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:1232
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
Definition: fe.hpp:2557
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
evaluate shape function - constant 1
Definition: fe.cpp:2550
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Definition: fe.cpp:2329
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:6695
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:6888
H1Pos_TriangleElement(const int p)
Definition: fe.cpp:8115
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:3623
void SetMapType(int M)
Definition: fe.hpp:581
Cubic3DFiniteElement()
Construct a cubic FE on tetrahedron.
Definition: fe.cpp:2376
Linear1DFiniteElement()
Construct a linear FE on interval.
Definition: fe.cpp:1213
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:4491
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:6282
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:1849
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.cpp:169
Nodes: x_i = (i+1)/(n+1), i=0,...,n-1.
Definition: fe.hpp:36
Geometry::Type GetGeomType() const
Returns the Geometry::Type of the reference element.
Definition: fe.hpp:308
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:1467
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:2450
static void CalcShape(const int p, const double x, const double y, double *shape)
Definition: fe.cpp:8170
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:2872
Array< int > s_dof
Definition: fe.hpp:2357
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:2469
static const ScalarFiniteElement & CheckScalarFE(const FiniteElement &fe)
Definition: fe.hpp:559
int GetBasisType() const
Definition: fe.hpp:1817
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:3929
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:899
int Dof
Number of degrees of freedom.
Definition: fe.hpp:237
int dim
Definition: ex3.cpp:48
Class for bilinear FE on quad with nodes at the 4 Gaussian points.
Definition: fe.hpp:879
Class for refined linear FE on interval.
Definition: fe.hpp:1436
void SetIJK(const int *IJK) const
Definition: fe.hpp:2866
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
Class for refined linear FE on triangle.
Definition: fe.hpp:1456
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
Definition: fe.hpp:2502
Class for refined linear FE on tetrahedron.
Definition: fe.hpp:1476
void SetPatch(int p) const
Definition: fe.hpp:2868
const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
Definition: fe.hpp:1860
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:1427
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:1438
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:1686
Class for constant FE on triangle.
Definition: fe.hpp:1072
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:2839
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:8631
RefinedLinear1DFiniteElement()
Construct a quadratic FE on interval.
Definition: fe.cpp:4380
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:7448
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:7659
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2464
ND_HexahedronElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Definition: fe.cpp:10743
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:1953
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:9397
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:7811
Poly_1D::Basis & basis1d
Definition: fe.hpp:1805
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2470
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:4407
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:3562
static void ChebyshevPoints(const int p, double *x)
Definition: fe.cpp:6663
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:6419
H1Pos_WedgeElement(const int p)
Definition: fe.cpp:8657
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:4152
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:6260
Class for refined trilinear FE on a hexahedron.
Definition: fe.hpp:1509
ND_TetrahedronElement(const int p)
Definition: fe.cpp:11306
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:9483
Array< int > t_dof
Definition: fe.hpp:2357
const int * GetAnisotropicOrders() const
Returns an array containing the anisotropic orders/degrees.
Definition: fe.hpp:322
Class for quadratic FE on tetrahedron.
Definition: fe.hpp:1127
Mode mode
Describes the contents of the B, Bt, G, and Gt arrays, see Mode.
Definition: fe.hpp:155
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:7264
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:2713
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:1207
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:2549
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:2244
class FiniteElement * FE
The FiniteElement that created and owns this object.
Definition: fe.hpp:130
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:2718
const IntegrationRule & GetNodes() const
Definition: fe.hpp:364
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:5509
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:1508
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:9154
static int VerifyOpen(int b_type)
Definition: fe.hpp:541
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:2676
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:2415
L2Pos_QuadrilateralElement(const int p)
Definition: fe.cpp:9009
const int * ijk
Definition: fe.hpp:2850
P0SegmentFiniteElement(int Ord=0)
Definition: fe.cpp:2812
static void CalcDShape(const int p, const double x, const double y, double *dshape_1d, double *dshape)
Definition: fe.cpp:8196
int GetDerivRangeType() const
Definition: fe.hpp:329
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:9746
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:3164
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:11883
DenseMatrix curlshape
Definition: fe.hpp:698
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2729
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:1312
Class for linear FE on tetrahedron.
Definition: fe.hpp:1102
H1_SegmentElement(const int p, const int btype=BasisType::GaussLobatto)
Definition: fe.cpp:7180
Class for linear FE on interval.
Definition: fe.hpp:802
virtual ~FiniteElement()
Definition: fe.cpp:214
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:10257
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:5560
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:195
Crouzeix-Raviart finite element on quadrilateral.
Definition: fe.hpp:1176
Class for linear FE on triangle.
Definition: fe.hpp:822
Nodes: x_i = (i+1/2)/n, i=0,...,n-1.
Definition: fe.hpp:38
Class for quadratic FE on triangle with nodes at the &quot;Gaussian&quot; points.
Definition: fe.hpp:957
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:9375
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:9996
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:2772
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:2108
L2_QuadrilateralElement(const int p, const int btype=BasisType::GaussLegendre)
Definition: fe.cpp:8902
NURBSFiniteElement(int D, Geometry::Type G, int Do, int O, int F)
Definition: fe.hpp:2855
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:2724
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:3821
Basis & GetBasis(const int p, const int btype)
Get a Poly_1D::Basis object of the given degree and BasisType, btype.
Definition: fe.cpp:6912
Refined tensor products of polynomials of order k.
Definition: fe.hpp:214
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:2669
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:1283
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:2611
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:10331
const double * OpenPoints(const int p, const int btype=BasisType::GaussLegendre)
Definition: fe.hpp:1731
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:8011
static void CalcBasis(const int p, const double x, double *u, double *d, double *dd)
Definition: fe.hpp:1766
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2513
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Definition: fe.cpp:1532
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:8612
L2_WedgeElement(const int p, const int btype=BasisType::GaussLegendre)
Definition: fe.cpp:9703
void ScalarLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I, const ScalarFiniteElement &fine_fe) const
&quot;Interpolation&quot; defined through local L2-projection.
Definition: fe.cpp:257
void SetElement(int e) const
Definition: fe.hpp:2870
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:1610
void ProjectGrad_ND(const double *tk, const Array< int > &d2t, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.cpp:1013
L2_TetrahedronElement(const int p, const int btype=BasisType::GaussLegendre)
Definition: fe.cpp:9506
void CalcPhysVShape(ElementTransformation &Trans, DenseMatrix &shape) const
Equivalent to the CalcVShape() method with the same arguments.
Definition: fe.hpp:386
static const int MaxDim
Definition: geom.hpp:42
Array< int > t_dof
Definition: fe.hpp:2133
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:9477
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2571
bool HasAnisotropicOrders() const
Returns true if the FiniteElement basis may be using different orders/degrees in different spatial di...
Definition: fe.hpp:319
virtual void CalcVShape(ElementTransformation &Trans, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in physical space at the point ...
Definition: fe.hpp:1259
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2193
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:11907
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:1624
DenseMatrix m_dshape
Definition: fe.hpp:2035
int Dim
Dimension of reference space.
Definition: fe.hpp:232
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:11252
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:9033
IntegrationRule Nodes
Definition: fe.hpp:240
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2835
Array< int > dof_map
Definition: fe.hpp:1804
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:1494
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:9266
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:7551
Array< double > Bt
Transpose of B.
Definition: fe.hpp:180
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:7733
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:3873
int Orders[Geometry::MaxDim]
Anisotropic orders.
Definition: fe.hpp:239
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:11683
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:3033
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:4805
void LocalInterpolation_ND(const VectorFiniteElement &cfe, const double *tk, const Array< int > &d2t, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.cpp:1073
static int CheckClosed(int type)
If the Quadrature1D type is not closed return Invalid; otherwise return type.
Definition: intrules.cpp:812
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &ddshape) const
Definition: fe.cpp:8069
H1Pos_TriangleElement TriangleFE
Definition: fe.hpp:2135
ND_QuadrilateralElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Definition: fe.cpp:11114
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:2930
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Overrides the scalar CalcShape function to print an error.
Definition: fe.hpp:2809
void CalcVShape_ND(ElementTransformation &Trans, DenseMatrix &shape) const
Definition: fe.cpp:733
DenseMatrix Jinv
Definition: fe.hpp:697
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:1584
BiCubic3DFiniteElement()
Construct a cubic FE on wedge.
Definition: fe.hpp:2123
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2829
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8833
int GetDof() const
Returns the number of degrees of freedom in the finite element.
Definition: fe.hpp:311
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:8036
Class for bi-quadratic FE on quadrilateral.
Definition: fe.hpp:973
Class for tri-linear FE on cube.
Definition: fe.hpp:1140
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:2832
Implements CalcDShape methods.
Definition: fe.hpp:289
static bool IsClosedType(int b_type)
Definition: fe.hpp:521
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
Definition: fe.hpp:2611
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:1378
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:1399
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:5590
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:9672
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:185
DenseMatrix t_dshape
Definition: fe.hpp:2131
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:1171
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:1245
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:4975
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:4672
DenseMatrix t_dshape
Definition: fe.hpp:2355
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:1084
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:6646
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:3723
DenseMatrix s_dshape
Definition: fe.hpp:2131
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:1313
H1_TetrahedronElement(const int p, const int btype=BasisType::GaussLobatto)
Definition: fe.cpp:7895
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2411
virtual void SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
Definition: fe.cpp:11864
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:2615
DenseMatrix s_dshape
Definition: fe.hpp:2355
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:1538
Structure representing the matrices/tensors needed to evaluate (in reference space) the values...
Definition: fe.hpp:125
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:9834
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:9581
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:10961
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:3097
L2Pos_TriangleElement TriangleFE
Definition: fe.hpp:2359
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:1735
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:2756
Class for quadratic FE on wedge.
Definition: fe.hpp:2111
Class for bilinear FE on quadrilateral.
Definition: fe.hpp:844
Class for linear FE on wedge.
Definition: fe.hpp:2103
static int CheckOpen(int type)
If the Quadrature1D type is not open return Invalid; otherwise return type.
Definition: intrules.cpp:824
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:660
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
Definition: fe.hpp:2672
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2408
Nodes: x_i = i/(n-1), i=0,...,n-1.
Definition: fe.hpp:37
Array< double > B
Basis functions evaluated at quadrature points.
Definition: fe.hpp:174
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:1825
Quad1DFiniteElement()
Construct a quadratic FE on interval.
Definition: fe.cpp:1419
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:2813
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:7688
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:868
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:2505
virtual const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
Definition: fe.cpp:206
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:1367
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:2607
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:1333
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:1274
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
H1Pos_QuadrilateralElement(const int p)
Definition: fe.cpp:7598
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:9765
void LocalRestriction_ND(const double *tk, const Array< int > &d2t, ElementTransformation &Trans, DenseMatrix &R) const
Definition: fe.cpp:1153
H1_TriangleElement(const int p, const int btype=BasisType::GaussLobatto)
Definition: fe.cpp:7740
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2783
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2732
Class for integration point with weight.
Definition: intrules.hpp:25
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:1227
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:9426
Mode
Type of data stored in the arrays B, Bt, G, and Gt.
Definition: fe.hpp:138
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.cpp:142
Full multidimensional representation which does not use tensor product structure. The ordering of the...
Definition: fe.hpp:143
L2Pos_SegmentElement SegmentFE
Definition: fe.hpp:2360
const Poly_1D::Basis & GetBasis1D() const
Definition: fe.hpp:1819
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:7709
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:8884
static bool IsOpenType(int b_type)
Definition: fe.hpp:528
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:617
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:2577
Bi-quadratic element on quad with nodes at the 9 Gaussian points.
Definition: fe.hpp:1012
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:1286
No derivatives implemented.
Definition: fe.hpp:288
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:9287
void Project_RT(const double *nk, const Array< int > &d2n, VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:744
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:7403
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:664
Array< DofToQuad * > dof2quad_array
Container for all DofToQuad objects created by the FiniteElement.
Definition: fe.hpp:247
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
Definition: fe.hpp:2453
H1_WedgeElement(const int p, const int btype=BasisType::GaussLobatto)
Definition: fe.cpp:8512
Array< int > s_dof
Definition: fe.hpp:2133
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:1402
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2568
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:3537
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:11454
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:3297
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:11203
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:839
static int VerifyClosed(int b_type)
Definition: fe.hpp:535
Implements CalcCurlShape methods.
Definition: fe.hpp:291
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:2793
virtual void ProjectDiv(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &div) const
Definition: fe.cpp:582
int DerivRangeType
Definition: fe.hpp:234
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:3045
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
Definition: fe.cpp:117
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2683
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8895
RefinedLinear2DFiniteElement()
Construct a quadratic FE on triangle.
Definition: fe.cpp:4426
NodalFiniteElement(int D, Geometry::Type G, int Do, int O, int F=FunctionSpace::Pk)
Definition: fe.hpp:613
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:6214
void ProjectCurl_2D(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.cpp:387
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2680
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:2635
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:4388
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:4116
aka &quot;open half&quot; Newton-Cotes
Definition: intrules.hpp:288
Array< double > G
Gradients/divergences/curls of basis functions evaluated at quadrature points.
Definition: fe.hpp:195
Array< int > dof_map
Definition: fe.hpp:2037
RT_TetrahedronElement(const int p)
Definition: fe.cpp:10559
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:5770
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:4321
Vector & Weights() const
Definition: fe.hpp:2872
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:7217
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:2400
BiQuad2DFiniteElement()
Construct a biquadratic FE on quadrilateral.
Definition: fe.cpp:1639
virtual void GetFaceDofs(int face, int **dofs, int *ndofs) const
Definition: fe.cpp:2631
Tensor products of 1D FEs (only degree 2 is functional)
Definition: fe.hpp:1415
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:3334
P0TriangleFiniteElement()
Construct P0 triangle finite element.
Definition: fe.cpp:2543
static int VerifyNodal(int b_type)
Definition: fe.hpp:546
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2789
virtual void SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
Definition: fe.hpp:2874
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:2818
static int Pow(int base, int dim)
Return base raised to the power dim.
Definition: fe.hpp:1841
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2516
RT_TriangleElement(const int p)
Definition: fe.cpp:10406
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:7198
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:11744
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2622
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2626
BiLinear3DFiniteElement()
Construct a linear FE on wedge.
Definition: fe.hpp:2107
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:11035
void Eval(const double x, Vector &u) const
Definition: fe.cpp:6512
L2Pos_SegmentElement(const int p)
Definition: fe.cpp:8857
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:4585
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:5825
Class for cubic FE on tetrahedron.
Definition: fe.hpp:1059
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:5756
static void CalcBernstein(const int p, const double x, double *u)
Definition: fe.hpp:1790
virtual void SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
Definition: fe.cpp:11794
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2630
int GetDerivType() const
Definition: fe.hpp:333
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:7618
static Geometry::Type GetTensorProductGeometry(int dim)
Definition: fe.hpp:1827
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:9130
For scalar fields; preserves point values.
Definition: fe.hpp:273
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:1560
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:10484
Quad2DFiniteElement()
Construct a quadratic FE on triangle.
Definition: fe.cpp:1477
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2686
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2565
void LocalRestriction_RT(const double *nk, const Array< int > &d2n, ElementTransformation &Trans, DenseMatrix &R) const
Definition: fe.cpp:1110
Describes the space on each element.
Definition: fe.hpp:207
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:2772
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:123
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
Definition: fe.hpp:2721
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:2818
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:5675
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:9052
static const VectorFiniteElement & CheckVectorFE(const FiniteElement &fe)
Definition: fe.hpp:771
RT_HexahedronElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Definition: fe.cpp:10093
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:11496
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:4173
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:1878
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:1253
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:2441
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &ddshape) const
Definition: fe.cpp:7862
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:2883
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:7329
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:1158
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:5726
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:3941
RT_QuadrilateralElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Definition: fe.cpp:9882
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:863
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:2778
virtual const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
Definition: fe.cpp:297
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:4856
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:11809
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:2675
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:2499
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:2739
void Project_ND(const double *tk, const Array< int > &d2t, VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:923
int GetRangeType() const
Definition: fe.hpp:327
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:1356
int Order
Order/degree of the shape functions.
Definition: fe.hpp:237
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:3239
static void CalcBasis(const int p, const double x, double *u, double *d)
Definition: fe.hpp:1759
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:8755
A Class that defines 1-D numerical quadrature rules on [0,1].
Definition: intrules.hpp:255
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2735
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:4146
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:7424
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:2520
L2_HexahedronElement(const int p, const int btype=BasisType::GaussLegendre)
Definition: fe.cpp:9087
virtual void GetLocalRestriction(ElementTransformation &Trans, DenseMatrix &R) const
Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs. ...
Definition: fe.cpp:422
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:7307
static void CalcDBinomTerms(const int p, const double x, const double y, double *d)
Definition: fe.cpp:6759
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:5339
const IntegrationRule * IntRule
IntegrationRule that defines the quadrature points at which the basis functions of the FE are evaluat...
Definition: fe.hpp:135
TriLinear3DFiniteElement()
Construct a tri-linear FE on cube.
Definition: fe.cpp:2720
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:148
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:1457
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:9109
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:2445
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:4443
const DofToQuad & GetTensorDofToQuad(const class TensorBasisElement &tb, const IntegrationRule &ir, DofToQuad::Mode mode) const
Definition: fe.cpp:345
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:3902
L2_TriangleElement(const int p, const int btype=BasisType::GaussLegendre)
Definition: fe.cpp:9330
BiLinear2DFiniteElement()
Construct a bilinear FE on quadrilateral.
Definition: fe.cpp:1261
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:2767
Poly_1D poly1d
Definition: fe.cpp:6960
Crouzeix-Raviart finite element on triangle.
Definition: fe.hpp:1164
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:6402
Polynomials of order k.
Definition: fe.hpp:212
Lagrange1DFiniteElement(int degree)
Definition: fe.cpp:3954
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:2982
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:6095
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:9690
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8960
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:1323
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:1120
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:7833
void ProjectGrad_RT(const double *nk, const Array< int > &d2n, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.cpp:839
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:614