Reference documentation for deal.II version 9.0.0
fe_face.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2009 - 2018 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_face_h
17 #define dealii_fe_face_h
18 
19 #include <deal.II/base/config.h>
20 #include <deal.II/base/tensor_product_polynomials.h>
21 #include <deal.II/base/polynomial_space.h>
22 #include <deal.II/fe/fe_poly_face.h>
23 
24 DEAL_II_NAMESPACE_OPEN
25 
26 
54 template <int dim, int spacedim=dim>
55 class FE_FaceQ : public FE_PolyFace<TensorProductPolynomials<dim-1>, dim, spacedim>
56 {
57 public:
63  FE_FaceQ (const unsigned int p);
64 
65  virtual
66  std::unique_ptr<FiniteElement<dim,spacedim> >
67  clone() const;
68 
74  virtual std::string get_name () const;
75 
83  virtual
84  void
85  convert_generalized_support_point_values_to_dof_values (const std::vector<Vector<double> > &support_point_values,
86  std::vector<double> &nodal_values) const;
87 
96  virtual void
98  FullMatrix<double> &matrix) const;
99 
108  virtual void
110  const unsigned int subface,
111  FullMatrix<double> &matrix) const;
112 
117  virtual bool has_support_on_face (const unsigned int shape_index,
118  const unsigned int face_index) const;
119 
142  virtual
143  std::vector<std::pair<unsigned int, unsigned int> >
145 
152  virtual
153  std::vector<std::pair<unsigned int, unsigned int> >
155 
162  virtual
163  std::vector<std::pair<unsigned int, unsigned int> >
165 
170  virtual bool hp_constraints_are_implemented () const;
171 
181  virtual
192  virtual std::pair<Table<2,bool>, std::vector<unsigned int> >
193  get_constant_modes () const;
194 
195 private:
199  static std::vector<unsigned int> get_dpo_vector (const unsigned int deg);
200 };
201 
202 
203 
216 template <int spacedim>
217 class FE_FaceQ<1,spacedim> : public FiniteElement<1,spacedim>
218 {
219 public:
223  FE_FaceQ (const unsigned int p);
224 
225  virtual
226  std::unique_ptr<FiniteElement<1,spacedim>>
227  clone() const;
228 
234  virtual std::string get_name () const;
235 
236  // for documentation, see the FiniteElement base class
237  virtual
239  requires_update_flags (const UpdateFlags update_flags) const;
240 
249  virtual void
251  FullMatrix<double> &matrix) const;
252 
261  virtual void
263  const unsigned int subface,
264  FullMatrix<double> &matrix) const;
265 
270  virtual bool has_support_on_face (const unsigned int shape_index,
271  const unsigned int face_index) const;
272 
277  virtual bool hp_constraints_are_implemented () const;
278 
296  virtual
297  std::vector<std::pair<unsigned int, unsigned int> >
299 
306  virtual
307  std::vector<std::pair<unsigned int, unsigned int> >
308  hp_line_dof_identities (const FiniteElement<1, spacedim> &fe_other) const;
309 
316  virtual
317  std::vector<std::pair<unsigned int, unsigned int> >
318  hp_quad_dof_identities (const FiniteElement<1, spacedim> &fe_other) const;
319 
329  virtual
332 
337  virtual std::pair<Table<2,bool>, std::vector<unsigned int> >
338  get_constant_modes () const;
339 
340 protected:
341  /*
342  * NOTE: The following functions have their definitions inlined into the class declaration
343  * because we otherwise run into a compiler error with MS Visual Studio.
344  */
345 
346 
347  virtual
348  std::unique_ptr<typename FiniteElement<1,spacedim>::InternalDataBase>
349  get_data (const UpdateFlags /*update_flags*/,
350  const Mapping<1,spacedim> &/*mapping*/,
351  const Quadrature<1> &/*quadrature*/,
353  {
354  return std_cxx14::make_unique<typename FiniteElement<1, spacedim>::InternalDataBase>();
355  }
356 
357  std::unique_ptr<typename FiniteElement<1,spacedim>::InternalDataBase>
358  get_face_data(const UpdateFlags update_flags,
359  const Mapping<1,spacedim> &/*mapping*/,
360  const Quadrature<0> &quadrature,
362  {
363  // generate a new data object and initialize some fields
364  auto data = std_cxx14::make_unique<typename FiniteElement<1,spacedim>::InternalDataBase>();
365  data->update_each = requires_update_flags(update_flags);
366 
367  const unsigned int n_q_points = quadrature.size();
368  AssertDimension(n_q_points, 1);
369  (void)n_q_points;
370 
371  // No derivatives of this element are implemented.
372  if (data->update_each & update_gradients || data->update_each & update_hessians)
373  {
374  Assert(false, ExcNotImplemented());
375  }
376 
377  return std::move(data);
378  }
379 
380  std::unique_ptr<typename FiniteElement<1,spacedim>::InternalDataBase>
381  get_subface_data(const UpdateFlags update_flags,
382  const Mapping<1,spacedim> &mapping,
383  const Quadrature<0> &quadrature,
385  {
386  return get_face_data(update_flags, mapping, quadrature, output_data);
387  }
388 
389  virtual
390  void
391  fill_fe_values (const typename Triangulation<1,spacedim>::cell_iterator &cell,
392  const CellSimilarity::Similarity cell_similarity,
393  const Quadrature<1> &quadrature,
394  const Mapping<1,spacedim> &mapping,
395  const typename Mapping<1,spacedim>::InternalDataBase &mapping_internal,
396  const ::internal::FEValuesImplementation::MappingRelatedData<1, spacedim> &mapping_data,
397  const typename FiniteElement<1,spacedim>::InternalDataBase &fe_internal,
399 
400  virtual
401  void
402  fill_fe_face_values (const typename Triangulation<1,spacedim>::cell_iterator &cell,
403  const unsigned int face_no,
404  const Quadrature<0> &quadrature,
405  const Mapping<1,spacedim> &mapping,
406  const typename Mapping<1,spacedim>::InternalDataBase &mapping_internal,
407  const ::internal::FEValuesImplementation::MappingRelatedData<1, spacedim> &mapping_data,
408  const typename FiniteElement<1,spacedim>::InternalDataBase &fe_internal,
410 
411  virtual
412  void
413  fill_fe_subface_values (const typename Triangulation<1,spacedim>::cell_iterator &cell,
414  const unsigned int face_no,
415  const unsigned int sub_no,
416  const Quadrature<0> &quadrature,
417  const Mapping<1,spacedim> &mapping,
418  const typename Mapping<1,spacedim>::InternalDataBase &mapping_internal,
419  const ::internal::FEValuesImplementation::MappingRelatedData<1, spacedim> &mapping_data,
420  const typename FiniteElement<1,spacedim>::InternalDataBase &fe_internal,
422 
423 private:
427  static
428  std::vector<unsigned int>
429  get_dpo_vector (const unsigned int deg);
430 };
431 
432 
433 
458 template <int dim, int spacedim=dim>
459 class FE_FaceP : public FE_PolyFace<PolynomialSpace<dim-1>, dim, spacedim>
460 {
461 public:
467  FE_FaceP(unsigned int p);
468 
469  virtual
470  std::unique_ptr<FiniteElement<dim,spacedim> >
471  clone() const;
472 
478  virtual std::string get_name () const;
479 
488  virtual void
490  FullMatrix<double> &matrix) const;
491 
500  virtual void
502  const unsigned int subface,
503  FullMatrix<double> &matrix) const;
504 
509  virtual bool has_support_on_face (const unsigned int shape_index,
510  const unsigned int face_index) const;
511 
516  virtual bool hp_constraints_are_implemented () const;
517 
527  virtual
530 
537  virtual std::pair<Table<2,bool>, std::vector<unsigned int> >
538  get_constant_modes () const;
539 
540 private:
544  static std::vector<unsigned int> get_dpo_vector (const unsigned int deg);
545 };
546 
547 
548 
553 template <int spacedim>
554 class FE_FaceP<1,spacedim> : public FE_FaceQ<1,spacedim>
555 {
556 public:
560  FE_FaceP (const unsigned int p);
561 
565  std::string get_name() const;
566 };
567 
568 
569 DEAL_II_NAMESPACE_CLOSE
570 
571 #endif
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const
Definition: fe_face.cc:774
#define AssertDimension(dim1, dim2)
Definition: exceptions.h:1248
virtual std::unique_ptr< FiniteElement< dim, spacedim > > clone() const
Definition: fe_face.cc:748
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
Definition: fe_poly_face.h:95
virtual FiniteElementDomination::Domination compare_for_face_domination(const FiniteElement< dim, spacedim > &fe_other) const
Definition: fe_face.cc:811
virtual void get_face_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const
Definition: fe_face.cc:141
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
Definition: fe_poly_face.h:144
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_quad_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
Definition: fe_face.cc:356
virtual void get_subface_interpolation_matrix(const FiniteElement< dim, spacedim > &source, const unsigned int subface, FullMatrix< double > &matrix) const
Definition: fe_face.cc:153
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const
#define Assert(cond, exc)
Definition: exceptions.h:1142
UpdateFlags
virtual std::pair< Table< 2, bool >, std::vector< unsigned int > > get_constant_modes() const
Definition: fe_face.cc:465
virtual std::string get_name() const
Definition: fe_face.cc:757
Abstract base class for mapping classes.
Definition: dof_tools.h:46
virtual bool hp_constraints_are_implemented() const
Definition: fe_face.cc:801
FE_FaceQ(const unsigned int p)
Definition: fe_face.cc:49
virtual void convert_generalized_support_point_values_to_dof_values(const std::vector< Vector< double > > &support_point_values, std::vector< double > &nodal_values) const
Definition: fe_face.cc:477
static std::vector< unsigned int > get_dpo_vector(const unsigned int deg)
Definition: fe_face.cc:785
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const
Definition: fe_face.cc:241
Second derivatives of shape functions.
virtual void get_subface_interpolation_matrix(const FiniteElement< dim, spacedim > &source, const unsigned int subface, FullMatrix< double > &matrix) const
Definition: fe_face.cc:859
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_vertex_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
Definition: fe_face.cc:275
unsigned int size() const
virtual void get_face_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const
Definition: fe_face.cc:847
virtual std::unique_ptr< FiniteElement< dim, spacedim > > clone() const
Definition: fe_face.cc:114
Shape function gradients.
static std::vector< unsigned int > get_dpo_vector(const unsigned int deg)
Definition: fe_face.cc:252
static ::ExceptionBase & ExcNotImplemented()
FE_FaceP(unsigned int p)
Definition: fe_face.cc:736
virtual std::string get_name() const
Definition: fe_face.cc:123
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
Definition: fe_poly_face.h:86
virtual std::pair< Table< 2, bool >, std::vector< unsigned int > > get_constant_modes() const
Definition: fe_face.cc:959
virtual FiniteElementDomination::Domination compare_for_face_domination(const FiniteElement< dim, spacedim > &fe_other) const
Definition: fe_face.cc:431
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_line_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
Definition: fe_face.cc:287
virtual bool hp_constraints_are_implemented() const
Definition: fe_face.cc:265