MFEM  v4.1.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-2020, Lawrence Livermore National Security, LLC. Produced
2 // at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3 // LICENSE and NOTICE for details. LLNL-CODE-806117.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability visit https://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the BSD-3 license. We welcome feedback and contributions, see file
10 // CONTRIBUTING.md for details.
11 
12 #ifndef MFEM_FE
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  Serendipity = 6, ///< Serendipity basis (squares / cubes)
40  NumBasisTypes = 7 /**< Keep track of maximum types to prevent
41  hard-coding */
42  };
43  /** @brief If the input does not represents a valid BasisType, abort with an
44  error; otherwise return the input. */
45  static int Check(int b_type)
46  {
47  MFEM_VERIFY(0 <= b_type && b_type < NumBasisTypes,
48  "unknown BasisType: " << b_type);
49  return b_type;
50  }
51  /** @brief If the input does not represents a valid nodal BasisType, abort
52  with an error; otherwise return the input. */
53  static int CheckNodal(int b_type)
54  {
55  MFEM_VERIFY(Check(b_type) != Positive,
56  "invalid nodal BasisType: " << Name(b_type));
57  return b_type;
58  }
59  /** @brief Get the corresponding Quadrature1D constant, when that makes
60  sense; otherwise return Quadrature1D::Invalid. */
61  static int GetQuadrature1D(int b_type)
62  {
63  switch (b_type)
64  {
67  case Positive: return Quadrature1D::ClosedUniform; // <-----
72  }
73  return Quadrature1D::Invalid;
74  }
75  /// Return the nodal BasisType corresponding to the Quadrature1D type.
76  static int GetNodalBasis(int qpt_type)
77  {
78  switch (qpt_type)
79  {
85  }
86  return Invalid;
87  }
88  /// Check and convert a BasisType constant to a string identifier.
89  static const char *Name(int b_type)
90  {
91  static const char *name[] =
92  {
93  "Gauss-Legendre", "Gauss-Lobatto", "Positive (Bernstein)",
94  "Open uniform", "Closed uniform", "Open half uniform"
95  };
96  return name[Check(b_type)];
97  }
98  /// Check and convert a BasisType constant to a char basis identifier.
99  static char GetChar(int b_type)
100  {
101  static const char ident[] = { 'g', 'G', 'P', 'u', 'U', 'o' };
102  return ident[Check(b_type)];
103  }
104  /// Convert char basis identifier to a BasisType constant.
105  static int GetType(char b_ident)
106  {
107  switch (b_ident)
108  {
109  case 'g': return GaussLegendre;
110  case 'G': return GaussLobatto;
111  case 'P': return Positive;
112  case 'u': return OpenUniform;
113  case 'U': return ClosedUniform;
114  case 'o': return OpenHalfUniform;
115  case 's': return GaussLobatto;
116  }
117  MFEM_ABORT("unknown BasisType identifier");
118  return -1;
119  }
120 };
121 
122 
123 /** @brief Structure representing the matrices/tensors needed to evaluate (in
124  reference space) the values, gradients, divergences, or curls of a
125  FiniteElement at a the quadrature points of a given IntegrationRule. */
126 /** Object of this type are typically created and owned by the respective
127  FiniteElement object. */
129 {
130 public:
131  /// The FiniteElement that created and owns this object.
132  /** This pointer is not owned. */
133  const class FiniteElement *FE;
134 
135  /** @brief IntegrationRule that defines the quadrature points at which the
136  basis functions of the #FE are evaluated. */
137  /** This pointer is not owned. */
139 
140  /// Type of data stored in the arrays #B, #Bt, #G, and #Gt.
141  enum Mode
142  {
143  /** @brief Full multidimensional representation which does not use tensor
144  product structure. The ordering of the degrees of freedom is as
145  defined by #FE */
147 
148  /** @brief Tensor product representation using 1D matrices/tensors with
149  dimensions using 1D number of quadrature points and degrees of
150  freedom. */
151  /** When representing a vector-valued FiniteElement, two DofToQuad objects
152  are used to describe the "closed" and "open" 1D basis functions
153  (TODO). */
155  };
156 
157  /// Describes the contents of the #B, #Bt, #G, and #Gt arrays, see #Mode.
159 
160  /** @brief Number of degrees of freedom = number of basis functions. When
161  #mode is TENSOR, this is the 1D number. */
162  int ndof;
163 
164  /** @brief Number of quadrature points. When #mode is TENSOR, this is the 1D
165  number. */
166  int nqpt;
167 
168  /// Basis functions evaluated at quadrature points.
169  /** The storage layout is column-major with dimensions:
170  - #nqpt x #ndof, for scalar elements, or
171  - #nqpt x dim x #ndof, for vector elements, (TODO)
172 
173  where
174 
175  - dim = dimension of the finite element reference space when #mode is
176  FULL, and dim = 1 when #mode is TENSOR. */
178 
179  /// Transpose of #B.
180  /** The storage layout is column-major with dimensions:
181  - #ndof x #nqpt, for scalar elements, or
182  - #ndof x #nqpt x dim, for vector elements (TODO). */
184 
185  /** @brief Gradients/divergences/curls of basis functions evaluated at
186  quadrature points. */
187  /** The storage layout is column-major with dimensions:
188  - #nqpt x dim x #ndof, for scalar elements, or
189  - #nqpt x #ndof, for H(div) vector elements (TODO), or
190  - #nqpt x cdim x #ndof, for H(curl) vector elements (TODO),
191 
192  where
193 
194  - dim = dimension of the finite element reference space when #mode is
195  FULL, and 1 when #mode is TENSOR,
196  - cdim = 1/1/3 in 1D/2D/3D, respectively, when #mode is FULL, and cdim =
197  1 when #mode is TENSOR. */
199 
200  /// Transpose of #G.
201  /** The storage layout is column-major with dimensions:
202  - #ndof x #nqpt x dim, for scalar elements, or
203  - #ndof x #nqpt, for H(div) vector elements (TODO), or
204  - #ndof x #nqpt x cdim, for H(curl) vector elements (TODO). */
206 };
207 
208 
209 /// Describes the space on each element
211 {
212 public:
213  enum
214  {
215  Pk, ///< Polynomials of order k
216  Qk, ///< Tensor products of polynomials of order k
217  rQk ///< Refined tensor products of polynomials of order k
218  };
219 };
220 
221 class ElementTransformation;
222 class Coefficient;
223 class VectorCoefficient;
224 class MatrixCoefficient;
225 class KnotVector;
226 
227 
228 // Base and derived classes for finite elements
229 
230 
231 /// Abstract class for Finite Elements
233 {
234 protected:
235  int Dim; ///< Dimension of reference space
236  Geometry::Type GeomType; ///< Geometry::Type of the reference element
239  mutable
240  int Dof, ///< Number of degrees of freedom
241  Order; ///< Order/degree of the shape functions
242  mutable int Orders[Geometry::MaxDim]; ///< Anisotropic orders
244 #ifndef MFEM_THREAD_SAFE
245  mutable DenseMatrix vshape; // Dof x Dim
246 #endif
247  /// Container for all DofToQuad objects created by the FiniteElement.
248  /** Multiple DofToQuad objects may be needed when different quadrature rules
249  or different DofToQuad::Mode are used. */
251 
252 public:
253  /// Enumeration for RangeType and DerivRangeType
254  enum { SCALAR, VECTOR };
255 
256  /** @brief Enumeration for MapType: defines how reference functions are
257  mapped to physical space.
258 
259  A reference function, `uh(xh)`, can be mapped to a function, `u(x)`, on a
260  general physical element in following ways:
261 
262  VALUE u(x) = uh(xh)
263  INTEGRAL u(x) = (1/w) * uh(xh)
264  H_DIV u(x) = (J/w) * uh(xh)
265  H_CURL u(x) = J^{-t} * uh(xh) (square J)
266  H_CURL u(x) = J*(J^t*J)^{-1} * uh(xh) (general J)
267 
268  where
269 
270  x = T(xh) is the image of the reference point xh ("x hat"),
271  J = J(xh) is the Jacobian matrix of the transformation T, and
272  w = w(xh) = / det(J), for square J,
273  \ det(J^t*J)^{1/2}, for general J,
274  is the transformation weight factor.
275  */
276  enum { VALUE, ///< For scalar fields; preserves point values
277  INTEGRAL, ///< For scalar fields; preserves volume integrals
278  H_DIV, /**< For vector fields; preserves surface integrals of the
279  normal component */
280  H_CURL /**< For vector fields; preserves line integrals of the
281  tangential component */
282  };
283 
284  /** @brief Enumeration for DerivType: defines which derivative method
285  is implemented.
286 
287  Each FiniteElement class implements only one type of derivative. The
288  value returned by GetDerivType() indicates which derivative method is
289  implemented.
290  */
291  enum { NONE, ///< No derivatives implemented
292  GRAD, ///< Implements CalcDShape methods
293  DIV, ///< Implements CalcDivShape methods
294  CURL ///< Implements CalcCurlShape methods
295  };
296 
297  /** Construct FiniteElement with given
298  @param D Reference space dimension
299  @param G Geometry type (of type Geometry::Type)
300  @param Do Number of degrees of freedom in the FiniteElement
301  @param O Order/degree of the FiniteElement
302  @param F FunctionSpace type of the FiniteElement
303  */
304  FiniteElement(int D, Geometry::Type G, int Do, int O,
305  int F = FunctionSpace::Pk);
306 
307  /// Returns the reference space dimension for the finite element
308  int GetDim() const { return Dim; }
309 
310  /// Returns the Geometry::Type of the reference element
311  Geometry::Type GetGeomType() const { return GeomType; }
312 
313  /// Returns the number of degrees of freedom in the finite element
314  int GetDof() const { return Dof; }
315 
316  /** @brief Returns the order of the finite element. In the case of
317  anisotropic orders, returns the maximum order. */
318  int GetOrder() const { return Order; }
319 
320  /** @brief Returns true if the FiniteElement basis *may be using* different
321  orders/degrees in different spatial directions. */
322  bool HasAnisotropicOrders() const { return Orders[0] != -1; }
323 
324  /// Returns an array containing the anisotropic orders/degrees.
325  const int *GetAnisotropicOrders() const { return Orders; }
326 
327  /// Returns the type of space on each element
328  int Space() const { return FuncSpace; }
329 
330  int GetRangeType() const { return RangeType; }
331 
332  int GetDerivRangeType() const { return DerivRangeType; }
333 
334  int GetMapType() const { return MapType; }
335 
336  int GetDerivType() const { return DerivType; }
337 
338  int GetDerivMapType() const { return DerivMapType; }
339 
340  /** @brief Evaluate the values of all shape functions of a scalar finite
341  element in reference space at the given point @a ip. */
342  /** The size (#Dof) of the result Vector @a shape must be set in advance. */
343  virtual void CalcShape(const IntegrationPoint &ip,
344  Vector &shape) const = 0;
345 
346  /** @brief Evaluate the values of all shape functions of a scalar finite
347  element in physical space at the point described by @a Trans. */
348  /** The size (#Dof) of the result Vector @a shape must be set in advance. */
349  void CalcPhysShape(ElementTransformation &Trans, Vector &shape) const;
350 
351  /** @brief Evaluate the gradients of all shape functions of a scalar finite
352  element in reference space at the given point @a ip. */
353  /** Each row of the result DenseMatrix @a dshape contains the derivatives of
354  one shape function. The size (#Dof x #Dim) of @a dshape must be set in
355  advance. */
356  virtual void CalcDShape(const IntegrationPoint &ip,
357  DenseMatrix &dshape) const = 0;
358 
359  /** @brief Evaluate the gradients of all shape functions of a scalar finite
360  element in physical space at the point described by @a Trans. */
361  /** Each row of the result DenseMatrix @a dshape contains the derivatives of
362  one shape function. The size (#Dof x SDim) of @a dshape must be set in
363  advance, where SDim >= #Dim is the physical space dimension as described
364  by @a Trans. */
366 
367  const IntegrationRule & GetNodes() const { return Nodes; }
368 
369  // virtual functions for finite elements on vector spaces
370 
371  /** @brief Evaluate the values of all shape functions of a *vector* finite
372  element in reference space at the given point @a ip. */
373  /** Each row of the result DenseMatrix @a shape contains the components of
374  one vector shape function. The size (#Dof x #Dim) of @a shape must be set
375  in advance. */
376  virtual void CalcVShape(const IntegrationPoint &ip,
377  DenseMatrix &shape) const;
378 
379  /** @brief Evaluate the values of all shape functions of a *vector* finite
380  element in physical space at the point described by @a Trans. */
381  /** Each row of the result DenseMatrix @a shape contains the components of
382  one vector shape function. The size (#Dof x SDim) of @a shape must be set
383  in advance, where SDim >= #Dim is the physical space dimension as
384  described by @a Trans. */
385  virtual void CalcVShape(ElementTransformation &Trans,
386  DenseMatrix &shape) const;
387 
388  /// Equivalent to the CalcVShape() method with the same arguments.
390  { CalcVShape(Trans, shape); }
391 
392  /** @brief Evaluate the divergence of all shape functions of a *vector*
393  finite element in reference space at the given point @a ip. */
394  /** The size (#Dof) of the result Vector @a divshape must be set in advance.
395  */
396  virtual void CalcDivShape(const IntegrationPoint &ip,
397  Vector &divshape) const;
398 
399  /** @brief Evaluate the divergence of all shape functions of a *vector*
400  finite element in physical space at the point described by @a Trans. */
401  /** The size (#Dof) of the result Vector @a divshape must be set in advance.
402  */
403  void CalcPhysDivShape(ElementTransformation &Trans, Vector &divshape) const;
404 
405  /** @brief Evaluate the curl of all shape functions of a *vector* finite
406  element in reference space at the given point @a ip. */
407  /** Each row of the result DenseMatrix @a curl_shape contains the components
408  of the curl of one vector shape function. The size (#Dof x CDim) of
409  @a curl_shape must be set in advance, where CDim = 3 for #Dim = 3 and
410  CDim = 1 for #Dim = 2. */
411  virtual void CalcCurlShape(const IntegrationPoint &ip,
412  DenseMatrix &curl_shape) const;
413 
414  /** @brief Evaluate the curl of all shape functions of a *vector* finite
415  element in physical space at the point described by @a Trans. */
416  /** Each row of the result DenseMatrix @a curl_shape contains the components
417  of the curl of one vector shape function. The size (#Dof x CDim) of
418  @a curl_shape must be set in advance, where CDim = 3 for #Dim = 3 and
419  CDim = 1 for #Dim = 2. */
421  DenseMatrix &curl_shape) const;
422 
423  virtual void GetFaceDofs(int face, int **dofs, int *ndofs) const;
424 
425  /** @brief Evaluate the Hessians of all shape functions of a scalar finite
426  element in reference space at the given point @a ip. */
427  /** Each row of the result DenseMatrix @a Hessian contains upper triangular
428  part of the Hessian of one shape function.
429  The order in 2D is {u_xx, u_xy, u_yy}.
430  The size (#Dof x (#Dim (#Dim-1)/2) of @a Hessian must be set in advance.*/
431  virtual void CalcHessian (const IntegrationPoint &ip,
432  DenseMatrix &Hessian) const;
433 
434  /** @brief Evaluate the Hessian of all shape functions of a scalar finite
435  element in reference space at the given point @a ip. */
436  /** The size (#Dof, #Dim*(#Dim+1)/2) of @a Hessian must be set in advance. */
438  DenseMatrix& Hessian) const;
439 
440  /** @brief Evaluate the Laplacian of all shape functions of a scalar finite
441  element in reference space at the given point @a ip. */
442  /** The size (#Dof) of @a Laplacian must be set in advance. */
444  Vector& Laplacian) const;
445 
447  Vector& Laplacian) const;
448 
449  /** @brief Return the local interpolation matrix @a I (Dof x Dof) where the
450  fine element is the image of the base geometry under the given
451  transformation. */
453  DenseMatrix &I) const;
454 
455  /** @brief Return a local restriction matrix @a R (Dof x Dof) mapping fine
456  dofs to coarse dofs.
457 
458  The fine element is the image of the base geometry under the given
459  transformation, @a Trans.
460 
461  The assumption in this method is that a subset of the coarse dofs can be
462  expressed only in terms of the dofs of the given fine element.
463 
464  Rows in @a R corresponding to coarse dofs that cannot be expressed in
465  terms of the fine dofs will be marked as invalid by setting the first
466  entry (column 0) in the row to infinity().
467 
468  This method assumes that the dimensions of @a R are set before it is
469  called. */
471  DenseMatrix &R) const;
472 
473  /** @brief Return interpolation matrix, @a I, which maps dofs from a coarse
474  element, @a fe, to the fine dofs on @a this finite element. */
475  /** @a Trans represents the mapping from the reference element of @a this
476  element into a subset of the reference space of the element @a fe, thus
477  allowing the "coarse" FiniteElement to be different from the "fine"
478  FiniteElement as when h-refinement is combined with p-refinement or
479  p-derefinement. It is assumed that both finite elements use the same
480  MapType. */
481  virtual void GetTransferMatrix(const FiniteElement &fe,
483  DenseMatrix &I) const;
484 
485  /** Given a coefficient and a transformation, compute its projection
486  (approximation) in the local finite dimensional space in terms
487  of the degrees of freedom. */
488  virtual void Project (Coefficient &coeff,
489  ElementTransformation &Trans, Vector &dofs) const;
490 
491  /** Given a vector coefficient and a transformation, compute its
492  projection (approximation) in the local finite dimensional space
493  in terms of the degrees of freedom. (VectorFiniteElements) */
494  virtual void Project (VectorCoefficient &vc,
495  ElementTransformation &Trans, Vector &dofs) const;
496 
497  /** Given a matrix coefficient and a transformation, compute an approximation
498  ("projection") in the local finite dimensional space in terms of the
499  degrees of freedom. For VectorFiniteElements, the rows of the coefficient
500  are projected in the vector space. */
501  virtual void ProjectMatrixCoefficient(
502  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const;
503 
504  /** Compute a representation (up to multiplicative constant) for
505  the delta function at the vertex with the given index. */
506  virtual void ProjectDelta(int vertex, Vector &dofs) const;
507 
508  /** Compute the embedding/projection matrix from the given FiniteElement
509  onto 'this' FiniteElement. The ElementTransformation is included to
510  support cases when the projection depends on it. */
511  virtual void Project(const FiniteElement &fe, ElementTransformation &Trans,
512  DenseMatrix &I) const;
513 
514  /** Compute the discrete gradient matrix from the given FiniteElement onto
515  'this' FiniteElement. The ElementTransformation is included to support
516  cases when the matrix depends on it. */
517  virtual void ProjectGrad(const FiniteElement &fe,
519  DenseMatrix &grad) const;
520 
521  /** Compute the discrete curl matrix from the given FiniteElement onto
522  'this' FiniteElement. The ElementTransformation is included to support
523  cases when the matrix depends on it. */
524  virtual void ProjectCurl(const FiniteElement &fe,
526  DenseMatrix &curl) const;
527 
528  /** Compute the discrete divergence matrix from the given FiniteElement onto
529  'this' FiniteElement. The ElementTransformation is included to support
530  cases when the matrix depends on it. */
531  virtual void ProjectDiv(const FiniteElement &fe,
533  DenseMatrix &div) const;
534 
535  /** Return a DofToQuad structure corresponding to the given IntegrationRule
536  using the given DofToQuad::Mode. */
537  /** See the documentation for DofToQuad for more details. */
538  virtual const DofToQuad &GetDofToQuad(const IntegrationRule &ir,
539  DofToQuad::Mode mode) const;
540 
541  virtual ~FiniteElement();
542 
543  static bool IsClosedType(int b_type)
544  {
545  const int q_type = BasisType::GetQuadrature1D(b_type);
546  return ((q_type != Quadrature1D::Invalid) &&
548  }
549 
550  static bool IsOpenType(int b_type)
551  {
552  const int q_type = BasisType::GetQuadrature1D(b_type);
553  return ((q_type != Quadrature1D::Invalid) &&
555  }
556 
557  static int VerifyClosed(int b_type)
558  {
559  MFEM_VERIFY(IsClosedType(b_type),
560  "invalid closed basis type: " << b_type);
561  return b_type;
562  }
563  static int VerifyOpen(int b_type)
564  {
565  MFEM_VERIFY(IsOpenType(b_type), "invalid open basis type: " << b_type);
566  return b_type;
567  }
568  static int VerifyNodal(int b_type)
569  {
570  return BasisType::CheckNodal(b_type);
571  }
572 };
573 
575 {
576 protected:
577 #ifndef MFEM_THREAD_SAFE
578  mutable Vector c_shape;
579 #endif
580 
582  {
583  if (fe.GetRangeType() != SCALAR)
584  { mfem_error("'fe' must be a ScalarFiniteElement"); }
585  return static_cast<const ScalarFiniteElement &>(fe);
586  }
587 
588  const DofToQuad &GetTensorDofToQuad(const class TensorBasisElement &tb,
589  const IntegrationRule &ir,
590  DofToQuad::Mode mode) const;
591 
592 public:
594  int F = FunctionSpace::Pk)
595 #ifdef MFEM_THREAD_SAFE
596  : FiniteElement(D, G, Do, O, F)
598 #else
599  : FiniteElement(D, G, Do, O, F), c_shape(Dof)
601 #endif
602 
603  void SetMapType(int M)
604  {
605  MFEM_VERIFY(M == VALUE || M == INTEGRAL, "unknown MapType");
606  MapType = M;
607  DerivType = (M == VALUE) ? GRAD : NONE;
608  }
609 
610  /// Nodal interpolation.
612  DenseMatrix &I,
613  const ScalarFiniteElement &fine_fe) const;
614 
615  /// "Interpolation" defined through local L2-projection.
616  /** If the "fine" elements cannot represent all basis functions of the
617  "coarse" element, then boundary values from different sub-elements are
618  generally different. */
620  DenseMatrix &I,
621  const ScalarFiniteElement &fine_fe) const;
622 
623  virtual const DofToQuad &GetDofToQuad(const IntegrationRule &ir,
624  DofToQuad::Mode mode) const;
625 };
626 
628 {
629 protected:
630  void ProjectCurl_2D(const FiniteElement &fe,
632  DenseMatrix &curl) const;
633 
634 public:
636  int F = FunctionSpace::Pk)
637  : ScalarFiniteElement(D, G, Do, O, F) { }
638 
640  DenseMatrix &I) const
641  { NodalLocalInterpolation(Trans, I, *this); }
642 
643  virtual void GetLocalRestriction(ElementTransformation &Trans,
644  DenseMatrix &R) const;
645 
646  virtual void GetTransferMatrix(const FiniteElement &fe,
647  ElementTransformation &Trans,
648  DenseMatrix &I) const
649  { CheckScalarFE(fe).NodalLocalInterpolation(Trans, I, *this); }
650 
651  virtual void Project (Coefficient &coeff,
652  ElementTransformation &Trans, Vector &dofs) const;
653 
654  virtual void Project (VectorCoefficient &vc,
655  ElementTransformation &Trans, Vector &dofs) const;
656 
657  // (mc.height x mc.width) @ DOFs -> (Dof x mc.width x mc.height) in dofs
658  virtual void ProjectMatrixCoefficient(
659  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const;
660 
661  virtual void Project(const FiniteElement &fe, ElementTransformation &Trans,
662  DenseMatrix &I) const;
663 
664  virtual void ProjectGrad(const FiniteElement &fe,
665  ElementTransformation &Trans,
666  DenseMatrix &grad) const;
667 
668  virtual void ProjectDiv(const FiniteElement &fe,
669  ElementTransformation &Trans,
670  DenseMatrix &div) const;
671 };
672 
673 
675 {
676 public:
678  int F = FunctionSpace::Pk) :
679  ScalarFiniteElement(D, G, Do, O, F)
680  { }
681 
683  DenseMatrix &I) const
684  { ScalarLocalInterpolation(Trans, I, *this); }
685 
686  virtual void GetTransferMatrix(const FiniteElement &fe,
688  DenseMatrix &I) const
689  { CheckScalarFE(fe).ScalarLocalInterpolation(Trans, I, *this); }
690 
692 
693  // Low-order monotone "projection" (actually it is not a projection): the
694  // dofs are set to be the Coefficient values at the nodes.
695  virtual void Project(Coefficient &coeff,
696  ElementTransformation &Trans, Vector &dofs) const;
697 
698  virtual void Project (VectorCoefficient &vc,
699  ElementTransformation &Trans, Vector &dofs) const;
700 
701  virtual void Project(const FiniteElement &fe, ElementTransformation &Trans,
702  DenseMatrix &I) const;
703 };
704 
706 {
707  // Hide the scalar functions CalcShape and CalcDShape.
708 private:
709  /// Overrides the scalar CalcShape function to print an error.
710  virtual void CalcShape(const IntegrationPoint &ip,
711  Vector &shape) const;
712 
713  /// Overrides the scalar CalcDShape function to print an error.
714  virtual void CalcDShape(const IntegrationPoint &ip,
715  DenseMatrix &dshape) const;
716 
717 protected:
718 #ifndef MFEM_THREAD_SAFE
719  mutable DenseMatrix J, Jinv;
721 #endif
722  void SetDerivMembers();
723 
725  DenseMatrix &shape) const;
726 
728  DenseMatrix &shape) const;
729 
730  void Project_RT(const double *nk, const Array<int> &d2n,
732  Vector &dofs) const;
733 
734  // project the rows of the matrix coefficient in an RT space
736  const double *nk, const Array<int> &d2n,
737  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const;
738 
739  void Project_RT(const double *nk, const Array<int> &d2n,
741  DenseMatrix &I) const;
742 
743  // rotated gradient in 2D
744  void ProjectGrad_RT(const double *nk, const Array<int> &d2n,
746  DenseMatrix &grad) const;
747 
748  // Compute the curl as a discrete operator from ND FE (fe) to ND FE (this).
749  // The natural FE for the range is RT, so this is an approximation.
750  void ProjectCurl_ND(const double *tk, const Array<int> &d2t,
752  DenseMatrix &curl) const;
753 
754  void ProjectCurl_RT(const double *nk, const Array<int> &d2n,
756  DenseMatrix &curl) const;
757 
758  void Project_ND(const double *tk, const Array<int> &d2t,
760  Vector &dofs) const;
761 
762  // project the rows of the matrix coefficient in an ND space
764  const double *tk, const Array<int> &d2t,
765  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const;
766 
767  void Project_ND(const double *tk, const Array<int> &d2t,
769  DenseMatrix &I) const;
770 
771  void ProjectGrad_ND(const double *tk, const Array<int> &d2t,
773  DenseMatrix &grad) const;
774 
776  const double *nk, const Array<int> &d2n,
778  DenseMatrix &I) const;
779 
781  const double *tk, const Array<int> &d2t,
783  DenseMatrix &I) const;
784 
785  void LocalRestriction_RT(const double *nk, const Array<int> &d2n,
787  DenseMatrix &R) const;
788 
789  void LocalRestriction_ND(const double *tk, const Array<int> &d2t,
791  DenseMatrix &R) const;
792 
794  {
795  if (fe.GetRangeType() != VECTOR)
796  { mfem_error("'fe' must be a VectorFiniteElement"); }
797  return static_cast<const VectorFiniteElement &>(fe);
798  }
799 
800 public:
801  VectorFiniteElement (int D, Geometry::Type G, int Do, int O, int M,
802  int F = FunctionSpace::Pk) :
803 #ifdef MFEM_THREAD_SAFE
804  FiniteElement(D, G, Do, O, F)
805  { RangeType = VECTOR; MapType = M; SetDerivMembers(); }
806 #else
807  FiniteElement(D, G, Do, O, F), Jinv(D)
808  { RangeType = VECTOR; MapType = M; SetDerivMembers(); }
809 #endif
810 };
811 
813 {
814 public:
816 
817  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
818 
819  virtual void CalcDShape(const IntegrationPoint &ip,
820  DenseMatrix &dshape) const;
821 };
822 
823 /// Class for linear FE on interval
825 {
826 public:
827  /// Construct a linear FE on interval
829 
830  /** virtual function which evaluates the values of all
831  shape functions at a given point ip and stores
832  them in the vector shape of dimension Dof (2) */
833  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
834 
835  /** virtual function which evaluates the derivatives of all
836  shape functions at a given point ip and stores them in
837  the matrix dshape (Dof x Dim) (2 x 1) so that each row
838  contains the derivative of one shape function */
839  virtual void CalcDShape(const IntegrationPoint &ip,
840  DenseMatrix &dshape) const;
841 };
842 
843 /// Class for linear FE on triangle
845 {
846 public:
847  /// Construct a linear FE on triangle
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 (3) */
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) (3 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 ProjectDelta(int vertex, Vector &dofs) const
862  { dofs = 0.0; dofs(vertex) = 1.0; }
863 };
864 
865 /// Class for bilinear FE on quadrilateral
867 {
868 public:
869  /// Construct a bilinear FE on quadrilateral
871 
872  /** virtual function which evaluates the values of all
873  shape functions at a given point ip and stores
874  them in the vector shape of dimension Dof (4) */
875  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
876 
877  /** virtual function which evaluates the values of all
878  partial derivatives of all shape functions at a given
879  point ip and stores them in the matrix dshape (Dof x Dim) (4 x 2)
880  so that each row contains the derivatives of one shape function */
881  virtual void CalcDShape(const IntegrationPoint &ip,
882  DenseMatrix &dshape) const;
883  virtual void CalcHessian (const IntegrationPoint &ip,
884  DenseMatrix &h) const;
885  virtual void ProjectDelta(int vertex, Vector &dofs) const
886  { dofs = 0.0; dofs(vertex) = 1.0; } // { dofs = 1.0; }
887 };
888 
889 /// Class for linear FE on triangle with nodes at the 3 "Gaussian" points
891 {
892 public:
894  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
895  virtual void CalcDShape(const IntegrationPoint &ip,
896  DenseMatrix &dshape) const;
897  virtual void ProjectDelta(int vertex, Vector &dofs) const;
898 };
899 
900 /// Class for bilinear FE on quad with nodes at the 4 Gaussian points
902 {
903 private:
904  static const double p[2];
905 
906 public:
908  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
909  virtual void CalcDShape(const IntegrationPoint &ip,
910  DenseMatrix &dshape) const;
911  virtual void ProjectDelta(int vertex, Vector &dofs) const;
912 };
913 
915 {
916 public:
918  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
919  virtual void CalcDShape(const IntegrationPoint &ip,
920  DenseMatrix &dshape) const;
921  virtual void ProjectDelta(int vertex, Vector &dofs) const
922  { dofs = 1.0; }
923 };
924 
925 /// Class for quadratic FE on interval
927 {
928 public:
929  /// Construct a quadratic FE on interval
931 
932  /** virtual function which evaluates the values of all
933  shape functions at a given point ip and stores
934  them in the vector shape of dimension Dof (3) */
935  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
936 
937  /** virtual function which evaluates the derivatives of all
938  shape functions at a given point ip and stores them in
939  the matrix dshape (Dof x Dim) (3 x 1) so that each row
940  contains the derivative of one shape function */
941  virtual void CalcDShape(const IntegrationPoint &ip,
942  DenseMatrix &dshape) const;
943 };
944 
946 {
947 public:
949  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
950  virtual void CalcDShape(const IntegrationPoint &ip,
951  DenseMatrix &dshape) const;
952 };
953 
954 /// Class for quadratic FE on triangle
956 {
957 public:
958  /// Construct a quadratic FE on triangle
960 
961  /** virtual function which evaluates the values of all
962  shape functions at a given point ip and stores
963  them in the vector shape of dimension Dof (6) */
964  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
965 
966  /** virtual function which evaluates the values of all
967  partial derivatives of all shape functions at a given
968  point ip and stores them in the matrix dshape (Dof x Dim) (6 x 2)
969  so that each row contains the derivatives of one shape function */
970  virtual void CalcDShape(const IntegrationPoint &ip,
971  DenseMatrix &dshape) const;
972 
973  virtual void CalcHessian (const IntegrationPoint &ip,
974  DenseMatrix &h) const;
975  virtual void ProjectDelta(int vertex, Vector &dofs) const;
976 };
977 
978 /// Class for quadratic FE on triangle with nodes at the "Gaussian" points
980 {
981 private:
982  static const double p[2];
983  DenseMatrix A;
984  mutable DenseMatrix D;
985  mutable Vector pol;
986 public:
988  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
989  virtual void CalcDShape(const IntegrationPoint &ip,
990  DenseMatrix &dshape) const;
991  // virtual void ProjectDelta(int vertex, Vector &dofs) const;
992 };
993 
994 /// Class for bi-quadratic FE on quadrilateral
996 {
997 public:
998  /// Construct a biquadratic FE on quadrilateral
1000 
1001  /** virtual function which evaluates the values of all
1002  shape functions at a given point ip and stores
1003  them in the vector shape of dimension Dof (9) */
1004  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1005 
1006  /** virtual function which evaluates the values of all
1007  partial derivatives of all shape functions at a given
1008  point ip and stores them in the matrix dshape (Dof x Dim) (9 x 2)
1009  so that each row contains the derivatives of one shape function */
1010  virtual void CalcDShape(const IntegrationPoint &ip,
1011  DenseMatrix &dshape) const;
1012  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1013 };
1014 
1016 {
1017 public:
1019  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1020  virtual void CalcDShape(const IntegrationPoint &ip,
1021  DenseMatrix &dshape) const;
1023  DenseMatrix &I) const;
1024  using FiniteElement::Project;
1025  virtual void Project(Coefficient &coeff, ElementTransformation &Trans,
1026  Vector &dofs) const;
1027  virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans,
1028  Vector &dofs) const;
1029  virtual void ProjectDelta(int vertex, Vector &dofs) const
1030  { dofs = 0.; dofs(vertex) = 1.; }
1031 };
1032 
1033 /// Bi-quadratic element on quad with nodes at the 9 Gaussian points
1035 {
1036 public:
1038  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1039  virtual void CalcDShape(const IntegrationPoint &ip,
1040  DenseMatrix &dshape) const;
1041  // virtual void ProjectDelta(int vertex, Vector &dofs) const { dofs = 1.; }
1042 };
1043 
1045 {
1046 public:
1048  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1049  virtual void CalcDShape(const IntegrationPoint &ip,
1050  DenseMatrix &dshape) const;
1051  virtual void CalcHessian (const IntegrationPoint &ip,
1052  DenseMatrix &h) const;
1053 };
1054 
1056 {
1057 public:
1059 
1060  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1061 
1062  virtual void CalcDShape(const IntegrationPoint &ip,
1063  DenseMatrix &dshape) const;
1064 };
1065 
1067 {
1068 public:
1070 
1071  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1072 
1073  virtual void CalcDShape(const IntegrationPoint &ip,
1074  DenseMatrix &dshape) const;
1075 
1076  virtual void CalcHessian (const IntegrationPoint &ip,
1077  DenseMatrix &h) const;
1078 };
1079 
1080 /// Class for cubic FE on tetrahedron
1082 {
1083 public:
1084  /// Construct a cubic FE on tetrahedron
1086 
1087  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1088 
1089  virtual void CalcDShape(const IntegrationPoint &ip,
1090  DenseMatrix &dshape) const;
1091 };
1092 
1093 /// Class for constant FE on triangle
1095 {
1096 public:
1097  /// Construct P0 triangle finite element
1099 
1100  /// evaluate shape function - constant 1
1101  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1102 
1103  /// evaluate derivatives of shape function - constant 0
1104  virtual void CalcDShape(const IntegrationPoint &ip,
1105  DenseMatrix &dshape) const;
1106  virtual void ProjectDelta(int vertex, Vector &dofs) const
1107  { dofs(0) = 1.0; }
1108 };
1109 
1110 
1112 {
1113 public:
1115  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1116  virtual void CalcDShape(const IntegrationPoint &ip,
1117  DenseMatrix &dshape) const;
1118  virtual void ProjectDelta(int vertex, Vector &dofs) const
1119  { dofs(0) = 1.0; }
1120 };
1121 
1122 
1123 /// Class for linear FE on tetrahedron
1125 {
1126 public:
1127  /// Construct a linear FE on tetrahedron
1129 
1130  /** virtual function which evaluates the values of all
1131  shape functions at a given point ip and stores
1132  them in the vector shape of dimension Dof (4) */
1133  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1134 
1135  /** virtual function which evaluates the values of all
1136  partial derivatives of all shape functions at a given
1137  point ip and stores them in the matrix dshape (Dof x Dim) (4 x 3)
1138  so that each row contains the derivatives of one shape function */
1139  virtual void CalcDShape(const IntegrationPoint &ip,
1140  DenseMatrix &dshape) const;
1141 
1142  virtual void ProjectDelta(int vertex, Vector &dofs) const
1143  { dofs = 0.0; dofs(vertex) = 1.0; }
1144 
1145  virtual void GetFaceDofs(int face, int **dofs, int *ndofs) const;
1146 };
1147 
1148 /// Class for quadratic FE on tetrahedron
1150 {
1151 public:
1152  /// Construct a quadratic FE on tetrahedron
1154 
1155  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1156 
1157  virtual void CalcDShape(const IntegrationPoint &ip,
1158  DenseMatrix &dshape) const;
1159 };
1160 
1161 /// Class for tri-linear FE on cube
1163 {
1164 public:
1165  /// Construct a tri-linear FE on cube
1167 
1168  /** virtual function which evaluates the values of all
1169  shape functions at a given point ip and stores
1170  them in the vector shape of dimension Dof (8) */
1171  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1172 
1173  /** virtual function which evaluates the values of all
1174  partial derivatives of all shape functions at a given
1175  point ip and stores them in the matrix dshape (Dof x Dim) (8 x 3)
1176  so that each row contains the derivatives of one shape function */
1177  virtual void CalcDShape(const IntegrationPoint &ip,
1178  DenseMatrix &dshape) const;
1179 
1180  virtual void ProjectDelta(int vertex, Vector &dofs) const
1181  { dofs = 0.0; dofs(vertex) = 1.0; }
1182 };
1183 
1184 
1185 /// Crouzeix-Raviart finite element on triangle
1187 {
1188 public:
1190  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1191  virtual void CalcDShape(const IntegrationPoint &ip,
1192  DenseMatrix &dshape) const;
1193  virtual void ProjectDelta(int vertex, Vector &dofs) const
1194  { dofs = 1.0; }
1195 };
1196 
1197 /// Crouzeix-Raviart finite element on quadrilateral
1199 {
1200 public:
1202  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1203  virtual void CalcDShape(const IntegrationPoint &ip,
1204  DenseMatrix &dshape) const;
1205 };
1206 
1208 {
1209 public:
1210  P0SegmentFiniteElement(int Ord = 0);
1211  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1212  virtual void CalcDShape(const IntegrationPoint &ip,
1213  DenseMatrix &dshape) const;
1214 };
1215 
1217 {
1218 private:
1219  static const double nk[3][2];
1220 
1221 public:
1223 
1224  virtual void CalcVShape(const IntegrationPoint &ip,
1225  DenseMatrix &shape) const;
1226 
1228  DenseMatrix &shape) const
1229  { CalcVShape_RT(Trans, shape); }
1230 
1231  virtual void CalcDivShape(const IntegrationPoint &ip,
1232  Vector &divshape) const;
1233 
1235  DenseMatrix &I) const;
1236 
1237  using FiniteElement::Project;
1238 
1239  virtual void Project (VectorCoefficient &vc,
1240  ElementTransformation &Trans, Vector &dofs) const;
1241 };
1242 
1244 {
1245 private:
1246  static const double nk[4][2];
1247 
1248 public:
1250 
1251  virtual void CalcVShape(const IntegrationPoint &ip,
1252  DenseMatrix &shape) const;
1253 
1255  DenseMatrix &shape) const
1256  { CalcVShape_RT(Trans, shape); }
1257 
1258  virtual void CalcDivShape(const IntegrationPoint &ip,
1259  Vector &divshape) const;
1260 
1262  DenseMatrix &I) const;
1263 
1264  using FiniteElement::Project;
1265 
1266  virtual void Project (VectorCoefficient &vc,
1267  ElementTransformation &Trans, Vector &dofs) const;
1268 };
1269 
1271 {
1272 private:
1273  static const double nk[8][2];
1274 
1275 public:
1277 
1278  virtual void CalcVShape(const IntegrationPoint &ip,
1279  DenseMatrix &shape) const;
1280 
1282  DenseMatrix &shape) const
1283  { CalcVShape_RT(Trans, shape); }
1284 
1285  virtual void CalcDivShape(const IntegrationPoint &ip,
1286  Vector &divshape) const;
1287 
1289  DenseMatrix &I) const;
1290 
1291  using FiniteElement::Project;
1292 
1293  virtual void Project (VectorCoefficient &vc,
1294  ElementTransformation &Trans, Vector &dofs) const;
1295 };
1296 
1298 {
1299 private:
1300  static const double nk[12][2];
1301 
1302 public:
1304 
1305  virtual void CalcVShape(const IntegrationPoint &ip,
1306  DenseMatrix &shape) const;
1307 
1309  DenseMatrix &shape) const
1310  { CalcVShape_RT(Trans, shape); }
1311 
1312  virtual void CalcDivShape(const IntegrationPoint &ip,
1313  Vector &divshape) const;
1314 
1316  DenseMatrix &I) const;
1317 
1318  using FiniteElement::Project;
1319 
1320  virtual void Project (VectorCoefficient &vc,
1321  ElementTransformation &Trans, Vector &dofs) const;
1322 };
1323 
1325 {
1326 private:
1327  static const double M[15][15];
1328 public:
1330 
1331  virtual void CalcVShape(const IntegrationPoint &ip,
1332  DenseMatrix &shape) const;
1333 
1335  DenseMatrix &shape) const
1336  { CalcVShape_RT(Trans, shape); }
1337 
1338  virtual void CalcDivShape(const IntegrationPoint &ip,
1339  Vector &divshape) const;
1340 };
1341 
1343 {
1344 private:
1345  static const double nk[24][2];
1346  static const double pt[4];
1347  static const double dpt[3];
1348 
1349 public:
1351 
1352  virtual void CalcVShape(const IntegrationPoint &ip,
1353  DenseMatrix &shape) const;
1354 
1356  DenseMatrix &shape) const
1357  { CalcVShape_RT(Trans, shape); }
1358 
1359  virtual void CalcDivShape(const IntegrationPoint &ip,
1360  Vector &divshape) const;
1361 
1363  DenseMatrix &I) const;
1364 
1365  using FiniteElement::Project;
1366 
1367  virtual void Project (VectorCoefficient &vc,
1368  ElementTransformation &Trans, Vector &dofs) const;
1369 };
1370 
1371 /// Linear 1D element with nodes 1/3 and 2/3 (trace of RT1)
1373 {
1374 public:
1376  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1377  virtual void CalcDShape(const IntegrationPoint &ip,
1378  DenseMatrix &dshape) const;
1379 };
1380 
1381 /// Quadratic 1D element with nodes the Gaussian points in [0,1] (trace of RT2)
1383 {
1384 public:
1386  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1387  virtual void CalcDShape(const IntegrationPoint &ip,
1388  DenseMatrix &dshape) const;
1389 };
1390 
1392 {
1393 private:
1394  Vector rwk;
1395 #ifndef MFEM_THREAD_SAFE
1396  mutable Vector rxxk;
1397 #endif
1398 public:
1399  Lagrange1DFiniteElement (int degree);
1400  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1401  virtual void CalcDShape(const IntegrationPoint &ip,
1402  DenseMatrix &dshape) const;
1403 };
1404 
1406 {
1407 public:
1409  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1410  virtual void CalcDShape(const IntegrationPoint &ip,
1411  DenseMatrix &dshape) const;
1412 };
1413 
1415 {
1416 public:
1417  P0TetFiniteElement ();
1418  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1419  virtual void CalcDShape(const IntegrationPoint &ip,
1420  DenseMatrix &dshape) const;
1421  virtual void ProjectDelta(int vertex, Vector &dofs) const
1422  { dofs(0) = 1.0; }
1423 };
1424 
1426 {
1427 public:
1428  P0HexFiniteElement ();
1429  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1430  virtual void CalcDShape(const IntegrationPoint &ip,
1431  DenseMatrix &dshape) const;
1432  virtual void ProjectDelta(int vertex, Vector &dofs) const
1433  { dofs(0) = 1.0; }
1434 };
1435 
1436 /// Tensor products of 1D FEs (only degree 2 is functional)
1438 {
1439 private:
1440  Lagrange1DFiniteElement * fe1d;
1441  int dof1d;
1442  int *I, *J, *K;
1443 #ifndef MFEM_THREAD_SAFE
1444  mutable Vector shape1dx, shape1dy, shape1dz;
1445  mutable DenseMatrix dshape1dx, dshape1dy, dshape1dz;
1446 #endif
1447 
1448 public:
1449  LagrangeHexFiniteElement (int degree);
1450  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1451  virtual void CalcDShape(const IntegrationPoint &ip,
1452  DenseMatrix &dshape) const;
1454 };
1455 
1456 
1457 /// Class for refined linear FE on interval
1459 {
1460 public:
1461  /// Construct a quadratic FE on interval
1463 
1464  /** virtual function which evaluates the values of all
1465  shape functions at a given point ip and stores
1466  them in the vector shape of dimension Dof (3) */
1467  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1468 
1469  /** virtual function which evaluates the derivatives of all
1470  shape functions at a given point ip and stores them in
1471  the matrix dshape (Dof x Dim) (3 x 1) so that each row
1472  contains the derivative of one shape function */
1473  virtual void CalcDShape(const IntegrationPoint &ip,
1474  DenseMatrix &dshape) const;
1475 };
1476 
1477 /// Class for refined linear FE on triangle
1479 {
1480 public:
1481  /// Construct a quadratic FE on triangle
1483 
1484  /** virtual function which evaluates the values of all
1485  shape functions at a given point ip and stores
1486  them in the vector shape of dimension Dof (6) */
1487  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1488 
1489  /** virtual function which evaluates the values of all
1490  partial derivatives of all shape functions at a given
1491  point ip and stores them in the matrix dshape (Dof x Dim) (6 x 2)
1492  so that each row contains the derivatives of one shape function */
1493  virtual void CalcDShape(const IntegrationPoint &ip,
1494  DenseMatrix &dshape) const;
1495 };
1496 
1497 /// Class for refined linear FE on tetrahedron
1499 {
1500 public:
1501  /// Construct a quadratic FE on tetrahedron
1503 
1504  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1505 
1506  virtual void CalcDShape(const IntegrationPoint &ip,
1507  DenseMatrix &dshape) const;
1508 };
1509 
1510 /// Class for refined bi-linear FE on quadrilateral
1512 {
1513 public:
1514  /// Construct a biquadratic FE on quadrilateral
1516 
1517  /** virtual function which evaluates the values of all
1518  shape functions at a given point ip and stores
1519  them in the vector shape of dimension Dof (9) */
1520  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1521 
1522  /** virtual function which evaluates the values of all
1523  partial derivatives of all shape functions at a given
1524  point ip and stores them in the matrix dshape (Dof x Dim) (9 x 2)
1525  so that each row contains the derivatives of one shape function */
1526  virtual void CalcDShape(const IntegrationPoint &ip,
1527  DenseMatrix &dshape) const;
1528 };
1529 
1530 /// Class for refined trilinear FE on a hexahedron
1532 {
1533 public:
1534  /// Construct a biquadratic FE on quadrilateral
1536 
1537  /** virtual function which evaluates the values of all
1538  shape functions at a given point ip and stores
1539  them in the vector shape of dimension Dof (9) */
1540  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1541 
1542  /** virtual function which evaluates the values of all
1543  partial derivatives of all shape functions at a given
1544  point ip and stores them in the matrix dshape (Dof x Dim) (9 x 2)
1545  so that each row contains the derivatives of one shape function */
1546  virtual void CalcDShape(const IntegrationPoint &ip,
1547  DenseMatrix &dshape) const;
1548 };
1549 
1550 
1552 {
1553 private:
1554  static const double tk[12][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 tk[6][3];
1577 
1578 public:
1580  virtual void CalcVShape(const IntegrationPoint &ip,
1581  DenseMatrix &shape) const;
1583  DenseMatrix &shape) const
1584  { CalcVShape_ND(Trans, shape); }
1585  virtual void CalcCurlShape(const IntegrationPoint &ip,
1586  DenseMatrix &curl_shape) const;
1588  DenseMatrix &I) const;
1589  using FiniteElement::Project;
1590  virtual void Project (VectorCoefficient &vc,
1591  ElementTransformation &Trans, Vector &dofs) const;
1592 };
1593 
1594 
1596 {
1597 private:
1598  static const double nk[6][3];
1599 
1600 public:
1602 
1603  virtual void CalcVShape(const IntegrationPoint &ip,
1604  DenseMatrix &shape) const;
1605 
1607  DenseMatrix &shape) const
1608  { CalcVShape_RT(Trans, shape); }
1609 
1610  virtual void CalcDivShape(const IntegrationPoint &ip,
1611  Vector &divshape) const;
1612 
1614  DenseMatrix &I) const;
1615 
1616  using FiniteElement::Project;
1617 
1618  virtual void Project (VectorCoefficient &vc,
1619  ElementTransformation &Trans, Vector &dofs) const;
1620 };
1621 
1622 
1624 {
1625 private:
1626  static const double nk[36][3];
1627 
1628 public:
1630 
1631  virtual void CalcVShape(const IntegrationPoint &ip,
1632  DenseMatrix &shape) const;
1633 
1635  DenseMatrix &shape) const
1636  { CalcVShape_RT(Trans, shape); }
1637 
1638  virtual void CalcDivShape(const IntegrationPoint &ip,
1639  Vector &divshape) const;
1640 
1642  DenseMatrix &I) const;
1643 
1644  using FiniteElement::Project;
1645 
1646  virtual void Project (VectorCoefficient &vc,
1647  ElementTransformation &Trans, Vector &dofs) const;
1648 };
1649 
1650 
1652 {
1653 private:
1654  static const double nk[4][3];
1655 
1656 public:
1658 
1659  virtual void CalcVShape(const IntegrationPoint &ip,
1660  DenseMatrix &shape) const;
1661 
1663  DenseMatrix &shape) const
1664  { CalcVShape_RT(Trans, shape); }
1665 
1666  virtual void CalcDivShape(const IntegrationPoint &ip,
1667  Vector &divshape) const;
1668 
1670  DenseMatrix &I) const;
1671 
1672  using FiniteElement::Project;
1673 
1674  virtual void Project (VectorCoefficient &vc,
1675  ElementTransformation &Trans, Vector &dofs) const;
1676 };
1677 
1678 
1680 {
1681 public:
1683  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1684  virtual void CalcDShape(const IntegrationPoint &ip,
1685  DenseMatrix &dshape) const;
1686 };
1687 
1688 
1689 class Poly_1D
1690 {
1691 public:
1693  {
1694  ChangeOfBasis = 0, // Use change of basis, O(p^2) Evals
1695  Barycentric = 1, // Use barycentric Lagrangian interpolation, O(p) Evals
1696  Positive = 2, // Fast evaluation of Bernstein polynomials
1697  NumEvalTypes = 3 // Keep count of the number of eval types
1698  };
1699 
1700  class Basis
1701  {
1702  private:
1703  int etype;
1704  DenseMatrixInverse Ai;
1705  mutable Vector x, w;
1706 
1707  public:
1708  /// Create a nodal or positive (Bernstein) basis
1709  Basis(const int p, const double *nodes, EvalType etype = Barycentric);
1710  void Eval(const double x, Vector &u) const;
1711  void Eval(const double x, Vector &u, Vector &d) const;
1712  };
1713 
1714 private:
1715  typedef std::map< int, Array<double*>* > PointsMap;
1716  typedef std::map< int, Array<Basis*>* > BasisMap;
1717 
1718  MemoryType h_mt;
1719  PointsMap points_container;
1720  BasisMap bases_container;
1721 
1722  static Array2D<int> binom;
1723 
1724  static void CalcMono(const int p, const double x, double *u);
1725  static void CalcMono(const int p, const double x, double *u, double *d);
1726 
1727  static void CalcChebyshev(const int p, const double x, double *u);
1728  static void CalcChebyshev(const int p, const double x, double *u, double *d);
1729  static void CalcChebyshev(const int p, const double x, double *u, double *d,
1730  double *dd);
1731 
1732  QuadratureFunctions1D quad_func;
1733 
1734 public:
1735  Poly_1D(): h_mt(MemoryType::HOST) { }
1736 
1737  /** @brief Get a pointer to an array containing the binomial coefficients "p
1738  choose k" for k=0,...,p for the given p. */
1739  static const int *Binom(const int p);
1740 
1741  /** @brief Get the coordinates of the points of the given BasisType,
1742  @a btype.
1743 
1744  @param[in] p The polynomial degree; the number of points is `p+1`.
1745  @param[in] btype The BasisType.
1746 
1747  @return A pointer to an array containing the `p+1` coordinates of the
1748  points. Returns NULL if the BasisType has no associated set of
1749  points. */
1750  const double *GetPoints(const int p, const int btype);
1751  const double *OpenPoints(const int p,
1752  const int btype = BasisType::GaussLegendre)
1753  { return GetPoints(p, btype); }
1754  const double *ClosedPoints(const int p,
1755  const int btype = BasisType::GaussLobatto)
1756  { return GetPoints(p, btype); }
1757 
1758  /** @brief Get a Poly_1D::Basis object of the given degree and BasisType,
1759  @a btype.
1760 
1761  @param[in] p The polynomial degree of the basis.
1762  @param[in] btype The BasisType.
1763 
1764  @return A reference to an object of type Poly_1D::Basis that represents
1765  the requested basis type. */
1766  Basis &GetBasis(const int p, const int btype);
1767 
1768  // Evaluate the values of a hierarchical 1D basis at point x
1769  // hierarchical = k-th basis function is degree k polynomial
1770  static void CalcBasis(const int p, const double x, double *u)
1771  // { CalcMono(p, x, u); }
1772  // Bernstein basis is not hierarchical --> does not work for triangles
1773  // and tetrahedra
1774  // { CalcBernstein(p, x, u); }
1775  // { CalcLegendre(p, x, u); }
1776  { CalcChebyshev(p, x, u); }
1777 
1778  // Evaluate the values and derivatives of a hierarchical 1D basis at point x
1779  static void CalcBasis(const int p, const double x, double *u, double *d)
1780  // { CalcMono(p, x, u, d); }
1781  // { CalcBernstein(p, x, u, d); }
1782  // { CalcLegendre(p, x, u, d); }
1783  { CalcChebyshev(p, x, u, d); }
1784 
1785  // Evaluate the values, derivatives and second derivatives of a hierarchical 1D basis at point x
1786  static void CalcBasis(const int p, const double x, double *u, double *d,
1787  double *dd)
1788  // { CalcMono(p, x, u, d); }
1789  // { CalcBernstein(p, x, u, d); }
1790  // { CalcLegendre(p, x, u, d); }
1791  { CalcChebyshev(p, x, u, d, dd); }
1792 
1793  // Evaluate a representation of a Delta function at point x
1794  static double CalcDelta(const int p, const double x)
1795  { return pow(x, (double) p); }
1796 
1797  static void ChebyshevPoints(const int p, double *x);
1798 
1799  /// Compute the terms in the expansion of the binomial (x + y)^p
1800  static void CalcBinomTerms(const int p, const double x, const double y,
1801  double *u);
1802  /** Compute the terms in the expansion of the binomial (x + y)^p and their
1803  derivatives with respect to x assuming that dy/dx = -1. */
1804  static void CalcBinomTerms(const int p, const double x, const double y,
1805  double *u, double *d);
1806  /** Compute the derivatives (w.r.t. x) of the terms in the expansion of the
1807  binomial (x + y)^p assuming that dy/dx = -1. */
1808  static void CalcDBinomTerms(const int p, const double x, const double y,
1809  double *d);
1810  static void CalcBernstein(const int p, const double x, double *u)
1811  { CalcBinomTerms(p, x, 1. - x, u); }
1812  static void CalcBernstein(const int p, const double x, double *u, double *d)
1813  { CalcBinomTerms(p, x, 1. - x, u, d); }
1814 
1815  static void CalcLegendre(const int p, const double x, double *u);
1816  static void CalcLegendre(const int p, const double x, double *u, double *d);
1817 
1818  ~Poly_1D();
1819 };
1820 
1821 extern Poly_1D poly1d;
1822 
1824 {
1825 protected:
1826  int b_type;
1830 
1831 public:
1833  {
1836  Sr_DOF_MAP = 2, // Sr = Serendipity
1837  };
1838 
1839  TensorBasisElement(const int dims, const int p, const int btype,
1840  const DofMapType dmtype);
1841 
1842  int GetBasisType() const { return b_type; }
1843 
1844  const Poly_1D::Basis& GetBasis1D() const { return basis1d; }
1845 
1846  /** @brief Get an Array<int> that maps lexicographically ordered indices to
1847  the indices of the respective nodes/dofs/basis functions. If the dofs are
1848  ordered lexicographically, i.e. the mapping is identity, the returned
1849  Array will be empty. */
1850  const Array<int> &GetDofMap() const { return dof_map; }
1851 
1853  {
1854  switch (dim)
1855  {
1856  case 1: return Geometry::SEGMENT;
1857  case 2: return Geometry::SQUARE;
1858  case 3: return Geometry::CUBE;
1859  default:
1860  MFEM_ABORT("invalid dimension: " << dim);
1861  return Geometry::INVALID;
1862  }
1863  }
1864 
1865  /// Return @a base raised to the power @a dim.
1866  static int Pow(int base, int dim)
1867  {
1868  switch (dim)
1869  {
1870  case 1: return base;
1871  case 2: return base*base;
1872  case 3: return base*base*base;
1873  default: MFEM_ABORT("invalid dimension: " << dim); return -1;
1874  }
1875  }
1876 };
1877 
1879  public TensorBasisElement
1880 {
1881 public:
1882  NodalTensorFiniteElement(const int dims, const int p, const int btype,
1883  const DofMapType dmtype);
1884 
1886  DofToQuad::Mode mode) const
1887  {
1888  return (mode == DofToQuad::FULL) ?
1890  ScalarFiniteElement::GetTensorDofToQuad(*this, ir, mode);
1891  }
1892 };
1893 
1895  public TensorBasisElement
1896 {
1897 public:
1898  PositiveTensorFiniteElement(const int dims, const int p,
1899  const DofMapType dmtype);
1900 
1902  DofToQuad::Mode mode) const
1903  {
1904  return (mode == DofToQuad::FULL) ?
1906  ScalarFiniteElement::GetTensorDofToQuad(*this, ir, mode);
1907  }
1908 };
1909 
1911  public TensorBasisElement
1912 {
1913 private:
1914  mutable Array<DofToQuad*> dof2quad_array_open;
1915 
1916 protected:
1918 
1919 public:
1920  VectorTensorFiniteElement(const int dims, const int d, const int p,
1921  const int cbtype, const int obtype,
1922  const int M, const DofMapType dmtype);
1923 
1924  const DofToQuad &GetDofToQuad(const IntegrationRule &ir,
1925  DofToQuad::Mode mode) const;
1926 
1927  const DofToQuad &GetDofToQuadOpen(const IntegrationRule &ir,
1928  DofToQuad::Mode mode) const;
1929 
1930  const DofToQuad &GetTensorDofToQuad(const IntegrationRule &ir,
1931  DofToQuad::Mode mode,
1932  const bool closed) const;
1933 };
1934 
1936 {
1937 private:
1938 #ifndef MFEM_THREAD_SAFE
1939  mutable Vector shape_x, dshape_x;
1940 #endif
1941 
1942 public:
1943  H1_SegmentElement(const int p, const int btype = BasisType::GaussLobatto);
1944  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1945  virtual void CalcDShape(const IntegrationPoint &ip,
1946  DenseMatrix &dshape) const;
1947  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1948 };
1949 
1950 
1952 {
1953 private:
1954 #ifndef MFEM_THREAD_SAFE
1955  mutable Vector shape_x, shape_y, dshape_x, dshape_y;
1956 #endif
1957 
1958 public:
1959  H1_QuadrilateralElement(const int p,
1960  const int btype = BasisType::GaussLobatto);
1961  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1962  virtual void CalcDShape(const IntegrationPoint &ip,
1963  DenseMatrix &dshape) const;
1964  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1965 };
1966 
1967 
1969 {
1970 private:
1971 #ifndef MFEM_THREAD_SAFE
1972  mutable Vector shape_x, shape_y, shape_z, dshape_x, dshape_y, dshape_z;
1973 #endif
1974 
1975 public:
1976  H1_HexahedronElement(const int p, const int btype = BasisType::GaussLobatto);
1977  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1978  virtual void CalcDShape(const IntegrationPoint &ip,
1979  DenseMatrix &dshape) const;
1980  virtual void ProjectDelta(int vertex, Vector &dofs) const;
1981 };
1982 
1984 {
1985 private:
1986 #ifndef MFEM_THREAD_SAFE
1987  // This is to share scratch space between invocations, which helps
1988  // speed things up, but with OpenMP, we need one copy per thread.
1989  // Right now, we solve this by allocating this space within each function
1990  // call every time we call it. Alternatively, we should do some sort
1991  // thread private thing. Brunner, Jan 2014
1992  mutable Vector shape_x, dshape_x;
1993 #endif
1994 
1995 public:
1996  H1Pos_SegmentElement(const int p);
1997  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
1998  virtual void CalcDShape(const IntegrationPoint &ip,
1999  DenseMatrix &dshape) const;
2000  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2001 };
2002 
2003 
2005 {
2006 private:
2007 #ifndef MFEM_THREAD_SAFE
2008  // See comment in H1Pos_SegmentElement
2009  mutable Vector shape_x, shape_y, dshape_x, dshape_y;
2010 #endif
2011 
2012 public:
2013  H1Pos_QuadrilateralElement(const int p);
2014  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2015  virtual void CalcDShape(const IntegrationPoint &ip,
2016  DenseMatrix &dshape) const;
2017  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2018 };
2019 
2020 
2022 {
2023 public:
2024  H1Ser_QuadrilateralElement(const int p);
2025  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2026  virtual void CalcDShape(const IntegrationPoint &ip,
2027  DenseMatrix &dshape) const;
2029  DenseMatrix &I) const;
2030  using FiniteElement::Project;
2031 };
2032 
2034 {
2035 private:
2036 #ifndef MFEM_THREAD_SAFE
2037  // See comment in H1Pos_SegementElement.
2038  mutable Vector shape_x, shape_y, shape_z, dshape_x, dshape_y, dshape_z;
2039 #endif
2040 
2041 public:
2042  H1Pos_HexahedronElement(const int p);
2043  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2044  virtual void CalcDShape(const IntegrationPoint &ip,
2045  DenseMatrix &dshape) const;
2046  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2047 };
2048 
2049 
2051 {
2052 private:
2053 #ifndef MFEM_THREAD_SAFE
2054  mutable Vector shape_x, shape_y, shape_l, dshape_x, dshape_y, dshape_l, u;
2055  mutable Vector ddshape_x, ddshape_y, ddshape_l;
2056  mutable DenseMatrix du, ddu;
2057 #endif
2058  DenseMatrixInverse Ti;
2059 
2060 public:
2061  H1_TriangleElement(const int p, const int btype = BasisType::GaussLobatto);
2062  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2063  virtual void CalcDShape(const IntegrationPoint &ip,
2064  DenseMatrix &dshape) const;
2065  virtual void CalcHessian(const IntegrationPoint &ip,
2066  DenseMatrix &ddshape) const;
2067 };
2068 
2069 
2071 {
2072 private:
2073 #ifndef MFEM_THREAD_SAFE
2074  mutable Vector shape_x, shape_y, shape_z, shape_l;
2075  mutable Vector dshape_x, dshape_y, dshape_z, dshape_l, u;
2076  mutable Vector ddshape_x, ddshape_y, ddshape_z, ddshape_l;
2077  mutable DenseMatrix du, ddu;
2078 #endif
2079  DenseMatrixInverse Ti;
2080 
2081 public:
2082  H1_TetrahedronElement(const int p,
2083  const int btype = BasisType::GaussLobatto);
2084  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2085  virtual void CalcDShape(const IntegrationPoint &ip,
2086  DenseMatrix &dshape) const;
2087  virtual void CalcHessian(const IntegrationPoint &ip,
2088  DenseMatrix &ddshape) const;
2089 };
2090 
2091 
2093 {
2094 protected:
2095 #ifndef MFEM_THREAD_SAFE
2098 #endif
2100 
2101 public:
2102  H1Pos_TriangleElement(const int p);
2103 
2104  // The size of shape is (p+1)(p+2)/2 (dof).
2105  static void CalcShape(const int p, const double x, const double y,
2106  double *shape);
2107 
2108  // The size of dshape_1d is p+1; the size of dshape is (dof x dim).
2109  static void CalcDShape(const int p, const double x, const double y,
2110  double *dshape_1d, double *dshape);
2111 
2112  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2113  virtual void CalcDShape(const IntegrationPoint &ip,
2114  DenseMatrix &dshape) const;
2115 };
2116 
2117 
2119 {
2120 protected:
2121 #ifndef MFEM_THREAD_SAFE
2124 #endif
2126 
2127 public:
2128  H1Pos_TetrahedronElement(const int p);
2129 
2130  // The size of shape is (p+1)(p+2)(p+3)/6 (dof).
2131  static void CalcShape(const int p, const double x, const double y,
2132  const double z, double *shape);
2133 
2134  // The size of dshape_1d is p+1; the size of dshape is (dof x dim).
2135  static void CalcDShape(const int p, const double x, const double y,
2136  const double z, double *dshape_1d, double *dshape);
2137 
2138  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2139  virtual void CalcDShape(const IntegrationPoint &ip,
2140  DenseMatrix &dshape) const;
2141 };
2142 
2143 
2145 {
2146 private:
2147 #ifndef MFEM_THREAD_SAFE
2148  mutable Vector t_shape, s_shape;
2149  mutable DenseMatrix t_dshape, s_dshape;
2150 #endif
2151  Array<int> t_dof, s_dof;
2152 
2153  H1_TriangleElement TriangleFE;
2154  H1_SegmentElement SegmentFE;
2155 
2156 public:
2157  H1_WedgeElement(const int p,
2158  const int btype = BasisType::GaussLobatto);
2159  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2160  virtual void CalcDShape(const IntegrationPoint &ip,
2161  DenseMatrix &dshape) const;
2162 };
2163 
2164 /// Class for linear FE on wedge
2166 {
2167 public:
2168  /// Construct a linear FE on wedge
2170 };
2171 
2172 /// Class for quadratic FE on wedge
2174 {
2175 public:
2176  /// Construct a quadratic FE on wedge
2178 };
2179 
2180 /// Class for cubic FE on wedge
2182 {
2183 public:
2184  /// Construct a cubic FE on wedge
2186 };
2187 
2189 {
2190 protected:
2191 #ifndef MFEM_THREAD_SAFE
2194 #endif
2196 
2199 
2200 public:
2201  H1Pos_WedgeElement(const int p);
2202 
2203  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2204  virtual void CalcDShape(const IntegrationPoint &ip,
2205  DenseMatrix &dshape) const;
2206 };
2207 
2208 
2210 {
2211 private:
2212 #ifndef MFEM_THREAD_SAFE
2213  mutable Vector shape_x, dshape_x;
2214 #endif
2215 
2216 public:
2217  L2_SegmentElement(const int p, const int btype = BasisType::GaussLegendre);
2218  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2219  virtual void CalcDShape(const IntegrationPoint &ip,
2220  DenseMatrix &dshape) const;
2221  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2222 };
2223 
2224 
2226 {
2227 private:
2228 #ifndef MFEM_THREAD_SAFE
2229  mutable Vector shape_x, dshape_x;
2230 #endif
2231 
2232 public:
2233  L2Pos_SegmentElement(const int p);
2234  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2235  virtual void CalcDShape(const IntegrationPoint &ip,
2236  DenseMatrix &dshape) const;
2237  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2238 };
2239 
2240 
2242 {
2243 private:
2244 #ifndef MFEM_THREAD_SAFE
2245  mutable Vector shape_x, shape_y, dshape_x, dshape_y;
2246 #endif
2247 
2248 public:
2249  L2_QuadrilateralElement(const int p,
2250  const int btype = BasisType::GaussLegendre);
2251  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2252  virtual void CalcDShape(const IntegrationPoint &ip,
2253  DenseMatrix &dshape) const;
2254  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2255  virtual void ProjectCurl(const FiniteElement &fe,
2257  DenseMatrix &curl) const
2258  { ProjectCurl_2D(fe, Trans, curl); }
2259 };
2260 
2261 
2263 {
2264 private:
2265 #ifndef MFEM_THREAD_SAFE
2266  mutable Vector shape_x, shape_y, dshape_x, dshape_y;
2267 #endif
2268 
2269 public:
2270  L2Pos_QuadrilateralElement(const int p);
2271  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2272  virtual void CalcDShape(const IntegrationPoint &ip,
2273  DenseMatrix &dshape) const;
2274  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2275 };
2276 
2277 
2279 {
2280 private:
2281 #ifndef MFEM_THREAD_SAFE
2282  mutable Vector shape_x, shape_y, shape_z, dshape_x, dshape_y, dshape_z;
2283 #endif
2284 
2285 public:
2286  L2_HexahedronElement(const int p,
2287  const int btype = BasisType::GaussLegendre);
2288  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2289  virtual void CalcDShape(const IntegrationPoint &ip,
2290  DenseMatrix &dshape) const;
2291  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2292 };
2293 
2294 
2296 {
2297 private:
2298 #ifndef MFEM_THREAD_SAFE
2299  mutable Vector shape_x, shape_y, shape_z, dshape_x, dshape_y, dshape_z;
2300 #endif
2301 
2302 public:
2303  L2Pos_HexahedronElement(const int p);
2304  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2305  virtual void CalcDShape(const IntegrationPoint &ip,
2306  DenseMatrix &dshape) const;
2307  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2308 };
2309 
2310 
2312 {
2313 private:
2314 #ifndef MFEM_THREAD_SAFE
2315  mutable Vector shape_x, shape_y, shape_l, dshape_x, dshape_y, dshape_l, u;
2316  mutable DenseMatrix du;
2317 #endif
2318  DenseMatrixInverse Ti;
2319 
2320 public:
2321  L2_TriangleElement(const int p,
2322  const int btype = BasisType::GaussLegendre);
2323  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2324  virtual void CalcDShape(const IntegrationPoint &ip,
2325  DenseMatrix &dshape) const;
2326  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2327  virtual void ProjectCurl(const FiniteElement &fe,
2329  DenseMatrix &curl) const
2330  { ProjectCurl_2D(fe, Trans, curl); }
2331 };
2332 
2333 
2335 {
2336 private:
2337 #ifndef MFEM_THREAD_SAFE
2338  mutable Vector dshape_1d;
2339 #endif
2340 
2341 public:
2342  L2Pos_TriangleElement(const int p);
2343  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2344  virtual void CalcDShape(const IntegrationPoint &ip,
2345  DenseMatrix &dshape) const;
2346  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2347 };
2348 
2349 
2351 {
2352 private:
2353 #ifndef MFEM_THREAD_SAFE
2354  mutable Vector shape_x, shape_y, shape_z, shape_l;
2355  mutable Vector dshape_x, dshape_y, dshape_z, dshape_l, u;
2356  mutable DenseMatrix du;
2357 #endif
2358  DenseMatrixInverse Ti;
2359 
2360 public:
2361  L2_TetrahedronElement(const int p,
2362  const int btype = BasisType::GaussLegendre);
2363  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2364  virtual void CalcDShape(const IntegrationPoint &ip,
2365  DenseMatrix &dshape) const;
2366  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2367 };
2368 
2369 
2371 {
2372 private:
2373 #ifndef MFEM_THREAD_SAFE
2374  mutable Vector dshape_1d;
2375 #endif
2376 
2377 public:
2378  L2Pos_TetrahedronElement(const int p);
2379  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2380  virtual void CalcDShape(const IntegrationPoint &ip,
2381  DenseMatrix &dshape) const;
2382  virtual void ProjectDelta(int vertex, Vector &dofs) const;
2383 };
2384 
2385 
2387 {
2388 private:
2389 #ifndef MFEM_THREAD_SAFE
2390  mutable Vector t_shape, s_shape;
2391  mutable DenseMatrix t_dshape, s_dshape;
2392 #endif
2393  Array<int> t_dof, s_dof;
2394 
2395  L2_TriangleElement TriangleFE;
2396  L2_SegmentElement SegmentFE;
2397 
2398 public:
2399  L2_WedgeElement(const int p,
2400  const int btype = BasisType::GaussLegendre);
2401  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2402  virtual void CalcDShape(const IntegrationPoint &ip,
2403  DenseMatrix &dshape) const;
2404 };
2405 
2407 {
2408 public:
2410 };
2411 
2413 {
2414 protected:
2415 #ifndef MFEM_THREAD_SAFE
2418 #endif
2420 
2423 
2424 public:
2425  L2Pos_WedgeElement(const int p);
2426 
2427  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2428  virtual void CalcDShape(const IntegrationPoint &ip,
2429  DenseMatrix &dshape) const;
2430 };
2431 
2432 
2434 {
2435 private:
2436  static const double nk[8];
2437 
2438  Poly_1D::Basis &cbasis1d, &obasis1d;
2439 #ifndef MFEM_THREAD_SAFE
2440  mutable Vector shape_cx, shape_ox, shape_cy, shape_oy;
2441  mutable Vector dshape_cx, dshape_cy;
2442 #endif
2443  Array<int> dof_map, dof2nk;
2444 
2445 public:
2446  RT_QuadrilateralElement(const int p,
2447  const int cb_type = BasisType::GaussLobatto,
2448  const int ob_type = BasisType::GaussLegendre);
2449  virtual void CalcVShape(const IntegrationPoint &ip,
2450  DenseMatrix &shape) const;
2452  DenseMatrix &shape) const
2453  { CalcVShape_RT(Trans, shape); }
2454  virtual void CalcDivShape(const IntegrationPoint &ip,
2455  Vector &divshape) const;
2457  DenseMatrix &I) const
2458  { LocalInterpolation_RT(*this, nk, dof2nk, Trans, I); }
2460  DenseMatrix &R) const
2461  { LocalRestriction_RT(nk, dof2nk, Trans, R); }
2462  virtual void GetTransferMatrix(const FiniteElement &fe,
2464  DenseMatrix &I) const
2465  { LocalInterpolation_RT(CheckVectorFE(fe), nk, dof2nk, Trans, I); }
2466  using FiniteElement::Project;
2467  virtual void Project(VectorCoefficient &vc,
2468  ElementTransformation &Trans, Vector &dofs) const
2469  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
2471  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2472  { ProjectMatrixCoefficient_RT(nk, dof2nk, mc, T, dofs); }
2474  DenseMatrix &I) const
2475  { Project_RT(nk, dof2nk, fe, Trans, I); }
2476  // Gradient + rotation = Curl: H1 -> H(div)
2477  virtual void ProjectGrad(const FiniteElement &fe,
2479  DenseMatrix &grad) const
2480  { ProjectGrad_RT(nk, dof2nk, fe, Trans, grad); }
2481  // Curl = Gradient + rotation: H1 -> H(div)
2482  virtual void ProjectCurl(const FiniteElement &fe,
2484  DenseMatrix &curl) const
2485  { ProjectGrad_RT(nk, dof2nk, fe, Trans, curl); }
2486 };
2487 
2488 
2490 {
2491  static const double nk[18];
2492 
2493  Poly_1D::Basis &cbasis1d, &obasis1d;
2494 #ifndef MFEM_THREAD_SAFE
2495  mutable Vector shape_cx, shape_ox, shape_cy, shape_oy, shape_cz, shape_oz;
2496  mutable Vector dshape_cx, dshape_cy, dshape_cz;
2497 #endif
2498  Array<int> dof_map, dof2nk;
2499 
2500 public:
2501  RT_HexahedronElement(const int p,
2502  const int cb_type = BasisType::GaussLobatto,
2503  const int ob_type = BasisType::GaussLegendre);
2504 
2505  virtual void CalcVShape(const IntegrationPoint &ip,
2506  DenseMatrix &shape) const;
2508  DenseMatrix &shape) const
2509  { CalcVShape_RT(Trans, shape); }
2510  virtual void CalcDivShape(const IntegrationPoint &ip,
2511  Vector &divshape) const;
2513  DenseMatrix &I) const
2514  { LocalInterpolation_RT(*this, nk, dof2nk, Trans, I); }
2516  DenseMatrix &R) const
2517  { LocalRestriction_RT(nk, dof2nk, Trans, R); }
2518  virtual void GetTransferMatrix(const FiniteElement &fe,
2520  DenseMatrix &I) const
2521  { LocalInterpolation_RT(CheckVectorFE(fe), nk, dof2nk, Trans, I); }
2522  using FiniteElement::Project;
2523  virtual void Project(VectorCoefficient &vc,
2524  ElementTransformation &Trans, Vector &dofs) const
2525  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
2527  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2528  { ProjectMatrixCoefficient_RT(nk, dof2nk, mc, T, dofs); }
2530  DenseMatrix &I) const
2531  { Project_RT(nk, dof2nk, fe, Trans, I); }
2532  virtual void ProjectCurl(const FiniteElement &fe,
2534  DenseMatrix &curl) const
2535  { ProjectCurl_RT(nk, dof2nk, fe, Trans, curl); }
2536 };
2537 
2538 
2540 {
2541  static const double nk[6], c;
2542 
2543 #ifndef MFEM_THREAD_SAFE
2544  mutable Vector shape_x, shape_y, shape_l;
2545  mutable Vector dshape_x, dshape_y, dshape_l;
2546  mutable DenseMatrix u;
2547  mutable Vector divu;
2548 #endif
2549  Array<int> dof2nk;
2550  DenseMatrixInverse Ti;
2551 
2552 public:
2553  RT_TriangleElement(const int p);
2554  virtual void CalcVShape(const IntegrationPoint &ip,
2555  DenseMatrix &shape) const;
2557  DenseMatrix &shape) const
2558  { CalcVShape_RT(Trans, shape); }
2559  virtual void CalcDivShape(const IntegrationPoint &ip,
2560  Vector &divshape) const;
2562  DenseMatrix &I) const
2563  { LocalInterpolation_RT(*this, nk, dof2nk, Trans, I); }
2565  DenseMatrix &R) const
2566  { LocalRestriction_RT(nk, dof2nk, Trans, R); }
2567  virtual void GetTransferMatrix(const FiniteElement &fe,
2569  DenseMatrix &I) const
2570  { LocalInterpolation_RT(CheckVectorFE(fe), nk, dof2nk, Trans, I); }
2571  using FiniteElement::Project;
2572  virtual void Project(VectorCoefficient &vc,
2573  ElementTransformation &Trans, Vector &dofs) const
2574  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
2576  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2577  { ProjectMatrixCoefficient_RT(nk, dof2nk, mc, T, dofs); }
2579  DenseMatrix &I) const
2580  { Project_RT(nk, dof2nk, fe, Trans, I); }
2581  // Gradient + rotation = Curl: H1 -> H(div)
2582  virtual void ProjectGrad(const FiniteElement &fe,
2584  DenseMatrix &grad) const
2585  { ProjectGrad_RT(nk, dof2nk, fe, Trans, grad); }
2586  // Curl = Gradient + rotation: H1 -> H(div)
2587  virtual void ProjectCurl(const FiniteElement &fe,
2589  DenseMatrix &curl) const
2590  { ProjectGrad_RT(nk, dof2nk, fe, Trans, curl); }
2591 };
2592 
2593 
2595 {
2596  static const double nk[12], c;
2597 
2598 #ifndef MFEM_THREAD_SAFE
2599  mutable Vector shape_x, shape_y, shape_z, shape_l;
2600  mutable Vector dshape_x, dshape_y, dshape_z, dshape_l;
2601  mutable DenseMatrix u;
2602  mutable Vector divu;
2603 #endif
2604  Array<int> dof2nk;
2605  DenseMatrixInverse Ti;
2606 
2607 public:
2608  RT_TetrahedronElement(const int p);
2609  virtual void CalcVShape(const IntegrationPoint &ip,
2610  DenseMatrix &shape) const;
2612  DenseMatrix &shape) const
2613  { CalcVShape_RT(Trans, shape); }
2614  virtual void CalcDivShape(const IntegrationPoint &ip,
2615  Vector &divshape) const;
2617  DenseMatrix &I) const
2618  { LocalInterpolation_RT(*this, nk, dof2nk, Trans, I); }
2620  DenseMatrix &R) const
2621  { LocalRestriction_RT(nk, dof2nk, Trans, R); }
2622  virtual void GetTransferMatrix(const FiniteElement &fe,
2624  DenseMatrix &I) const
2625  { LocalInterpolation_RT(CheckVectorFE(fe), nk, dof2nk, Trans, I); }
2626  using FiniteElement::Project;
2627  virtual void Project(VectorCoefficient &vc,
2628  ElementTransformation &Trans, Vector &dofs) const
2629  { Project_RT(nk, dof2nk, vc, Trans, dofs); }
2631  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2632  { ProjectMatrixCoefficient_RT(nk, dof2nk, mc, T, dofs); }
2634  DenseMatrix &I) const
2635  { Project_RT(nk, dof2nk, fe, Trans, I); }
2636  virtual void ProjectCurl(const FiniteElement &fe,
2638  DenseMatrix &curl) const
2639  { ProjectCurl_RT(nk, dof2nk, fe, Trans, curl); }
2640 };
2641 
2642 
2644 {
2645  static const double tk[18];
2646 #ifndef MFEM_THREAD_SAFE
2647  mutable Vector shape_cx, shape_ox, shape_cy, shape_oy, shape_cz, shape_oz;
2648  mutable Vector dshape_cx, dshape_cy, dshape_cz;
2649 #endif
2650  Array<int> dof2tk;
2651 
2652 public:
2653  ND_HexahedronElement(const int p,
2654  const int cb_type = BasisType::GaussLobatto,
2655  const int ob_type = BasisType::GaussLegendre);
2656 
2657  virtual void CalcVShape(const IntegrationPoint &ip,
2658  DenseMatrix &shape) const;
2659 
2661  DenseMatrix &shape) const
2662  { CalcVShape_ND(Trans, shape); }
2663 
2664  virtual void CalcCurlShape(const IntegrationPoint &ip,
2665  DenseMatrix &curl_shape) const;
2666 
2668  DenseMatrix &I) const
2669  { LocalInterpolation_ND(*this, tk, dof2tk, Trans, I); }
2670 
2672  DenseMatrix &R) const
2673  { LocalRestriction_ND(tk, dof2tk, Trans, R); }
2674 
2675  virtual void GetTransferMatrix(const FiniteElement &fe,
2677  DenseMatrix &I) const
2678  { LocalInterpolation_ND(CheckVectorFE(fe), tk, dof2tk, Trans, I); }
2679 
2680  using FiniteElement::Project;
2681 
2682  virtual void Project(VectorCoefficient &vc,
2683  ElementTransformation &Trans, Vector &dofs) const
2684  { Project_ND(tk, dof2tk, vc, Trans, dofs); }
2685 
2687  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2688  { ProjectMatrixCoefficient_ND(tk, dof2tk, mc, T, dofs); }
2689 
2690  virtual void Project(const FiniteElement &fe,
2692  DenseMatrix &I) const
2693  { Project_ND(tk, dof2tk, fe, Trans, I); }
2694 
2695  virtual void ProjectGrad(const FiniteElement &fe,
2697  DenseMatrix &grad) const
2698  { ProjectGrad_ND(tk, dof2tk, fe, Trans, grad); }
2699 
2700  virtual void ProjectCurl(const FiniteElement &fe,
2702  DenseMatrix &curl) const
2703  { ProjectCurl_ND(tk, dof2tk, fe, Trans, curl); }
2704 };
2705 
2706 
2708 {
2709  static const double tk[8];
2710 
2711 #ifndef MFEM_THREAD_SAFE
2712  mutable Vector shape_cx, shape_ox, shape_cy, shape_oy;
2713  mutable Vector dshape_cx, dshape_cy;
2714 #endif
2715  Array<int> dof2tk;
2716 
2717 public:
2718  ND_QuadrilateralElement(const int p,
2719  const int cb_type = BasisType::GaussLobatto,
2720  const int ob_type = BasisType::GaussLegendre);
2721  virtual void CalcVShape(const IntegrationPoint &ip,
2722  DenseMatrix &shape) const;
2724  DenseMatrix &shape) const
2725  { CalcVShape_ND(Trans, shape); }
2726  virtual void CalcCurlShape(const IntegrationPoint &ip,
2727  DenseMatrix &curl_shape) const;
2729  DenseMatrix &I) const
2730  { LocalInterpolation_ND(*this, tk, dof2tk, Trans, I); }
2732  DenseMatrix &R) const
2733  { LocalRestriction_ND(tk, dof2tk, Trans, R); }
2734  virtual void GetTransferMatrix(const FiniteElement &fe,
2736  DenseMatrix &I) const
2737  { LocalInterpolation_ND(CheckVectorFE(fe), tk, dof2tk, Trans, I); }
2738  using FiniteElement::Project;
2739  virtual void Project(VectorCoefficient &vc,
2740  ElementTransformation &Trans, Vector &dofs) const
2741  { Project_ND(tk, dof2tk, vc, Trans, dofs); }
2743  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2744  { ProjectMatrixCoefficient_ND(tk, dof2tk, mc, T, dofs); }
2745  virtual void Project(const FiniteElement &fe,
2747  DenseMatrix &I) const
2748  { Project_ND(tk, dof2tk, fe, Trans, I); }
2749  virtual void ProjectGrad(const FiniteElement &fe,
2751  DenseMatrix &grad) const
2752  { ProjectGrad_ND(tk, dof2tk, fe, Trans, grad); }
2753 };
2754 
2755 
2757 {
2758  static const double tk[18], c;
2759 
2760 #ifndef MFEM_THREAD_SAFE
2761  mutable Vector shape_x, shape_y, shape_z, shape_l;
2762  mutable Vector dshape_x, dshape_y, dshape_z, dshape_l;
2763  mutable DenseMatrix u;
2764 #endif
2765  Array<int> dof2tk;
2766  DenseMatrixInverse Ti;
2767 
2768 public:
2769  ND_TetrahedronElement(const int p);
2770  virtual void CalcVShape(const IntegrationPoint &ip,
2771  DenseMatrix &shape) const;
2773  DenseMatrix &shape) const
2774  { CalcVShape_ND(Trans, shape); }
2775  virtual void CalcCurlShape(const IntegrationPoint &ip,
2776  DenseMatrix &curl_shape) const;
2778  DenseMatrix &I) const
2779  { LocalInterpolation_ND(*this, tk, dof2tk, Trans, I); }
2781  DenseMatrix &R) const
2782  { LocalRestriction_ND(tk, dof2tk, Trans, R); }
2783  virtual void GetTransferMatrix(const FiniteElement &fe,
2785  DenseMatrix &I) const
2786  { LocalInterpolation_ND(CheckVectorFE(fe), tk, dof2tk, Trans, I); }
2787  using FiniteElement::Project;
2788  virtual void Project(VectorCoefficient &vc,
2789  ElementTransformation &Trans, Vector &dofs) const
2790  { Project_ND(tk, dof2tk, vc, Trans, dofs); }
2792  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2793  { ProjectMatrixCoefficient_ND(tk, dof2tk, mc, T, dofs); }
2794  virtual void Project(const FiniteElement &fe,
2796  DenseMatrix &I) const
2797  { Project_ND(tk, dof2tk, fe, Trans, I); }
2798  virtual void ProjectGrad(const FiniteElement &fe,
2800  DenseMatrix &grad) const
2801  { ProjectGrad_ND(tk, dof2tk, fe, Trans, grad); }
2802 
2803  virtual void ProjectCurl(const FiniteElement &fe,
2805  DenseMatrix &curl) const
2806  { ProjectCurl_ND(tk, dof2tk, fe, Trans, curl); }
2807 };
2808 
2810 {
2811  static const double tk[8], c;
2812 
2813 #ifndef MFEM_THREAD_SAFE
2814  mutable Vector shape_x, shape_y, shape_l;
2815  mutable Vector dshape_x, dshape_y, dshape_l;
2816  mutable DenseMatrix u;
2817  mutable Vector curlu;
2818 #endif
2819  Array<int> dof2tk;
2820  DenseMatrixInverse Ti;
2821 
2822 public:
2823  ND_TriangleElement(const int p);
2824  virtual void CalcVShape(const IntegrationPoint &ip,
2825  DenseMatrix &shape) const;
2827  DenseMatrix &shape) const
2828  { CalcVShape_ND(Trans, shape); }
2829  virtual void CalcCurlShape(const IntegrationPoint &ip,
2830  DenseMatrix &curl_shape) const;
2832  DenseMatrix &I) const
2833  { LocalInterpolation_ND(*this, tk, dof2tk, Trans, I); }
2835  DenseMatrix &R) const
2836  { LocalRestriction_ND(tk, dof2tk, Trans, R); }
2837  virtual void GetTransferMatrix(const FiniteElement &fe,
2839  DenseMatrix &I) const
2840  { LocalInterpolation_ND(CheckVectorFE(fe), tk, dof2tk, Trans, I); }
2841  using FiniteElement::Project;
2842  virtual void Project(VectorCoefficient &vc,
2843  ElementTransformation &Trans, Vector &dofs) const
2844  { Project_ND(tk, dof2tk, vc, Trans, dofs); }
2846  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2847  { ProjectMatrixCoefficient_ND(tk, dof2tk, mc, T, dofs); }
2848  virtual void Project(const FiniteElement &fe,
2850  DenseMatrix &I) const
2851  { Project_ND(tk, dof2tk, fe, Trans, I); }
2852  virtual void ProjectGrad(const FiniteElement &fe,
2854  DenseMatrix &grad) const
2855  { ProjectGrad_ND(tk, dof2tk, fe, Trans, grad); }
2856 };
2857 
2858 
2860 {
2861  static const double tk[1];
2862 
2863  Poly_1D::Basis &obasis1d;
2864  Array<int> dof2tk;
2865 
2866 public:
2867  ND_SegmentElement(const int p, const int ob_type = BasisType::GaussLegendre);
2868  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
2869  { obasis1d.Eval(ip.x, shape); }
2870  virtual void CalcVShape(const IntegrationPoint &ip,
2871  DenseMatrix &shape) const;
2873  DenseMatrix &shape) const
2874  { CalcVShape_ND(Trans, shape); }
2875  // virtual void CalcCurlShape(const IntegrationPoint &ip,
2876  // DenseMatrix &curl_shape) const;
2878  DenseMatrix &I) const
2879  { LocalInterpolation_ND(*this, tk, dof2tk, Trans, I); }
2881  DenseMatrix &R) const
2882  { LocalRestriction_ND(tk, dof2tk, Trans, R); }
2883  virtual void GetTransferMatrix(const FiniteElement &fe,
2885  DenseMatrix &I) const
2886  { LocalInterpolation_ND(CheckVectorFE(fe), tk, dof2tk, Trans, I); }
2887  using FiniteElement::Project;
2888  virtual void Project(VectorCoefficient &vc,
2889  ElementTransformation &Trans, Vector &dofs) const
2890  { Project_ND(tk, dof2tk, vc, Trans, dofs); }
2892  MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
2893  { ProjectMatrixCoefficient_ND(tk, dof2tk, mc, T, dofs); }
2894  virtual void Project(const FiniteElement &fe,
2896  DenseMatrix &I) const
2897  { Project_ND(tk, dof2tk, fe, Trans, I); }
2898  virtual void ProjectGrad(const FiniteElement &fe,
2900  DenseMatrix &grad) const
2901  { ProjectGrad_ND(tk, dof2tk, fe, Trans, grad); }
2902 };
2903 
2904 
2906 {
2907 protected:
2909  mutable const int *ijk;
2910  mutable int patch, elem;
2911  mutable Vector weights;
2912 
2913 public:
2914  NURBSFiniteElement(int D, Geometry::Type G, int Do, int O, int F)
2915  : ScalarFiniteElement(D, G, Do, O, F)
2916  {
2917  ijk = NULL;
2918  patch = elem = -1;
2919  kv.SetSize(Dim);
2920  weights.SetSize(Dof);
2921  weights = 1.0;
2922  }
2923 
2924  void Reset () const { patch = elem = -1; }
2925  void SetIJK (const int *IJK) const { ijk = IJK; }
2926  int GetPatch () const { return patch; }
2927  void SetPatch (int p) const { patch = p; }
2928  int GetElement () const { return elem; }
2929  void SetElement (int e) const { elem = e; }
2931  Vector &Weights () const { return weights; }
2932  /// Update the NURBSFiniteElement according to the currently set knot vectors
2933  virtual void SetOrder () const { }
2934 };
2935 
2937 {
2938 protected:
2939  mutable Vector shape_x;
2940 
2941 public:
2943  : NURBSFiniteElement(1, Geometry::SEGMENT, p + 1, p, FunctionSpace::Qk),
2944  shape_x(p + 1) { }
2945 
2946  virtual void SetOrder() const;
2947  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2948  virtual void CalcDShape(const IntegrationPoint &ip,
2949  DenseMatrix &dshape) const;
2950  virtual void CalcHessian (const IntegrationPoint &ip,
2951  DenseMatrix &hessian) const;
2952 };
2953 
2955 {
2956 protected:
2958  mutable DenseMatrix du;
2959 
2960 public:
2962  : NURBSFiniteElement(2, Geometry::SQUARE, (p + 1)*(p + 1), p,
2963  FunctionSpace::Qk),
2964  u(Dof), shape_x(p + 1), shape_y(p + 1), dshape_x(p + 1),
2965  dshape_y(p + 1), d2shape_x(p + 1), d2shape_y(p + 1), du(Dof,2)
2966  { Orders[0] = Orders[1] = p; }
2967 
2968  NURBS2DFiniteElement(int px, int py)
2969  : NURBSFiniteElement(2, Geometry::SQUARE, (px + 1)*(py + 1),
2970  std::max(px, py), FunctionSpace::Qk),
2971  u(Dof), shape_x(px + 1), shape_y(py + 1), dshape_x(px + 1),
2972  dshape_y(py + 1), d2shape_x(px + 1), d2shape_y(py + 1), du(Dof,2)
2973  { Orders[0] = px; Orders[1] = py; }
2974 
2975  virtual void SetOrder() const;
2976  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
2977  virtual void CalcDShape(const IntegrationPoint &ip,
2978  DenseMatrix &dshape) const;
2979  virtual void CalcHessian (const IntegrationPoint &ip,
2980  DenseMatrix &hessian) const;
2981 };
2982 
2984 {
2985 protected:
2989  mutable DenseMatrix du;
2990 
2991 public:
2993  : NURBSFiniteElement(3, Geometry::CUBE, (p + 1)*(p + 1)*(p + 1), p,
2994  FunctionSpace::Qk),
2995  u(Dof), shape_x(p + 1), shape_y(p + 1), shape_z(p + 1),
2996  dshape_x(p + 1), dshape_y(p + 1), dshape_z(p + 1),
2997  d2shape_x(p + 1), d2shape_y(p + 1), d2shape_z(p + 1), du(Dof,3)
2998  { Orders[0] = Orders[1] = Orders[2] = p; }
2999 
3000  NURBS3DFiniteElement(int px, int py, int pz)
3001  : NURBSFiniteElement(3, Geometry::CUBE, (px + 1)*(py + 1)*(pz + 1),
3002  std::max(std::max(px,py),pz), FunctionSpace::Qk),
3003  u(Dof), shape_x(px + 1), shape_y(py + 1), shape_z(pz + 1),
3004  dshape_x(px + 1), dshape_y(py + 1), dshape_z(pz + 1),
3005  d2shape_x(px + 1), d2shape_y(py + 1), d2shape_z(pz + 1), du(Dof,3)
3006  { Orders[0] = px; Orders[1] = py; Orders[2] = pz; }
3007 
3008  virtual void SetOrder() const;
3009  virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const;
3010  virtual void CalcDShape(const IntegrationPoint &ip,
3011  DenseMatrix &dshape) const;
3012  virtual void CalcHessian (const IntegrationPoint &ip,
3013  DenseMatrix &hessian) const;
3014 };
3015 
3016 } // namespace mfem
3017 
3018 #endif
Abstract class for Finite Elements.
Definition: fe.hpp:232
RefinedLinear3DFiniteElement()
Construct a quadratic FE on tetrahedron.
Definition: fe.cpp:4941
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:1662
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
Definition: fe.cpp:12276
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:1826
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:9325
ND_SegmentElement(const int p, const int ob_type=BasisType::GaussLegendre)
Definition: fe.cpp:12210
For scalar fields; preserves point values.
Definition: fe.hpp:276
DenseMatrix curlshape_J
Definition: fe.hpp:720
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:6740
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2523
int GetDim() const
Returns the reference space dimension for the finite element.
Definition: fe.hpp:308
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:7995
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:3578
ScalarFiniteElement(int D, Geometry::Type G, int Do, int O, int F=FunctionSpace::Pk)
Definition: fe.hpp:593
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:1634
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:4519
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:1574
static void CalcBernstein(const int p, const double x, double *u, double *d)
Definition: fe.hpp:1812
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2482
Class for an integration rule - an Array of IntegrationPoint.
Definition: intrules.hpp:90
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:2127
L2Pos_WedgeElement(const int p)
Definition: fe.cpp:10196
Linear 1D element with nodes 1/3 and 2/3 (trace of RT1)
Definition: fe.hpp:1372
Quadratic 1D element with nodes the Gaussian points in [0,1] (trace of RT2)
Definition: fe.hpp:1382
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:9715
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:12337
Linear3DFiniteElement()
Construct a linear FE on tetrahedron.
Definition: fe.cpp:2976
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:45
virtual void CalcPhysLinLaplacian(ElementTransformation &Trans, Vector &Laplacian) const
Definition: fe.cpp:248
static double CalcDelta(const int p, const double x)
Definition: fe.hpp:1794
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:3760
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:2556
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:2616
No derivatives implemented.
Definition: fe.hpp:291
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:9476
void ProjectMatrixCoefficient_RT(const double *nk, const Array< int > &d2n, MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.cpp:928
void ProjectMatrixCoefficient_ND(const double *tk, const Array< int > &d2t, MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.cpp:1104
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:11066
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:5173
const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
Definition: fe.cpp:11515
NodalTensorFiniteElement(const int dims, const int p, const int btype, const DofMapType dmtype)
Definition: fe.cpp:7555
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:2371
void LocalInterpolation_RT(const VectorFiniteElement &cfe, const double *nk, const Array< int > &d2n, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.cpp:1198
L2Pos_TriangleElement(const int p)
Definition: fe.cpp:9859
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:2749
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:1227
H1Pos_SegmentElement(const int p)
Definition: fe.cpp:7937
Basis(const int p, const double *nodes, EvalType etype=Barycentric)
Create a nodal or positive (Bernstein) basis.
Definition: fe.cpp:6845
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:2880
Tensor product representation using 1D matrices/tensors with dimensions using 1D number of quadrature...
Definition: fe.hpp:154
int GetPatch() const
Definition: fe.hpp:2926
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2636
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:1118
Geometry::Type GeomType
Geometry::Type of the reference element.
Definition: fe.hpp:236
static int GetNodalBasis(int qpt_type)
Return the nodal BasisType corresponding to the Quadrature1D type.
Definition: fe.hpp:76
virtual void CalcPhysHessian(ElementTransformation &Trans, DenseMatrix &Hessian) const
Evaluate the Hessian of all shape functions of a scalar finite element in reference space at the give...
Definition: fe.cpp:293
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:5785
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:1029
Array< const KnotVector * > kv
Definition: fe.hpp:2908
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:3215
NURBS2DFiniteElement(int px, int py)
Definition: fe.hpp:2968
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:2930
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:2993
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:9898
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2803
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:3532
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:3812
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:2167
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:7975
FiniteElement(D, G, Do, O, F)
PositiveTensorFiniteElement(const int dims, const int p, const DofMapType dmtype)
Definition: fe.cpp:7564
int GetDerivMapType() const
Definition: fe.hpp:338
L2Pos_TetrahedronElement(const int p)
Definition: fe.cpp:10054
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:2459
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:9178
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.cpp:654
void CalcVShape_RT(ElementTransformation &Trans, DenseMatrix &shape) const
Definition: fe.cpp:885
void SetSize(int s)
Resize the vector to size s.
Definition: vector.hpp:407
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:10448
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:5847
virtual void CalcPhysLaplacian(ElementTransformation &Trans, Vector &Laplacian) const
Evaluate the Laplacian of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:206
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:4302
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:1495
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:615
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:2191
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
Definition: fe.cpp:2549
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2587
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:2460
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
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:2834
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
evaluate derivatives of shape function - constant 0
Definition: fe.cpp:2947
H1Pos_SegmentElement SegmentFE
Definition: fe.hpp:2198
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:1582
BiQuadratic3DFiniteElement()
Construct a quadratic FE on wedge.
Definition: fe.hpp:2177
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:2660
const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
Definition: fe.hpp:1901
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:1384
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:7640
H1Pos_TetrahedronElement(const int p)
Definition: fe.cpp:8664
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:12243
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:9344
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:2456
LagrangeHexFiniteElement(int degree)
Definition: fe.cpp:4571
TensorBasisElement(const int dims, const int p, const int btype, const DofMapType dmtype)
Definition: fe.cpp:7354
L2_SegmentElement(const int p, const int btype=BasisType::GaussLegendre)
Definition: fe.cpp:9204
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...
Definition: fe.hpp:318
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:3310
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:1952
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:4425
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:4733
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:2723
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:166
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:4377
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:2518
Array< double > Gt
Transpose of G.
Definition: fe.hpp:205
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.cpp:717
void Reset() const
Definition: fe.hpp:2924
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2572
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:2622
Class for quadratic FE on triangle.
Definition: fe.hpp:955
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:12257
int ndof
Number of degrees of freedom = number of basis functions. When mode is TENSOR, this is the 1D number...
Definition: fe.hpp:162
Class for quadratic FE on interval.
Definition: fe.hpp:926
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:2451
static int GetQuadrature1D(int b_type)
Get the corresponding Quadrature1D constant, when that makes sense; otherwise return Quadrature1D::In...
Definition: fe.hpp:61
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:10922
VectorFiniteElement(int D, Geometry::Type G, int Do, int O, int M, int F=FunctionSpace::Pk)
Definition: fe.hpp:801
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:10258
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:6013
void ProjectCurl_ND(const double *tk, const Array< int > &d2t, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.cpp:1030
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:2962
int Space() const
Returns the type of space on each element.
Definition: fe.hpp:328
virtual void SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
Definition: fe.cpp:12234
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:2620
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:2529
RefinedTriLinear3DFiniteElement()
Construct a biquadratic FE on quadrilateral.
Definition: fe.cpp:5320
DenseMatrix vshape
Definition: fe.hpp:245
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:4558
NURBS3DFiniteElement(int px, int py, int pz)
Definition: fe.hpp:3000
Quadratic3DFiniteElement()
Construct a quadratic FE on tetrahedron.
Definition: fe.cpp:3032
int GetMapType() const
Definition: fe.hpp:334
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:9220
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:6363
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:6550
Tensor products of polynomials of order k.
Definition: fe.hpp:216
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:3409
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:10018
static void CalcLegendre(const int p, const double x, double *u)
Definition: fe.cpp:7180
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2700
void NodalLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I, const ScalarFiniteElement &fine_fe) const
Nodal interpolation.
Definition: fe.cpp:387
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:2672
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:10084
Polynomials of order k.
Definition: fe.hpp:215
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:3240
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:3232
static const char * Name(int b_type)
Check and convert a BasisType constant to a string identifier.
Definition: fe.hpp:89
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:9282
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:7692
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:1432
Class for cubic FE on wedge.
Definition: fe.hpp:2181
void ProjectCurl_RT(const double *nk, const Array< int > &d2n, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.cpp:1068
H1Pos_HexahedronElement(const int p)
Definition: fe.cpp:8070
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:8766
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:646
const DofToQuad & GetTensorDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode, const bool closed) const
Definition: fe.cpp:11533
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:9960
Implements CalcDivShape methods.
Definition: fe.hpp:293
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
Definition: fe.cpp:1456
static int GetType(char b_ident)
Convert char basis identifier to a BasisType constant.
Definition: fe.hpp:105
int GetElement() const
Definition: fe.hpp:2928
PositiveFiniteElement(int D, Geometry::Type G, int Do, int O, int F=FunctionSpace::Pk)
Definition: fe.hpp:677
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:8042
Linear2DFiniteElement()
Construct a linear FE on triangle.
Definition: fe.cpp:1398
const double * ClosedPoints(const int p, const int btype=BasisType::GaussLobatto)
Definition: fe.hpp:1754
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2467
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:3089
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:53
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2845
Class for refined bi-linear FE on quadrilateral.
Definition: fe.hpp:1511
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:6685
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:5509
H1_HexahedronElement(const int p, const int btype=BasisType::GaussLobatto)
Definition: fe.cpp:7782
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:12131
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:1365
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:2692
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:9643
ND_TriangleElement(const int p)
Definition: fe.cpp:12050
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2327
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:11102
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:2883
static void CalcDShape(const int p, const double x, const double y, const double z, double *dshape_1d, double *dshape)
Definition: fe.cpp:8799
static void CalcBasis(const int p, const double x, double *u)
Definition: fe.hpp:1770
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:1254
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:2619
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
evaluate shape function - constant 1
Definition: fe.cpp:2941
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
Definition: fe.cpp:2720
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:7086
const double * GetPoints(const int p, const int btype)
Get the coordinates of the points of the given BasisType, btype.
Definition: fe.cpp:7279
H1Pos_TriangleElement(const int p)
Definition: fe.cpp:8519
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:4014
void SetMapType(int M)
Definition: fe.hpp:603
Poly_1D::Basis & obasis1d
Definition: fe.hpp:1917
Cubic3DFiniteElement()
Construct a cubic FE on tetrahedron.
Definition: fe.cpp:2767
Linear1DFiniteElement()
Construct a linear FE on interval.
Definition: fe.cpp:1377
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:4882
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:6673
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:2240
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.cpp:169
Geometry::Type GetGeomType() const
Returns the Geometry::Type of the reference 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:1631
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:2512
static void CalcShape(const int p, const double x, const double y, double *shape)
Definition: fe.cpp:8574
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:3263
VectorTensorFiniteElement(const int dims, const int d, const int p, const int cbtype, const int obtype, const int M, const DofMapType dmtype)
Definition: fe.cpp:7571
Array< int > s_dof
Definition: fe.hpp:2419
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:2860
static const ScalarFiniteElement & CheckScalarFE(const FiniteElement &fe)
Definition: fe.hpp:581
int GetBasisType() const
Definition: fe.hpp:1842
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:4320
Implements CalcCurlShape methods.
Definition: fe.hpp:294
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:921
int Dof
Number of degrees of freedom.
Definition: fe.hpp:240
Class for bilinear FE on quad with nodes at the 4 Gaussian points.
Definition: fe.hpp:901
Class for refined linear FE on interval.
Definition: fe.hpp:1458
void SetIJK(const int *IJK) const
Definition: fe.hpp:2925
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:9226
Class for refined linear FE on triangle.
Definition: fe.hpp:1478
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:2564
Class for refined linear FE on tetrahedron.
Definition: fe.hpp:1498
void SetPatch(int p) const
Definition: fe.hpp:2927
const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
Definition: fe.hpp:1885
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:1591
Poly_1D::Basis & cbasis1d
Definition: fe.hpp:1917
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:1602
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:1850
Class for constant FE on triangle.
Definition: fe.hpp:1094
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:2898
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:9035
RefinedLinear1DFiniteElement()
Construct a quadratic FE on interval.
Definition: fe.cpp:4771
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:7852
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8063
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2526
ND_HexahedronElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Definition: fe.cpp:11148
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:2344
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:9801
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:8215
Poly_1D::Basis & basis1d
Definition: fe.hpp:1828
For scalar fields; preserves volume integrals.
Definition: fe.hpp:277
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2532
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:4798
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:153
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:3953
static void ChebyshevPoints(const int p, double *x)
Definition: fe.cpp:7054
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:6810
H1Pos_WedgeElement(const int p)
Definition: fe.cpp:9061
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:4543
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:6651
Class for refined trilinear FE on a hexahedron.
Definition: fe.hpp:1531
ND_TetrahedronElement(const int p)
Definition: fe.cpp:11788
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:9887
Array< int > t_dof
Definition: fe.hpp:2419
const int * GetAnisotropicOrders() const
Returns an array containing the anisotropic orders/degrees.
Definition: fe.hpp:325
Class for quadratic FE on tetrahedron.
Definition: fe.hpp:1149
Mode mode
Describes the contents of the B, Bt, G, and Gt arrays, see Mode.
Definition: fe.hpp:158
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:7668
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: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:1371
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:2611
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:2635
class FiniteElement * FE
The FiniteElement that created and owns this object.
Definition: fe.hpp:133
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:2777
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:2034
const IntegrationRule & GetNodes() const
Definition: fe.hpp:367
Implements CalcDShape methods.
Definition: fe.hpp:292
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:5900
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:1672
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:9558
static int VerifyOpen(int b_type)
Definition: fe.hpp:563
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:3067
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:2477
L2Pos_QuadrilateralElement(const int p)
Definition: fe.cpp:9413
const int * ijk
Definition: fe.hpp:2909
P0SegmentFiniteElement(int Ord=0)
Definition: fe.cpp:3203
static void CalcDShape(const int p, const double x, const double y, double *dshape_1d, double *dshape)
Definition: fe.cpp:8600
int GetDerivRangeType() const
Definition: fe.hpp:332
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:10151
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:3555
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:12455
DenseMatrix curlshape
Definition: fe.hpp:720
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2788
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:1334
Class for linear FE on tetrahedron.
Definition: fe.hpp:1124
H1_SegmentElement(const int p, const int btype=BasisType::GaussLobatto)
Definition: fe.cpp:7584
Class for linear FE on interval.
Definition: fe.hpp:824
virtual ~FiniteElement()
Definition: fe.cpp:378
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:10662
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:5951
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:1198
Class for linear FE on triangle.
Definition: fe.hpp:844
Class for quadratic FE on triangle with nodes at the &quot;Gaussian&quot; points.
Definition: fe.hpp:979
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:9779
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:10401
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:2831
Nodes: x_i = i/(n-1), i=0,...,n-1.
Definition: fe.hpp:37
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:2499
L2_QuadrilateralElement(const int p, const int btype=BasisType::GaussLegendre)
Definition: fe.cpp:9306
NURBSFiniteElement(int D, Geometry::Type G, int Do, int O, int F)
Definition: fe.hpp:2914
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:2783
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:4212
Basis & GetBasis(const int p, const int btype)
Get a Poly_1D::Basis object of the given degree and BasisType, btype.
Definition: fe.cpp:7303
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:2728
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:1447
aka &quot;open half&quot; Newton-Cotes
Definition: intrules.hpp:296
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:3002
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:10736
const double * OpenPoints(const int p, const int btype=BasisType::GaussLegendre)
Definition: fe.hpp:1751
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:8415
static void CalcBasis(const int p, const double x, double *u, double *d, double *dd)
Definition: fe.hpp:1786
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2575
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &h) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
Definition: fe.cpp:1696
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:9016
L2_WedgeElement(const int p, const int btype=BasisType::GaussLegendre)
Definition: fe.cpp:10108
void ScalarLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I, const ScalarFiniteElement &fine_fe) const
&quot;Interpolation&quot; defined through local L2-projection.
Definition: fe.cpp:421
void SetElement(int e) const
Definition: fe.hpp:2929
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:1774
void ProjectGrad_ND(const double *tk, const Array< int > &d2t, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.cpp:1177
L2_TetrahedronElement(const int p, const int btype=BasisType::GaussLegendre)
Definition: fe.cpp:9910
void CalcPhysVShape(ElementTransformation &Trans, DenseMatrix &shape) const
Equivalent to the CalcVShape() method with the same arguments.
Definition: fe.hpp:389
static const int MaxDim
Definition: geom.hpp:42
Array< int > t_dof
Definition: fe.hpp:2195
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:9881
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2633
bool HasAnisotropicOrders() const
Returns true if the FiniteElement basis may be using different orders/degrees in different spatial di...
Definition: fe.hpp:322
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:1281
virtual void ProjectCurl(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.hpp:2255
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Definition: fe.cpp:12479
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:1788
DenseMatrix m_dshape
Definition: fe.hpp:2097
int Dim
Dimension of reference space.
Definition: fe.hpp:235
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:11734
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:9437
IntegrationRule Nodes
Definition: fe.hpp:243
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2894
Array< int > dof_map
Definition: fe.hpp:1827
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:1658
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:9670
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:7955
Array< double > Bt
Transpose of B.
Definition: fe.hpp:183
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:8137
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:4264
int Orders[Geometry::MaxDim]
Anisotropic orders.
Definition: fe.hpp:242
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:12165
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:3424
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:5196
void LocalInterpolation_ND(const VectorFiniteElement &cfe, const double *tk, const Array< int > &d2t, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.cpp:1237
Nodes: x_i = (i+1)/(n+1), i=0,...,n-1.
Definition: fe.hpp:36
static int CheckClosed(int type)
If the Quadrature1D type is not closed return Invalid; otherwise return type.
Definition: intrules.cpp:824
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &ddshape) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
Definition: fe.cpp:8473
H1Pos_TriangleElement TriangleFE
Definition: fe.hpp:2197
ND_QuadrilateralElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Definition: fe.cpp:11596
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:3321
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Overrides the scalar CalcShape function to print an error.
Definition: fe.hpp:2868
void CalcVShape_ND(ElementTransformation &Trans, DenseMatrix &shape) const
Definition: fe.cpp:897
DenseMatrix Jinv
Definition: fe.hpp:719
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:1606
BiCubic3DFiniteElement()
Construct a cubic FE on wedge.
Definition: fe.hpp:2185
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2888
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:9237
int GetDof() const
Returns the number of degrees of freedom in the finite element.
Definition: fe.hpp:314
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:8440
Class for bi-quadratic FE on quadrilateral.
Definition: fe.hpp:995
Class for tri-linear FE on cube.
Definition: fe.hpp:1162
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:2891
MemoryType
Memory types supported by MFEM.
Definition: mem_manager.hpp:27
static bool IsClosedType(int b_type)
Definition: fe.hpp:543
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:2671
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:1542
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:1421
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:5981
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &Hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
Definition: fe.cpp:105
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:10077
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:2193
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:1193
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:1409
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:5366
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:5063
DenseMatrix t_dshape
Definition: fe.hpp:2417
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:1106
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:7037
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:4114
DenseMatrix s_dshape
Definition: fe.hpp:2193
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:1477
H1_TetrahedronElement(const int p, const int btype=BasisType::GaussLobatto)
Definition: fe.cpp:8299
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2473
Array< int > inv_dof_map
Definition: fe.hpp:1829
virtual void SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
Definition: fe.cpp:12431
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
DenseMatrix s_dshape
Definition: fe.hpp:2417
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
Structure representing the matrices/tensors needed to evaluate (in reference space) the values...
Definition: fe.hpp:128
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:10239
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:9985
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:11366
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:3488
L2Pos_TriangleElement TriangleFE
Definition: fe.hpp:2421
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:1899
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:3147
Class for quadratic FE on wedge.
Definition: fe.hpp:2173
Class for bilinear FE on quadrilateral.
Definition: fe.hpp:866
Class for linear FE on wedge.
Definition: fe.hpp:2165
static int CheckOpen(int type)
If the Quadrature1D type is not open return Invalid; otherwise return type.
Definition: intrules.cpp:836
Serendipity basis (squares / cubes)
Definition: fe.hpp:39
Refined tensor products of polynomials of order k.
Definition: fe.hpp:217
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:682
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:2731
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2470
Array< double > B
Basis functions evaluated at quadrature points.
Definition: fe.hpp:177
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:1850
Quad1DFiniteElement()
Construct a quadratic FE on interval.
Definition: fe.cpp:1583
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:2872
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:8092
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:890
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:2567
virtual const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
Definition: fe.cpp:370
static char GetChar(int b_type)
Check and convert a BasisType constant to a char basis identifier.
Definition: fe.hpp:99
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:1531
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:2667
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:1355
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:1438
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:8002
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:10170
void LocalRestriction_ND(const double *tk, const Array< int > &d2t, ElementTransformation &Trans, DenseMatrix &R) const
Definition: fe.cpp:1317
H1_TriangleElement(const int p, const int btype=BasisType::GaussLobatto)
Definition: fe.cpp:8144
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2842
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2791
Class for integration point with weight.
Definition: intrules.hpp:25
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:1391
Host memory; using new[] and delete[].
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:9830
Mode
Type of data stored in the arrays B, Bt, G, and Gt.
Definition: fe.hpp:141
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:146
L2Pos_SegmentElement SegmentFE
Definition: fe.hpp:2422
const Poly_1D::Basis & GetBasis1D() const
Definition: fe.hpp:1844
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:8113
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:9288
static bool IsOpenType(int b_type)
Definition: fe.hpp:550
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:639
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:2968
const DofToQuad & GetDofToQuadOpen(const IntegrationRule &ir, DofToQuad::Mode mode) const
Definition: fe.cpp:11524
Bi-quadratic element on quad with nodes at the 9 Gaussian points.
Definition: fe.hpp:1034
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:1308
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:9691
void Project_RT(const double *nk, const Array< int > &d2n, VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:908
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:7807
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:686
Array< DofToQuad * > dof2quad_array
Container for all DofToQuad objects created by the FiniteElement.
Definition: fe.hpp:250
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:2515
H1_WedgeElement(const int p, const int btype=BasisType::GaussLobatto)
Definition: fe.cpp:8916
Array< int > s_dof
Definition: fe.hpp:2195
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:1566
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2630
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:3928
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:11936
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:3688
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:11685
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:861
static int VerifyClosed(int b_type)
Definition: fe.hpp:557
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:2852
virtual void ProjectDiv(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &div) const
Definition: fe.cpp:746
int DerivRangeType
Definition: fe.hpp:237
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:3436
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
int dim
Definition: ex24.cpp:43
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2742
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:9299
RefinedLinear2DFiniteElement()
Construct a quadratic FE on triangle.
Definition: fe.cpp:4817
NodalFiniteElement(int D, Geometry::Type G, int Do, int O, int F=FunctionSpace::Pk)
Definition: fe.hpp:635
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:6605
void ProjectCurl_2D(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
Definition: fe.cpp:551
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2739
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:2695
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:4779
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:4507
Array< double > G
Gradients/divergences/curls of basis functions evaluated at quadrature points.
Definition: fe.hpp:198
Array< int > dof_map
Definition: fe.hpp:2099
RT_TetrahedronElement(const int p)
Definition: fe.cpp:10964
Nodes: x_i = (i+1/2)/n, i=0,...,n-1.
Definition: fe.hpp:38
virtual void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const
Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base g...
Definition: fe.cpp:6161
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:4712
Vector & Weights() const
Definition: fe.hpp:2931
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:7621
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:2462
BiQuad2DFiniteElement()
Construct a biquadratic FE on quadrilateral.
Definition: fe.cpp:1803
virtual void GetFaceDofs(int face, int **dofs, int *ndofs) const
Definition: fe.cpp:3022
Tensor products of 1D FEs (only degree 2 is functional)
Definition: fe.hpp:1437
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:3725
P0TriangleFiniteElement()
Construct P0 triangle finite element.
Definition: fe.cpp:2934
static int VerifyNodal(int b_type)
Definition: fe.hpp:568
aka open Newton-Cotes
Definition: intrules.hpp:294
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2848
virtual void SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
Definition: fe.hpp:2933
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:3209
static int Pow(int base, int dim)
Return base raised to the power dim.
Definition: fe.hpp:1866
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2578
H1Ser_QuadrilateralElement(const int p)
Definition: fe.cpp:1918
RT_TriangleElement(const int p)
Definition: fe.cpp:10811
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:7602
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:12226
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2682
virtual void ProjectMatrixCoefficient(MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const
Definition: fe.hpp:2686
BiLinear3DFiniteElement()
Construct a linear FE on wedge.
Definition: fe.hpp:2169
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:11440
void Eval(const double x, Vector &u) const
Definition: fe.cpp:6903
L2Pos_SegmentElement(const int p)
Definition: fe.cpp:9261
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
Definition: fe.cpp:12525
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:4976
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:6216
Class for cubic FE on tetrahedron.
Definition: fe.hpp:1081
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:6147
static void CalcBernstein(const int p, const double x, double *u)
Definition: fe.hpp:1810
virtual void SetOrder() const
Update the NURBSFiniteElement according to the currently set knot vectors.
Definition: fe.cpp:12300
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2690
int GetDerivType() const
Definition: fe.hpp:336
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:8022
static Geometry::Type GetTensorProductGeometry(int dim)
Definition: fe.hpp:1852
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:9534
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:1724
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:10889
Quad2DFiniteElement()
Construct a quadratic FE on triangle.
Definition: fe.cpp:1641
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2745
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.hpp:2627
void LocalRestriction_RT(const double *nk, const Array< int > &d2n, ElementTransformation &Trans, DenseMatrix &R) const
Definition: fe.cpp:1274
Describes the space on each element.
Definition: fe.hpp:210
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:3163
Bernstein polynomials.
Definition: fe.hpp:35
virtual void GetTransferMatrix(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this f...
Definition: fe.cpp: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:2780
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:2877
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:6066
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:9456
static const VectorFiniteElement & CheckVectorFE(const FiniteElement &fe)
Definition: fe.hpp:793
RT_HexahedronElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Definition: fe.cpp:10498
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:11978
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:4564
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:2269
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:1417
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:2832
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &ddshape) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
Definition: fe.cpp:8266
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:3274
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:7733
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:1180
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:6117
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:4332
RT_QuadrilateralElement(const int p, const int cb_type=BasisType::GaussLobatto, const int ob_type=BasisType::GaussLegendre)
Definition: fe.cpp:10287
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:885
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:2837
virtual const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
Definition: fe.cpp:461
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const
Definition: fe.cpp:5247
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:12318
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:2734
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:2561
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:2798
void Project_ND(const double *tk, const Array< int > &d2t, VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:1087
int GetRangeType() const
Definition: fe.hpp:330
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:1520
int Order
Order/degree of the shape functions.
Definition: fe.hpp:240
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:3630
static void CalcBasis(const int p, const double x, double *u, double *d)
Definition: fe.hpp:1779
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:9159
A Class that defines 1-D numerical quadrature rules on [0,1].
Definition: intrules.hpp:263
virtual void Project(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const
Definition: fe.hpp:2794
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:4537
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:7828
virtual void ProjectGrad(const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.hpp:2582
L2_HexahedronElement(const int p, const int btype=BasisType::GaussLegendre)
Definition: fe.cpp:9491
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:586
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:7711
static void CalcDBinomTerms(const int p, const double x, const double y, double *d)
Definition: fe.cpp:7150
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:5730
virtual void CalcHessian(const IntegrationPoint &ip, DenseMatrix &hessian) const
Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the giv...
Definition: fe.cpp:12372
const IntegrationRule * IntRule
IntegrationRule that defines the quadrature points at which the basis functions of the FE are evaluat...
Definition: fe.hpp:138
TriLinear3DFiniteElement()
Construct a tri-linear FE on cube.
Definition: fe.cpp:3111
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:1621
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:9513
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:2507
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const
Definition: fe.cpp:4834
const DofToQuad & GetTensorDofToQuad(const class TensorBasisElement &tb, const IntegrationRule &ir, DofToQuad::Mode mode) const
Definition: fe.cpp:509
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:4293
aka closed Newton-Cotes
Definition: intrules.hpp:295
L2_TriangleElement(const int p, const int btype=BasisType::GaussLegendre)
Definition: fe.cpp:9734
BiLinear2DFiniteElement()
Construct a bilinear FE on quadrilateral.
Definition: fe.cpp:1425
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:2826
Poly_1D poly1d
Definition: fe.cpp:7351
Crouzeix-Raviart finite element on triangle.
Definition: fe.hpp:1186
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:6793
Lagrange1DFiniteElement(int degree)
Definition: fe.cpp:4345
virtual void Project(VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:3373
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:6486
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:10095
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.cpp:9364
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:1487
virtual void ProjectDelta(int vertex, Vector &dofs) const
Definition: fe.hpp:1142
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:8237
void ProjectGrad_RT(const double *nk, const Array< int > &d2n, const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const
Definition: fe.cpp:1003
virtual void Project(Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const
Definition: fe.cpp:778