| 1 |
// ------------------------------------------------------------------------ |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: LGPL-2.1-or-later |
| 4 |
// Copyright (C) 2010 - 2023 by the deal.II authors |
| 5 |
// |
| 6 |
// This file is part of the deal.II library. |
| 7 |
// |
| 8 |
// Part of the source code is dual licensed under Apache-2.0 WITH |
| 9 |
// LLVM-exception OR LGPL-2.1-or-later. Detailed license information |
| 10 |
// governing the source code and code contributions can be found in |
| 11 |
// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II. |
| 12 |
// |
| 13 |
// ------------------------------------------------------------------------ |
| 14 |
|
| 15 |
#ifndef dealii_fe_bdm_h |
| 16 |
#define dealii_fe_bdm_h |
| 17 |
|
| 18 |
#include <deal.II/base/config.h> |
| 19 |
|
| 20 |
#include <deal.II/base/geometry_info.h> |
| 21 |
#include <deal.II/base/polynomial.h> |
| 22 |
#include <deal.II/base/polynomials_bdm.h> |
| 23 |
#include <deal.II/base/tensor_product_polynomials.h> |
| 24 |
|
| 25 |
#include <deal.II/fe/fe.h> |
| 26 |
#include <deal.II/fe/fe_poly_tensor.h> |
| 27 |
|
| 28 |
#include <vector> |
| 29 |
|
| 30 |
DEAL_II_NAMESPACE_OPEN |
| 31 |
|
| 32 |
/** |
| 33 |
* The Brezzi-Douglas-Marini element. |
| 34 |
* |
| 35 |
* <h3>Degrees of freedom</h3> |
| 36 |
* |
| 37 |
* @todo The 3d version exhibits some numerical instabilities, in particular |
| 38 |
* for higher order |
| 39 |
* |
| 40 |
* @todo Restriction matrices are missing. |
| 41 |
* |
| 42 |
* The matching pressure space for FE_BDM of order <i>k</i> is the element |
| 43 |
* FE_DGP of order <i>k-1</i>. |
| 44 |
* |
| 45 |
* The BDM element of order @p p has <i>p+1</i> degrees of freedom on each |
| 46 |
* face. These are implemented as the function values in the <i>p+1</i> Gauss |
| 47 |
* points on each face. |
| 48 |
* |
| 49 |
* Additionally, for order greater or equal 2, we have additional |
| 50 |
* <i>p(p-1)</i>, the number of vector valued polynomials in |
| 51 |
* <i>P<sub>p</sub></i>, interior degrees of freedom. These are the vector |
| 52 |
* function values in the first <i>p(p-1)/2</i> of the <i>p<sup>2</sup></i> |
| 53 |
* Gauss points in the cell. |
| 54 |
* |
| 55 |
* @ingroup fe |
| 56 |
*/ |
| 57 |
template <int dim> |
| 58 |
class FE_BDM : public FE_PolyTensor<dim> |
| 59 |
{ |
| 60 |
public: |
| 61 |
/** |
| 62 |
* Constructor for the BDM element of degree @p p. |
| 63 |
*/ |
| 64 |
FE_BDM(const unsigned int p); |
| 65 |
|
| 66 |
/** |
| 67 |
* Return a string that uniquely identifies a finite element. This class |
| 68 |
* returns <tt>FE_BDM<dim>(degree)</tt>, with @p dim and @p degree replaced |
| 69 |
* by appropriate values. |
| 70 |
*/ |
| 71 |
virtual std::string |
| 72 |
get_name() const override; |
| 73 |
|
| 74 |
virtual std::unique_ptr<FiniteElement<dim, dim>> |
| 75 |
clone() const override; |
| 76 |
|
| 77 |
// documentation inherited from the base class |
| 78 |
virtual void |
| 79 |
convert_generalized_support_point_values_to_dof_values( |
| 80 |
const std::vector<Vector<double>> &support_point_values, |
| 81 |
std::vector<double> &nodal_values) const override; |
| 82 |
|
| 83 |
private: |
| 84 |
/** |
| 85 |
* Only for internal use. Its full name is @p get_dofs_per_object_vector |
| 86 |
* function and it creates the @p dofs_per_object vector that is needed |
| 87 |
* within the constructor to be passed to the constructor of @p |
| 88 |
* FiniteElementData. |
| 89 |
*/ |
| 90 |
static std::vector<unsigned int> |
| 91 |
get_dpo_vector(const unsigned int degree); |
| 92 |
|
| 93 |
/** |
| 94 |
* Compute the vector used for the @p restriction_is_additive field passed |
| 95 |
* to the base class's constructor. |
| 96 |
*/ |
| 97 |
static std::vector<bool> |
| 98 |
get_ria_vector(const unsigned int degree); |
| 99 |
/** |
| 100 |
* Initialize the FiniteElement<dim>::generalized_support_points and |
| 101 |
* FiniteElement<dim>::generalized_face_support_points fields. Called from |
| 102 |
* the constructor. See the |
| 103 |
* @ref GlossGeneralizedSupport "glossary entry on generalized support points" |
| 104 |
* for more information. |
| 105 |
*/ |
| 106 |
void |
| 107 |
initialize_support_points(const unsigned int bdm_degree); |
| 108 |
/** |
| 109 |
* The values in the face support points of the polynomials needed as test |
| 110 |
* functions. The outer vector is indexed by quadrature points, the inner by |
| 111 |
* the test function. The test function space is PolynomialsP<dim-1>. |
| 112 |
*/ |
| 113 |
std::vector<std::vector<double>> test_values_face; |
| 114 |
/** |
| 115 |
* The values in the interior support points of the polynomials needed as |
| 116 |
* test functions. The outer vector is indexed by quadrature points, the |
| 117 |
* inner by the test function. The test function space is PolynomialsP<dim>. |
| 118 |
*/ |
| 119 |
std::vector<std::vector<double>> test_values_cell; |
| 120 |
|
| 121 |
/** |
| 122 |
* Initialize the permutation pattern and the pattern of sign change. |
| 123 |
* |
| 124 |
* @note This function is not fully filled with the correct implementation |
| 125 |
* yet. It needs to be consistently implemented in a future release to work |
| 126 |
* on meshes that contain cells with flipped faces. |
| 127 |
*/ |
| 128 |
void |
| 129 |
initialize_quad_dof_index_permutation_and_sign_change(); |
| 130 |
}; |
| 131 |
|
| 132 |
DEAL_II_NAMESPACE_CLOSE |
| 133 |
|
| 134 |
#endif |