From b3acca071ab1d2b70d084342f5ed9067ab2ee093 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 20 Oct 2017 10:08:06 -0600 Subject: [PATCH] Rename parallel::Vector::val to parallel::Vector::values. --- include/deal.II/lac/la_parallel_vector.h | 18 ++-- .../lac/la_parallel_vector.templates.h | 88 +++++++++---------- 2 files changed, 53 insertions(+), 53 deletions(-) diff --git a/include/deal.II/lac/la_parallel_vector.h b/include/deal.II/lac/la_parallel_vector.h index 6777f8d8c6..7988201261 100644 --- a/include/deal.II/lac/la_parallel_vector.h +++ b/include/deal.II/lac/la_parallel_vector.h @@ -1083,7 +1083,7 @@ namespace LinearAlgebra /** * Pointer to the array of local elements of this vector. */ - std::unique_ptr val; + std::unique_ptr values; /** * For parallel loops with TBB, this member variable stores the affinity @@ -1263,7 +1263,7 @@ namespace LinearAlgebra typename Vector::iterator Vector::begin () { - return val.get(); + return values.get(); } @@ -1273,7 +1273,7 @@ namespace LinearAlgebra typename Vector::const_iterator Vector::begin () const { - return val.get(); + return values.get(); } @@ -1283,7 +1283,7 @@ namespace LinearAlgebra typename Vector::iterator Vector::end () { - return val.get()+partitioner->local_size(); + return values.get()+partitioner->local_size(); } @@ -1293,7 +1293,7 @@ namespace LinearAlgebra typename Vector::const_iterator Vector::end () const { - return val.get()+partitioner->local_size(); + return values.get()+partitioner->local_size(); } @@ -1312,7 +1312,7 @@ namespace LinearAlgebra Assert (partitioner->in_local_range (global_index) || vector_is_ghosted == true, ExcMessage("You tried to read a ghost element of this vector, " "but it has not imported its ghost values.")); - return val[partitioner->global_to_local(global_index)]; + return values[partitioner->global_to_local(global_index)]; } @@ -1333,7 +1333,7 @@ namespace LinearAlgebra // (then, the compiler picks this method according to the C++ rule book // even if a human would pick the const method when this subsequent use // is just a read) - return val[partitioner->global_to_local (global_index)]; + return values[partitioner->global_to_local (global_index)]; } @@ -1370,7 +1370,7 @@ namespace LinearAlgebra Assert (local_index < local_size() || vector_is_ghosted == true, ExcMessage("You tried to read a ghost element of this vector, " "but it has not imported its ghost values.")); - return val[local_index]; + return values[local_index]; } @@ -1383,7 +1383,7 @@ namespace LinearAlgebra AssertIndexRange (local_index, partitioner->local_size()+ partitioner->n_ghost_indices()); - return val[local_index]; + return values[local_index]; } diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index cbc8a6c145..80149e9454 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -62,18 +62,18 @@ namespace LinearAlgebra { if (new_alloc_size > allocated_size) { - Assert (((allocated_size > 0 && val != nullptr) || - val == nullptr), ExcInternalError()); + Assert (((allocated_size > 0 && values != nullptr) || + values == nullptr), ExcInternalError()); Number *new_val; Utilities::System::posix_memalign ((void **)&new_val, 64, sizeof(Number)*new_alloc_size); - val.reset (new_val); + values.reset (new_val); allocated_size = new_alloc_size; } else if (new_alloc_size == 0) { - val.reset(); + values.reset(); allocated_size = 0; } thread_loop_partitioner.reset(new ::dealii::parallel::internal::TBBPartitioner()); @@ -204,7 +204,7 @@ namespace LinearAlgebra : partitioner (new Utilities::MPI::Partitioner()), allocated_size (0), - val (nullptr) + values (nullptr) { reinit(0); } @@ -216,7 +216,7 @@ namespace LinearAlgebra : Subscriptor(), allocated_size (0), - val (nullptr), + values (nullptr), vector_is_ghosted (false) { reinit (v, true); @@ -226,7 +226,7 @@ namespace LinearAlgebra const size_type this_size = local_size(); if (this_size>0) { - dealii::internal::VectorOperations::Vector_copy copier(v.val.get(), val.get()); + dealii::internal::VectorOperations::Vector_copy copier(v.values.get(), values.get()); internal::VectorOperations::parallel_for(copier, 0, partitioner->local_size(), thread_loop_partitioner); } @@ -240,7 +240,7 @@ namespace LinearAlgebra const MPI_Comm communicator) : allocated_size (0), - val (nullptr), + values (nullptr), vector_is_ghosted (false) { reinit (local_range, ghost_indices, communicator); @@ -253,7 +253,7 @@ namespace LinearAlgebra const MPI_Comm communicator) : allocated_size (0), - val (nullptr), + values (nullptr), vector_is_ghosted (false) { reinit (local_range, communicator); @@ -265,7 +265,7 @@ namespace LinearAlgebra Vector::Vector (const size_type size) : allocated_size (0), - val (nullptr), + values (nullptr), vector_is_ghosted (false) { reinit (size, false); @@ -278,7 +278,7 @@ namespace LinearAlgebra Vector (const std::shared_ptr &partitioner) : allocated_size (0), - val (nullptr), + values (nullptr), vector_is_ghosted (false) { reinit (partitioner); @@ -363,7 +363,7 @@ namespace LinearAlgebra const size_type this_size = local_size(); if (this_size>0) { - dealii::internal::VectorOperations::Vector_copy copier(c.val.get(), val.get()); + dealii::internal::VectorOperations::Vector_copy copier(c.values.get(), values.get()); internal::VectorOperations::parallel_for(copier, 0, this_size, thread_loop_partitioner); } @@ -494,7 +494,7 @@ namespace LinearAlgebra void Vector::zero_out_ghosts () { - std::fill_n (&val[partitioner->local_size()], + std::fill_n (&values[partitioner->local_size()], partitioner->n_ghost_indices(), Number()); vector_is_ghosted = false; @@ -522,7 +522,7 @@ namespace LinearAlgebra partitioner->import_from_ghosted_array_start (operation, counter, - ArrayView(val.get() + partitioner->local_size(),partitioner->n_ghost_indices()), + ArrayView(values.get() + partitioner->local_size(),partitioner->n_ghost_indices()), ArrayView(import_data.get(), partitioner->n_import_indices()), compress_requests); #endif @@ -547,8 +547,8 @@ namespace LinearAlgebra partitioner->import_from_ghosted_array_finish (operation, ArrayView(import_data.get(), partitioner->n_import_indices()), - ArrayView(val.get(), partitioner->local_size()), - ArrayView(val.get() + partitioner->local_size(),partitioner->n_ghost_indices()), + ArrayView(values.get(), partitioner->local_size()), + ArrayView(values.get() + partitioner->local_size(),partitioner->n_ghost_indices()), compress_requests); vector_is_ghosted = false; @@ -577,9 +577,9 @@ namespace LinearAlgebra partitioner->export_to_ghosted_array_start (counter, - ArrayView(val.get(), partitioner->local_size()), + ArrayView(values.get(), partitioner->local_size()), ArrayView(import_data.get(), partitioner->n_import_indices()), - ArrayView(val.get() + partitioner->local_size(),partitioner->n_ghost_indices()), + ArrayView(values.get() + partitioner->local_size(),partitioner->n_ghost_indices()), update_ghost_values_requests); #else @@ -605,7 +605,7 @@ namespace LinearAlgebra Threads::Mutex::ScopedLock lock (mutex); partitioner->export_to_ghosted_array_finish - (ArrayView(val.get() + partitioner->local_size(),partitioner->n_ghost_indices()), + (ArrayView(values.get() + partitioner->local_size(),partitioner->n_ghost_indices()), update_ghost_values_requests); } #endif @@ -660,7 +660,7 @@ namespace LinearAlgebra IndexSet tmp_index_set = tmp_vector.locally_owned_elements(); for (size_type i=0; i0) { - internal::VectorOperations::Vector_set setter(s, val.get()); + internal::VectorOperations::Vector_set setter(s, values.get()); internal::VectorOperations::parallel_for(setter, 0, this_size, thread_loop_partitioner); @@ -763,7 +763,7 @@ namespace LinearAlgebra AssertDimension (local_size(), v.local_size()); - internal::VectorOperations::Vectorization_add_v vector_add(val.get(), v.val.get()); + internal::VectorOperations::Vectorization_add_v vector_add(values.get(), v.values.get()); internal::VectorOperations::parallel_for(vector_add, 0, partitioner->local_size(), thread_loop_partitioner); @@ -786,7 +786,7 @@ namespace LinearAlgebra AssertDimension (local_size(), v.local_size()); - internal::VectorOperations::Vectorization_subtract_v vector_subtract(val.get(), v.val.get()); + internal::VectorOperations::Vectorization_subtract_v vector_subtract(values.get(), v.values.get()); internal::VectorOperations::parallel_for(vector_subtract, 0, partitioner->local_size(), thread_loop_partitioner); @@ -804,7 +804,7 @@ namespace LinearAlgebra { AssertIsFinite(a); - internal::VectorOperations::Vectorization_add_factor vector_add(val.get(), a); + internal::VectorOperations::Vectorization_add_factor vector_add(values.get(), a); internal::VectorOperations::parallel_for(vector_add, 0, partitioner->local_size(), thread_loop_partitioner); @@ -827,7 +827,7 @@ namespace LinearAlgebra AssertIsFinite(a); AssertDimension (local_size(), v.local_size()); - internal::VectorOperations::Vectorization_add_av vector_add(val.get(), v.val.get(), a); + internal::VectorOperations::Vectorization_add_av vector_add(values.get(), v.values.get(), a); internal::VectorOperations::parallel_for(vector_add, 0, partitioner->local_size(), thread_loop_partitioner); @@ -858,8 +858,8 @@ namespace LinearAlgebra AssertDimension (local_size(), v.local_size()); AssertDimension (local_size(), w.local_size()); - internal::VectorOperations::Vectorization_add_avpbw vector_add(val.get(), v.val.get(), - w.val.get(), a, b); + internal::VectorOperations::Vectorization_add_avpbw vector_add(values.get(), v.values.get(), + w.values.get(), a, b); internal::VectorOperations::parallel_for(vector_add, 0, partitioner->local_size(), thread_loop_partitioner); @@ -891,7 +891,7 @@ namespace LinearAlgebra AssertIsFinite(x); AssertDimension (local_size(), v.local_size()); - internal::VectorOperations::Vectorization_sadd_xv vector_sadd(val.get(), v.val.get(), x); + internal::VectorOperations::Vectorization_sadd_xv vector_sadd(values.get(), v.values.get(), x); internal::VectorOperations::parallel_for(vector_sadd, 0, partitioner->local_size(), thread_loop_partitioner); @@ -916,7 +916,7 @@ namespace LinearAlgebra AssertIsFinite(a); AssertDimension (local_size(), v.local_size()); - internal::VectorOperations::Vectorization_sadd_xav vector_sadd(val.get(), v.val.get(), a, x); + internal::VectorOperations::Vectorization_sadd_xav vector_sadd(values.get(), v.values.get(), a, x); internal::VectorOperations::parallel_for(vector_sadd, 0, partitioner->local_size(), thread_loop_partitioner); @@ -941,7 +941,7 @@ namespace LinearAlgebra AssertDimension (local_size(), v.local_size()); AssertDimension (local_size(), w.local_size()); - internal::VectorOperations::Vectorization_sadd_xavbw vector_sadd(val.get(), v.val.get(), w.val.get(), + internal::VectorOperations::Vectorization_sadd_xavbw vector_sadd(values.get(), v.values.get(), w.values.get(), x, a, b); internal::VectorOperations::parallel_for(vector_sadd, 0, partitioner->local_size(), thread_loop_partitioner); @@ -957,7 +957,7 @@ namespace LinearAlgebra Vector::operator *= (const Number factor) { AssertIsFinite(factor); - internal::VectorOperations::Vectorization_multiply_factor vector_multiply(val.get(), + internal::VectorOperations::Vectorization_multiply_factor vector_multiply(values.get(), factor); internal::VectorOperations::parallel_for(vector_multiply, 0, partitioner->local_size(), @@ -992,7 +992,7 @@ namespace LinearAlgebra AssertDimension (local_size(), v.local_size()); - internal::VectorOperations::Vectorization_scale vector_scale(val.get(), v.val.get()); + internal::VectorOperations::Vectorization_scale vector_scale(values.get(), v.values.get()); internal::VectorOperations::parallel_for(vector_scale, 0, partitioner->local_size(), thread_loop_partitioner); @@ -1015,7 +1015,7 @@ namespace LinearAlgebra AssertIsFinite(a); AssertDimension (local_size(), v.local_size()); - internal::VectorOperations::Vectorization_equ_au vector_equ(val.get(), v.val.get(), a); + internal::VectorOperations::Vectorization_equ_au vector_equ(values.get(), v.values.get(), a); internal::VectorOperations::parallel_for(vector_equ, 0, partitioner->local_size(), thread_loop_partitioner); @@ -1038,8 +1038,8 @@ namespace LinearAlgebra AssertDimension (local_size(), v.local_size()); AssertDimension (local_size(), w.local_size()); - internal::VectorOperations::Vectorization_equ_aubv vector_equ(val.get(), v.val.get(), - w.val.get(), a, b); + internal::VectorOperations::Vectorization_equ_aubv vector_equ(values.get(), v.values.get(), + w.values.get(), a, b); internal::VectorOperations::parallel_for(vector_equ, 0, partitioner->local_size(), thread_loop_partitioner); @@ -1055,7 +1055,7 @@ namespace LinearAlgebra { const size_type local_size = partitioner->local_size(); for (size_type i=0; ilocal_size(), v.partitioner->local_size()); Number sum; - internal::VectorOperations::Dot dot(val.get(), v.val.get()); + internal::VectorOperations::Dot dot(values.get(), v.values.get()); internal::VectorOperations::parallel_reduce (dot, 0, partitioner->local_size(), sum, thread_loop_partitioner); AssertIsFinite(sum); @@ -1126,7 +1126,7 @@ namespace LinearAlgebra Vector::norm_sqr_local () const { real_type sum; - internal::VectorOperations::Norm2 norm2(val.get()); + internal::VectorOperations::Norm2 norm2(values.get()); internal::VectorOperations::parallel_reduce (norm2, 0, partitioner->local_size(), sum, thread_loop_partitioner); AssertIsFinite(sum); @@ -1146,7 +1146,7 @@ namespace LinearAlgebra return Number(); Number sum; - internal::VectorOperations::MeanValue mean(val.get()); + internal::VectorOperations::MeanValue mean(values.get()); internal::VectorOperations::parallel_reduce (mean, 0, partitioner->local_size(), sum, thread_loop_partitioner); @@ -1176,7 +1176,7 @@ namespace LinearAlgebra Vector::l1_norm_local () const { real_type sum; - internal::VectorOperations::Norm1 norm1(val.get()); + internal::VectorOperations::Norm1 norm1(values.get()); internal::VectorOperations::parallel_reduce (norm1, 0, partitioner->local_size(), sum, thread_loop_partitioner); @@ -1218,7 +1218,7 @@ namespace LinearAlgebra Vector::lp_norm_local (const real_type p) const { real_type sum; - internal::VectorOperations::NormP normp(val.get(), p); + internal::VectorOperations::NormP normp(values.get(), p); internal::VectorOperations::parallel_reduce (normp, 0, partitioner->local_size(), sum, thread_loop_partitioner); return std::pow(sum, 1./p); @@ -1249,7 +1249,7 @@ namespace LinearAlgebra const size_type local_size = partitioner->local_size(); for (size_type i=0; i::abs(val[i]), max); + max = std::max (numbers::NumberTraits::abs(values[i]), max); return max; } @@ -1282,7 +1282,7 @@ namespace LinearAlgebra AssertDimension (vec_size, w.local_size()); Number sum; - internal::VectorOperations::AddAndDot adder(this->val.get(), v.val.get(), w.val.get(), a); + internal::VectorOperations::AddAndDot adder(this->values.get(), v.values.get(), w.values.get(), a); internal::VectorOperations::parallel_reduce (adder, 0, vec_size, sum, thread_loop_partitioner); AssertIsFinite(sum); return sum; -- 2.39.5