16 #include <deal.II/base/memory_consumption.h> 17 #include <deal.II/fe/mapping.h> 18 #include <deal.II/fe/fe.h> 19 #include <deal.II/fe/fe_values.h> 20 #include <deal.II/base/quadrature.h> 21 #include <deal.II/base/qprojector.h> 22 #include <deal.II/grid/tria.h> 23 #include <deal.II/grid/tria_iterator.h> 24 #include <deal.II/dofs/dof_accessor.h> 25 #include <deal.II/grid/tria_boundary.h> 31 DEAL_II_NAMESPACE_OPEN
37 template <
int dim,
int spacedim>
44 template <
int dim,
int spacedim>
50 template <
int dim,
int spacedim>
59 template <
int dim,
int spacedim>
62 const std::vector<bool> &r_i_a_f,
63 const std::vector<ComponentMask> &nonzero_c)
74 std::make_pair(
std::make_pair(0U, 0U), 0U)),
92 std::bind2nd(std::not_equal_to<unsigned int>(),
140 ref<RefinementCase<dim>::isotropic_refinement+1; ++ref)
155 template <
int dim,
int spacedim>
162 template <
int dim,
int spacedim>
167 AssertThrow(
false, ExcUnitShapeValuesDoNotExist());
173 template <
int dim,
int spacedim>
177 const unsigned int)
const 179 AssertThrow(
false, ExcUnitShapeValuesDoNotExist());
185 template <
int dim,
int spacedim>
190 AssertThrow(
false, ExcUnitShapeValuesDoNotExist());
196 template <
int dim,
int spacedim>
200 const unsigned int)
const 202 AssertThrow(
false, ExcUnitShapeValuesDoNotExist());
208 template <
int dim,
int spacedim>
213 AssertThrow(
false, ExcUnitShapeValuesDoNotExist());
219 template <
int dim,
int spacedim>
223 const unsigned int)
const 225 AssertThrow(
false, ExcUnitShapeValuesDoNotExist());
231 template <
int dim,
int spacedim>
236 AssertThrow(
false, ExcUnitShapeValuesDoNotExist());
242 template <
int dim,
int spacedim>
246 const unsigned int)
const 248 AssertThrow(
false, ExcUnitShapeValuesDoNotExist());
254 template <
int dim,
int spacedim>
259 AssertThrow(
false, ExcUnitShapeValuesDoNotExist());
265 template <
int dim,
int spacedim>
269 const unsigned int)
const 271 AssertThrow(
false, ExcUnitShapeValuesDoNotExist());
276 template <
int dim,
int spacedim>
279 const bool isotropic_restriction_only,
280 const bool isotropic_prolongation_only)
283 ref_case <= RefinementCase<dim>::isotropic_refinement; ++ref_case)
287 for (
unsigned int i=0; i<nc; ++i)
304 template <
int dim,
int spacedim>
312 ExcMessage(
"Restriction matrices are only available for refined cells!"));
324 template <
int dim,
int spacedim>
332 ExcMessage(
"Prolongation matrices are only available for refined cells!"));
346 template <
int dim,
int spacedim>
358 template <
int dim,
int spacedim>
376 template <
int dim,
int spacedim>
395 template <
int dim,
int spacedim>
402 this->n_components());
418 template <
int dim,
int spacedim>
433 component_mask[c] =
true;
440 template <
int dim,
int spacedim>
451 template <
int dim,
int spacedim>
462 template <
int dim,
int spacedim>
474 template <
int dim,
int spacedim>
499 if (component_mask[c] ==
true)
500 block_mask[block] =
true;
510 Assert (component_mask[c] == block_mask[block],
511 ExcMessage (
"The component mask argument given to this function " 512 "is not a mask where the individual components belonging " 513 "to one block of the finite element are either all " 514 "selected or not selected. You can't call this function " 515 "with a component mask that splits blocks."));
526 template <
int dim,
int spacedim>
530 const unsigned int face,
531 const bool face_orientation,
532 const bool face_flip,
533 const bool face_rotation)
const 536 ExcIndexRange(face_index, 0, this->dofs_per_face));
553 if ((face_orientation !=
true) || (face_flip !=
false) || (face_rotation !=
false))
555 ExcMessage (
"The function in this base class can not handle this case. " 556 "Rather, the derived class you are using must provide " 557 "an overloaded version but apparently hasn't done so. See " 558 "the documentation of this function for more information."));
568 const unsigned int dof_index_on_vertex = face_index % this->
dofs_per_vertex;
578 dof_index_on_vertex);
588 const unsigned int dof_index_on_line = index % this->
dofs_per_line;
602 Assert (dim >= 3, ExcInternalError());
616 template <
int dim,
int spacedim>
619 const bool face_orientation,
620 const bool face_flip,
621 const bool face_rotation)
const 627 Assert (dim==3, ExcInternalError());
648 template <
int dim,
int spacedim>
651 const bool line_orientation)
const 663 if (line_orientation)
671 template <
int dim,
int spacedim>
676 ref_case<RefinementCase<dim>::isotropic_refinement+1; ++ref_case)
677 for (
unsigned int c=0;
697 template <
int dim,
int spacedim>
702 ref_case<RefinementCase<dim>::isotropic_refinement+1; ++ref_case)
703 for (
unsigned int c=0;
723 template <
int dim,
int spacedim>
729 for (
unsigned int c=0;
749 template <
int dim,
int spacedim>
755 for (
unsigned int c=0;
775 template <
int dim,
int spacedim>
787 template <
int dim,
int spacedim>
796 template <
int dim,
int spacedim>
802 ExcMessage(
"Constraints for this element are only implemented " 803 "for the case that faces are refined isotropically " 804 "(which is always the case in 2d, and in 3d requires " 805 "that the neighboring cell of a coarse cell presents " 806 "exactly four children on the common face)."));
808 ExcMessage (
"The finite element for which you try to obtain " 809 "hanging node constraints does not appear to " 822 template <
int dim,
int spacedim>
836 12*this->dofs_per_line +
840 Assert (
false, ExcNotImplemented());
848 template <
int dim,
int spacedim>
860 ExcInterpolationNotImplemented());
865 template <
int dim,
int spacedim>
877 ExcInterpolationNotImplemented());
882 template <
int dim,
int spacedim>
894 typename FEE::ExcInterpolationNotImplemented());
899 template <
int dim,
int spacedim>
900 std::vector<std::pair<unsigned int, unsigned int> >
904 Assert (
false, ExcNotImplemented());
905 return std::vector<std::pair<unsigned int, unsigned int> > ();
910 template <
int dim,
int spacedim>
911 std::vector<std::pair<unsigned int, unsigned int> >
915 Assert (
false, ExcNotImplemented());
916 return std::vector<std::pair<unsigned int, unsigned int> > ();
921 template <
int dim,
int spacedim>
922 std::vector<std::pair<unsigned int, unsigned int> >
926 Assert (
false, ExcNotImplemented());
927 return std::vector<std::pair<unsigned int, unsigned int> > ();
932 template <
int dim,
int spacedim>
937 Assert (
false, ExcNotImplemented());
938 return FiniteElementDomination::neither_element_dominates;
943 template <
int dim,
int spacedim>
954 template <
int dim,
int spacedim>
955 const std::vector<Point<dim> > &
970 template <
int dim,
int spacedim>
979 template <
int dim,
int spacedim>
980 const std::vector<Point<dim> > &
994 template <
int dim,
int spacedim>
1003 template <
int dim,
int spacedim>
1008 ExcIndexRange (index, 0, this->dofs_per_cell));
1010 ExcFEHasNoSupportPoints ());
1016 template <
int dim,
int spacedim>
1017 const std::vector<
Point<dim-1> > &
1026 ExcInternalError());
1032 template <
int dim,
int spacedim>
1041 template <
int dim,
int spacedim>
1042 const std::vector<
Point<dim-1> > &
1056 template <
int dim,
int spacedim>
1065 template <
int dim,
int spacedim>
1070 ExcIndexRange (index, 0, this->dofs_per_face));
1072 ExcFEHasNoSupportPoints ());
1078 template <
int dim,
int spacedim>
1082 const unsigned int)
const 1089 template <
int dim,
int spacedim>
1090 std::pair<Table<2,bool>, std::vector<unsigned int> >
1093 Assert (
false, ExcNotImplemented());
1094 return std::pair<Table<2,bool>, std::vector<unsigned int> >
1101 template <
int dim,
int spacedim>
1104 std::vector<double> &local_dofs,
1105 const std::vector<double> &values)
const 1111 ExcDimensionMismatch(local_dofs.size(),this->
dofs_per_cell));
1115 std::copy(values.begin(), values.end(), local_dofs.begin());
1121 template <
int dim,
int spacedim>
1124 std::vector<double> &local_dofs,
1126 unsigned int offset)
const 1132 ExcDimensionMismatch(local_dofs.size(),this->
dofs_per_cell));
1134 ExcDimensionMismatch(values[0].size(),offset+this->
n_components()));
1138 const std::pair<unsigned int, unsigned int> index
1140 local_dofs[i] = values[i](offset+index.first);
1147 template <
int dim,
int spacedim>
1150 std::vector<double> &local_dofs,
1151 const VectorSlice<
const std::vector<std::vector<double> > > &values)
const 1157 ExcDimensionMismatch(local_dofs.size(),this->
dofs_per_cell));
1159 ExcDimensionMismatch(values.size(), this->
n_components()));
1163 const std::pair<unsigned int, unsigned int> index
1165 local_dofs[i] = values[index.first][i];
1171 template <
int dim,
int spacedim>
1191 template <
int dim,
int spacedim>
1192 std::vector<unsigned int>
1196 std::vector<unsigned int> retval (nonzero_components.size());
1197 for (
unsigned int i=0; i<nonzero_components.size(); ++i)
1198 retval[i] = nonzero_components[i].n_selected_components();
1206 template <
int dim,
int spacedim>
1220 template <
int dim,
int spacedim>
1234 template <
int dim,
int spacedim>
1239 Assert (index==0, ExcIndexRange(index,0,1));
1252 DEAL_II_NAMESPACE_CLOSE
bool represents_the_all_selected_mask() const
bool is_primitive() const
static const unsigned int invalid_unsigned_int
BlockMask block_mask(const FEValuesExtractors::Scalar &scalar) 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
const unsigned int components
#define AssertDimension(dim1, dim2)
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
FiniteElement(const FiniteElementData< dim > &fe_data, const std::vector< bool > &restriction_is_additive_flags, const std::vector< ComponentMask > &nonzero_components)
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
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 void interpolate(std::vector< double > &local_dofs, const std::vector< double > &values) 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
::ExceptionBase & ExcMessage(std::string arg1)
#define AssertIndexRange(index, range)
const unsigned int dofs_per_quad
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
bool represents_the_all_selected_mask() const
ComponentMask component_mask(const FEValuesExtractors::Scalar &scalar) const
#define AssertThrow(cond, exc)
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
const std::vector< unsigned int > n_nonzero_components_table
const unsigned int dofs_per_line
size_type n_elements() const
unsigned int n_blocks() const
bool has_face_support_points() const
bool operator==(const FiniteElement< dim, spacedim > &) const
std::vector< Point< dim > > unit_support_points
const unsigned int first_face_line_index
bool has_support_points() const
unsigned int component_to_block_index(const unsigned int component) const
const FullMatrix< double > & constraints(const ::internal::SubfaceCase< dim > &subface_case=::internal::SubfaceCase< dim >::case_isotropic) const
static unsigned int n_children(const RefinementCase< dim > &refinement_case)
virtual Tensor< 1, dim > shape_grad_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
const unsigned int first_quad_index
virtual std::size_t memory_consumption() const
std::vector< std::vector< FullMatrix< double > > > prolongation
#define Assert(cond, exc)
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.
std::vector< Point< dim-1 > > unit_face_support_points
void reinit(const unsigned int n_blocks, const size_type n_elements_per_block)
virtual void get_subface_interpolation_matrix(const FiniteElement< dim, spacedim > &source, const unsigned int subface, FullMatrix< double > &matrix) const
bool constraints_are_implemented(const ::internal::SubfaceCase< dim > &subface_case=::internal::SubfaceCase< dim >::case_isotropic) const
unsigned int size() const
virtual const FiniteElement< dim, spacedim > & base_element(const unsigned int index) const
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
virtual ~InternalDataBase()
const unsigned int dofs_per_cell
std::vector< Point< dim-1 > > generalized_face_support_points
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
std_cxx11::enable_if< std_cxx11::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
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
virtual double shape_value(const unsigned int i, const Point< dim > &p) const
unsigned int n_components() const
const unsigned int first_face_quad_index
std::vector< std::pair< unsigned int, unsigned int > > system_to_component_table
virtual bool hp_constraints_are_implemented() const
const unsigned int dofs_per_face
bool prolongation_is_implemented() const
const unsigned int first_line_index
virtual Tensor< 4, dim > shape_4th_derivative_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
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)
const unsigned int dofs_per_vertex
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
BlockIndices base_to_block_indices
void set_primitivity(const bool value)
virtual Tensor< 4, dim > shape_4th_derivative(const unsigned int i, const Point< dim > &p) const
unsigned int size() const
unsigned int size() const
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
void fill(InputIterator entries, const bool C_style_indexing=true)
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