]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use ReferenceCell::Type to get Info 10673/head
authorPeter Munch <peterrmuench@gmail.com>
Wed, 8 Jul 2020 19:25:21 +0000 (21:25 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Fri, 17 Jul 2020 07:15:15 +0000 (09:15 +0200)
include/deal.II/grid/tria_accessor.templates.h

index 0f9408e7ab953effabf52dd26ba798bfec91a7c4..1ee14383773ba5ac6f0c5f1f3f5d7f08c9e332bf 100644 (file)
@@ -2163,26 +2163,12 @@ template <int structdim, int dim, int spacedim>
 inline const ReferenceCell::internal::Info::Base &
 TriaAccessor<structdim, dim, spacedim>::reference_cell_info() const
 {
-  static ReferenceCell::internal::Info::Base   gei_invalid;
-  static ReferenceCell::internal::Info::Vertex gei_vertex;
-  static ReferenceCell::internal::Info::Line   gei_line;
-  static ReferenceCell::internal::Info::Quad   gei_quad;
-  static ReferenceCell::internal::Info::Hex    gei_hex;
-
-  switch (structdim) // TODO: use ReferenceCell::Type
-    {
-      case 0:
-        return gei_vertex;
-      case 1:
-        return gei_line;
-      case 2:
-        return gei_quad;
-      case 3:
-        return gei_hex;
-      default:
-        Assert(false, StandardExceptions::ExcNotImplemented());
-        return gei_invalid;
-    }
+  if (structdim == 0)
+    return ReferenceCell::internal::Info::get_cell(ReferenceCell::Type::Vertex);
+  else if (structdim == 1)
+    return ReferenceCell::internal::Info::get_cell(ReferenceCell::Type::Line);
+  else
+    return ReferenceCell::internal::Info::get_cell(this->reference_cell_type());
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.