343 {
345
346 int row_nb_dofs = row_data.getIndices().size();
347 if (row_nb_dofs == 0) {
349 }
350 int col_nb_dofs = col_data.getIndices().size();
351 if (col_nb_dofs == 0) {
353 }
354 kTangent.resize(row_nb_dofs, col_nb_dofs,
false);
356 auxVec.resize(col_nb_dofs,
false);
357 auxMat.resize(col_nb_dofs, 2,
false);
358 int nb_gauss_pts = row_data.getN().size1();
359 for (int gg = 0; gg != nb_gauss_pts; gg++) {
360
361 double val = getGaussPts()(2, gg) * getArea();
366 ublas::matrix_row<MatrixDouble> an_pow3_by_grad_u(
368
369
370 noalias(
auxVec) = prod(col_diff_n, an_pow3_by_grad_u);
371
373
374
375
376
378 val * prod(row_diff_n, trans(an * col_diff_n -
auxMat));
379
380 }
382 &*row_data.getIndices().data().begin(), col_nb_dofs,
383 &*col_data.getIndices().data().begin(),
384 &*
kTangent.data().begin(), ADD_VALUES);
386 }
#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.
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Matrix adaptor.
MoFEMErrorCode MatSetValues(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Assemble PETSc matrix.
MatrixDouble gradU
nb_gauss_pts x 2 gradients at integration pts
VectorDouble aN
size of nb_gauss_pts,
MatrixDouble aNpow3byGradU
nb_gauss_pts x 2,