]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix some problems with offset indices.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 30 Sep 2003 22:31:35 +0000 (22:31 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 30 Sep 2003 22:31:35 +0000 (22:31 +0000)
git-svn-id: https://svn.dealii.org/trunk@8076 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/fe/fe_dgp.cc
deal.II/deal.II/source/fe/fe_dgq.cc
deal.II/deal.II/source/fe/fe_q.cc
deal.II/deal.II/source/fe/fe_q_hierarchical.cc
deal.II/deal.II/source/fe/fe_raviart_thomas.cc

index f020d38e9d5cabeab1c52ff6c7c7fde62ae3faba..0c772f15445419e5ab2616f2ccae08d82aaeb860 100644 (file)
@@ -18,6 +18,7 @@
 #include <fe/fe.h>
 #include <fe/mapping.h>
 #include <fe/fe_dgp.h>
+#include <fe/mapping_q1.h>
 #include <fe/fe_values.h>
 
 #ifdef HAVE_STD_STRINGSTREAM
@@ -350,7 +351,9 @@ FE_DGP<dim>::fill_fe_values (const Mapping<dim>                   &mapping,
     }
   
   if (flags & update_second_derivatives)
-    this->compute_2nd (mapping, cell, 0, mapping_data, fe_data, data);
+    this->compute_2nd (mapping, cell,
+                       internal::DataSetDescriptor<dim>::cell().offset(),
+                       mapping_data, fe_data, data);
 }
 
 
