MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
normal_deriv_restriction.hpp
Go to the documentation of this file.
1// Copyright (c) 2010-2024, 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_NORMAL_DERIV_RESTRICTION
13#define MFEM_NORMAL_DERIV_RESTRICTION
14
15#include "../mesh/mesh.hpp"
16
17namespace mfem
18{
19
20class FiniteElementSpace;
21enum class ElementDofOrdering;
22
23/// @brief Class to compute face normal derivatives (in reference coordinate) of
24/// an L2 grid function (used internally by L2FaceRestriction).
26{
27protected:
28 const FiniteElementSpace &fes; ///< The L2 finite element space.
29 const FaceType face_type; ///< Face type: either boundary or interior.
30 const int dim; ///< Dimension of the mesh.
31 const int nf; ///< Number of faces of the given @a face_type.
32 const int ne; ///< Number of elements.
33 int ne_type; ///< Number of elements with faces of type face type
34
35 Array<int> face_to_elem; ///< Face-wise information array.
36 Array<int> elem_to_face; ///< Element-wise information array.
37 Array<int> face_to_vol; ///< maps face index to volume index
38
39public:
40 /// @brief Constructor.
41 /// @param[in] fes_ The associated FiniteElementSpace (should be L2/DG).
42 /// @param[in] f_ordering Request a specific face dof ordering. Currently
43 /// only ElementDofOrdering::LEXICOGRAPHIC is supported.
44 /// @param[in] face_type_ Type of faces to compute restriction (interior or boundary).
46 const ElementDofOrdering f_ordering,
47 const FaceType face_type_);
48
49 /// @brief Computes the normal derivatives on the @a face_type faces of the mesh.
50 /// @param[in] x The L-vector degrees of freedom.
51 /// @param[out] y The face E(like)-vector degrees of freedom of the format
52 /// (face_dofs x vdim x 2 x nf) where nf is the number of faces of type @a
53 /// face_type. The face_dofs are ordered according to @a f_ordering specified
54 /// in the constructor.
55 void Mult(const Vector &x, Vector &y) const;
56
57 /// @brief Computes the transpose of the action of Mult(), accumulating into
58 /// @a y with coefficient @a a.
59 /// @param x Face E-vector layout (face_dofs x vdim x 2 x nf).
60 /// @param y L-vector layout.
61 /// @param a Optional coefficient (y = y + a*R^t*x)
62 void AddMultTranspose(const Vector &x, Vector &y,
63 const real_t a = 1.0) const;
64
65 /// @name Internal compute kernels. Public because of nvcc restriction.
66 ///@{
67
68 template <int T_D1D = 0>
69 void Mult2D(const Vector &x, Vector &y) const;
70
71 template <int T_D1D = 0>
72 void AddMultTranspose2D(const Vector &x, Vector &y, const real_t a) const;
73
74 template <int T_D1D = 0>
75 void Mult3D(const Vector &x, Vector &y) const;
76
77 template <int T_D1D = 0>
78 void AddMultTranspose3D(const Vector &x, Vector &y, const real_t a) const;
79
80 /// @}
81};
82
83}
84
85#endif // MFEM_RESTRICTION
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Definition fespace.hpp:220
Class to compute face normal derivatives (in reference coordinate) of an L2 grid function (used inter...
void Mult(const Vector &x, Vector &y) const
Computes the normal derivatives on the face_type faces of the mesh.
Array< int > elem_to_face
Element-wise information array.
L2NormalDerivativeFaceRestriction(const FiniteElementSpace &fes_, const ElementDofOrdering f_ordering, const FaceType face_type_)
Constructor.
const int nf
Number of faces of the given face_type.
Array< int > face_to_elem
Face-wise information array.
const FiniteElementSpace & fes
The L2 finite element space.
int ne_type
Number of elements with faces of type face type.
const FaceType face_type
Face type: either boundary or interior.
void Mult2D(const Vector &x, Vector &y) const
void Mult3D(const Vector &x, Vector &y) const
void AddMultTranspose(const Vector &x, Vector &y, const real_t a=1.0) const
Computes the transpose of the action of Mult(), accumulating into y with coefficient a.
Array< int > face_to_vol
maps face index to volume index
void AddMultTranspose2D(const Vector &x, Vector &y, const real_t a) const
void AddMultTranspose3D(const Vector &x, Vector &y, const real_t a) const
Vector data type.
Definition vector.hpp:80
real_t a
Definition lissajous.cpp:41
float real_t
Definition config.hpp:43
ElementDofOrdering
Constants describing the possible orderings of the DOFs in one element.
Definition fespace.hpp:75
FaceType
Definition mesh.hpp:47