]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Use an iterator to specify the vector elements.
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 22 Sep 2009 08:59:28 +0000 (08:59 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 22 Sep 2009 08:59:28 +0000 (08:59 +0000)
git-svn-id: https://svn.dealii.org/trunk@19490 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/dof_accessor.templates.h
deal.II/lac/include/lac/block_vector_base.h
deal.II/lac/source/petsc_vector_base.cc

index 3597fc3af992ad00faa7f05f5b78b494a835d417..312a82e64d84d28a95888ee36d2dec5212ab70de 100644 (file)
@@ -2301,8 +2301,7 @@ namespace internal
                                  ->cell_dof_indices_cache[accessor.present_index * n_dofs];
 
                                   // distribute cell vector
-           global_destination.add(n_dofs, dofs,
-                                  &(*const_cast<dealii::Vector<number>*>(&local_source))(0));
+           global_destination.add(n_dofs, dofs,local_source.begin());
          }
 
 
index 5fe707226a07d7fc7cfb51e5aa886cfe3983b537..f485cde3511037d78b2e0fd8f65897cb08f176d3 100644 (file)
@@ -1910,8 +1910,8 @@ template <class VectorType>
 template <typename Number>
 inline
 void
-BlockVectorBase<VectorType> ::add (const std::vector<unsigned int> &indices,
-                                  const std::vector<Number>       &values)
+BlockVectorBase<VectorType>::add (const std::vector<unsigned int> &indices,
+                                 const std::vector<Number>       &values)
 {
   Assert (indices.size() == values.size(),
          ExcDimensionMismatch(indices.size(), values.size()));
@@ -1924,8 +1924,8 @@ template <class VectorType>
 template <typename Number>
 inline
 void
-BlockVectorBase<VectorType> ::add (const std::vector<unsigned int> &indices,
-                                  const Vector<Number>            &values)
+BlockVectorBase<VectorType>::add (const std::vector<unsigned int> &indices,
+                                 const Vector<Number>            &values)
 {
   Assert (indices.size() == values.size(),
          ExcDimensionMismatch(indices.size(), values.size()));
@@ -1940,9 +1940,9 @@ template <class VectorType>
 template <typename Number>
 inline
 void
-BlockVectorBase<VectorType> ::add (const unsigned int  n_indices,
-                                  const unsigned int *indices,
-                                  const Number       *values)
+BlockVectorBase<VectorType>::add (const unsigned int  n_indices,
+                                 const unsigned int *indices,
+                                 const Number       *values)
 {
   for (unsigned int i=0; i<n_indices; ++i)
     (*this)(indices[i]) += values[i];
index 5f8ef55231c04fb6192d6b31c16363a14b483979..904b8eca184081da453043565ade48cb7741bd0e 100644 (file)
@@ -262,9 +262,7 @@ namespace PETScWrappers
   {
     Assert (indices.size() == values.size(),
             ExcMessage ("Function called with arguments of different sizes"));
-    do_set_add_operation(indices.size(), &indices[0],
-                        &(*const_cast<dealii::Vector<PetscScalar>*>(&values))(0),
-                        true);
+    do_set_add_operation(indices.size(), &indices[0], values.begin(), true);
   }
 
 

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.