From: Peter Munch <peterrmuench@gmail.com>
Date: Sat, 18 Jul 2020 17:27:58 +0000 (+0200)
Subject: Store reference cell type in FiniteElementData
X-Git-Tag: v9.3.0-rc1~1264^2~1
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b9c257aaa8e7e9d449f145fd6bef1da231fc245;p=dealii.git

Store reference cell type in FiniteElementData
---

diff --git a/include/deal.II/fe/fe_base.h b/include/deal.II/fe/fe_base.h
index 1b3c42f652..3b69a65a82 100644
--- a/include/deal.II/fe/fe_base.h
+++ b/include/deal.II/fe/fe_base.h
@@ -219,6 +219,13 @@ public:
    */
   static const unsigned int dimension = dim;
 
+private:
+  /**
+   * Reference cell type.
+   */
+  const ReferenceCell::Type cell_type;
+
+public:
   /**
    * Number of degrees of freedom on a vertex.
    */
@@ -364,6 +371,12 @@ public:
                     const Conformity                 conformity = unknown,
                     const BlockIndices &block_indices = BlockIndices());
 
+  /**
+   * Return type of reference cell.
+   */
+  ReferenceCell::Type
+  reference_cell_type() const;
+
   /**
    * Number of dofs per vertex.
    */
@@ -546,6 +559,14 @@ namespace FiniteElementDomination
 } // namespace FiniteElementDomination
 
 
+template <int dim>
+inline ReferenceCell::Type
+FiniteElementData<dim>::reference_cell_type() const
+{
+  return cell_type;
+}
+
+
 template <int dim>
 inline unsigned int
 FiniteElementData<dim>::n_dofs_per_vertex() const
diff --git a/source/fe/fe_data.cc b/source/fe/fe_data.cc
index ad587ad12d..f9fff482ff 100644
--- a/source/fe/fe_data.cc
+++ b/source/fe/fe_data.cc
@@ -46,7 +46,8 @@ FiniteElementData<dim>::FiniteElementData(
   const unsigned int               degree,
   const Conformity                 conformity,
   const BlockIndices &             block_indices)
-  : dofs_per_vertex(dofs_per_object[0])
+  : cell_type(cell_type)
+  , dofs_per_vertex(dofs_per_object[0])
   , dofs_per_line(dofs_per_object[1])
   , dofs_per_quad(dim > 1 ? dofs_per_object[2] : 0)
   , dofs_per_hex(dim > 2 ? dofs_per_object[3] : 0)