Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
vector_tools.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2019 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_vector_tools_h
17 #define dealii_vector_tools_h
18 
19 
20 #include <deal.II/base/config.h>
21 
22 #include <deal.II/base/exceptions.h>
23 #include <deal.II/base/function.h>
24 #include <deal.II/base/patterns.h>
25 #include <deal.II/base/point.h>
26 #include <deal.II/base/quadrature_lib.h>
27 
28 #include <deal.II/dofs/deprecated_function_map.h>
29 #include <deal.II/dofs/dof_handler.h>
30 
31 #include <deal.II/hp/dof_handler.h>
32 #include <deal.II/hp/mapping_collection.h>
33 
34 #include <functional>
35 #include <map>
36 #include <set>
37 #include <vector>
38 
39 DEAL_II_NAMESPACE_OPEN
40 
41 template <int dim, typename RangeNumberType>
42 class Function;
43 template <int dim>
44 class Quadrature;
45 template <int dim>
46 class QGauss;
47 template <int dim, typename number>
48 class MatrixFree;
49 
50 template <typename number>
51 class Vector;
52 template <typename number>
53 class FullMatrix;
54 template <int dim, int spacedim>
55 class Mapping;
56 template <typename gridtype>
57 class InterGridMap;
58 namespace hp
59 {
60  template <int dim>
61  class QCollection;
62 }
63 template <typename number>
64 class AffineConstraints;
65 
66 
67 // TODO: Move documentation of functions to the functions!
68 
334 namespace VectorTools
335 {
361  enum NormType
362  {
388 
404 
422 
440 
457 
474 
495 
513 
530 
549 
567 
583 
584  };
589 
590 
591 
611  template <int dim,
612  int spacedim,
613  typename VectorType,
614  template <int, int> class DoFHandlerType>
615  void
616  interpolate(
617  const Mapping<dim, spacedim> & mapping,
618  const DoFHandlerType<dim, spacedim> & dof,
620  VectorType & vec,
621  const ComponentMask &component_mask = ComponentMask());
622 
627  template <int dim,
628  int spacedim,
629  typename VectorType,
630  template <int, int> class DoFHandlerType>
631  void
632  interpolate(
633  const DoFHandlerType<dim, spacedim> & dof,
635  VectorType & vec,
636  const ComponentMask &component_mask = ComponentMask());
637 
654  template <int dim, class InVector, class OutVector, int spacedim>
655  void
657  const DoFHandler<dim, spacedim> &dof_2,
658  const FullMatrix<double> & transfer,
659  const InVector & data_1,
660  OutVector & data_2);
661 
710  template <int dim,
711  int spacedim,
712  typename VectorType,
713  template <int, int> class DoFHandlerType>
714  void
716  const Mapping<dim, spacedim> & mapping,
717  const DoFHandlerType<dim, spacedim> &dof_handler,
718  const std::map<types::material_id,
720  & function_map,
721  VectorType & dst,
722  const ComponentMask &component_mask = ComponentMask());
723 
748  template <int dim,
749  int spacedim,
750  typename VectorType,
751  template <int, int> class DoFHandlerType>
752  void
753  interpolate_to_different_mesh(const DoFHandlerType<dim, spacedim> &dof1,
754  const VectorType & u1,
755  const DoFHandlerType<dim, spacedim> &dof2,
756  VectorType & u2);
757 
771  template <int dim,
772  int spacedim,
773  typename VectorType,
774  template <int, int> class DoFHandlerType>
775  void
777  const DoFHandlerType<dim, spacedim> & dof1,
778  const VectorType & u1,
779  const DoFHandlerType<dim, spacedim> & dof2,
781  VectorType & u2);
782 
790  template <int dim,
791  int spacedim,
792  typename VectorType,
793  template <int, int> class DoFHandlerType>
794  void
796  const InterGridMap<DoFHandlerType<dim, spacedim>> & intergridmap,
797  const VectorType & u1,
799  VectorType & u2);
800 
881  template <int dim, typename VectorType, int spacedim>
882  void
883  project(const Mapping<dim, spacedim> & mapping,
884  const DoFHandler<dim, spacedim> & dof,
886  const Quadrature<dim> & quadrature,
888  VectorType & vec,
889  const bool enforce_zero_boundary = false,
890  const Quadrature<dim - 1> &q_boundary = (dim > 1 ?
891  QGauss<dim - 1>(2) :
893  const bool project_to_boundary_first = false);
894 
899  template <int dim, typename VectorType, int spacedim>
900  void
903  const Quadrature<dim> & quadrature,
905  VectorType & vec,
906  const bool enforce_zero_boundary = false,
907  const Quadrature<dim - 1> &q_boundary = (dim > 1 ?
908  QGauss<dim - 1>(2) :
910  const bool project_to_boundary_first = false);
911 
916  template <int dim, typename VectorType, int spacedim>
917  void
919  const hp::DoFHandler<dim, spacedim> & dof,
921  const hp::QCollection<dim> & quadrature,
923  VectorType & vec,
924  const bool enforce_zero_boundary = false,
926  dim > 1 ? QGauss<dim - 1>(2) : Quadrature<dim - 1>(0)),
927  const bool project_to_boundary_first = false);
928 
933  template <int dim, typename VectorType, int spacedim>
934  void
937  const hp::QCollection<dim> & quadrature,
939  VectorType & vec,
940  const bool enforce_zero_boundary = false,
942  dim > 1 ? QGauss<dim - 1>(2) : Quadrature<dim - 1>(0)),
943  const bool project_to_boundary_first = false);
944 
969  template <int dim, typename VectorType, int spacedim>
970  void
971  project(const Mapping<dim, spacedim> & mapping,
972  const DoFHandler<dim, spacedim> & dof,
974  const Quadrature<dim> & quadrature,
975  const std::function<typename VectorType::value_type(
977  const unsigned int)> & func,
978  VectorType & vec_result);
979 
1008  template <int dim, typename VectorType>
1009  void
1010  project(std::shared_ptr<
1013  const unsigned int n_q_points_1d,
1015  const unsigned int,
1016  const unsigned int)> &func,
1017  VectorType & vec_result,
1018  const unsigned int fe_component = 0);
1019 
1024  template <int dim, typename VectorType>
1025  void
1026  project(std::shared_ptr<
1030  const unsigned int,
1031  const unsigned int)> & func,
1032  VectorType & vec_result,
1033  const unsigned int fe_component = 0);
1034 
1085  template <int dim,
1086  int spacedim,
1087  template <int, int> class DoFHandlerType,
1088  typename number>
1089  void
1091  const Mapping<dim, spacedim> & mapping,
1092  const DoFHandlerType<dim, spacedim> &dof,
1093  const std::map<types::boundary_id, const Function<spacedim, number> *>
1094  & function_map,
1095  std::map<types::global_dof_index, number> &boundary_values,
1096  const ComponentMask &component_mask = ComponentMask());
1097 
1102  template <int dim, int spacedim, typename number>
1103  void
1105  const hp::MappingCollection<dim, spacedim> &mapping,
1106  const hp::DoFHandler<dim, spacedim> & dof,
1107  const std::map<types::boundary_id, const Function<spacedim, number> *>
1108  & function_map,
1109  std::map<types::global_dof_index, number> &boundary_values,
1110  const ComponentMask &component_mask = ComponentMask());
1111 
1121  template <int dim,
1122  int spacedim,
1123  template <int, int> class DoFHandlerType,
1124  typename number>
1125  void
1127  const Mapping<dim, spacedim> & mapping,
1128  const DoFHandlerType<dim, spacedim> & dof,
1129  const types::boundary_id boundary_component,
1130  const Function<spacedim, number> & boundary_function,
1131  std::map<types::global_dof_index, number> &boundary_values,
1132  const ComponentMask &component_mask = ComponentMask());
1133 
1143  template <int dim,
1144  int spacedim,
1145  template <int, int> class DoFHandlerType,
1146  typename number>
1147  void
1149  const DoFHandlerType<dim, spacedim> & dof,
1150  const types::boundary_id boundary_component,
1151  const Function<spacedim, number> & boundary_function,
1152  std::map<types::global_dof_index, number> &boundary_values,
1153  const ComponentMask &component_mask = ComponentMask());
1154 
1155 
1162  template <int dim,
1163  int spacedim,
1164  template <int, int> class DoFHandlerType,
1165  typename number>
1166  void
1168  const DoFHandlerType<dim, spacedim> &dof,
1169  const std::map<types::boundary_id, const Function<spacedim, number> *>
1170  & function_map,
1171  std::map<types::global_dof_index, number> &boundary_values,
1172  const ComponentMask &component_mask = ComponentMask());
1173 
1174 
1236  template <int dim,
1237  int spacedim,
1238  template <int, int> class DoFHandlerType,
1239  typename number>
1240  void
1242  const Mapping<dim, spacedim> & mapping,
1243  const DoFHandlerType<dim, spacedim> &dof,
1244  const std::map<types::boundary_id, const Function<spacedim, number> *>
1245  & function_map,
1246  AffineConstraints<number> &constraints,
1247  const ComponentMask & component_mask = ComponentMask());
1248 
1260  template <int dim,
1261  int spacedim,
1262  template <int, int> class DoFHandlerType,
1263  typename number>
1264  void
1266  const Mapping<dim, spacedim> & mapping,
1267  const DoFHandlerType<dim, spacedim> &dof,
1268  const types::boundary_id boundary_component,
1269  const Function<spacedim, number> & boundary_function,
1270  AffineConstraints<number> & constraints,
1271  const ComponentMask & component_mask = ComponentMask());
1272 
1284  template <int dim,
1285  int spacedim,
1286  template <int, int> class DoFHandlerType,
1287  typename number>
1288  void
1290  const DoFHandlerType<dim, spacedim> &dof,
1291  const types::boundary_id boundary_component,
1292  const Function<spacedim, number> & boundary_function,
1293  AffineConstraints<number> & constraints,
1294  const ComponentMask & component_mask = ComponentMask());
1295 
1296 
1305  template <int dim,
1306  int spacedim,
1307  template <int, int> class DoFHandlerType,
1308  typename number>
1309  void
1311  const DoFHandlerType<dim, spacedim> &dof,
1312  const std::map<types::boundary_id, const Function<spacedim, number> *>
1313  & function_map,
1314  AffineConstraints<number> &constraints,
1315  const ComponentMask & component_mask = ComponentMask());
1316 
1317 
1382  template <int dim, int spacedim, typename number>
1383  void
1385  const Mapping<dim, spacedim> & mapping,
1386  const DoFHandler<dim, spacedim> &dof,
1387  const std::map<types::boundary_id, const Function<spacedim, number> *>
1388  & boundary_functions,
1389  const Quadrature<dim - 1> & q,
1390  std::map<types::global_dof_index, number> &boundary_values,
1391  std::vector<unsigned int> component_mapping = {});
1392 
1397  template <int dim, int spacedim, typename number>
1398  void
1400  const DoFHandler<dim, spacedim> &dof,
1401  const std::map<types::boundary_id, const Function<spacedim, number> *>
1402  & boundary_function,
1403  const Quadrature<dim - 1> & q,
1404  std::map<types::global_dof_index, number> &boundary_values,
1405  std::vector<unsigned int> component_mapping = {});
1406 
1410  template <int dim, int spacedim, typename number>
1411  void
1413  const hp::MappingCollection<dim, spacedim> &mapping,
1414  const hp::DoFHandler<dim, spacedim> & dof,
1415  const std::map<types::boundary_id, const Function<spacedim, number> *>
1416  & boundary_functions,
1417  const hp::QCollection<dim - 1> & q,
1418  std::map<types::global_dof_index, number> &boundary_values,
1419  std::vector<unsigned int> component_mapping = {});
1420 
1425  template <int dim, int spacedim, typename number>
1426  void
1428  const hp::DoFHandler<dim, spacedim> &dof,
1429  const std::map<types::boundary_id, const Function<spacedim, number> *>
1430  & boundary_function,
1431  const hp::QCollection<dim - 1> & q,
1432  std::map<types::global_dof_index, number> &boundary_values,
1433  std::vector<unsigned int> component_mapping = {});
1434 
1473  template <int dim, int spacedim, typename number>
1474  void
1476  const Mapping<dim, spacedim> & mapping,
1477  const DoFHandler<dim, spacedim> &dof,
1478  const std::map<types::boundary_id, const Function<spacedim, number> *>
1479  & boundary_functions,
1480  const Quadrature<dim - 1> &q,
1481  AffineConstraints<number> &constraints,
1482  std::vector<unsigned int> component_mapping = {});
1483 
1490  template <int dim, int spacedim, typename number>
1491  void
1493  const DoFHandler<dim, spacedim> &dof,
1494  const std::map<types::boundary_id, const Function<spacedim, number> *>
1495  & boundary_function,
1496  const Quadrature<dim - 1> &q,
1497  AffineConstraints<number> &constraints,
1498  std::vector<unsigned int> component_mapping = {});
1499 
1500 
1558  template <int dim>
1559  DEAL_II_DEPRECATED void
1561  const DoFHandler<dim> & dof_handler,
1562  const unsigned int first_vector_component,
1563  const Function<dim, double> &boundary_function,
1564  const types::boundary_id boundary_component,
1565  AffineConstraints<double> & constraints,
1566  const Mapping<dim> & mapping = StaticMappingQ1<dim>::mapping);
1567 
1579  template <int dim>
1580  DEAL_II_DEPRECATED void
1582  const hp::DoFHandler<dim> & dof_handler,
1583  const unsigned int first_vector_component,
1584  const Function<dim, double> & boundary_function,
1585  const types::boundary_id boundary_component,
1586  AffineConstraints<double> & constraints,
1587  const hp::MappingCollection<dim, dim> &mapping_collection =
1589 
1685  template <int dim>
1686  void
1688  const DoFHandler<dim> & dof_handler,
1689  const unsigned int first_vector_component,
1690  const Function<dim, double> &boundary_function,
1691  const types::boundary_id boundary_component,
1692  AffineConstraints<double> & constraints,
1693  const Mapping<dim> & mapping = StaticMappingQ1<dim>::mapping);
1694 
1695 
1702  template <int dim>
1703  void
1705  const hp::DoFHandler<dim> & dof_handler,
1706  const unsigned int first_vector_component,
1707  const Function<dim, double> & boundary_function,
1708  const types::boundary_id boundary_component,
1709  AffineConstraints<double> & constraints,
1710  const hp::MappingCollection<dim, dim> &mapping_collection =
1712 
1713 
1760  template <int dim>
1761  void
1763  const DoFHandler<dim> & dof_handler,
1764  const unsigned int first_vector_component,
1765  const Function<dim, double> &boundary_function,
1766  const types::boundary_id boundary_component,
1767  AffineConstraints<double> & constraints,
1768  const Mapping<dim> & mapping = StaticMappingQ1<dim>::mapping);
1769 
1778  template <int dim>
1779  void
1781  const hp::DoFHandler<dim> & dof_handler,
1782  const unsigned int first_vector_component,
1783  const Function<dim, double> & boundary_function,
1784  const types::boundary_id boundary_component,
1785  AffineConstraints<double> & constraints,
1786  const hp::MappingCollection<dim, dim> &mapping_collection =
1788 
1789 
2017  template <int dim, int spacedim, template <int, int> class DoFHandlerType>
2018  void
2020  const DoFHandlerType<dim, spacedim> &dof_handler,
2021  const unsigned int first_vector_component,
2022  const std::set<types::boundary_id> & boundary_ids,
2023  const std::map<types::boundary_id, const Function<spacedim> *>
2024  & function_map,
2025  AffineConstraints<double> & constraints,
2027 
2040  template <int dim, int spacedim, template <int, int> class DoFHandlerType>
2041  void
2043  const DoFHandlerType<dim, spacedim> &dof_handler,
2044  const unsigned int first_vector_component,
2045  const std::set<types::boundary_id> & boundary_ids,
2046  AffineConstraints<double> & constraints,
2048 
2065  template <int dim, int spacedim, template <int, int> class DoFHandlerType>
2066  void
2068  const DoFHandlerType<dim, spacedim> &dof_handler,
2069  const unsigned int first_vector_component,
2070  const std::set<types::boundary_id> & boundary_ids,
2071  const std::map<types::boundary_id, const Function<spacedim> *>
2072  & function_map,
2073  AffineConstraints<double> & constraints,
2075 
2084  template <int dim, int spacedim, template <int, int> class DoFHandlerType>
2085  void
2087  const DoFHandlerType<dim, spacedim> &dof_handler,
2088  const unsigned int first_vector_component,
2089  const std::set<types::boundary_id> & boundary_ids,
2090  AffineConstraints<double> & constraints,
2092 
2093 
2095 
2099 
2106  template <int dim, int spacedim, typename VectorType>
2107  void
2109  const Mapping<dim, spacedim> & mapping,
2110  const DoFHandler<dim, spacedim> & dof,
2111  const Quadrature<dim> & q,
2113  VectorType & rhs_vector,
2116 
2121  template <int dim, int spacedim, typename VectorType>
2122  void
2124  const DoFHandler<dim, spacedim> & dof,
2125  const Quadrature<dim> & q,
2127  VectorType & rhs_vector,
2130 
2134  template <int dim, int spacedim, typename VectorType>
2135  void
2137  const hp::MappingCollection<dim, spacedim> & mapping,
2138  const hp::DoFHandler<dim, spacedim> & dof,
2139  const hp::QCollection<dim> & q,
2141  VectorType & rhs_vector,
2144 
2148  template <int dim, int spacedim, typename VectorType>
2149  void
2151  const hp::DoFHandler<dim, spacedim> & dof,
2152  const hp::QCollection<dim> & q,
2154  VectorType & rhs_vector,
2157 
2242  template <int dim, int spacedim>
2243  void
2245  const DoFHandler<dim, spacedim> &dof_handler,
2246  const Point<spacedim> & p,
2247  Vector<double> & rhs_vector);
2248 
2253  template <int dim, int spacedim>
2254  void
2256  const Point<spacedim> & p,
2257  Vector<double> & rhs_vector);
2258 
2262  template <int dim, int spacedim>
2263  void
2265  const hp::MappingCollection<dim, spacedim> &mapping,
2266  const hp::DoFHandler<dim, spacedim> & dof_handler,
2267  const Point<spacedim> & p,
2268  Vector<double> & rhs_vector);
2269 
2276  template <int dim, int spacedim>
2277  void
2279  const Point<spacedim> & p,
2280  Vector<double> & rhs_vector);
2281 
2300  template <int dim, int spacedim>
2301  void
2303  const DoFHandler<dim, spacedim> &dof_handler,
2304  const Point<spacedim> & p,
2305  const Point<dim> & direction,
2306  Vector<double> & rhs_vector);
2307 
2312  template <int dim, int spacedim>
2313  void
2315  const Point<spacedim> & p,
2316  const Point<dim> & direction,
2317  Vector<double> & rhs_vector);
2318 
2322  template <int dim, int spacedim>
2323  void
2325  const hp::MappingCollection<dim, spacedim> &mapping,
2326  const hp::DoFHandler<dim, spacedim> & dof_handler,
2327  const Point<spacedim> & p,
2328  const Point<dim> & direction,
2329  Vector<double> & rhs_vector);
2330 
2337  template <int dim, int spacedim>
2338  void
2340  const Point<spacedim> & p,
2341  const Point<dim> & direction,
2342  Vector<double> & rhs_vector);
2343 
2353  template <int dim, int spacedim, typename VectorType>
2354  void
2356  const Mapping<dim, spacedim> & mapping,
2357  const DoFHandler<dim, spacedim> & dof,
2358  const Quadrature<dim - 1> & q,
2360  VectorType & rhs_vector,
2361  const std::set<types::boundary_id> & boundary_ids =
2362  std::set<types::boundary_id>());
2363 
2371  template <int dim, int spacedim, typename VectorType>
2372  void
2374  const DoFHandler<dim, spacedim> & dof,
2375  const Quadrature<dim - 1> & q,
2377  VectorType & rhs_vector,
2378  const std::set<types::boundary_id> & boundary_ids =
2379  std::set<types::boundary_id>());
2380 
2387  template <int dim, int spacedim, typename VectorType>
2388  void
2390  const hp::MappingCollection<dim, spacedim> & mapping,
2391  const hp::DoFHandler<dim, spacedim> & dof,
2392  const hp::QCollection<dim - 1> & q,
2394  VectorType & rhs_vector,
2395  const std::set<types::boundary_id> & boundary_ids =
2396  std::set<types::boundary_id>());
2397 
2406  template <int dim, int spacedim, typename VectorType>
2407  void
2409  const hp::DoFHandler<dim, spacedim> & dof,
2410  const hp::QCollection<dim - 1> & q,
2412  VectorType & rhs_vector,
2413  const std::set<types::boundary_id> & boundary_ids =
2414  std::set<types::boundary_id>());
2415 
2417 
2421 
2509  template <int dim, class InVector, class OutVector, int spacedim>
2510  void
2512  const DoFHandler<dim, spacedim> & dof,
2513  const InVector & fe_function,
2514  const Function<spacedim, double> &exact_solution,
2515  OutVector & difference,
2516  const Quadrature<dim> & q,
2517  const NormType & norm,
2518  const Function<spacedim, double> *weight = nullptr,
2519  const double exponent = 2.);
2520 
2525  template <int dim, class InVector, class OutVector, int spacedim>
2526  void
2528  const InVector & fe_function,
2529  const Function<spacedim, double> &exact_solution,
2530  OutVector & difference,
2531  const Quadrature<dim> & q,
2532  const NormType & norm,
2533  const Function<spacedim, double> *weight = nullptr,
2534  const double exponent = 2.);
2535 
2539  template <int dim, class InVector, class OutVector, int spacedim>
2540  void
2542  const hp::DoFHandler<dim, spacedim> & dof,
2543  const InVector & fe_function,
2544  const Function<spacedim, double> &exact_solution,
2545  OutVector & difference,
2546  const hp::QCollection<dim> & q,
2547  const NormType & norm,
2548  const Function<spacedim, double> *weight = nullptr,
2549  const double exponent = 2.);
2550 
2555  template <int dim, class InVector, class OutVector, int spacedim>
2556  void
2558  const InVector & fe_function,
2559  const Function<spacedim, double> & exact_solution,
2560  OutVector & difference,
2561  const hp::QCollection<dim> & q,
2562  const NormType & norm,
2563  const Function<spacedim, double> * weight = nullptr,
2564  const double exponent = 2.);
2565 
2591  template <int dim, int spacedim, class InVector>
2592  double
2594  const InVector & cellwise_error,
2595  const NormType & norm,
2596  const double exponent = 2.);
2597 
2610  template <int dim, typename VectorType, int spacedim>
2611  void
2613  const DoFHandler<dim, spacedim> & dof,
2614  const VectorType & fe_function,
2617  const Point<spacedim> & point);
2618 
2631  template <int dim, typename VectorType, int spacedim>
2632  void
2634  const Mapping<dim, spacedim> & mapping,
2635  const DoFHandler<dim, spacedim> & dof,
2636  const VectorType & fe_function,
2639  const Point<spacedim> & point);
2640 
2677  template <int dim, typename VectorType, int spacedim>
2678  void
2680  const VectorType & fe_function,
2681  const Point<spacedim> & point,
2683 
2701  template <int dim, typename VectorType, int spacedim>
2702  void
2704  const VectorType & fe_function,
2705  const Point<spacedim> & point,
2707 
2747  template <int dim, typename VectorType, int spacedim>
2748  typename VectorType::value_type
2750  const VectorType & fe_function,
2751  const Point<spacedim> & point);
2752 
2770  template <int dim, typename VectorType, int spacedim>
2771  typename VectorType::value_type
2773  const VectorType & fe_function,
2774  const Point<spacedim> & point);
2775 
2810  template <int dim, typename VectorType, int spacedim>
2811  void
2812  point_value(const Mapping<dim, spacedim> & mapping,
2813  const DoFHandler<dim, spacedim> & dof,
2814  const VectorType & fe_function,
2815  const Point<spacedim> & point,
2817 
2835  template <int dim, typename VectorType, int spacedim>
2836  void
2838  const hp::DoFHandler<dim, spacedim> & dof,
2839  const VectorType & fe_function,
2840  const Point<spacedim> & point,
2842 
2876  template <int dim, typename VectorType, int spacedim>
2877  typename VectorType::value_type
2878  point_value(const Mapping<dim, spacedim> & mapping,
2879  const DoFHandler<dim, spacedim> &dof,
2880  const VectorType & fe_function,
2881  const Point<spacedim> & point);
2882 
2900  template <int dim, typename VectorType, int spacedim>
2901  typename VectorType::value_type
2903  const hp::DoFHandler<dim, spacedim> & dof,
2904  const VectorType & fe_function,
2905  const Point<spacedim> & point);
2906 
2939  template <int dim, typename VectorType, int spacedim>
2940  void
2942  const DoFHandler<dim, spacedim> &dof,
2943  const VectorType & fe_function,
2944  const Point<spacedim> & point,
2946 
2963  template <int dim, typename VectorType, int spacedim>
2964  void
2966  const hp::DoFHandler<dim, spacedim> &dof,
2967  const VectorType & fe_function,
2968  const Point<spacedim> & point,
2970 
3003  template <int dim, typename VectorType, int spacedim>
3006  const VectorType & fe_function,
3007  const Point<spacedim> & point);
3008 
3025  template <int dim, typename VectorType, int spacedim>
3028  const VectorType & fe_function,
3029  const Point<spacedim> & point);
3030 
3063  template <int dim, typename VectorType, int spacedim>
3064  void
3066  const Mapping<dim, spacedim> & mapping,
3067  const DoFHandler<dim, spacedim> &dof,
3068  const VectorType & fe_function,
3069  const Point<spacedim> & point,
3071 
3088  template <int dim, typename VectorType, int spacedim>
3089  void
3091  const hp::MappingCollection<dim, spacedim> &mapping,
3092  const hp::DoFHandler<dim, spacedim> & dof,
3093  const VectorType & fe_function,
3094  const Point<spacedim> & point,
3096 
3129  template <int dim, typename VectorType, int spacedim>
3131  point_gradient(const Mapping<dim, spacedim> & mapping,
3132  const DoFHandler<dim, spacedim> &dof,
3133  const VectorType & fe_function,
3134  const Point<spacedim> & point);
3135 
3152  template <int dim, typename VectorType, int spacedim>
3155  const hp::DoFHandler<dim, spacedim> & dof,
3156  const VectorType & fe_function,
3157  const Point<spacedim> & point);
3158 
3160 
3164 
3214  template <typename VectorType>
3215  void
3216  subtract_mean_value(VectorType &v, const std::vector<bool> &p_select = {});
3217 
3218 
3242  template <int dim, typename VectorType, int spacedim>
3243  typename VectorType::value_type
3245  const DoFHandler<dim, spacedim> &dof,
3246  const Quadrature<dim> & quadrature,
3247  const VectorType & v,
3248  const unsigned int component);
3249 
3254  template <int dim, typename VectorType, int spacedim>
3255  typename VectorType::value_type
3257  const Quadrature<dim> & quadrature,
3258  const VectorType & v,
3259  const unsigned int component);
3261 
3291  template <int dim,
3292  int spacedim,
3293  template <int, int> class DoFHandlerType,
3294  typename VectorType>
3295  void
3296  get_position_vector(const DoFHandlerType<dim, spacedim> &dh,
3297  VectorType & vector,
3298  const ComponentMask &mask = ComponentMask());
3299 
3301 
3306  "The given point is inside a cell of a "
3307  "parallel::distributed::Triangulation that is not "
3308  "locally owned by this processor.");
3309 } // namespace VectorTools
3310 
3311 
3312 // Make sure we can use NormType with Patterns.
3313 namespace Patterns
3314 {
3315  namespace Tools
3316  {
3317  template <>
3318  struct Convert<VectorTools::NormType, void>
3319  {
3323  static std::unique_ptr<Patterns::PatternBase>
3324  to_pattern()
3325  {
3326  return std_cxx14::make_unique<Patterns::Selection>(
3327  "mean|L1_norm|L2_norm|Lp_norm|"
3328  "Linfty_norm|H1_seminorm|Hdiv_seminorm|"
3329  "H1_norm|W1p_seminorm|W1p_norm|"
3330  "W1infty_seminorm|W1infty_norm");
3331  }
3332 
3333 
3334 
3338  static std::string
3339  to_string(const VectorTools::NormType & s,
3340  const std::unique_ptr<Patterns::PatternBase> &p =
3342  {
3343  std::string str;
3344  if (s == VectorTools::mean)
3345  str = "mean";
3346  else if (s == VectorTools::L1_norm)
3347  str = "L1_norm";
3348  else if (s == VectorTools::L2_norm)
3349  str = "L2_norm";
3350  else if (s == VectorTools::Lp_norm)
3351  str = "Lp_norm";
3352  else if (s == VectorTools::Linfty_norm)
3353  str = "Linfty_norm";
3354  else if (s == VectorTools::H1_seminorm)
3355  str = "H1_seminorm";
3356  else if (s == VectorTools::Hdiv_seminorm)
3357  str = "Hdiv_seminorm";
3358  else if (s == VectorTools::H1_norm)
3359  str = "H1_norm";
3360  else if (s == VectorTools::W1p_seminorm)
3361  str = "W1p_seminorm";
3362  else if (s == VectorTools::W1infty_seminorm)
3363  str = "W1infty_seminorm";
3364  else if (s == VectorTools::W1infty_norm)
3365  str = "W1infty_norm";
3366  else if (s == VectorTools::W1p_norm)
3367  str = "W1p_norm";
3368  else
3369  {
3370  AssertThrow(false, ExcMessage("Didn't recognize a norm type."));
3371  }
3372  AssertThrow(p->match(str), ExcInternalError());
3373  return str;
3374  }
3375 
3376 
3380  static VectorTools::NormType
3381  to_value(const std::string & str,
3382  const std::unique_ptr<Patterns::PatternBase> &p =
3384  {
3386  AssertThrow(p->match(str),
3387  ExcMessage(
3388  "String " + str +
3389  " cannot be converted to VectorTools::NormType"));
3390 
3391  if (str == "mean")
3393  else if (str == "L1_norm")
3395  else if (str == "L2_norm")
3397  else if (str == "Lp_norm")
3399  else if (str == "Linfty_norm")
3401  else if (str == "H1_seminorm")
3403  else if (str == "Hdiv_seminorm")
3405  else if (str == "H1_norm")
3407  else if (str == "W1p_seminorm")
3409  else if (str == "W1infty_seminorm")
3411  else if (str == "W1infty_norm")
3413  else if (str == "W1p_norm")
3415  else
3416  {
3417  AssertThrow(false, ExcMessage("Didn't recognize a norm type."));
3418  }
3419  return norm;
3420  }
3421  };
3422  } // namespace Tools
3423 } // namespace Patterns
3424 
3425 DEAL_II_NAMESPACE_CLOSE
3426 
3427 #endif
void integrate_difference(const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof, const InVector &fe_function, const Function< spacedim, double > &exact_solution, OutVector &difference, const Quadrature< dim > &q, const NormType &norm, const Function< spacedim, double > *weight=nullptr, const double exponent=2.)
void point_value(const DoFHandler< dim, spacedim > &dof, const VectorType &fe_function, const Point< spacedim > &point, Vector< typename VectorType::value_type > &value)
void point_gradient(const DoFHandler< dim, spacedim > &dof, const VectorType &fe_function, const Point< spacedim > &point, std::vector< Tensor< 1, spacedim, typename VectorType::value_type >> &value)
void compute_normal_flux_constraints(const DoFHandlerType< dim, spacedim > &dof_handler, const unsigned int first_vector_component, const std::set< types::boundary_id > &boundary_ids, AffineConstraints< double > &constraints, const Mapping< dim, spacedim > &mapping=StaticMappingQ1< dim >::mapping)
void project_boundary_values_curl_conforming_l2(const DoFHandler< dim > &dof_handler, const unsigned int first_vector_component, const Function< dim, double > &boundary_function, const types::boundary_id boundary_component, AffineConstraints< double > &constraints, const Mapping< dim > &mapping=StaticMappingQ1< dim >::mapping)
void point_difference(const DoFHandler< dim, spacedim > &dof, const VectorType &fe_function, const Function< spacedim, typename VectorType::value_type > &exact_solution, Vector< typename VectorType::value_type > &difference, const Point< spacedim > &point)
static T to_value(const std::string &s, const std::unique_ptr< Patterns::PatternBase > &p=Convert< T >::to_pattern())=delete
void interpolate_based_on_material_id(const Mapping< dim, spacedim > &mapping, const DoFHandlerType< dim, spacedim > &dof_handler, const std::map< types::material_id, const Function< spacedim, typename VectorType::value_type > *> &function_map, VectorType &dst, const ComponentMask &component_mask=ComponentMask())
static std::unique_ptr< Patterns::PatternBase > to_pattern()=delete
void compute_nonzero_tangential_flux_constraints(const DoFHandlerType< dim, spacedim > &dof_handler, const unsigned int first_vector_component, const std::set< types::boundary_id > &boundary_ids, const std::map< types::boundary_id, const Function< spacedim > *> &function_map, AffineConstraints< double > &constraints, const Mapping< dim, spacedim > &mapping=StaticMappingQ1< dim >::mapping)
unsigned int material_id
Definition: types.h:134
double norm(const FEValuesBase< dim > &fe, const ArrayView< const std::vector< Tensor< 1, dim >>> &Du)
Definition: divergence.h:548
void compute_nonzero_normal_flux_constraints(const DoFHandlerType< dim, spacedim > &dof_handler, const unsigned int first_vector_component, const std::set< types::boundary_id > &boundary_ids, const std::map< types::boundary_id, const Function< spacedim > *> &function_map, AffineConstraints< double > &constraints, const Mapping< dim, spacedim > &mapping=StaticMappingQ1< dim >::mapping)
#define AssertThrow(cond, exc)
Definition: exceptions.h:1519
void create_right_hand_side(const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof, const Quadrature< dim > &q, const Function< spacedim, typename VectorType::value_type > &rhs, VectorType &rhs_vector, const AffineConstraints< typename VectorType::value_type > &constraints=AffineConstraints< typename VectorType::value_type >())
void project_boundary_values_div_conforming(const DoFHandler< dim > &dof_handler, const unsigned int first_vector_component, const Function< dim, double > &boundary_function, const types::boundary_id boundary_component, AffineConstraints< double > &constraints, const Mapping< dim > &mapping=StaticMappingQ1< dim >::mapping)
LinearAlgebra::distributed::Vector< Number > Vector
static ::ExceptionBase & ExcMessage(std::string arg1)
void get_position_vector(const DoFHandlerType< dim, spacedim > &dh, VectorType &vector, const ComponentMask &mask=ComponentMask())
Abstract base class for mapping classes.
Definition: dof_tools.h:57
#define DeclExceptionMsg(Exception, defaulttext)
Definition: exceptions.h:496
static ::ExceptionBase & ExcPointNotAvailableHere()
void interpolate(const Mapping< dim, spacedim > &mapping, const DoFHandlerType< dim, spacedim > &dof, const Function< spacedim, typename VectorType::value_type > &function, VectorType &vec, const ComponentMask &component_mask=ComponentMask())
void create_point_source_vector(const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof_handler, const Point< spacedim > &p, Vector< double > &rhs_vector)
VectorType::value_type compute_mean_value(const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof, const Quadrature< dim > &quadrature, const VectorType &v, const unsigned int component)
Definition: hp.h:117
void interpolate_boundary_values(const Mapping< dim, spacedim > &mapping, const DoFHandlerType< dim, spacedim > &dof, const std::map< types::boundary_id, const Function< spacedim, number > *> &function_map, std::map< types::global_dof_index, number > &boundary_values, const ComponentMask &component_mask=ComponentMask())
Definition: mpi.h:90
void project_boundary_values(const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof, const std::map< types::boundary_id, const Function< spacedim, number > *> &boundary_functions, const Quadrature< dim - 1 > &q, std::map< types::global_dof_index, number > &boundary_values, std::vector< unsigned int > component_mapping={})
void subtract_mean_value(VectorType &v, const std::vector< bool > &p_select={})
void compute_no_normal_flux_constraints(const DoFHandlerType< dim, spacedim > &dof_handler, const unsigned int first_vector_component, const std::set< types::boundary_id > &boundary_ids, AffineConstraints< double > &constraints, const Mapping< dim, spacedim > &mapping=StaticMappingQ1< dim >::mapping)
void create_boundary_right_hand_side(const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof, const Quadrature< dim - 1 > &q, const Function< spacedim, typename VectorType::value_type > &rhs, VectorType &rhs_vector, const std::set< types::boundary_id > &boundary_ids=std::set< types::boundary_id >())
typename ActiveSelector::active_cell_iterator active_cell_iterator
Definition: dof_handler.h:324
double compute_global_error(const Triangulation< dim, spacedim > &tria, const InVector &cellwise_error, const NormType &norm, const double exponent=2.)
unsigned int boundary_id
Definition: types.h:111
void project_boundary_values_curl_conforming(const DoFHandler< dim > &dof_handler, const unsigned int first_vector_component, const Function< dim, double > &boundary_function, const types::boundary_id boundary_component, AffineConstraints< double > &constraints, const Mapping< dim > &mapping=StaticMappingQ1< dim >::mapping)
void project(const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof, const AffineConstraints< typename VectorType::value_type > &constraints, const Quadrature< dim > &quadrature, const Function< spacedim, typename VectorType::value_type > &function, VectorType &vec, const bool enforce_zero_boundary=false, const Quadrature< dim - 1 > &q_boundary=(dim > 1 ? QGauss< dim - 1 >(2) :Quadrature< dim - 1 >(0)), const bool project_to_boundary_first=false)
void interpolate_to_different_mesh(const DoFHandlerType< dim, spacedim > &dof1, const VectorType &u1, const DoFHandlerType< dim, spacedim > &dof2, VectorType &u2)
static ::ExceptionBase & ExcInternalError()
static std::string to_string(const T &s, const std::unique_ptr< Patterns::PatternBase > &p=Convert< T >::to_pattern())=delete