MFEM  v4.6.0
Finite element discretization library
face_map_utils.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2023, 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_FACE_MAP_UTILS_HPP
13 #define MFEM_FACE_MAP_UTILS_HPP
14 
15 #include "../../general/array.hpp"
16 #include <utility> // std::pair
17 #include <vector>
18 
19 namespace mfem
20 {
21 
22 namespace internal
23 {
24 
25 /// Each face of a hexahedron is given by a level set x_i = l, where x_i is one
26 /// of x, y, or z (corresponding to i=0, i=1, i=2), and l is either 0 or 1.
27 /// Returns i and level.
28 std::pair<int,int> GetFaceNormal3D(const int face_id);
29 
30 /// @brief Fills in the entries of the lexicographic face_map.
31 ///
32 /// For use in FiniteElement::GetFaceMap.
33 ///
34 /// n_face_dofs_per_component is the number of DOFs for each vector component
35 /// on the face (there is only one vector component in all cases except for 3D
36 /// Nedelec elements, where the face DOFs have two components to span the
37 /// tangent space).
38 ///
39 /// The DOFs for the i-th vector component begin at offsets[i] (i.e. the number
40 /// of vector components is given by offsets.size()).
41 ///
42 /// The DOFs for each vector component are arranged in a Cartesian grid defined
43 /// by strides and n_dofs_per_dim.
44 void FillFaceMap(const int n_face_dofs_per_component,
45  const std::vector<int> &offsets,
46  const std::vector<int> &strides,
47  const std::vector<int> &n_dofs_per_dim,
48  Array<int> &face_map);
49 
50 /// Return the face map for nodal tensor elements (H1, L2, and Bernstein basis).
51 void GetTensorFaceMap(const int dim, const int order, const int face_id,
52  Array<int> &face_map);
53 
54 } // namespace internal
55 
56 } // namespace mfem
57 
58 #endif
int dim
Definition: ex24.cpp:53