13 typename Policy::gidx_t &startRow,
14 typename Policy::gidx_t &endRow,
15 typename Policy::gidx_t &startCol,
16 typename Policy::gidx_t &endCol,
17 std::vector<typename Policy::lidx_t> &rs_d,
18 std::vector<typename Policy::gidx_t> &cols_d,
19 std::vector<typename Policy::scalar_t> &coeffs_d,
20 std::vector<typename Policy::lidx_t> &rs_od,
21 std::vector<typename Policy::gidx_t> &cols_od,
22 std::vector<typename Policy::scalar_t> &coeffs_od )
24 using gidx_t =
typename Policy::gidx_t;
25 using lidx_t =
typename Policy::lidx_t;
26 using scalar_t =
typename Policy::scalar_t;
30 auto lDOF = matrix->getLeftDOFManager();
31 auto rDOF = matrix->getRightDOFManager();
33 startRow =
static_cast<gidx_t
>( rDOF->beginDOF() );
34 endRow =
static_cast<gidx_t
>( rDOF->endDOF() );
35 startCol =
static_cast<gidx_t
>( lDOF->beginDOF() );
36 endCol =
static_cast<gidx_t
>( lDOF->endDOF() );
43 for (
auto row = startRow; row < endRow; ++row ) {
45 std::vector<size_t> rcols;
46 std::vector<scalar_t> rvals;
48 matrix->getRowByGlobalID( row, rcols, rvals );
51 lidx_t nnzd = 0, nnzod = 0;
52 for (
size_t i = 0; i < rcols.size(); ++i ) {
53 const auto col =
static_cast<gidx_t
>( rcols[i] );
54 if ( startCol <= col && col < endCol ) {
56 cols_d.push_back( col );
57 coeffs_d.push_back(
static_cast<scalar_t
>( rvals[i] ) );
60 cols_od.push_back( col );
61 coeffs_od.push_back(
static_cast<scalar_t
>( rvals[i] ) );
64 const lidx_t prev_rs_d = rs_d.back();
65 const lidx_t prev_rs_od = rs_od.back();
66 rs_d.push_back( prev_rs_d + nnzd );
67 rs_od.push_back( prev_rs_od + nnzod );
void transformDofToCSR(std::shared_ptr< Matrix > matrix, typename Policy::gidx_t &startRow, typename Policy::gidx_t &endRow, typename Policy::gidx_t &startCol, typename Policy::gidx_t &endCol, std::vector< typename Policy::lidx_t > &rs_d, std::vector< typename Policy::gidx_t > &cols_d, std::vector< typename Policy::scalar_t > &coeffs_d, std::vector< typename Policy::lidx_t > &rs_od, std::vector< typename Policy::gidx_t > &cols_od, std::vector< typename Policy::scalar_t > &coeffs_od)