deal.II version GIT relicensing-2369-g11de1c533e 2025-01-16 20:50:00+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
fe.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 1998 - 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_h
16#define dealii_fe_h
17
18#include <deal.II/base/config.h>
19
22#include <deal.II/fe/fe_data.h>
25#include <deal.II/fe/mapping.h>
27
29#include <deal.II/lac/vector.h>
30
31#include <memory>
32
33
35
36// Forward declarations:
37#ifndef DOXYGEN
38template <int dim, int spacedim>
39class FEValuesBase;
40template <int dim, int spacedim>
41class FEValues;
42template <int dim, int spacedim>
43class FEFaceValues;
44template <int dim, int spacedim>
45class FESubfaceValues;
46namespace NonMatching
47{
48 template <int dim>
49 class FEImmersedSurfaceValues;
50}
51template <int dim, int spacedim>
52class FESystem;
53#endif
54
653template <int dim, int spacedim = dim>
655 public FiniteElementData<dim>
656{
657public:
661 static constexpr unsigned int space_dimension = spacedim;
662
688 {
689 public:
695
699 virtual ~InternalDataBase() = default;
700
705
721
725 virtual std::size_t
727 };
728
729public:
773 const std::vector<bool> &restriction_is_additive_flags,
774 const std::vector<ComponentMask> &nonzero_components);
775
780
785
790 virtual ~FiniteElement() override = default;
791
800 std::pair<std::unique_ptr<FiniteElement<dim, spacedim>>, unsigned int>
801 operator^(const unsigned int multiplicity) const;
802
814 virtual std::unique_ptr<FiniteElement<dim, spacedim>>
815 clone() const = 0;
816
827 virtual std::string
828 get_name() const = 0;
829
855 virtual double
856 shape_value(const unsigned int i, const Point<dim> &p) const;
857
864 virtual double
865 shape_value_component(const unsigned int i,
866 const Point<dim> &p,
867 const unsigned int component) const;
868
890 virtual Tensor<1, dim>
891 shape_grad(const unsigned int i, const Point<dim> &p) const;
892
899 virtual Tensor<1, dim>
900 shape_grad_component(const unsigned int i,
901 const Point<dim> &p,
902 const unsigned int component) const;
903
925 virtual Tensor<2, dim>
926 shape_grad_grad(const unsigned int i, const Point<dim> &p) const;
927
934 virtual Tensor<2, dim>
935 shape_grad_grad_component(const unsigned int i,
936 const Point<dim> &p,
937 const unsigned int component) const;
938
960 virtual Tensor<3, dim>
961 shape_3rd_derivative(const unsigned int i, const Point<dim> &p) const;
962
970 virtual Tensor<3, dim>
971 shape_3rd_derivative_component(const unsigned int i,
972 const Point<dim> &p,
973 const unsigned int component) const;
974
996 virtual Tensor<4, dim>
997 shape_4th_derivative(const unsigned int i, const Point<dim> &p) const;
998
1006 virtual Tensor<4, dim>
1008 const Point<dim> &p,
1009 const unsigned int component) const;
1020 virtual bool
1021 has_support_on_face(const unsigned int shape_index,
1022 const unsigned int face_index) const;
1023
1060 virtual const FullMatrix<double> &
1061 get_restriction_matrix(const unsigned int child,
1062 const RefinementCase<dim> &refinement_case =
1064
1094 virtual const FullMatrix<double> &
1095 get_prolongation_matrix(const unsigned int child,
1096 const RefinementCase<dim> &refinement_case =
1098
1120 bool
1122
1138 bool
1140
1162 bool
1164
1180 bool
1182
1183
1192 bool
1193 restriction_is_additive(const unsigned int index) const;
1194
1206 const FullMatrix<double> &
1207 constraints(const ::internal::SubfaceCase<dim> &subface_case =
1209
1225 bool
1227 const ::internal::SubfaceCase<dim> &subface_case =
1229
1230
1252 virtual bool
1254
1255
1267 virtual void
1269 FullMatrix<double> &matrix) const;
1289 virtual void
1291 FullMatrix<double> &matrix,
1292 const unsigned int face_no = 0) const;
1293
1294
1306 virtual void
1308 const unsigned int subface,
1309 FullMatrix<double> &matrix,
1310 const unsigned int face_no = 0) const;
1334 virtual std::vector<std::pair<unsigned int, unsigned int>>
1336
1341 virtual std::vector<std::pair<unsigned int, unsigned int>>
1343
1348 virtual std::vector<std::pair<unsigned int, unsigned int>>
1350 const unsigned int face_no = 0) const;
1351
1369 const unsigned int codim = 0) const;
1370
1403 virtual bool
1405
1410 bool
1412
1448 std::pair<unsigned int, unsigned int>
1449 system_to_component_index(const unsigned int index) const;
1450
1460 unsigned int
1461 component_to_system_index(const unsigned int component,
1462 const unsigned int index) const;
1463
1473 std::pair<unsigned int, unsigned int>
1474 face_system_to_component_index(const unsigned int index,
1475 const unsigned int face_no = 0) const;
1476
1483 unsigned int
1485 const unsigned int index,
1486 const unsigned int face_no,
1487 const types::geometric_orientation combined_orientation) const;
1488
1536 virtual unsigned int
1538 const unsigned int face_dof_index,
1539 const unsigned int face,
1540 const types::geometric_orientation combined_orientation =
1542
1552 unsigned int
1554 const unsigned int index,
1555 const types::geometric_orientation combined_orientation) const;
1556
1573 const ComponentMask &
1574 get_nonzero_components(const unsigned int i) const;
1575
1586 unsigned int
1587 n_nonzero_components(const unsigned int i) const;
1588
1597 bool
1599
1610 bool
1611 is_primitive(const unsigned int i) const;
1612
1629 virtual const Table<2, bool> &
1631
1643 unsigned int
1645
1650 virtual const FiniteElement<dim, spacedim> &
1651 base_element(const unsigned int index) const;
1652
1659 unsigned int
1660 element_multiplicity(const unsigned int index) const;
1661
1735 get_sub_fe(const ComponentMask &mask) const;
1736
1745 virtual const FiniteElement<dim, spacedim> &
1746 get_sub_fe(const unsigned int first_component,
1747 const unsigned int n_selected_components) const;
1748
1771 std::pair<std::pair<unsigned int, unsigned int>, unsigned int>
1772 system_to_base_index(const unsigned int index) const;
1773
1782 std::pair<std::pair<unsigned int, unsigned int>, unsigned int>
1783 face_system_to_base_index(const unsigned int index,
1784 const unsigned int face_no = 0) const;
1785
1791 first_block_of_base(const unsigned int b) const;
1792
1805 std::pair<unsigned int, unsigned int>
1806 component_to_base_index(const unsigned int component) const;
1807
1808
1813 std::pair<unsigned int, unsigned int>
1814 block_to_base_index(const unsigned int block) const;
1815
1819 std::pair<unsigned int, types::global_dof_index>
1820 system_to_block_index(const unsigned int component) const;
1821
1825 unsigned int
1826 component_to_block_index(const unsigned int component) const;
1827
1843 bool
1844 shape_function_belongs_to(const unsigned int shape_function,
1845 const FEValuesExtractors::Scalar &component) const;
1846
1862 bool
1863 shape_function_belongs_to(const unsigned int shape_function,
1865
1866
1882 bool
1884 const unsigned int shape_function,
1886
1887
1898 bool
1900 const unsigned int shape_function,
1923
1938
1954 const FEValuesExtractors::SymmetricTensor<2> &sym_tensor) const;
1955
1972
1993 BlockMask
1995
2012 BlockMask
2014
2032 BlockMask
2034
2057 BlockMask
2059
2075 virtual std::pair<Table<2, bool>, std::vector<unsigned int>>
2077
2115 const std::vector<Point<dim>> &
2117
2144 bool
2146
2159 virtual Point<dim>
2160 unit_support_point(const unsigned int index) const;
2161
2188 const std::vector<Point<dim - 1>> &
2189 get_unit_face_support_points(const unsigned int face_no = 0) const;
2190
2202 bool
2203 has_face_support_points(const unsigned int face_no = 0) const;
2204
2209 virtual Point<dim - 1>
2210 unit_face_support_point(const unsigned int index,
2211 const unsigned int face_no = 0) const;
2212
2240 const std::vector<Point<dim>> &
2242
2257 bool
2259
2306 get_associated_geometry_primitive(const unsigned int cell_dof_index) const;
2307
2308
2386 virtual void
2388 const std::vector<Vector<double>> &support_point_values,
2389 std::vector<double> &nodal_values) const;
2390
2401 virtual std::size_t
2403
2410 int,
2411 << "The shape function with index " << arg1
2412 << " is not primitive, i.e. it is vector-valued and "
2413 << "has more than one non-zero vector component. This "
2414 << "function cannot be called for these shape functions. "
2415 << "Maybe you want to use the same function with the "
2416 << "_component suffix?");
2430 "You are trying to access the values or derivatives of shape functions "
2431 "on the reference cell of an element that does not define its shape "
2432 "functions through mapping from the reference cell. Consequently, "
2433 "you cannot ask for shape function values or derivatives on the "
2434 "reference cell.");
2435
2443 "You are trying to access the support points of a finite "
2444 "element that either has no support points at all, or for "
2445 "which the corresponding tables have not been implemented.");
2446
2454 "You are trying to access the matrices that describe how "
2455 "to embed a finite element function on one cell into the "
2456 "finite element space on one of its children (i.e., the "
2457 "'embedding' or 'prolongation' matrices). However, the "
2458 "current finite element can either not define this sort of "
2459 "operation, or it has not yet been implemented.");
2460
2469 "You are trying to access the matrices that describe how "
2470 "to restrict a finite element function from the children "
2471 "of one cell to the finite element space defined on their "
2472 "parent (i.e., the 'restriction' or 'projection' matrices). "
2473 "However, the current finite element can either not define "
2474 "this sort of operation, or it has not yet been "
2475 "implemented.");
2476
2482 int,
2483 int,
2484 << "The interface matrix has a size of " << arg1 << 'x' << arg2
2485 << ", which is not reasonable for the current element "
2486 "in the present dimension.");
2492
2493protected:
2507 void
2509 const bool isotropic_restriction_only = false,
2510 const bool isotropic_prolongation_only = false);
2511
2524 std::vector<std::vector<FullMatrix<double>>> restriction;
2525
2538 std::vector<std::vector<FullMatrix<double>>> prolongation;
2539
2551
2562 std::vector<Point<dim>> unit_support_points;
2563
2569 std::vector<std::vector<Point<dim - 1>>> unit_face_support_points;
2570
2575 std::vector<Point<dim>> generalized_support_points;
2576
2581 std::vector<std::vector<Point<dim - 1>>> generalized_face_support_points;
2582
2599
2612
2616 std::vector<std::pair<unsigned int, unsigned int>> system_to_component_table;
2617
2627 std::vector<std::vector<std::pair<unsigned int, unsigned int>>>
2629
2646 std::vector<std::pair<std::pair<unsigned int, unsigned int>, unsigned int>>
2648
2652 std::vector<
2653 std::vector<std::pair<std::pair<unsigned int, unsigned int>, unsigned int>>>
2655
2661
2682 std::vector<std::pair<std::pair<unsigned int, unsigned int>, unsigned int>>
2684
2690 const std::vector<bool> restriction_is_additive_flags;
2691
2699 const std::vector<ComponentMask> nonzero_components;
2700
2708 const std::vector<unsigned int> n_nonzero_components_table;
2709
2716
2724
2739
2745 static std::vector<unsigned int>
2747 const std::vector<ComponentMask> &nonzero_components);
2748
2769 virtual UpdateFlags
2770 requires_update_flags(const UpdateFlags update_flags) const = 0;
2771
2849 virtual std::unique_ptr<InternalDataBase>
2850 get_data(const UpdateFlags update_flags,
2851 const Mapping<dim, spacedim> &mapping,
2852 const Quadrature<dim> &quadrature,
2853 ::internal::FEValuesImplementation::
2854 FiniteElementRelatedData<dim, spacedim> &output_data) const = 0;
2855
2898 virtual std::unique_ptr<InternalDataBase>
2899 get_face_data(const UpdateFlags update_flags,
2900 const Mapping<dim, spacedim> &mapping,
2901 const hp::QCollection<dim - 1> &quadrature,
2902 ::internal::FEValuesImplementation::
2903 FiniteElementRelatedData<dim, spacedim> &output_data) const;
2904
2908 virtual std::unique_ptr<InternalDataBase>
2910 const UpdateFlags update_flags,
2911 const Mapping<dim, spacedim> &mapping,
2912 const Quadrature<dim - 1> &quadrature,
2914 &output_data) const;
2915
2959 virtual std::unique_ptr<InternalDataBase>
2961 const UpdateFlags update_flags,
2962 const Mapping<dim, spacedim> &mapping,
2963 const Quadrature<dim - 1> &quadrature,
2965 spacedim>
2966 &output_data) const;
2967
3048 virtual void
3051 const CellSimilarity::Similarity cell_similarity,
3052 const Quadrature<dim> &quadrature,
3053 const Mapping<dim, spacedim> &mapping,
3054 const typename Mapping<dim, spacedim>::InternalDataBase &mapping_internal,
3056 &mapping_data,
3057 const InternalDataBase &fe_internal,
3059 spacedim>
3060 &output_data) const = 0;
3061
3104 virtual void
3107 const unsigned int face_no,
3108 const hp::QCollection<dim - 1> &quadrature,
3109 const Mapping<dim, spacedim> &mapping,
3110 const typename Mapping<dim, spacedim>::InternalDataBase &mapping_internal,
3112 &mapping_data,
3113 const InternalDataBase &fe_internal,
3115 spacedim>
3116 &output_data) const;
3117
3121 virtual void
3124 const unsigned int face_no,
3125 const Quadrature<dim - 1> &quadrature,
3126 const Mapping<dim, spacedim> &mapping,
3127 const typename Mapping<dim, spacedim>::InternalDataBase &mapping_internal,
3129 &mapping_data,
3130 const InternalDataBase &fe_internal,
3132 &output_data) const;
3133
3179 virtual void
3182 const unsigned int face_no,
3183 const unsigned int sub_no,
3184 const Quadrature<dim - 1> &quadrature,
3185 const Mapping<dim, spacedim> &mapping,
3186 const typename Mapping<dim, spacedim>::InternalDataBase &mapping_internal,
3188 &mapping_data,
3189 const InternalDataBase &fe_internal,
3191 spacedim>
3192 &output_data) const = 0;
3193
3194 friend class InternalDataBase;
3195 friend class FEValuesBase<dim, spacedim>;
3196 friend class FEValues<dim, spacedim>;
3197 friend class FEFaceValues<dim, spacedim>;
3198 friend class FESubfaceValues<dim, spacedim>;
3199 friend class NonMatching::FEImmersedSurfaceValues<dim>;
3200 friend class FESystem<dim, spacedim>;
3201
3202 // explicitly check for sensible template arguments, but not on windows
3203 // because MSVC creates bogus warnings during normal compilation
3204#ifndef DEAL_II_MSVC
3205 static_assert(dim <= spacedim,
3206 "The dimension <dim> of a FiniteElement must be less than or "
3207 "equal to the space dimension <spacedim> in which it lives.");
3208#endif
3209};
3210
3211
3212//----------------------------------------------------------------------//
3213#ifndef DOXYGEN
3214
3215template <int dim, int spacedim>
3216inline std::pair<unsigned int, unsigned int>
3218 const unsigned int index) const
3219{
3221 Assert(is_primitive(index),
3223 index)));
3224 return system_to_component_table[index];
3225}
3226
3227
3228
3229template <int dim, int spacedim>
3230inline unsigned int
3232{
3233 return base_to_block_indices.size();
3234}
3235
3236
3237
3238template <int dim, int spacedim>
3239inline unsigned int
3241 const unsigned int index) const
3242{
3243 return static_cast<unsigned int>(base_to_block_indices.block_size(index));
3244}
3245
3246
3247
3248template <int dim, int spacedim>
3249inline unsigned int
3251 const unsigned int component,
3252 const unsigned int index) const
3253{
3254 AssertIndexRange(component, this->n_components());
3255 const std::vector<std::pair<unsigned int, unsigned int>>::const_iterator it =
3256 std::find(system_to_component_table.begin(),
3258 std::pair<unsigned int, unsigned int>(component, index));
3259
3261 ExcMessage("You are asking for the number of the shape function "
3262 "within a system element that corresponds to vector "
3263 "component " +
3264 Utilities::int_to_string(component) +
3265 " and within this to "
3266 "index " +
3268 ". But no such "
3269 "shape function exists."));
3270 return std::distance(system_to_component_table.begin(), it);
3271}
3272
3273
3274
3275template <int dim, int spacedim>
3276inline std::pair<unsigned int, unsigned int>
3278 const unsigned int index,
3279 const unsigned int face_no) const
3280{
3282 index,
3283 face_system_to_component_table[this->n_unique_faces() == 1 ? 0 : face_no]
3284 .size());
3285
3286 // in debug mode, check whether the
3287 // function is primitive, since
3288 // otherwise the result may have no
3289 // meaning
3290 //
3291 // since the primitivity tables are
3292 // all geared towards cell dof
3293 // indices, rather than face dof
3294 // indices, we have to work a
3295 // little bit...
3296 //
3297 // in 1d, the face index is equal
3298 // to the cell index
3299 Assert(is_primitive(this->face_to_cell_index(index, face_no)),
3301 index)));
3302
3304 0 :
3305 face_no][index];
3306}
3307
3308
3309
3310template <int dim, int spacedim>
3311inline std::pair<std::pair<unsigned int, unsigned int>, unsigned int>
3313 const unsigned int index) const
3314{
3317}
3318
3319
3320
3321template <int dim, int spacedim>
3322inline std::pair<std::pair<unsigned int, unsigned int>, unsigned int>
3324 const unsigned int index,
3325 const unsigned int face_no) const
3326{
3328 index,
3329 face_system_to_base_table[this->n_unique_faces() == 1 ? 0 : face_no]
3330 .size());
3331 return face_system_to_base_table[this->n_unique_faces() == 1 ? 0 : face_no]
3332 [index];
3333}
3334
3335
3336
3337template <int dim, int spacedim>
3340 const unsigned int index) const
3341{
3342 return base_to_block_indices.block_start(index);
3343}
3344
3345
3346
3347template <int dim, int spacedim>
3348inline std::pair<unsigned int, unsigned int>
3350 const unsigned int index) const
3351{
3353
3354 return component_to_base_table[index].first;
3355}
3356
3357
3358
3359template <int dim, int spacedim>
3360inline std::pair<unsigned int, unsigned int>
3362 const unsigned int index) const
3363{
3365}
3366
3367
3368
3369template <int dim, int spacedim>
3370inline std::pair<unsigned int, types::global_dof_index>
3372 const unsigned int index) const
3373{
3374 AssertIndexRange(index, this->n_dofs_per_cell());
3375 // The block is computed simply as
3376 // first block of this base plus
3377 // the index within the base blocks
3378 return std::pair<unsigned int, types::global_dof_index>(
3380 system_to_base_table[index].first.second,
3381 system_to_base_table[index].second);
3382}
3383
3384
3385
3386template <int dim, int spacedim>
3387inline bool
3389 const unsigned int shape_function,
3390 const FEValuesExtractors::Scalar &component) const
3391{
3392 AssertIndexRange(shape_function, this->n_dofs_per_cell());
3393 AssertIndexRange(component.component, this->n_components());
3394
3395 if (is_primitive(shape_function))
3396 return (system_to_component_table[shape_function].first ==
3397 component.component);
3398 else
3399 return nonzero_components[shape_function][component.component];
3400}
3401
3402
3403
3404template <int dim, int spacedim>
3405inline bool
3407 const unsigned int shape_function,
3409{
3410 AssertIndexRange(shape_function, this->n_dofs_per_cell());
3411 AssertIndexRange(components.first_vector_component, this->n_components());
3412 AssertIndexRange(components.first_vector_component + dim,
3413 this->n_components() + 1);
3414
3415 if (is_primitive(shape_function))
3416 return ((system_to_component_table[shape_function].first >=
3417 components.first_vector_component) &&
3418 (system_to_component_table[shape_function].first <
3419 components.first_vector_component + dim));
3420 else
3421 // Return whether there is overlap between the nonzero components
3422 // of the current shape function and the selected components of
3423 // the extractor:
3424 {
3425 for (unsigned int i = components.first_vector_component;
3426 i < components.first_vector_component + dim;
3427 ++i)
3428 if (nonzero_components[shape_function][i])
3429 return true;
3430 return false;
3431 }
3432}
3433
3434
3435
3436template <int dim, int spacedim>
3437inline bool
3439 const unsigned int shape_function,
3441{
3442 AssertIndexRange(shape_function, this->n_dofs_per_cell());
3443 AssertIndexRange(components.first_tensor_component, this->n_components());
3444 AssertIndexRange(components.first_tensor_component + dim,
3445 this->n_components() + 1);
3446
3447 if (is_primitive(shape_function))
3448 return ((system_to_component_table[shape_function].first >=
3449 components.first_tensor_component) &&
3450 (system_to_component_table[shape_function].first <
3451 components.first_tensor_component +
3453 else
3454 // Return whether there is overlap between the nonzero components
3455 // of the current shape function and the selected components of
3456 // the extractor:
3457 {
3458 for (unsigned int i = components.first_tensor_component;
3459 i < components.first_tensor_component +
3461 ++i)
3462 if (nonzero_components[shape_function][i])
3463 return true;
3464 return false;
3465 }
3466}
3467
3468
3469
3470template <int dim, int spacedim>
3471inline bool
3473 const unsigned int shape_function,
3475{
3476 AssertIndexRange(shape_function, this->n_dofs_per_cell());
3477 AssertIndexRange(components.first_tensor_component, this->n_components());
3478 AssertIndexRange(components.first_tensor_component + dim,
3479 this->n_components() + 1);
3480
3481 if (is_primitive(shape_function))
3482 return ((system_to_component_table[shape_function].first >=
3483 components.first_tensor_component) &&
3484 (system_to_component_table[shape_function].first <
3485 components.first_tensor_component +
3487 else
3488 // Return whether there is overlap between the nonzero components
3489 // of the current shape function and the selected components of
3490 // the extractor:
3491 {
3492 for (unsigned int i = components.first_tensor_component;
3493 i < components.first_tensor_component +
3495 ++i)
3496 if (nonzero_components[shape_function][i])
3497 return true;
3498 return false;
3499 }
3500}
3501
3502
3503
3504template <int dim, int spacedim>
3505inline bool
3507 const unsigned int index) const
3508{
3509 AssertIndexRange(index, this->n_dofs_per_cell());
3510 return restriction_is_additive_flags[index];
3511}
3512
3513
3514
3515template <int dim, int spacedim>
3516inline const ComponentMask &
3518{
3520 return nonzero_components[i];
3521}
3522
3523
3524
3525template <int dim, int spacedim>
3526inline unsigned int
3528{
3530 return n_nonzero_components_table[i];
3531}
3532
3533
3534
3535template <int dim, int spacedim>
3536inline bool
3538{
3539 return cached_primitivity;
3540}
3541
3542
3543
3544template <int dim, int spacedim>
3545inline bool
3546FiniteElement<dim, spacedim>::is_primitive(const unsigned int i) const
3547{
3549
3550 // return primitivity of a shape
3551 // function by checking whether it
3552 // has more than one non-zero
3553 // component or not. we could cache
3554 // this value in an array of bools,
3555 // but accessing a bit-vector (as
3556 // std::vector<bool> is) is
3557 // probably more expensive than
3558 // just comparing against 1
3559 //
3560 // for good measure, short circuit the test
3561 // if the entire FE is primitive
3562 return (is_primitive() || (n_nonzero_components_table[i] == 1));
3563}
3564
3565
3566
3567template <int dim, int spacedim>
3568inline const Table<2, bool> &
3570{
3572}
3573
3574
3575
3576template <int dim, int spacedim>
3577inline GeometryPrimitive
3579 const unsigned int cell_dof_index) const
3580{
3581 AssertIndexRange(cell_dof_index, this->n_dofs_per_cell());
3582
3583 // just go through the usual cases, taking into account how DoFs
3584 // are enumerated on the reference cell
3585 if (cell_dof_index < this->get_first_line_index())
3587 else if (cell_dof_index < this->get_first_quad_index(0))
3589 else if (cell_dof_index < this->get_first_hex_index())
3591 else
3593}
3594
3595#endif
3596
3598
3599#endif
size_type block_size(const unsigned int i) const
unsigned int size() const
size_type block_start(const unsigned int i) const
std::pair< unsigned int, size_type > global_to_local(const size_type i) const
virtual unsigned int face_to_cell_index(const unsigned int face_dof_index, const unsigned int face, const types::geometric_orientation combined_orientation=ReferenceCell::default_combined_face_orientation()) const override
unsigned int get_first_line_index() const
const unsigned int components
Definition fe_data.h:446
unsigned int n_dofs_per_cell() const
unsigned int get_first_quad_index(const unsigned int quad_no=0) const
unsigned int n_components() const
unsigned int n_unique_faces() const
unsigned int get_first_hex_index() const
virtual ~InternalDataBase()=default
InternalDataBase(const InternalDataBase &)=delete
virtual std::size_t memory_consumption() const
bool constraints_are_implemented(const ::internal::SubfaceCase< dim > &subface_case=::internal::SubfaceCase< dim >::case_isotropic) const
bool shape_function_belongs_to(const unsigned int shape_function, const FEValuesExtractors::Vector &components) const
std::pair< unsigned int, types::global_dof_index > system_to_block_index(const unsigned int component) const
bool isotropic_prolongation_is_implemented() const
virtual std::string get_name() const =0
virtual Point< dim > unit_support_point(const unsigned int index) const
virtual FiniteElementDomination::Domination compare_for_domination(const FiniteElement< dim, spacedim > &fe_other, const unsigned int codim=0) const
const std::vector< unsigned int > n_nonzero_components_table
Definition fe.h:2708
virtual std::unique_ptr< InternalDataBase > get_data(const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const Quadrature< dim > &quadrature, ::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &output_data) const =0
virtual const FullMatrix< double > & get_restriction_matrix(const unsigned int child, const RefinementCase< dim > &refinement_case=RefinementCase< dim >::isotropic_refinement) const
const ComponentMask & get_nonzero_components(const unsigned int i) const
virtual void fill_fe_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const CellSimilarity::Similarity cell_similarity, const Quadrature< dim > &quadrature, const Mapping< dim, spacedim > &mapping, const typename Mapping< dim, spacedim >::InternalDataBase &mapping_internal, const internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &mapping_data, const InternalDataBase &fe_internal, ::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &output_data) const =0
std::vector< std::vector< Point< dim - 1 > > > unit_face_support_points
Definition fe.h:2569
bool prolongation_is_implemented() const
virtual std::pair< Table< 2, bool >, std::vector< unsigned int > > get_constant_modes() const
virtual const FiniteElement< dim, spacedim > & base_element(const unsigned int index) const
ComponentMask component_mask(const BlockMask &block_mask) const
virtual Tensor< 1, dim > shape_grad(const unsigned int i, const Point< dim > &p) const
ComponentMask component_mask(const FEValuesExtractors::SymmetricTensor< 2 > &sym_tensor) const
virtual std::unique_ptr< InternalDataBase > get_face_data(const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const hp::QCollection< dim - 1 > &quadrature, ::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &output_data) const
std::pair< unsigned int, unsigned int > component_to_base_index(const unsigned int component) const
virtual Point< dim - 1 > unit_face_support_point(const unsigned int index, const unsigned int face_no=0) const
bool is_primitive(const unsigned int i) const
static std::vector< unsigned int > compute_n_nonzero_components(const std::vector< ComponentMask > &nonzero_components)
virtual std::unique_ptr< InternalDataBase > get_subface_data(const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const Quadrature< dim - 1 > &quadrature, ::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &output_data) const
bool shape_function_belongs_to(const unsigned int shape_function, const FEValuesExtractors::Scalar &component) const
bool has_face_support_points(const unsigned int face_no=0) const
const bool cached_primitivity
Definition fe.h:2715
virtual const FiniteElement< dim, spacedim > & get_sub_fe(const unsigned int first_component, const unsigned int n_selected_components) const
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_quad_dof_identities(const FiniteElement< dim, spacedim > &fe_other, const unsigned int face_no=0) const
ComponentMask component_mask(const FEValuesExtractors::Scalar &scalar) const
bool operator!=(const FiniteElement< dim, spacedim > &) const
ComponentMask component_mask(const FEValuesExtractors::Vector &vector) const
bool has_support_points() const
std::vector< std::vector< FullMatrix< double > > > restriction
Definition fe.h:2524
bool has_generalized_support_points() const
virtual std::unique_ptr< FiniteElement< dim, spacedim > > clone() const =0
virtual Tensor< 2, dim > shape_grad_grad(const unsigned int i, const Point< dim > &p) const
std::vector< Table< 2, int > > adjust_quad_dof_index_for_face_orientation_table
Definition fe.h:2598
virtual bool operator==(const FiniteElement< dim, spacedim > &fe) const
bool shape_function_belongs_to(const unsigned int shape_function, const FEValuesExtractors::SymmetricTensor< 2 > &components) const
const std::vector< Point< dim > > & get_unit_support_points() const
virtual void fill_fe_face_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const hp::QCollection< dim - 1 > &quadrature, const Mapping< dim, spacedim > &mapping, const typename Mapping< dim, spacedim >::InternalDataBase &mapping_internal, const internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &mapping_data, const InternalDataBase &fe_internal, ::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &output_data) const
static constexpr unsigned int space_dimension
Definition fe.h:661
BlockIndices base_to_block_indices
Definition fe.h:2660
bool is_primitive() const
void reinit_restriction_and_prolongation_matrices(const bool isotropic_restriction_only=false, const bool isotropic_prolongation_only=false)
const std::vector< Point< dim - 1 > > & get_unit_face_support_points(const unsigned int face_no=0) const
bool isotropic_restriction_is_implemented() const
std::vector< std::vector< Point< dim - 1 > > > generalized_face_support_points
Definition fe.h:2581
std::pair< unsigned int, unsigned int > block_to_base_index(const unsigned int block) const
std::vector< int > adjust_line_dof_index_for_line_orientation_table
Definition fe.h:2611
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const
bool restriction_is_additive(const unsigned int index) const
virtual void fill_fe_subface_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const unsigned int sub_no, const Quadrature< dim - 1 > &quadrature, const Mapping< dim, spacedim > &mapping, const typename Mapping< dim, spacedim >::InternalDataBase &mapping_internal, const internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &mapping_data, const InternalDataBase &fe_internal, ::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &output_data) const =0
const FiniteElement< dim, spacedim > & get_sub_fe(const ComponentMask &mask) const
virtual Tensor< 4, dim > shape_4th_derivative_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
virtual double shape_value_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
unsigned int adjust_quad_dof_index_for_face_orientation(const unsigned int index, const unsigned int face_no, const types::geometric_orientation combined_orientation) const
FiniteElement(const FiniteElement< dim, spacedim > &)=default
virtual void get_subface_interpolation_matrix(const FiniteElement< dim, spacedim > &source, const unsigned int subface, FullMatrix< double > &matrix, const unsigned int face_no=0) const
unsigned int component_to_block_index(const unsigned int component) const
BlockMask block_mask(const FEValuesExtractors::Scalar &scalar) const
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const =0
virtual void get_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const
virtual Tensor< 3, dim > shape_3rd_derivative(const unsigned int i, const Point< dim > &p) const
std::pair< unsigned int, unsigned int > system_to_component_index(const unsigned int index) const
std::vector< std::pair< std::pair< unsigned int, unsigned int >, unsigned int > > system_to_base_table
Definition fe.h:2647
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_line_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
virtual void convert_generalized_support_point_values_to_dof_values(const std::vector< Vector< double > > &support_point_values, std::vector< double > &nodal_values) const
FiniteElement(const FiniteElementData< dim > &fe_data, const std::vector< bool > &restriction_is_additive_flags, const std::vector< ComponentMask > &nonzero_components)
BlockMask block_mask(const FEValuesExtractors::Vector &vector) const
BlockMask block_mask(const ComponentMask &component_mask) const
bool shape_function_belongs_to(const unsigned int shape_function, const FEValuesExtractors::Tensor< 2 > &components) const
std::pair< std::pair< unsigned int, unsigned int >, unsigned int > system_to_base_index(const unsigned int index) const
std::vector< std::pair< unsigned int, unsigned int > > system_to_component_table
Definition fe.h:2616
std::pair< std::pair< unsigned int, unsigned int >, unsigned int > face_system_to_base_index(const unsigned int index, const unsigned int face_no=0) const
virtual Tensor< 3, dim > shape_3rd_derivative_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
const FullMatrix< double > & constraints(const ::internal::SubfaceCase< dim > &subface_case=::internal::SubfaceCase< dim >::case_isotropic) const
unsigned int element_multiplicity(const unsigned int index) const
std::pair< std::unique_ptr< FiniteElement< dim, spacedim > >, unsigned int > operator^(const unsigned int multiplicity) const
unsigned int adjust_line_dof_index_for_line_orientation(const unsigned int index, const types::geometric_orientation combined_orientation) const
const std::vector< bool > restriction_is_additive_flags
Definition fe.h:2690
virtual ~FiniteElement() override=default
std::vector< std::pair< std::pair< unsigned int, unsigned int >, unsigned int > > component_to_base_table
Definition fe.h:2683
TableIndices< 2 > interface_constraints_size() const
std::vector< std::vector< std::pair< std::pair< unsigned int, unsigned int >, unsigned int > > > face_system_to_base_table
Definition fe.h:2654
std::vector< Point< dim > > unit_support_points
Definition fe.h:2562
virtual Tensor< 1, dim > shape_grad_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
bool restriction_is_implemented() const
virtual std::unique_ptr< InternalDataBase > get_face_data(const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const Quadrature< dim - 1 > &quadrature, internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &output_data) const
virtual unsigned int face_to_cell_index(const unsigned int face_dof_index, const unsigned int face, const types::geometric_orientation combined_orientation=ReferenceCell::default_combined_face_orientation()) const
std::vector< std::vector< std::pair< unsigned int, unsigned int > > > face_system_to_component_table
Definition fe.h:2628
virtual void fill_fe_face_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const Quadrature< dim - 1 > &quadrature, const Mapping< dim, spacedim > &mapping, const typename Mapping< dim, spacedim >::InternalDataBase &mapping_internal, const internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &mapping_data, const InternalDataBase &fe_internal, internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &output_data) const
FiniteElement(FiniteElement< dim, spacedim > &&)=default
unsigned int n_nonzero_components(const unsigned int i) const
FullMatrix< double > interface_constraints
Definition fe.h:2550
const std::vector< Point< dim > > & get_generalized_support_points() const
BlockMask block_mask(const FEValuesExtractors::SymmetricTensor< 2 > &sym_tensor) const
unsigned int n_base_elements() const
virtual Tensor< 2, dim > shape_grad_grad_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
virtual const FullMatrix< double > & get_prolongation_matrix(const unsigned int child, const RefinementCase< dim > &refinement_case=RefinementCase< dim >::isotropic_refinement) const
Table< 2, bool > local_dof_sparsity_pattern
Definition fe.h:2723
virtual double shape_value(const unsigned int i, const Point< dim > &p) const
virtual void get_face_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix, const unsigned int face_no=0) const
virtual const Table< 2, bool > & get_local_dof_sparsity_pattern() const
virtual std::size_t memory_consumption() const
virtual Tensor< 4, dim > shape_4th_derivative(const unsigned int i, const Point< dim > &p) const
GeometryPrimitive get_associated_geometry_primitive(const unsigned int cell_dof_index) const
std::vector< Point< dim > > generalized_support_points
Definition fe.h:2575
unsigned int component_to_system_index(const unsigned int component, const unsigned int index) const
const std::vector< ComponentMask > nonzero_components
Definition fe.h:2699
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_vertex_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
std::pair< unsigned int, unsigned int > face_system_to_component_index(const unsigned int index, const unsigned int face_no=0) const
virtual bool hp_constraints_are_implemented() const
std::vector< std::vector< FullMatrix< double > > > prolongation
Definition fe.h:2538
types::global_dof_index first_block_of_base(const unsigned int b) const
Abstract base class for mapping classes.
Definition mapping.h:318
Definition point.h:111
static constexpr types::geometric_orientation default_combined_face_orientation()
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:498
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:499
Point< 2 > first
Definition grid_out.cc:4629
#define DeclException0(Exception0)
Definition exceptions.h:466
static ::ExceptionBase & ExcShapeFunctionNotPrimitive(int arg1)
#define Assert(cond, exc)
static ::ExceptionBase & ExcWrongInterfaceMatrixSize(int arg1, int arg2)
#define DeclException2(Exception2, type1, type2, outsequence)
Definition exceptions.h:534
static ::ExceptionBase & ExcUnitShapeValuesDoNotExist()
static ::ExceptionBase & ExcProjectionVoid()
#define AssertIndexRange(index, range)
#define DeclExceptionMsg(Exception, defaulttext)
Definition exceptions.h:489
static ::ExceptionBase & ExcFENotPrimitive()
static ::ExceptionBase & ExcEmbeddingVoid()
#define DeclException1(Exception1, type1, outsequence)
Definition exceptions.h:511
static ::ExceptionBase & ExcInterpolationNotImplemented()
static ::ExceptionBase & ExcMessage(std::string arg1)
static ::ExceptionBase & ExcFEHasNoSupportPoints()
UpdateFlags
std::size_t size
Definition mpi.cc:734
std::string int_to_string(const unsigned int value, const unsigned int digits=numbers::invalid_unsigned_int)
Definition utilities.cc:470
unsigned char geometric_orientation
Definition types.h:40