| 1 |
// ------------------------------------------------------------------------ |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: LGPL-2.1-or-later |
| 4 |
// Copyright (C) 2002 - 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_dgp_nonparametric_h |
| 16 |
#define dealii_fe_dgp_nonparametric_h |
| 17 |
|
| 18 |
#include <deal.II/base/config.h> |
| 19 |
|
| 20 |
#include <deal.II/base/polynomial.h> |
| 21 |
#include <deal.II/base/polynomial_space.h> |
| 22 |
|
| 23 |
#include <deal.II/fe/fe.h> |
| 24 |
#include <deal.II/fe/mapping.h> |
| 25 |
|
| 26 |
DEAL_II_NAMESPACE_OPEN |
| 27 |
|
| 28 |
/** |
| 29 |
* @addtogroup fe |
| 30 |
* @{ |
| 31 |
*/ |
| 32 |
|
| 33 |
/** |
| 34 |
* Discontinuous finite elements evaluated at the mapped quadrature points. |
| 35 |
* |
| 36 |
* Warning: this class does not work properly, yet. Don't use it! |
| 37 |
* |
| 38 |
* This finite element implements complete polynomial spaces, that is, |
| 39 |
* $d$-dimensional polynomials of order $k$. |
| 40 |
* |
| 41 |
* The polynomials are not mapped. Therefore, they are constant, linear, |
| 42 |
* quadratic, etc. on any grid cell. |
| 43 |
* |
| 44 |
* Since the polynomials are evaluated at the quadrature points of the actual |
| 45 |
* grid cell, no grid transfer and interpolation matrices are available. |
| 46 |
* |
| 47 |
* The purpose of this class is experimental, therefore the implementation |
| 48 |
* will remain incomplete. |
| 49 |
* |
| 50 |
* Besides, this class is not implemented for the codimension one case |
| 51 |
* (<tt>spacedim != dim</tt>). |
| 52 |
* |
| 53 |
* |
| 54 |
* <h3>Visualization of shape functions</h3> In 2d, the shape functions of |
| 55 |
* this element look as follows. |
| 56 |
* |
| 57 |
* <h4>$P_0$ element</h4> |
| 58 |
* |
| 59 |
* <table> <tr> <td align="center"> |
| 60 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P1/P1_DGPNonparametric_shape0000.png |
| 61 |
* </td> |
| 62 |
* |
| 63 |
* <td align="center"> </td> </tr> <tr> <td align="center"> $P_0$ element, |
| 64 |
* shape function 0 </td> |
| 65 |
* |
| 66 |
* <td align="center"></tr> </table> |
| 67 |
* |
| 68 |
* <h4>$P_1$ element</h4> |
| 69 |
* |
| 70 |
* <table> <tr> <td align="center"> |
| 71 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P1/P1_DGPNonparametric_shape0000.png |
| 72 |
* </td> |
| 73 |
* |
| 74 |
* <td align="center"> |
| 75 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P1/P1_DGPNonparametric_shape0001.png |
| 76 |
* </td> </tr> <tr> <td align="center"> $P_1$ element, shape function 0 </td> |
| 77 |
* |
| 78 |
* <td align="center"> $P_1$ element, shape function 1 </td> </tr> |
| 79 |
* |
| 80 |
* <tr> <td align="center"> |
| 81 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P1/P1_DGPNonparametric_shape0002.png |
| 82 |
* </td> |
| 83 |
* |
| 84 |
* <td align="center"> </td> </tr> <tr> <td align="center"> $P_1$ element, |
| 85 |
* shape function 2 </td> |
| 86 |
* |
| 87 |
* <td align="center"></td> </tr> </table> |
| 88 |
* |
| 89 |
* |
| 90 |
* <h4>$P_2$ element</h4> |
| 91 |
* |
| 92 |
* <table> <tr> <td align="center"> |
| 93 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P2/P2_DGPNonparametric_shape0000.png |
| 94 |
* </td> |
| 95 |
* |
| 96 |
* <td align="center"> |
| 97 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P2/P2_DGPNonparametric_shape0001.png |
| 98 |
* </td> </tr> <tr> <td align="center"> $P_2$ element, shape function 0 </td> |
| 99 |
* |
| 100 |
* <td align="center"> $P_2$ element, shape function 1 </td> </tr> |
| 101 |
* |
| 102 |
* <tr> <td align="center"> |
| 103 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P2/P2_DGPNonparametric_shape0002.png |
| 104 |
* </td> |
| 105 |
* |
| 106 |
* <td align="center"> |
| 107 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P2/P2_DGPNonparametric_shape0003.png |
| 108 |
* </td> </tr> <tr> <td align="center"> $P_2$ element, shape function 2 </td> |
| 109 |
* |
| 110 |
* <td align="center"> $P_2$ element, shape function 3 </td> </tr> |
| 111 |
* |
| 112 |
* <tr> <td align="center"> |
| 113 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P2/P2_DGPNonparametric_shape0004.png |
| 114 |
* </td> |
| 115 |
* |
| 116 |
* <td align="center"> |
| 117 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P2/P2_DGPNonparametric_shape0005.png |
| 118 |
* </td> </tr> <tr> <td align="center"> $P_2$ element, shape function 4 </td> |
| 119 |
* |
| 120 |
* <td align="center"> $P_2$ element, shape function 5 </td> </tr> </table> |
| 121 |
* |
| 122 |
* |
| 123 |
* <h4>$P_3$ element</h4> |
| 124 |
* |
| 125 |
* <table> <tr> <td align="center"> |
| 126 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P3/P3_DGPNonparametric_shape0000.png |
| 127 |
* </td> |
| 128 |
* |
| 129 |
* <td align="center"> |
| 130 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P3/P3_DGPNonparametric_shape0001.png |
| 131 |
* </td> </tr> <tr> <td align="center"> $P_3$ element, shape function 0 </td> |
| 132 |
* |
| 133 |
* <td align="center"> $P_3$ element, shape function 1 </td> </tr> |
| 134 |
* |
| 135 |
* <tr> <td align="center"> |
| 136 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P3/P3_DGPNonparametric_shape0002.png |
| 137 |
* </td> |
| 138 |
* |
| 139 |
* <td align="center"> |
| 140 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P3/P3_DGPNonparametric_shape0003.png |
| 141 |
* </td> </tr> <tr> <td align="center"> $P_3$ element, shape function 2 </td> |
| 142 |
* |
| 143 |
* <td align="center"> $P_3$ element, shape function 3 </td> </tr> |
| 144 |
* |
| 145 |
* <tr> <td align="center"> |
| 146 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P3/P3_DGPNonparametric_shape0004.png |
| 147 |
* </td> |
| 148 |
* |
| 149 |
* <td align="center"> |
| 150 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P3/P3_DGPNonparametric_shape0005.png |
| 151 |
* </td> </tr> <tr> <td align="center"> $P_3$ element, shape function 4 </td> |
| 152 |
* |
| 153 |
* <td align="center"> $P_3$ element, shape function 5 </td> </tr> |
| 154 |
* |
| 155 |
* <tr> <td align="center"> |
| 156 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P3/P3_DGPNonparametric_shape0006.png |
| 157 |
* </td> |
| 158 |
* |
| 159 |
* <td align="center"> |
| 160 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P3/P3_DGPNonparametric_shape0007.png |
| 161 |
* </td> </tr> <tr> <td align="center"> $P_3$ element, shape function 6 </td> |
| 162 |
* |
| 163 |
* <td align="center"> $P_3$ element, shape function 7 </td> </tr> |
| 164 |
* |
| 165 |
* <tr> <td align="center"> |
| 166 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P3/P3_DGPNonparametric_shape0008.png |
| 167 |
* </td> |
| 168 |
* |
| 169 |
* <td align="center"> |
| 170 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P3/P3_DGPNonparametric_shape0009.png |
| 171 |
* </td> </tr> <tr> <td align="center"> $P_3$ element, shape function 8 </td> |
| 172 |
* |
| 173 |
* <td align="center"> $P_3$ element, shape function 9 </td> </tr> </table> |
| 174 |
* |
| 175 |
* |
| 176 |
* <h4>$P_4$ element</h4> <table> <tr> <td align="center"> |
| 177 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P4/P4_DGPNonparametric_shape0000.png |
| 178 |
* </td> |
| 179 |
* |
| 180 |
* <td align="center"> |
| 181 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P4/P4_DGPNonparametric_shape0001.png |
| 182 |
* </td> </tr> <tr> <td align="center"> $P_4$ element, shape function 0 </td> |
| 183 |
* |
| 184 |
* <td align="center"> $P_4$ element, shape function 1 </td> </tr> |
| 185 |
* |
| 186 |
* <tr> <td align="center"> |
| 187 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P4/P4_DGPNonparametric_shape0002.png |
| 188 |
* </td> |
| 189 |
* |
| 190 |
* <td align="center"> |
| 191 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P4/P4_DGPNonparametric_shape0003.png |
| 192 |
* </td> </tr> <tr> <td align="center"> $P_4$ element, shape function 2 </td> |
| 193 |
* |
| 194 |
* <td align="center"> $P_4$ element, shape function 3 </td> </tr> |
| 195 |
* |
| 196 |
* <tr> <td align="center"> |
| 197 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P4/P4_DGPNonparametric_shape0004.png |
| 198 |
* </td> |
| 199 |
* |
| 200 |
* <td align="center"> |
| 201 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P4/P4_DGPNonparametric_shape0005.png |
| 202 |
* </td> </tr> <tr> <td align="center"> $P_4$ element, shape function 4 </td> |
| 203 |
* |
| 204 |
* <td align="center"> $P_4$ element, shape function 5 </td> </tr> |
| 205 |
* |
| 206 |
* <tr> <td align="center"> |
| 207 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P4/P4_DGPNonparametric_shape0006.png |
| 208 |
* </td> |
| 209 |
* |
| 210 |
* <td align="center"> |
| 211 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P4/P4_DGPNonparametric_shape0007.png |
| 212 |
* </td> </tr> <tr> <td align="center"> $P_4$ element, shape function 6 </td> |
| 213 |
* |
| 214 |
* <td align="center"> $P_4$ element, shape function 7 </td> </tr> |
| 215 |
* |
| 216 |
* <tr> <td align="center"> |
| 217 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P4/P4_DGPNonparametric_shape0008.png |
| 218 |
* </td> |
| 219 |
* |
| 220 |
* <td align="center"> |
| 221 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P4/P4_DGPNonparametric_shape0009.png |
| 222 |
* </td> </tr> <tr> <td align="center"> $P_4$ element, shape function 8 </td> |
| 223 |
* |
| 224 |
* <td align="center"> $P_4$ element, shape function 9 </td> </tr> |
| 225 |
* |
| 226 |
* <tr> <td align="center"> |
| 227 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P4/P4_DGPNonparametric_shape0010.png |
| 228 |
* </td> |
| 229 |
* |
| 230 |
* <td align="center"> |
| 231 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P4/P4_DGPNonparametric_shape0011.png |
| 232 |
* </td> </tr> <tr> <td align="center"> $P_4$ element, shape function 10 </td> |
| 233 |
* |
| 234 |
* <td align="center"> $P_4$ element, shape function 11 </td> </tr> |
| 235 |
* |
| 236 |
* <tr> <td align="center"> |
| 237 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P4/P4_DGPNonparametric_shape0012.png |
| 238 |
* </td> |
| 239 |
* |
| 240 |
* <td align="center"> |
| 241 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P4/P4_DGPNonparametric_shape0013.png |
| 242 |
* </td> </tr> <tr> <td align="center"> $P_4$ element, shape function 12 </td> |
| 243 |
* |
| 244 |
* <td align="center"> $P_4$ element, shape function 13 </td> </tr> |
| 245 |
* |
| 246 |
* <tr> <td align="center"> |
| 247 |
* @image html http://www.dealii.org/images/shape-functions/DGPNonparametric/P4/P4_DGPNonparametric_shape0014.png |
| 248 |
* </td> |
| 249 |
* |
| 250 |
* <td align="center"> </td> </tr> <tr> <td align="center"> $P_4$ element, |
| 251 |
* shape function 14 </td> |
| 252 |
* |
| 253 |
* <td align="center"></td> </tr> </table> |
| 254 |
* |
| 255 |
* |
| 256 |
* <h3> Implementation details </h3> |
| 257 |
* |
| 258 |
* This element does not have an InternalData class, unlike all other |
| 259 |
* elements, because the InternalData classes are used to store things that |
| 260 |
* can be computed once and reused multiple times (such as the values of shape |
| 261 |
* functions at quadrature points on the reference cell). However, because the |
| 262 |
* element is not mapped, this element has nothing that could be computed on |
| 263 |
* the reference cell -- everything needs to be computed on the real cell -- |
| 264 |
* and consequently there is nothing we'd like to store in such an object. We |
| 265 |
* can thus simply use the members already provided by |
| 266 |
* FiniteElement::InternalDataBase without adding anything in a derived class |
| 267 |
* in this class. |
| 268 |
*/ |
| 269 |
template <int dim, int spacedim = dim> |
| 270 |
class FE_DGPNonparametric : public FiniteElement<dim, spacedim> |
| 271 |
{ |
| 272 |
public: |
| 273 |
/** |
| 274 |
* Constructor for tensor product polynomials of degree @p k. |
| 275 |
*/ |
| 276 |
FE_DGPNonparametric(const unsigned int k); |
| 277 |
|
| 278 |
/** |
| 279 |
* Return a string that uniquely identifies a finite element. This class |
| 280 |
* returns <tt>FE_DGPNonparametric<dim>(degree)</tt>, with @p dim and @p |
| 281 |
* degree replaced by appropriate values. |
| 282 |
*/ |
| 283 |
virtual std::string |
| 284 |
get_name() const override; |
| 285 |
|
| 286 |
virtual std::unique_ptr<FiniteElement<dim, spacedim>> |
| 287 |
clone() const override; |
| 288 |
|
| 289 |
// for documentation, see the FiniteElement base class |
| 290 |
virtual UpdateFlags |
| 291 |
requires_update_flags(const UpdateFlags update_flags) const override; |
| 292 |
|
| 293 |
/** |
| 294 |
* This function is intended to return the value of a shape function at a |
| 295 |
* point on the reference cell. However, since the current element does not |
| 296 |
* implement shape functions by mapping from a reference cell, no shape |
| 297 |
* functions exist on the reference cell. |
| 298 |
* |
| 299 |
* Consequently, as discussed in the corresponding function in the base |
| 300 |
* class, FiniteElement::shape_value(), this function throws an exception of |
| 301 |
* type FiniteElement::ExcUnitShapeValuesDoNotExist. |
| 302 |
*/ |
| 303 |
virtual double |
| 304 |
shape_value(const unsigned int i, const Point<dim> &p) const override; |
| 305 |
|
| 306 |
/** |
| 307 |
* This function is intended to return the value of a shape function at a |
| 308 |
* point on the reference cell. However, since the current element does not |
| 309 |
* implement shape functions by mapping from a reference cell, no shape |
| 310 |
* functions exist on the reference cell. |
| 311 |
* |
| 312 |
* Consequently, as discussed in the corresponding function in the base |
| 313 |
* class, FiniteElement::shape_value_component(), this function throws an |
| 314 |
* exception of type FiniteElement::ExcUnitShapeValuesDoNotExist. |
| 315 |
*/ |
| 316 |
virtual double |
| 317 |
shape_value_component(const unsigned int i, |
| 318 |
const Point<dim> &p, |
| 319 |
const unsigned int component) const override; |
| 320 |
|
| 321 |
/** |
| 322 |
* This function is intended to return the gradient of a shape function at a |
| 323 |
* point on the reference cell. However, since the current element does not |
| 324 |
* implement shape functions by mapping from a reference cell, no shape |
| 325 |
* functions exist on the reference cell. |
| 326 |
* |
| 327 |
* Consequently, as discussed in the corresponding function in the base |
| 328 |
* class, FiniteElement::shape_grad(), this function throws an exception of |
| 329 |
* type FiniteElement::ExcUnitShapeValuesDoNotExist. |
| 330 |
*/ |
| 331 |
virtual Tensor<1, dim> |
| 332 |
shape_grad(const unsigned int i, const Point<dim> &p) const override; |
| 333 |
|
| 334 |
/** |
| 335 |
* This function is intended to return the gradient of a shape function at a |
| 336 |
* point on the reference cell. However, since the current element does not |
| 337 |
* implement shape functions by mapping from a reference cell, no shape |
| 338 |
* functions exist on the reference cell. |
| 339 |
* |
| 340 |
* Consequently, as discussed in the corresponding function in the base |
| 341 |
* class, FiniteElement::shape_grad_component(), this function throws an |
| 342 |
* exception of type FiniteElement::ExcUnitShapeValuesDoNotExist. |
| 343 |
*/ |
| 344 |
virtual Tensor<1, dim> |
| 345 |
shape_grad_component(const unsigned int i, |
| 346 |
const Point<dim> &p, |
| 347 |
const unsigned int component) const override; |
| 348 |
|
| 349 |
/** |
| 350 |
* This function is intended to return the Hessian of a shape function at a |
| 351 |
* point on the reference cell. However, since the current element does not |
| 352 |
* implement shape functions by mapping from a reference cell, no shape |
| 353 |
* functions exist on the reference cell. |
| 354 |
* |
| 355 |
* Consequently, as discussed in the corresponding function in the base |
| 356 |
* class, FiniteElement::shape_grad_grad(), this function throws an |
| 357 |
* exception of type FiniteElement::ExcUnitShapeValuesDoNotExist. |
| 358 |
*/ |
| 359 |
virtual Tensor<2, dim> |
| 360 |
shape_grad_grad(const unsigned int i, const Point<dim> &p) const override; |
| 361 |
|
| 362 |
/** |
| 363 |
* This function is intended to return the Hessian of a shape function at a |
| 364 |
* point on the reference cell. However, since the current element does not |
| 365 |
* implement shape functions by mapping from a reference cell, no shape |
| 366 |
* functions exist on the reference cell. |
| 367 |
* |
| 368 |
* Consequently, as discussed in the corresponding function in the base |
| 369 |
* class, FiniteElement::shape_grad_grad_component(), this function throws |
| 370 |
* an exception of type FiniteElement::ExcUnitShapeValuesDoNotExist. |
| 371 |
*/ |
| 372 |
virtual Tensor<2, dim> |
| 373 |
shape_grad_grad_component(const unsigned int i, |
| 374 |
const Point<dim> &p, |
| 375 |
const unsigned int component) const override; |
| 376 |
|
| 377 |
/** |
| 378 |
* Return the polynomial degree of this finite element, i.e. the value |
| 379 |
* passed to the constructor. |
| 380 |
*/ |
| 381 |
unsigned int |
| 382 |
get_degree() const; |
| 383 |
|
| 384 |
/** |
| 385 |
* Return the matrix interpolating from a face of one element to the face |
| 386 |
* of the neighboring element. The size of the matrix is then |
| 387 |
* <tt>source.dofs_per_face</tt> times <tt>this->dofs_per_face</tt>. |
| 388 |
* |
| 389 |
* Derived elements will have to implement this function. They may only |
| 390 |
* provide interpolation matrices for certain source finite elements, for |
| 391 |
* example those from the same family. If they don't implement interpolation |
| 392 |
* from a given element, then they must throw an exception of type |
| 393 |
* FiniteElement<dim,spacedim>::ExcInterpolationNotImplemented. |
| 394 |
*/ |
| 395 |
virtual void |
| 396 |
get_face_interpolation_matrix(const FiniteElement<dim, spacedim> &source, |
| 397 |
FullMatrix<double> &matrix, |
| 398 |
const unsigned int face_no = 0) const override; |
| 399 |
|
| 400 |
/** |
| 401 |
* Return the matrix interpolating from a face of one element to the face |
| 402 |
* of the neighboring element. The size of the matrix is then |
| 403 |
* <tt>source.dofs_per_face</tt> times <tt>this->dofs_per_face</tt>. |
| 404 |
* |
| 405 |
* Derived elements will have to implement this function. They may only |
| 406 |
* provide interpolation matrices for certain source finite elements, for |
| 407 |
* example those from the same family. If they don't implement interpolation |
| 408 |
* from a given element, then they must throw an exception of type |
| 409 |
* FiniteElement<dim,spacedim>::ExcInterpolationNotImplemented. |
| 410 |
*/ |
| 411 |
virtual void |
| 412 |
get_subface_interpolation_matrix( |
| 413 |
const FiniteElement<dim, spacedim> &source, |
| 414 |
const unsigned int subface, |
| 415 |
FullMatrix<double> &matrix, |
| 416 |
const unsigned int face_no = 0) const override; |
| 417 |
|
| 418 |
/** |
| 419 |
* @name Functions to support hp |
| 420 |
* @{ |
| 421 |
*/ |
| 422 |
|
| 423 |
/** |
| 424 |
* If, on a vertex, several finite elements are active, the hp-code first |
| 425 |
* assigns the degrees of freedom of each of these FEs different global |
| 426 |
* indices. It then calls this function to find out which of them should get |
| 427 |
* identical values, and consequently can receive the same global DoF index. |
| 428 |
* This function therefore returns a list of identities between DoFs of the |
| 429 |
* present finite element object with the DoFs of @p fe_other, which is a |
| 430 |
* reference to a finite element object representing one of the other finite |
| 431 |
* elements active on this particular vertex. The function computes which of |
| 432 |
* the degrees of freedom of the two finite element objects are equivalent, |
| 433 |
* both numbered between zero and the corresponding value of |
| 434 |
* n_dofs_per_vertex() of the two finite elements. The first index of each |
| 435 |
* pair denotes one of the vertex dofs of the present element, whereas the |
| 436 |
* second is the corresponding index of the other finite element. |
| 437 |
* |
| 438 |
* This being a discontinuous element, the set of such constraints is of |
| 439 |
* course empty. |
| 440 |
*/ |
| 441 |
virtual std::vector<std::pair<unsigned int, unsigned int>> |
| 442 |
hp_vertex_dof_identities( |
| 443 |
const FiniteElement<dim, spacedim> &fe_other) const override; |
| 444 |
|
| 445 |
/** |
| 446 |
* Same as hp_vertex_dof_indices(), except that the function treats degrees |
| 447 |
* of freedom on lines. |
| 448 |
* |
| 449 |
* This being a discontinuous element, the set of such constraints is of |
| 450 |
* course empty. |
| 451 |
*/ |
| 452 |
virtual std::vector<std::pair<unsigned int, unsigned int>> |
| 453 |
hp_line_dof_identities( |
| 454 |
const FiniteElement<dim, spacedim> &fe_other) const override; |
| 455 |
|
| 456 |
/** |
| 457 |
* Same as hp_vertex_dof_indices(), except that the function treats degrees |
| 458 |
* of freedom on quads. |
| 459 |
* |
| 460 |
* This being a discontinuous element, the set of such constraints is of |
| 461 |
* course empty. |
| 462 |
*/ |
| 463 |
virtual std::vector<std::pair<unsigned int, unsigned int>> |
| 464 |
hp_quad_dof_identities(const FiniteElement<dim, spacedim> &fe_other, |
| 465 |
const unsigned int face_no = 0) const override; |
| 466 |
|
| 467 |
/** |
| 468 |
* Return whether this element implements its hanging node constraints in |
| 469 |
* the new way, which has to be used to make elements "hp-compatible". |
| 470 |
* |
| 471 |
* For the FE_DGPNonparametric class the result is always true (independent |
| 472 |
* of the degree of the element), as it has no hanging nodes (being a |
| 473 |
* discontinuous element). |
| 474 |
*/ |
| 475 |
virtual bool |
| 476 |
hp_constraints_are_implemented() const override; |
| 477 |
|
| 478 |
/** |
| 479 |
* @copydoc FiniteElement::compare_for_domination() |
| 480 |
*/ |
| 481 |
virtual FiniteElementDomination::Domination |
| 482 |
compare_for_domination(const FiniteElement<dim, spacedim> &fe_other, |
| 483 |
const unsigned int codim = 0) const override final; |
| 484 |
|
| 485 |
/** |
| 486 |
* @} |
| 487 |
*/ |
| 488 |
|
| 489 |
/** |
| 490 |
* This function returns @p true, if the shape function @p shape_index has |
| 491 |
* non-zero function values somewhere on the face @p face_index. |
| 492 |
*/ |
| 493 |
virtual bool |
| 494 |
has_support_on_face(const unsigned int shape_index, |
| 495 |
const unsigned int face_index) const override; |
| 496 |
|
| 497 |
/** |
| 498 |
* Determine an estimate for the memory consumption (in bytes) of this |
| 499 |
* object. |
| 500 |
* |
| 501 |
* This function is made virtual, since finite element objects are usually |
| 502 |
* accessed through pointers to their base class, rather than the class |
| 503 |
* itself. |
| 504 |
*/ |
| 505 |
virtual std::size_t |
| 506 |
memory_consumption() const override; |
| 507 |
|
| 508 |
protected: |
| 509 |
/** |
| 510 |
* Prepare internal data structures and fill in values independent of the |
| 511 |
* cell. |
| 512 |
*/ |
| 513 |
virtual std::unique_ptr< |
| 514 |
typename FiniteElement<dim, spacedim>::InternalDataBase> |
| 515 |
get_data( |
| 516 |
const UpdateFlags update_flags, |
| 517 |
const Mapping<dim, spacedim> &mapping, |
| 518 |
const Quadrature<dim> &quadrature, |
| 519 |
dealii::internal::FEValuesImplementation::FiniteElementRelatedData<dim, |
| 520 |
spacedim> |
| 521 |
&output_data) const override; |
| 522 |
|
| 523 |
virtual void |
| 524 |
fill_fe_values( |
| 525 |
const typename Triangulation<dim, spacedim>::cell_iterator &cell, |
| 526 |
const CellSimilarity::Similarity cell_similarity, |
| 527 |
const Quadrature<dim> &quadrature, |
| 528 |
const Mapping<dim, spacedim> &mapping, |
| 529 |
const typename Mapping<dim, spacedim>::InternalDataBase &mapping_internal, |
| 530 |
const internal::FEValuesImplementation::MappingRelatedData<dim, spacedim> |
| 531 |
&mapping_data, |
| 532 |
const typename FiniteElement<dim, spacedim>::InternalDataBase &fe_internal, |
| 533 |
dealii::internal::FEValuesImplementation::FiniteElementRelatedData<dim, |
| 534 |
spacedim> |
| 535 |
&output_data) const override; |
| 536 |
|
| 537 |
using FiniteElement<dim, spacedim>::fill_fe_face_values; |
| 538 |
|
| 539 |
virtual void |
| 540 |
fill_fe_face_values( |
| 541 |
const typename Triangulation<dim, spacedim>::cell_iterator &cell, |
| 542 |
const unsigned int face_no, |
| 543 |
const hp::QCollection<dim - 1> &quadrature, |
| 544 |
const Mapping<dim, spacedim> &mapping, |
| 545 |
const typename Mapping<dim, spacedim>::InternalDataBase &mapping_internal, |
| 546 |
const internal::FEValuesImplementation::MappingRelatedData<dim, spacedim> |
| 547 |
&mapping_data, |
| 548 |
const typename FiniteElement<dim, spacedim>::InternalDataBase &fe_internal, |
| 549 |
dealii::internal::FEValuesImplementation::FiniteElementRelatedData<dim, |
| 550 |
spacedim> |
| 551 |
&output_data) const override; |
| 552 |
|
| 553 |
virtual void |
| 554 |
fill_fe_subface_values( |
| 555 |
const typename Triangulation<dim, spacedim>::cell_iterator &cell, |
| 556 |
const unsigned int face_no, |
| 557 |
const unsigned int sub_no, |
| 558 |
const Quadrature<dim - 1> &quadrature, |
| 559 |
const Mapping<dim, spacedim> &mapping, |
| 560 |
const typename Mapping<dim, spacedim>::InternalDataBase &mapping_internal, |
| 561 |
const internal::FEValuesImplementation::MappingRelatedData<dim, spacedim> |
| 562 |
&mapping_data, |
| 563 |
const typename FiniteElement<dim, spacedim>::InternalDataBase &fe_internal, |
| 564 |
dealii::internal::FEValuesImplementation::FiniteElementRelatedData<dim, |
| 565 |
spacedim> |
| 566 |
&output_data) const override; |
| 567 |
|
| 568 |
private: |
| 569 |
/** |
| 570 |
* Only for internal use. Its full name is @p get_dofs_per_object_vector |
| 571 |
* function and it creates the @p dofs_per_object vector that is needed |
| 572 |
* within the constructor to be passed to the constructor of @p |
| 573 |
* FiniteElementData. |
| 574 |
*/ |
| 575 |
static std::vector<unsigned int> |
| 576 |
get_dpo_vector(const unsigned int degree); |
| 577 |
|
| 578 |
/** |
| 579 |
* Pointer to an object representing the polynomial space used here. |
| 580 |
*/ |
| 581 |
const PolynomialSpace<dim> polynomial_space; |
| 582 |
|
| 583 |
// Allow access from other dimensions. |
| 584 |
template <int, int> |
| 585 |
friend class FE_DGPNonparametric; |
| 586 |
}; |
| 587 |
|
| 588 |
/** @} */ |
| 589 |
|
| 590 |
DEAL_II_NAMESPACE_CLOSE |
| 591 |
|
| 592 |
#endif |