| 1 |
// ------------------------------------------------------------------------ |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: LGPL-2.1-or-later |
| 4 |
// Copyright (C) 2010 - 2024 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_dg_vector_templates_h |
| 16 |
#define dealii_fe_dg_vector_templates_h |
| 17 |
|
| 18 |
|
| 19 |
#include <deal.II/base/config.h> |
| 20 |
|
| 21 |
#include <deal.II/base/quadrature_lib.h> |
| 22 |
|
| 23 |
#include <deal.II/fe/fe_dg_vector.h> |
| 24 |
#include <deal.II/fe/fe_tools.h> |
| 25 |
|
| 26 |
#include <memory> |
| 27 |
|
| 28 |
DEAL_II_NAMESPACE_OPEN |
| 29 |
|
| 30 |
|
| 31 |
// TODO:[GK] deg+1 is wrong here and should be fixed after FiniteElementData was |
| 32 |
// cleaned up |
| 33 |
|
| 34 |
template <typename PolynomialType, int dim, int spacedim> |
| 35 |
FE_DGVector<PolynomialType, dim, spacedim>::FE_DGVector(const unsigned int deg, |
| 36 |
MappingKind map) |
| 37 |
: FE_PolyTensor<dim, spacedim>( |
| 38 |
PolynomialType(deg), |
| 39 |
FiniteElementData<dim>(get_dpo_vector(deg), |
| 40 |
dim, |
| 41 |
deg + 1, |
| 42 |
FiniteElementData<dim>::L2), |
| 43 |
std::vector<bool>(PolynomialType::n_polynomials(deg), true), |
| 44 |
std::vector<ComponentMask>(PolynomialType::n_polynomials(deg), |
| 45 |
ComponentMask(dim, true))) |
| 46 |
{ |
| 47 |
this->mapping_kind = {map}; |
| 48 |
const unsigned int polynomial_degree = this->tensor_degree(); |
| 49 |
|
| 50 |
QGauss<dim> quadrature(polynomial_degree + 1); |
| 51 |
this->generalized_support_points = quadrature.get_points(); |
| 52 |
|
| 53 |
this->reinit_restriction_and_prolongation_matrices(true, true); |
| 54 |
FETools::compute_projection_matrices(*this, this->restriction, true); |
| 55 |
FETools::compute_embedding_matrices(*this, this->prolongation, true); |
| 56 |
} |
| 57 |
|
| 58 |
|
| 59 |
template <typename PolynomialType, int dim, int spacedim> |
| 60 |
std::unique_ptr<FiniteElement<dim, spacedim>> |
| 61 |
FE_DGVector<PolynomialType, dim, spacedim>::clone() const |
| 62 |
{ |
| 63 |
return std::make_unique<FE_DGVector<PolynomialType, dim, spacedim>>(*this); |
| 64 |
} |
| 65 |
|
| 66 |
|
| 67 |
template <typename PolynomialType, int dim, int spacedim> |
| 68 |
std::string |
| 69 |
FE_DGVector<PolynomialType, dim, spacedim>::get_name() const |
| 70 |
{ |
| 71 |
std::ostringstream namebuf; |
| 72 |
namebuf << "FE_DGVector_" << this->poly_space->name() << '<' << dim << ">(" |
| 73 |
<< this->degree - 1 << ')'; |
| 74 |
return namebuf.str(); |
| 75 |
} |
| 76 |
|
| 77 |
|
| 78 |
template <typename PolynomialType, int dim, int spacedim> |
| 79 |
std::vector<unsigned int> |
| 80 |
FE_DGVector<PolynomialType, dim, spacedim>::get_dpo_vector( |
| 81 |
const unsigned int deg) |
| 82 |
{ |
| 83 |
std::vector<unsigned int> dpo(dim + 1); |
| 84 |
dpo[dim] = PolynomialType::n_polynomials(deg); |
| 85 |
|
| 86 |
return dpo; |
| 87 |
} |
| 88 |
|
| 89 |
|
| 90 |
template <typename PolynomialType, int dim, int spacedim> |
| 91 |
bool |
| 92 |
FE_DGVector<PolynomialType, dim, spacedim>::has_support_on_face( |
| 93 |
const unsigned int, |
| 94 |
const unsigned int) const |
| 95 |
{ |
| 96 |
return true; |
| 97 |
} |
| 98 |
|
| 99 |
|
| 100 |
template <typename PolynomialType, int dim, int spacedim> |
| 101 |
std::size_t |
| 102 |
FE_DGVector<PolynomialType, dim, spacedim>::memory_consumption() const |
| 103 |
{ |
| 104 |
DEAL_II_NOT_IMPLEMENTED(); |
| 105 |
return 0; |
| 106 |
} |
| 107 |
|
| 108 |
DEAL_II_NAMESPACE_CLOSE |
| 109 |
|
| 110 |
#endif |