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
LinearAlgebra::VectorSpaceVector::locally_owned_elements
virtual ::IndexSet locally_owned_elements() const =0
IndexSet
Definition: index_set.h:74
LinearAlgebra
Definition: communication_pattern_base.h:27
LinearAlgebra::VectorSpaceVector::equ
virtual void equ(const Number a, const VectorSpaceVector< Number > &V)=0
LinearAlgebra::VectorSpaceVector::operator+=
virtual VectorSpaceVector< Number > & operator+=(const VectorSpaceVector< Number > &V)=0
LinearAlgebra::VectorSpaceVector::~VectorSpaceVector
virtual ~VectorSpaceVector()=default
LinearAlgebra::VectorSpaceVector::l2_norm
virtual real_type l2_norm() const =0
LinearAlgebra::VectorSpaceVector::size
virtual size_type size() const =0
LinearAlgebra::VectorSpaceVector::compress
virtual void compress(VectorOperation::values)
Definition: vector_space_vector.h:225
LinearAlgebra::VectorSpaceVector::operator-=
virtual VectorSpaceVector< Number > & operator-=(const VectorSpaceVector< Number > &V)=0
LinearAlgebra::VectorSpaceVector::operator*
virtual Number operator*(const VectorSpaceVector< Number > &V) const =0
LinearAlgebra::VectorSpaceVector::l1_norm
virtual real_type l1_norm() const =0
types::global_dof_index
unsigned int global_dof_index
Definition: types.h:89
LinearAlgebra::VectorSpaceVector::operator/=
virtual VectorSpaceVector< Number > & operator/=(const Number factor)=0
LinearAlgebra::VectorSpaceVector::scale
virtual void scale(const VectorSpaceVector< Number > &scaling_factors)=0
LinearAlgebra::VectorSpaceVector::reinit
virtual void reinit(const VectorSpaceVector< Number > &V, const bool omit_zeroing_entries=false)=0
LinearAlgebra::VectorSpaceVector::linfty_norm
virtual real_type linfty_norm() const =0
VectorOperation::values
values
Definition: vector_operation.h:40
numbers::NumberTraits::real_type
number real_type
Definition: numbers.h:363
LinearAlgebra::ReadWriteVector
Definition: la_parallel_vector.h:48
LinearAlgebra::VectorSpaceVector::add_and_dot
virtual Number add_and_dot(const Number a, const VectorSpaceVector< Number > &V, const VectorSpaceVector< Number > &W)=0
LinearAlgebra::VectorSpaceVector::all_zero
virtual bool all_zero() const =0
LinearAlgebra::VectorSpaceVector::memory_consumption
virtual std::size_t memory_consumption() const =0
LinearAlgebra::VectorSpaceVector
Definition: vector_space_vector.h:54
LinearAlgebra::VectorSpaceVector::print
virtual void print(std::ostream &out, const unsigned int precision=3, const bool scientific=true, const bool across=true) const =0
LinearAlgebra::VectorSpaceVector::add
virtual void add(const Number a)=0
LinearAlgebra::VectorSpaceVector::operator*=
virtual VectorSpaceVector< Number > & operator*=(const Number factor)=0
LinearAlgebra::VectorSpaceVector::sadd
virtual void sadd(const Number s, const Number a, const VectorSpaceVector< Number > &V)=0
LinearAlgebra::VectorSpaceVector::operator=
virtual VectorSpaceVector< Number > & operator=(const Number s)=0
LinearAlgebra::VectorSpaceVector::mean_value
virtual value_type mean_value() const =0