34 {
36
38
39 auto get_row_indices = [&]() ->
const VectorInt & {
40 if (auto e_ptr = row_data.getFieldEntities()[0]) {
41 if (auto stored_data_ptr =
42 e_ptr->getSharedStoragePtr<EssentialBcStorage>()) {
43 return stored_data_ptr->entityIndices;
44 }
45 }
46 return row_data.getIndices();
47 };
48
49 const auto &row_ind = get_row_indices();
50 const auto &col_ind = col_data.getIndices();
51
52 const auto nb_rows = row_ind.size();
53 const auto nb_cols = col_ind.size();
54
57
58 if (idx >= size) {
62 }
63
64
65 auto get_uid = [](auto &data) {
66 return data.getFieldEntities()[0]->getLocalUniqueId();
67 };
68
70 get_uid(col_data));
71
72 auto get_storage = [&
p]() {
return const_cast<SchurL2Mats &
>(*
p.first); };
73
75
76 auto asmb = [&](auto &sm) {
77 sm.resize(nb_rows, nb_cols, false);
78 noalias(sm) = mat;
79 };
80
81 asmb(get_storage().
getMat());
82
83 auto add_indices = [](auto &storage, auto &ind) {
84 storage.resize(ind.size(), false);
85 noalias(storage) = ind;
86 };
87
88 add_indices(get_storage().
getRowInd(), row_ind);
89 add_indices(get_storage().
getColInd(), col_ind);
90
91 } else {
92
93 auto asmb = [&](auto &sm) {
95 switch (iora) {
96 case ADD_VALUES:
97 sm += mat;
98 break;
99 case INSERT_VALUES:
100 noalias(sm) = mat;
101 break;
102 default:
104 "Assembly type not implemented");
105 }
107 };
108
110
111 }
112
114}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
UBlasMatrix< double > MatrixDouble
UBlasVector< int > VectorInt
SchurL2Mats(const size_t idx, const UId uid_row, const UId uid_col)
static MatSetValuesPtr matSetValuesPtr
backend assembly function
static SchurL2Storage schurL2Storage