]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Automagically determine number of elements in fields.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 30 Mar 2001 07:50:03 +0000 (07:50 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 30 Mar 2001 07:50:03 +0000 (07:50 +0000)
git-svn-id: https://svn.dealii.org/trunk@4345 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/fe/fe_dgq_1d.cc
deal.II/deal.II/source/fe/fe_dgq_2d.cc
deal.II/deal.II/source/fe/fe_dgq_3d.cc
deal.II/deal.II/source/fe/fe_q_1d.cc
deal.II/deal.II/source/fe/fe_q_2d.cc
deal.II/deal.II/source/fe/fe_q_3d.cc

index 9438ba56497722ef2ca142d29d648074f2e87cff..1c54afdc0f8178447af1f333cb56d4d0d091dad1 100644 (file)
@@ -138,7 +138,9 @@ const double * const FE_DGQ<1>::Matrices::embedding[] =
 };
 
 
-const unsigned int FE_DGQ<1>::Matrices::n_embedding_matrices = 5;
+const unsigned int FE_DGQ<1>::Matrices::n_embedding_matrices
+  = sizeof(FE_DGQ<1>::Matrices::embedding) /
+    sizeof(FE_DGQ<1>::Matrices::embedding[0]);
 
 
 
@@ -156,7 +158,10 @@ const double * const FE_DGQ<1>::Matrices::projection_matrices[] =
 };
 
 
-const unsigned int FE_DGQ<1>::Matrices::n_projection_matrices = 8;
+const unsigned int FE_DGQ<1>::Matrices::n_projection_matrices
+  = sizeof(FE_DGQ<1>::Matrices::projection_matrices) /
+    sizeof(FE_DGQ<1>::Matrices::projection_matrices[0]);
+
 
 #else // #if deal_II_dimension
 // On gcc2.95 on Alpha OSF1, the native assembler does not like empty
index facf0ff5097c6e171dd18f3ac3970875d1247619..47b95aaf35273f5a22e6e987c9d740d7ae1705cf 100644 (file)
@@ -344,8 +344,9 @@ const double * const FE_DGQ<2>::Matrices::embedding[] =
       FE_DGQ_2d::dgq4_into_dgq4_refined
 };
 
-const unsigned int FE_DGQ<2>::Matrices::n_embedding_matrices = 5;
-
+const unsigned int FE_DGQ<2>::Matrices::n_embedding_matrices
+  = sizeof(FE_DGQ<2>::Matrices::embedding) /
+    sizeof(FE_DGQ<2>::Matrices::embedding[0]);
 
 
 const double * const FE_DGQ<2>::Matrices::projection_matrices[] =
@@ -361,7 +362,10 @@ const double * const FE_DGQ<2>::Matrices::projection_matrices[] =
 };
 
 
-const unsigned int FE_DGQ<2>::Matrices::n_projection_matrices = 8;
+const unsigned int FE_DGQ<2>::Matrices::n_projection_matrices
+  = sizeof(FE_DGQ<2>::Matrices::projection_matrices) /
+    sizeof(FE_DGQ<2>::Matrices::projection_matrices[0]);
+
 
 #else // #if deal_II_dimension
 // On gcc2.95 on Alpha OSF1, the native assembler does not like empty
index 90618398721dec9bf9654d45de473aac44bf6728..07ae49c5cb0828972b1bb57b9226294cc5892c49 100644 (file)
@@ -396,7 +396,10 @@ const double * const FE_DGQ<3>::Matrices::embedding[] =
 };
 
 
-const unsigned int FE_DGQ<3>::Matrices::n_embedding_matrices = 4;
+const unsigned int FE_DGQ<3>::Matrices::n_embedding_matrices
+  = sizeof(FE_DGQ<3>::Matrices::embedding) /
+    sizeof(FE_DGQ<3>::Matrices::embedding[0]);
+
 
 
 const double * const FE_DGQ<3>::Matrices::projection_matrices[] =
@@ -408,7 +411,9 @@ const double * const FE_DGQ<3>::Matrices::projection_matrices[] =
       FE_DGQ_3d::dgq4_refined_onto_dgq4
 };
 
