/home/runner/work/kynema/kynema/kynema/src/solver/linear_solver/dss_numeric_umfpack.hpp Source File

Kynema API: /home/runner/work/kynema/kynema/kynema/src/solver/linear_solver/dss_numeric_umfpack.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
dss_numeric_umfpack.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Kokkos_Core.hpp>
4#include <umfpack.h>
5
6#include "dss_algorithm.hpp"
8
9namespace kynema::dss {
10template <typename CrsMatrixType>
11struct NumericFunction<Handle<Algorithm::UMFPACK>, CrsMatrixType> {
12 static void numeric(Handle<Algorithm::UMFPACK>& dss_handle, CrsMatrixType& A) {
13 auto values = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), A.values);
14 auto row_ptrs = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), A.graph.row_map);
15 auto col_inds = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), A.graph.entries);
16
17 auto*& symbolic = dss_handle.get_symbolic();
18 auto*& numeric = dss_handle.get_numeric();
19 auto* control = dss_handle.get_control();
20
21 umfpack_di_numeric(
22 row_ptrs.data(), col_inds.data(), values.data(), symbolic, &numeric, control, nullptr
23 );
24 }
25};
26
27} // namespace kynema::dss
Definition dss_handle.hpp:10
Definition dss_algorithm.hpp:4
Algorithm
Definition dss_algorithm.hpp:6
static void numeric(Handle< Algorithm::UMFPACK > &dss_handle, CrsMatrixType &A)
Definition dss_numeric_umfpack.hpp:12
Definition dss_numeric.hpp:8