Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
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.md at
12 // the top level directory of deal.II.
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 
21 #include <deal.II/base/numbers.h>
22 
23 #include <deal.II/lac/vector_operation.h>
24 
25 #include <memory>
26 
27 
28 DEAL_II_NAMESPACE_OPEN
29 
30 class IndexSet;
31 namespace LinearAlgebra
32 {
33  class CommunicationPatternBase;
34  template <typename Number>
35  class ReadWriteVector;
36 } // namespace LinearAlgebra
37 
38 namespace LinearAlgebra
39 {
53  template <typename Number>
55  {
56  public:
57  using value_type = Number;
58  using size_type = types::global_dof_index;
59  using real_type = typename numbers::NumberTraits<Number>::real_type;
60 
65  virtual void
67  const bool omit_zeroing_entries = false) = 0;
68 
74  operator=(const Number s) = 0;
75 
80  operator*=(const Number factor) = 0;
81 
86  operator/=(const Number factor) = 0;
87 
93 
99 
108  virtual void
109  import(
110  const ReadWriteVector<Number> & V,
111  VectorOperation::values operation,
112  std::shared_ptr<const CommunicationPatternBase> communication_pattern =
113  std::shared_ptr<const CommunicationPatternBase>()) = 0;
114 
118  virtual Number operator*(const VectorSpaceVector<Number> &V) const = 0;
119 
123  virtual void
124  add(const Number a) = 0;
125 
129  virtual void
130  add(const Number a, const VectorSpaceVector<Number> &V) = 0;
131 
135  virtual void
136  add(const Number a,
137  const VectorSpaceVector<Number> &V,
138  const Number b,
139  const VectorSpaceVector<Number> &W) = 0;
140 
145  virtual void
146  sadd(const Number s,
147  const Number a,
148  const VectorSpaceVector<Number> &V) = 0;
149 
155  virtual void
156  scale(const VectorSpaceVector<Number> &scaling_factors) = 0;
157 
161  virtual void
162  equ(const Number a, const VectorSpaceVector<Number> &V) = 0;
163 
167  virtual bool
168  all_zero() const = 0;
169 
173  virtual value_type
174  mean_value() const = 0;
175 
180  virtual real_type
181  l1_norm() const = 0;
182 
187  virtual real_type
188  l2_norm() const = 0;
189 
194  virtual real_type
195  linfty_norm() const = 0;
196 
217  virtual Number
218  add_and_dot(const Number a,
219  const VectorSpaceVector<Number> &V,
220  const VectorSpaceVector<Number> &W) = 0;
221 
226  {}
227 
232  virtual size_type
233  size() const = 0;
234 
246  virtual ::IndexSet
247  locally_owned_elements() const = 0;
248 
252  virtual void
253  print(std::ostream & out,
254  const unsigned int precision = 3,
255  const bool scientific = true,
256  const bool across = true) const = 0;
257 
261  virtual std::size_t
262  memory_consumption() const = 0;
263 
268  virtual ~VectorSpaceVector() = default;
269  };
271 } // namespace LinearAlgebra
272 
273 DEAL_II_NAMESPACE_CLOSE
274 
275 #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
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
unsigned int global_dof_index
Definition: types.h:89
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