Reference documentation for deal.II version 8.5.1
vector_space_vector.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2015 - 2016 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii__vector_space_vector_h
17 #define dealii__vector_space_vector_h
18 
19 #include <deal.II/base/config.h>
20 #include <deal.II/base/numbers.h>
21 #include <deal.II/base/std_cxx11/shared_ptr.h>
22 #include <deal.II/lac/vector.h>
23 
24 
25 DEAL_II_NAMESPACE_OPEN
26 
27 class IndexSet;
28 namespace LinearAlgebra
29 {
30  class CommunicationPatternBase;
31  template <typename Number> class ReadWriteVector;
32 }
33 
34 namespace LinearAlgebra
35 {
49  template <typename Number>
51  {
52  public:
53  typedef Number value_type;
54  typedef types::global_dof_index size_type;
55  typedef typename numbers::NumberTraits<Number>::real_type real_type;
56 
57 
61  virtual VectorSpaceVector<Number> &operator*= (const Number factor) = 0;
62 
66  virtual VectorSpaceVector<Number> &operator/= (const Number factor) = 0;
67 
72 
77 
86  virtual void import(const ReadWriteVector<Number> &V,
87  VectorOperation::values operation,
88  std_cxx11::shared_ptr<const CommunicationPatternBase> communication_pattern =
89  std_cxx11::shared_ptr<const CommunicationPatternBase> ()) = 0;
90 
94  virtual Number operator* (const VectorSpaceVector<Number> &V) const = 0;
95 
99  virtual void add(const Number a) = 0;
100 
104  virtual void add(const Number a, const VectorSpaceVector<Number> &V) = 0;
105 
109  virtual void add(const Number a, const VectorSpaceVector<Number> &V,
110  const Number b, const VectorSpaceVector<Number> &W) = 0;
111 
116  virtual void sadd(const Number s, const Number a,
117  const VectorSpaceVector<Number> &V) = 0;
118 
124  virtual void scale(const VectorSpaceVector<Number> &scaling_factors) = 0;
125 
129  virtual void equ(const Number a, const VectorSpaceVector<Number> &V) = 0;
130 
134  virtual value_type mean_value() const = 0;
135 
140  virtual real_type l1_norm() const = 0;
141 
146  virtual real_type l2_norm() const = 0;
147 
152  virtual real_type linfty_norm() const = 0;
153 
170  virtual Number add_and_dot(const Number a,
171  const VectorSpaceVector<Number> &V,
172  const VectorSpaceVector<Number> &W) = 0;
173 
178 
183  virtual size_type size() const = 0;
184 
196  virtual ::IndexSet locally_owned_elements() const = 0;
197 
201  virtual void print(std::ostream &out,
202  const unsigned int precision=3,
203  const bool scientific=true,
204  const bool across=true) const = 0;
205 
209  virtual std::size_t memory_consumption() const = 0;
210 
215  virtual ~VectorSpaceVector();
216  };
221 #ifndef DOXYGEN
222  // TODO we can get rid of this when we require C++11 by using '=default'
223  // above
224  template <typename Number>
225  inline
227  {}
228 #endif // DOXYGEN
229 }
230 
231 DEAL_II_NAMESPACE_CLOSE
232 
233 #endif
virtual Number operator*(const VectorSpaceVector< Number > &V) const =0
virtual void sadd(const Number s, const Number a, const VectorSpaceVector< Number > &V)=0
virtual VectorSpaceVector< Number > & operator/=(const Number factor)=0
virtual real_type l2_norm() const =0
virtual void add(const Number a)=0
virtual real_type linfty_norm() const =0
virtual void scale(const VectorSpaceVector< Number > &scaling_factors)=0
virtual void equ(const Number a, const VectorSpaceVector< Number > &V)=0
virtual size_type size() const =0
unsigned int global_dof_index
Definition: types.h:88
virtual Number add_and_dot(const Number a, const VectorSpaceVector< Number > &V, const VectorSpaceVector< Number > &W)=0
virtual void compress(VectorOperation::values)
virtual std::size_t memory_consumption() const =0
virtual void print(std::ostream &out, const unsigned int precision=3, const bool scientific=true, const bool across=true) const =0
virtual VectorSpaceVector< Number > & operator+=(const VectorSpaceVector< Number > &V)=0
virtual real_type l1_norm() const =0
virtual VectorSpaceVector< Number > & operator-=(const VectorSpaceVector< Number > &V)=0
virtual VectorSpaceVector< Number > & operator*=(const Number factor)=0
virtual value_type mean_value() const =0
virtual ::IndexSet locally_owned_elements() const =0