Reference documentation for deal.II version 9.4.1
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
vector_space_vector.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 2015 - 2021 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
23
25
26#include <memory>
27
28
30
31// Forward declarations
32#ifndef DOXYGEN
33class IndexSet;
34namespace LinearAlgebra
35{
36 template <typename Number>
37 class ReadWriteVector;
38} // namespace LinearAlgebra
39#endif
40
41namespace LinearAlgebra
42{
54 template <typename Number>
56 {
57 public:
58 using value_type = Number;
61
66 virtual void
68 const bool omit_zeroing_entries = false) = 0;
69
75 operator=(const Number s) = 0;
76
81 operator*=(const Number factor) = 0;
82
87 operator/=(const Number factor) = 0;
88
94
100
109 virtual void
110 import(const ReadWriteVector<Number> &V,
111 VectorOperation::values operation,
112 std::shared_ptr<const Utilities::MPI::CommunicationPatternBase>
113 communication_pattern = {}) = 0;
114
118 virtual Number
120
124 virtual void
125 add(const Number a) = 0;
126
130 virtual void
131 add(const Number a, const VectorSpaceVector<Number> &V) = 0;
132
136 virtual void
137 add(const Number a,
139 const Number b,
140 const VectorSpaceVector<Number> &W) = 0;
141
146 virtual void
147 sadd(const Number s,
148 const Number a,
149 const VectorSpaceVector<Number> &V) = 0;
150
156 virtual void
157 scale(const VectorSpaceVector<Number> &scaling_factors) = 0;
158
162 virtual void
163 equ(const Number a, const VectorSpaceVector<Number> &V) = 0;
164
168 virtual bool
169 all_zero() const = 0;
170
174 virtual value_type
175 mean_value() const = 0;
176
181 virtual real_type
182 l1_norm() const = 0;
183
188 virtual real_type
189 l2_norm() const = 0;
190
195 virtual real_type
196 linfty_norm() const = 0;
197
218 virtual Number
219 add_and_dot(const Number a,
221 const VectorSpaceVector<Number> &W) = 0;
222
227 {}
228
233 virtual size_type
234 size() const = 0;
235
247 virtual ::IndexSet
249
253 virtual void
254 print(std::ostream & out,
255 const unsigned int precision = 3,
256 const bool scientific = true,
257 const bool across = true) const = 0;
258
262 virtual std::size_t
264
269 virtual ~VectorSpaceVector() = default;
270 };
272} // namespace LinearAlgebra
273
274// ---------------------------- Free functions --------------------------
275
276namespace LinearAlgebra
277{
282 template <typename Number>
283 void
285 {
286 vector.add(-vector.mean_value());
287 }
288} // namespace LinearAlgebra
289
291
292#endif
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:442
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:443
virtual VectorSpaceVector< Number > & operator+=(const VectorSpaceVector< Number > &V)=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 Number factor)=0
virtual void scale(const VectorSpaceVector< Number > &scaling_factors)=0
virtual ~VectorSpaceVector()=default
virtual real_type l2_norm() const =0
virtual void equ(const Number a, const VectorSpaceVector< Number > &V)=0
virtual void add(const Number a)=0
virtual VectorSpaceVector< Number > & operator-=(const VectorSpaceVector< Number > &V)=0
void set_zero_mean_value(VectorSpaceVector< Number > &vector)
types::global_dof_index size_type
virtual std::size_t memory_consumption() const =0
virtual ::IndexSet locally_owned_elements() const =0
virtual void add(const Number a, const VectorSpaceVector< Number > &V)=0
virtual void compress(VectorOperation::values)
virtual real_type l1_norm() const =0
typename numbers::NumberTraits< Number >::real_type real_type
virtual void reinit(const VectorSpaceVector< Number > &V, const bool omit_zeroing_entries=false)=0
virtual size_type size() const =0
virtual VectorSpaceVector< Number > & operator/=(const Number factor)=0
virtual Number add_and_dot(const Number a, const VectorSpaceVector< Number > &V, const VectorSpaceVector< Number > &W)=0
virtual bool all_zero() const =0
virtual void sadd(const Number s, const Number a, const VectorSpaceVector< Number > &V)=0
virtual value_type mean_value() const =0
virtual VectorSpaceVector< Number > & operator=(const Number s)=0
virtual void add(const Number a, const VectorSpaceVector< Number > &V, const Number b, const VectorSpaceVector< Number > &W)=0
virtual Number operator*(const VectorSpaceVector< Number > &V) const =0
virtual real_type linfty_norm() const =0
unsigned int global_dof_index
Definition: types.h:76