]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Getting support points from system elements resulted in an exception.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 10 May 2000 09:11:11 +0000 (09:11 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 10 May 2000 09:11:11 +0000 (09:11 +0000)
git-svn-id: https://svn.dealii.org/branches/Branch-3-0@2829 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 2bac4eaa732f151faa58bd883c0f76960fa014c1..e20955631c8eccb7570834b4d6aa9da4d487fbf1 100644 (file)
@@ -489,7 +489,7 @@ void FESystem<dim>::initialize ()
          };
 
 
-// now set up the interface constraints.
+                                  // now set up the interface constraints.
                                   // this is kind'o hairy, so don't try
                                   // to do it dimension independent
   build_interface_constraints ();
@@ -755,7 +755,7 @@ FESystem<dim>::shape_grad_grad (const unsigned int  i,
   Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
 
 
-pair<unsigned,unsigned> comp = system_to_component_index(i);
+  pair<unsigned,unsigned> comp = system_to_component_index(i);
   
   return base_element(component_to_base_table[comp.first])
     .shape_grad_grad(comp.second, p);
@@ -986,25 +986,39 @@ FESystem<dim>::fill_fe_values (const DoFHandler<dim>::cell_iterator &cell,
                               const FullMatrix<double>  &shape_values_transform,
                               const vector<vector<Tensor<1,dim> > > &shape_grad_transform) const
 {
-  vector<Point<dim> > supp(base_elements[0].first->dofs_per_cell);
+                                  // if we are to compute the support
+                                  // points, then we need to get them
+                                  // from each base element. the
+                                  // following variable is used as
+                                  // temporary
+  vector<Point<dim> > supp(compute_support_points ?
+                          base_elements[0].first->dofs_per_cell :
+                          0);
 
   base_elements[0].first->fill_fe_values (cell, unit_points, jacobians, compute_jacobians,
                                          jacobians_grad, compute_jacobians_grad,
-                                         support_points, compute_support_points,
+                                         supp, compute_support_points,
                                          q_points, compute_q_points,
                                          shape_values_transform, shape_grad_transform);
   
   if (compute_support_points)
     {
-      unsigned component = 0;
-      
-      for (unsigned m=0 ; m < element_multiplicity(0) ; ++ m)
+                                      // for the first base element, we
+                                      // have obtained the support
+                                      // points above already
+      unsigned int component = 0;
+      for (unsigned int m=0 ; m < element_multiplicity(0) ; ++ m)
        {
-         for (unsigned i=0 ; i < base_element(0).dofs_per_cell ; ++i)
+         for (unsigned int i=0 ; i < base_element(0).dofs_per_cell ; ++i)
            support_points[component_to_system_index(component,i)] = supp[i];
          ++component;
        }
-      for (unsigned base=1 ; base < n_base_elements() ; ++base)
+
+                                      // if there are more base
+                                      // elements, we still have to
+                                      // get the support points from
+                                      // them
+      for (unsigned int base=1 ; base < n_base_elements() ; ++base)
        {
          supp.resize(base_elements[base].first->dofs_per_cell);
          base_elements[base].first->fill_fe_values (cell, unit_points, jacobians, false,
@@ -1013,9 +1027,9 @@ FESystem<dim>::fill_fe_values (const DoFHandler<dim>::cell_iterator &cell,
                                                     q_points, false,
                                                     shape_values_transform, shape_grad_transform);
          
-         for (unsigned m=0 ; m < element_multiplicity(base) ; ++ m)
+         for (unsigned int m=0 ; m < element_multiplicity(base) ; ++ m)
            {
-             for (unsigned i=0 ; i < base_element(base).dofs_per_cell ; ++i)
+             for (unsigned int i=0 ; i < base_element(base).dofs_per_cell ; ++i)
                support_points[component_to_system_index(component,i)] = supp[i];
              ++component;
            }

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.