19 #include <deal.II/base/config.h> 20 #include <deal.II/fe/fe_base.h> 21 #include <deal.II/fe/fe_values_extractors.h> 22 #include <deal.II/fe/fe_update_flags.h> 23 #include <deal.II/fe/component_mask.h> 24 #include <deal.II/fe/block_mask.h> 25 #include <deal.II/fe/mapping.h> 27 DEAL_II_NAMESPACE_OPEN
30 template <
int dim,
int spacedim>
class FEValues;
33 template <
int dim,
int spacedim>
class FESystem;
568 template <
int dim,
int spacedim=dim>
717 virtual std::string
get_name ()
const = 0;
778 const unsigned int component)
const;
812 const unsigned int component)
const;
846 const unsigned int component)
const;
880 const unsigned int component)
const;
914 const unsigned int component)
const;
926 const unsigned int face_index)
const;
1183 const unsigned int subface,
1209 std::vector<std::pair<unsigned int, unsigned int> >
1217 std::vector<std::pair<unsigned int, unsigned int> >
1225 std::vector<std::pair<unsigned int, unsigned int> >
1286 std::pair<unsigned int, unsigned int>
1299 const unsigned int index)
const;
1310 std::pair<unsigned int, unsigned int>
1322 const bool face_orientation,
1323 const bool face_flip,
1324 const bool face_rotation)
const;
1382 const unsigned int face,
1383 const bool face_orientation =
true,
1384 const bool face_flip =
false,
1385 const bool face_rotation =
false)
const;
1395 const bool line_orientation)
const;
1501 std::pair<std::pair<unsigned int, unsigned int>,
unsigned int>
1512 std::pair<std::pair<unsigned int, unsigned int>,
unsigned int>
1533 std::pair<unsigned int, unsigned int>
1541 std::pair<unsigned int,unsigned int>
1547 std::pair<unsigned int,types::global_dof_index>
1728 virtual std::pair<Table<2,bool>,std::vector<unsigned int> >
1768 const std::vector<Point<dim> > &
1832 const std::vector<
Point<dim-1> > &
1860 const std::vector<Point<dim> > &
1877 const std::vector<
Point<dim-1> > &
2009 std::vector<double> &nodal_values)
const;
2025 const std::vector<double> &values)
const DEAL_II_DEPRECATED;
2042 const unsigned int offset = 0) const DEAL_II_DEPRECATED;
2053 const
VectorSlice<const
std::vector<
std::vector<
double> > > &values) const DEAL_II_DEPRECATED;
2074 << "The shape function with index " << arg1
2075 << " is not primitive, i.e. it is vector-valued and "
2076 << "has more than one non-zero vector component. This "
2077 << "function cannot be called for these shape functions. "
2078 << "Maybe you want to use the same function with the "
2079 << "_component suffix?");
2092 "You are trying to access the values or derivatives of shape functions "
2093 "on the reference cell of an element that does not define its shape "
2094 "functions through mapping from the reference cell. Consequently, "
2095 "you cannot ask for shape function values or derivatives on the "
2105 "You are trying to access the support points of a finite "
2106 "element that either has no support points at all, or for "
2107 "which the corresponding tables have not been implemented.");
2116 "You are trying to access the matrices that describe how "
2117 "to embed a finite element function on one cell into the "
2118 "finite element space on one of its children (i.e., the "
2119 "'embedding' or '
prolongation' matrices). However, the "
2120 "current finite element can either not define this sort of "
2121 "operation, or it has not yet been implemented.");
2131 "You are trying to access the matrices that describe how "
2132 "to restrict a finite element function from the children "
2133 "of one cell to the finite element space defined on their "
2134 "parent (i.e., the '
restriction' or 'projection' matrices). "
2135 "However, the current finite element can either not define "
2136 "this sort of operation, or it has not yet been "
2145 << "The interface matrix has a size of " << arg1
2147 << ", which is not reasonable for the current element "
2171 const
bool isotropic_prolongation_only=false);
2308 std::vector<
std::pair<
std::pair<
unsigned int,
unsigned int>,
unsigned int> >
2314 std::vector<
std::pair<
std::pair<
unsigned int,
unsigned int>,
unsigned int> >
2338 std::vector<
std::pair<
std::pair<
unsigned int,
unsigned int>,
unsigned int> >
2393 std::vector<
unsigned int>
2499 const
Mapping<dim,spacedim> &mapping,
2501 ::
internal::
FEValues::FiniteElementRelatedData<dim, spacedim> &output_data) const = 0;
2547 const
Mapping<dim,spacedim> &mapping,
2549 ::
internal::
FEValues::FiniteElementRelatedData<dim, spacedim> &output_data) const;
2595 const
Mapping<dim,spacedim> &mapping,
2597 ::
internal::
FEValues::FiniteElementRelatedData<dim, spacedim> &output_data) const;
2684 const
Mapping<dim,spacedim> &mapping,
2685 const typename
Mapping<dim,spacedim>::InternalDataBase &mapping_internal,
2686 const ::
internal::
FEValues::MappingRelatedData<dim, spacedim> &mapping_data,
2687 const InternalDataBase &fe_internal,
2688 ::
internal::
FEValues::FiniteElementRelatedData<dim, spacedim> &output_data) const = 0;
2735 const
unsigned int face_no,
2737 const
Mapping<dim,spacedim> &mapping,
2738 const typename
Mapping<dim,spacedim>::InternalDataBase &mapping_internal,
2739 const ::
internal::
FEValues::MappingRelatedData<dim, spacedim> &mapping_data,
2740 const InternalDataBase &fe_internal,
2741 ::
internal::
FEValues::FiniteElementRelatedData<dim, spacedim> &output_data) const = 0;
2791 const
unsigned int face_no,
2792 const
unsigned int sub_no,
2794 const
Mapping<dim,spacedim> &mapping,
2795 const typename
Mapping<dim,spacedim>::InternalDataBase &mapping_internal,
2796 const ::
internal::
FEValues::MappingRelatedData<dim, spacedim> &mapping_data,
2797 const InternalDataBase &fe_internal,
2798 ::
internal::
FEValues::FiniteElementRelatedData<dim, spacedim> &output_data) const = 0;
2800 friend class InternalDataBase;
2802 friend class
FEValues<dim,spacedim>;
2805 friend class
FESystem<dim,spacedim>;
2809 #ifdef DEAL_II_WITH_CXX11 2810 #ifndef DEAL_II_MSVC 2811 static_assert (dim<=spacedim,
2812 "The dimension <dim> of a FiniteElement must be less than or " 2813 "equal to the space dimension <spacedim> in which it lives.");
2823 template <
int dim,
int spacedim>
2830 ExcMessage (
"A fe_index of zero is the only index allowed here"));
2836 template <
int dim,
int spacedim>
2838 std::pair<unsigned int,unsigned int>
2841 Assert (index < system_to_component_table.size(),
2843 Assert (is_primitive (index),
2845 return system_to_component_table[index];
2850 template <
int dim,
int spacedim>
2855 return base_to_block_indices.size();
2860 template <
int dim,
int spacedim>
2865 return static_cast<unsigned int>(base_to_block_indices.block_size(index));
2870 template <
int dim,
int spacedim>
2874 const unsigned int index)
const 2877 const std::vector<std::pair<unsigned int, unsigned int> >::const_iterator
2878 it = std::find(system_to_component_table.begin(), system_to_component_table.end(),
2879 std::pair<unsigned int, unsigned int>(component, index));
2881 Assert(it != system_to_component_table.end(),
2882 ExcMessage (
"You are asking for the number of the shape function " 2883 "within a system element that corresponds to vector " 2886 "shape function exists."));
2887 return std::distance(system_to_component_table.begin(), it);
2892 template <
int dim,
int spacedim>
2894 std::pair<unsigned int,unsigned int>
2897 Assert(index < face_system_to_component_table.size(),
2898 ExcIndexRange(index, 0, face_system_to_component_table.size()));
2913 Assert (is_primitive(this->face_to_cell_index(index, 0)),
2916 return face_system_to_component_table[index];
2921 template <
int dim,
int spacedim>
2923 std::pair<std::pair<unsigned int,unsigned int>,
unsigned int>
2926 Assert (index < system_to_base_table.size(),
2928 return system_to_base_table[index];
2934 template <
int dim,
int spacedim>
2936 std::pair<std::pair<unsigned int,unsigned int>,
unsigned int>
2939 Assert(index < face_system_to_base_table.size(),
2941 return face_system_to_base_table[index];
2946 template <
int dim,
int spacedim>
2951 return base_to_block_indices.block_start(index);
2956 template <
int dim,
int spacedim>
2958 std::pair<unsigned int,unsigned int>
2961 Assert(index < component_to_base_table.size(),
2964 return component_to_base_table[index].first;
2969 template <
int dim,
int spacedim>
2971 std::pair<unsigned int,unsigned int>
2974 return base_to_block_indices.global_to_local(index);
2979 template <
int dim,
int spacedim>
2981 std::pair<unsigned int,types::global_dof_index>
2984 Assert (index < this->dofs_per_cell,
2989 return std::pair<unsigned int, types::global_dof_index>(
2990 first_block_of_base(system_to_base_table[index].first.first)
2991 + system_to_base_table[index].first.second,
2992 system_to_base_table[index].second);
2997 template <
int dim,
int spacedim>
3002 Assert(index < this->dofs_per_cell,
3004 return restriction_is_additive_flags[index];
3009 template <
int dim,
int spacedim>
3015 return nonzero_components[i];
3020 template <
int dim,
int spacedim>
3026 return n_nonzero_components_table[i];
3031 template <
int dim,
int spacedim>
3036 return cached_primitivity;
3041 template <
int dim,
int spacedim>
3060 return (is_primitive() ||
3061 (n_nonzero_components_table[i] == 1));
3066 template <
int dim,
int spacedim>
3071 Assert (cell_dof_index < this->dofs_per_cell,
3076 if (cell_dof_index < this->first_line_index)
3078 else if (cell_dof_index < this->first_quad_index)
3080 else if (cell_dof_index < this->first_hex_index)
3088 DEAL_II_NAMESPACE_CLOSE
virtual void fill_fe_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const CellSimilarity::Similarity cell_similarity, const Quadrature< dim > &quadrature, const Mapping< dim, spacedim > &mapping, const typename Mapping< dim, spacedim >::InternalDataBase &mapping_internal, const ::internal::FEValues::MappingRelatedData< dim, spacedim > &mapping_data, const InternalDataBase &fe_internal, ::internal::FEValues::FiniteElementRelatedData< dim, spacedim > &output_data) const =0
static ::ExceptionBase & ExcFEHasNoSupportPoints()
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const =0
BlockMask block_mask(const FEValuesExtractors::Scalar &scalar) const
bool restriction_is_additive(const unsigned int index) const
virtual Tensor< 2, dim > shape_grad_grad_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
std::vector< std::vector< FullMatrix< double > > > restriction
#define DeclException2(Exception2, type1, type2, outsequence)
virtual std::size_t memory_consumption() const
const std::vector< Point< dim-1 > > & get_unit_face_support_points() const
virtual void get_face_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const
virtual InternalDataBase * get_data(const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const Quadrature< dim > &quadrature, ::internal::FEValues::FiniteElementRelatedData< dim, spacedim > &output_data) const =0
std::vector< Point< dim > > generalized_support_points
virtual Tensor< 3, dim > shape_3rd_derivative(const unsigned int i, const Point< dim > &p) const
FullMatrix< double > interface_constraints
unsigned int n_nonzero_components(const unsigned int i) const
const std::vector< Point< dim-1 > > & get_generalized_face_support_points() const
FiniteElement(const FiniteElementData< dim > &fe_data, const std::vector< bool > &restriction_is_additive_flags, const std::vector< ComponentMask > &nonzero_components)
virtual void interpolate(std::vector< double > &local_dofs, const std::vector< double > &values) const 1
virtual double shape_value_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
virtual void get_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const
static ::ExceptionBase & ExcUnitShapeValuesDoNotExist()
virtual Point< dim > unit_support_point(const unsigned int index) const
bool restriction_is_implemented() const
const std::vector< Point< dim > > & get_generalized_support_points() const
virtual Tensor< 1, dim > shape_grad(const unsigned int i, const Point< dim > &p) const
virtual Tensor< 3, dim > shape_3rd_derivative_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
virtual void fill_fe_face_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const Quadrature< dim-1 > &quadrature, const Mapping< dim, spacedim > &mapping, const typename Mapping< dim, spacedim >::InternalDataBase &mapping_internal, const ::internal::FEValues::MappingRelatedData< dim, spacedim > &mapping_data, const InternalDataBase &fe_internal, ::internal::FEValues::FiniteElementRelatedData< dim, spacedim > &output_data) const =0
#define AssertIndexRange(index, range)
Table< 2, int > adjust_quad_dof_index_for_face_orientation_table
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_quad_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
bool isotropic_prolongation_is_implemented() const
std::vector< std::pair< std::pair< unsigned int, unsigned int >, unsigned int > > component_to_base_table
bool has_generalized_support_points() const
ComponentMask component_mask(const FEValuesExtractors::Scalar &scalar) const
static std::vector< unsigned int > compute_n_nonzero_components(const std::vector< ComponentMask > &nonzero_components)
std::vector< std::pair< std::pair< unsigned int, unsigned int >, unsigned int > > face_system_to_base_table
virtual const FullMatrix< double > & get_prolongation_matrix(const unsigned int child, const RefinementCase< dim > &refinement_case=RefinementCase< dim >::isotropic_refinement) const
bool is_primitive() const
static ::ExceptionBase & ExcInterpolationNotImplemented()
const std::vector< unsigned int > n_nonzero_components_table
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
virtual void convert_generalized_support_point_values_to_nodal_values(const std::vector< Vector< double > > &support_point_values, std::vector< double > &nodal_values) const
bool has_face_support_points() const
bool operator==(const FiniteElement< dim, spacedim > &) const
std::vector< Point< dim > > unit_support_points
bool has_support_points() const
unsigned int component_to_block_index(const unsigned int component) const
static ::ExceptionBase & ExcFENotPrimitive()
static ::ExceptionBase & ExcMessage(std::string arg1)
const FullMatrix< double > & constraints(const ::internal::SubfaceCase< dim > &subface_case=::internal::SubfaceCase< dim >::case_isotropic) const
virtual Tensor< 1, dim > shape_grad_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
virtual std::size_t memory_consumption() const
#define DeclException1(Exception1, type1, outsequence)
std::vector< std::vector< FullMatrix< double > > > prolongation
std::pair< unsigned int, unsigned int > component_to_base_index(const unsigned int component) const
unsigned int global_dof_index
#define Assert(cond, exc)
unsigned int element_multiplicity(const unsigned int index) const
virtual const FullMatrix< double > & get_restriction_matrix(const unsigned int child, const RefinementCase< dim > &refinement_case=RefinementCase< dim >::isotropic_refinement) const
Abstract base class for mapping classes.
GeometryPrimitive get_associated_geometry_primitive(const unsigned int cell_dof_index) const
std::vector< Point< dim-1 > > unit_face_support_points
const ComponentMask & get_nonzero_components(const unsigned int i) const
#define DeclExceptionMsg(Exception, defaulttext)
#define DeclException0(Exception0)
virtual void get_subface_interpolation_matrix(const FiniteElement< dim, spacedim > &source, const unsigned int subface, FullMatrix< double > &matrix) const
virtual void fill_fe_subface_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const unsigned int sub_no, const Quadrature< dim-1 > &quadrature, const Mapping< dim, spacedim > &mapping, const typename Mapping< dim, spacedim >::InternalDataBase &mapping_internal, const ::internal::FEValues::MappingRelatedData< dim, spacedim > &mapping_data, const InternalDataBase &fe_internal, ::internal::FEValues::FiniteElementRelatedData< dim, spacedim > &output_data) const =0
bool constraints_are_implemented(const ::internal::SubfaceCase< dim > &subface_case=::internal::SubfaceCase< dim >::case_isotropic) const
static ::ExceptionBase & ExcWrongInterfaceMatrixSize(int arg1, int arg2)
std::pair< unsigned int, unsigned int > face_system_to_component_index(const unsigned int index) const
virtual const FiniteElement< dim, spacedim > & base_element(const unsigned int index) const
virtual std::string get_name() const =0
static ::ExceptionBase & ExcProjectionVoid()
bool has_generalized_face_support_points() const
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_vertex_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
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
virtual 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
virtual Point< dim-1 > unit_face_support_point(const unsigned int index) const
std::string int_to_string(const unsigned int value, const unsigned int digits=numbers::invalid_unsigned_int)
virtual ~InternalDataBase()
std::pair< unsigned int, unsigned int > block_to_base_index(const unsigned int block) const
static ::ExceptionBase & ExcShapeFunctionNotPrimitive(int arg1)
std::vector< Point< dim-1 > > generalized_face_support_points
static const unsigned int dimension
types::global_dof_index first_block_of_base(const unsigned int b) const
unsigned int adjust_line_dof_index_for_line_orientation(const unsigned int index, const bool line_orientation) const
const std::vector< Point< dim > > & get_unit_support_points() const
unsigned int component_to_system_index(const unsigned int component, const unsigned int index) const
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_line_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
std::pair< unsigned int, unsigned int > system_to_component_index(const unsigned int index) const
const FiniteElement< dim, spacedim > & operator[](const unsigned int fe_index) const
std::pair< std::pair< unsigned int, unsigned int >, unsigned int > face_system_to_base_index(const unsigned int index) const
static ::ExceptionBase & ExcEmbeddingVoid()
virtual double shape_value(const unsigned int i, const Point< dim > &p) const
std::pair< std::pair< unsigned int, unsigned int >, unsigned int > system_to_base_index(const unsigned int index) const
std::pair< unsigned int, types::global_dof_index > system_to_block_index(const unsigned int component) const
std::vector< std::pair< unsigned int, unsigned int > > system_to_component_table
virtual bool hp_constraints_are_implemented() const
bool prolongation_is_implemented() const
virtual Tensor< 4, dim > shape_4th_derivative_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
const bool cached_primitivity
virtual Tensor< 2, dim > shape_grad_grad(const unsigned int i, const Point< dim > &p) const
const std::vector< ComponentMask > nonzero_components
void reinit_restriction_and_prolongation_matrices(const bool isotropic_restriction_only=false, const bool isotropic_prolongation_only=false)
virtual 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
std::vector< std::pair< unsigned int, unsigned int > > face_system_to_component_table
bool isotropic_restriction_is_implemented() const
virtual FiniteElement< dim, spacedim > * clone() const =0
BlockIndices base_to_block_indices
unsigned int n_components(const DoFHandler< dim, spacedim > &dh)
virtual Tensor< 4, dim > shape_4th_derivative(const unsigned int i, const Point< dim > &p) const
unsigned int n_base_elements() const
static const unsigned int space_dimension
unsigned int adjust_quad_dof_index_for_face_orientation(const unsigned int index, const bool face_orientation, const bool face_flip, const bool face_rotation) const
std::vector< int > adjust_line_dof_index_for_line_orientation_table
TableIndices< 2 > interface_constraints_size() const
virtual std::pair< Table< 2, bool >, std::vector< unsigned int > > get_constant_modes() const
const std::vector< bool > restriction_is_additive_flags
virtual FiniteElementDomination::Domination compare_for_face_domination(const FiniteElement< dim, spacedim > &fe_other) const
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const
std::vector< std::pair< std::pair< unsigned int, unsigned int >, unsigned int > > system_to_base_table