| 1 |
// ------------------------------------------------------------------------ |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: LGPL-2.1-or-later |
| 4 |
// Copyright (C) 2013 - 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_q_iso_q1_h |
| 16 |
#define dealii_fe_q_iso_q1_h |
| 17 |
|
| 18 |
#include <deal.II/base/config.h> |
| 19 |
|
| 20 |
#include <deal.II/base/polynomials_piecewise.h> |
| 21 |
#include <deal.II/base/tensor_product_polynomials.h> |
| 22 |
|
| 23 |
#include <deal.II/fe/fe_q_base.h> |
| 24 |
|
| 25 |
DEAL_II_NAMESPACE_OPEN |
| 26 |
|
| 27 |
|
| 28 |
/** |
| 29 |
* @addtogroup fe |
| 30 |
* @{ |
| 31 |
*/ |
| 32 |
|
| 33 |
/** |
| 34 |
* Implementation of a scalar Lagrange finite element @p Qp-iso-Q1 |
| 35 |
* that defines the finite element space of continuous, piecewise |
| 36 |
* linear elements with @p p subdivisions in each coordinate |
| 37 |
* direction. It yields an element with the same number of degrees of |
| 38 |
* freedom as the @p Qp elements but using linear interpolation |
| 39 |
* instead of higher order one. In other words, on every cell, the |
| 40 |
* shape functions are not of higher order polynomial degree |
| 41 |
* interpolating a set of node points, but are piecewise (bi-, |
| 42 |
* tri-)linear *within* the cell and interpolating the same set of |
| 43 |
* node points. This type of element is also called *macro element* in |
| 44 |
* the literature as it can be seen as consisting of several smaller |
| 45 |
* elements, namely <i>p</i><tt><sup>dim</sup></tt> such sub-cells. |
| 46 |
* |
| 47 |
* The numbering of degrees of freedom is done in exactly the same way as in |
| 48 |
* FE_Q of degree @p p. See there for a detailed description on how degrees of |
| 49 |
* freedom are numbered within one element. |
| 50 |
* |
| 51 |
* This element represents a Q-linear finite element space on a reduced mesh of |
| 52 |
* size <i>h/p</i>. Its effect is equivalent to using FE_Q of degree one on a |
| 53 |
* finer mesh by a factor @p p if an equivalent quadrature is used. However, |
| 54 |
* this element reduces the flexibility in the choice of (adaptive) mesh size |
| 55 |
* by exactly this factor @p p, which typically reduces efficiency. On the |
| 56 |
* other hand, comparing this element with @p p subdivisions to the FE_Q |
| 57 |
* element of degree @p p on the same mesh shows that the convergence is |
| 58 |
* typically much worse for smooth problems. In particular, @p Qp elements |
| 59 |
* achieve interpolation orders of <i>h<sup>p+1</sup></i> in the $L_2$ norm, |
| 60 |
* whereas these elements reach only <i>(h/p)<sup>2</sup></i>. For these two |
| 61 |
* reasons, this element is usually not very useful as a standalone. In |
| 62 |
* addition, any evaluation of face terms on the boundaries within the |
| 63 |
* elements becomes impossible with this element because deal.II does not |
| 64 |
* have the equivalent of FEFaceValues for lower-dimensional integrals |
| 65 |
* in the interior of cells. |
| 66 |
* |
| 67 |
* Nonetheless, there are a few use cases where this element actually is |
| 68 |
* useful: |
| 69 |
* <ol> |
| 70 |
* |
| 71 |
* <li> Systems of PDEs where certain variables demand for higher resolutions |
| 72 |
* than the others and the additional degrees of freedom should be spent on |
| 73 |
* increasing the resolution of linears instead of higher order polynomials, |
| 74 |
* and you do not want to use two different meshes for the different |
| 75 |
* components. This can be the case when irregularities (shocks) appear in the |
| 76 |
* solution and stabilization techniques are used that work for linears but |
| 77 |
* not higher order elements. </li> |
| 78 |
* |
| 79 |
* <li> Stokes/Navier Stokes systems such as the one discussed in |
| 80 |
* step-22 could be solved with Q2-iso-Q1 elements for velocities |
| 81 |
* instead of $Q_2$ elements. Combined with $Q_1$ pressures they give |
| 82 |
* a stable mixed element pair. However, they perform worse than the |
| 83 |
* standard (Taylor-Hood $Q_2\times Q_1$) approach in most |
| 84 |
* situations. (See, for example, @cite Boffi2011 .) This combination |
| 85 |
* of subdivided elements for the velocity and non-subdivided elements |
| 86 |
* for the pressure is sometimes called the "Bercovier-Pironneau |
| 87 |
* element" and dates back to around the same time as the Taylor-Hood |
| 88 |
* element (namely, the mid-1970s). For more information, see the |
| 89 |
* paper by Bercovier and Pironneau from 1979 @cite Bercovier1979, and |
| 90 |
* for the origins of the comparable Taylor-Hood element see |
| 91 |
* @cite Taylor73 from 1973.</li> |
| 92 |
* |
| 93 |
* <li> Preconditioning systems of FE_Q systems of higher order @p p with a |
| 94 |
* preconditioner based on @p Qp-iso-Q1 elements: Some preconditioners like |
| 95 |
* algebraic multigrid perform much better with linear elements than with |
| 96 |
* higher order elements because they often implicitly assume a sparse |
| 97 |
* connectivity between entries. Then, creating a preconditioner matrix based |
| 98 |
* on these elements yields the same number of degrees of freedom (and a |
| 99 |
* spectrally equivalent linear system), which can be combined with a (high |
| 100 |
* order) system matrix in an iterative solver like CG. </li> |
| 101 |
* </ol> |
| 102 |
* |
| 103 |
* <h3>Appropriate integration</h3> |
| 104 |
* |
| 105 |
* Due to the nature of these elements as a concatenation of linears, care |
| 106 |
* must be taken when selecting quadrature formulas for this element. The |
| 107 |
* standard choice for an element of @p p subelements is a formula |
| 108 |
* <tt>QIterated<dim>(QGauss<1>(2), p)</tt>, which corresponds to the formula |
| 109 |
* that would be used for integrating functions on a finer mesh. This is in |
| 110 |
* contrast with FE_Q(p) where QGauss<dim>(p+1) is the default choice. In |
| 111 |
* particular, care must be taken to not use a quadrature formula that |
| 112 |
* evaluates the basis functions (and their derivatives) on sub-element |
| 113 |
* boundaries as the gradients of piecewise functions on internal boundaries |
| 114 |
* are set to zero. No checks are performed internally to ensure that this is |
| 115 |
* not the case - it is the user's responsibility to avoid these situations. |
| 116 |
* |
| 117 |
* Also note that the usual deal.II routines for setting up sparsity patterns |
| 118 |
* and assembling matrices do not make use of the increased sparsity in this |
| 119 |
* element compared to FE_Q. This is because DoFTools::make_sparsity_pattern |
| 120 |
* assumes coupling between all degrees of freedom within the element, whereas |
| 121 |
* FE_Q_iso_Q1 with more than one subdivision does have less coupling. |
| 122 |
*/ |
| 123 |
template <int dim, int spacedim = dim> |
| 124 |
class FE_Q_iso_Q1 : public FE_Q_Base<dim, spacedim> |
| 125 |
{ |
| 126 |
public: |
| 127 |
/** |
| 128 |
* Construct a FE_Q_iso_Q1 element with a given number of subdivisions. The |
| 129 |
* number of subdivision is similar to the degree in FE_Q in the sense that |
| 130 |
* both elements produce the same number of degrees of freedom. |
| 131 |
*/ |
| 132 |
FE_Q_iso_Q1(const unsigned int n_subdivisions); |
| 133 |
|
| 134 |
/** |
| 135 |
* Construct a FE_Q_iso_Q1 element with a given vector of support points. |
| 136 |
*/ |
| 137 |
FE_Q_iso_Q1(const std::vector<Point<1>> &support_points); |
| 138 |
|
| 139 |
/** |
| 140 |
* Return a string that uniquely identifies a finite element. This class |
| 141 |
* returns <tt>FE_Q_iso_q1<dim>(equivalent_degree)</tt>, with @p dim and @p |
| 142 |
* equivalent_degree replaced by appropriate values. |
| 143 |
*/ |
| 144 |
virtual std::string |
| 145 |
get_name() const override; |
| 146 |
|
| 147 |
virtual std::unique_ptr<FiniteElement<dim, spacedim>> |
| 148 |
clone() const override; |
| 149 |
|
| 150 |
/** |
| 151 |
* Implementation of the corresponding function in the FiniteElement |
| 152 |
* class. Since the current element is interpolatory, the nodal |
| 153 |
* values are exactly the support point values. Furthermore, since |
| 154 |
* the current element is scalar, the support point values need to |
| 155 |
* be vectors of length 1. |
| 156 |
*/ |
| 157 |
virtual void |
| 158 |
convert_generalized_support_point_values_to_dof_values( |
| 159 |
const std::vector<Vector<double>> &support_point_values, |
| 160 |
std::vector<double> &nodal_values) const override; |
| 161 |
|
| 162 |
/** |
| 163 |
* @name Functions to support hp |
| 164 |
* @{ |
| 165 |
*/ |
| 166 |
|
| 167 |
/** |
| 168 |
* @copydoc FiniteElement::compare_for_domination() |
| 169 |
*/ |
| 170 |
virtual FiniteElementDomination::Domination |
| 171 |
compare_for_domination(const FiniteElement<dim, spacedim> &fe_other, |
| 172 |
const unsigned int codim = 0) const override final; |
| 173 |
|
| 174 |
/** @} */ |
| 175 |
}; |
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
/** @} */ |
| 180 |
|
| 181 |
DEAL_II_NAMESPACE_CLOSE |
| 182 |
|
| 183 |
#endif |