BlockVector<double>;
BlockVector<float>;
+ LinearAlgebra::Vector<double>;
+ LinearAlgebra::Vector<float> ;
+
LinearAlgebra::distributed::Vector<double>;
LinearAlgebra::distributed::Vector<float> ;
BlockVector<double>;
BlockVector<float>;
+ LinearAlgebra::Vector<double>;
+ LinearAlgebra::Vector<float> ;
+
LinearAlgebra::distributed::Vector<double>;
LinearAlgebra::distributed::Vector<float> ;
#include <deal.II/lac/sparse_matrix.h>
#include <deal.II/lac/block_sparsity_pattern.h>
#include <deal.II/lac/block_sparse_matrix.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/petsc_parallel_vector.h>
// call compress() finally. the first case here is for the complicated case,
// the last else is for the simple case (sequential vector)
const IndexSet vec_owned_elements = vec.locally_owned_elements();
- if (vec.supports_distributed_data == true)
+ if ((typeid(vec) != typeid(Vector<double>)) &&
+ (typeid(vec) != typeid(Vector<float>)) &&
+ (typeid(vec) != typeid(BlockVector<double>)) &&
+ (typeid(vec) != typeid(BlockVector<float>)) &&
+ (typeid(vec) != typeid(LinearAlgebra::Vector<double>)) &&
+ (typeid(vec) != typeid(LinearAlgebra::Vector<float>)))
{
// This processor owns only part of the vector. one may think that
// every processor should be able to simply communicate those elements
/**
* Compute the mean value of all the entries in the vector.
*/
- Number mean_value () const;
+ virtual Number mean_value () const;
/**
* $l_p$-norm of the vector. The pth root of the sum of the pth powers
{
public:
typedef types::global_dof_index size_type;
+ typedef typename ReadWriteVector<Number>::value_type value_type;
/**
* Constructor. Create a vector of dimension zero.
*/
virtual void equ(const Number a, const VectorSpaceVector<Number> &V);
+ /**
+ * Return the mean value of the element of this vector.
+ */
+ virtual typename VectorSpaceVector<Number>::value_type mean_value() const;
+
/**
* Return the l<sub>1</sub> norm of the vector (i.e., the sum of the
* absolute values of all entries).
+ template <typename Number>
+ typename VectorSpaceVector<Number>::value_type Vector<Number>::mean_value() const
+ {
+ Assert (this->size(), ExcEmptyObject());
+
+ typedef typename VectorSpaceVector<Number>::real_type real_type;
+ value_type sum;
+ internal::MeanValue<Number> mean_value(this->val);
+ internal::parallel_reduce(mean_value, this->size(), sum, this->thread_loop_partitioner);
+
+ return sum/static_cast<real_type>(this->size());
+ }
+
+
+
template <typename Number>
typename VectorSpaceVector<Number>::real_type Vector<Number>::l1_norm() const
{
*/
virtual void equ(const double a, const VectorSpaceVector<double> &V);
+ /**
+ * Return the mean value of the element of this vector.
+ */
+ virtual double mean_value() const;
/**
* Return the l<sub>1</sub> norm of the vector (i.e., the sum of the
*/
virtual void equ(const Number a, const VectorSpaceVector<Number> &V) = 0;
+ /**
+ * Return the mean value of the element of this vector.
+ */
+ virtual value_type mean_value() const = 0;
+
/**
* Return the l<sub>1</sub> norm of the vector (i.e., the sum of the
* absolute values of all entries among all processors).
const VectorSpaceVector<Number> &V,
const VectorSpaceVector<Number> &W) = 0;
+ /**
+ * This function does nothing and only exists for backward compatibility.
+ */
+ virtual void compress(VectorOperation::values) {}
+
/**
* Return the global size of the vector, equal to the sum of the number of
* locally owned indices among all processors.
// from two levels above in
// defect2. This is subtracted from
// the original defect.
- t[level].equ(-1.,defect2[level],1.,defect[level]);
+ t[level].equ(-1.,defect2[level]);
+ t[level] += defect[level];
if (debug>2)
deallog << cychar << "-cycle defect norm " << t[level].l2_norm()
if (edge_up != 0)
edge_up->Tvmult(level, t[level], solution[level-1]);
- t[level].sadd(-1.,-1.,defect2[level],1.,defect[level]);
+ t[level].sadd(-1.,-1.,defect2[level]);
+ t[level] += defect[level];
if (debug>2)
deallog << cychar << "-cycle Defect norm " << t[level].l2_norm()
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/base/work_stream.h>
#include <deal.II/lac/vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/block_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/base/qprojector.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <limits>
#include <set>
#include <list>
+#include <typeinfo>
DEAL_II_NAMESPACE_OPEN
else
{
// This function is not implemented for distributed vectors.
- Assert(!v.supports_distributed_data, ExcNotImplemented());
+ Assert(typeid(v) == typeid(Vector<double>) ||
+ typeid(v) == typeid(Vector<float>) ||
+ typeid(v) == typeid(BlockVector<double>) ||
+ typeid(v) == typeid(BlockVector<float>) ||
+ typeid(v) == typeid(LinearAlgebra::Vector<double>) ||
+ typeid(v) == typeid(LinearAlgebra::Vector<float>),
+ ExcNotImplemented());
const unsigned int n = v.size();
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <deal.II/base/thread_management.h>
#include <deal.II/base/utilities.h>
#include <deal.II/lac/vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/block_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
OutVector &u1_difference)
{
back_interpolate(dof1, constraints1, u1, dof2, constraints2, u1_difference);
- u1_difference.sadd(-1, u1);
+ u1_difference.sadd(-1., 1., u1);
}
// special version for Trilinos
#include <deal.II/base/std_cxx11/unique_ptr.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/full_matrix.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/parallel_vector.h>
#include <deal.II/lac/parallel_block_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <deal.II/fe/mapping_q1_eulerian.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
-#include <deal.II/lac/parallel_vector.h>
-#include <deal.II/lac/parallel_block_vector.h>
+#include <deal.II/lac/la_vector.h>
+#include <deal.II/lac/la_parallel_vector.h>
+#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/petsc_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/parallel_vector.h>
#include <deal.II/lac/parallel_block_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/sparse_matrix_ez.h>
#include <deal.II/lac/chunk_sparse_matrix.h>
#include <deal.II/lac/block_sparse_matrix_ez.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/vector_memory.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/petsc_block_vector.h>
#include <deal.II/lac/trilinos_vector.h>
+ double Vector::mean_value() const
+ {
+ double mean_value(0.);
+
+ int ierr = vector->MeanValue(&mean_value);
+ Assert(ierr==0, ExcTrilinosError(ierr));
+ (void) ierr;
+
+ return mean_value;
+ }
+
+
+
double Vector::l1_norm() const
{
double norm(0.);
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <deal.II/base/memory_consumption.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <deal.II/base/work_stream.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/base/work_stream.h>
#include <deal.II/lac/vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/block_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/la_parallel_block_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <deal.II/dofs/dof_accessor.h>
#include <deal.II/fe/fe.h>
#include <deal.II/lac/vector.h>
+#include <deal.II/lac/la_vector.h>
#include <deal.II/lac/la_parallel_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/trilinos_vector.h>