-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdirectSolverGive.h
More file actions
56 lines (46 loc) · 1.85 KB
/
directSolverGive.h
File metadata and controls
56 lines (46 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
#include "../directSolver.h"
template <class LevelCacheType>
class DirectSolver_CSR_LU_Give : public DirectSolver<LevelCacheType>
{
public:
explicit DirectSolver_CSR_LU_Give(const PolarGrid& grid, const LevelCacheType& level_cache, bool DirBC_Interior,
int num_omp_threads);
// Note: The rhs (right-hand side) vector gets overwritten with the solution.
void solveInPlace(Vector<double> solution) override;
private:
// Solver matrix and solver structure
SparseMatrixCSR<double> solver_matrix_;
SparseLUSolver<double> lu_solver_;
// clang-format off
const Stencil stencil_interior_ = {
7, 4, 8,
1, 0, 2,
5, 3, 6
};
const Stencil stencil_across_origin_ = {
-1, 4, 6,
1, 0, 2,
-1, 3, 5
};
const Stencil stencil_DB_ = {
-1, -1, -1,
-1, 0, -1,
-1, -1, -1
};
// clang-format on
SparseMatrixCSR<double> buildSolverMatrix();
void buildSolverMatrixCircleSection(const int i_r, SparseMatrixCSR<double>& solver_matrix);
void buildSolverMatrixRadialSection(const int i_theta, SparseMatrixCSR<double>& solver_matrix);
// Returns the total number of non-zero elements in the solver matrix.
int getNonZeroCountSolverMatrix() const;
// Retrieves the stencil for the solver matrix at the given radial index.
const Stencil& getStencil(int i_r) const;
int getStencilSize(int global_index) const;
void nodeBuildSolverMatrixGive(int i_r, int i_theta, const PolarGrid& grid, const bool DirBC_Interior,
SparseMatrixCSR<double>& solver_matrix, double arr, double att, double art,
double detDF, double coeff_beta);
};
#include "buildSolverMatrix.inl"
#include "directSolverGive.inl"
#include "matrixStencil.inl"