FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
csr_apply_helper.hpp
1// FEAT3: Finite Element Analysis Toolbox, Version 3
2// Copyright (C) 2010 by Stefan Turek & the FEAT group
3// FEAT3 is released under the GNU General Public License version 3,
4// see the file 'copyright.txt' in the top level directory for details.
5
6#pragma once
7
9#include <kernel/util/memory_arbiter.hpp>
10#include <kernel/util/omp_util.hpp>
11#include <kernel/backend.hpp>
12#include <kernel/global/gate.hpp>
13#include <kernel/solver/iterative.hpp>
14#include <kernel/solver/krylov_orthogonalizer.hpp>
15
16
17
18namespace FEAT::Solver::CSRHelper
19{
20 // The matrix/filter/vector data is passed as Memory::Arbiter objects; the kernels acquire the
21 // device (cuda) views they need themselves, instead of receiving pre-resolved raw device pointers.
22 template<typename DT_, typename IT_>
23 struct CRSMat
24 {
25 const Memory::Arbiter* val;
26 const Memory::Arbiter* row;
27 const Memory::Arbiter* col;
28 Index num_rows;
29 Index num_cols;
30 Index num_nnz;
31 };
32
33 template<typename DT_, typename IT_>
35 {
36 const Memory::Arbiter* val;
37 const Memory::Arbiter* ind;
38 Index used_elements;
39 };
40
41 template<typename DT_, typename IT_>
43 {
44 CRSMat<DT_, IT_> mat_sys;
45 CRSMat<DT_, IT_> mat_vanka;
46 UnitFilterInfo<DT_, IT_> def_filter;
47 // krylov basis vectors: one arbiter per vector (read-write inside the kernel)
48 const std::vector<Memory::Arbiter*>* vec_v;
49 Memory::Arbiter* vec_w;
51 Index size;
52
53 DT_ res_scale;
54 DT_ abs_tol;
55 DT_ rel_tol;
56 Index krylov_dim;
57 Index max_iter;
58 Index min_iter;
59 Index plot_interval;
60 FEAT::Solver::PlotMode plot_mode;
61 bool prefetch_data;
62 // orthogonalization strategy: only classical_gram_schmidt or cgs2 are supported here
64 // DGKS norm-ratio threshold triggering a corrective reorthogonalization sweep (cgs2 only)
65 DT_ reortho_tol;
66 // if set, always perform the corrective reorthogonalization sweep (cgs2 only)
67 bool force_reortho;
68 };
69
70 template<typename DT_>
72 {
73 DT_ def_norm;
74 DT_ def_init;
75 Index num_iter;
76 };
77}
FEAT Kernel base header.
Global gate implementation.
Definition: gate.hpp:78
Handles vector prolongation, restriction and serialization.
Memory arbiter class.
PlotMode
Solver plot modes enumeration.
Definition: iterative.hpp:54
KrylovOrthogonalizerType
Enumeration of the available Krylov subspace orthogonalization strategies.
std::uint64_t Index
Index data type.