From 40a0e1e5870f498eb0faf767478294ca9e8f9f9c Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Tue, 22 Sep 2009 08:59:28 +0000 Subject: [PATCH] Use an iterator to specify the vector elements. git-svn-id: https://svn.dealii.org/trunk@19490 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/include/dofs/dof_accessor.templates.h | 3 +-- deal.II/lac/include/lac/block_vector_base.h | 14 +++++++------- deal.II/lac/source/petsc_vector_base.cc | 4 +--- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/deal.II/deal.II/include/dofs/dof_accessor.templates.h b/deal.II/deal.II/include/dofs/dof_accessor.templates.h index 3597fc3af9..312a82e64d 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.templates.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.templates.h @@ -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*>(&local_source))(0)); + global_destination.add(n_dofs, dofs,local_source.begin()); } diff --git a/deal.II/lac/include/lac/block_vector_base.h b/deal.II/lac/include/lac/block_vector_base.h index 5fe707226a..f485cde351 100644 --- a/deal.II/lac/include/lac/block_vector_base.h +++ b/deal.II/lac/include/lac/block_vector_base.h @@ -1910,8 +1910,8 @@ template template inline void -BlockVectorBase ::add (const std::vector &indices, - const std::vector &values) +BlockVectorBase::add (const std::vector &indices, + const std::vector &values) { Assert (indices.size() == values.size(), ExcDimensionMismatch(indices.size(), values.size())); @@ -1924,8 +1924,8 @@ template template inline void -BlockVectorBase ::add (const std::vector &indices, - const Vector &values) +BlockVectorBase::add (const std::vector &indices, + const Vector &values) { Assert (indices.size() == values.size(), ExcDimensionMismatch(indices.size(), values.size())); @@ -1940,9 +1940,9 @@ template template inline void -BlockVectorBase ::add (const unsigned int n_indices, - const unsigned int *indices, - const Number *values) +BlockVectorBase::add (const unsigned int n_indices, + const unsigned int *indices, + const Number *values) { for (unsigned int i=0; i*>(&values))(0), - true); + do_set_add_operation(indices.size(), &indices[0], values.begin(), true); } -- 2.39.5