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
8
#include <
kernel/base_header.hpp
>
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
18
namespace
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_>
34
struct
UnitFilterInfo
35
{
36
const
Memory::Arbiter
* val;
37
const
Memory::Arbiter
* ind;
38
Index
used_elements;
39
};
40
41
template
<
typename
DT_,
typename
IT_>
42
struct
GMRESApplyInfo
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;
50
Global::Gate<LAFEM::DenseVector<DT_, IT_>
,
LAFEM::VectorMirror<DT_, IT_>
>* gate;
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
63
FEAT::Solver::KrylovOrthogonalizerType
ortho_type;
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_>
71
struct
GMRESStatus
72
{
73
DT_ def_norm;
74
DT_ def_init;
75
Index
num_iter;
76
};
77
}
base_header.hpp
FEAT Kernel base header.
FEAT::Global::Gate
Global gate implementation.
Definition:
gate.hpp:78
FEAT::LAFEM::VectorMirror
Handles vector prolongation, restriction and serialization.
Definition:
vector_mirror.hpp:68
FEAT::Memory::Arbiter
Memory arbiter class.
Definition:
memory_arbiter.hpp:637
FEAT::Solver::PlotMode
PlotMode
Solver plot modes enumeration.
Definition:
iterative.hpp:54
FEAT::Solver::KrylovOrthogonalizerType
KrylovOrthogonalizerType
Enumeration of the available Krylov subspace orthogonalization strategies.
Definition:
krylov_orthogonalizer.hpp:34
FEAT::Index
std::uint64_t Index
Index data type.
Definition:
base_header.hpp:130
FEAT::Solver::CSRHelper::CRSMat
Definition:
csr_apply_helper.hpp:24
FEAT::Solver::CSRHelper::GMRESApplyInfo
Definition:
csr_apply_helper.hpp:43
FEAT::Solver::CSRHelper::GMRESStatus
Definition:
csr_apply_helper.hpp:72
FEAT::Solver::CSRHelper::UnitFilterInfo
Definition:
csr_apply_helper.hpp:35
kernel
solver
backend_aux
csr_apply_helper.hpp
Generated by
1.9.5