@@ -374,7 +377,10 @@ FE_DGP<dim>::fill_fe_face_values (const Mapping<dim>                   &mapping,
                                   // offset determines which data set
                                   // to take (all data sets for all
                                   // faces are stored contiguously)
-  const unsigned int offset = face * quadrature.n_quadrature_points;
+  const unsigned int offset
+    = (internal::DataSetDescriptor<dim>::
+       face (cell, face,
+             quadrature.n_quadrature_points)).offset();
   
   const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
 
@@ -422,8 +428,10 @@ FE_DGP<dim>::fill_fe_subface_values (const Mapping<dim>                   &mappi
                                   // offset determines which data set
                                   // to take (all data sets for all
                                   // sub-faces are stored contiguously)
-  const unsigned int offset = (face * GeometryInfo<dim>::subfaces_per_face + subface)
-                             * quadrature.n_quadrature_points;
+  const unsigned int offset
+    = (internal::DataSetDescriptor<dim>::
+       sub_face (cell, face, subface,
+                 quadrature.n_quadrature_points)).offset();
 
   const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
 
index 3c409c9e51621e984a5f58f29bbadb95d413e67b..3accfb98c43942ce04aafa0ec4c4482f51a877c7 100644 (file)
@@ -18,6 +18,7 @@
 #include <grid/tria_iterator.h>
 #include <dofs/dof_accessor.h>
 #include <fe/fe.h>
+#include <fe/mapping_q1.h>
 #include <fe/mapping.h>
 #include <fe/fe_dgq.h>
 #include <fe/fe_values.h>
@@ -764,7 +765,9 @@ FE_DGQ<dim>::fill_fe_values (const Mapping<dim>                   &mapping,
     }
   
   if (flags & update_second_derivatives)
-    this->compute_2nd (mapping, cell, 0, mapping_data, fe_data, data);
+    this->compute_2nd (mapping, cell,
+                       internal::DataSetDescriptor<dim>::cell().offset(),
+                       mapping_data, fe_data, data);
 }
 
 
@@ -788,7 +791,10 @@ FE_DGQ<dim>::fill_fe_face_values (const Mapping<dim>                   &mapping,
                                   // offset determines which data set
                                   // to take (all data sets for all
                                   // faces are stored contiguously)
-  const unsigned int offset = face * quadrature.n_quadrature_points;
+  const unsigned int offset
+    = (internal::DataSetDescriptor<dim>::
+       face (cell, face,
+             quadrature.n_quadrature_points)).offset();
   
   const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
 
@@ -836,8 +842,10 @@ FE_DGQ<dim>::fill_fe_subface_values (const Mapping<dim>                   &mappi
                                   // offset determines which data set
                                   // to take (all data sets for all
                                   // sub-faces are stored contiguously)
-  const unsigned int offset = (face * GeometryInfo<dim>::subfaces_per_face + subface)
-                             * quadrature.n_quadrature_points;
+  const unsigned int offset
+    = (internal::DataSetDescriptor<dim>::
+       sub_face (cell, face, subface,
+                 quadrature.n_quadrature_points)).offset();
 
   const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
 
index 30090b963a00e991add0884371de0c553518630e..572b02e9a44280e6266360b910c1fe8b10311ee4 100644 (file)
@@ -19,6 +19,7 @@
 #include <dofs/dof_accessor.h>
 #include <fe/fe.h>
 #include <fe/mapping.h>
+#include <fe/mapping_q1.h>
 #include <fe/fe_q.h>
 #include <fe/fe_values.h>
 
@@ -1687,7 +1688,9 @@ FE_Q<dim>::fill_fe_values (const Mapping<dim>                   &mapping,
     }
 
   if (flags & update_second_derivatives)
-    this->compute_2nd (mapping, cell, 0, mapping_data, fe_data, data);
+    this->compute_2nd (mapping, cell,
+                       internal::DataSetDescriptor<dim>::cell().offset(),
+                       mapping_data, fe_data, data);
 }
 
 
@@ -1711,7 +1714,10 @@ FE_Q<dim>::fill_fe_face_values (const Mapping<dim>                   &mapping,
                                   // offset determines which data set
                                   // to take (all data sets for all
                                   // faces are stored contiguously)
-  const unsigned int offset = face * quadrature.n_quadrature_points;
+  const unsigned int offset
+    = (internal::DataSetDescriptor<dim>::
+       face (cell, face,
+             quadrature.n_quadrature_points)).offset();
   
   const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
 
@@ -1759,8 +1765,10 @@ FE_Q<dim>::fill_fe_subface_values (const Mapping<dim>                   &mapping
                                   // offset determines which data set
                                   // to take (all data sets for all
                                   // sub-faces are stored contiguously)
-  const unsigned int offset = ((face * GeometryInfo<dim>::subfaces_per_face + subface)
-                               * quadrature.n_quadrature_points);
+  const unsigned int offset
+    = (internal::DataSetDescriptor<dim>::
+       sub_face (cell, face, subface,
+                 quadrature.n_quadrature_points)).offset();
 
   const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
 
index 26417028a0410e6f2f1ce7024cc4a41b301fd1ed..39cb5bd1e905137013164a614d5f57c862611792 100644 (file)
@@ -19,6 +19,7 @@
 #include <dofs/dof_accessor.h>
 #include <fe/fe.h>
 #include <fe/mapping.h>
+#include <fe/mapping_q1.h>
 #include <fe/fe_q_hierarchical.h>
 #include <fe/fe_values.h>
 
@@ -1059,7 +1060,9 @@ FE_Q_Hierarchical<dim>::fill_fe_values (
     }
 
   if (flags & update_second_derivatives)
-    this->compute_2nd (mapping, cell, 0, mapping_data, fe_data, data);
+    this->compute_2nd (mapping, cell,
+                       internal::DataSetDescriptor<dim>::cell().offset(),
+                       mapping_data, fe_data, data);
 }
 
 
@@ -1084,7 +1087,10 @@ FE_Q_Hierarchical<dim>::fill_fe_face_values (
                                   // offset determines which data set
                                   // to take (all data sets for all
                                   // faces are stored contiguously)
-  const unsigned int offset = face * quadrature.n_quadrature_points;
+  const unsigned int offset
+    = (internal::DataSetDescriptor<dim>::
+       face (cell, face,
+             quadrature.n_quadrature_points)).offset();
   
   const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
 
@@ -1133,8 +1139,10 @@ FE_Q_Hierarchical<dim>::fill_fe_subface_values (
                                   // offset determines which data set
                                   // to take (all data sets for all
                                   // sub-faces are stored contiguously)
-  const unsigned int offset = ((face * GeometryInfo<dim>::subfaces_per_face + subface)
-                               * quadrature.n_quadrature_points);
+  const unsigned int offset
+    = (internal::DataSetDescriptor<dim>::
+       sub_face (cell, face, subface,
+                 quadrature.n_quadrature_points)).offset();
 
   const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
 
index b46b93cc40656ab399abd703cf2cd9fa5044060c..28d837df1407ba26703da46d0a45cdebd13bda07 100644 (file)
@@ -18,6 +18,7 @@
 #include <dofs/dof_accessor.h>
 #include <fe/fe.h>
 #include <fe/mapping.h>
+#include <fe/mapping_q1.h>
 #include <fe/fe_raviart_thomas.h>
 #include <fe/fe_values.h>
 
@@ -1609,7 +1610,9 @@ FE_RaviartThomas<dim>::fill_fe_values (const Mapping<dim>                   &map
     }
 
   if (flags & update_second_derivatives)
-    this->compute_2nd (mapping, cell, 0, mapping_data, fe_data, data);
+    this->compute_2nd (mapping, cell,
+                       internal::DataSetDescriptor<dim>::cell().offset(),
+                       mapping_data, fe_data, data);
 }
 
 
@@ -1633,7 +1636,10 @@ FE_RaviartThomas<dim>::fill_fe_face_values (const Mapping<dim>
                                    // offset determines which data set
                                   // to take (all data sets for all
                                   // faces are stored contiguously)
-  const unsigned int offset = face * quadrature.n_quadrature_points;
+  const unsigned int offset
+    = (internal::DataSetDescriptor<dim>::
+       face (cell, face,
+             quadrature.n_quadrature_points)).offset();
 
                                   // get the flags indicating the
                                   // fields that have to be filled
@@ -1772,8 +1778,10 @@ FE_RaviartThomas<dim>::fill_fe_subface_values (const Mapping<dim>
                                    // offset determines which data set
                                   // to take (all data sets for all
                                   // faces are stored contiguously)
-  const unsigned int offset = ((face * GeometryInfo<dim>::subfaces_per_face + subface)
-                               * quadrature.n_quadrature_points);
+  const unsigned int offset
+    = (internal::DataSetDescriptor<dim>::
+       sub_face (cell, face, subface,
+                 quadrature.n_quadrature_points)).offset();
 
                                   // get the flags indicating the
                                   // fields that have to be filled

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.