Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
fe_face.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2009 - 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_fe_face_h
17 #define dealii_fe_face_h
18 
19 #include <deal.II/base/config.h>
20 
21 #include <deal.II/base/polynomial_space.h>
22 #include <deal.II/base/tensor_product_polynomials.h>
23 
24 #include <deal.II/fe/fe_poly_face.h>
25 
26 DEAL_II_NAMESPACE_OPEN
27 
28 
56 template <int dim, int spacedim = dim>
57 class FE_FaceQ
58  : public FE_PolyFace<TensorProductPolynomials<dim - 1>, dim, spacedim>
59 {
60 public:
66  FE_FaceQ(const unsigned int p);
67 
68  virtual std::unique_ptr<FiniteElement<dim, spacedim>>
69  clone() const override;
70 
76  virtual std::string
77  get_name() const override;
78 
86  virtual void
88  const std::vector<Vector<double>> &support_point_values,
89  std::vector<double> & nodal_values) const override;
90 
99  virtual void
101  FullMatrix<double> &matrix) const override;
102 
111  virtual void
113  const unsigned int subface,
114  FullMatrix<double> &matrix) const override;
115 
120  virtual bool
121  has_support_on_face(const unsigned int shape_index,
122  const unsigned int face_index) const override;
123 
146  virtual std::vector<std::pair<unsigned int, unsigned int>>
148  const FiniteElement<dim, spacedim> &fe_other) const override;
149 
156  virtual std::vector<std::pair<unsigned int, unsigned int>>
158  const FiniteElement<dim, spacedim> &fe_other) const override;
159 
166  virtual std::vector<std::pair<unsigned int, unsigned int>>
168  const FiniteElement<dim, spacedim> &fe_other) const override;
169 
174  virtual bool
175  hp_constraints_are_implemented() const override;
176 
182  const unsigned int codim = 0) const override final;
183 
192  virtual std::pair<Table<2, bool>, std::vector<unsigned int>>
193  get_constant_modes() const override;
194 
195 private:
199  static std::vector<unsigned int>
200  get_dpo_vector(const unsigned int deg);
201 };
202 
203 
204 
217 template <int spacedim>
218 class FE_FaceQ<1, spacedim> : public FiniteElement<1, spacedim>
219 {
220 public:
224  FE_FaceQ(const unsigned int p);
225 
226  virtual std::unique_ptr<FiniteElement<1, spacedim>>
227  clone() const override;
228 
234  virtual std::string
235  get_name() const override;
236 
237  // for documentation, see the FiniteElement base class
238  virtual UpdateFlags
239  requires_update_flags(const UpdateFlags update_flags) const override;
240 
249  virtual void
251  FullMatrix<double> &matrix) const override;
252 
261  virtual void
263  const unsigned int subface,
264  FullMatrix<double> &matrix) const override;
265 
270  virtual bool
271  has_support_on_face(const unsigned int shape_index,
272  const unsigned int face_index) const override;
273 
278  virtual bool
279  hp_constraints_are_implemented() const override;
280 
298  virtual std::vector<std::pair<unsigned int, unsigned int>>
300  const FiniteElement<1, spacedim> &fe_other) const override;
301 
308  virtual std::vector<std::pair<unsigned int, unsigned int>>
310  const FiniteElement<1, spacedim> &fe_other) const override;
311 
318  virtual std::vector<std::pair<unsigned int, unsigned int>>
320  const FiniteElement<1, spacedim> &fe_other) const override;
321 
326  virtual std::pair<Table<2, bool>, std::vector<unsigned int>>
327  get_constant_modes() const override;
328 
329 protected:
330  /*
331  * NOTE: The following functions have their definitions inlined into the class
332  * declaration because we otherwise run into a compiler error with MS Visual
333  * Studio.
334  */
335 
336 
337  virtual std::unique_ptr<typename FiniteElement<1, spacedim>::InternalDataBase>
338  get_data(
339  const UpdateFlags /*update_flags*/,
340  const Mapping<1, spacedim> & /*mapping*/,
341  const Quadrature<1> & /*quadrature*/,
343  spacedim>
344  & /*output_data*/) const override
345  {
346  return std_cxx14::make_unique<
348  }
349 
350  std::unique_ptr<typename FiniteElement<1, spacedim>::InternalDataBase>
352  const UpdateFlags update_flags,
353  const Mapping<1, spacedim> & /*mapping*/,
354  const Quadrature<0> &quadrature,
356  spacedim>
357  & /*output_data*/) const override
358  {
359  // generate a new data object and initialize some fields
360  auto data_ptr = std_cxx14::make_unique<
362  data_ptr->update_each = requires_update_flags(update_flags);
363 
364  const unsigned int n_q_points = quadrature.size();
365  AssertDimension(n_q_points, 1);
366  (void)n_q_points;
367 
368  // No derivatives of this element are implemented.
369  if (data_ptr->update_each & update_gradients ||
370  data_ptr->update_each & update_hessians)
371  {
372  Assert(false, ExcNotImplemented());
373  }
374 
375  return data_ptr;
376  }
377 
378  std::unique_ptr<typename FiniteElement<1, spacedim>::InternalDataBase>
380  const UpdateFlags update_flags,
381  const Mapping<1, spacedim> &mapping,
382  const Quadrature<0> & quadrature,
384  spacedim>
385  &output_data) const override
386  {
387  return get_face_data(update_flags, mapping, quadrature, output_data);
388  }
389 
390  virtual void
391  fill_fe_values(
392  const typename Triangulation<1, spacedim>::cell_iterator &cell,
393  const CellSimilarity::Similarity cell_similarity,
394  const Quadrature<1> & quadrature,
395  const Mapping<1, spacedim> & mapping,
396  const typename Mapping<1, spacedim>::InternalDataBase & mapping_internal,
397  const ::internal::FEValuesImplementation::MappingRelatedData<1,
398  spacedim>
399  & mapping_data,
400  const typename FiniteElement<1, spacedim>::InternalDataBase &fe_internal,
402  spacedim>
403  &output_data) const override;
404 
405  virtual void
406  fill_fe_face_values(
407  const typename Triangulation<1, spacedim>::cell_iterator &cell,
408  const unsigned int face_no,
409  const Quadrature<0> & quadrature,
410  const Mapping<1, spacedim> & mapping,
411  const typename Mapping<1, spacedim>::InternalDataBase & mapping_internal,
412  const ::internal::FEValuesImplementation::MappingRelatedData<1,
413  spacedim>
414  & mapping_data,
415  const typename FiniteElement<1, spacedim>::InternalDataBase &fe_internal,
417  spacedim>
418  &output_data) const override;
419 
420  virtual void
421  fill_fe_subface_values(
422  const typename Triangulation<1, spacedim>::cell_iterator &cell,
423  const unsigned int face_no,
424  const unsigned int sub_no,
425  const Quadrature<0> & quadrature,
426  const Mapping<1, spacedim> & mapping,
427  const typename Mapping<1, spacedim>::InternalDataBase & mapping_internal,
428  const ::internal::FEValuesImplementation::MappingRelatedData<1,
429  spacedim>
430  & mapping_data,
431  const typename FiniteElement<1, spacedim>::InternalDataBase &fe_internal,
433  spacedim>
434  &output_data) const override;
435 
436 private:
440  static std::vector<unsigned int>
441  get_dpo_vector(const unsigned int deg);
442 };
443 
444 
445 
470 template <int dim, int spacedim = dim>
471 class FE_FaceP : public FE_PolyFace<PolynomialSpace<dim - 1>, dim, spacedim>
472 {
473 public:
479  FE_FaceP(unsigned int p);
480 
481  virtual std::unique_ptr<FiniteElement<dim, spacedim>>
482  clone() const override;
483 
489  virtual std::string
490  get_name() const override;
491 
500  virtual void
502  FullMatrix<double> &matrix) const override;
503 
512  virtual void
514  const unsigned int subface,
515  FullMatrix<double> &matrix) const override;
516 
521  virtual bool
522  has_support_on_face(const unsigned int shape_index,
523  const unsigned int face_index) const override;
524 
529  virtual bool
530  hp_constraints_are_implemented() const override;
531 
537  const unsigned int codim = 0) const override final;
538 
545  virtual std::pair<Table<2, bool>, std::vector<unsigned int>>
546  get_constant_modes() const override;
547 
548 private:
552  static std::vector<unsigned int>
553  get_dpo_vector(const unsigned int deg);
554 };
555 
556 
557 
562 template <int spacedim>
563 class FE_FaceP<1, spacedim> : public FE_FaceQ<1, spacedim>
564 {
565 public:
569  FE_FaceP(const unsigned int p);
570 
574  std::string
575  get_name() const override;
576 };
577 
578 
579 DEAL_II_NAMESPACE_CLOSE
580 
581 #endif
virtual void get_face_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const override
Definition: fe_face.cc:862
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const override
virtual std::pair< Table< 2, bool >, std::vector< unsigned int > > get_constant_modes() const override
Definition: fe_face.cc:476
#define AssertDimension(dim1, dim2)
Definition: exceptions.h:1567
virtual std::unique_ptr< typename FiniteElement< dim, spacedim >::InternalDataBase > get_data(const UpdateFlags, const Mapping< dim, spacedim > &, const Quadrature< dim > &, ::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &) const override
Definition: fe_poly_face.h:90
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const override
Definition: fe_face.cc:249
virtual std::unique_ptr< FiniteElement< dim, spacedim > > clone() const override
Definition: fe_face.cc:762
virtual std::unique_ptr< FiniteElement< dim, spacedim > > clone() const override
Definition: fe_face.cc:122
virtual void get_subface_interpolation_matrix(const FiniteElement< dim, spacedim > &source, const unsigned int subface, FullMatrix< double > &matrix) const override
Definition: fe_face.cc:875
virtual FiniteElementDomination::Domination compare_for_domination(const FiniteElement< dim, spacedim > &fe_other, const unsigned int codim=0) const override final
Definition: fe_face.cc:439
std::unique_ptr< typename FiniteElement< dim, spacedim >::InternalDataBase > get_face_data(const UpdateFlags update_flags, const Mapping< dim, spacedim > &, const Quadrature< dim - 1 > &quadrature, ::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &) const override
Definition: fe_poly_face.h:102
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_line_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const override
Definition: fe_face.cc:293
#define Assert(cond, exc)
Definition: exceptions.h:1407
UpdateFlags
std::unique_ptr< typename FiniteElement< dim, spacedim >::InternalDataBase > get_subface_data(const UpdateFlags update_flags, const Mapping< dim, spacedim > &mapping, const Quadrature< dim - 1 > &quadrature, ::internal::FEValuesImplementation::FiniteElementRelatedData< dim, spacedim > &output_data) const override
Definition: fe_poly_face.h:159
Abstract base class for mapping classes.
Definition: dof_tools.h:57
virtual void get_subface_interpolation_matrix(const FiniteElement< dim, spacedim > &source, const unsigned int subface, FullMatrix< double > &matrix) const override
Definition: fe_face.cc:160
FE_FaceQ(const unsigned int p)
Definition: fe_face.cc:51
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_vertex_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const override
Definition: fe_face.cc:282
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const override
Definition: fe_face.cc:787
virtual std::string get_name() const override
Definition: fe_face.cc:131
static std::vector< unsigned int > get_dpo_vector(const unsigned int deg)
Definition: fe_face.cc:798
virtual bool hp_constraints_are_implemented() const override
Definition: fe_face.cc:814
Second derivatives of shape functions.
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_quad_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const override
Definition: fe_face.cc:362
unsigned int size() const
Shape function gradients.
static std::vector< unsigned int > get_dpo_vector(const unsigned int deg)
Definition: fe_face.cc:260
virtual std::pair< Table< 2, bool >, std::vector< unsigned int > > get_constant_modes() const override
Definition: fe_face.cc:979
static ::ExceptionBase & ExcNotImplemented()
FE_FaceP(unsigned int p)
Definition: fe_face.cc:747
virtual void get_face_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const override
Definition: fe_face.cc:147
virtual FiniteElementDomination::Domination compare_for_domination(const FiniteElement< dim, spacedim > &fe_other, const unsigned int codim=0) const override final
Definition: fe_face.cc:823
virtual std::string get_name() const override
Definition: fe_face.cc:771
virtual void convert_generalized_support_point_values_to_dof_values(const std::vector< Vector< double >> &support_point_values, std::vector< double > &nodal_values) const override
Definition: fe_face.cc:487
virtual bool hp_constraints_are_implemented() const override
Definition: fe_face.cc:273