Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated Vector member functions #15534

Merged
merged 1 commit into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 0 additions & 21 deletions include/deal.II/base/partitioner.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,19 +285,6 @@ namespace Utilities
types::global_dof_index
size() const;

/**
* Return the number of locally owned indices,
* i.e., local_range().second minus local_range().first.
* The returned numbers need to add up to the total number of indices when
* summed over all processes
*
* @deprecated Use the more clearly named function locally_owned_size()
* instead.
*/
DEAL_II_DEPRECATED
unsigned int
local_size() const;

/**
* Return the number of locally owned indices,
* i.e., local_range().second minus local_range().first.
Expand Down Expand Up @@ -826,14 +813,6 @@ namespace Utilities



inline unsigned int
Partitioner::local_size() const
{
return locally_owned_size();
}



inline unsigned int
Partitioner::locally_owned_size() const
{
Expand Down
14 changes: 0 additions & 14 deletions include/deal.II/lac/la_parallel_block_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -413,20 +413,6 @@ namespace LinearAlgebra
void
update_ghost_values() const;

/**
* This method zeros the entries on ghost dofs, but does not touch
* locally owned DoFs.
*
* After calling this method, read access to ghost elements of the
* vector is forbidden and an exception is thrown. Only write access to
* ghost elements is allowed in this state.
*
* @deprecated Use zero_out_ghost_values() instead.
*/
DEAL_II_DEPRECATED void
zero_out_ghosts() const;


/**
* This method zeros the entries on ghost dofs, but does not touch
* locally owned DoFs.
Expand Down
9 changes: 0 additions & 9 deletions include/deal.II/lac/la_parallel_block_vector.templates.h
Original file line number Diff line number Diff line change
Expand Up @@ -470,15 +470,6 @@ namespace LinearAlgebra



template <typename Number>
void
BlockVector<Number>::zero_out_ghosts() const
{
this->zero_out_ghost_values();
}



template <typename Number>
void
BlockVector<Number>::zero_out_ghost_values() const
Expand Down
32 changes: 0 additions & 32 deletions include/deal.II/lac/la_parallel_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -636,19 +636,6 @@ namespace LinearAlgebra
void
update_ghost_values_finish() const;

/**
* This method zeros the entries on ghost dofs, but does not touch
* locally owned DoFs.
*
* After calling this method, read access to ghost elements of the
* vector is forbidden and an exception is thrown. Only write access to
* ghost elements is allowed in this state.
*
* @deprecated Use zero_out_ghost_values() instead.
*/
DEAL_II_DEPRECATED void
zero_out_ghosts() const;

/**
* This method zeros the entries on ghost dofs, but does not touch
* locally owned DoFs.
Expand Down Expand Up @@ -981,16 +968,6 @@ namespace LinearAlgebra
*/
/** @{ */

/**
* Return the local size of the vector, i.e., the number of indices
* owned locally.
*
* @deprecated Use locally_owned_size() instead.
*/
DEAL_II_DEPRECATED
size_type
local_size() const;

/**
* Return the local size of the vector, i.e., the number of indices
* owned locally.
Expand Down Expand Up @@ -1491,15 +1468,6 @@ namespace LinearAlgebra



template <typename Number, typename MemorySpace>
inline typename Vector<Number, MemorySpace>::size_type
Vector<Number, MemorySpace>::local_size() const
{
return locally_owned_size();
}



template <typename Number, typename MemorySpace>
inline typename Vector<Number, MemorySpace>::size_type
Vector<Number, MemorySpace>::locally_owned_size() const
Expand Down
9 changes: 0 additions & 9 deletions include/deal.II/lac/la_parallel_vector.templates.h
Original file line number Diff line number Diff line change
Expand Up @@ -947,15 +947,6 @@ namespace LinearAlgebra



template <typename Number, typename MemorySpaceType>
void
Vector<Number, MemorySpaceType>::zero_out_ghosts() const
{
this->zero_out_ghost_values();
}



template <typename Number, typename MemorySpaceType>
void
Vector<Number, MemorySpaceType>::zero_out_ghost_values() const
Expand Down
48 changes: 0 additions & 48 deletions include/deal.II/lac/petsc_vector_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,20 +357,6 @@ namespace PETScWrappers
size_type
size() const;

/**
* Return the local dimension of the vector, i.e. the number of elements
* stored on the present MPI process. For sequential vectors, this number
* is the same as size(), but for parallel vectors it may be smaller.
*
* To figure out which elements exactly are stored locally, use
* local_range() or locally_owned_elements().
*
* @deprecated use locally_owned_size() instead.
*/
DEAL_II_DEPRECATED
size_type
local_size() const;

/**
* Return the local dimension of the vector, i.e. the number of elements
* stored on the present MPI process. For sequential vectors, this number
Expand Down Expand Up @@ -627,28 +613,6 @@ namespace PETScWrappers
PetscScalar
add_and_dot(const PetscScalar a, const VectorBase &V, const VectorBase &W);

/**
* Return the value of the vector element with the largest negative value.
*
* @deprecated This function has been deprecated to improve compatibility
* with other classes inheriting from VectorSpaceVector. If you need to
* use this functionality then use the PETSc function VecMin instead.
*/
DEAL_II_DEPRECATED
real_type
min() const;

/**
* Return the value of the vector element with the largest positive value.
*
* @deprecated This function has been deprecated to improve compatibility
* with other classes inheriting from VectorSpaceVector. If you need to
* use this functionality then use the PETSc function VecMax instead.
*/
DEAL_II_DEPRECATED
real_type
max() const;

