MFEM  v4.1.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
quadinterpolator_face.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_QUADINTERPOLATOR_FACE
13 #define MFEM_QUADINTERPOLATOR_FACE
14 
15 #include "fespace.hpp"
16 
17 namespace mfem
18 {
19 
20 /** @brief A class that performs interpolation from a face E-vector to
21  quadrature point values and/or derivatives (Q-vectors) on the faces. */
22 /** A face E-vector represents the face-wise discontinuous version of the trace
23  FE space and can be obtained, for example, from a GridFunction using the
24  Operator returned by FiniteElementSpace::GetFaceRestriction(). */
26 {
27 private:
28  FaceType type;
29  int nf;
30  Array<bool> signs;
31 protected:
32  friend class FiniteElementSpace; // Needs access to qspace and IntRule
33 
34  const FiniteElementSpace *fespace; ///< Not owned
35  const IntegrationRule *IntRule; ///< Not owned
36 
37  mutable bool use_tensor_products;
38 
39  static const int MAX_NQ1D = 10;
40  static const int MAX_ND1D = 10;
41  static const int MAX_VDIM1D = 1;
42 
43  static const int MAX_NQ2D = 100;
44  static const int MAX_ND2D = 100;
45  static const int MAX_VDIM2D = 2;
46 
47  static const int MAX_NQ3D = 1000;
48  static const int MAX_ND3D = 1000;
49  static const int MAX_VDIM3D = 3;
50 
51 public:
53  {
54  VALUES = 1 << 0, ///< Evaluate the values at quadrature points
55  DERIVATIVES = 1 << 1, ///< Evaluate the derivatives at quadrature points
56  /** @brief Assuming the derivative at quadrature points form a matrix,
57  this flag can be used to compute and store their determinants. This
58  flag can only be used in Mult(). */
59  DETERMINANTS = 1 << 2,
60  NORMALS = 1 << 3
61  };
62 
64  const IntegrationRule &ir, FaceType type);
65 
66  /** @brief Disable the use of tensor product evaluations, for tensor-product
67  elements, e.g. quads and hexes. */
68  /** Currently, tensor product evaluations are not implemented and this method
69  has no effect. */
70  void DisableTensorProducts(bool disable = true) const
71  { use_tensor_products = !disable; }
72 
73  /// Interpolate the E-vector @a e_vec to quadrature points.
74  /** The @a eval_flags are a bitwise mask of constants from the FaceEvalFlags
75  enumeration. When the VALUES flag is set, the values at quadrature points
76  are computed and stored in the Vector @a q_val. Similarly, when the flag
77  DERIVATIVES is set, the derivatives are computed and stored in @a q_der.
78  When the DETERMINANTS flags is set, it is assumed that the derivatives
79  form a matrix at each quadrature point (i.e. the associated
80  FiniteElementSpace is a vector space) and their determinants are computed
81  and stored in @a q_det. */
82  void Mult(const Vector &e_vec, unsigned eval_flags,
83  Vector &q_val, Vector &q_der, Vector &q_det, Vector &q_nor) const;
84 
85  // Compute kernels follow (cannot be private or protected with nvcc)
86 
87  /// Template compute kernel for 2D.
88  template<const int T_VDIM = 0, const int T_ND = 0, const int T_NQ = 0>
89  static void Eval2D(const int NF,
90  const int vdim,
91  const DofToQuad &maps,
92  const Array<bool> &signs,
93  const Vector &e_vec,
94  Vector &q_val,
95  Vector &q_der,
96  Vector &q_det,
97  Vector &q_nor,
98  const int eval_flags);
99 
100  /// Template compute kernel for 3D.
101  template<const int T_VDIM = 0, const int T_ND = 0, const int T_NQ = 0>
102  static void Eval3D(const int NF,
103  const int vdim,
104  const DofToQuad &maps,
105  const Array<bool> &signs,
106  const Vector &e_vec,
107  Vector &q_val,
108  Vector &q_der,
109  Vector &q_det,
110  Vector &q_nor,
111  const int eval_flags);
112 };
113 
114 } // mfem namespace
115 
116 #endif // MFEM_QUADINTERPOLATOR_FACE
Class for an integration rule - an Array of IntegrationPoint.
Definition: intrules.hpp:90
static void Eval3D(const int NF, const int vdim, const DofToQuad &maps, const Array< bool > &signs, const Vector &e_vec, Vector &q_val, Vector &q_der, Vector &q_det, Vector &q_nor, const int eval_flags)
Template compute kernel for 3D.
FaceQuadratureInterpolator(const FiniteElementSpace &fes, const IntegrationRule &ir, FaceType type)
const IntegrationRule * IntRule
Not owned.
FaceType
Definition: mesh.hpp:42
void Mult(const Vector &e_vec, unsigned eval_flags, Vector &q_val, Vector &q_der, Vector &q_det, Vector &q_nor) const
Interpolate the E-vector e_vec to quadrature points.
A class that performs interpolation from a face E-vector to quadrature point values and/or derivative...
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Definition: fespace.hpp:87
Structure representing the matrices/tensors needed to evaluate (in reference space) the values...
Definition: fe.hpp:128
Evaluate the values at quadrature points.
void DisableTensorProducts(bool disable=true) const
Disable the use of tensor product evaluations, for tensor-product elements, e.g. quads and hexes...
static void Eval2D(const int NF, const int vdim, const DofToQuad &maps, const Array< bool > &signs, const Vector &e_vec, Vector &q_val, Vector &q_der, Vector &q_det, Vector &q_nor, const int eval_flags)
Template compute kernel for 2D.
Evaluate the derivatives at quadrature points.
Vector data type.
Definition: vector.hpp:48
Assuming the derivative at quadrature points form a matrix, this flag can be used to compute and stor...
const FiniteElementSpace * fespace
Not owned.