9#include <kernel/global/vector.hpp>
10#include <kernel/global/matrix.hpp>
11#include <kernel/lafem/dense_vector.hpp>
12#include <kernel/lafem/dense_vector_blocked.hpp>
13#include <kernel/lafem/sparse_matrix_csr.hpp>
14#include <kernel/lafem/sparse_matrix_bcsr.hpp>
15#include <kernel/lafem/sparse_matrix_cscr.hpp>
16#include <kernel/util/stop_watch.hpp>
29 template<
typename MatrixB_,
typename MatrixD_>
57 template<
typename DT_,
typename IT_,
int dim_,
typename MirrorV_,
typename MirrorP_>
59 Global::
Matrix<LAFEM::SparseMatrixBCSR<DT_, IT_, dim_, 1>, MirrorV_, MirrorP_>,
60 Global::Matrix<LAFEM::SparseMatrixBCSR<DT_, IT_, 1, dim_>, MirrorP_, MirrorV_>>
64 typedef IT_ IndexType;
65 static constexpr int dim = dim_;
67 typedef MirrorV_ MirrorTypeV;
68 typedef MirrorP_ MirrorTypeP;
100 static constexpr bool is_global =
true;
101 static constexpr bool is_local =
false;
237 _diagonal_a(diagonal_a),
309 watch_init_symbolic.
reset();
310 watch_init_sym_matrix_loc.
reset();
311 watch_init_sym_pres_mirror.
reset();
312 watch_init_sym_reduced_b.
reset();
313 watch_init_sym_data_mirror.
reset();
314 watch_init_sym_neighbor_s.
reset();
315 watch_init_numeric.
reset();
316 watch_init_num_matrix_loc.
reset();
317 watch_init_num_gather_b.
reset();
318 watch_init_num_premult_da.
reset();
319 watch_init_num_neighbor_s.
reset();
321 watch_apply_matrix_loc.
reset();
322 watch_apply_neighbor_s.
reset();
335 static constexpr std::size_t nt = 14;
336 double tsum[nt], tmax[nt], tloc[nt] =
339 watch_init_sym_matrix_loc.
elapsed(),
340 watch_init_sym_pres_mirror.
elapsed(),
341 watch_init_sym_reduced_b.
elapsed(),
342 watch_init_sym_data_mirror.
elapsed(),
343 watch_init_sym_neighbor_s.
elapsed(),
345 watch_init_num_matrix_loc.
elapsed(),
346 watch_init_num_gather_b.
elapsed(),
347 watch_init_num_premult_da.
elapsed(),
348 watch_init_num_neighbor_s.
elapsed(),
350 watch_apply_matrix_loc.
elapsed(),
351 watch_apply_neighbor_s.
elapsed()
354 this->get_comm()->allreduce(tloc, tsum, nt,
Dist::op_sum);
355 this->get_comm()->allreduce(tloc, tmax, nt,
Dist::op_max);
359 const double ds = 1.0 / double(this->get_comm()->size());
360 for(std::size_t i(0); i < nt; ++i)
365 s +=
String(34,
' ') +
"Mean Time Max Time\n";
366 s += _fmt_time(tsum[0], tmax[0],
"Total Symbolic Initialization");
367 s += _fmt_time(tsum[0], tmax[0], tsum[1], tmax[1],
"Local Schur Matrix Structure");
368 s += _fmt_time(tsum[0], tmax[0], tsum[2], tmax[2],
"Pressure Mirror");
369 s += _fmt_time(tsum[0], tmax[0], tsum[3], tmax[3],
"Reduced-B Matrix Structure");
370 s += _fmt_time(tsum[0], tmax[0], tsum[4], tmax[4],
"Reduced-B Data Mirror");
371 s += _fmt_time(tsum[0], tmax[0], tsum[5], tmax[5],
"Neighbor Matrix Structure");
372 double tsym_other_sum = tsum[0] - tsum[1] - tsum[2] - tsum[3] - tsum[4] - tsum[5];
373 double tsym_other_max = tmax[0] - tmax[1] - tmax[2] - tmax[3] - tmax[4] - tmax[5];
374 s += _fmt_time(tsum[0], tmax[0], tsym_other_sum, tsym_other_max,
"Other Symbolic");
376 s += _fmt_time(tsum[6], tmax[6],
"Total Numeric Initialization");
377 s += _fmt_time(tsum[6], tmax[6], tsum[7], tmax[7],
"Local Schur Matrix Values");
378 s += _fmt_time(tsum[6], tmax[6], tsum[8], tmax[8],
"Reduced-B Gather");
379 s += _fmt_time(tsum[6], tmax[6], tsum[9], tmax[9],
"Pre-Multiply D*A");
380 s += _fmt_time(tsum[6], tmax[6], tsum[10], tmax[10],
"Neighbor Matrix Values");
381 double tnum_other_sum = tsum[6] - tsum[7] - tsum[8] - tsum[9] - tsum[10];
382 double tnum_other_max = tmax[6] - tmax[7] - tmax[8] - tmax[9] - tmax[10];
383 s += _fmt_time(tsum[6], tmax[6], tnum_other_sum, tnum_other_max,
"Other Numeric");
385 s += _fmt_time(tsum[11], tmax[11],
"Total Matrix Apply");
386 s += _fmt_time(tsum[11], tmax[11], tsum[12], tmax[12],
"Local Schur Matrix");
387 s += _fmt_time(tsum[11], tmax[11], tsum[13], tmax[13],
"Neighbor Schur Matrix");
388 double tapp_other_sum = tsum[11] - tsum[12] - tsum[13];
389 double tapp_other_max = tmax[11] - tmax[12] - tmax[13];
390 s += _fmt_time(tsum[11], tmax[11], tapp_other_sum, tapp_other_max,
"Other Apply");
425 watch_init_symbolic.
start();
434 XASSERTM(gate_p->
_ranks.empty(),
"pressure space is not discontinuous");
438 watch_init_sym_matrix_loc.
start();
445 watch_init_sym_matrix_loc.
stop();
452 this->_ranks = gate_v->
_ranks;
455 const std::size_t num_neighs = this->_ranks.size();
456 if(num_neighs <= std::size_t(0))
458 watch_init_symbolic.
stop();
466 this->_pres_mirrors.resize(num_neighs);
467 this->_data_mirrors.resize(num_neighs);
468 this->_neighbor_graphs.resize(num_neighs);
469 this->_neighbor_matrices.resize(num_neighs);
472 std::vector<Adjacency::Graph> my_graphs(num_neighs);
475 for(std::size_t i(0); i < num_neighs; ++i)
478 const MirrorTypeV& mirror_v = gate_v->
_mirrors.at(i);
481 watch_init_sym_pres_mirror.
start();
482 MirrorTypeP& mirror_p = this->_pres_mirrors.at(i);
483 this->_asm_pres_mirror(mirror_p, mirror_v, this->_matrix_b.
local());
484 watch_init_sym_pres_mirror.
stop();
487 watch_init_sym_reduced_b.
start();
488 my_graphs.at(i) = this->_asm_reduced_b( mirror_p, mirror_v, this->_matrix_b.
local());
489 watch_init_sym_reduced_b.
stop();
492 watch_init_sym_data_mirror.
start();
493 this->_data_mirrors.at(i) = this->_asm_data_mirror(mirror_p, mirror_v, this->_matrix_b.
local(), my_graphs.at(i));
494 watch_init_sym_data_mirror.
stop();
498 std::vector<std::array<Index,3>> recv_dims(num_neighs), send_dims(num_neighs);
502 for(std::size_t i(0); i < num_neighs; ++i)
504 recv_reqs[i] = comm.
irecv(recv_dims.at(i).data(), std::size_t(3), this->_ranks.at(i));
508 for(std::size_t i(0); i < num_neighs; ++i)
511 auto& sdim = send_dims.at(i);
512 sdim[0] = g.get_num_nodes_domain();
513 sdim[1] = g.get_num_nodes_image();
515 send_reqs[i] = comm.
isend(sdim.data(), std::size_t(3), this->_ranks.at(i));
519 for(std::size_t i(0u); recv_reqs.wait_any(i); )
522 auto& rdim = recv_dims.at(i);
532 for(std::size_t i(0); i < num_neighs; ++i)
534 recv_reqs[i] = comm.
irecv(this->_neighbor_graphs.at(i).get_domain_ptr(),
535 recv_dims.at(i)[0] + std::size_t(1), this->_ranks.at(i));
542 for(std::size_t i(0); i < num_neighs; ++i)
544 send_reqs[i] = comm.
isend(my_graphs.at(i).get_domain_ptr(),
545 send_dims.at(i)[0] + std::size_t(1), this->_ranks.at(i));
549 recv_reqs.wait_all();
552 for(std::size_t i(0); i < num_neighs; ++i)
554 recv_reqs[i] = comm.
irecv(this->_neighbor_graphs.at(i).get_image_idx(),
555 recv_dims.at(i)[2], this->_ranks.at(i));
562 for(std::size_t i(0); i < num_neighs; ++i)
564 send_reqs[i] = comm.
isend(my_graphs.at(i).get_image_idx(), send_dims.at(i)[2], this->_ranks.at(i));
568 recv_reqs.wait_all();
574 for(std::size_t i(0); i < num_neighs; ++i)
576 watch_init_sym_neighbor_s.
start();
587 watch_init_sym_neighbor_s.
stop();
591 watch_init_symbolic.
stop();
607 watch_init_numeric.
start();
610 watch_init_num_matrix_loc.
start();
612 _asm_local_schur_matrix(this->_matrix_s, this->_matrix_d.
local(), this->_diagonal_a.local(), this->_matrix_b.local());
613 watch_init_num_matrix_loc.
stop();
616 const std::size_t num_neighs = this->_ranks.size();
617 if(num_neighs <= std::size_t(0))
619 watch_init_numeric.
stop();
627 std::vector<BufferVectorType> recv_bufs(num_neighs), send_bufs(num_neighs);
631 for(std::size_t i(0); i < num_neighs; ++i)
634 recv_reqs[i] = comm.
irecv(recv_bufs.at(i).elements(), recv_bufs.at(i).size(), this->_ranks.at(i));
638 for(std::size_t i(0); i < num_neighs; ++i)
640 watch_init_num_gather_b.
start();
641 send_bufs.at(i) = _gather_b(this->_data_mirrors.at(i), this->_matrix_b.local());
642 watch_init_num_gather_b.
stop();
643 send_reqs[i] = comm.
isend(send_bufs.at(i).elements(), send_bufs.at(i).size(), this->_ranks.at(i));
647 watch_init_num_premult_da.
start();
648 _premult_da(this->_matrix_da, this->_matrix_d.
local(), this->_diagonal_a.local());
649 watch_init_num_premult_da.
stop();
652 for(std::size_t i(0u); recv_reqs.wait_any(i); )
654 watch_init_num_neighbor_s.
start();
655 this->_neighbor_matrices.at(i).format();
656 _asm_neighbor_schur_matrix(this->_neighbor_matrices.at(i), this->_matrix_da,
657 this->_matrix_b.get_row_gate()->_mirrors.at(i), this->_neighbor_graphs.at(i), recv_bufs.at(i));
658 watch_init_num_neighbor_s.
stop();
663 watch_init_numeric.
stop();
701 Index& owned_dof_count,
Index& owned_num_nzes,
Index& global_num_nzes)
const
704 global_dof_offset =
Index(0);
705 global_dof_count = owned_dof_count = _matrix_s.
rows();
709 for(
const auto& x : _neighbor_matrices)
710 owned_num_nzes += x.used_elements();
711 global_num_nzes = owned_num_nzes;
716 this->get_comm()->exscan(&owned_dof_count, &global_dof_offset, std::size_t(1),
Dist::op_sum);
717 this->get_comm()->allreduce(&owned_dof_count, &global_dof_count, std::size_t(1),
Dist::op_sum);
718 this->get_comm()->allreduce(&owned_num_nzes, &global_num_nzes, std::size_t(1),
Dist::op_sum);
741 template<
typename RPT_,
typename CIT_>
745 static constexpr std::uint64_t max_rpt = 1ull << (8*
sizeof(RPT_) - 1);
746 static constexpr std::uint64_t max_cit = 1ull << (8*
sizeof(CIT_) - 1);
758 const IndexType* row_ptr_s = _matrix_s.
row_ptr();
759 const IndexType* col_idx_s = _matrix_s.
col_ind();
761 FEAT_PRAGMA_OMP(parallel
for)
762 for(
Index i = 0; i <= n; ++i)
764 ASSERTM(std::uint64_t(row_ptr_s[i]) < max_rpt,
"row-pointer exceeds RPT_ type range!");
765 row_ptr[i] = RPT_(row_ptr_s[i]);
768 FEAT_PRAGMA_OMP(parallel
for)
769 for(
Index i = 0; i < m; ++i)
771 ASSERTM(std::uint64_t(col_idx_s[i]) < max_cit,
"column-index exceeds CIT_ type range!");
772 col_idx[i] = CIT_(col_idx_s[i]);
781 const std::size_t num_neighs = this->_ranks.size();
790 std::vector<std::vector<IndexType>> recv_dofs(num_neighs), send_dofs(num_neighs);
794 for(std::size_t i(0); i < num_neighs; ++i)
796 recv_dofs.at(i).resize(_neighbor_graphs.at(i).get_num_nodes_image());
797 recv_reqs[i] = comm.
irecv(recv_dofs.at(i).data(), recv_dofs.at(i).size(), this->_ranks.at(i));
801 for(std::size_t i(0); i < num_neighs; ++i)
803 const Index num_idx = _pres_mirrors.at(i).num_indices();
804 const IndexType* pidx = _pres_mirrors.at(i).indices();
805 send_dofs.at(i).resize(num_idx);
806 IndexType* sidx = send_dofs.at(i).data();
807 for(
Index k(0); k < num_idx; ++k)
808 sidx[k] = global_dof_offset + pidx[k];
809 send_reqs[i] = comm.
isend(send_dofs.at(i).data(), send_dofs.at(i).size(), this->_ranks.at(i));
814 const IndexType* row_ptr_s = _matrix_s.
row_ptr();
815 const IndexType* col_idx_s = _matrix_s.
col_ind();
818 std::vector<IndexType> row_aux(num_rows, IndexType(0));
819 for(
Index i(0); i < num_rows; ++i)
820 row_aux[i] = (row_ptr_s[i+1] - row_ptr_s[i]);
822 for(
const auto& x : _neighbor_matrices)
824 const Index used_rows = x.used_rows();
825 const IndexType* row_ptr_x = x.row_ptr();
826 const IndexType* row_idx_x = x.row_numbers();
827 for(
Index i(0); i < used_rows; ++i)
828 row_aux[row_idx_x[i]] += (row_ptr_x[i+1] - row_ptr_x[i]);
832 row_ptr[0] = RPT_(0);
833 for(
Index i(0); i < num_rows; ++i)
835 row_ptr[i+1] = row_ptr[i] + row_aux[i];
836 row_aux[i] = IndexType(row_ptr[i]);
847 std::map<int, std::size_t> neigh_map_l, neigh_map_h;
848 for(std::size_t ineigh(0); ineigh < num_neighs; ++ineigh)
850 if(_ranks.at(ineigh) < comm.
rank())
851 neigh_map_l.emplace(_ranks.at(ineigh), ineigh);
853 neigh_map_h.emplace(_ranks.at(ineigh), ineigh);
857 recv_reqs.wait_all();
860 for(
auto it = neigh_map_l.begin(); it != neigh_map_l.end(); ++it)
862 std::size_t ineigh = it->second;
863 const Index used_rows = _neighbor_matrices.at(ineigh).used_rows();
864 const IndexType* row_ptr_x = _neighbor_matrices.at(ineigh).row_ptr();
865 const IndexType* row_idx_x = _neighbor_matrices.at(ineigh).row_numbers();
866 const IndexType* col_idx_x = _neighbor_matrices.at(ineigh).col_ind();
867 const IndexType* dof_idx_x = recv_dofs.at(ineigh).data();
868 for(
Index i(0); i < used_rows; ++i)
870 IndexType& k = row_aux[row_idx_x[i]];
871 for(IndexType j(row_ptr_x[i]); j < row_ptr_x[i + 1]; ++j, ++k)
872 col_idx[k] = CIT_(dof_idx_x[col_idx_x[j]]);
877 for(
Index i(0); i < num_rows; ++i)
879 IndexType k = row_aux[i];
880 for(IndexType j(row_ptr_s[i]); j < row_ptr_s[i + 1]; ++j, ++k)
881 col_idx[k] = CIT_(global_dof_offset + col_idx_s[j]);
886 for(
auto it = neigh_map_h.begin(); it != neigh_map_h.end(); ++it)
888 std::size_t ineigh = it->second;
889 const Index used_rows = _neighbor_matrices.at(ineigh).used_rows();
890 const IndexType* row_ptr_x = _neighbor_matrices.at(ineigh).row_ptr();
891 const IndexType* row_idx_x = _neighbor_matrices.at(ineigh).row_numbers();
892 const IndexType* col_idx_x = _neighbor_matrices.at(ineigh).col_ind();
893 const IndexType* dof_idx_x = recv_dofs.at(ineigh).data();
894 for(
Index i(0); i < used_rows; ++i)
896 IndexType& k = row_aux[row_idx_x[i]];
897 for(IndexType j(row_ptr_x[i]); j < row_ptr_x[i + 1]; ++j, ++k)
898 col_idx[k] = CIT_(dof_idx_x[col_idx_x[j]]);
907 for(
Index i = 0; i < num_rows; ++i)
909 for(RPT_ j(row_ptr[i]); j + 1 < row_ptr[i + 1]; ++j)
911 ASSERT(col_idx[j] < col_idx[j+1]);
932 template<
typename DTV_,
typename RPT_,
typename CIT_>
939 const DataType* val_s = _matrix_s.
val();
941 FEAT_PRAGMA_OMP(parallel
for)
942 for(
Index i = 0; i < num_nzes; ++i)
943 val[i] = DTV_(val_s[i]);
952 const IndexType* row_ptr_s = _matrix_s.
row_ptr();
953 const DataType* val_s = _matrix_s.
val();
956 std::vector<IndexType> row_aux(num_rows);
959 for(
Index i(0); i < num_rows; ++i)
960 row_aux[i] = IndexType(row_ptr[i]);
963 const int my_rank = this->get_comm()->rank();
966 std::map<int, std::size_t> neigh_map_l, neigh_map_h;
967 for(std::size_t ineigh(0); ineigh < _ranks.size(); ++ineigh)
969 if(_ranks.at(ineigh) < my_rank)
970 neigh_map_l.emplace(_ranks.at(ineigh), ineigh);
972 neigh_map_h.emplace(_ranks.at(ineigh), ineigh);
976 for(
auto it = neigh_map_l.begin(); it != neigh_map_l.end(); ++it)
978 std::size_t ineigh = it->second;
979 const Index used_rows = _neighbor_matrices.at(ineigh).used_rows();
980 const IndexType* row_ptr_x = _neighbor_matrices.at(ineigh).row_ptr();
981 const IndexType* row_idx_x = _neighbor_matrices.at(ineigh).row_numbers();
982 const DataType* val_x = _neighbor_matrices.at(ineigh).val();
983 for(
Index i(0); i < used_rows; ++i)
985 IndexType& k = row_aux[row_idx_x[i]];
986 for(IndexType j(row_ptr_x[i]); j < row_ptr_x[i + 1]; ++j, ++k)
987 val[k] = DTV_(val_x[j]);
992 for(
Index i(0); i < num_rows; ++i)
994 Index k = row_aux[i];
995 for(
Index j(row_ptr_s[i]); j < row_ptr_s[i+1]; ++j, ++k)
996 val[k] = DTV_(val_s[j]);
1001 for(
auto it = neigh_map_h.begin(); it != neigh_map_h.end(); ++it)
1003 std::size_t ineigh = it->second;
1004 const Index used_rows = _neighbor_matrices.at(ineigh).used_rows();
1005 const IndexType* row_ptr_x = _neighbor_matrices.at(ineigh).row_ptr();
1006 const IndexType* row_idx_x = _neighbor_matrices.at(ineigh).row_numbers();
1007 const DataType* val_x = _neighbor_matrices.at(ineigh).val();
1008 for(
Index i(0); i < used_rows; ++i)
1010 IndexType& k = row_aux[row_idx_x[i]];
1011 for(IndexType j(row_ptr_x[i]); j < row_ptr_x[i + 1]; ++j, ++k)
1012 val[k] = DTV_(val_x[j]);
1018 for(
Index i(0); i < num_rows; ++i)
1020 ASSERT(row_aux[i] == IndexType(row_ptr[i+1]));
1066 const Index num_dof_mir_v = mirror_v.num_indices();
1067 const IndexType* velo_idx = mirror_v.indices();
1068 const IndexType* row_ptr = matrix_b.
row_ptr();
1069 const IndexType* col_idx = matrix_b.
col_ind();
1073 std::set<IndexType> dof_set;
1074 for(
Index i(0); i < num_dof_mir_v; ++i)
1076 const Index irow = velo_idx[i];
1077 for(IndexType j(row_ptr[irow]); j < row_ptr[irow+1]; ++j)
1078 dof_set.insert(col_idx[j]);
1082 mirror_p = MirrorTypeP(matrix_b.
columns(),
Index(dof_set.size()));
1083 IndexType* pidx = mirror_p.indices();
1084 for(
auto it = dof_set.begin(); it != dof_set.end(); ++it, ++pidx)
1106 const Index num_dof_mir_v = mirror_v.num_indices();
1107 const Index num_dof_mir_p = mirror_p.num_indices();
1108 const IndexType* velo_idx = mirror_v.indices();
1109 const IndexType* pres_idx = mirror_p.indices();
1110 const IndexType* row_ptr = matrix_b.
row_ptr();
1111 const IndexType* col_idx = matrix_b.
col_ind();
1115 for(
Index i(0); i < num_dof_mir_v; ++i)
1117 const Index irow = velo_idx[i];
1118 num_red_nzes +=
Index(row_ptr[irow+1] - row_ptr[irow]);
1127 dom_ptr[0] =
Index(0);
1128 for(
Index i(0); i < num_dof_mir_v; ++i)
1131 const IndexType irow = velo_idx[i];
1133 for(IndexType j(row_ptr[irow]), k(dom_ptr[i]); j < row_ptr[irow+1]; ++j, ++k)
1136 img_idx[k] = ~IndexType(0);
1139 for(
Index l(0); l < num_dof_mir_p; ++l)
1141 if(col_idx[j] == pres_idx[l])
1148 ASSERT(img_idx[k] != ~IndexType(0));
1151 dom_ptr[i+1] = dom_ptr[i] + (row_ptr[irow+1] - row_ptr[irow]);
1180 const Index num_dof_mir_v = mirror_v.num_indices();
1181 const IndexType* velo_idx = mirror_v.indices();
1182 const IndexType* pres_idx = mirror_p.indices();
1183 const IndexType* row_ptr = matrix_b.
row_ptr();
1184 const IndexType* col_idx = matrix_b.
col_ind();
1190 IndexType* dat_idx = data_mirror.indices();
1193 for(
Index i(0); i < num_dof_mir_v; ++i)
1196 const IndexType irow = velo_idx[i];
1199 for(
Index k(dom_ptr[i]); k < dom_ptr[i+1]; ++k)
1202 dat_idx[k] = ~IndexType(0);
1205 const Index jcol = pres_idx[img_idx[k]];
1208 for(IndexType j(row_ptr[irow]); j < row_ptr[irow + 1]; ++j)
1210 if(jcol == col_idx[j])
1217 ASSERT(dat_idx[k] != ~IndexType(0));
1239 const Index num_idx = data_mirror.num_indices();
1240 const IndexType* idx = data_mirror.indices();
1246 for(
Index i(0); i < num_idx; ++i)
1248 buf_val[i] = mat_val[idx[i]];
1258 for(
int i(0); i < dim; ++i)
1259 da(0, i) = val_d(0, i) * val_a(i);
1266 DataType s = DataType(0);
1267 for(
int i(0); i < dim; ++i)
1268 s += val_da(0, i) * val_b(i, 0);
1275 for(
int i(0); i < dim; ++i)
1276 val_da(i, 0) = val_d(0, i) * val_a(i);
1282 DataType s = DataType(0);
1283 for(
int i(0); i < dim; ++i)
1284 s += val_da(i, 0) * val_b(i, 0);
1305 const IndexType* row_ptr = mat_d.
row_ptr();
1306 const IndexType* col_idx = mat_d.
col_ind();
1307 const IndexType* row_ptr_da = mat_da.
row_ptr();
1314 std::vector<Index> ptr(num_cols);
1315 for(
Index i(0); i < num_cols; ++i)
1316 ptr[i] = row_ptr_da[i];
1319 for(
Index i(0); i < num_rows; ++i)
1321 for(
Index j(row_ptr[i]); j < row_ptr[i + 1]; ++j)
1323 const Index col = col_idx[j];
1324 _mat_mult_d_a(val_da[ptr[col]++], val_d[j], val_a[col]);
1350 DataType* data_s = s.
val();
1354 const IndexType* row_ptr_s = s.
row_ptr();
1355 const IndexType* col_idx_s = s.
col_ind();
1356 const IndexType* row_ptr_d = d.
row_ptr();
1357 const IndexType* col_idx_d = d.
col_ind();
1358 const IndexType* row_ptr_b = b.
row_ptr();
1359 const IndexType* col_idx_b = b.
col_ind();
1362 for(IndexType i(0); i < IndexType(s.
rows()); ++i)
1365 for(IndexType ik(row_ptr_d[i]); ik < row_ptr_d[i+1]; ++ik)
1368 const IndexType k = col_idx_d[ik];
1371 const ValueTypeD val_da = _mat_mult_d_a(data_d[ik], data_a[k]);
1374 for(IndexType ij(row_ptr_s[i]), kj(row_ptr_b[k]); kj < row_ptr_b[k+1]; ++ij)
1376 ASSERT(ij < row_ptr_s[i+1]);
1377 ASSERT(col_idx_s[ij] <= col_idx_b[kj]);
1378 if(col_idx_s[ij] == col_idx_b[kj])
1380 data_s[ij] += _mat_mult_da_b(val_da, data_b[kj]);
1412 XASSERT(graph_b.get_num_nodes_domain() == mirror_v.num_indices());
1417 DataType* data_s = s.
val();
1418 const IndexType* row_ptr_s = s.
row_ptr();
1420 const IndexType* col_idx_s = s.
col_ind();
1426 const IndexType* col_ptr_da = da.
row_ptr();
1427 const IndexType* row_idx_da = da.
col_ind();
1429 const Index num_mir_idx = mirror_v.num_indices();
1430 const IndexType* mir_idx = mirror_v.indices();
1437 for(
Index l(0); l < num_mir_idx; ++l)
1440 const Index k = mir_idx[l];
1443 for(
Index ik(col_ptr_da[k]), si(0); (ik < col_ptr_da[k + 1]) && (si < used_rows_s); )
1446 if(row_idx_da[ik] < row_idx_s[si])
1452 if(row_idx_s[si] < row_idx_da[ik])
1460 for(IndexType ij(row_ptr_s[si]), kj(dom_ptr_b[l]); kj < dom_ptr_b[l+1]; ++ij)
1462 ASSERT(ij < row_ptr_s[si+1]);
1463 ASSERT(col_idx_s[ij] <= img_idx_b[kj]);
1464 if(col_idx_s[ij] == img_idx_b[kj])
1466 data_s[ij] += _mat_mult_da_b(data_da[ik], data_b[kj]);
1499 const std::size_t num_neighs = this->_ranks.size();
1502 if(num_neighs <= std::size_t(0))
1505 watch_apply_matrix_loc.
start();
1507 this->_matrix_s.
apply(r, x);
1509 this->_matrix_s.
apply(r, x, y, alpha);
1510 watch_apply_matrix_loc.
stop();
1518 std::vector<BufferVectorType> recv_bufs(num_neighs), send_bufs(num_neighs);
1522 for(std::size_t i(0); i < num_neighs; ++i)
1524 recv_bufs.at(i) =
BufferVectorType(this->_neighbor_matrices.at(i).columns());
1525 recv_reqs[i] = comm.
irecv(recv_bufs.at(i).elements(), recv_bufs.at(i).size(), this->_ranks.at(i));
1529 for(std::size_t i(0); i < num_neighs; ++i)
1531 send_bufs.at(i) =
BufferVectorType(this->_pres_mirrors.at(i).num_indices());
1532 this->_pres_mirrors.at(i).gather(send_bufs.at(i), x);
1533 send_reqs[i] = comm.
isend(send_bufs.at(i).elements(), send_bufs.at(i).size(), this->_ranks.at(i));
1537 watch_apply_matrix_loc.
start();
1539 this->_matrix_s.
apply(r, x);
1541 this->_matrix_s.
apply(r, x, y, alpha);
1542 watch_apply_matrix_loc.
stop();
1545 for(std::size_t i(0u); recv_reqs.wait_any(i); )
1547 watch_apply_neighbor_s.
start();
1548 this->_neighbor_matrices.at(i).apply(r, recv_bufs.at(i), r, (only_Ax ? DataType(1) : alpha));
1549 watch_apply_neighbor_s.
stop();
#define ASSERT(expr)
Debug-Assertion macro definition.
#define ASSERTM(expr, msg)
Debug-Assertion macro definition with custom message.
#define XASSERT(expr)
Assertion macro definition.
#define XASSERTM(expr, msg)
Assertion macro definition with custom message.
Adjacency Graph implementation.
void sort_indices()
Sorts the image indices to non-descending order.
Index * get_domain_ptr()
Returns the domain pointer array.
Index * get_image_idx()
Returns the image node index array.
Index get_num_indices() const
Returns the total number indices.
Request irecv(void *buffer, std::size_t count, const Datatype &datatype, int source, int tag=0) const
Nonblocking Receive.
Request isend(const void *buffer, std::size_t count, const Datatype &datatype, int dest, int tag=0) const
Nonblocking Send.
int rank() const
Returns the rank of this process in this communicator.
Communication Request vector class.
void wait_all()
Blocks until all active requests are fulfilled.
Global gate implementation.
const Dist::Comm * get_comm() const
Returns a const pointer to the underlying communicator.
std::vector< Mirror_ > _mirrors
vector mirrors
std::vector< int > _ranks
communication ranks
Global Matrix wrapper class template.
VectorTypeR create_vector_r() const
Creates and returns a new R-compatible global vector object.
VectorTypeL create_vector_l() const
Creates and returns a new L-compatible global vector object.
const GateRowType * get_row_gate() const
Returns a const pointer to the internal row gate of the matrix.
const Dist::Comm * get_comm() const
Returns a const pointer to the internal communicator of the gates of the matrix.
LocalMatrix_ & local()
Returns a reference to the internal local LAFEM matrix object.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::adp_upload_symbolic void adp_upload_symbolic(RPT_ *row_ptr, CIT_ *col_idx, Index global_dof_offset) const
Assembles the matrix structure of an algebraic DOF partitioned matrix.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_mat_mult_d_a static ValueTypeD _mat_mult_d_a(const ValueTypeD &val_d, const ValueTypeA &val_a)
auxiliary function for _asm_local_schur_matrix: multiply two values D*A
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_neighbor_graphs std::vector< Adjacency::Graph > _neighbor_graphs
Neighbor B-matrix adjacency graphs.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_asm_data_mirror static MirrorTypeP _asm_data_mirror(const MirrorTypeP &mirror_p, const MirrorTypeV &mirror_v, const LocalMatrixTypeB &matrix_b, const Adjacency::Graph &graph)
Auxiliary Function: computes a data mirror from B to B'.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_fmt_time static String _fmt_time(double tsum_total, double tmax_total, double tsum, double tmax, String st)
auxiliary function: format a time line
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_asm_reduced_b static Adjacency::Graph _asm_reduced_b(const MirrorTypeP &mirror_p, const MirrorTypeV &mirror_v, const LocalMatrixTypeB &matrix_b)
Auxiliary Function: reduces the matrix B to B'.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_matrix_d const GlobalMatrixTypeD & _matrix_d
the velocity-divergence matrix D
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::adp_upload_numeric void adp_upload_numeric(DTV_ *val, const RPT_ *row_ptr, const CIT_ *col_idx) const
Uploads the numeric values of the matrix into an ADP matrix.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_data_mirrors std::vector< MirrorTypeP > _data_mirrors
B-matrix data mirrors.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::watch_apply_matrix_loc StopWatch watch_apply_matrix_loc
local Schur-Matrix apply time
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_premult_da static void _premult_da(LocalMatrixTypeB &mat_da, const LocalMatrixTypeD &mat_d, const LocalVectorTypeV &mat_a)
Auxiliary Function: Computes the product (D*A) and stores the result in a CSC matrix.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::init_numeric void init_numeric()
Performs the numeric initialization of the matrix.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_asm_pres_mirror static void _asm_pres_mirror(MirrorTypeP &mirror_p, const MirrorTypeV &mirror_v, const LocalMatrixTypeB &matrix_b)
Auxiliary function: assembles a pressure mirror from a velocity mirror and the B-matrix.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::~PMDCDSCMatrix virtual ~PMDCDSCMatrix()
virtual destructor
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_matrix_s LocalMatrixTypeS _matrix_s
The local Schur-complement matrix.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::PMDCDSCMatrix PMDCDSCMatrix(const GlobalVectorTypeV &diagonal_a, const GlobalMatrixTypeB &matrix_b, const GlobalMatrixTypeD &matrix_d)
Constructor.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::watch_apply StopWatch watch_apply
total apply time
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::init_symbolic void init_symbolic()
Performs the symbolic initialization of the matrix.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_matrix_b const GlobalMatrixTypeB & _matrix_b
the pressure-gradient matrix B
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::get_comm const Dist::Comm * get_comm() const
Returns a pointer to the underlying communicator.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_asm_local_schur_matrix static void _asm_local_schur_matrix(LocalMatrixTypeS &s, const LocalMatrixTypeD &d, const LocalVectorTypeV &a, const LocalMatrixTypeB &b)
Assembles the local Schur-Matrix S = (D*A*B)
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_mat_mult_da_b static DataType _mat_mult_da_b(const ValueTypeB &val_da, const ValueTypeB &val_b)
auxiliary function for _asm_neighbor_schur_matrix: multiply two values DA*B with DA in transposed for...
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::apply void apply(VectorTypeL &r, const VectorTypeR &x) const
Calculate .
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::format_timings String format_timings() const
Returns a string that contains the formatted timing statistics.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_mat_mult_da_b static DataType _mat_mult_da_b(const ValueTypeD &val_da, const ValueTypeB &val_b)
auxiliary function for _asm_local_schur_matrix: multiply two values DA*B
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::watch_init_num_neighbor_s StopWatch watch_init_num_neighbor_s
neighbor Schur-matrix numeric assembly time
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_mat_mult_d_a static void _mat_mult_d_a(ValueTypeB &val_da, const ValueTypeD &val_d, const ValueTypeA &val_a)
auxiliary function for _asm_neighbor_schur_matrix: multiply two values D*A and store in transposed fo...
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::create_vector_l VectorTypeL create_vector_l() const
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::watch_init_sym_neighbor_s StopWatch watch_init_sym_neighbor_s
neighbor Schur-Matrix symbolic assembly time
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::GateColType GlobalMatrixTypeB::GateColType GateColType
The column-gate type (used by SFINAE)
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_neighbor_matrices std::vector< NeighMatrixTypeS > _neighbor_matrices
Pre-multiplied neighbor Schur-complement matrices.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_diagonal_a const GlobalVectorTypeV & _diagonal_a
the diagonal matrix a (stored as a vector)
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::get_local_schur_matrix const LocalMatrixTypeS & get_local_schur_matrix() const
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::watch_init_symbolic StopWatch watch_init_symbolic
total symbolic/numeric init time
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::watch_init_num_gather_b StopWatch watch_init_num_gather_b
reduced-B matrix data gather time
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::watch_init_numeric StopWatch watch_init_numeric
total numeric init time
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::watch_init_sym_data_mirror StopWatch watch_init_sym_data_mirror
reduced B-matrix data mirror assembly time
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::extract_diag GlobalVectorTypeP extract_diag() const
Extracts the main diagonal.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::watch_init_num_premult_da StopWatch watch_init_num_premult_da
pre-multiply D*A time
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_asm_neighbor_schur_matrix static void _asm_neighbor_schur_matrix(NeighMatrixTypeS &s, const LocalMatrixTypeB &da, const MirrorTypeV &mirror_v, const Adjacency::Graph &graph_b, const BufferVectorType &buffer_b)
Assembles a neighbor Schur-Matrix S_k = (D*A*M_k^T*B_k)
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::init void init()
Performs both symbolic and numeric initialization of the matrix.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::GateRowType GlobalMatrixTypeD::GateRowType GateRowType
The row-gate type (used by SFINAE)
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::watch_apply_neighbor_s StopWatch watch_apply_neighbor_s
neighbor Matrix apply time
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::create_vector_r VectorTypeR create_vector_r() const
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::watch_init_sym_pres_mirror StopWatch watch_init_sym_pres_mirror
pressure mirror assembly time
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::watch_init_num_matrix_loc StopWatch watch_init_num_matrix_loc
local Schur-Matrix numeric assembly time
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::apply void apply(VectorTypeL &r, const VectorTypeR &x, const VectorTypeL &y, const DataType alpha=DataType(1)) const
Calculate .
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::adp_compute_counts void adp_compute_counts(Index &global_dof_offset, Index &global_dof_count, Index &owned_dof_count, Index &owned_num_nzes, Index &global_num_nzes) const
Compute the counts required for an algebraic dof partitioning of this matrix.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::watch_init_sym_reduced_b StopWatch watch_init_sym_reduced_b
reduced B-matrix symbolic assembly time
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_matrix_da LocalMatrixTypeB _matrix_da
Pre-Multiplied transposed matrix-product (D*A)^T.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_fmt_time static String _fmt_time(double tsum_total, double tmax_total, String st)
auxiliary function: format a time line
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_pres_mirrors std::vector< MirrorTypeP > _pres_mirrors
Pressure DOF mirrors.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::reset_timings void reset_timings()
Resets the internal stop watches used for collecting timing statistics.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::extract_diag void extract_diag(GlobalVectorTypeP &vec_diag) const
Extracts the main diagonal.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::watch_init_sym_matrix_loc StopWatch watch_init_sym_matrix_loc
local Schur-Matrix symbolic assembly time
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_apply void _apply(LocalVectorTypeP &r, const LocalVectorTypeP &x, const LocalVectorTypeP &y, const DataType alpha, bool only_Ax) const
Applies this matrix onto a vector.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_gather_b static BufferVectorType _gather_b(const MirrorTypeP &data_mirror, const LocalMatrixTypeB &matrix_b)
Auxiliary Function: Gathers the data array from B to B' using the data mirror.
FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_ranks std::vector< int > _ranks
neighbor process ranks
Pre-Multiplied Discontinuous Diagonal Schur-Complement Matrix.
Global vector wrapper class template.
const Dist::Comm * get_comm() const
Returns a const pointer to the internal communicator of the gate of the vector.
LocalVector_ & local()
Returns a reference to the internal local LAFEM vector object.
void format(DT_ value=DT_(0))
Reset all elements of the container to a given value or zero if missing.
Blocked Dense data vector class template.
auto elements() const -> const typename Intern::DenseVectorBlockedPerspectiveHelper< DT_, BlockSize_, perspective_ >::Type *
Retrieve a pointer to the data array.
Index size() const
The number of elements.
Dense data vector class template.
DT_ * elements()
Get a pointer to the data array.
CSR based blocked sparse matrix.
Index rows() const
Retrieve matrix row count.
IT_ * col_ind()
Retrieve column indices array.
IT_ * row_ptr()
Retrieve row start index array.
Index columns() const
Retrieve matrix column count.
Index used_elements() const
Retrieve non zero element count.
auto val() const -> const typename Intern::BCSRPerspectiveHelper< DT_, BlockHeight_, BlockWidth_, perspective_ >::Type *
Retrieve non zero element array.
CSCR based sparse matrix.
IT_ * col_ind()
Retrieve column indices array.
IT_ * row_numbers()
Retrieve row numbers of non zero rows.
Index columns() const
Retrieve matrix column count.
Index rows() const
Retrieve matrix row count.
DT_ * val()
Retrieve non zero element array.
Index used_rows() const
Retrieve used matrix non zero row count.
IT_ * row_ptr()
Retrieve row start index array.
IT_ * col_ind()
Retrieve column indices array.
DT_ * val()
Retrieve non zero element array.
Index rows() const
Retrieve matrix row count.
Index columns() const
Retrieve matrix column count.
void extract_diag(VectorTypeL &diag, DenseVector< IT_, IT_ > &diag_indices) const
extract main diagonal vector from matrix
void apply(DenseVector< DT_, IT_ > &r, const DenseVector< DT_, IT_ > &x) const
Calculate .
Index used_elements() const
Retrieve non zero element count.
IT_ * row_ptr()
Retrieve row start index array.
double elapsed() const
Returns the total elapsed time in seconds.
void start()
Starts the stop-watch.
void reset()
Resets the elapsed time.
void stop()
Stops the stop-watch and increments elapsed time.
String class implementation.
String pad_back(size_type len, char c=' ') const
Pads the back of the string up to a desired length.
Tiny Matrix class template.
Tiny Vector class template.
@ injectify_sorted
Render-Injectified mode, sort image indices.
@ injectify_transpose
Render-Injectified-Transpose mode.
const Operation op_max(MPI_MAX)
Operation wrapper for MPI_MAX.
const Operation op_sum(MPI_SUM)
Operation wrapper for MPI_SUM.
T_ abs(T_ x)
Returns the absolute value.
String stringify_fp_fix(DataType_ value, int precision=0, int width=0, bool sign=false)
Prints a floating point value to a string in fixed-point notation.
std::uint64_t Index
Index data type.