Reference documentation for deal.II version 9.0.0
vector_space_vector.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2015 - 2018 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/lac/vector_operation.h>
22 
23 #include <memory>
24 
25 
26 DEAL_II_NAMESPACE_OPEN
27 
28 class IndexSet;
29 namespace LinearAlgebra
30 {
31  class CommunicationPatternBase;
32  template <typename Number> class ReadWriteVector;
33 }
34 
35 namespace LinearAlgebra
36 {
50  template <typename Number>
52  {
53  public:
54  typedef Number value_type;
55  typedef types::global_dof_index size_type;
56  typedef typename numbers::NumberTraits<Number>::real_type real_type;
57 
62  virtual void reinit(const VectorSpaceVector<Number> &V,
63  const bool omit_zeroing_entries = false) = 0;
64 
69  virtual VectorSpaceVector<Number> &operator= (const Number s) = 0;
70 
74  virtual VectorSpaceVector<Number> &operator*= (const Number factor) = 0;
75 
79  virtual VectorSpaceVector<Number> &operator/= (const Number factor) = 0;
80 
85 
90 
99  virtual void import(const ReadWriteVector<Number> &V,
100  VectorOperation::values operation,
101  std::shared_ptr<const CommunicationPatternBase> communication_pattern =
102  std::shared_ptr<const CommunicationPatternBase> ()) = 0;
103 
107  virtual Number operator* (const VectorSpaceVector<Number> &V) const = 0;
108 
112  virtual void add(const Number a) = 0;
113 
117  virtual void add(const Number a, const VectorSpaceVector<Number> &V) = 0;
118 
122  virtual void add(const Number a, const VectorSpaceVector<Number> &V,
123  const Number b, const VectorSpaceVector<Number> &W) = 0;
124 
129  virtual void sadd(const Number s, const Number a,
130  const VectorSpaceVector<Number> &V) = 0;
131 
137  virtual void scale(const VectorSpaceVector<Number> &scaling_factors) = 0;
138 
142  virtual void equ(const Number a, const VectorSpaceVector<Number> &V) = 0;
143 
147  virtual bool all_zero() const = 0;
148 
152  virtual value_type mean_value() const = 0;
153 
158  virtual real_type l1_norm() const = 0;
159 
164  virtual real_type l2_norm() const = 0;
165 
170  virtual real_type linfty_norm() const = 0;
171 
191  virtual Number add_and_dot(const Number a,
192  const VectorSpaceVector<Number> &V,
193  const VectorSpaceVector<Number> &W) = 0;
194 
199 
204  virtual size_type size() const = 0;
205 
217  virtual ::IndexSet locally_owned_elements() const = 0;
218 
222  virtual void print(std::ostream &out,
223  const unsigned int precision=3,
224  const bool scientific=true,
225  const bool across=true) const = 0;
226 
230  virtual std::size_t memory_consumption() const = 0;
231 
236  virtual ~VectorSpaceVector() = default;
237  };
239 }
240 
241 DEAL_II_NAMESPACE_CLOSE
242 
243 #endif
virtual Number operator*(const VectorSpaceVector< Number > &V) const =0
virtual VectorSpaceVector< Number > & operator=(const Number s)=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 reinit(const VectorSpaceVector< Number > &V, const bool omit_zeroing_entries=false)=0
virtual void compress(VectorOperation::values)
virtual bool all_zero() const =0
virtual ~VectorSpaceVector()=default
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