Skip to content

Commit

Permalink
Remove deprecated Vector member functions
Browse files Browse the repository at this point in the history
  • Loading branch information
masterleinad committed Jul 2, 2023
1 parent 2d2b093 commit 84d9f26
Show file tree
Hide file tree
Showing 141 changed files with 270 additions and 570 deletions.
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)$
*
* @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
14 changes: 8 additions & 6 deletions source/lac/trilinos_solver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,9 @@ namespace TrilinosWrappers
{
// In case we call the solver with deal.II vectors, we create views of the
// vectors in Epetra format.
AssertDimension(x.local_size(),
AssertDimension(x.locally_owned_size(),
A.trilinos_matrix().DomainMap().NumMyElements());
AssertDimension(b.local_size(),
AssertDimension(b.locally_owned_size(),
A.trilinos_matrix().RangeMap().NumMyElements());

Epetra_Vector ep_x(View, A.trilinos_matrix().DomainMap(), x.begin());
Expand All @@ -258,8 +258,10 @@ namespace TrilinosWrappers
const dealii::LinearAlgebra::distributed::Vector<double> &b,
const PreconditionBase &preconditioner)
{
AssertDimension(x.local_size(), A.OperatorDomainMap().NumMyElements());
AssertDimension(b.local_size(), A.OperatorRangeMap().NumMyElements());
AssertDimension(x.locally_owned_size(),
A.OperatorDomainMap().NumMyElements());
AssertDimension(b.locally_owned_size(),
A.OperatorRangeMap().NumMyElements());

Epetra_Vector ep_x(View, A.OperatorDomainMap(), x.begin());
Epetra_Vector ep_b(View,
Expand Down Expand Up @@ -858,9 +860,9 @@ namespace TrilinosWrappers
dealii::LinearAlgebra::distributed::Vector<double> & x,
const dealii::LinearAlgebra::distributed::Vector<double> &b)
{
AssertDimension(x.local_size(),
AssertDimension(x.locally_owned_size(),
A.trilinos_matrix().DomainMap().NumMyElements());
AssertDimension(b.local_size(),
AssertDimension(b.locally_owned_size(),
A.trilinos_matrix().RangeMap().NumMyElements());
Epetra_Vector ep_x(View, A.trilinos_matrix().DomainMap(), x.begin());
Epetra_Vector ep_b(View,
Expand Down

0 comments on commit 84d9f26

Please sign in to comment.