From c310f7417e7d5b1fae29da30e4eba004ca995cb3 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 8 May 2017 08:50:17 -0600 Subject: [PATCH] Some text cleanups. No functionality changes. --- .../deal.II/algorithms/operator.templates.h | 8 ++--- .../fe/fe_tools_interpolate.templates.h | 3 +- include/deal.II/lac/vector_element_access.h | 36 ++++++++++++------- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/include/deal.II/algorithms/operator.templates.h b/include/deal.II/algorithms/operator.templates.h index 26d1893639..ad90555318 100644 --- a/include/deal.II/algorithms/operator.templates.h +++ b/include/deal.II/algorithms/operator.templates.h @@ -55,8 +55,8 @@ namespace Algorithms if (v == nullptr) continue; deallog << vectors.name(i); for (unsigned int j=0; jsize(); ++j) - deallog << ' ' << ::dealii::internal::ElementAccess::get( - *v, j); + deallog << ' ' + << ::dealii::internal::ElementAccess::get(*v, j); deallog << std::endl; } deallog << std::endl; @@ -69,8 +69,8 @@ namespace Algorithms const VectorType *v = vectors.try_read_ptr(i); if (v == nullptr) continue; for (unsigned int j=0; jsize(); ++j) - (*os) << ' ' << ::dealii::internal::ElementAccess::get( - *v, j); + (*os) << ' ' + << ::dealii::internal::ElementAccess::get(*v, j); } (*os) << std::endl; } diff --git a/include/deal.II/fe/fe_tools_interpolate.templates.h b/include/deal.II/fe/fe_tools_interpolate.templates.h index 2eddceae25..56d70f842d 100644 --- a/include/deal.II/fe/fe_tools_interpolate.templates.h +++ b/include/deal.II/fe/fe_tools_interpolate.templates.h @@ -238,7 +238,8 @@ namespace FETools = ::dealii::internal::ElementAccess::get( u2, i); ::dealii::internal::ElementAccess::set( - val/::dealii::internal::ElementAccess::get(touch_count,i), i, u2); + val / + ::dealii::internal::ElementAccess::get(touch_count,i), i, u2); } // finish the work on parallel vectors diff --git a/include/deal.II/lac/vector_element_access.h b/include/deal.II/lac/vector_element_access.h index 2d79a16a45..86aa4bbc36 100644 --- a/include/deal.II/lac/vector_element_access.h +++ b/include/deal.II/lac/vector_element_access.h @@ -27,22 +27,25 @@ namespace internal struct ElementAccess { public: - static void add(typename VectorType::value_type value, - types::global_dof_index i, VectorType &V); + static void add(const typename VectorType::value_type value, + const types::global_dof_index i, + VectorType &V); static void set(typename VectorType::value_type value, - types::global_dof_index i, VectorType &V); + const types::global_dof_index i, + VectorType &V); - static typename VectorType::value_type get(const VectorType &V, - types::global_dof_index i); + static typename VectorType::value_type get(const VectorType &V, + const types::global_dof_index i); }; template inline - void ElementAccess::add(typename VectorType::value_type value, - types::global_dof_index i, VectorType &V) + void ElementAccess::add(const typename VectorType::value_type value, + const types::global_dof_index i, + VectorType &V) { V(i) += value; } @@ -51,8 +54,9 @@ namespace internal template inline - void ElementAccess::set(typename VectorType::value_type value, - types::global_dof_index i, VectorType &V) + void ElementAccess::set(const typename VectorType::value_type value, + const types::global_dof_index i, + VectorType &V) { V(i) = value; } @@ -62,7 +66,8 @@ namespace internal template inline typename VectorType::value_type - ElementAccess::get(const VectorType &V, types::global_dof_index i) + ElementAccess::get(const VectorType &V, + const types::global_dof_index i) { return V(i); } @@ -73,7 +78,9 @@ namespace internal template <> inline void ElementAccess:: - add(double value, types::global_dof_index i, LinearAlgebra::EpetraWrappers::Vector &V) + add(const double value, + const types::global_dof_index i, + LinearAlgebra::EpetraWrappers::Vector &V) { // Extract local indices in the vector. Epetra_FEVector vector = V.trilinos_vector(); @@ -88,7 +95,9 @@ namespace internal template <> inline void ElementAccess:: - set(double value, types::global_dof_index i, LinearAlgebra::EpetraWrappers::Vector &V) + set(const double value, + const types::global_dof_index i, + LinearAlgebra::EpetraWrappers::Vector &V) { // Extract local indices in the vector. Epetra_FEVector vector = V.trilinos_vector(); @@ -103,7 +112,8 @@ namespace internal inline double ElementAccess:: - get(const LinearAlgebra::EpetraWrappers::Vector &V, types::global_dof_index i) + get(const LinearAlgebra::EpetraWrappers::Vector &V, + const types::global_dof_index i) { // Extract local indices in the vector. Epetra_FEVector vector = V.trilinos_vector(); -- 2.39.5