517 {
519
520 try {
521 int nb_row = row_data.getIndices().size();
522 if (nb_row == 0)
524 int nb_col = col_data.getIndices().size();
525 if (nb_col == 0)
528 getNumeredEntFiniteElementPtr()->getEnt()) ==
531 }
532 ND.resize(nb_row, 3);
533 K.resize(nb_row, nb_col);
535 int nb_gauss_pts = row_data.getN().size1();
536 for (int gg = 0; gg < nb_gauss_pts; gg++) {
538 getFEMethod());
539 double w = getGaussPts()(2, gg) *
540 cblas_dnrm2(3, &getNormalsAtGaussPtsF3()(gg, 0), 1) * 0.5;
542 for (int nn = 0; nn < nb_row / 3; nn++) {
543 for (
int dd = 0;
dd < 3;
dd++) {
544 for (int DD = 0; DD < 3; DD++) {
545 ND(3 * nn + dd, DD) += row_data.getN(gg)[nn] *
D(dd, DD);
546 }
547 }
548 }
549 for (int nn = 0; nn < nb_row / 3; nn++) {
550 for (
int dd = 0;
dd < 3;
dd++) {
551 for (int NN = 0; NN < nb_col / 3; NN++) {
552 for (int DD = 0; DD < 3; DD++) {
553 K(3 * nn + dd, 3 * NN + DD) +=
554 w *
ND(3 * nn + dd, DD) * col_data.getN(gg)[NN];
555 }
556 }
557 }
558 }
559 }
561 &row_data.getIndices()[0], nb_col,
562 &col_data.getIndices()[0], &
K(0, 0), ADD_VALUES);
563 } catch (const std::exception &ex) {
564 std::ostringstream ss;
565 ss << "throw in method: " << ex.what() << std::endl;
567 ss.str().c_str());
568 }
570 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ MOFEM_STD_EXCEPTION_THROW
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
MoFEMErrorCode MatSetValues(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Assemble PETSc matrix.
virtual MoFEMErrorCode calculateTangentStiffeness(MatrixDouble &tangent_matrix, int gg, CommonData &common_data, const FEMethod *fe_method)
Calculate tangent stiffness.