deal.II version GIT relicensing-6834-g5b78e6bcdf 2026-10-01 11:20:01+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_interface_values.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 2019 - 2026 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef dealii_fe_interface_values_h
14#define dealii_fe_interface_values_h
15
16#include <deal.II/base/config.h>
17
19
21#include <deal.II/fe/mapping.h>
22
26
28
29#ifndef DOXYGEN
30template <int dim, int spacedim>
32#endif
33
39{
43 template <int dim, int spacedim = dim>
44 class Base
45 {
46 public:
51
52 protected:
57
62 template <class InputVector, class OutputVector>
63 void
64 get_local_dof_values(const InputVector &dof_values,
65 OutputVector &local_dof_values) const;
66 };
67
68
69
73 template <int dim, int spacedim = dim>
74 class Scalar : public Base<dim, spacedim>
75 {
76 public:
80 using value_type = double;
81
88
95
102
109 template <typename Number>
111
118 template <typename Number>
121
128 template <typename Number>
131
138 template <typename Number>
141
146 const unsigned int component);
147
173 value(const bool here_or_there,
174 const unsigned int interface_dof_index,
175 const unsigned int q_point) const;
176
192 gradient(const bool here_or_there,
193 const unsigned int interface_dof_index,
194 const unsigned int q_point) const;
195
214 jump_in_values(const unsigned int interface_dof_index,
215 const unsigned int q_point) const;
216
228 jump_in_gradients(const unsigned int interface_dof_index,
229 const unsigned int q_point) const;
230
242 jump_in_hessians(const unsigned int interface_dof_index,
243 const unsigned int q_point) const;
244
256 jump_in_third_derivatives(const unsigned int interface_dof_index,
257 const unsigned int q_point) const;
258
277 average_of_values(const unsigned int interface_dof_index,
278 const unsigned int q_point) const;
279
291 average_of_gradients(const unsigned int interface_dof_index,
292 const unsigned int q_point) const;
293
306 average_of_hessians(const unsigned int interface_dof_index,
307 const unsigned int q_point) const;
308
335 template <class InputVector>
336 void
338 const bool here_or_there,
339 const InputVector &fe_function,
341 &values) const;
342
365 template <class InputVector>
366 void
368 const bool here_or_there,
369 const InputVector &local_dof_values,
371 &values) const;
372
393 template <class InputVector>
394 void
396 const InputVector &fe_function,
398 &values) const;
399
407 template <class InputVector>
408 void
410 const InputVector &local_dof_values,
412 &values) const;
413
427 template <class InputVector>
428 void
430 const InputVector &fe_function,
432 &gradients) const;
433
441 template <class InputVector>
442 void
444 const InputVector &local_dof_values,
446 &gradients) const;
447
461 template <class InputVector>
462 void
464 const InputVector &fe_function,
466 &hessians) const;
467
475 template <class InputVector>
476 void
478 const InputVector &local_dof_values,
480 &hessians) const;
481
496 template <class InputVector>
497 void
499 const InputVector &fe_function,
500 std::vector<
502 &third_derivatives) const;
503
511 template <class InputVector>
512 void
514 const InputVector &local_dof_values,
515 std::vector<
517 &third_derivatives) const;
518
539 template <class InputVector>
540 void
542 const InputVector &fe_function,
544 &values) const;
545
553 template <class InputVector>
554 void
556 const InputVector &local_dof_values,
558 &values) const;
559
573 template <class InputVector>
574 void
576 const InputVector &fe_function,
578 &gradients) const;
579
587 template <class InputVector>
588 void
590 const InputVector &local_dof_values,
592 &gradients) const;
593
607 template <class InputVector>
608 void
610 const InputVector &fe_function,
612 &hessians) const;
613
621 template <class InputVector>
622 void
624 const InputVector &local_dof_values,
626 &hessians) const;
627
630 private:
635 };
636
637
638
642 template <int dim, int spacedim = dim>
643 class Vector : public Base<dim, spacedim>
644 {
645 public:
651
658
666
674
681 template <typename Number>
683
690 template <typename Number>
693
700 template <typename Number>
703
710 template <typename Number>
713
718 const unsigned int first_vector_component);
719
745 value(const bool here_or_there,
746 const unsigned int interface_dof_index,
747 const unsigned int q_point) const;
748
764 gradient(const bool here_or_there,
765 const unsigned int interface_dof_index,
766 const unsigned int q_point) const;
767
768
786 jump_in_values(const unsigned int interface_dof_index,
787 const unsigned int q_point) const;
788
799 jump_in_gradients(const unsigned int interface_dof_index,
800 const unsigned int q_point) const;
801
808 jump_gradient(const unsigned int interface_dof_index,
809 const unsigned int q_point) const;
810
822 jump_in_hessians(const unsigned int interface_dof_index,
823 const unsigned int q_point) const;
824
831 jump_hessian(const unsigned int interface_dof_index,
832 const unsigned int q_point) const;
833
845 jump_in_third_derivatives(const unsigned int interface_dof_index,
846 const unsigned int q_point) const;
847
865 average_of_values(const unsigned int interface_dof_index,
866 const unsigned int q_point) const;
867
878 average_of_gradients(const unsigned int interface_dof_index,
879 const unsigned int q_point) const;
880
893 average_of_hessians(const unsigned int interface_dof_index,
894 const unsigned int q_point) const;
895
902 average_hessian(const unsigned int interface_dof_index,
903 const unsigned int q_point) const;
904
931 template <class InputVector>
932 void
934 const bool here_or_there,
935 const InputVector &fe_function,
937 &values) const;
938
961 template <class InputVector>
962 void
964 const bool here_or_there,
965 const InputVector &local_dof_values,
967 &values) const;
968
989 template <class InputVector>
990 void
992 const InputVector &fe_function,
994 &values) const;
995
1003 template <class InputVector>
1004 void
1006 const InputVector &local_dof_values,
1008 &values) const;
1009
1023 template <class InputVector>
1024 void
1026 const InputVector &fe_function,
1028 &gradients) const;
1029
1037 template <class InputVector>
1038 void
1040 const InputVector &local_dof_values,
1042 &gradients) const;
1043
1057 template <class InputVector>
1058 void
1060 const InputVector &fe_function,
1062 &hessians) const;
1063
1071 template <class InputVector>
1072 void
1074 const InputVector &local_dof_values,
1076 &hessians) const;
1077
1092 template <class InputVector>
1093 void
1095 const InputVector &fe_function,
1096 std::vector<
1098 &third_derivatives) const;
1099
1107 template <class InputVector>
1108 void
1110 const InputVector &local_dof_values,
1111 std::vector<
1113 &third_derivatives) const;
1114
1135 template <class InputVector>
1136 void
1138 const InputVector &fe_function,
1140 &values) const;
1141
1149 template <class InputVector>
1150 void
1152 const InputVector &local_dof_values,
1154 &values) const;
1155
1169 template <class InputVector>
1170 void
1172 const InputVector &fe_function,
1174 &gradients) const;
1175
1183 template <class InputVector>
1184 void
1186 const InputVector &local_dof_values,
1188 &gradients) const;
1189
1203 template <class InputVector>
1204 void
1206 const InputVector &fe_function,
1208 &hessians) const;
1209
1217 template <class InputVector>
1218 void
1220 const InputVector &local_dof_values,
1222 &hessians) const;
1223
1226 private:
1231 };
1232} // namespace FEInterfaceViews
1233
1234
1235namespace internal
1236{
1238 {
1243 template <int dim, int spacedim, typename Extractor>
1245 {};
1246
1254 template <int dim, int spacedim>
1255 struct ViewType<dim, spacedim, FEValuesExtractors::Scalar>
1256 {
1257 using type = typename ::FEInterfaceViews::Scalar<dim, spacedim>;
1258 };
1259
1267 template <int dim, int spacedim>
1268 struct ViewType<dim, spacedim, FEValuesExtractors::Vector>
1269 {
1270 using type = typename ::FEInterfaceViews::Vector<dim, spacedim>;
1271 };
1272 } // namespace FEInterfaceViews
1273} // namespace internal
1274
1275namespace FEInterfaceViews
1276{
1281 template <int dim, int spacedim, typename Extractor>
1282 using View = typename ::internal::FEInterfaceViews::
1283 ViewType<dim, spacedim, Extractor>::type;
1284} // namespace FEInterfaceViews
1285
1286
1287
1312template <int dim, int spacedim = dim>
1314{
1315public:
1329 {
1330 InterfaceData(const unsigned int face_no,
1331 const unsigned int sub_face_no,
1332 const unsigned int face_no_neighbor,
1333 const unsigned int sub_face_no_neighbor)
1334 : face_no(face_no)
1338 {}
1339
1340 // mandatory
1341 unsigned int face_no;
1342 unsigned int sub_face_no;
1343 unsigned int face_no_neighbor;
1345
1346 // optional
1353 };
1357 const unsigned int n_quadrature_points;
1358
1366 const Quadrature<dim - 1> &quadrature,
1367 const UpdateFlags update_flags);
1368
1376 const hp::QCollection<dim - 1> &quadrature,
1377 const UpdateFlags update_flags);
1378
1386 const Quadrature<dim - 1> &quadrature,
1387 const UpdateFlags update_flags);
1388
1394 const hp::MappingCollection<dim, spacedim> &mapping_collection,
1395 const hp::FECollection<dim, spacedim> &fe_collection,
1396 const hp::QCollection<dim - 1> &quadrature_collection,
1397 const UpdateFlags update_flags);
1398
1403 const hp::QCollection<dim - 1> &quadrature_collection,
1404 const UpdateFlags update_flags);
1405
1522 template <typename CellIteratorType, typename CellNeighborIteratorType>
1523 void
1524 reinit(const CellIteratorType &cell,
1525 const unsigned int face_no,
1526 const unsigned int sub_face_no,
1527 const CellNeighborIteratorType &cell_neighbor,
1528 const unsigned int face_no_neighbor,
1529 const unsigned int sub_face_no_neighbor,
1530 const unsigned int q_index = numbers::invalid_unsigned_int,
1531 const unsigned int mapping_index = numbers::invalid_unsigned_int,
1532 const unsigned int fe_index = numbers::invalid_unsigned_int,
1533 const unsigned int fe_index_neighbor = numbers::invalid_unsigned_int);
1534
1549 template <typename CellIteratorType, typename CellNeighborIteratorType>
1550 void
1551 reinit(const CellIteratorType &cell,
1552 const CellNeighborIteratorType &cell_neighbor,
1553 const InterfaceData &interface_data);
1554
1581 template <typename CellIteratorType>
1582 void
1583 reinit(const CellIteratorType &cell,
1584 const unsigned int face_no,
1585 const unsigned int q_index = numbers::invalid_unsigned_int,
1586 const unsigned int mapping_index = numbers::invalid_unsigned_int,
1587 const unsigned int fe_index = numbers::invalid_unsigned_int);
1588
1597 get_fe_face_values(const unsigned int cell_index) const;
1598
1604
1609 get_fe() const;
1610
1614 const Quadrature<dim - 1> &
1616
1622
1628
1632 const hp::QCollection<dim - 1> &
1634
1639 bool
1641
1647
1655 get_cell(const unsigned int cell_index) const;
1656
1664 unsigned int
1665 get_face_number(const unsigned int cell_index) const;
1666
1678 bool
1680
1692 double
1693 JxW(const unsigned int quadrature_point) const;
1694
1700 const std::vector<double> &
1702
1712 normal_vector(const unsigned int q_point_index) const;
1713
1723 const std::vector<Tensor<1, spacedim>> &
1725
1735
1742 const Point<spacedim> &
1743 quadrature_point(const unsigned int q_point) const;
1744
1750 const std::vector<Point<spacedim>> &
1752
1763 unsigned
1765
1795
1806 std::vector<types::global_dof_index>
1808
1821 std::array<unsigned int, 2>
1822 interface_dof_to_dof_indices(const unsigned int interface_dof_index) const;
1823
1854 double
1855 shape_value(const bool here_or_there,
1856 const unsigned int interface_dof_index,
1857 const unsigned int q_point,
1858 const unsigned int component = 0) const;
1859
1870 shape_grad(const bool here_or_there,
1871 const unsigned int interface_dof_index,
1872 const unsigned int q_point,
1873 const unsigned int component = 0) const;
1874
1902 double
1903 jump_in_shape_values(const unsigned int interface_dof_index,
1904 const unsigned int q_point,
1905 const unsigned int component = 0) const;
1906
1921 jump_in_shape_gradients(const unsigned int interface_dof_index,
1922 const unsigned int q_point,
1923 const unsigned int component = 0) const;
1924
1940 jump_in_shape_hessians(const unsigned int interface_dof_index,
1941 const unsigned int q_point,
1942 const unsigned int component = 0) const;
1943
1958 jump_in_shape_3rd_derivatives(const unsigned int interface_dof_index,
1959 const unsigned int q_point,
1960 const unsigned int component = 0) const;
1961
1984 double
1985 average_of_shape_values(const unsigned int interface_dof_index,
1986 const unsigned int q_point,
1987 const unsigned int component = 0) const;
1988
2003 average_of_shape_gradients(const unsigned int interface_dof_index,
2004 const unsigned int q_point,
2005 const unsigned int component = 0) const;
2006
2022 average_of_shape_hessians(const unsigned int interface_dof_index,
2023 const unsigned int q_point,
2024 const unsigned int component = 0) const;
2025
2045 template <class InputVector>
2046 void
2048 const InputVector &fe_function,
2049 std::vector<typename InputVector::value_type> &values) const;
2050
2059 template <class InputVector>
2060 void
2062 const InputVector &fe_function,
2064 &gradients) const;
2065
2073 template <class InputVector>
2074 void
2076 const InputVector &fe_function,
2078 &hessians) const;
2079
2088 template <class InputVector>
2089 void
2091 const InputVector &fe_function,
2093 &third_derivatives) const;
2094
2110 template <class InputVector>
2111 void
2113 const InputVector &fe_function,
2114 std::vector<typename InputVector::value_type> &values) const;
2115
2123 template <class InputVector>
2124 void
2126 const InputVector &fe_function,
2128 &gradients) const;
2129
2137 template <class InputVector>
2138 void
2140 const InputVector &fe_function,
2142 &hessians) const;
2143
2163
2172
2177private:
2185 std::vector<std::pair<types::global_dof_index, std::array<unsigned int, 2>>>
2187
2193
2200
// non-hp data
2205
2209 std::unique_ptr<FEFaceValues<dim, spacedim>> internal_fe_face_values;
2210
2214 std::unique_ptr<FESubfaceValues<dim, spacedim>> internal_fe_subface_values;
2215
2219 std::unique_ptr<FEFaceValues<dim, spacedim>> internal_fe_face_values_neighbor;
2220
2224 std::unique_ptr<FESubfaceValues<dim, spacedim>>
2226
// non-hp data
2228
// hp data
2233
2238 std::unique_ptr<hp::FEFaceValues<dim, spacedim>> internal_hp_fe_face_values;
2239
2244 std::unique_ptr<hp::FESubfaceValues<dim, spacedim>>
2246
2251 std::unique_ptr<hp::FEFaceValues<dim, spacedim>>
2253
2258 std::unique_ptr<hp::FESubfaceValues<dim, spacedim>>
2260
2268 "The current function doesn't make sense when used with a "
2269 "FEInterfaceValues object with hp-capabilities.");
2270
2278 "The current function doesn't make sense when used with a "
2279 "FEInterfaceValues object without hp-capabilities.");
2280
// hp data
2282
2283 /*
2284 * Make the view classes friends of this class, since they
2285 * access internal data.
2286 */
2287 template <int, int>
2289 template <int, int>
2291};
2292
2293
2294
2295#ifndef DOXYGEN
2296
2297/*---------------------- Inline functions ---------------------*/
2298
2299template <int dim, int spacedim>
2301 const Mapping<dim, spacedim> &mapping,
2303 const Quadrature<dim - 1> &quadrature,
2304 const UpdateFlags update_flags)
2305 : n_quadrature_points(quadrature.size())
2306 , fe_face_values(nullptr)
2307 , fe_face_values_neighbor(nullptr)
2308 , internal_fe_face_values(
2309 std::make_unique<FEFaceValues<dim, spacedim>>(mapping,
2310 fe,
2311 quadrature,
2312 update_flags))
2313 , internal_fe_subface_values(
2314 std::make_unique<FESubfaceValues<dim, spacedim>>(mapping,
2315 fe,
2316 quadrature,
2317 update_flags))
2318 , internal_fe_face_values_neighbor(
2319 std::make_unique<FEFaceValues<dim, spacedim>>(mapping,
2320 fe,
2321 quadrature,
2322 update_flags))
2323 , internal_fe_subface_values_neighbor(
2324 std::make_unique<FESubfaceValues<dim, spacedim>>(mapping,
2325 fe,
2326 quadrature,
2327 update_flags))
2328{}
2329
2330
2331
2332template <int dim, int spacedim>
2335 const Quadrature<dim - 1> &quadrature,
2336 const UpdateFlags update_flags)
2338 fe.reference_cell().template get_default_linear_mapping<spacedim>(),
2339 fe,
2340 quadrature,
2341 update_flags)
2342{}
2343
2344
2345
2346template <int dim, int spacedim>
2348 const Mapping<dim, spacedim> &mapping,
2350 const hp::QCollection<dim - 1> &quadrature,
2351 const UpdateFlags update_flags)
2352 : n_quadrature_points(quadrature.max_n_quadrature_points())
2353 , fe_face_values(nullptr)
2354 , fe_face_values_neighbor(nullptr)
2355 , internal_fe_face_values(
2356 std::make_unique<FEFaceValues<dim, spacedim>>(mapping,
2357 fe,
2358 quadrature,
2359 update_flags))
2360 , internal_fe_subface_values(
2361 std::make_unique<FESubfaceValues<dim, spacedim>>(mapping,
2362 fe,
2363 quadrature,
2364 update_flags))
2365 , internal_fe_face_values_neighbor(
2366 std::make_unique<FEFaceValues<dim, spacedim>>(mapping,
2367 fe,
2368 quadrature[0],
2369 update_flags))
2370 , internal_fe_subface_values_neighbor(
2371 std::make_unique<FESubfaceValues<dim, spacedim>>(mapping,
2372 fe,
2373 quadrature[0],
2374 update_flags))
2375{}
2376
2377
2378
2379template <int dim, int spacedim>
2381 const hp::MappingCollection<dim, spacedim> &mapping_collection,
2382 const hp::FECollection<dim, spacedim> &fe_collection,
2383 const hp::QCollection<dim - 1> &quadrature_collection,
2384 const UpdateFlags update_flags)
2385 : n_quadrature_points(quadrature_collection.max_n_quadrature_points())
2386 , fe_face_values(nullptr)
2387 , fe_face_values_neighbor(nullptr)
2388 , internal_hp_fe_face_values(
2389 std::make_unique<hp::FEFaceValues<dim, spacedim>>(mapping_collection,
2390 fe_collection,
2391 quadrature_collection,
2392 update_flags))
2393 , internal_hp_fe_subface_values(
2394 std::make_unique<hp::FESubfaceValues<dim, spacedim>>(
2395 mapping_collection,
2396 fe_collection,
2397 quadrature_collection,
2398 update_flags))
2399 , internal_hp_fe_face_values_neighbor(
2400 std::make_unique<hp::FEFaceValues<dim, spacedim>>(mapping_collection,
2401 fe_collection,
2402 quadrature_collection,
2403 update_flags))
2404 , internal_hp_fe_subface_values_neighbor(
2405 std::make_unique<hp::FESubfaceValues<dim, spacedim>>(
2406 mapping_collection,
2407 fe_collection,
2408 quadrature_collection,
2409 update_flags))
2410{
2411 AssertDimension(dim, spacedim);
2412}
2413
2414
2415
2416template <int dim, int spacedim>
2418 const hp::FECollection<dim, spacedim> &fe_collection,
2419 const hp::QCollection<dim - 1> &quadrature_collection,
2420 const UpdateFlags update_flags)
2421 : FEInterfaceValues(fe_collection.get_reference_cell_default_linear_mapping(),
2422 fe_collection,
2423 quadrature_collection,
2424 update_flags)
2425{}
2426
2427
2428
2429template <int dim, int spacedim>
2430template <typename CellIteratorType, typename CellNeighborIteratorType>
2431void
2433 const CellIteratorType &cell,
2434 const unsigned int face_no,
2435 const unsigned int sub_face_no,
2436 const CellNeighborIteratorType &cell_neighbor,
2437 const unsigned int face_no_neighbor,
2438 const unsigned int sub_face_no_neighbor,
2439 const unsigned int q_index,
2440 const unsigned int mapping_index,
2441 const unsigned int fe_index_in,
2442 const unsigned int fe_index_neighbor_in)
2443{
2444 InterfaceData data(face_no,
2445 sub_face_no,
2446 face_no_neighbor,
2447 sub_face_no_neighbor);
2448 data.q_index = q_index;
2449 data.mapping_index = mapping_index;
2450 data.fe_index = fe_index_in;
2451 data.fe_index_neighbor = fe_index_neighbor_in;
2452
2453 reinit(cell, cell_neighbor, data);
2454}
2455
2456
2457
2458template <int dim, int spacedim>
2459template <typename CellIteratorType, typename CellNeighborIteratorType>
2460void
2462 const CellIteratorType &cell,
2463 const CellNeighborIteratorType &cell_neighbor,
2464 const InterfaceData &interface_data)
2465{
2466 Assert(internal_fe_face_values || internal_hp_fe_face_values,
2468
2469 constexpr bool is_dof_cell_accessor =
2470 std::is_same_v<DoFCellAccessor<dim, spacedim, true>,
2471 typename CellIteratorType::AccessorType> ||
2472 std::is_same_v<DoFCellAccessor<dim, spacedim, false>,
2473 typename CellIteratorType::AccessorType>;
2474
2475 constexpr bool is_dof_cell_accessor_neighbor =
2476 std::is_same_v<DoFCellAccessor<dim, spacedim, true>,
2477 typename CellNeighborIteratorType::AccessorType> ||
2478 std::is_same_v<DoFCellAccessor<dim, spacedim, false>,
2479 typename CellNeighborIteratorType::AccessorType>;
2480
2481 const unsigned int face_no = interface_data.face_no;
2482 const unsigned int sub_face_no = interface_data.sub_face_no;
2483 const unsigned int face_no_neighbor = interface_data.face_no_neighbor;
2484 const unsigned int sub_face_no_neighbor = interface_data.sub_face_no_neighbor;
2485
2486 unsigned int active_fe_index = 0;
2487 unsigned int active_fe_index_neighbor = 0;
2488
2489 if (internal_fe_face_values)
2490 {
2491 if (sub_face_no == numbers::invalid_unsigned_int)
2492 {
2493 internal_fe_face_values->reinit(cell, face_no);
2494 fe_face_values = internal_fe_face_values.get();
2495 }
2496 else
2497 {
2498 internal_fe_subface_values->reinit(cell, face_no, sub_face_no);
2499 fe_face_values = internal_fe_subface_values.get();
2500 }
2501 if (sub_face_no_neighbor == numbers::invalid_unsigned_int)
2502 {
2503 internal_fe_face_values_neighbor->reinit(cell_neighbor,
2504 face_no_neighbor);
2505 fe_face_values_neighbor = internal_fe_face_values_neighbor.get();
2506 }
2507 else
2508 {
2509 internal_fe_subface_values_neighbor->reinit(cell_neighbor,
2510 face_no_neighbor,
2511 sub_face_no_neighbor);
2512 fe_face_values_neighbor = internal_fe_subface_values_neighbor.get();
2513 }
2514
2515 AssertDimension(fe_face_values->n_quadrature_points,
2516 fe_face_values_neighbor->n_quadrature_points);
2517
2518 const_cast<unsigned int &>(this->n_quadrature_points) =
2519 fe_face_values->n_quadrature_points;
2520 }
2521 else if (internal_hp_fe_face_values)
2522 {
2523 active_fe_index = interface_data.fe_index;
2524 active_fe_index_neighbor =
2525 (interface_data.fe_index_neighbor == numbers::invalid_unsigned_int) ?
2526 interface_data.fe_index :
2527 interface_data.fe_index_neighbor;
2528
2529 if (active_fe_index == numbers::invalid_unsigned_int)
2530 {
2531 if constexpr (is_dof_cell_accessor)
2532 active_fe_index = cell->active_fe_index();
2533 else
2534 active_fe_index = 0;
2535 }
2536
2537 if (active_fe_index_neighbor == numbers::invalid_unsigned_int)
2538 {
2539 if constexpr (is_dof_cell_accessor_neighbor)
2540 active_fe_index_neighbor = cell_neighbor->active_fe_index();
2541 else
2542 active_fe_index_neighbor = 0;
2543 }
2544
2545 unsigned int used_q_index = interface_data.q_index;
2546 unsigned int used_mapping_index = interface_data.mapping_index;
2547
2548 // First check. If there is only one element in a collection, and if none
2549 // had been specified explicitly, then that's clearly the one to take:
2550 if (used_q_index == numbers::invalid_unsigned_int)
2551 if (internal_hp_fe_face_values->get_quadrature_collection().size() == 1)
2552 used_q_index = 0;
2553
2554 if (used_mapping_index == numbers::invalid_unsigned_int)
2555 if (internal_hp_fe_face_values->get_mapping_collection().size() == 1)
2556 used_mapping_index = 0;
2557
2558 // Second check: See if the two quadrature objects are the same, because
2559 // in that case it does not matter which one we use. Unfortunately, we
2560 // currently have no way of testing that two mapping objects are the
2561 // same :-(
2562 if (used_q_index == numbers::invalid_unsigned_int)
2563 if (internal_hp_fe_face_values
2564 ->get_quadrature_collection()[active_fe_index] ==
2565 internal_hp_fe_face_values
2566 ->get_quadrature_collection()[active_fe_index_neighbor])
2567 used_q_index = active_fe_index;
2568
2569 // Third check, if the above did not already suffice. We see if we
2570 // can get somewhere via the dominated's finite element index.
2571 if ((used_q_index == numbers::invalid_unsigned_int) ||
2572 (used_mapping_index == numbers::invalid_unsigned_int))
2573 {
2574 const unsigned int dominated_fe_index =
2575 ((used_q_index == numbers::invalid_unsigned_int) ||
2576 (used_mapping_index == numbers::invalid_unsigned_int) ?
2577 internal_hp_fe_face_values->get_fe_collection()
2578 .find_dominated_fe(
2579 {active_fe_index, active_fe_index_neighbor}) :
2581
2582 if (used_q_index == numbers::invalid_unsigned_int)
2583 {
2584 Assert(dominated_fe_index != numbers::invalid_fe_index,
2585 ExcMessage(
2586 "You called this function with 'q_index' left at its "
2587 "default value, but this can only work if one of "
2588 "the two finite elements adjacent to this face "
2589 "dominates the other. See the documentation "
2590 "of this function for more information of how "
2591 "to deal with this situation."));
2592 used_q_index = dominated_fe_index;
2593 }
2594
2595 if (used_mapping_index == numbers::invalid_unsigned_int)
2596 {
2597 Assert(dominated_fe_index != numbers::invalid_fe_index,
2598 ExcMessage(
2599 "You called this function with 'mapping_index' left "
2600 "at its default value, but this can only work if one "
2601 "of the two finite elements adjacent to this face "
2602 "dominates the other. See the documentation "
2603 "of this function for more information of how "
2604 "to deal with this situation."));
2605 used_mapping_index = dominated_fe_index;
2606 }
2607 }
2608
2609 // If q_index_neighbor is given use it, if not use the values determined
2610 // before
2611 const unsigned int used_q_index_neighbor =
2612 (interface_data.q_index_neighbor == numbers::invalid_unsigned_int) ?
2613 used_q_index :
2614 interface_data.q_index_neighbor;
2615 // Same as for q_index_neighbor
2616 const unsigned int used_mapping_index_neighbor =
2617 (interface_data.mapping_index_neighbor ==
2619 used_mapping_index :
2620 interface_data.mapping_index_neighbor;
2621
2622 // Same as if above, but when hp is enabled.
2623 if (sub_face_no == numbers::invalid_unsigned_int)
2624 {
2625 internal_hp_fe_face_values->reinit(
2626 cell, face_no, used_q_index, used_mapping_index, active_fe_index);
2627 fe_face_values = &const_cast<FEFaceValues<dim, spacedim> &>(
2628 internal_hp_fe_face_values->get_present_fe_values());
2629 }
2630 else
2631 {
2632 internal_hp_fe_subface_values->reinit(cell,
2633 face_no,
2634 sub_face_no,
2635 used_q_index,
2636 used_mapping_index,
2637 active_fe_index);
2638
2639 fe_face_values = &const_cast<FESubfaceValues<dim, spacedim> &>(
2640 internal_hp_fe_subface_values->get_present_fe_values());
2641 }
2642 if (sub_face_no_neighbor == numbers::invalid_unsigned_int)
2643 {
2644 internal_hp_fe_face_values_neighbor->reinit(
2645 cell_neighbor,
2646 face_no_neighbor,
2647 used_q_index_neighbor,
2648 used_mapping_index_neighbor,
2649 active_fe_index_neighbor);
2650
2651 fe_face_values_neighbor = &const_cast<FEFaceValues<dim, spacedim> &>(
2652 internal_hp_fe_face_values_neighbor->get_present_fe_values());
2653 }
2654 else
2655 {
2656 internal_hp_fe_subface_values_neighbor->reinit(
2657 cell_neighbor,
2658 face_no_neighbor,
2659 sub_face_no_neighbor,
2660 used_q_index_neighbor,
2661 used_mapping_index_neighbor,
2662 active_fe_index_neighbor);
2663
2664 fe_face_values_neighbor =
2665 &const_cast<FESubfaceValues<dim, spacedim> &>(
2666 internal_hp_fe_subface_values_neighbor->get_present_fe_values());
2667 }
2668
2669 AssertDimension(fe_face_values->n_quadrature_points,
2670 fe_face_values_neighbor->n_quadrature_points);
2671
2672 const_cast<unsigned int &>(this->n_quadrature_points) =
2673 fe_face_values->n_quadrature_points;
2674 }
2675
2676 // Set up dof mapping and remove duplicates (for continuous elements).
2677 if constexpr (is_dof_cell_accessor_neighbor && is_dof_cell_accessor)
2678 {
2679 // Get dof indices first:
2680 std::vector<types::global_dof_index> v_1(
2681 fe_face_values->get_fe().n_dofs_per_cell());
2682 cell->get_active_or_mg_dof_indices(v_1);
2683 std::vector<types::global_dof_index> v_2(
2684 fe_face_values_neighbor->get_fe().n_dofs_per_cell());
2685 cell_neighbor->get_active_or_mg_dof_indices(v_2);
2686
2687 interface_dof_data.resize(v_1.size() + v_2.size());
2688
2689 // First create a mapping for the DoFs on the first side
2690 // of the interface:
2691 for (unsigned int i = 0; i < v_1.size(); ++i)
2692 interface_dof_data[i] = {v_1[i], {{i, numbers::invalid_unsigned_int}}};
2693
2694 // Then we need to add the DoFs on the second side. We need
2695 // to merge this information with the mapping on the first
2696 // side, which if we left things as is, would result in an O(N^2)
2697 // complexity: For each DoF on the second side, we'd have to search
2698 // all of the ones on the first side. But we can reduce this to
2699 // O(N*log(N)) by sorting the DoFs on the first side, in which
2700 // case finding whether a second-side DoF already exists on the
2701 // first side only requires log(N) steps. So sort the information
2702 // we added above.
2703 //
2704 // In practice, DoF indices on many cells are already sorted
2705 // (because we number them in the first place in the same order
2706 // as we encounter them here). So guard the sorting step by a cheap
2707 // check for whether the data is already sorted:
2708 const auto compare_interface_dofs = [](const auto &interface_dof_1,
2709 const auto &interface_dof_2) {
2710 return (interface_dof_1.first < interface_dof_2.first);
2711 };
2712 const auto interface_dof_data_end_after_v_1 =
2713 interface_dof_data.begin() + v_1.size();
2714 if (std::is_sorted(interface_dof_data.begin(),
2715 interface_dof_data_end_after_v_1,
2716 compare_interface_dofs) == false)
2717 std::sort(interface_dof_data.begin(),
2718 interface_dof_data_end_after_v_1,
2719 compare_interface_dofs);
2720
2721 // Now add the second set of DoFs:
2722 unsigned int idx = v_1.size();
2723 for (unsigned int i = 0; i < v_2.size(); ++i)
2724 {
2725 // Find out whether v2[i] is a DoF that also exists on the first side
2726 // of the interface. If it does, we need to record 'i' in the second
2727 // slot of the map. If it doesn't, record an {invalid,i} entry.
2728 //
2729 // Because we sorted the first set of interface DoFs, finding whether
2730 // a given v_2[i] already exists can be done via std::lower_bound(),
2731 // rather than requiring the much more expensive std::find().
2732 const auto it =
2733 std::lower_bound(interface_dof_data.begin(),
2734 interface_dof_data_end_after_v_1,
2735 v_2[i],
2736 [](const auto &interface_dof_1,
2737 const auto &index) {
2738 return (interface_dof_1.first < index);
2739 });
2740 if ((it != interface_dof_data_end_after_v_1) && (it->first == v_2[i]))
2741 {
2742 it->second[1] = i;
2743 }
2744 else
2745 {
2746 interface_dof_data[idx] = {v_2[i],
2748 ++idx;
2749 }
2750 }
2751 interface_dof_data.resize(idx);
2752 }
2753 else
2754 // We don't have DoF indices associated with at least one of the two
2755 // cells. In that case, only build the mapping from the local numbering
2756 // on the interface to the local numbering on either side, without
2757 // reference to global DoF indices.
2758 {
2759 const unsigned int n_dofs_per_cell_1 = fe_face_values->dofs_per_cell;
2760 const unsigned int n_dofs_per_cell_2 =
2761 fe_face_values_neighbor->dofs_per_cell;
2762
2763 interface_dof_data.resize(n_dofs_per_cell_1 + n_dofs_per_cell_2);
2764
2765 for (unsigned int i = 0; i < n_dofs_per_cell_1; ++i)
2766 {
2767 interface_dof_data[i] = {numbers::invalid_dof_index,
2769 }
2770
2771 for (unsigned int i = 0; i < n_dofs_per_cell_2; ++i)
2772 {
2773 interface_dof_data[i + n_dofs_per_cell_1] = {
2775 }
2776 }
2777}
2778
2779
2780
2781template <int dim, int spacedim>
2782template <typename CellIteratorType>
2783void
2784FEInterfaceValues<dim, spacedim>::reinit(const CellIteratorType &cell,
2785 const unsigned int face_no,
2786 const unsigned int q_index,
2787 const unsigned int mapping_index,
2788 const unsigned int fe_index)
2789{
2790 Assert(internal_fe_face_values || internal_hp_fe_face_values,
2792
2793 if (internal_fe_face_values)
2794 {
2795 Assert((q_index == 0 || q_index == numbers::invalid_unsigned_int),
2797 Assert((mapping_index == 0 ||
2798 mapping_index == numbers::invalid_unsigned_int),
2800 Assert((fe_index == 0 || fe_index == numbers::invalid_unsigned_int),
2802
2803 internal_fe_face_values->reinit(cell, face_no);
2804 fe_face_values = internal_fe_face_values.get();
2805 fe_face_values_neighbor = nullptr;
2806 }
2807 else if (internal_hp_fe_face_values)
2808 {
2809 internal_hp_fe_face_values->reinit(
2810 cell, face_no, q_index, mapping_index, fe_index);
2811 fe_face_values = &const_cast<FEFaceValues<dim, spacedim> &>(
2812 internal_hp_fe_face_values->get_present_fe_values());
2813 fe_face_values_neighbor = nullptr;
2814 }
2815
2816 std::vector<types::global_dof_index> interface_dof_indices(
2817 fe_face_values->get_fe().n_dofs_per_cell());
2818
2819 if constexpr (std::is_same_v<typename CellIteratorType::AccessorType,
2821 std::is_same_v<typename CellIteratorType::AccessorType,
2823 {
2824 cell->get_active_or_mg_dof_indices(interface_dof_indices);
2825 }
2826 else
2827 {
2828 for (auto &i : interface_dof_indices)
2830 }
2831
2832 interface_dof_data.resize(interface_dof_indices.size());
2833 for (unsigned int i = 0; i < interface_dof_indices.size(); ++i)
2834 interface_dof_data[i] = {interface_dof_indices[i],
2836}
2837
2838
2839
2840template <int dim, int spacedim>
2841inline double
2842FEInterfaceValues<dim, spacedim>::JxW(const unsigned int q) const
2843{
2844 Assert(fe_face_values != nullptr,
2845 ExcMessage("This call requires a call to reinit() first."));
2846 return fe_face_values->JxW(q);
2847}
2848
2849
2850
2851template <int dim, int spacedim>
2852const std::vector<double> &
2854{
2855 Assert(fe_face_values != nullptr,
2856 ExcMessage("This call requires a call to reinit() first."));
2857 return fe_face_values->get_JxW_values();
2858}
2859
2860
2861
2862template <int dim, int spacedim>
2863const std::vector<Tensor<1, spacedim>> &
2865{
2866 Assert(fe_face_values != nullptr,
2867 ExcMessage("This call requires a call to reinit() first."));
2868 return fe_face_values->get_normal_vectors();
2869}
2870
2871
2872
2873template <int dim, int spacedim>
2876{
2877 Assert(!has_hp_capabilities(), ExcOnlyAvailableWithoutHP());
2878 return internal_fe_face_values->get_mapping();
2879}
2880
2881
2882
2883template <int dim, int spacedim>
2886{
2887 Assert(!has_hp_capabilities(), ExcOnlyAvailableWithoutHP());
2888 return internal_fe_face_values->get_fe();
2889}
2890
2891
2892
2893template <int dim, int spacedim>
2894const Quadrature<dim - 1> &
2896{
2897 Assert(!has_hp_capabilities(), ExcOnlyAvailableWithoutHP());
2898 return internal_fe_face_values->get_quadrature();
2899}
2900
2901
2902
2903template <int dim, int spacedim>
2906{
2907 Assert(has_hp_capabilities(), ExcOnlyAvailableWithHP());
2908 return internal_hp_fe_face_values->get_mapping_collection();
2909}
2910
2911
2912
2913template <int dim, int spacedim>
2916{
2917 Assert(has_hp_capabilities(), ExcOnlyAvailableWithHP());
2918 return internal_hp_fe_face_values->get_fe_collection();
2919}
2920
2921
2922
2923template <int dim, int spacedim>
2924const hp::QCollection<dim - 1> &
2926{
2927 Assert(has_hp_capabilities(), ExcOnlyAvailableWithHP());
2928 return internal_hp_fe_face_values->get_quadrature_collection();
2929}
2930
2931
2932
2933template <int dim, int spacedim>
2934bool
2936{
2937 if (internal_hp_fe_face_values || internal_hp_fe_subface_values ||
2938 internal_hp_fe_face_values_neighbor ||
2939 internal_hp_fe_subface_values_neighbor)
2940 {
2941 Assert(!internal_fe_face_values, ExcInternalError());
2942 Assert(!internal_fe_subface_values, ExcInternalError());
2943 Assert(!internal_fe_face_values_neighbor, ExcInternalError());
2944 Assert(!internal_fe_subface_values_neighbor, ExcInternalError());
2945
2946 return true;
2947 }
2948
2949 Assert(internal_fe_face_values || internal_fe_subface_values ||
2950 internal_fe_face_values_neighbor ||
2951 internal_fe_subface_values_neighbor,
2953 Assert(!internal_hp_fe_face_values, ExcInternalError());
2954 Assert(!internal_hp_fe_subface_values, ExcInternalError());
2955 Assert(!internal_hp_fe_face_values_neighbor, ExcInternalError());
2956 Assert(!internal_hp_fe_subface_values_neighbor, ExcInternalError());
2957
2958 return false;
2959}
2960
2961
2962
2963template <int dim, int spacedim>
2966{
2968 0U, n_quadrature_points);
2969}
2970
2971
2972
2973template <int dim, int spacedim>
2974const Point<spacedim> &
2976 const unsigned int q_point) const
2977{
2978 Assert(fe_face_values != nullptr,
2979 ExcMessage("This call requires a call to reinit() first."));
2980 return fe_face_values->quadrature_point(q_point);
2981}
2982
2983
2984
2985template <int dim, int spacedim>
2986const std::vector<Point<spacedim>> &
2988{
2989 Assert(fe_face_values != nullptr,
2990 ExcMessage("This call requires a call to reinit() first."));
2991 return fe_face_values->get_quadrature_points();
2992}
2993
2994
2995
2996template <int dim, int spacedim>
2999{
3000 if (has_hp_capabilities())
3001 return internal_hp_fe_face_values->get_update_flags();
3002 else
3003 return internal_fe_face_values->get_update_flags();
3004}
3005
3006
3007
3008template <int dim, int spacedim>
3011{
3012 return get_fe_face_values(cell_index).get_cell();
3013}
3014
3015
3016
3017template <int dim, int spacedim>
3018inline unsigned int
3020 const unsigned int cell_index) const
3021{
3022 return get_fe_face_values(cell_index).get_face_number();
3023}
3024
3025
3026
3027template <int dim, int spacedim>
3028unsigned
3030{
3031 Assert(
3032 interface_dof_data.size() > 0,
3033 ExcMessage(
3034 "n_current_interface_dofs() is only available after a call to reinit()."));
3035 return interface_dof_data.size();
3036}
3037
3038
3039
3040template <int dim, int spacedim>
3043{
3045 0U, n_current_interface_dofs());
3046}
3047
3048
3049
3050template <int dim, int spacedim>
3051bool
3053{
3054 return fe_face_values_neighbor == nullptr;
3055}
3056
3057
3058
3059template <int dim, int spacedim>
3060std::vector<types::global_dof_index>
3062{
3063 std::vector<types::global_dof_index> interface_dof_indices(
3064 interface_dof_data.size());
3065
3066 for (const unsigned int i : dof_indices())
3067 interface_dof_indices[i] = interface_dof_data[i].first;
3068
3069 return interface_dof_indices;
3070}
3071
3072
3073
3074template <int dim, int spacedim>
3075std::array<unsigned int, 2>
3077 const unsigned int interface_dof_index) const
3078{
3079 AssertIndexRange(interface_dof_index, n_current_interface_dofs());
3080 return interface_dof_data[interface_dof_index].second;
3081}
3082
3083
3084
3085template <int dim, int spacedim>
3088 const unsigned int cell_index) const
3089{
3091 Assert(
3092 cell_index == 0 || !at_boundary(),
3093 ExcMessage(
3094 "You are on a boundary, so you can only ask for the first FEFaceValues object."));
3095
3096 return (cell_index == 0) ? *fe_face_values : *fe_face_values_neighbor;
3097}
3098
3099
3100
3101template <int dim, int spacedim>
3104 const unsigned int q_point_index) const
3105{
3106 return fe_face_values->normal_vector(q_point_index);
3107}
3108
3109
3110
3111template <int dim, int spacedim>
3112double
3114 const bool here_or_there,
3115 const unsigned int interface_dof_index,
3116 const unsigned int q_point,
3117 const unsigned int component) const
3118{
3119 const auto dof_pair = interface_dof_to_dof_indices(interface_dof_index);
3120
3121 if (here_or_there && dof_pair[0] != numbers::invalid_unsigned_int)
3122 return get_fe_face_values(0).shape_value_component(dof_pair[0],
3123 q_point,
3124 component);
3125 if (!here_or_there && dof_pair[1] != numbers::invalid_unsigned_int)
3126 return get_fe_face_values(1).shape_value_component(dof_pair[1],
3127 q_point,
3128 component);
3129
3130 return 0.0;
3131}
3132
3133
3134template <int dim, int spacedim>
3137 const bool here_or_there,
3138 const unsigned int interface_dof_index,
3139 const unsigned int q_point,
3140 const unsigned int component) const
3141{
3142 const auto dof_pair = interface_dof_to_dof_indices(interface_dof_index);
3143
3145
3146 if (here_or_there && dof_pair[0] != numbers::invalid_unsigned_int)
3147 value = get_fe_face_values(0).shape_grad_component(dof_pair[0],
3148 q_point,
3149 component);
3150 if (!here_or_there && dof_pair[1] != numbers::invalid_unsigned_int)
3151 value = get_fe_face_values(1).shape_grad_component(dof_pair[1],
3152 q_point,
3153 component);
3154
3155 return value;
3156}
3157
3158template <int dim, int spacedim>
3159double
3161 const unsigned int interface_dof_index,
3162 const unsigned int q_point,
3163 const unsigned int component) const
3164{
3165 const auto dof_pair = interface_dof_to_dof_indices(interface_dof_index);
3166
3167 double value = 0.0;
3168
3169 if (dof_pair[0] != numbers::invalid_unsigned_int)
3170 value += get_fe_face_values(0).shape_value_component(dof_pair[0],
3171 q_point,
3172 component);
3173 if (dof_pair[1] != numbers::invalid_unsigned_int)
3174 value -= get_fe_face_values(1).shape_value_component(dof_pair[1],
3175 q_point,
3176 component);
3177 return value;
3178}
3179
3180
3181
3182template <int dim, int spacedim>
3183double
3185 const unsigned int interface_dof_index,
3186 const unsigned int q_point,
3187 const unsigned int component) const
3188{
3189 const auto dof_pair = interface_dof_to_dof_indices(interface_dof_index);
3190
3191 if (at_boundary())
3192 return get_fe_face_values(0).shape_value_component(dof_pair[0],
3193 q_point,
3194 component);
3195
3196 double value = 0.0;
3197
3198 if (dof_pair[0] != numbers::invalid_unsigned_int)
3199 value += 0.5 * get_fe_face_values(0).shape_value_component(dof_pair[0],
3200 q_point,
3201 component);
3202 if (dof_pair[1] != numbers::invalid_unsigned_int)
3203 value += 0.5 * get_fe_face_values(1).shape_value_component(dof_pair[1],
3204 q_point,
3205 component);
3206
3207 return value;
3208}
3209
3210
3211
3212template <int dim, int spacedim>
3215 const unsigned int interface_dof_index,
3216 const unsigned int q_point,
3217 const unsigned int component) const
3218{
3219 const auto dof_pair = interface_dof_to_dof_indices(interface_dof_index);
3220
3221 if (at_boundary())
3222 return get_fe_face_values(0).shape_grad_component(dof_pair[0],
3223 q_point,
3224 component);
3225
3227
3228 if (dof_pair[0] != numbers::invalid_unsigned_int)
3229 value += 0.5 * get_fe_face_values(0).shape_grad_component(dof_pair[0],
3230 q_point,
3231 component);
3232 if (dof_pair[1] != numbers::invalid_unsigned_int)
3233 value += 0.5 * get_fe_face_values(1).shape_grad_component(dof_pair[1],
3234 q_point,
3235 component);
3236
3237 return value;
3238}
3239
3240
3241
3242template <int dim, int spacedim>
3245 const unsigned int interface_dof_index,
3246 const unsigned int q_point,
3247 const unsigned int component) const
3248{
3249 const auto dof_pair = interface_dof_to_dof_indices(interface_dof_index);
3250
3251 if (at_boundary())
3252 return get_fe_face_values(0).shape_hessian_component(dof_pair[0],
3253 q_point,
3254 component);
3255
3257
3258 if (dof_pair[0] != numbers::invalid_unsigned_int)
3259 value += 0.5 * get_fe_face_values(0).shape_hessian_component(dof_pair[0],
3260 q_point,
3261 component);
3262 if (dof_pair[1] != numbers::invalid_unsigned_int)
3263 value += 0.5 * get_fe_face_values(1).shape_hessian_component(dof_pair[1],
3264 q_point,
3265 component);
3266
3267 return value;
3268}
3269
3270
3271
3272template <int dim, int spacedim>
3275 const unsigned int interface_dof_index,
3276 const unsigned int q_point,
3277 const unsigned int component) const
3278{
3279 const auto dof_pair = interface_dof_to_dof_indices(interface_dof_index);
3280
3281 if (at_boundary())
3282 return get_fe_face_values(0).shape_grad_component(dof_pair[0],
3283 q_point,
3284 component);
3285
3287
3288 if (dof_pair[0] != numbers::invalid_unsigned_int)
3289 value += get_fe_face_values(0).shape_grad_component(dof_pair[0],
3290 q_point,
3291 component);
3292 if (dof_pair[1] != numbers::invalid_unsigned_int)
3293 value -= get_fe_face_values(1).shape_grad_component(dof_pair[1],
3294 q_point,
3295 component);
3296
3297 return value;
3298}
3299
3300
3301
3302template <int dim, int spacedim>
3305 const unsigned int interface_dof_index,
3306 const unsigned int q_point,
3307 const unsigned int component) const
3308{
3309 const auto dof_pair = interface_dof_to_dof_indices(interface_dof_index);
3310
3311 if (at_boundary())
3312 return get_fe_face_values(0).shape_hessian_component(dof_pair[0],
3313 q_point,
3314 component);
3315
3317
3318 if (dof_pair[0] != numbers::invalid_unsigned_int)
3319 value += get_fe_face_values(0).shape_hessian_component(dof_pair[0],
3320 q_point,
3321 component);
3322 if (dof_pair[1] != numbers::invalid_unsigned_int)
3323 value -= get_fe_face_values(1).shape_hessian_component(dof_pair[1],
3324 q_point,
3325 component);
3326
3327 return value;
3328}
3329
3330
3331
3332template <int dim, int spacedim>
3335 const unsigned int interface_dof_index,
3336 const unsigned int q_point,
3337 const unsigned int component) const
3338{
3339 const auto dof_pair = interface_dof_to_dof_indices(interface_dof_index);
3340
3341 if (at_boundary())
3342 return get_fe_face_values(0).shape_3rd_derivative_component(dof_pair[0],
3343 q_point,
3344 component);
3345
3347
3348 if (dof_pair[0] != numbers::invalid_unsigned_int)
3349 value += get_fe_face_values(0).shape_3rd_derivative_component(dof_pair[0],
3350 q_point,
3351 component);
3352 if (dof_pair[1] != numbers::invalid_unsigned_int)
3353 value -= get_fe_face_values(1).shape_3rd_derivative_component(dof_pair[1],
3354 q_point,
3355 component);
3356
3357 return value;
3358}
3359
3360
3361
3362template <int dim, int spacedim>
3363template <class InputVector>
3364void
3366 const InputVector &fe_function,
3367 std::vector<typename InputVector::value_type> &values) const
3368{
3369 AssertDimension(values.size(), n_quadrature_points);
3370
3372 this->operator[](scalar).get_jump_in_function_values(fe_function, values);
3373}
3374
3375
3376
3377template <int dim, int spacedim>
3378template <class InputVector>
3379void
3381 const InputVector &fe_function,
3383 const
3384{
3385 AssertDimension(gradients.size(), n_quadrature_points);
3386
3388 this->operator[](scalar).get_jump_in_function_gradients(fe_function,
3389 gradients);
3390}
3391
3392
3393
3394template <int dim, int spacedim>
3395template <class InputVector>
3396void
3398 const InputVector &fe_function,
3400 const
3401{
3402 AssertDimension(hessians.size(), n_quadrature_points);
3403
3405 this->operator[](scalar).get_jump_in_function_hessians(fe_function, hessians);
3406}
3407
3408
3409
3410template <int dim, int spacedim>
3411template <class InputVector>
3412void
3414 const InputVector &fe_function,
3416 &third_derivatives) const
3417{
3418 AssertDimension(third_derivatives.size(), n_quadrature_points);
3419
3421 this->operator[](scalar).get_jump_in_function_third_derivatives(
3422 fe_function, third_derivatives);
3423}
3424
3425
3426
3427template <int dim, int spacedim>
3428template <class InputVector>
3429void
3431 const InputVector &fe_function,
3432 std::vector<typename InputVector::value_type> &values) const
3433{
3434 AssertDimension(values.size(), n_quadrature_points);
3435
3437 this->operator[](scalar).get_average_of_function_values(fe_function, values);
3438}
3439
3440
3441
3442template <int dim, int spacedim>
3443template <class InputVector>
3444void
3446 const InputVector &fe_function,
3448 const
3449{
3450 AssertDimension(gradients.size(), n_quadrature_points);
3451
3453 this->operator[](scalar).get_average_of_function_gradients(fe_function,
3454 gradients);
3455}
3456
3457
3458
3459template <int dim, int spacedim>
3460template <class InputVector>
3461void
3463 const InputVector &fe_function,
3465 const
3466{
3467 AssertDimension(hessians.size(), n_quadrature_points);
3468
3470 this->operator[](scalar).get_average_of_function_hessians(fe_function,
3471 hessians);
3472}
3473
3474
3475
3476/*------------ Inline functions: FEInterfaceValues------------*/
3477template <int dim, int spacedim>
3480 const FEValuesExtractors::Scalar &scalar) const
3481{
3482 const unsigned int n_components =
3483 (this->has_hp_capabilities() ? this->get_fe_collection().n_components() :
3484 this->get_fe().n_components());
3485 (void)n_components;
3486 AssertIndexRange(scalar.component, n_components);
3487 return FEInterfaceViews::Scalar<dim, spacedim>(*this, scalar.component);
3488}
3489
3490
3491
3492template <int dim, int spacedim>
3495 const FEValuesExtractors::Vector &vector) const
3496{
3497 const unsigned int n_components =
3498 (this->has_hp_capabilities() ? this->get_fe_collection().n_components() :
3499 this->get_fe().n_components());
3500 const unsigned int n_vectors =
3503 0);
3504 (void)n_components;
3505 (void)n_vectors;
3506 AssertIndexRange(vector.first_vector_component, n_vectors);
3508 vector.first_vector_component);
3509}
3510
3511
3512
3513namespace FEInterfaceViews
3514{
3515 template <int dim, int spacedim>
3517 const FEInterfaceValues<dim, spacedim> &fe_interface)
3518 : fe_interface(&fe_interface)
3519 {}
3520
3521
3522
3523 template <int dim, int spacedim>
3524 Scalar<dim, spacedim>::Scalar(
3525 const FEInterfaceValues<dim, spacedim> &fe_interface,
3526 const unsigned int component)
3527 : Base<dim, spacedim>(fe_interface)
3528 , extractor(component)
3529 {}
3530
3531
3532
3533 template <int dim, int spacedim>
3534 template <class InputVector, class OutputVector>
3535 void
3536 Base<dim, spacedim>::get_local_dof_values(
3537 const InputVector &dof_values,
3538 OutputVector &local_dof_values) const
3539 {
3540 const auto &interface_dof_indices =
3541 this->fe_interface->get_interface_dof_indices();
3542
3543 AssertDimension(interface_dof_indices.size(), local_dof_values.size());
3544
3545 for (const unsigned int i : this->fe_interface->dof_indices())
3546 local_dof_values[i] = dof_values(interface_dof_indices[i]);
3547 }
3548
3549
3550
3551 template <int dim, int spacedim>
3552 typename Scalar<dim, spacedim>::value_type
3553 Scalar<dim, spacedim>::value(const bool here_or_there,
3554 const unsigned int interface_dof_index,
3555 const unsigned int q_point) const
3556 {
3557 const auto dof_pair =
3558 this->fe_interface->interface_dof_to_dof_indices(interface_dof_index);
3559
3560 if (here_or_there && dof_pair[0] != numbers::invalid_unsigned_int)
3561 return (*(this->fe_interface->fe_face_values))[extractor].value(
3562 dof_pair[0], q_point);
3563
3564 if (!here_or_there && dof_pair[1] != numbers::invalid_unsigned_int)
3565 return (*(this->fe_interface->fe_face_values_neighbor))[extractor].value(
3566 dof_pair[1], q_point);
3567
3568 return 0.0;
3569 }
3570
3571
3572
3573 template <int dim, int spacedim>
3574 typename Scalar<dim, spacedim>::gradient_type
3575 Scalar<dim, spacedim>::gradient(const bool here_or_there,
3576 const unsigned int interface_dof_index,
3577 const unsigned int q_point) const
3578 {
3579 const auto dof_pair =
3580 this->fe_interface->interface_dof_to_dof_indices(interface_dof_index);
3581
3582 gradient_type value;
3583
3584 if (here_or_there && dof_pair[0] != numbers::invalid_unsigned_int)
3585 return (*(this->fe_interface->fe_face_values))[extractor].gradient(
3586 dof_pair[0], q_point);
3587
3588 if (!here_or_there && dof_pair[1] != numbers::invalid_unsigned_int)
3589 return (*(this->fe_interface->fe_face_values_neighbor))[extractor]
3590 .gradient(dof_pair[1], q_point);
3591
3592 return value;
3593 }
3594
3595
3596
3597 template <int dim, int spacedim>
3598 typename Scalar<dim, spacedim>::value_type
3599 Scalar<dim, spacedim>::jump_in_values(const unsigned int interface_dof_index,
3600 const unsigned int q_point) const
3601 {
3602 const auto dof_pair =
3603 this->fe_interface->interface_dof_to_dof_indices(interface_dof_index);
3604
3605 value_type value = 0.0;
3606
3607 if (dof_pair[0] != numbers::invalid_unsigned_int)
3608 value +=
3609 (*(this->fe_interface->fe_face_values))[extractor].value(dof_pair[0],
3610 q_point);
3611
3612 if (dof_pair[1] != numbers::invalid_unsigned_int)
3613 value -=
3614 (*(this->fe_interface->fe_face_values_neighbor))[extractor].value(
3615 dof_pair[1], q_point);
3616
3617 return value;
3618 }
3619
3620
3621
3622 template <int dim, int spacedim>
3623 typename Scalar<dim, spacedim>::value_type
3624 Scalar<dim, spacedim>::average_of_values(
3625 const unsigned int interface_dof_index,
3626 const unsigned int q_point) const
3627 {
3628 const auto dof_pair =
3629 this->fe_interface->interface_dof_to_dof_indices(interface_dof_index);
3630
3631 if (this->fe_interface->at_boundary())
3632 return (*(this->fe_interface->fe_face_values))[extractor].value(
3633 dof_pair[0], q_point);
3634
3635 value_type value = 0.0;
3636
3637 if (dof_pair[0] != numbers::invalid_unsigned_int)
3638 value +=
3639 0.5 *
3640 (*(this->fe_interface->fe_face_values))[extractor].value(dof_pair[0],
3641 q_point);
3642
3643 if (dof_pair[1] != numbers::invalid_unsigned_int)
3644 value +=
3645 0.5 * (*(this->fe_interface->fe_face_values_neighbor))[extractor].value(
3646 dof_pair[1], q_point);
3647
3648 return value;
3649 }
3650
3651
3652
3653 template <int dim, int spacedim>
3654 typename Scalar<dim, spacedim>::gradient_type
3655 Scalar<dim, spacedim>::average_of_gradients(
3656 const unsigned int interface_dof_index,
3657 const unsigned int q_point) const
3658 {
3659 const auto dof_pair =
3660 this->fe_interface->interface_dof_to_dof_indices(interface_dof_index);
3661
3662 if (this->fe_interface->at_boundary())
3663 return (*(this->fe_interface->fe_face_values))[extractor].gradient(
3664 dof_pair[0], q_point);
3665
3666 gradient_type value;
3667
3668 if (dof_pair[0] != numbers::invalid_unsigned_int)
3669 value +=
3670 0.5 *
3671 (*(this->fe_interface->fe_face_values))[extractor].gradient(dof_pair[0],
3672 q_point);
3673
3674 if (dof_pair[1] != numbers::invalid_unsigned_int)
3675 value += 0.5 * (*(this->fe_interface->fe_face_values_neighbor))[extractor]
3676 .gradient(dof_pair[1], q_point);
3677
3678 return value;
3679 }
3680
3681
3682
3683 template <int dim, int spacedim>
3684 typename Scalar<dim, spacedim>::gradient_type
3685 Scalar<dim, spacedim>::jump_in_gradients(
3686 const unsigned int interface_dof_index,
3687 const unsigned int q_point) const
3688 {
3689 const auto dof_pair =
3690 this->fe_interface->interface_dof_to_dof_indices(interface_dof_index);
3691
3692 if (this->fe_interface->at_boundary())
3693 return (*(this->fe_interface->fe_face_values))[extractor].gradient(
3694 dof_pair[0], q_point);
3695
3696 gradient_type value;
3697
3698 if (dof_pair[0] != numbers::invalid_unsigned_int)
3699 value +=
3700 (*(this->fe_interface->fe_face_values))[extractor].gradient(dof_pair[0],
3701 q_point);
3702
3703 if (dof_pair[1] != numbers::invalid_unsigned_int)
3704 value -=
3705 (*(this->fe_interface->fe_face_values_neighbor))[extractor].gradient(
3706 dof_pair[1], q_point);
3707
3708 return value;
3709 }
3710
3711
3712
3713 template <int dim, int spacedim>
3714 typename Scalar<dim, spacedim>::hessian_type
3715 Scalar<dim, spacedim>::average_of_hessians(
3716 const unsigned int interface_dof_index,
3717 const unsigned int q_point) const
3718 {
3719 const auto dof_pair =
3720 this->fe_interface->interface_dof_to_dof_indices(interface_dof_index);
3721
3722 if (this->fe_interface->at_boundary())
3723 return (*(this->fe_interface->fe_face_values))[extractor].hessian(
3724 dof_pair[0], q_point);
3725
3726 hessian_type value;
3727
3728 if (dof_pair[0] != numbers::invalid_unsigned_int)
3729 value +=
3730 0.5 *
3731 (*(this->fe_interface->fe_face_values))[extractor].hessian(dof_pair[0],
3732 q_point);
3733
3734 if (dof_pair[1] != numbers::invalid_unsigned_int)
3735 value += 0.5 * (*(this->fe_interface->fe_face_values_neighbor))[extractor]
3736 .hessian(dof_pair[1], q_point);
3737
3738 return value;
3739 }
3740
3741
3742
3743 template <int dim, int spacedim>
3744 typename Scalar<dim, spacedim>::third_derivative_type
3745 Scalar<dim, spacedim>::jump_in_third_derivatives(
3746 const unsigned int interface_dof_index,
3747 const unsigned int q_point) const
3748 {
3749 const auto dof_pair =
3750 this->fe_interface->interface_dof_to_dof_indices(interface_dof_index);
3751
3752 if (this->fe_interface->at_boundary())
3753 return (*(this->fe_interface->fe_face_values))[extractor]
3754 .third_derivative(dof_pair[0], q_point);
3755
3756 third_derivative_type value;
3757
3758 if (dof_pair[0] != numbers::invalid_unsigned_int)
3759 value +=
3760 (*(this->fe_interface->fe_face_values))[extractor].third_derivative(
3761 dof_pair[0], q_point);
3762
3763 if (dof_pair[1] != numbers::invalid_unsigned_int)
3764 value -= (*(this->fe_interface->fe_face_values_neighbor))[extractor]
3765 .third_derivative(dof_pair[1], q_point);
3766
3767 return value;
3768 }
3769
3770
3771
3772 template <int dim, int spacedim>
3773 typename Scalar<dim, spacedim>::hessian_type
3774 Scalar<dim, spacedim>::jump_in_hessians(
3775 const unsigned int interface_dof_index,
3776 const unsigned int q_point) const
3777 {
3778 const auto dof_pair =
3779 this->fe_interface->interface_dof_to_dof_indices(interface_dof_index);
3780
3781 if (this->fe_interface->at_boundary())
3782 return (*(this->fe_interface->fe_face_values))[extractor].hessian(
3783 dof_pair[0], q_point);
3784
3785 hessian_type value;
3786
3787 if (dof_pair[0] != numbers::invalid_unsigned_int)
3788 value +=
3789 (*(this->fe_interface->fe_face_values))[extractor].hessian(dof_pair[0],
3790 q_point);
3791
3792 if (dof_pair[1] != numbers::invalid_unsigned_int)
3793 value -=
3794 (*(this->fe_interface->fe_face_values_neighbor))[extractor].hessian(
3795 dof_pair[1], q_point);
3796
3797 return value;
3798 }
3799
3800
3801
3802 template <int dim, int spacedim>
3803 template <class InputVector>
3804 void
3805 Scalar<dim, spacedim>::get_function_values_from_local_dof_values(
3806 const bool here_or_there,
3807 const InputVector &local_dof_values,
3808 std::vector<solution_value_type<typename InputVector::value_type>> &values)
3809 const
3810 {
3811 AssertDimension(values.size(), this->fe_interface->n_quadrature_points);
3812
3813 for (const auto dof_index : this->fe_interface->dof_indices())
3814 for (const auto q_index : this->fe_interface->quadrature_point_indices())
3815 {
3816 if (dof_index == 0)
3817 values[q_index] = 0.;
3818
3819 values[q_index] += local_dof_values[dof_index] *
3820 value(here_or_there, dof_index, q_index);
3821 }
3822 }
3823
3824
3825
3826 template <int dim, int spacedim>
3827 template <class InputVector>
3828 void
3829 Scalar<dim, spacedim>::get_function_values(
3830 const bool here_or_there,
3831 const InputVector &fe_function,
3832 std::vector<solution_value_type<typename InputVector::value_type>> &values)
3833 const
3834 {
3835 std::vector<typename InputVector::value_type> local_dof_values(
3836 this->fe_interface->n_current_interface_dofs());
3837 this->get_local_dof_values(fe_function, local_dof_values);
3838
3839 get_function_values_from_local_dof_values(here_or_there,
3840 local_dof_values,
3841 values);
3842 }
3843
3844
3845
3846 template <int dim, int spacedim>
3847 template <class InputVector>
3848 void
3849 Scalar<dim, spacedim>::get_jump_in_function_values_from_local_dof_values(
3850 const InputVector &local_dof_values,
3851 std::vector<solution_value_type<typename InputVector::value_type>> &values)
3852 const
3853 {
3854 AssertDimension(values.size(), this->fe_interface->n_quadrature_points);
3855
3856 for (const auto dof_index : this->fe_interface->dof_indices())
3857 for (const auto q_index : this->fe_interface->quadrature_point_indices())
3858 {
3859 if (dof_index == 0)
3860 values[q_index] = 0.;
3861
3862 values[q_index] +=
3863 local_dof_values[dof_index] * jump_in_values(dof_index, q_index);
3864 }
3865 }
3866
3867
3868
3869 template <int dim, int spacedim>
3870 template <class InputVector>
3871 void
3872 Scalar<dim, spacedim>::get_jump_in_function_values(
3873 const InputVector &fe_function,
3874 std::vector<solution_value_type<typename InputVector::value_type>> &values)
3875 const
3876 {
3877 std::vector<typename InputVector::value_type> local_dof_values(
3878 this->fe_interface->n_current_interface_dofs());
3879 this->get_local_dof_values(fe_function, local_dof_values);
3880
3881 get_jump_in_function_values_from_local_dof_values(local_dof_values, values);
3882 }
3883
3884
3885
3886 template <int dim, int spacedim>
3887 template <class InputVector>
3888 void
3889 Scalar<dim, spacedim>::get_jump_in_function_gradients_from_local_dof_values(
3890 const InputVector &local_dof_values,
3891 std::vector<solution_gradient_type<typename InputVector::value_type>>
3892 &gradients) const
3893 {
3894 AssertDimension(gradients.size(), this->fe_interface->n_quadrature_points);
3895
3896 for (const auto dof_index : this->fe_interface->dof_indices())
3897 for (const auto q_index : this->fe_interface->quadrature_point_indices())
3898 {
3899 if (dof_index == 0)
3900 gradients[q_index] = 0.;
3901
3902 gradients[q_index] +=
3903 local_dof_values[dof_index] * jump_in_gradients(dof_index, q_index);
3904 }
3905 }
3906
3907
3908
3909 template <int dim, int spacedim>
3910 template <class InputVector>
3911 void
3912 Scalar<dim, spacedim>::get_jump_in_function_gradients(
3913 const InputVector &fe_function,
3914 std::vector<solution_gradient_type<typename InputVector::value_type>>
3915 &gradients) const
3916 {
3917 std::vector<typename InputVector::value_type> local_dof_values(
3918 this->fe_interface->n_current_interface_dofs());
3919 this->get_local_dof_values(fe_function, local_dof_values);
3920
3921 get_jump_in_function_gradients_from_local_dof_values(local_dof_values,
3922 gradients);
3923 }
3924
3925
3926
3927 template <int dim, int spacedim>
3928 template <class InputVector>
3929 void
3930 Scalar<dim, spacedim>::get_average_of_function_values_from_local_dof_values(
3931 const InputVector &local_dof_values,
3932 std::vector<solution_value_type<typename InputVector::value_type>> &values)
3933 const
3934 {
3935 AssertDimension(values.size(), this->fe_interface->n_quadrature_points);
3936
3937 for (const auto dof_index : this->fe_interface->dof_indices())
3938 for (const auto q_index : this->fe_interface->quadrature_point_indices())
3939 {
3940 if (dof_index == 0)
3941 values[q_index] = 0.;
3942
3943 values[q_index] +=
3944 local_dof_values[dof_index] * average_of_values(dof_index, q_index);
3945 }
3946 }
3947
3948
3949
3950 template <int dim, int spacedim>
3951 template <class InputVector>
3952 void
3953 Scalar<dim, spacedim>::get_average_of_function_values(
3954 const InputVector &fe_function,
3955 std::vector<solution_value_type<typename InputVector::value_type>> &values)
3956 const
3957 {
3958 std::vector<typename InputVector::value_type> local_dof_values(
3959 this->fe_interface->n_current_interface_dofs());
3960 this->get_local_dof_values(fe_function, local_dof_values);
3961
3962 get_average_of_function_values_from_local_dof_values(local_dof_values,
3963 values);
3964 }
3965
3966
3967
3968 template <int dim, int spacedim>
3969 template <class InputVector>
3970 void
3971 Scalar<dim, spacedim>::
3972 get_average_of_function_gradients_from_local_dof_values(
3973 const InputVector &local_dof_values,
3974 std::vector<solution_gradient_type<typename InputVector::value_type>>
3975 &gradients) const
3976 {
3977 AssertDimension(gradients.size(), this->fe_interface->n_quadrature_points);
3978
3979 for (const auto dof_index : this->fe_interface->dof_indices())
3980 for (const auto q_index : this->fe_interface->quadrature_point_indices())
3981 {
3982 if (dof_index == 0)
3983 gradients[q_index] = 0.;
3984
3985 gradients[q_index] += local_dof_values[dof_index] *
3986 average_of_gradients(dof_index, q_index);
3987 }
3988 }
3989
3990
3991
3992 template <int dim, int spacedim>
3993 template <class InputVector>
3994 void
3995 Scalar<dim, spacedim>::get_average_of_function_gradients(
3996 const InputVector &fe_function,
3997 std::vector<solution_gradient_type<typename InputVector::value_type>>
3998 &gradients) const
3999 {
4000 std::vector<typename InputVector::value_type> local_dof_values(
4001 this->fe_interface->n_current_interface_dofs());
4002 this->get_local_dof_values(fe_function, local_dof_values);
4003
4004 get_average_of_function_gradients_from_local_dof_values(local_dof_values,
4005 gradients);
4006 }
4007
4008
4009
4010 template <int dim, int spacedim>
4011 template <class InputVector>
4012 void
4013 Scalar<dim, spacedim>::get_jump_in_function_hessians_from_local_dof_values(
4014 const InputVector &local_dof_values,
4015 std::vector<solution_hessian_type<typename InputVector::value_type>>
4016 &hessians) const
4017 {
4018 AssertDimension(hessians.size(), this->fe_interface->n_quadrature_points);
4019
4020 for (const auto dof_index : this->fe_interface->dof_indices())
4021 for (const auto q_index : this->fe_interface->quadrature_point_indices())
4022 {
4023 if (dof_index == 0)
4024 hessians[q_index] = 0.;
4025
4026 hessians[q_index] +=
4027 local_dof_values[dof_index] * jump_in_hessians(dof_index, q_index);
4028 }
4029 }
4030
4031
4032
4033 template <int dim, int spacedim>
4034 template <class InputVector>
4035 void
4036 Scalar<dim, spacedim>::get_jump_in_function_hessians(
4037 const InputVector &fe_function,
4038 std::vector<solution_hessian_type<typename InputVector::value_type>>
4039 &hessians) const
4040 {
4041 std::vector<typename InputVector::value_type> local_dof_values(
4042 this->fe_interface->n_current_interface_dofs());
4043 this->get_local_dof_values(fe_function, local_dof_values);
4044
4045 get_jump_in_function_hessians_from_local_dof_values(local_dof_values,
4046 hessians);
4047 }
4048
4049
4050
4051 template <int dim, int spacedim>
4052 template <class InputVector>
4053 void
4054 Scalar<dim, spacedim>::get_average_of_function_hessians_from_local_dof_values(
4055 const InputVector &local_dof_values,
4056 std::vector<solution_hessian_type<typename InputVector::value_type>>
4057 &hessians) const
4058 {
4059 AssertDimension(hessians.size(), this->fe_interface->n_quadrature_points);
4060
4061 for (const unsigned int dof_index : this->fe_interface->dof_indices())
4062 for (const auto q_index : this->fe_interface->quadrature_point_indices())
4063 {
4064 if (dof_index == 0)
4065 hessians[q_index] = 0.;
4066
4067 hessians[q_index] += local_dof_values[dof_index] *
4068 average_of_hessians(dof_index, q_index);
4069 }
4070 }
4071
4072
4073
4074 template <int dim, int spacedim>
4075 template <class InputVector>
4076 void
4077 Scalar<dim, spacedim>::get_average_of_function_hessians(
4078 const InputVector &fe_function,
4079 std::vector<solution_hessian_type<typename InputVector::value_type>>
4080 &hessians) const
4081 {
4082 std::vector<typename InputVector::value_type> local_dof_values(
4083 this->fe_interface->n_current_interface_dofs());
4084 this->get_local_dof_values(fe_function, local_dof_values);
4085
4086 get_average_of_function_hessians_from_local_dof_values(local_dof_values,
4087 hessians);
4088 }
4089
4090
4091
4092 template <int dim, int spacedim>
4093 template <class InputVector>
4094 void
4095 Scalar<dim, spacedim>::
4096 get_jump_in_function_third_derivatives_from_local_dof_values(
4097 const InputVector &local_dof_values,
4098 std::vector<
4099 solution_third_derivative_type<typename InputVector::value_type>>
4100 &third_derivatives) const
4101 {
4102 AssertDimension(third_derivatives.size(),
4103 this->fe_interface->n_quadrature_points);
4104
4105 for (const unsigned int dof_index : this->fe_interface->dof_indices())
4106 for (const auto q_index : this->fe_interface->quadrature_point_indices())
4107 {
4108 if (dof_index == 0)
4109 third_derivatives[q_index] = 0.;
4110
4111 third_derivatives[q_index] +=
4112 local_dof_values[dof_index] *
4113 jump_in_third_derivatives(dof_index, q_index);
4114 }
4115 }
4116
4117
4118
4119 template <int dim, int spacedim>
4120 template <class InputVector>
4121 void
4122 Scalar<dim, spacedim>::get_jump_in_function_third_derivatives(
4123 const InputVector &fe_function,
4124 std::vector<
4125 solution_third_derivative_type<typename InputVector::value_type>>
4126 &third_derivatives) const
4127 {
4128 std::vector<typename InputVector::value_type> local_dof_values(
4129 this->fe_interface->n_current_interface_dofs());
4130 this->get_local_dof_values(fe_function, local_dof_values);
4131
4132 get_jump_in_function_third_derivatives_from_local_dof_values(
4133 local_dof_values, third_derivatives);
4134 }
4135
4136
4137
4138 template <int dim, int spacedim>
4140 const FEInterfaceValues<dim, spacedim> &fe_interface,
4141 const unsigned int first_vector_component)
4142 : Base<dim, spacedim>(fe_interface)
4143 , extractor(first_vector_component)
4144 {}
4145
4146
4147
4148 template <int dim, int spacedim>
4150 Vector<dim, spacedim>::value(const bool here_or_there,
4151 const unsigned int interface_dof_index,
4152 const unsigned int q_point) const
4153 {
4154 const auto dof_pair =
4155 this->fe_interface->interface_dof_to_dof_indices(interface_dof_index);
4156
4157 if (here_or_there && dof_pair[0] != numbers::invalid_unsigned_int)
4158 return (*(this->fe_interface->fe_face_values))[extractor].value(
4159 dof_pair[0], q_point);
4160
4161 if (!here_or_there && dof_pair[1] != numbers::invalid_unsigned_int)
4162 return (*(this->fe_interface->fe_face_values_neighbor))[extractor].value(
4163 dof_pair[1], q_point);
4164
4165 return value_type();
4166 }
4167
4168
4169
4170 template <int dim, int spacedim>
4172 Vector<dim, spacedim>::gradient(const bool here_or_there,
4173 const unsigned int interface_dof_index,
4174 const unsigned int q_point) const
4175 {
4176 const auto dof_pair =
4177 this->fe_interface->interface_dof_to_dof_indices(interface_dof_index);
4178
4179 gradient_type value;
4180
4181 if (here_or_there && dof_pair[0] != numbers::invalid_unsigned_int)
4182 return (*(this->fe_interface->fe_face_values))[extractor].gradient(
4183 dof_pair[0], q_point);
4184
4185 if (!here_or_there && dof_pair[1] != numbers::invalid_unsigned_int)
4186 return (*(this->fe_interface->fe_face_values_neighbor))[extractor]
4187 .gradient(dof_pair[1], q_point);
4188
4189 return value;
4190 }
4191
4192
4193
4194 template <int dim, int spacedim>
4196 Vector<dim, spacedim>::jump_in_values(const unsigned int interface_dof_index,
4197 const unsigned int q_point) const
4198 {
4199 const auto dof_pair =
4200 this->fe_interface->interface_dof_to_dof_indices(interface_dof_index);
4201
4203
4204 if (dof_pair[0] != numbers::invalid_unsigned_int)
4205 value +=
4206 (*(this->fe_interface->fe_face_values))[extractor].value(dof_pair[0],
4207 q_point);
4208
4209 if (dof_pair[1] != numbers::invalid_unsigned_int)
4210 value -=
4211 (*(this->fe_interface->fe_face_values_neighbor))[extractor].value(
4212 dof_pair[1], q_point);
4213
4214 return value;
4215 }
4216
4217
4218
4219 template <int dim, int spacedim>
4222 const unsigned int interface_dof_index,
4223 const unsigned int q_point) const
4224 {
4225 const auto dof_pair =
4226 this->fe_interface->interface_dof_to_dof_indices(interface_dof_index);
4227
4228 if (this->fe_interface->at_boundary())
4229 return (*(this->fe_interface->fe_face_values))[extractor].value(
4230 dof_pair[0], q_point);
4231
4233
4234 if (dof_pair[0] != numbers::invalid_unsigned_int)
4235 value +=
4236 0.5 *
4237 (*(this->fe_interface->fe_face_values))[extractor].value(dof_pair[0],
4238 q_point);
4239
4240 if (dof_pair[1] != numbers::invalid_unsigned_int)
4241 value +=
4242 0.5 * (*(this->fe_interface->fe_face_values_neighbor))[extractor].value(
4243 dof_pair[1], q_point);
4244
4245 return value;
4246 }
4247
4248
4249
4250 template <int dim, int spacedim>
4253 const unsigned int interface_dof_index,
4254 const unsigned int q_point) const
4255 {
4256 const auto dof_pair =
4257 this->fe_interface->interface_dof_to_dof_indices(interface_dof_index);
4258
4259 if (this->fe_interface->at_boundary())
4260 return (*(this->fe_interface->fe_face_values))[extractor].gradient(
4261 dof_pair[0], q_point);
4262
4263 gradient_type value;
4264
4265 if (dof_pair[0] != numbers::invalid_unsigned_int)
4266 value +=
4267 0.5 *
4268 (*(this->fe_interface->fe_face_values))[extractor].gradient(dof_pair[0],
4269 q_point);
4270
4271 if (dof_pair[1] != numbers::invalid_unsigned_int)
4272 value += 0.5 * (*(this->fe_interface->fe_face_values_neighbor))[extractor]
4273 .gradient(dof_pair[1], q_point);
4274
4275 return value;
4276 }
4277
4278
4279
4280 template <int dim, int spacedim>
4283 const unsigned int interface_dof_index,
4284 const unsigned int q_point) const
4285 {
4286 const auto dof_pair =
4287 this->fe_interface->interface_dof_to_dof_indices(interface_dof_index);
4288
4289 if (this->fe_interface->at_boundary())
4290 return (*(this->fe_interface->fe_face_values))[extractor].gradient(
4291 dof_pair[0], q_point);
4292
4293 gradient_type value;
4294
4295 if (dof_pair[0] != numbers::invalid_unsigned_int)
4296 value +=
4297 (*(this->fe_interface->fe_face_values))[extractor].gradient(dof_pair[0],
4298 q_point);
4299
4300 if (dof_pair[1] != numbers::invalid_unsigned_int)
4301 value -=
4302 (*(this->fe_interface->fe_face_values_neighbor))[extractor].gradient(
4303 dof_pair[1], q_point);
4304
4305 return value;
4306 }
4307
4308
4309
4310 template <int dim, int spacedim>
4312 Vector<dim, spacedim>::jump_gradient(const unsigned int interface_dof_index,
4313 const unsigned int q_point) const
4314 {
4315 return jump_in_gradients(interface_dof_index, q_point);
4316 }
4317
4318
4319
4320 template <int dim, int spacedim>
4323 const unsigned int interface_dof_index,
4324 const unsigned int q_point) const
4325 {
4326 const auto dof_pair =
4327 this->fe_interface->interface_dof_to_dof_indices(interface_dof_index);
4328
4329 if (this->fe_interface->at_boundary())
4330 return (*(this->fe_interface->fe_face_values))[extractor].hessian(
4331 dof_pair[0], q_point);
4332
4333 hessian_type value;
4334
4335 if (dof_pair[0] != numbers::invalid_unsigned_int)
4336 value +=
4337 0.5 *
4338 (*(this->fe_interface->fe_face_values))[extractor].hessian(dof_pair[0],
4339 q_point);
4340
4341 if (dof_pair[1] != numbers::invalid_unsigned_int)
4342 value += 0.5 * (*(this->fe_interface->fe_face_values_neighbor))[extractor]
4343 .hessian(dof_pair[1], q_point);
4344
4345 return value;
4346 }
4347
4348
4349
4350 template <int dim, int spacedim>
4352 Vector<dim, spacedim>::average_hessian(const unsigned int interface_dof_index,
4353 const unsigned int q_point) const
4354 {
4355 return average_of_hessians(interface_dof_index, q_point);
4356 }
4357
4358
4359
4360 template <int dim, int spacedim>
4363 const unsigned int interface_dof_index,
4364 const unsigned int q_point) const
4365 {
4366 const auto dof_pair =
4367 this->fe_interface->interface_dof_to_dof_indices(interface_dof_index);
4368
4369 if (this->fe_interface->at_boundary())
4370 return (*(this->fe_interface->fe_face_values))[extractor].hessian(
4371 dof_pair[0], q_point);
4372
4373 hessian_type value;
4374
4375 if (dof_pair[0] != numbers::invalid_unsigned_int)
4376 value +=
4377 (*(this->fe_interface->fe_face_values))[extractor].hessian(dof_pair[0],
4378 q_point);
4379
4380 if (dof_pair[1] != numbers::invalid_unsigned_int)
4381 value -=
4382 (*(this->fe_interface->fe_face_values_neighbor))[extractor].hessian(
4383 dof_pair[1], q_point);
4384
4385 return value;
4386 }
4387
4388
4389
4390 template <int dim, int spacedim>
4392 Vector<dim, spacedim>::jump_hessian(const unsigned int interface_dof_index,
4393 const unsigned int q_point) const
4394 {
4395 return jump_in_hessians(interface_dof_index, q_point);
4396 }
4397
4398
4399
4400 template <int dim, int spacedim>
4403 const unsigned int interface_dof_index,
4404 const unsigned int q_point) const
4405 {
4406 const auto dof_pair =
4407 this->fe_interface->interface_dof_to_dof_indices(interface_dof_index);
4408
4409 if (this->fe_interface->at_boundary())
4410 return (*(this->fe_interface->fe_face_values))[extractor]
4411 .third_derivative(dof_pair[0], q_point);
4412
4413 third_derivative_type value;
4414
4415 if (dof_pair[0] != numbers::invalid_unsigned_int)
4416 value +=
4417 (*(this->fe_interface->fe_face_values))[extractor].third_derivative(
4418 dof_pair[0], q_point);
4419
4420 if (dof_pair[1] != numbers::invalid_unsigned_int)
4421 value -= (*(this->fe_interface->fe_face_values_neighbor))[extractor]
4422 .third_derivative(dof_pair[1], q_point);
4423
4424 return value;
4425 }
4426
4427
4428
4429 template <int dim, int spacedim>
4430 template <class InputVector>
4431 void
4433 const bool here_or_there,
4434 const InputVector &local_dof_values,
4435 std::vector<solution_value_type<typename InputVector::value_type>> &values)
4436 const
4437 {
4438 AssertDimension(values.size(), this->fe_interface->n_quadrature_points);
4439
4440 for (const auto dof_index : this->fe_interface->dof_indices())
4441 for (const auto q_index : this->fe_interface->quadrature_point_indices())
4442 {
4443 if (dof_index == 0)
4444 values[q_index] = 0.;
4445
4446 values[q_index] += local_dof_values[dof_index] *
4447 value(here_or_there, dof_index, q_index);
4448 }
4449 }
4450
4451
4452
4453 template <int dim, int spacedim>
4454 template <class InputVector>
4455 void
4457 const bool here_or_there,
4458 const InputVector &fe_function,
4459 std::vector<solution_value_type<typename InputVector::value_type>> &values)
4460 const
4461 {
4462 std::vector<typename InputVector::value_type> local_dof_values(
4463 this->fe_interface->n_current_interface_dofs());
4464 this->get_local_dof_values(fe_function, local_dof_values);
4465
4466 get_function_values_from_local_dof_values(here_or_there,
4467 local_dof_values,
4468 values);
4469 }
4470
4471
4472
4473 template <int dim, int spacedim>
4474 template <class InputVector>
4475 void
4477 const InputVector &local_dof_values,
4478 std::vector<solution_value_type<typename InputVector::value_type>> &values)
4479 const
4480 {
4481 AssertDimension(values.size(), this->fe_interface->n_quadrature_points);
4482
4483 for (const auto dof_index : this->fe_interface->dof_indices())
4484 for (const auto q_index : this->fe_interface->quadrature_point_indices())
4485 {
4486 if (dof_index == 0)
4487 values[q_index] = 0.;
4488
4489 values[q_index] +=
4490 local_dof_values[dof_index] * jump_in_values(dof_index, q_index);
4491 }
4492 }
4493
4494
4495
4496 template <int dim, int spacedim>
4497 template <class InputVector>
4498 void
4500 const InputVector &fe_function,
4501 std::vector<solution_value_type<typename InputVector::value_type>> &values)
4502 const
4503 {
4504 std::vector<typename InputVector::value_type> local_dof_values(
4505 this->fe_interface->n_current_interface_dofs());
4506 this->get_local_dof_values(fe_function, local_dof_values);
4507
4508 get_jump_in_function_values_from_local_dof_values(local_dof_values, values);
4509 }
4510
4511
4512
4513 template <int dim, int spacedim>
4514 template <class InputVector>
4515 void
4517 const InputVector &local_dof_values,
4518 std::vector<solution_gradient_type<typename InputVector::value_type>>
4519 &gradients) const
4520 {
4521 AssertDimension(gradients.size(), this->fe_interface->n_quadrature_points);
4522
4523 for (const auto dof_index : this->fe_interface->dof_indices())
4524 for (const auto q_index : this->fe_interface->quadrature_point_indices())
4525 {
4526 if (dof_index == 0)
4527 gradients[q_index] = 0.;
4528
4529 gradients[q_index] +=
4530 local_dof_values[dof_index] * jump_in_gradients(dof_index, q_index);
4531 }
4532 }
4533
4534
4535
4536 template <int dim, int spacedim>
4537 template <class InputVector>
4538 void
4540 const InputVector &fe_function,
4541 std::vector<solution_gradient_type<typename InputVector::value_type>>
4542 &gradients) const
4543 {
4544 std::vector<typename InputVector::value_type> local_dof_values(
4545 this->fe_interface->n_current_interface_dofs());
4546 this->get_local_dof_values(fe_function, local_dof_values);
4547
4548 get_jump_in_function_gradients_from_local_dof_values(local_dof_values,
4549 gradients);
4550 }
4551
4552
4553
4554 template <int dim, int spacedim>
4555 template <class InputVector>
4556 void
4558 const InputVector &local_dof_values,
4559 std::vector<solution_value_type<typename InputVector::value_type>> &values)
4560 const
4561 {
4562 AssertDimension(values.size(), this->fe_interface->n_quadrature_points);
4563
4564 for (const auto dof_index : this->fe_interface->dof_indices())
4565 for (const auto q_index : this->fe_interface->quadrature_point_indices())
4566 {
4567 if (dof_index == 0)
4568 values[q_index] = 0.;
4569
4570 values[q_index] +=
4571 local_dof_values[dof_index] * average_of_values(dof_index, q_index);
4572 }
4573 }
4574
4575
4576
4577 template <int dim, int spacedim>
4578 template <class InputVector>
4579 void
4581 const InputVector &fe_function,
4582 std::vector<solution_value_type<typename InputVector::value_type>> &values)
4583 const
4584 {
4585 std::vector<typename InputVector::value_type> local_dof_values(
4586 this->fe_interface->n_current_interface_dofs());
4587 this->get_local_dof_values(fe_function, local_dof_values);
4588
4589 get_average_of_function_values_from_local_dof_values(local_dof_values,
4590 values);
4591 }
4592
4593
4594
4595 template <int dim, int spacedim>
4596 template <class InputVector>
4597 void
4600 const InputVector &local_dof_values,
4601 std::vector<solution_gradient_type<typename InputVector::value_type>>
4602 &gradients) const
4603 {
4604 AssertDimension(gradients.size(), this->fe_interface->n_quadrature_points);
4605
4606 for (const auto dof_index : this->fe_interface->dof_indices())
4607 for (const auto q_index : this->fe_interface->quadrature_point_indices())
4608 {
4609 if (dof_index == 0)
4610 gradients[q_index] = 0.;
4611
4612 gradients[q_index] += local_dof_values[dof_index] *
4613 average_of_gradients(dof_index, q_index);
4614 }
4615 }
4616
4617
4618
4619 template <int dim, int spacedim>
4620 template <class InputVector>
4621 void
4623 const InputVector &fe_function,
4624 std::vector<solution_gradient_type<typename InputVector::value_type>>
4625 &gradients) const
4626 {
4627 std::vector<typename InputVector::value_type> local_dof_values(
4628 this->fe_interface->n_current_interface_dofs());
4629 this->get_local_dof_values(fe_function, local_dof_values);
4630
4631 get_average_of_function_gradients_from_local_dof_values(local_dof_values,
4632 gradients);
4633 }
4634
4635
4636
4637 template <int dim, int spacedim>
4638 template <class InputVector>
4639 void
4641 const InputVector &local_dof_values,
4642 std::vector<solution_hessian_type<typename InputVector::value_type>>
4643 &hessians) const
4644 {
4645 AssertDimension(hessians.size(), this->fe_interface->n_quadrature_points);
4646
4647 for (const auto dof_index : this->fe_interface->dof_indices())
4648 for (const auto q_index : this->fe_interface->quadrature_point_indices())
4649 {
4650 if (dof_index == 0)
4651 hessians[q_index] = 0.;
4652
4653 hessians[q_index] +=
4654 local_dof_values[dof_index] * jump_in_hessians(dof_index, q_index);
4655 }
4656 }
4657
4658
4659
4660 template <int dim, int spacedim>
4661 template <class InputVector>
4662 void
4664 const InputVector &fe_function,
4665 std::vector<solution_hessian_type<typename InputVector::value_type>>
4666 &hessians) const
4667 {
4668 std::vector<typename InputVector::value_type> local_dof_values(
4669 this->fe_interface->n_current_interface_dofs());
4670 this->get_local_dof_values(fe_function, local_dof_values);
4671
4672 get_jump_in_function_hessians_from_local_dof_values(local_dof_values,
4673 hessians);
4674 }
4675
4676
4677
4678 template <int dim, int spacedim>
4679 template <class InputVector>
4680 void
4682 const InputVector &local_dof_values,
4683 std::vector<solution_hessian_type<typename InputVector::value_type>>
4684 &hessians) const
4685 {
4686 AssertDimension(hessians.size(), this->fe_interface->n_quadrature_points);
4687
4688 for (const unsigned int dof_index : this->fe_interface->dof_indices())
4689 for (const auto q_index : this->fe_interface->quadrature_point_indices())
4690 {
4691 if (dof_index == 0)
4692 hessians[q_index] = 0.;
4693
4694 hessians[q_index] += local_dof_values[dof_index] *
4695 average_of_hessians(dof_index, q_index);
4696 }
4697 }
4698
4699
4700
4701 template <int dim, int spacedim>
4702 template <class InputVector>
4703 void
4705 const InputVector &fe_function,
4706 std::vector<solution_hessian_type<typename InputVector::value_type>>
4707 &hessians) const
4708 {
4709 std::vector<typename InputVector::value_type> local_dof_values(
4710 this->fe_interface->n_current_interface_dofs());
4711 this->get_local_dof_values(fe_function, local_dof_values);
4712
4713 get_average_of_function_hessians_from_local_dof_values(local_dof_values,
4714 hessians);
4715 }
4716
4717
4718
4719 template <int dim, int spacedim>
4720 template <class InputVector>
4721 void
4724 const InputVector &local_dof_values,
4725 std::vector<
4726 solution_third_derivative_type<typename InputVector::value_type>>
4727 &third_derivatives) const
4728 {
4729 AssertDimension(third_derivatives.size(),
4730 this->fe_interface->n_quadrature_points);
4731
4732 for (const unsigned int dof_index : this->fe_interface->dof_indices())
4733 for (const auto q_index : this->fe_interface->quadrature_point_indices())
4734 {
4735 if (dof_index == 0)
4736 third_derivatives[q_index] = 0.;
4737
4738 third_derivatives[q_index] +=
4739 local_dof_values[dof_index] *
4740 jump_in_third_derivatives(dof_index, q_index);
4741 }
4742 }
4743
4744
4745
4746 template <int dim, int spacedim>
4747 template <class InputVector>
4748 void
4750 const InputVector &fe_function,
4751 std::vector<
4752 solution_third_derivative_type<typename InputVector::value_type>>
4753 &third_derivatives) const
4754 {
4755 std::vector<typename InputVector::value_type> local_dof_values(
4756 this->fe_interface->n_current_interface_dofs());
4757 this->get_local_dof_values(fe_function, local_dof_values);
4758
4759 get_jump_in_function_third_derivatives_from_local_dof_values(
4760 local_dof_values, third_derivatives);
4761 }
4762} // namespace FEInterfaceViews
4763
4764#endif // DOXYGEN
4765
4767
4768#endif
*  *  for(const auto &cell :triangulation.active_cell_iterators())
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, level_dof_access > > &cell, const unsigned int face_no)
std::unique_ptr< FEFaceValues< dim, spacedim > > internal_fe_face_values
UpdateFlags get_update_flags() const
const hp::MappingCollection< dim, spacedim > & get_mapping_collection() const
Tensor< 1, spacedim > average_of_shape_gradients(const unsigned int interface_dof_index, const unsigned int q_point, const unsigned int component=0) const
void get_average_of_function_gradients(const InputVector &fe_function, std::vector< Tensor< 1, spacedim, typename InputVector::value_type > > &gradients) const
void get_jump_in_function_third_derivatives(const InputVector &fe_function, std::vector< Tensor< 3, spacedim, typename InputVector::value_type > > &third_derivatives) const
std_cxx20::ranges::iota_view< unsigned int, unsigned int > dof_indices() const
FEFaceValuesBase< dim, spacedim > * fe_face_values_neighbor
bool at_boundary() const
const std::vector< double > & get_JxW_values() const
void get_average_of_function_hessians(const InputVector &fe_function, std::vector< Tensor< 2, spacedim, typename InputVector::value_type > > &hessians) const
FEInterfaceValues(const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const Quadrature< dim - 1 > &quadrature, const UpdateFlags update_flags)
void reinit(const CellIteratorType &cell, const unsigned int face_no, const unsigned int q_index=numbers::invalid_unsigned_int, const unsigned int mapping_index=numbers::invalid_unsigned_int, const unsigned int fe_index=numbers::invalid_unsigned_int)
const hp::FECollection< dim, spacedim > & get_fe_collection() const
Tensor< 3, spacedim > jump_in_shape_3rd_derivatives(const unsigned int interface_dof_index, const unsigned int q_point, const unsigned int component=0) const
std::vector< std::pair< types::global_dof_index, std::array< unsigned int, 2 > > > interface_dof_data
FEInterfaceValues(const hp::MappingCollection< dim, spacedim > &mapping_collection, const hp::FECollection< dim, spacedim > &fe_collection, const hp::QCollection< dim - 1 > &quadrature_collection, const UpdateFlags update_flags)
std::unique_ptr< hp::FESubfaceValues< dim, spacedim > > internal_hp_fe_subface_values
const unsigned int n_quadrature_points
bool has_hp_capabilities() const
void reinit(const CellIteratorType &cell, const unsigned int face_no, const unsigned int sub_face_no, const CellNeighborIteratorType &cell_neighbor, const unsigned int face_no_neighbor, const unsigned int sub_face_no_neighbor, const unsigned int q_index=numbers::invalid_unsigned_int, const unsigned int mapping_index=numbers::invalid_unsigned_int, const unsigned int fe_index=numbers::invalid_unsigned_int, const unsigned int fe_index_neighbor=numbers::invalid_unsigned_int)
FEInterfaceViews::Scalar< dim, spacedim > operator[](const FEValuesExtractors::Scalar &scalar) const
unsigned n_current_interface_dofs() const
const std::vector< Tensor< 1, spacedim > > & get_normal_vectors() const
const FiniteElement< dim, spacedim > & get_fe() const
double average_of_shape_values(const unsigned int interface_dof_index, const unsigned int q_point, const unsigned int component=0) const
const std::vector< Point< spacedim > > & get_quadrature_points() const
std::unique_ptr< FESubfaceValues< dim, spacedim > > internal_fe_subface_values
double shape_value(const bool here_or_there, const unsigned int interface_dof_index, const unsigned int q_point, const unsigned int component=0) const
const FEFaceValuesBase< dim, spacedim > & get_fe_face_values(const unsigned int cell_index) const
Tensor< 2, spacedim > average_of_shape_hessians(const unsigned int interface_dof_index, const unsigned int q_point, const unsigned int component=0) const
std::unique_ptr< hp::FESubfaceValues< dim, spacedim > > internal_hp_fe_subface_values_neighbor
FEInterfaceValues(const hp::FECollection< dim, spacedim > &fe_collection, const hp::QCollection< dim - 1 > &quadrature_collection, const UpdateFlags update_flags)
const hp::QCollection< dim - 1 > & get_quadrature_collection() const
FEInterfaceValues(const Mapping< dim, spacedim > &mapping, const FiniteElement< dim, spacedim > &fe, const hp::QCollection< dim - 1 > &quadrature, const UpdateFlags update_flags)
FEFaceValuesBase< dim, spacedim > * fe_face_values
Tensor< 1, spacedim > normal_vector(const unsigned int q_point_index) const
std::unique_ptr< FESubfaceValues< dim, spacedim > > internal_fe_subface_values_neighbor
Tensor< 1, spacedim > shape_grad(const bool here_or_there, const unsigned int interface_dof_index, const unsigned int q_point, const unsigned int component=0) const
Triangulation< dim, spacedim >::cell_iterator get_cell(const unsigned int cell_index) const
void get_jump_in_function_hessians(const InputVector &fe_function, std::vector< Tensor< 2, spacedim, typename InputVector::value_type > > &hessians) const
double JxW(const unsigned int quadrature_point) const
void get_average_of_function_values(const InputVector &fe_function, std::vector< typename InputVector::value_type > &values) const
Tensor< 1, spacedim > jump_in_shape_gradients(const unsigned int interface_dof_index, const unsigned int q_point, const unsigned int component=0) const
Tensor< 2, spacedim > jump_in_shape_hessians(const unsigned int interface_dof_index, const unsigned int q_point, const unsigned int component=0) const
std::unique_ptr< hp::FEFaceValues< dim, spacedim > > internal_hp_fe_face_values_neighbor
std_cxx20::ranges::iota_view< unsigned int, unsigned int > quadrature_point_indices() const
FEInterfaceViews::Vector< dim, spacedim > operator[](const FEValuesExtractors::Vector &vector) const
double jump_in_shape_values(const unsigned int interface_dof_index, const unsigned int q_point, const unsigned int component=0) const
unsigned int get_face_number(const unsigned int cell_index) const
std::vector< types::global_dof_index > get_interface_dof_indices() const
FEInterfaceValues(const FiniteElement< dim, spacedim > &fe, const Quadrature< dim - 1 > &quadrature, const UpdateFlags update_flags)
void reinit(const CellIteratorType &cell, const CellNeighborIteratorType &cell_neighbor, const InterfaceData &interface_data)
std::array< unsigned int, 2 > interface_dof_to_dof_indices(const unsigned int interface_dof_index) const
std::unique_ptr< hp::FEFaceValues< dim, spacedim > > internal_hp_fe_face_values
std::unique_ptr< FEFaceValues< dim, spacedim > > internal_fe_face_values_neighbor
void get_jump_in_function_values(const InputVector &fe_function, std::vector< typename InputVector::value_type > &values) const
void get_jump_in_function_gradients(const InputVector &fe_function, std::vector< Tensor< 1, spacedim, typename InputVector::value_type > > &gradients) const
const Mapping< dim, spacedim > & get_mapping() const
const Point< spacedim > & quadrature_point(const unsigned int q_point) const
const Quadrature< dim - 1 > & get_quadrature() const
void get_local_dof_values(const InputVector &dof_values, OutputVector &local_dof_values) const
Base(const FEInterfaceValues< dim, spacedim > &fe_interface)
const FEInterfaceValues< dim, spacedim > * fe_interface
void get_jump_in_function_third_derivatives(const InputVector &fe_function, std::vector< solution_third_derivative_type< typename InputVector::value_type > > &third_derivatives) const
void get_jump_in_function_gradients_from_local_dof_values(const InputVector &local_dof_values, std::vector< solution_gradient_type< typename InputVector::value_type > > &gradients) const
gradient_type jump_in_gradients(const unsigned int interface_dof_index, const unsigned int q_point) const
void get_jump_in_function_hessians(const InputVector &fe_function, std::vector< solution_hessian_type< typename InputVector::value_type > > &hessians) const
hessian_type jump_in_hessians(const unsigned int interface_dof_index, const unsigned int q_point) const
gradient_type gradient(const bool here_or_there, const unsigned int interface_dof_index, const unsigned int q_point) const
const FEValuesExtractors::Scalar extractor
void get_jump_in_function_third_derivatives_from_local_dof_values(const InputVector &local_dof_values, std::vector< solution_third_derivative_type< typename InputVector::value_type > > &third_derivatives) const
typename FEValuesViews::Scalar< dim, spacedim >::gradient_type gradient_type
hessian_type average_of_hessians(const unsigned int interface_dof_index, const unsigned int q_point) const
void get_jump_in_function_gradients(const InputVector &fe_function, std::vector< solution_gradient_type< typename InputVector::value_type > > &gradients) const
value_type value(const bool here_or_there, const unsigned int interface_dof_index, const unsigned int q_point) const
void get_average_of_function_hessians_from_local_dof_values(const InputVector &local_dof_values, std::vector< solution_hessian_type< typename InputVector::value_type > > &hessians) const
void get_average_of_function_values_from_local_dof_values(const InputVector &local_dof_values, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
void get_average_of_function_values(const InputVector &fe_function, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
typename ProductType< Number, value_type >::type solution_value_type
void get_average_of_function_gradients(const InputVector &fe_function, std::vector< solution_gradient_type< typename InputVector::value_type > > &gradients) const
typename ProductType< Number, third_derivative_type >::type solution_third_derivative_type
void get_jump_in_function_values_from_local_dof_values(const InputVector &local_dof_values, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
void get_jump_in_function_values(const InputVector &fe_function, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
Scalar(const FEInterfaceValues< dim, spacedim > &fe_interface, const unsigned int component)
typename FEValuesViews::Scalar< dim, spacedim >::hessian_type hessian_type
third_derivative_type jump_in_third_derivatives(const unsigned int interface_dof_index, const unsigned int q_point) const
gradient_type average_of_gradients(const unsigned int interface_dof_index, const unsigned int q_point) const
void get_average_of_function_hessians(const InputVector &fe_function, std::vector< solution_hessian_type< typename InputVector::value_type > > &hessians) const
void get_average_of_function_gradients_from_local_dof_values(const InputVector &local_dof_values, std::vector< solution_gradient_type< typename InputVector::value_type > > &gradients) const
value_type average_of_values(const unsigned int interface_dof_index, const unsigned int q_point) const
void get_jump_in_function_hessians_from_local_dof_values(const InputVector &local_dof_values, std::vector< solution_hessian_type< typename InputVector::value_type > > &hessians) const
value_type jump_in_values(const unsigned int interface_dof_index, const unsigned int q_point) const
void get_function_values_from_local_dof_values(const bool here_or_there, const InputVector &local_dof_values, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
typename FEValuesViews::Scalar< dim, spacedim >::third_derivative_type third_derivative_type
void get_function_values(const bool here_or_there, const InputVector &fe_function, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
typename ProductType< Number, hessian_type >::type solution_hessian_type
typename ProductType< Number, gradient_type >::type solution_gradient_type
const FEValuesExtractors::Vector extractor
void get_average_of_function_gradients_from_local_dof_values(const InputVector &local_dof_values, std::vector< solution_gradient_type< typename InputVector::value_type > > &gradients) const
void get_average_of_function_hessians(const InputVector &fe_function, std::vector< solution_hessian_type< typename InputVector::value_type > > &hessians) const
gradient_type gradient(const bool here_or_there, const unsigned int interface_dof_index, const unsigned int q_point) const
void get_jump_in_function_values(const InputVector &fe_function, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
void get_average_of_function_values_from_local_dof_values(const InputVector &local_dof_values, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
void get_function_values_from_local_dof_values(const bool here_or_there, const InputVector &local_dof_values, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
void get_average_of_function_hessians_from_local_dof_values(const InputVector &local_dof_values, std::vector< solution_hessian_type< typename InputVector::value_type > > &hessians) const
hessian_type average_hessian(const unsigned int interface_dof_index, const unsigned int q_point) const
Vector(const FEInterfaceValues< dim, spacedim > &fe_interface, const unsigned int first_vector_component)
void get_average_of_function_gradients(const InputVector &fe_function, std::vector< solution_gradient_type< typename InputVector::value_type > > &gradients) const
void get_function_values(const bool here_or_there, const InputVector &fe_function, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
typename ProductType< Number, gradient_type >::type solution_gradient_type
hessian_type jump_hessian(const unsigned int interface_dof_index, const unsigned int q_point) const
typename ProductType< Number, value_type >::type solution_value_type
void get_average_of_function_values(const InputVector &fe_function, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
typename FEValuesViews::Vector< dim, spacedim >::value_type value_type
value_type value(const bool here_or_there, const unsigned int interface_dof_index, const unsigned int q_point) const
void get_jump_in_function_third_derivatives_from_local_dof_values(const InputVector &local_dof_values, std::vector< solution_third_derivative_type< typename InputVector::value_type > > &third_derivatives) const
void get_jump_in_function_gradients(const InputVector &fe_function, std::vector< solution_gradient_type< typename InputVector::value_type > > &gradients) const
third_derivative_type jump_in_third_derivatives(const unsigned int interface_dof_index, const unsigned int q_point) const
void get_jump_in_function_gradients_from_local_dof_values(const InputVector &local_dof_values, std::vector< solution_gradient_type< typename InputVector::value_type > > &gradients) const
void get_jump_in_function_hessians_from_local_dof_values(const InputVector &local_dof_values, std::vector< solution_hessian_type< typename InputVector::value_type > > &hessians) const
void get_jump_in_function_hessians(const InputVector &fe_function, std::vector< solution_hessian_type< typename InputVector::value_type > > &hessians) const
value_type jump_in_values(const unsigned int interface_dof_index, const unsigned int q_point) const
typename ProductType< Number, hessian_type >::type solution_hessian_type
void get_jump_in_function_third_derivatives(const InputVector &fe_function, std::vector< solution_third_derivative_type< typename InputVector::value_type > > &third_derivatives) const
gradient_type jump_gradient(const unsigned int interface_dof_index, const unsigned int q_point) const
value_type average_of_values(const unsigned int interface_dof_index, const unsigned int q_point) const
hessian_type jump_in_hessians(const unsigned int interface_dof_index, const unsigned int q_point) const
void get_jump_in_function_values_from_local_dof_values(const InputVector &local_dof_values, std::vector< solution_value_type< typename InputVector::value_type > > &values) const
gradient_type average_of_gradients(const unsigned int interface_dof_index, const unsigned int q_point) const
typename ProductType< Number, third_derivative_type >::type solution_third_derivative_type
typename FEValuesViews::Vector< dim, spacedim >::gradient_type gradient_type
gradient_type jump_in_gradients(const unsigned int interface_dof_index, const unsigned int q_point) const
typename FEValuesViews::Vector< dim, spacedim >::third_derivative_type third_derivative_type
hessian_type average_of_hessians(const unsigned int interface_dof_index, const unsigned int q_point) const
typename FEValuesViews::Vector< dim, spacedim >::hessian_type hessian_type
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, level_dof_access > > &cell, const unsigned int face_no, const unsigned int subface_no)
Abstract base class for mapping classes.
Definition mapping.h:318
Definition point.h:111
friend class Vector
Definition vector.h:1102
Number value_type
Definition vector.h:115
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
Point< 2 > first
Definition grid_out.cc:4639
unsigned int cell_index
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcOnlyAvailableWithHP()
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
#define DeclExceptionMsg(Exception, defaulttext)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcNotInitialized()
static ::ExceptionBase & ExcOnlyAvailableWithoutHP()
static ::ExceptionBase & ExcMessage(std::string arg1)
UpdateFlags
const Mapping< dim, spacedim > & get_default_linear_mapping(const Triangulation< dim, spacedim > &triangulation)
Definition mapping.cc:314
std::vector< index_type > data
Definition mpi.cc:734
std::size_t size
Definition mpi.cc:733
typename ::internal::FEInterfaceViews::ViewType< dim, spacedim, Extractor >::type View
void reference_cell(Triangulation< dim, spacedim > &tria, const ReferenceCell< dim > &reference_cell)
*  *  *  ScaleZFunction< dim, Number, components >::ScaleZFunction *  component(component)
*  *  *  *  std::vector< Number > ThermoPlasticMaterial< dim, ViscoplasticYieldLaw, Number >::get_state_parameters   const
Definition hp.h:115
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)
constexpr types::global_dof_index invalid_dof_index
Definition types.h:259
constexpr unsigned int invalid_unsigned_int
Definition types.h:228
constexpr types::fe_index invalid_fe_index
Definition types.h:250
boost::integer_range< IncrementableType > iota_view
Definition iota_view.h:43
STL namespace.
InterfaceData(const unsigned int face_no, const unsigned int sub_face_no, const unsigned int face_no_neighbor, const unsigned int sub_face_no_neighbor)
typename internal::ProductTypeImpl< std::decay_t< T >, std::decay_t< U > >::type type