231 {
232
234
235 const int row_nb_dofs = row_data.getIndices().size();
236 if (!row_nb_dofs)
238 const int col_nb_dofs = col_data.getIndices().size();
239 if (!col_nb_dofs)
241
242 if (
dAta.
tEts.find(getNumeredEntFiniteElementPtr()->getEnt()) ==
245 }
247
248
249 locG.resize(row_nb_dofs, col_nb_dofs,
false);
251 const int row_nb_gauss_pts = row_data.getN().size1();
252 if (!row_nb_gauss_pts)
254 const int row_nb_base_functions = row_data.getN().size2();
255 auto row_diff_base_functions = row_data.getFTensor1DiffN<3>();
256
260
261
262 for (int gg = 0; gg != row_nb_gauss_pts; gg++) {
263
264
265 double w = getVolume() * getGaussPts()(3, gg);
266
267 int row_bb = 0;
268 for (; row_bb != row_nb_dofs / 3; row_bb++) {
269
270 t1(
i) =
w * row_diff_base_functions(
i);
271
272 auto base_functions = col_data.getFTensor0N(gg, 0);
273 for (int col_bb = 0; col_bb != col_nb_dofs; col_bb++) {
274
276 &
locG(3 * row_bb + 1, col_bb),
277 &
locG(3 * row_bb + 2, col_bb));
278
279 k(
i) += t1(
i) * base_functions;
280 ++base_functions;
281 }
282 ++row_diff_base_functions;
283 }
284 for (; row_bb != row_nb_base_functions; row_bb++) {
285 ++row_diff_base_functions;
286 }
287 }
288
290 &*row_data.getIndices().begin(), col_nb_dofs,
291 &*col_data.getIndices().begin(), &*
locG.data().begin(),
292 ADD_VALUES);
293
294
297 &*col_data.getIndices().begin(), row_nb_dofs,
298 &*row_data.getIndices().begin(), &*
locG.data().begin(),
299 ADD_VALUES);
301 }
#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.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
MoFEMErrorCode MatSetValues(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Assemble PETSc matrix.
MoFEMErrorCode getBlockData(BlockData &data)