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
relaxation_block.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 2010 - 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_relaxation_block_h
17#define dealii_relaxation_block_h
18
19#include <deal.II/base/config.h>
20
23
26#include <deal.II/lac/vector.h>
27
28#include <set>
29#include <vector>
30
32
54template <typename MatrixType,
55 typename InverseNumberType = typename MatrixType::value_type,
56 typename VectorType = Vector<double>>
57class RelaxationBlock : protected PreconditionBlockBase<InverseNumberType>
58{
59private:
63 using number = typename MatrixType::value_type;
64
68 using value_type = InverseNumberType;
69
70public:
75
83 {
84 public:
89 const double relaxation = 1.,
90 const bool invert_diagonal = true,
91 const bool same_diagonal = false,
94 const double threshold = 0.,
95 VectorType * temp_ghost_vector = nullptr);
96
102
107
115
125
130
140 double threshold = 0.;
141
151 unsigned int kernel_size = 0;
152
173 std::vector<std::vector<unsigned int>> order;
174
183 mutable VectorType *temp_ghost_vector;
184
188 std::size_t
190 };
191
201 void
202 initialize(const MatrixType &A, const AdditionalData &parameters);
203
209 void
211
227 void
229
230protected:
239 void
240 do_step(VectorType & dst,
241 const VectorType &prev,
242 const VectorType &src,
243 const bool backward) const;
244
251 SmartPointer<const MatrixType,
254
261
262private:
266 void
267 block_kernel(const size_type block_begin, const size_type block_end);
268};
269
270
284template <typename MatrixType,
285 typename InverseNumberType = typename MatrixType::value_type,
286 typename VectorType = Vector<double>>
288 : public virtual Subscriptor,
289 protected RelaxationBlock<MatrixType, InverseNumberType, VectorType>
290{
291public:
295 // RelaxationBlockJacobi();
296
300 using number = typename MatrixType::value_type;
301
306 AdditionalData;
307
311 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::initialize;
312
316 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::clear;
317
321 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::size;
325 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::inverse;
329 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::
334 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::inverse_svd;
338 using PreconditionBlockBase<InverseNumberType>::log_statistics;
342 void
343 step(VectorType &dst, const VectorType &rhs) const;
344
348 void
349 Tstep(VectorType &dst, const VectorType &rhs) const;
350
355 void
356 vmult(VectorType &dst, const VectorType &rhs) const;
357
362 void
363 Tvmult(VectorType &dst, const VectorType &rhs) const;
364};
365
366
380template <typename MatrixType,
381 typename InverseNumberType = typename MatrixType::value_type,
382 typename VectorType = Vector<double>>
384 : public virtual Subscriptor,
385 protected RelaxationBlock<MatrixType, InverseNumberType, VectorType>
386{
387public:
391 // RelaxationBlockSOR();
392
396 using number = typename MatrixType::value_type;
397
402 AdditionalData;
403
407 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::initialize;
408
412 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::clear;
413
417 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::size;
421 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::inverse;
425 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::
430 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::inverse_svd;
434 using PreconditionBlockBase<InverseNumberType>::log_statistics;
438 void
439 step(VectorType &dst, const VectorType &rhs) const;
440
444 void
445 Tstep(VectorType &dst, const VectorType &rhs) const;
446
451 void
452 vmult(VectorType &dst, const VectorType &rhs) const;
453
458 void
459 Tvmult(VectorType &dst, const VectorType &rhs) const;
460};
461
462
476template <typename MatrixType,
477 typename InverseNumberType = typename MatrixType::value_type,
478 typename VectorType = Vector<double>>
480 : public virtual Subscriptor,
481 protected RelaxationBlock<MatrixType, InverseNumberType, VectorType>
482{
483public:
487 using number = typename MatrixType::value_type;
488
493 AdditionalData;
494
498 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::initialize;
499
503 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::clear;
504
508 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::size;
512 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::inverse;
516 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::
521 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::inverse_svd;
525 using PreconditionBlockBase<InverseNumberType>::log_statistics;
529 void
530 step(VectorType &dst, const VectorType &rhs) const;
531
535 void
536 Tstep(VectorType &dst, const VectorType &rhs) const;
537
542 void
543 vmult(VectorType &dst, const VectorType &rhs) const;
544
549 void
550 Tvmult(VectorType &dst, const VectorType &rhs) const;
551};
552
553
555
556#endif
Householder< number > & inverse_householder(size_type i)
FullMatrix< number > & inverse(size_type i)
LAPACKFullMatrix< number > & inverse_svd(size_type i)
void Tstep(VectorType &dst, const VectorType &rhs) const
void Tvmult(VectorType &dst, const VectorType &rhs) const
void vmult(VectorType &dst, const VectorType &rhs) const
void step(VectorType &dst, const VectorType &rhs) const
typename MatrixType::value_type number
void Tvmult(VectorType &dst, const VectorType &rhs) const
void step(VectorType &dst, const VectorType &rhs) const
void vmult(VectorType &dst, const VectorType &rhs) const
typename MatrixType::value_type number
void Tstep(VectorType &dst, const VectorType &rhs) const
void Tstep(VectorType &dst, const VectorType &rhs) const
void Tvmult(VectorType &dst, const VectorType &rhs) const
typename MatrixType::value_type number
void step(VectorType &dst, const VectorType &rhs) const
void vmult(VectorType &dst, const VectorType &rhs) const
AdditionalData(const double relaxation=1., const bool invert_diagonal=true, const bool same_diagonal=false, const typename PreconditionBlockBase< InverseNumberType >::Inversion inversion=PreconditionBlockBase< InverseNumberType >::gauss_jordan, const double threshold=0., VectorType *temp_ghost_vector=nullptr)
PreconditionBlockBase< InverseNumberType >::Inversion inversion
std::size_t memory_consumption() const
std::vector< std::vector< unsigned int > > order
void initialize(const MatrixType &A, const AdditionalData &parameters)
void block_kernel(const size_type block_begin, const size_type block_end)
void do_step(VectorType &dst, const VectorType &prev, const VectorType &src, const bool backward) const
SmartPointer< const AdditionalData, RelaxationBlock< MatrixType, InverseNumberType, VectorType > > additional_data
SmartPointer< const MatrixType, RelaxationBlock< MatrixType, InverseNumberType, VectorType > > A
typename MatrixType::value_type number
void invert_diagblocks()
InverseNumberType value_type
Definition: vector.h:109
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:442
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:443
unsigned int global_dof_index
Definition: types.h:76