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();
717 glob_dof_offset =
Index(0);
718 glob_dof_count = _matrix_s.
rows();
725 const std::size_t num_neighs = this->_ranks.size();
728 const Index num_loc_dofs = _matrix_s.
rows();
741 std::vector<std::vector<IndexType>> recv_dofs(num_neighs), send_dofs(num_neighs);
745 for(std::size_t i(0); i < num_neighs; ++i)
747 recv_dofs.at(i).resize(_neighbor_graphs.at(i).get_num_nodes_image());
748 recv_reqs[i] = comm.
irecv(recv_dofs.at(i).data(), recv_dofs.at(i).size(), this->_ranks.at(i));
752 for(std::size_t i(0); i < num_neighs; ++i)
754 const Index num_idx = _pres_mirrors.at(i).num_indices();
755 const IndexType* pidx = _pres_mirrors.at(i).indices();
756 send_dofs.at(i).resize(num_idx);
757 IndexType* sidx = send_dofs.at(i).data();
758 for(
Index k(0); k < num_idx; ++k)
759 sidx[k] = glob_dof_offset + pidx[k];
760 send_reqs[i] = comm.
isend(send_dofs.at(i).data(), send_dofs.at(i).size(), this->_ranks.at(i));
764 const Index num_rows = num_loc_dofs;
765 const IndexType* row_ptr_s = _matrix_s.
row_ptr();
766 const IndexType* col_idx_s = _matrix_s.
col_ind();
770 std::vector<IndexType> row_aux(num_rows, IndexType(0));
771 for(
Index i(0); i < num_rows; ++i)
772 row_aux[i] = (row_ptr_s[i+1] - row_ptr_s[i]);
774 for(
const auto& x : _neighbor_matrices)
776 num_nzes += x.used_elements();
777 const Index used_rows = x.used_rows();
778 const IndexType* row_ptr_x = x.row_ptr();
779 const IndexType* row_idx_x = x.row_numbers();
780 for(
Index i(0); i < used_rows; ++i)
781 row_aux[row_idx_x[i]] += (row_ptr_x[i+1] - row_ptr_x[i]);
788 IndexType* row_ptr_g = matrix_g.
row_ptr();
789 IndexType* col_idx_g = matrix_g.
col_ind();
792 row_ptr_g[0] = IndexType(0);
793 for(
Index i(0); i < num_rows; ++i)
795 row_ptr_g[i+1] = row_ptr_g[i] + row_aux[i];
796 row_aux[i] = row_ptr_g[i];
807 std::map<int, std::size_t> neigh_map_l, neigh_map_h;
808 for(std::size_t ineigh(0); ineigh < num_neighs; ++ineigh)
810 if(_ranks.at(ineigh) < comm.
rank())
811 neigh_map_l.emplace(_ranks.at(ineigh), ineigh);
813 neigh_map_h.emplace(_ranks.at(ineigh), ineigh);
817 recv_reqs.wait_all();
820 for(
auto it = neigh_map_l.begin(); it != neigh_map_l.end(); ++it)
822 std::size_t ineigh = it->second;
823 const Index used_rows = _neighbor_matrices.at(ineigh).used_rows();
824 const IndexType* row_ptr_x = _neighbor_matrices.at(ineigh).row_ptr();
825 const IndexType* row_idx_x = _neighbor_matrices.at(ineigh).row_numbers();
826 const IndexType* col_idx_x = _neighbor_matrices.at(ineigh).col_ind();
827 const IndexType* dof_idx_x = recv_dofs.at(ineigh).data();
828 for(
Index i(0); i < used_rows; ++i)
830 IndexType& k = row_aux[row_idx_x[i]];
831 for(IndexType j(row_ptr_x[i]); j < row_ptr_x[i + 1]; ++j, ++k)
832 col_idx_g[k] = dof_idx_x[col_idx_x[j]];
837 for(
Index i(0); i < num_rows; ++i)
839 IndexType k = row_aux[i];
840 for(IndexType j(row_ptr_s[i]); j < row_ptr_s[i + 1]; ++j, ++k)
841 col_idx_g[k] = glob_dof_offset + col_idx_s[j];
846 for(
auto it = neigh_map_h.begin(); it != neigh_map_h.end(); ++it)
848 std::size_t ineigh = it->second;
849 const Index used_rows = _neighbor_matrices.at(ineigh).used_rows();
850 const IndexType* row_ptr_x = _neighbor_matrices.at(ineigh).row_ptr();
851 const IndexType* row_idx_x = _neighbor_matrices.at(ineigh).row_numbers();
852 const IndexType* col_idx_x = _neighbor_matrices.at(ineigh).col_ind();
853 const IndexType* dof_idx_x = recv_dofs.at(ineigh).data();
854 for(
Index i(0); i < used_rows; ++i)
856 IndexType& k = row_aux[row_idx_x[i]];
857 for(IndexType j(row_ptr_x[i]); j < row_ptr_x[i + 1]; ++j, ++k)
858 col_idx_g[k] = dof_idx_x[col_idx_x[j]];
867 for(
Index i = 0; i < num_rows; ++i)
869 for(IndexType j(row_ptr_g[i]); j + 1 < row_ptr_g[i + 1]; ++j)
871 ASSERT(col_idx_g[j] < col_idx_g[j+1]);
893 matrix.
copy(_matrix_s);
902 const IndexType* row_ptr_s = _matrix_s.
row_ptr();
903 const IndexType* row_ptr_g = matrix.
row_ptr();
904 const DataType* val_s = _matrix_s.
val();
905 DataType* val_g = matrix.
val();
908 std::vector<IndexType> row_aux(num_rows);
911 for(
Index i(0); i < num_rows; ++i)
912 row_aux[i] = row_ptr_g[i];
915 const int my_rank = this->get_comm()->rank();
918 std::map<int, std::size_t> neigh_map_l, neigh_map_h;
919 for(std::size_t ineigh(0); ineigh < _ranks.size(); ++ineigh)
921 if(_ranks.at(ineigh) < my_rank)
922 neigh_map_l.emplace(_ranks.at(ineigh), ineigh);
924 neigh_map_h.emplace(_ranks.at(ineigh), ineigh);
928 for(
auto it = neigh_map_l.begin(); it != neigh_map_l.end(); ++it)
930 std::size_t ineigh = it->second;
931 const Index used_rows = _neighbor_matrices.at(ineigh).used_rows();
932 const IndexType* row_ptr_x = _neighbor_matrices.at(ineigh).row_ptr();
933 const IndexType* row_idx_x = _neighbor_matrices.at(ineigh).row_numbers();
934 const DataType* val_x = _neighbor_matrices.at(ineigh).val();
935 for(
Index i(0); i < used_rows; ++i)
937 IndexType& k = row_aux[row_idx_x[i]];
938 for(IndexType j(row_ptr_x[i]); j < row_ptr_x[i + 1]; ++j, ++k)
944 for(
Index i(0); i < num_rows; ++i)
946 Index k = row_aux[i];
947 for(
Index j(row_ptr_s[i]); j < row_ptr_s[i+1]; ++j, ++k)
953 for(
auto it = neigh_map_h.begin(); it != neigh_map_h.end(); ++it)
955 std::size_t ineigh = it->second;
956 const Index used_rows = _neighbor_matrices.at(ineigh).used_rows();
957 const IndexType* row_ptr_x = _neighbor_matrices.at(ineigh).row_ptr();
958 const IndexType* row_idx_x = _neighbor_matrices.at(ineigh).row_numbers();
959 const DataType* val_x = _neighbor_matrices.at(ineigh).val();
960 for(
Index i(0); i < used_rows; ++i)
962 IndexType& k = row_aux[row_idx_x[i]];
963 for(IndexType j(row_ptr_x[i]); j < row_ptr_x[i + 1]; ++j, ++k)
970 for(
Index i(0); i < num_rows; ++i)
972 ASSERT(row_aux[i] == row_ptr_g[i+1]);
1018 const Index num_dof_mir_v = mirror_v.num_indices();
1019 const IndexType* velo_idx = mirror_v.indices();
1020 const IndexType* row_ptr = matrix_b.
row_ptr();
1021 const IndexType* col_idx = matrix_b.
col_ind();
1025 std::set<IndexType> dof_set;
1026 for(
Index i(0); i < num_dof_mir_v; ++i)
1028 const Index irow = velo_idx[i];
1029 for(IndexType j(row_ptr[irow]); j < row_ptr[irow+1]; ++j)
1030 dof_set.insert(col_idx[j]);
1034 mirror_p = MirrorTypeP(matrix_b.
columns(),
Index(dof_set.size()));
1035 IndexType* pidx = mirror_p.indices();
1036 for(
auto it = dof_set.begin(); it != dof_set.end(); ++it, ++pidx)
1058 const Index num_dof_mir_v = mirror_v.num_indices();
1059 const Index num_dof_mir_p = mirror_p.num_indices();
1060 const IndexType* velo_idx = mirror_v.indices();
1061 const IndexType* pres_idx = mirror_p.indices();
1062 const IndexType* row_ptr = matrix_b.
row_ptr();
1063 const IndexType* col_idx = matrix_b.
col_ind();
1067 for(
Index i(0); i < num_dof_mir_v; ++i)
1069 const Index irow = velo_idx[i];
1070 num_red_nzes +=
Index(row_ptr[irow+1] - row_ptr[irow]);
1079 dom_ptr[0] =
Index(0);
1080 for(
Index i(0); i < num_dof_mir_v; ++i)
1083 const IndexType irow = velo_idx[i];
1085 for(IndexType j(row_ptr[irow]), k(dom_ptr[i]); j < row_ptr[irow+1]; ++j, ++k)
1088 img_idx[k] = ~IndexType(0);
1091 for(
Index l(0); l < num_dof_mir_p; ++l)
1093 if(col_idx[j] == pres_idx[l])
1100 ASSERT(img_idx[k] != ~IndexType(0));
1103 dom_ptr[i+1] = dom_ptr[i] + (row_ptr[irow+1] - row_ptr[irow]);
1132 const Index num_dof_mir_v = mirror_v.num_indices();
1133 const IndexType* velo_idx = mirror_v.indices();
1134 const IndexType* pres_idx = mirror_p.indices();
1135 const IndexType* row_ptr = matrix_b.
row_ptr();
1136 const IndexType* col_idx = matrix_b.
col_ind();
1142 IndexType* dat_idx = data_mirror.indices();
1145 for(
Index i(0); i < num_dof_mir_v; ++i)
1148 const IndexType irow = velo_idx[i];
1151 for(
Index k(dom_ptr[i]); k < dom_ptr[i+1]; ++k)
1154 dat_idx[k] = ~IndexType(0);
1157 const Index jcol = pres_idx[img_idx[k]];
1160 for(IndexType j(row_ptr[irow]); j < row_ptr[irow + 1]; ++j)
1162 if(jcol == col_idx[j])
1169 ASSERT(dat_idx[k] != ~IndexType(0));
1191 const Index num_idx = data_mirror.num_indices();
1192 const IndexType* idx = data_mirror.indices();
1198 for(
Index i(0); i < num_idx; ++i)
1200 buf_val[i] = mat_val[idx[i]];
1210 for(
int i(0); i < dim; ++i)
1211 da(0, i) = val_d(0, i) * val_a(i);
1218 DataType s = DataType(0);
1219 for(
int i(0); i < dim; ++i)
1220 s += val_da(0, i) * val_b(i, 0);
1227 for(
int i(0); i < dim; ++i)
1228 val_da(i, 0) = val_d(0, i) * val_a(i);
1234 DataType s = DataType(0);
1235 for(
int i(0); i < dim; ++i)
1236 s += val_da(i, 0) * val_b(i, 0);
1257 const IndexType* row_ptr = mat_d.
row_ptr();
1258 const IndexType* col_idx = mat_d.
col_ind();
1259 const IndexType* row_ptr_da = mat_da.
row_ptr();
1266 std::vector<Index> ptr(num_cols);
1267 for(
Index i(0); i < num_cols; ++i)
1268 ptr[i] = row_ptr_da[i];
1271 for(
Index i(0); i < num_rows; ++i)
1273 for(
Index j(row_ptr[i]); j < row_ptr[i + 1]; ++j)
1275 const Index col = col_idx[j];
1276 _mat_mult_d_a(val_da[ptr[col]++], val_d[j], val_a[col]);
1302 DataType* data_s = s.
val();
1306 const IndexType* row_ptr_s = s.
row_ptr();
1307 const IndexType* col_idx_s = s.
col_ind();
1308 const IndexType* row_ptr_d = d.
row_ptr();
1309 const IndexType* col_idx_d = d.
col_ind();
1310 const IndexType* row_ptr_b = b.
row_ptr();
1311 const IndexType* col_idx_b = b.
col_ind();
1314 for(IndexType i(0); i < IndexType(s.
rows()); ++i)
1317 for(IndexType ik(row_ptr_d[i]); ik < row_ptr_d[i+1]; ++ik)
1320 const IndexType k = col_idx_d[ik];
1323 const ValueTypeD val_da = _mat_mult_d_a(data_d[ik], data_a[k]);
1326 for(IndexType ij(row_ptr_s[i]), kj(row_ptr_b[k]); kj < row_ptr_b[k+1]; ++ij)
1328 ASSERT(ij < row_ptr_s[i+1]);
1329 ASSERT(col_idx_s[ij] <= col_idx_b[kj]);
1330 if(col_idx_s[ij] == col_idx_b[kj])
1332 data_s[ij] += _mat_mult_da_b(val_da, data_b[kj]);
1364 XASSERT(graph_b.get_num_nodes_domain() == mirror_v.num_indices());
1369 DataType* data_s = s.
val();
1370 const IndexType* row_ptr_s = s.
row_ptr();
1372 const IndexType* col_idx_s = s.
col_ind();
1378 const IndexType* col_ptr_da = da.
row_ptr();
1379 const IndexType* row_idx_da = da.
col_ind();
1381 const Index num_mir_idx = mirror_v.num_indices();
1382 const IndexType* mir_idx = mirror_v.indices();
1389 for(
Index l(0); l < num_mir_idx; ++l)
1392 const Index k = mir_idx[l];
1395 for(
Index ik(col_ptr_da[k]), si(0); (ik < col_ptr_da[k + 1]) && (si < used_rows_s); )
1398 if(row_idx_da[ik] < row_idx_s[si])
1404 if(row_idx_s[si] < row_idx_da[ik])
1412 for(IndexType ij(row_ptr_s[si]), kj(dom_ptr_b[l]); kj < dom_ptr_b[l+1]; ++ij)
1414 ASSERT(ij < row_ptr_s[si+1]);
1415 ASSERT(col_idx_s[ij] <= img_idx_b[kj]);
1416 if(col_idx_s[ij] == img_idx_b[kj])
1418 data_s[ij] += _mat_mult_da_b(data_da[ik], data_b[kj]);
1451 const std::size_t num_neighs = this->_ranks.size();
1454 if(num_neighs <= std::size_t(0))
1457 watch_apply_matrix_loc.
start();
1459 this->_matrix_s.
apply(r, x);
1461 this->_matrix_s.
apply(r, x, y, alpha);
1462 watch_apply_matrix_loc.
stop();
1470 std::vector<BufferVectorType> recv_bufs(num_neighs), send_bufs(num_neighs);
1474 for(std::size_t i(0); i < num_neighs; ++i)
1476 recv_bufs.at(i) =
BufferVectorType(this->_neighbor_matrices.at(i).columns());
1477 recv_reqs[i] = comm.
irecv(recv_bufs.at(i).elements(), recv_bufs.at(i).size(), this->_ranks.at(i));
1481 for(std::size_t i(0); i < num_neighs; ++i)
1483 send_bufs.at(i) =
BufferVectorType(this->_pres_mirrors.at(i).num_indices());
1484 this->_pres_mirrors.at(i).gather(send_bufs.at(i), x);
1485 send_reqs[i] = comm.
isend(send_bufs.at(i).elements(), send_bufs.at(i).size(), this->_ranks.at(i));
1489 watch_apply_matrix_loc.
start();
1491 this->_matrix_s.
apply(r, x);
1493 this->_matrix_s.
apply(r, x, y, alpha);
1494 watch_apply_matrix_loc.
stop();
1497 for(std::size_t i(0u); recv_reqs.wait_any(i); )
1499 watch_apply_neighbor_s.
start();
1500 this->_neighbor_matrices.at(i).apply(r, recv_bufs.at(i), r, (only_Ax ? DataType(1) : alpha));
1501 watch_apply_neighbor_s.
stop();
#define ASSERT(expr)
Debug-Assertion macro definition.
#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.
void allreduce(const void *sendbuf, void *recvbuf, std::size_t count, const Datatype &datatype, const Operation &op) const
Blocking All-Reduce.
void exscan(const void *sendbuf, void *recvbuf, std::size_t count, const Datatype &datatype, const Operation &op) const
Blocking Exclusive Scan.
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_ > >::_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_ > >::asm_adp_numeric void asm_adp_numeric(LocalMatrixTypeS &matrix) const
Copies 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_ > >::_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_ > >::asm_adp_symbolic LocalMatrixTypeS asm_adp_symbolic(Index &glob_dof_offset, Index &glob_dof_count) 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_ > >::_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_ > >::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.
void copy(const SparseMatrixCSR &x, bool full=false)
Performs .
IT_ * col_ind()
Retrieve column indices array.
DT_ * val()
Retrieve non zero element array.
Index rows() const
Retrieve matrix row count.
SparseMatrixCSR clone(CloneMode clone_mode=CloneMode::Weak) const
Clone operation.
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.