feat(equation-and-linear-solve): step 2 — pardiso-linear-solver
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include <span>
|
||||
#include <vector>
|
||||
|
||||
#include <fesa/assembly/symmetric_csr.hpp>
|
||||
#include <fesa/core/diagnostic.hpp>
|
||||
|
||||
namespace fesa {
|
||||
|
||||
struct LinearSolveResult final {
|
||||
std::vector<double> solution;
|
||||
double relative_residual{};
|
||||
std::vector<Diagnostic> diagnostics;
|
||||
};
|
||||
|
||||
class LinearSolver {
|
||||
public:
|
||||
virtual ~LinearSolver() = default;
|
||||
|
||||
[[nodiscard]] virtual LinearSolveResult solve(
|
||||
const SymmetricCsr& matrix,
|
||||
std::span<const double> rhs) = 0;
|
||||
};
|
||||
|
||||
} // namespace fesa
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <span>
|
||||
|
||||
#include <fesa/solvers/linear/linear_solver.hpp>
|
||||
|
||||
namespace fesa {
|
||||
|
||||
class PardisoLinearSolver final : public LinearSolver {
|
||||
public:
|
||||
PardisoLinearSolver();
|
||||
~PardisoLinearSolver() override;
|
||||
|
||||
[[nodiscard]] LinearSolveResult solve(
|
||||
const SymmetricCsr& matrix,
|
||||
std::span<const double> rhs) override;
|
||||
};
|
||||
|
||||
} // namespace fesa
|
||||
Reference in New Issue
Block a user