/**
* Return whether the vector contains only elements with value zero. This
* is a collective operation. This function is expensive, because
Expand All @@ -657,18 +621,6 @@ namespace PETScWrappers
bool
all_zero() const;

/**
* Return @p true if the vector has no negative entries, i.e. all entries
* are zero or positive. This function is used, for example, to check
* whether refinement indicators are really all positive (or zero).
*
* @deprecated This function has been deprecated to improve compatibility
* with other classes inheriting from VectorSpaceVector.
*/
DEAL_II_DEPRECATED
bool
is_non_negative() const;

/**
* Multiply the entire vector by a fixed factor.
*/
Expand Down
20 changes: 0 additions & 20 deletions include/deal.II/lac/read_write_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -539,17 +539,6 @@ namespace LinearAlgebra
size_type
size() const;

/**
* This function returns the number of elements stored. It is smaller or
* equal to the dimension of the vector space that is modeled by an object
* of this kind. This dimension is return by size().
*
* @deprecated use locally_owned_size() instead.
*/
DEAL_II_DEPRECATED
size_type
n_elements() const;

/**
* Return the local size of the vector, i.e., the number of indices
* owned locally.
Expand Down Expand Up @@ -968,15 +957,6 @@ namespace LinearAlgebra



template <typename Number>
inline typename ReadWriteVector<Number>::size_type
ReadWriteVector<Number>::n_elements() const
{
return stored_elements.n_elements();
}



template <typename Number>
inline typename ReadWriteVector<Number>::size_type
ReadWriteVector<Number>::locally_owned_size() const
Expand Down
34 changes: 4 additions & 30 deletions include/deal.II/lac/trilinos_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -762,23 +762,6 @@ namespace TrilinosWrappers
size_type
size() const;

/**
* Return the local dimension of the vector, i.e. the number of elements
* stored on the present MPI process. For sequential vectors, this number
* is the same as size(), but for parallel vectors it may be smaller.
*
* To figure out which elements exactly are stored locally, use
* local_range().
*
* If the vector contains ghost elements, they are included in this
* number.
*
* @deprecated This function is deprecated.
*/
DEAL_II_DEPRECATED
size_type
local_size() const;

/**
* Return the local size of the vector, i.e., the number of indices
* owned locally.
Expand All @@ -792,9 +775,10 @@ namespace TrilinosWrappers
* stored, the second the index of the one past the last one that is
* stored locally. If this is a sequential vector, then the result will be
* the pair <code>(0,N)</code>, otherwise it will be a pair
* <code>(i,i+n)</code>, where <code>n=local_size()</code> and
* <code>i</code> is the first element of the vector stored on this
* processor, corresponding to the half open interval $[i,i+n)$
* <code>(i,i+n)</code>, where <code>n</code> is the number of elements
* stored on this processor and and <code>i</code> is the first element of
* the vector stored on this processor, corresponding to the half open
* interval $[i,i+n)$
Comment on lines -795 to +781
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for also updating these unrelated things.

*
* @note The description above is true most of the time, but not always.
* In particular, Trilinos vectors need not store contiguous ranges of
Expand Down Expand Up @@ -1052,8 +1036,6 @@ namespace TrilinosWrappers
* corresponds to the one given by the global indices in case the vector
* is constructed from an IndexSet or other methods in deal.II (note that
* an Epetra_Map can contain elements in arbitrary orders, though).
*
* It holds that end() - begin() == local_size().
*/
iterator
begin();
Expand Down Expand Up @@ -1775,14 +1757,6 @@ namespace TrilinosWrappers



inline Vector::size_type
Vector::local_size() const
{
return vector->Map().NumMyElements();
}



inline Vector::size_type
Vector::locally_owned_size() const
{
Expand Down
71 changes: 0 additions & 71 deletions source/lac/petsc_vector_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -448,18 +448,6 @@ namespace PETScWrappers



VectorBase::size_type
VectorBase::local_size() const
{
PetscInt sz;
const PetscErrorCode ierr = VecGetLocalSize(vector, &sz);
AssertThrow(ierr == 0, ExcPETScError(ierr));

return sz;
}



std::pair<VectorBase::size_type, VectorBase::size_type>
VectorBase::local_range() const
{
Expand Down Expand Up @@ -749,33 +737,6 @@ namespace PETScWrappers



VectorBase::real_type
VectorBase::min() const
{
PetscInt p;
real_type d;

const PetscErrorCode ierr = VecMin(vector, &p, &d);
AssertThrow(ierr == 0, ExcPETScError(ierr));

return d;
}


VectorBase::real_type
VectorBase::max() const
{
PetscInt p;
real_type d;

const PetscErrorCode ierr = VecMax(vector, &p, &d);
AssertThrow(ierr == 0, ExcPETScError(ierr));

return d;
}



bool
VectorBase::all_zero() const
{
Expand Down Expand Up @@ -830,38 +791,6 @@ namespace PETScWrappers



bool
VectorBase::is_non_negative() const
{
// get a representation of the vector and
// loop over all the elements
const PetscScalar *start_ptr;
PetscErrorCode ierr = VecGetArrayRead(vector, &start_ptr);
AssertThrow(ierr == 0, ExcPETScError(ierr));

const PetscScalar *ptr = start_ptr,
*eptr = start_ptr + locally_owned_size();
bool flag = true;
while (ptr != eptr)
{
if (!internal::is_non_negative(*ptr))
{
flag = false;
break;
}
++ptr;
}

// restore the representation of the
// vector
ierr = VecRestoreArrayRead(vector, &start_ptr);
AssertThrow(ierr == 0, ExcPETScError(ierr));

return flag;
}



VectorBase &
VectorBase::operator*=(const PetscScalar a)
{
Expand Down