--- /dev/null
+Changed: The deprecated member functions add(), normalize(), conjugate(), abs()
+and mult() in the vector classes have been removed.
+<br>
+(Daniel Arndt, 2017/06/12)
*/
void add (const value_type s);
- /**
- * U+=V. Simple vector addition, equal to the <tt>operator +=</tt>.
- *
- * This function is deprecated use the <tt>operator +=</tt> instead.
- */
- void add (const BlockVectorBase &V) DEAL_II_DEPRECATED;
-
/**
* U+=a*V. Simple addition of a scaled vector.
*/
-template <class VectorType>
-void BlockVectorBase<VectorType>::add (const BlockVectorBase<VectorType> &v)
-{
- *this += v;
-}
-
-
-
template <class VectorType>
void BlockVectorBase<VectorType>::add (const value_type a,
const BlockVectorBase<VectorType> &v)
if (i == component)
vmult_add(dst.block(i), src.block(i));
else
- dst.block(i).add(src.block(i));
+ dst.block(i)+=src.block(i);
}
const VectorBase &V,
const VectorBase &W);
- /**
- * Normalize vector by dividing by the $l_2$-norm of the vector. Return
- * the vector norm before normalization.
- *
- * This function is deprecated.
- */
- real_type normalize () const DEAL_II_DEPRECATED;
-
/**
* Return the value of the vector element with the largest negative value.
*/
*/
real_type max () const;
- /**
- * Replace every element in a vector with its absolute value.
- *
- * This function is deprecated.
- */
- VectorBase &abs () DEAL_II_DEPRECATED;
-
- /**
- * Conjugate a vector.
- *
- * This function is deprecated.
- */
- VectorBase &conjugate () DEAL_II_DEPRECATED;
-
- /**
- * A collective piecewise multiply operation on <code>this</code> vector
- * with itself. TODO: The model for this function should be similar to add
- * ().
- *
- * This function is deprecated.
- */
- VectorBase &mult () DEAL_II_DEPRECATED;
-
- /**
- * Same as above, but a collective piecewise multiply operation of
- * <code>this</code> vector with <b>v</b>.
- *
- * This function is deprecated.
- */
- VectorBase &mult (const VectorBase &v) DEAL_II_DEPRECATED;
-
- /**
- * Same as above, but a collective piecewise multiply operation of
- * <b>u</b> with <b>v</b>.
- *
- * This function is deprecated.
- */
- VectorBase &mult (const VectorBase &u,
- const VectorBase &v) DEAL_II_DEPRECATED;
-
/**
* Return whether the vector contains only elements with value zero. This
* is a collective operation. This function is expensive, because
*/
void add (const PetscScalar s);
- /**
- * Simple vector addition, equal to the <tt>operator +=</tt>.
- *
- * @deprecated Use the <tt>operator +=</tt> instead.
- */
- void add (const VectorBase &V) DEAL_II_DEPRECATED;
-
/**
* Simple addition of a multiple of a vector, i.e. <tt>*this += a*V</tt>.
*/
tau *= theta*psi;
d.sadd(psi*theta_old, psi*alpha, p);
- x.add(d);
+ x += d;
print_vectors(step,x,v,d);
// Step 5
*/
void add (const Number s);
- /**
- * Simple vector addition, equal to the <tt>operator +=</tt>.
- *
- * @deprecated Use the <tt>operator +=</tt> instead.
- *
- * @dealiiOperationIsMultithreaded
- */
- void add (const Vector<Number> &V) DEAL_II_DEPRECATED;
-
-
/**
* Multiple addition of scaled vectors, i.e. <tt>*this += a*V+b*W</tt>.
*
Vector<Number> &Vector<Number>::operator += (const Vector<Number> &v)
{
Assert (vec_size!=0, ExcEmptyObject());
+ Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
- add (v);
+ internal::VectorOperations::Vectorization_add_v<Number> vector_add(val, v.val);
+ internal::VectorOperations::parallel_for(vector_add,0,vec_size,thread_loop_partitioner);
return *this;
}
-template <typename Number>
-void Vector<Number>::add (const Vector<Number> &v)
-{
- Assert (vec_size!=0, ExcEmptyObject());
- Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
-
- internal::VectorOperations::Vectorization_add_v<Number> vector_add(val, v.val);
- internal::VectorOperations::parallel_for(vector_add,0,vec_size,thread_loop_partitioner);
-}
-
-
-
template <typename Number>
void Vector<Number>::add (const Number a, const Vector<Number> &v,
const Number b, const Vector<Number> &w)
BlockVectorType aux;
aux.reinit(dst);
vmult(aux, src);
- dst.add(aux);
+ dst += aux;
}
- VectorBase::real_type
- VectorBase::normalize () const
- {
- real_type d;
- Assert (!has_ghost_elements(), ExcGhostsPresent());
- const PetscErrorCode ierr = VecNormalize (vector, &d);
- AssertThrow (ierr == 0, ExcPETScError(ierr));
-
- return d;
- }
-
-
VectorBase::real_type
VectorBase::min () const
{
}
- VectorBase &
- VectorBase::abs ()
- {
- Assert (!has_ghost_elements(), ExcGhostsPresent());
-
- const PetscErrorCode ierr = VecAbs (vector);
- AssertThrow (ierr == 0, ExcPETScError(ierr));
-
- return *this;
- }
-
-
-
- VectorBase &
- VectorBase::conjugate ()
- {
- Assert (!has_ghost_elements(), ExcGhostsPresent());
-
- const PetscErrorCode ierr = VecConjugate (vector);
- AssertThrow (ierr == 0, ExcPETScError(ierr));
-
- return *this;
- }
-
-
-
- VectorBase &
- VectorBase::mult ()
- {
- Assert (!has_ghost_elements(), ExcGhostsPresent());
-
- const PetscErrorCode ierr = VecPointwiseMult (vector,vector,vector);
- AssertThrow (ierr == 0, ExcPETScError(ierr));
-
- return *this;
- }
-
-
- VectorBase &
- VectorBase::mult (const VectorBase &v)
- {
- Assert (!has_ghost_elements(), ExcGhostsPresent());
- const PetscErrorCode ierr = VecPointwiseMult (vector,vector,v);
- AssertThrow (ierr == 0, ExcPETScError(ierr));
-
- return *this;
- }
-
-
- VectorBase &
- VectorBase::mult (const VectorBase &u,
- const VectorBase &v)
- {
- Assert (!has_ghost_elements(), ExcGhostsPresent());
- const PetscErrorCode ierr = VecPointwiseMult (vector,u,v);
- AssertThrow (ierr == 0, ExcPETScError(ierr));
-
- return *this;
- }
bool
VectorBase::all_zero () const
- void
- VectorBase::add (const VectorBase &v)
- {
- *this += v;
- }
-
-
-
void
VectorBase::add (const PetscScalar a,
const VectorBase &v)
+++ /dev/null
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2004 - 2016 by the deal.II authors
-//
-// This file is part of the deal.II library.
-//
-// The deal.II library is free software; you can use it, redistribute
-// it, and/or modify it under the terms of the GNU Lesser General
-// Public License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-// The full text of the license can be found in the file LICENSE at
-// the top level of the deal.II distribution.
-//
-// ---------------------------------------------------------------------
-
-
-
-// check Vector<std::complex<double> >::add(Vector)
-
-#include "../tests.h"
-#include <deal.II/lac/vector.h>
-#include <fstream>
-#include <iomanip>
-#include <vector>
-
-
-void test (Vector<std::complex<double> > &v,
- Vector<std::complex<double> > &w)
-{
- for (unsigned int i=0; i<v.size(); ++i)
- {
- v(i) = i;
- w(i) = std::complex<double> (i+1., i+2.);
- }
-
- v.compress ();
- w.compress ();
-
- v.add (w);
-
- // make sure we get the expected result
- for (unsigned int i=0; i<v.size(); ++i)
- {
- AssertThrow (w(i) == std::complex<double> (i+1., i+2.),
- ExcInternalError());
- AssertThrow (v(i) == 1.*i+std::complex<double> (i+1., i+2.),
- ExcInternalError());
- }
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main ()
-{
- initlog();
- deallog.threshold_double(1.e-10);
-
- try
- {
- Vector<std::complex<double> > v (100);
- Vector<std::complex<double> > w (100);
- test (v,w);
- }
- catch (std::exception &exc)
- {
- deallog << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- deallog << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- deallog << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- deallog << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
-}
+++ /dev/null
-
-DEAL::OK
+++ /dev/null
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2004 - 2016 by the deal.II authors
-//
-// This file is part of the deal.II library.
-//
-// The deal.II library is free software; you can use it, redistribute
-// it, and/or modify it under the terms of the GNU Lesser General
-// Public License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-// The full text of the license can be found in the file LICENSE at
-// the top level of the deal.II distribution.
-//
-// ---------------------------------------------------------------------
-
-
-
-// check Vector<double>::add(Vector)
-
-#include "../tests.h"
-#include <deal.II/lac/vector.h>
-#include <fstream>
-#include <iomanip>
-#include <vector>
-
-
-void test (Vector<double> &v,
- Vector<double> &w)
-{
- for (unsigned int i=0; i<v.size(); ++i)
- {
- v(i) = i;
- w(i) = i+1.;
- }
-
- v.compress ();
- w.compress ();
-
- v.add (w);
-
- // make sure we get the expected result
- for (unsigned int i=0; i<v.size(); ++i)
- {
- Assert (w(i) == i+1., ExcInternalError());
- Assert (v(i) == i+(i+1.), ExcInternalError());
- }
-
- deallog << "OK" << std::endl;
-}
-
-
-
-int main ()
-{
- initlog();
- deallog.threshold_double(1.e-10);
-
- try
- {
- Vector<double> v (100);
- Vector<double> w (100);
- test (v,w);
- }
- catch (std::exception &exc)
- {
- deallog << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- deallog << "Exception on processing: " << std::endl
- << exc.what() << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
-
- return 1;
- }
- catch (...)
- {
- deallog << std::endl << std::endl
- << "----------------------------------------------------"
- << std::endl;
- deallog << "Unknown exception!" << std::endl
- << "Aborting!" << std::endl
- << "----------------------------------------------------"
- << std::endl;
- return 1;
- };
-}
+++ /dev/null
-
-DEAL::OK