Reference documentation for deal.II version 8.5.1
fe_face.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2009 - 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_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 
51 template <int dim, int spacedim=dim>
52 class FE_FaceQ : public FE_PolyFace<TensorProductPolynomials<dim-1>, dim, spacedim>
53 {
54 public:
60  FE_FaceQ (const unsigned int p);
61 
62  virtual FiniteElement<dim,spacedim> *clone() const;
63 
69  virtual std::string get_name () const;
70 
79  virtual void
81  FullMatrix<double> &matrix) const;
82 
91  virtual void
93  const unsigned int subface,
94  FullMatrix<double> &matrix) const;
95 
100  virtual bool has_support_on_face (const unsigned int shape_index,
101  const unsigned int face_index) const;
102 
107  virtual bool hp_constraints_are_implemented () const;
108 
118  virtual
121 
126  virtual std::pair<Table<2,bool>, std::vector<unsigned int> >
127  get_constant_modes () const;
128 
129 private:
133  static std::vector<unsigned int> get_dpo_vector (const unsigned int deg);
134 };
135 
136 
137 
150 template <int spacedim>
151 class FE_FaceQ<1,spacedim> : public FiniteElement<1,spacedim>
152 {
153 public:
157  FE_FaceQ (const unsigned int p);
158 
162  virtual FiniteElement<1,spacedim> *clone() const;
163 
169  virtual std::string get_name () const;
170 
171  // for documentation, see the FiniteElement base class
172  virtual
174  requires_update_flags (const UpdateFlags update_flags) const;
175 
184  virtual void
186  FullMatrix<double> &matrix) const;
187 
196  virtual void
198  const unsigned int subface,
199  FullMatrix<double> &matrix) const;
200 
205  virtual bool has_support_on_face (const unsigned int shape_index,
206  const unsigned int face_index) const;
207 
212  virtual bool hp_constraints_are_implemented () const;
213 
223  virtual
226 
231  virtual std::pair<Table<2,bool>, std::vector<unsigned int> >
232  get_constant_modes () const;
233 
234 protected:
235  /*
236  * NOTE: The following functions have their definitions inlined into the class declaration
237  * because we otherwise run into a compiler error with MS Visual Studio.
238  */
239 
240 
241  virtual
243  get_data (const UpdateFlags /*update_flags*/,
244  const Mapping<1,spacedim> &/*mapping*/,
245  const Quadrature<1> &/*quadrature*/,
247  {
249  }
250 
252  get_face_data(const UpdateFlags update_flags,
253  const Mapping<1,spacedim> &/*mapping*/,
254  const Quadrature<0> &quadrature,
256  {
257  // generate a new data object and initialize some fields
260  data->update_each = requires_update_flags(update_flags);
261 
262  const unsigned int n_q_points = quadrature.size();
263  AssertDimension(n_q_points, 1);
264  (void)n_q_points;
265 
266  // No derivatives of this element are implemented.
267  if (data->update_each & update_gradients || data->update_each & update_hessians)
268  {
269  Assert(false, ExcNotImplemented());
270  }
271 
272  return data;
273  }
274 
276  get_subface_data(const UpdateFlags update_flags,
277  const Mapping<1,spacedim> &mapping,
278  const Quadrature<0> &quadrature,
280  {
281  return get_face_data(update_flags, mapping, quadrature, output_data);
282  }
283 
284  virtual
285  void
286  fill_fe_values (const typename Triangulation<1,spacedim>::cell_iterator &cell,
287  const CellSimilarity::Similarity cell_similarity,
288  const Quadrature<1> &quadrature,
289  const Mapping<1,spacedim> &mapping,
290  const typename Mapping<1,spacedim>::InternalDataBase &mapping_internal,
291  const ::internal::FEValues::MappingRelatedData<1, spacedim> &mapping_data,
292  const typename FiniteElement<1,spacedim>::InternalDataBase &fe_internal,
294 
295  virtual
296  void
297  fill_fe_face_values (const typename Triangulation<1,spacedim>::cell_iterator &cell,
298  const unsigned int face_no,
299  const Quadrature<0> &quadrature,
300  const Mapping<1,spacedim> &mapping,
301  const typename Mapping<1,spacedim>::InternalDataBase &mapping_internal,
302  const ::internal::FEValues::MappingRelatedData<1, spacedim> &mapping_data,
303  const typename FiniteElement<1,spacedim>::InternalDataBase &fe_internal,
305 
306  virtual
307  void
308  fill_fe_subface_values (const typename Triangulation<1,spacedim>::cell_iterator &cell,
309  const unsigned int face_no,
310  const unsigned int sub_no,
311  const Quadrature<0> &quadrature,
312  const Mapping<1,spacedim> &mapping,
313  const typename Mapping<1,spacedim>::InternalDataBase &mapping_internal,
314  const ::internal::FEValues::MappingRelatedData<1, spacedim> &mapping_data,
315  const typename FiniteElement<1,spacedim>::InternalDataBase &fe_internal,
317 
318 private:
322  static
323  std::vector<unsigned int>
324  get_dpo_vector (const unsigned int deg);
325 };
326 
327 
328 
350 template <int dim, int spacedim=dim>
351 class FE_FaceP : public FE_PolyFace<PolynomialSpace<dim-1>, dim, spacedim>
352 {
353 public:
359  FE_FaceP(unsigned int p);
360 
364  virtual FiniteElement<dim,spacedim> *clone() const;
365 
371  virtual std::string get_name () const;
372 
381  virtual void
383  FullMatrix<double> &matrix) const;
384 
393  virtual void
395  const unsigned int subface,
396  FullMatrix<double> &matrix) const;
397 
402  virtual bool has_support_on_face (const unsigned int shape_index,
403  const unsigned int face_index) const;
404 
409  virtual bool hp_constraints_are_implemented () const;
410 
420  virtual
423 
430  virtual std::pair<Table<2,bool>, std::vector<unsigned int> >
431  get_constant_modes () const;
432 
433 private:
437  static std::vector<unsigned int> get_dpo_vector (const unsigned int deg);
438 };
439 
440 
441 
445 template <int spacedim>
446 class FE_FaceP<1,spacedim> : public FE_FaceQ<1,spacedim>
447 {
448 public:
452  FE_FaceP (const unsigned int p);
453 
457  std::string get_name() const;
458 };
459 
460 
461 DEAL_II_NAMESPACE_CLOSE
462 
463 #endif
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const
Definition: fe_face.cc:557
#define AssertDimension(dim1, dim2)
Definition: exceptions.h:1146
virtual FiniteElement< dim, spacedim > * clone() const
Definition: fe_face.cc:531
virtual FiniteElement< dim, spacedim > * clone() const
Definition: fe_face.cc:106
virtual FiniteElementDomination::Domination compare_for_face_domination(const FiniteElement< dim, spacedim > &fe_other) const
Definition: fe_face.cc:595
virtual void get_face_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const
Definition: fe_face.cc:133
virtual void get_subface_interpolation_matrix(const FiniteElement< dim, spacedim > &source, const unsigned int subface, FullMatrix< double > &matrix) const
Definition: fe_face.cc:145
virtual FiniteElement< dim, spacedim >::InternalDataBase * get_data(const UpdateFlags, const Mapping< dim, spacedim > &, const Quadrature< dim > &, ::internal::FEValues::FiniteElementRelatedData< dim, spacedim > &) const
Definition: fe_poly_face.h:85
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const
#define Assert(cond, exc)
Definition: exceptions.h:313
UpdateFlags
virtual std::pair< Table< 2, bool >, std::vector< unsigned int > > get_constant_modes() const
Definition: fe_face.cc:301
virtual std::string get_name() const
Definition: fe_face.cc:540
Abstract base class for mapping classes.
Definition: dof_tools.h:46
virtual bool hp_constraints_are_implemented() const
Definition: fe_face.cc:585
FE_FaceQ(const unsigned int p)
Definition: fe_face.cc:41
static std::vector< unsigned int > get_dpo_vector(const unsigned int deg)
Definition: fe_face.cc:568
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const
Definition: fe_face.cc:233
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:643
unsigned int size() const
virtual void get_face_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix) const
Definition: fe_face.cc:631
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_poly_face.h:144
Shape function gradients.
static std::vector< unsigned int > get_dpo_vector(const unsigned int deg)
Definition: fe_face.cc:244
static ::ExceptionBase & ExcNotImplemented()
FE_FaceP(unsigned int p)
Definition: fe_face.cc:519
virtual std::string get_name() const
Definition: fe_face.cc:115
virtual std::pair< Table< 2, bool >, std::vector< unsigned int > > get_constant_modes() const
Definition: fe_face.cc:743
virtual FiniteElementDomination::Domination compare_for_face_domination(const FiniteElement< dim, spacedim > &fe_other) const
Definition: fe_face.cc:267
FiniteElement< dim, spacedim >::InternalDataBase * get_face_data(const UpdateFlags update_flags, const Mapping< dim, spacedim > &, const Quadrature< dim-1 > &quadrature, ::internal::FEValues::FiniteElementRelatedData< dim, spacedim > &) const
Definition: fe_poly_face.h:95
virtual bool hp_constraints_are_implemented() const
Definition: fe_face.cc:257