Reference documentation for deal.II version 9.5.0
\(\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 - 2022 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 <vector>
29
31
53template <typename MatrixType,
54 typename InverseNumberType = typename MatrixType::value_type,
55 typename VectorType = Vector<double>>
56class RelaxationBlock : protected PreconditionBlockBase<InverseNumberType>
57{
58private:
62 using number = typename MatrixType::value_type;
63
67 using value_type = InverseNumberType;
68
69public:
74
82 {
83 public:
88 const double relaxation = 1.,
89 const bool invert_diagonal = true,
90 const bool same_diagonal = false,
93 const double threshold = 0.,
94 VectorType * temp_ghost_vector = nullptr);
95
101
106
114
124
129
139 double threshold = 0.;
140
150 unsigned int kernel_size = 0;
151
172 std::vector<std::vector<unsigned int>> order;
173
182 mutable VectorType *temp_ghost_vector;
183
187 std::size_t
189 };
190
200 void
201 initialize(const MatrixType &A, const AdditionalData &parameters);
202
208 void
210
226 void
228
229protected:
238 void
239 do_step(VectorType & dst,
240 const VectorType &prev,
241 const VectorType &src,
242 const bool backward) const;
243
250 SmartPointer<const MatrixType,
253
260
261private:
265 void
266 block_kernel(const size_type block_begin, const size_type block_end);
267};
268
269
283template <typename MatrixType,
284 typename InverseNumberType = typename MatrixType::value_type,
285 typename VectorType = Vector<double>>
287 : public virtual Subscriptor,
288 protected RelaxationBlock<MatrixType, InverseNumberType, VectorType>
289{
290public:
294 // RelaxationBlockJacobi();
295
299 using number = typename MatrixType::value_type;
300
305 AdditionalData;
306
310 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::initialize;
311
315 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::clear;
316
320 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::size;
324 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::inverse;
328 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::
333 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::inverse_svd;
337 using PreconditionBlockBase<InverseNumberType>::log_statistics;
341 void
342 step(VectorType &dst, const VectorType &rhs) const;
343
347 void
348 Tstep(VectorType &dst, const VectorType &rhs) const;
349
354 void
355 vmult(VectorType &dst, const VectorType &rhs) const;
356
361 void
362 Tvmult(VectorType &dst, const VectorType &rhs) const;
363};
364
365
379template <typename MatrixType,
380 typename InverseNumberType = typename MatrixType::value_type,
381 typename VectorType = Vector<double>>
383 : public virtual Subscriptor,
384 protected RelaxationBlock<MatrixType, InverseNumberType, VectorType>
385{
386public:
390 // RelaxationBlockSOR();
391
395 using number = typename MatrixType::value_type;
396
401 AdditionalData;
402
406 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::initialize;
407
411 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::clear;
412
416 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::size;
420 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::inverse;
424 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::
429 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::inverse_svd;
433 using PreconditionBlockBase<InverseNumberType>::log_statistics;
437 void
438 step(VectorType &dst, const VectorType &rhs) const;
439
443 void
444 Tstep(VectorType &dst, const VectorType &rhs) const;
445
450 void
451 vmult(VectorType &dst, const VectorType &rhs) const;
452
457 void
458 Tvmult(VectorType &dst, const VectorType &rhs) const;
459};
460
461
475template <typename MatrixType,
476 typename InverseNumberType = typename MatrixType::value_type,
477 typename VectorType = Vector<double>>
479 : public virtual Subscriptor,
480 protected RelaxationBlock<MatrixType, InverseNumberType, VectorType>
481{
482public:
486 using number = typename MatrixType::value_type;
487
492 AdditionalData;
493
497 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::initialize;
498
502 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::clear;
503
507 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::size;
511 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::inverse;
515 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::
520 using RelaxationBlock<MatrixType, InverseNumberType, VectorType>::inverse_svd;
524 using PreconditionBlockBase<InverseNumberType>::log_statistics;
528 void
529 step(VectorType &dst, const VectorType &rhs) const;
530
534 void
535 Tstep(VectorType &dst, const VectorType &rhs) const;
536
541 void
542 vmult(VectorType &dst, const VectorType &rhs) const;
543
548 void
549 Tvmult(VectorType &dst, const VectorType &rhs) const;
550};
551
552
554
555#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
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:472
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:473
unsigned int global_dof_index
Definition types.h:82