]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix a bug: the array size was already nonzero (the base class constructor sets it...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 19 Jan 2007 20:26:13 +0000 (20:26 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 19 Jan 2007 20:26:13 +0000 (20:26 +0000)
git-svn-id: https://svn.dealii.org/trunk@14349 0785d39b-7218-0410-832d-ea1e28bc413d

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

index b6db8a9000a3a54c9b18b35b37c7cd34408ee491..ef70cb174b8e4c7de3369dd724ef56b0c5322111 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -1864,18 +1864,26 @@ template <>
 void
 FESystem<3>::initialize_quad_dof_index_permutation ()
 {
+                                  // the array into which we want to write
+                                  // should have the correct size already.
+  Assert (adjust_quad_dof_index_for_face_orientation_table.size()==this->dofs_per_quad,
+         ExcInternalError());
                                   // to obtain the shifts for this composed
                                   // element, concatenate the shift vectors of
                                   // the base elements
+  unsigned int index = 0;
   for (unsigned int b=0; b<n_base_elements();++b)
     {
-      const std::vector<int> &temp=this->base_element(b).adjust_quad_dof_index_for_face_orientation_table;
+      const std::vector<int> &temp
+       = this->base_element(b).adjust_quad_dof_index_for_face_orientation_table;
       for (unsigned int c=0; c<element_multiplicity(b); ++c)
-       adjust_quad_dof_index_for_face_orientation_table.insert
-         (adjust_quad_dof_index_for_face_orientation_table.begin(),
-          temp.begin(),temp.end());
+       {
+         std::copy (temp.begin(), temp.end(),
+                    adjust_quad_dof_index_for_face_orientation_table.begin() + index);
+         index += temp.size();
+       }
     }
-  Assert (adjust_quad_dof_index_for_face_orientation_table.size()==this->dofs_per_quad,
+  Assert (index == this->dofs_per_quad,
          ExcInternalError());
 }
 

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.