16 #ifndef dealii_fe_tools_H 17 #define dealii_fe_tools_H 21 #include <deal.II/base/config.h> 22 #include <deal.II/base/subscriptor.h> 23 #include <deal.II/base/exceptions.h> 24 #include <deal.II/base/geometry_info.h> 25 #include <deal.II/base/tensor.h> 27 #include <deal.II/base/std_cxx14/memory.h> 28 #include <deal.II/distributed/tria.h> 29 #include <deal.II/fe/component_mask.h> 30 #include <deal.II/lac/parallel_vector.h> 38 DEAL_II_NAMESPACE_OPEN
43 template <
int dim,
int spacedim>
class DoFHandler;
80 template <
int dim,
int spacedim=dim>
87 virtual std::unique_ptr<FiniteElement<dim,spacedim> >
88 get (
const unsigned int degree)
const = 0;
95 virtual std::unique_ptr<FiniteElement<dim,spacedim> >
122 virtual std::unique_ptr<FiniteElement<FE::dimension,FE::space_dimension> >
123 get (
const unsigned int degree)
const;
129 virtual std::unique_ptr<FiniteElement<FE::dimension,FE::space_dimension> >
148 template <
int dim,
int spacedim>
151 std::vector<unsigned int> &renumbering,
152 std::vector<std::vector<unsigned int> > &start_indices);
169 template <
int dim,
int spacedim>
172 std::vector<types::global_dof_index> &renumbering,
173 std::vector<types::global_dof_index> &block_data,
174 bool return_start_indices =
true);
189 template <
int dim,
typename number,
int spacedim>
206 template <
int dim,
typename number,
int spacedim>
223 template <
int dim,
typename number,
int spacedim>
232 template <
int dim,
typename number,
int spacedim>
304 template <
int dim,
int spacedim>
346 template <
int dim,
typename number,
int spacedim>
349 const bool isotropic_only =
false,
350 const double threshold = 1.e-12);
373 template <
int dim,
typename number,
int spacedim>
377 const unsigned int face_coarse,
378 const unsigned int face_fine,
379 const double threshold = 1.e-12);
412 template <
int dim,
typename number,
int spacedim>
416 const bool isotropic_only =
false);
503 template <
int dim,
int spacedim>
517 template <
int dim,
int spacedim>
566 template <
int dim,
int spacedim>
572 const unsigned int face,
592 template <
int dim,
int spacedim,
typename number>
596 std::vector<number> &dof_values);
633 template <
int dim,
int spacedim,
634 template <
int,
int>
class DoFHandlerType1,
635 template <
int,
int>
class DoFHandlerType2,
636 class InVector,
class OutVector>
638 interpolate (
const DoFHandlerType1<dim,spacedim> &dof1,
640 const DoFHandlerType2<dim,spacedim> &dof2,
659 template <
int dim,
int spacedim,
660 template <
int,
int>
class DoFHandlerType1,
661 template <
int,
int>
class DoFHandlerType2,
662 class InVector,
class OutVector>
663 void interpolate (
const DoFHandlerType1<dim,spacedim> &dof1,
665 const DoFHandlerType2<dim,spacedim> &dof2,
685 template <
int,
int>
class DoFHandlerType,
686 class InVector,
class OutVector,
int spacedim>
690 OutVector &u1_interpolated);
704 template <
int dim,
class InVector,
class OutVector,
int spacedim>
710 OutVector &u1_interpolated);
721 template <
int dim,
class InVector,
class OutVector,
int spacedim>
725 OutVector &z1_difference);
739 template <
int dim,
class InVector,
class OutVector,
int spacedim>
745 OutVector &z1_difference);
757 template <
int dim,
class InVector,
class OutVector,
int spacedim>
822 template <
int dim,
class InVector,
class OutVector,
int spacedim>
840 template <
int dim,
class InVector,
class OutVector,
int spacedim>
876 std::vector<unsigned int> &h2l);
881 std::vector<unsigned int> &h2l);
888 std::vector<unsigned int>
899 std::vector<unsigned int> &l2h);
906 std::vector<unsigned int>
983 namespace Compositing
1002 template <
int dim,
int spacedim>
1005 const std::vector<unsigned int> &multiplicities,
1006 const bool do_tensor_product =
true);
1013 template <
int dim,
int spacedim>
1021 template <
int dim,
int spacedim>
1024 const unsigned int N1,
1026 const unsigned int N2=0,
1028 const unsigned int N3=0,
1030 const unsigned int N4=0,
1032 const unsigned int N5=0);
1046 template <
int dim,
int spacedim>
1049 const std::vector<unsigned int> &multiplicities);
1055 template <
int dim,
int spacedim>
1074 template <
int dim,
int spacedim>
1077 const unsigned int N1,
1079 const unsigned int N2=0,
1081 const unsigned int N3=0,
1083 const unsigned int N4=0,
1085 const unsigned int N5=0);
1104 template <
int dim,
int spacedim>
1105 std::vector<ComponentMask>
1107 const std::vector<unsigned int> &multiplicities,
1108 const bool do_tensor_product =
true);
1115 template <
int dim,
int spacedim>
1116 std::vector<ComponentMask>
1138 template <
int dim,
int spacedim>
1139 std::vector<ComponentMask>
1141 const unsigned int N1,
1143 const unsigned int N2=0,
1145 const unsigned int N3=0,
1147 const unsigned int N4=0,
1149 const unsigned int N5=0,
1150 const bool do_tensor_product =
true);
1168 template <
int dim,
int spacedim>
1170 build_cell_tables(std::vector< std::pair< std::pair< unsigned int, unsigned int >,
unsigned int > > &system_to_base_table,
1171 std::vector< std::pair< unsigned int, unsigned int > > &system_to_component_table,
1172 std::vector< std::pair< std::pair< unsigned int, unsigned int >,
unsigned int > > &component_to_base_table,
1174 const bool do_tensor_product =
true);
1191 template <
int dim,
int spacedim>
1193 build_face_tables(std::vector< std::pair< std::pair< unsigned int, unsigned int >,
unsigned int > > &face_system_to_base_table,
1194 std::vector< std::pair< unsigned int, unsigned int > > &face_system_to_component_table,
1196 const bool do_tensor_product =
true);
1234 template <
int dim,
int spacedim = dim>
1235 std::unique_ptr<FiniteElement<dim, spacedim> >
1290 template <
int dim,
int spacedim>
1305 <<
"Can't re-generate a finite element from the string '" 1321 <<
"The dimension " << arg1
1322 <<
" in the finite element string must match " 1323 <<
"the space dimension " 1355 <<
"You are using continuous elements on a grid with " 1356 <<
"hanging nodes but without providing hanging node " 1357 <<
"constraints. Use the respective function with " 1358 <<
"additional ConstraintMatrix argument(s), instead." 1373 <<
"This is a " << arg1 <<
"x" << arg2 <<
" matrix, " 1374 <<
"but should be a " << arg3 <<
"x" << arg4 <<
" matrix.");
1382 <<
"Least squares fit leaves a gap of " << arg1);
1391 << arg1 <<
" must be greater than " << arg2);
1400 std::unique_ptr<FiniteElement<FE::dimension, FE::space_dimension> >
1403 return std_cxx14::make_unique<FE>(degree);
1406 namespace Compositing
1408 template <
int dim,
int spacedim>
1413 std::vector<const FiniteElement<dim,spacedim>*> fes;
1414 std::vector<unsigned int> multiplicities;
1417 [&fes, &multiplicities]
1418 (
const std::pair<std::unique_ptr<FiniteElement<dim, spacedim>>,
unsigned int> &fe_system)
1420 fes.push_back(fe_system.first.get());
1421 multiplicities.push_back(fe_system.second);
1424 for (
const auto &p : fe_systems)
1432 template <
int dim,
int spacedim>
1437 std::vector<const FiniteElement<dim,spacedim>*> fes;
1438 std::vector<unsigned int> multiplicities;
1441 [&fes, &multiplicities]
1442 (
const std::pair<std::unique_ptr<FiniteElement<dim, spacedim>>,
unsigned int> &fe_system)
1444 fes.push_back(fe_system.first.get());
1445 multiplicities.push_back(fe_system.second);
1448 for (
const auto &p : fe_systems)
1456 template <
int dim,
int spacedim>
1457 std::vector<ComponentMask>
1461 std::vector<const FiniteElement<dim,spacedim>*> fes;
1462 std::vector<unsigned int> multiplicities;
1465 [&fes, &multiplicities]
1466 (
const std::pair<std::unique_ptr<FiniteElement<dim, spacedim>>,
unsigned int> &fe_system)
1468 fes.push_back(fe_system.first.get());
1469 multiplicities.push_back(fe_system.second);
1472 for (
const auto &p : fe_systems)
1484 DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcLeastSquaresError(double arg1)
#define DeclException2(Exception2, type1, type2, outsequence)
static ::ExceptionBase & ExcGridNotRefinedAtLeastOnce()
static ::ExceptionBase & ExcHangingNodesNotAllowed(int arg1)
ActiveSelector::active_cell_iterator active_cell_iterator
static ::ExceptionBase & ExcFENotPrimitive()
static ::ExceptionBase & ExcMatrixDimensionMismatch(int arg1, int arg2, int arg3, int arg4)
#define DeclException1(Exception1, type1, outsequence)
static ::ExceptionBase & ExcNotGreaterThan(int arg1, int arg2)
#define DeclException0(Exception0)
ReturnType< rank, T >::value_type & extract(T &t, const ArrayType &indices)
static ::ExceptionBase & ExcInvalidFEDimension(char arg1, int arg2)
static ::ExceptionBase & ExcInvalidFE()
#define DeclException4(Exception4, type1, type2, type3, type4, outsequence)
static ::ExceptionBase & ExcInvalidFEName(std::string arg1)
static ::ExceptionBase & ExcTriangulationMismatch()