33 {
35
36 if (transpose) {
38 false);
40 }
41
43
44
45
46
47
48
49 auto &bmc = *bmc_ptr;
50 int *row_ind_ptr = &*row_data.getIndices().begin();
51 int *col_ind_ptr = &*col_data.getIndices().begin();
52 int row_nb_dofs = row_data.getIndices().size();
53 int col_nb_dofs = col_data.getIndices().size();
56
57 auto set_block = [&](auto &row_name, auto &col_name, auto row_side,
58 auto col_side, auto row_type, auto col_type,
59 const auto &
m,
const auto &row_ind,
60 const auto &col_ind) {
61 auto it = bmc.get<0>().find(boost::make_tuple(
62 row_name, col_name, row_type, col_type, row_side, col_side));
63 if (it != bmc.get<0>().end()) {
65 it->setInd(row_ind, col_ind);
66 it->setSetAtElement();
67 } else
68 bmc.insert(BlockMatData(row_name, col_name, row_type, col_type,
69 row_side, col_side,
m, row_ind, col_ind));
70 };
71
72 if ( this->rowFieldName != "SIGMA" &&
73 this->colFieldName != "SIGMA") {
74 if (auto e_ptr = row_data.getFieldEntities()[0]) {
75 if (auto stored_data_ptr =
76 e_ptr->getSharedStoragePtr<EssentialBcStorage>()) {
78 set_block(this->rowFieldName, this->colFieldName, this->
rowSide,
80 stored_data_ptr->entityIndices, col_data.getIndices());
81 if (transpose)
82 set_block(this->colFieldName, this->rowFieldName, this->
colSide,
84 col_data.getIndices(), stored_data_ptr->entityIndices);
85 } else {
87 set_block(this->rowFieldName, this->colFieldName, this->
rowSide,
89 row_data.getIndices(), col_data.getIndices());
90
91 if (transpose)
92 set_block(this->colFieldName, this->rowFieldName, this->
colSide,
94 col_data.getIndices(), row_data.getIndices());
95 }
96 } else
98 "No field entities for assembly");
99 }
100 }
101
102
103 if (transpose) {
105 this->getKSPB(), col_data, row_data,
107 }
108
110
112 this->getKSPB(), row_data, col_data, &*this->
locMat.data().begin(),
113 ADD_VALUES);
114 }
115
117 }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FTensor::Index< 'm', SPACE_DIM > m
boost::weak_ptr< BlockMatContainer > block_mat_container_ptr
MoFEMErrorCode MatSetValues< EssentialBcStorage >(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Set values to matrix in operator.
MatrixDouble locMatTranspose
local entity block matrix
int rowSide
row side number
int colSide
column side number
EntityType colType
column type
MatrixDouble locMat
local entity block matrix
EntityType rowType
row type