-const unsigned int FE_DGQ<3>::Matrices::n_projection_matrices = 5;
+const unsigned int FE_DGQ<3>::Matrices::n_projection_matrices
+  = sizeof(FE_DGQ<3>::Matrices::projection_matrices) /
+    sizeof(FE_DGQ<3>::Matrices::projection_matrices[0]);
 
 
 #else // #if deal_II_dimension
index 4ff87beabf9e865b30a6d767eb853ca312c0e640..3d8cbaa3b08f345729c49997d92b04a66e0217bb 100644 (file)
@@ -90,8 +90,6 @@ namespace FE_Q_1d
 // embedding matrices
 
 
-const unsigned int  FE_Q<1>::Matrices::n_embedding_matrices = 4;
-
 const double * const
 FE_Q<1>::Matrices::embedding[][GeometryInfo<1>::children_per_cell] =
 {
@@ -101,6 +99,12 @@ FE_Q<1>::Matrices::embedding[][GeometryInfo<1>::children_per_cell] =
   {FE_Q_1d::q4_into_q4_refined_0, FE_Q_1d::q4_into_q4_refined_1},
 };
 
+const unsigned int
+FE_Q<1>::Matrices::n_embedding_matrices
+  = sizeof(FE_Q<1>::Matrices::embedding) /
+    sizeof(FE_Q<1>::Matrices::embedding[0]);
+
+
 
 // No constraints in 1d
 const unsigned int 
index 4ccccb945c3c6c2c8bff6702bbf5c86c8e272d60..aa9422a8e0a10b0c42b8dc118d388b69efccbb46 100644 (file)
@@ -190,8 +190,6 @@ namespace FE_Q_2d
 
 // embedding matrices
 
-const unsigned int FE_Q<2>::Matrices::n_embedding_matrices = 3;
-
 const double * const 
 FE_Q<2>::Matrices::embedding[][GeometryInfo<2>::children_per_cell] =
 {
@@ -204,6 +202,11 @@ FE_Q<2>::Matrices::embedding[][GeometryInfo<2>::children_per_cell] =
 };
 
 
+const unsigned int
+FE_Q<2>::Matrices::n_embedding_matrices
+  = sizeof(FE_Q<2>::Matrices::embedding) /
+    sizeof(FE_Q<2>::Matrices::embedding[0]);
+
 
 // Constraint matrices taken from Wolfgangs old version
 namespace FE_Q_2d 
@@ -253,7 +256,9 @@ FE_Q<2>::Matrices::constraint_matrices[] =
 
 
 const unsigned int 
-FE_Q<2>::Matrices::n_constraint_matrices = 4;
+FE_Q<2>::Matrices::n_constraint_matrices
+  = sizeof(FE_Q<2>::Matrices::constraint_matrices) /
+    sizeof(FE_Q<2>::Matrices::constraint_matrices[0]);
 
 
 
index 1ffb80dc268b5e00c43f55f7ad11327da5afa538..bf96e3a55e5313834988280b453769caf2184ca2 100644 (file)
@@ -369,9 +369,6 @@ namespace FE_Q_3d
 
 // embedding matrices
 
-const unsigned int 
-FE_Q<3>::Matrices::n_embedding_matrices = 2;
-
 const double * const 
 FE_Q<3>::Matrices::embedding[][GeometryInfo<3>::children_per_cell] =
 {
@@ -386,6 +383,12 @@ FE_Q<3>::Matrices::embedding[][GeometryInfo<3>::children_per_cell] =
 };
 
 
+const unsigned int
+FE_Q<3>::Matrices::n_embedding_matrices
+  = sizeof(FE_Q<3>::Matrices::embedding) /
+    sizeof(FE_Q<3>::Matrices::embedding[0]);
+
+
 
 // Constraint matrices taken from Wolfgangs old version
 
@@ -434,7 +437,10 @@ FE_Q<3>::Matrices::constraint_matrices[] =
 };
 
 const unsigned int 
-FE_Q<3>::Matrices::n_constraint_matrices = 2;
+FE_Q<3>::Matrices::n_constraint_matrices
+  = sizeof(FE_Q<3>::Matrices::constraint_matrices) /
+    sizeof(FE_Q<3>::Matrices::constraint_matrices[0]);
+
 
 
 #else // #if deal_II_dimension

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.