]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use the GeometryInfo<dim> class in some places to enhance readability.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 25 May 1998 22:31:58 +0000 (22:31 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 25 May 1998 22:31:58 +0000 (22:31 +0000)
git-svn-id: https://svn.dealii.org/trunk@364 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/fe/fe.cc

index 32fce303d0f8064e8cb38ae51e0aeabda8ca78a1..b564fa2b1bcff2082c55c2fca03d251f4f48b009 100644 (file)
@@ -47,7 +47,7 @@ FiniteElementBase<1>::FiniteElementBase (const unsigned int dofs_per_vertex,
   Assert (dofs_per_quad==0, ExcInternalError());
 
   const unsigned int dim=1;
-  for (unsigned int i=0; i<(1<<dim); ++i) 
+  for (unsigned int i=0; i<GeometryInfo<dim>::children_per_cell; ++i) 
     {
       restriction[i].reinit (total_dofs, total_dofs);
       prolongation[i].reinit (total_dofs, total_dofs);
@@ -67,7 +67,7 @@ FiniteElementBase<2>::FiniteElementBase (const unsigned int dofs_per_vertex,
                                      dofs_per_quad)
 {
   const unsigned int dim=2;
-  for (unsigned int i=0; i<(1<<dim); ++i) 
+  for (unsigned int i=0; i<GeometryInfo<dim>::children_per_cell; ++i) 
     {
       restriction[i].reinit (total_dofs, total_dofs);
       prolongation[i].reinit (total_dofs, total_dofs);
@@ -81,7 +81,7 @@ FiniteElementBase<2>::FiniteElementBase (const unsigned int dofs_per_vertex,
 template <int dim>
 const dFMatrix &
 FiniteElementBase<dim>::restrict (const unsigned int child) const {
-  Assert (child<(1<<dim), ExcInvalidIndex(child));
+  Assert (child<GeometryInfo<dim>::children_per_cell, ExcInvalidIndex(child));
   return restriction[child];
 };
 
@@ -90,7 +90,7 @@ FiniteElementBase<dim>::restrict (const unsigned int child) const {
 template <int dim>
 const dFMatrix &
 FiniteElementBase<dim>::prolongate (const unsigned int child) const {
-  Assert (child<(1<<dim), ExcInvalidIndex(child));
+  Assert (child<GeometryInfo<dim>::children_per_cell, ExcInvalidIndex(child));
   return prolongation[child];
 };
 

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.