Reference documentation for deal.II version 8.4.1
fe_system.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2016 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 at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii__fe_system_h
17 #define dealii__fe_system_h
18 
19 
20 /*---------------------------- fe_system.h ---------------------------*/
21 
22 
23 #include <deal.II/base/config.h>
24 #include <deal.II/base/thread_management.h>
25 #include <deal.II/fe/fe.h>
26 #include <vector>
27 #include <utility>
28 
29 DEAL_II_NAMESPACE_OPEN
30 
31 
156 template <int dim, int spacedim=dim>
157 class FESystem : public FiniteElement<dim,spacedim>
158 {
159 public:
160 
192  const unsigned int n_elements);
193 
200  FESystem (const FiniteElement<dim,spacedim> &fe1, const unsigned int n1,
201  const FiniteElement<dim,spacedim> &fe2, const unsigned int n2);
202 
209  FESystem (const FiniteElement<dim,spacedim> &fe1, const unsigned int n1,
210  const FiniteElement<dim,spacedim> &fe2, const unsigned int n2,
211  const FiniteElement<dim,spacedim> &fe3, const unsigned int n3);
212 
219  FESystem (const FiniteElement<dim,spacedim> &fe1, const unsigned int n1,
220  const FiniteElement<dim,spacedim> &fe2, const unsigned int n2,
221  const FiniteElement<dim,spacedim> &fe3, const unsigned int n3,
222  const FiniteElement<dim,spacedim> &fe4, const unsigned int n4);
223 
230  FESystem (const FiniteElement<dim,spacedim> &fe1, const unsigned int n1,
231  const FiniteElement<dim,spacedim> &fe2, const unsigned int n2,
232  const FiniteElement<dim,spacedim> &fe3, const unsigned int n3,
233  const FiniteElement<dim,spacedim> &fe4, const unsigned int n4,
234  const FiniteElement<dim,spacedim> &fe5, const unsigned int n5);
235 
415  FESystem (const std::vector<const FiniteElement<dim,spacedim>*> &fes,
416  const std::vector<unsigned int> &multiplicities);
417 
421  virtual ~FESystem ();
422 
431  virtual std::string get_name () const;
432 
433  // for documentation, see the FiniteElement base class
434  virtual
436  requires_update_flags (const UpdateFlags update_flags) const;
437 
450  virtual double shape_value (const unsigned int i,
451  const Point<dim> &p) const;
452 
461  virtual double shape_value_component (const unsigned int i,
462  const Point<dim> &p,
463  const unsigned int component) const;
464 
479  virtual Tensor<1,dim> shape_grad (const unsigned int i,
480  const Point<dim> &p) const;
481 
490  virtual Tensor<1,dim> shape_grad_component (const unsigned int i,
491  const Point<dim> &p,
492  const unsigned int component) const;
493 
508  virtual Tensor<2,dim> shape_grad_grad (const unsigned int i,
509  const Point<dim> &p) const;
510 
519  virtual
521  shape_grad_grad_component (const unsigned int i,
522  const Point<dim> &p,
523  const unsigned int component) const;
524 
539  virtual Tensor<3,dim> shape_3rd_derivative (const unsigned int i,
540  const Point<dim> &p) const;
541 
550  virtual Tensor<3,dim> shape_3rd_derivative_component (const unsigned int i,
551  const Point<dim> &p,
552  const unsigned int component) const;
553 
568  virtual Tensor<4,dim> shape_4th_derivative (const unsigned int i,
569  const Point<dim> &p) const;
570 
579  virtual Tensor<4,dim> shape_4th_derivative_component (const unsigned int i,
580  const Point<dim> &p,
581  const unsigned int component) const;
582 
594  virtual void
596  FullMatrix<double> &matrix) const;
597 
604  virtual const FiniteElement<dim,spacedim> &
605  base_element (const unsigned int index) const;
606 
611  virtual bool has_support_on_face (const unsigned int shape_index,
612  const unsigned int face_index) const;
613 
637  virtual const FullMatrix<double> &
638  get_restriction_matrix (const unsigned int child,
640 
668  virtual const FullMatrix<double> &
669  get_prolongation_matrix (const unsigned int child,
671 
710  virtual
711  unsigned int face_to_cell_index (const unsigned int face_dof_index,
712  const unsigned int face,
713  const bool face_orientation = true,
714  const bool face_flip = false,
715  const bool face_rotation = false) const;
716 
720  virtual
721  Point<dim>
722  unit_support_point (const unsigned int index) const;
723 
727  virtual
728  Point<dim-1>
729  unit_face_support_point (const unsigned int index) const;
730 
738  virtual std::pair<Table<2,bool>, std::vector<unsigned int> >
739  get_constant_modes () const;
740 
753  virtual bool hp_constraints_are_implemented () const;
754 
767  virtual void
769  FullMatrix<double> &matrix) const;
770 
771 
784  virtual void
786  const unsigned int subface,
787  FullMatrix<double> &matrix) const;
788 
804  virtual
805  std::vector<std::pair<unsigned int, unsigned int> >
807 
812  virtual
813  std::vector<std::pair<unsigned int, unsigned int> >
814  hp_line_dof_identities (const FiniteElement<dim,spacedim> &fe_other) const;
815 
820  virtual
821  std::vector<std::pair<unsigned int, unsigned int> >
822  hp_quad_dof_identities (const FiniteElement<dim,spacedim> &fe_other) const;
823 
833  virtual
837 
846  virtual std::size_t memory_consumption () const;
847 
848 protected:
849 
855  virtual FiniteElement<dim,spacedim> *clone() const;
856 
857 
859  get_data (const UpdateFlags update_flags,
860  const Mapping<dim,spacedim> &mapping,
861  const Quadrature<dim> &quadrature,
863 
864  virtual
866  get_face_data (const UpdateFlags update_flags,
867  const Mapping<dim,spacedim> &mapping,
868  const Quadrature<dim-1> &quadrature,
870 
871  virtual
873  get_subface_data (const UpdateFlags update_flags,
874  const Mapping<dim,spacedim> &mapping,
875  const Quadrature<dim-1> &quadrature,
877 
878  virtual
879  void
880  fill_fe_values (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
881  const CellSimilarity::Similarity cell_similarity,
882  const Quadrature<dim> &quadrature,
883  const Mapping<dim,spacedim> &mapping,
884  const typename Mapping<dim,spacedim>::InternalDataBase &mapping_internal,
885  const ::internal::FEValues::MappingRelatedData<dim, spacedim> &mapping_data,
886  const typename FiniteElement<dim,spacedim>::InternalDataBase &fe_internal,
888 
889  virtual
890  void
891  fill_fe_face_values (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
892  const unsigned int face_no,
893  const Quadrature<dim-1> &quadrature,
894  const Mapping<dim,spacedim> &mapping,
895  const typename Mapping<dim,spacedim>::InternalDataBase &mapping_internal,
896  const ::internal::FEValues::MappingRelatedData<dim, spacedim> &mapping_data,
897  const typename FiniteElement<dim,spacedim>::InternalDataBase &fe_internal,
899 
900  virtual
901  void
902  fill_fe_subface_values (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
903  const unsigned int face_no,
904  const unsigned int sub_no,
905  const Quadrature<dim-1> &quadrature,
906  const Mapping<dim,spacedim> &mapping,
907  const typename Mapping<dim,spacedim>::InternalDataBase &mapping_internal,
908  const ::internal::FEValues::MappingRelatedData<dim, spacedim> &mapping_data,
909  const typename FiniteElement<dim,spacedim>::InternalDataBase &fe_internal,
911 
922  template <int dim_1>
923  void compute_fill (const Mapping<dim,spacedim> &mapping,
924  const typename Triangulation<dim,spacedim>::cell_iterator &cell,
925  const unsigned int face_no,
926  const unsigned int sub_no,
927  const Quadrature<dim_1> &quadrature,
928  const CellSimilarity::Similarity cell_similarity,
929  const typename Mapping<dim,spacedim>::InternalDataBase &mapping_internal,
930  const typename FiniteElement<dim,spacedim>::InternalDataBase &fe_data,
933 
934 private:
935 
940 
955  std::vector<std::pair<std_cxx11::shared_ptr<const FiniteElement<dim,spacedim> >,
956  unsigned int> >
958 
959 
965 
971 
982  void initialize (const std::vector<const FiniteElement<dim,spacedim>*> &fes,
983  const std::vector<unsigned int> &multiplicities);
984 
988  void build_cell_tables();
989 
993  void build_face_tables();
994 
999 
1005  template <int structdim>
1006  std::vector<std::pair<unsigned int, unsigned int> >
1007  hp_object_dof_identities (const FiniteElement<dim,spacedim> &fe_other) const;
1008 
1015  class InternalData : public FiniteElement<dim,spacedim>::InternalDataBase
1016  {
1017  public:
1022  InternalData (const unsigned int n_base_elements);
1023 
1028  ~InternalData();
1029 
1034  void set_fe_data(const unsigned int base_no,
1036 
1042  get_fe_data (const unsigned int base_no) const;
1043 
1050  get_fe_output_object (const unsigned int base_no) const;
1051 
1052  private:
1053 
1064  typename std::vector<typename FiniteElement<dim,spacedim>::InternalDataBase *> base_fe_datas;
1065 
1074  mutable std::vector<internal::FEValues::FiniteElementRelatedData<dim,spacedim> > base_fe_output_objects;
1075  };
1076 
1077  /*
1078  * Mutex for protecting initialization of restriction and embedding matrix.
1079  */
1080  mutable Threads::Mutex mutex;
1081 };
1082 
1083 
1084 DEAL_II_NAMESPACE_CLOSE
1085 
1086 /*---------------------------- fe_system.h ---------------------------*/
1087 #endif
1088 /*---------------------------- fe_system.h ---------------------------*/
virtual Tensor< 2, dim > shape_grad_grad_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
Definition: fe_system.cc:943
void initialize_unit_support_points()
Definition: fe_system.cc:2349
virtual bool hp_constraints_are_implemented() const
Definition: fe_system.cc:2482
virtual std::size_t memory_consumption() const
Definition: fe_system.cc:3023
static const unsigned int invalid_unsigned_int
Definition: types.h:164
virtual const FullMatrix< double > & get_prolongation_matrix(const unsigned int child, const RefinementCase< dim > &refinement_case=RefinementCase< dim >::isotropic_refinement) const
Definition: fe_system.cc:1234
FiniteElement< dim, spacedim >::InternalDataBase & get_fe_data(const unsigned int base_no) const
Definition: fe_system.cc:73
virtual Tensor< 2, dim > shape_grad_grad(const unsigned int i, const Point< dim > &p) const
Definition: fe_system.cc:928
void build_interface_constraints()
Definition: fe_system.cc:2102
virtual void get_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const
Definition: fe_system.cc:1063
virtual std::pair< Table< 2, bool >, std::vector< unsigned int > > get_constant_modes() const
Definition: fe_system.cc:2969
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_vertex_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
Definition: fe_system.cc:2830
std::vector< std::pair< std_cxx11::shared_ptr< const FiniteElement< dim, spacedim > >, unsigned int > > base_elements
Definition: fe_system.h:957
virtual Tensor< 3, dim > shape_3rd_derivative(const unsigned int i, const Point< dim > &p) const
Definition: fe_system.cc:973
virtual FiniteElement< dim, spacedim > * clone() const
Definition: fe_system.cc:814
virtual void get_subface_interpolation_matrix(const FiniteElement< dim, spacedim > &source, const unsigned int subface, FullMatrix< double > &matrix) const
Definition: fe_system.cc:2606
virtual FiniteElementDomination::Domination compare_for_face_domination(const FiniteElement< dim, spacedim > &fe_other) const
Definition: fe_system.cc:2856
void initialize_quad_dof_index_permutation()
Definition: fe_system.cc:2427
std::vector< internal::FEValues::FiniteElementRelatedData< dim, spacedim > > base_fe_output_objects
Definition: fe_system.h:1074
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_line_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
Definition: fe_system.cc:2837
void set_fe_data(const unsigned int base_no, typename FiniteElement< dim, spacedim >::InternalDataBase *)
Definition: fe_system.cc:85
virtual Tensor< 1, dim > shape_grad(const unsigned int i, const Point< dim > &p) const
Definition: fe_system.cc:883
virtual Tensor< 1, dim > shape_grad_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
Definition: fe_system.cc:898
virtual std::string get_name() const
Definition: fe_system.cc:783
virtual unsigned int face_to_cell_index(const unsigned int face_dof_index, const unsigned int face, const bool face_orientation=true, const bool face_flip=false, const bool face_rotation=false) const
Definition: fe_system.cc:1298
InternalData(const unsigned int n_base_elements)
Definition: fe_system.cc:48
virtual FiniteElement< dim, spacedim >::InternalDataBase * get_subface_data(const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const Quadrature< dim-1 > &quadrature,::internal::FEValues::FiniteElementRelatedData< dim, spacedim > &output_data) const
Definition: fe_system.cc:1472
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const
Definition: fe_system.cc:2911
std::vector< std::pair< unsigned int, unsigned int > > hp_object_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
Definition: fe_system.cc:2718
virtual const FullMatrix< double > & get_restriction_matrix(const unsigned int child, const RefinementCase< dim > &refinement_case=RefinementCase< dim >::isotropic_refinement) const
Definition: fe_system.cc:1145
void build_face_tables()
Definition: fe_system.cc:1946
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const
Definition: fe_system.cc:1343
virtual double shape_value_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
Definition: fe_system.cc:846
UpdateFlags
static const unsigned int invalid_face_number
Definition: fe_system.h:939
Abstract base class for mapping classes.
Definition: dof_tools.h:52
Definition: fe.h:34
virtual Point< dim > unit_support_point(const unsigned int index) const
Definition: fe_system.cc:2923
void initialize_unit_face_support_points()
Definition: fe_system.cc:2381
virtual Tensor< 4, dim > shape_4th_derivative_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
Definition: fe_system.cc:1033
virtual Point< dim-1 > unit_face_support_point(const unsigned int index) const
Definition: fe_system.cc:2946
unsigned int n_base_elements() const
Definition: fe.h:2756
virtual Tensor< 3, dim > shape_3rd_derivative_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
Definition: fe_system.cc:988
void initialize(const std::vector< const FiniteElement< dim, spacedim > * > &fes, const std::vector< unsigned int > &multiplicities)
Definition: fe_system.cc:2285
virtual const FiniteElement< dim, spacedim > & base_element(const unsigned int index) const
Definition: fe_system.cc:2900
virtual FiniteElement< dim, spacedim >::InternalDataBase * get_data(const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const Quadrature< dim > &quadrature,::internal::FEValues::FiniteElementRelatedData< dim, spacedim > &output_data) const
Definition: fe_system.cc:1358
void compute_fill(const Mapping< dim, spacedim > &mapping, const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const unsigned int sub_no, const Quadrature< dim_1 > &quadrature, const CellSimilarity::Similarity cell_similarity, const typename Mapping< dim, spacedim >::InternalDataBase &mapping_internal, const typename FiniteElement< dim, spacedim >::InternalDataBase &fe_data, const internal::FEValues::MappingRelatedData< dim, spacedim > &mapping_data, internal::FEValues::FiniteElementRelatedData< dim, spacedim > &output_data) const
Definition: fe_system.cc:1587
std::vector< typename FiniteElement< dim, spacedim >::InternalDataBase * > base_fe_datas
Definition: fe_system.h:1064
internal::FEValues::FiniteElementRelatedData< dim, spacedim > & get_fe_output_object(const unsigned int base_no) const
Definition: fe_system.cc:98
FESystem(const FiniteElement< dim, spacedim > &fe, const unsigned int n_elements)
Definition: fe_system.cc:607
virtual FiniteElement< dim, spacedim >::InternalDataBase * get_face_data(const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const Quadrature< dim-1 > &quadrature,::internal::FEValues::FiniteElementRelatedData< dim, spacedim > &output_data) const
Definition: fe_system.cc:1414
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_quad_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
Definition: fe_system.cc:2846
void build_cell_tables()
Definition: fe_system.cc:1762
virtual Tensor< 4, dim > shape_4th_derivative(const unsigned int i, const Point< dim > &p) const
Definition: fe_system.cc:1018
virtual void get_face_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const
Definition: fe_system.cc:2496
virtual double shape_value(const unsigned int i, const Point< dim > &p) const
Definition: fe_system.cc:831
virtual ~FESystem()
Definition: fe_system.cc:776