]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Revert to the old style scheme of explicitely specializing
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 23 May 2001 08:15:25 +0000 (08:15 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 23 May 2001 08:15:25 +0000 (08:15 +0000)
GeometryInfo for all dimensions.

git-svn-id: https://svn.dealii.org/trunk@4710 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/grid/geometry_info.h
deal.II/deal.II/source/grid/geometry_info.cc

index 3c53ed37ab06fd23e10ec6b494577a2f4e5f8768..dd4a99b61f5541b2e9fa6a702138ecee22a8d731 100644 (file)
@@ -194,50 +194,69 @@ struct GeometryInfo<0>
 
 
 
-/* -------------- declaration of explicit specializations ------------- */
-
+//TODO:[WB] Document new classes, and reference in old one.
+template <>
+struct GeometryInfo<1> 
+{
+    static const unsigned int dim               = 1;
+    static const unsigned int children_per_cell = 2;
+    static const unsigned int faces_per_cell    = 2;
+    static const unsigned int subfaces_per_face = 0;
+    static const unsigned int vertices_per_cell = 2;
+    static const unsigned int vertices_per_face = 1;
+    static const unsigned int lines_per_face    = 0;
+    static const unsigned int quads_per_face    = 0;
+    static const unsigned int lines_per_cell    = 1;
+    static const unsigned int quads_per_cell    = 0;
+    static const unsigned int hexes_per_cell    = 0;
+    static const unsigned int opposite_face[faces_per_cell];
+    static unsigned int child_cell_on_face (const unsigned int face,
+                                           const unsigned int subface);
+};
 
-template <> const unsigned int GeometryInfo<1>::opposite_face[GeometryInfo<1>::faces_per_cell];
-template <> const unsigned int GeometryInfo<2>::opposite_face[GeometryInfo<2>::faces_per_cell];
-template <> const unsigned int GeometryInfo<3>::opposite_face[GeometryInfo<3>::faces_per_cell];
 
 
+template <>
+struct GeometryInfo<2>
+{
+    static const unsigned int dim               = 2;
+    static const unsigned int children_per_cell = 4;
+    static const unsigned int faces_per_cell    = 4;
+    static const unsigned int subfaces_per_face = 2;
+    static const unsigned int vertices_per_cell = 4;
+    static const unsigned int vertices_per_face = 2;
+    static const unsigned int lines_per_face    = 1;
+    static const unsigned int quads_per_face    = 0;
+    static const unsigned int lines_per_cell    = 4;
+    static const unsigned int quads_per_cell    = 1;
+    static const unsigned int hexes_per_cell    = 0;
+    static const unsigned int opposite_face[faces_per_cell];
+    static unsigned int child_cell_on_face (const unsigned int face,
+                                           const unsigned int subface);
+};
 
 
-/*---------------------------- Inline functions --------------------------------*/
 
-template<>
-inline unsigned int
-GeometryInfo<2>::child_cell_on_face (const unsigned int face,
-                                     const unsigned int subface)
+template <>
+struct GeometryInfo<3> 
 {
-  Assert (face<faces_per_cell, ExcIndexRange(face, 0, faces_per_cell));
-  Assert (subface<subfaces_per_face, ExcIndexRange(subface, 0, subfaces_per_face));
-  
-  const unsigned subcells[faces_per_cell][subfaces_per_face] = {{0,1},
-                                                               {1,2},
-                                                               {3,2},
-                                                               {0,3}};
-  return subcells[face][subface];
+    static const unsigned int dim               = 3;
+    static const unsigned int children_per_cell = 8;
+    static const unsigned int faces_per_cell    = 6;
+    static const unsigned int subfaces_per_face = 4;
+    static const unsigned int vertices_per_cell = 8;
+    static const unsigned int vertices_per_face = 4;
+    static const unsigned int lines_per_face    = 4;
+    static const unsigned int quads_per_face    = 1;
+    static const unsigned int lines_per_cell    = 12;
+    static const unsigned int quads_per_cell    = 6;
+    static const unsigned int hexes_per_cell    = 1;
+    static const unsigned int opposite_face[faces_per_cell];
+    static unsigned int child_cell_on_face (const unsigned int face,
+                                           const unsigned int subface);
 };
 
 
-template<>
-inline
-unsigned int GeometryInfo<3>::child_cell_on_face (const unsigned int face,
-                                                 const unsigned int subface)
-{
-  Assert (face<faces_per_cell, ExcIndexRange(face, 0, faces_per_cell));
-  Assert (subface<subfaces_per_face, ExcIndexRange(subface, 0, subfaces_per_face));
-  
-  const unsigned subcells[faces_per_cell][subfaces_per_face] = {{0, 1, 2, 3},
-                                                               {4, 5, 6, 7},
-                                                               {0, 1, 5, 4},
-                                                               {1, 5, 6, 2},
-                                                               {3, 2, 6, 7},
-                                                               {0, 4, 7, 3}};
-  return subcells[face][subface];
-};
 
 
 #endif
index 554a46a742a16fe05f3579e0f5a4cfd22e796e2b..7a918922a5fcc3b4d225720e0ac2d4ac095457e7 100644 (file)
 #include <grid/geometry_info.h>
 
 
-template <int dim> const unsigned int GeometryInfo<dim>::vertices_per_cell;
-template <int dim> const unsigned int GeometryInfo<dim>::lines_per_cell;
-template <int dim> const unsigned int GeometryInfo<dim>::quads_per_cell;
-template <int dim> const unsigned int GeometryInfo<dim>::hexes_per_cell;
-template <int dim> const unsigned int GeometryInfo<dim>::children_per_cell;
+const unsigned int GeometryInfo<1>::dim;
+const unsigned int GeometryInfo<1>::children_per_cell;
+const unsigned int GeometryInfo<1>::faces_per_cell;
+const unsigned int GeometryInfo<1>::subfaces_per_face;
+const unsigned int GeometryInfo<1>::vertices_per_cell;
+const unsigned int GeometryInfo<1>::vertices_per_face;
+const unsigned int GeometryInfo<1>::lines_per_face;
+const unsigned int GeometryInfo<1>::quads_per_face;
+const unsigned int GeometryInfo<1>::lines_per_cell;
+const unsigned int GeometryInfo<1>::quads_per_cell;
+const unsigned int GeometryInfo<1>::hexes_per_cell;
+
+const unsigned int GeometryInfo<2>::dim;
+const unsigned int GeometryInfo<2>::children_per_cell;
+const unsigned int GeometryInfo<2>::faces_per_cell;
+const unsigned int GeometryInfo<2>::subfaces_per_face;
+const unsigned int GeometryInfo<2>::vertices_per_cell;
+const unsigned int GeometryInfo<2>::vertices_per_face;
+const unsigned int GeometryInfo<2>::lines_per_face;
+const unsigned int GeometryInfo<2>::quads_per_face;
+const unsigned int GeometryInfo<2>::lines_per_cell;
+const unsigned int GeometryInfo<2>::quads_per_cell;
+const unsigned int GeometryInfo<2>::hexes_per_cell;
+
+const unsigned int GeometryInfo<3>::dim;
+const unsigned int GeometryInfo<3>::children_per_cell;
+const unsigned int GeometryInfo<3>::faces_per_cell;
+const unsigned int GeometryInfo<3>::subfaces_per_face;
+const unsigned int GeometryInfo<3>::vertices_per_cell;
+const unsigned int GeometryInfo<3>::vertices_per_face;
+const unsigned int GeometryInfo<3>::lines_per_face;
+const unsigned int GeometryInfo<3>::quads_per_face;
+const unsigned int GeometryInfo<3>::lines_per_cell;
+const unsigned int GeometryInfo<3>::quads_per_cell;
+const unsigned int GeometryInfo<3>::hexes_per_cell;
+
 
 
-template <>
 const unsigned int GeometryInfo<1>::opposite_face[GeometryInfo<1>::faces_per_cell]
 = { 0, 1 };
 
 
-template <>
 const unsigned int GeometryInfo<2>::opposite_face[GeometryInfo<2>::faces_per_cell]
 = { 2, 3, 0, 1 };
 
 
-template <>
 const unsigned int GeometryInfo<3>::opposite_face[GeometryInfo<3>::faces_per_cell]
 = { 1, 0, 4, 5, 2, 3 };
 
 
 
-template class GeometryInfo<deal_II_dimension>;
+
+
+unsigned int
+GeometryInfo<2>::child_cell_on_face (const unsigned int face,
+                                     const unsigned int subface)
+{
+  Assert (face<faces_per_cell, ExcIndexRange(face, 0, faces_per_cell));
+  Assert (subface<subfaces_per_face, ExcIndexRange(subface, 0, subfaces_per_face));
+  
+  const unsigned subcells[faces_per_cell][subfaces_per_face] = {{0,1},
+                                                               {1,2},
+                                                               {3,2},
+                                                               {0,3}};
+  return subcells[face][subface];
+};
+
+
+
+
+unsigned int
+GeometryInfo<3>::child_cell_on_face (const unsigned int face,
+                                    const unsigned int subface)
+{
+  Assert (face<faces_per_cell, ExcIndexRange(face, 0, faces_per_cell));
+  Assert (subface<subfaces_per_face, ExcIndexRange(subface, 0, subfaces_per_face));
+  
+  const unsigned subcells[faces_per_cell][subfaces_per_face] = {{0, 1, 2, 3},
+                                                               {4, 5, 6, 7},
+                                                               {0, 1, 5, 4},
+                                                               {1, 5, 6, 2},
+                                                               {3, 2, 6, 7},
+                                                               {0, 4, 7, 3}};
+  return subcells[face][subface];
+};

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.