512 {
514
515 try {
516 int nb_row = row_data.getIndices().size();
517 if (nb_row == 0)
519 int nb_col = col_data.getIndices().size();
520 if (nb_col == 0)
523 getNumeredEntFiniteElementPtr()->getEnt()) ==
526 }
527 ND.resize(nb_row, 3);
528 K.resize(nb_row, nb_col);
530 int nb_gauss_pts = row_data.getN().size1();
531 for (int gg = 0; gg < nb_gauss_pts; gg++) {
533 getFEMethod());
534 double w = getGaussPts()(2, gg) *
535 cblas_dnrm2(3, &getNormalsAtGaussPtsF3()(gg, 0), 1) * 0.5;
537 for (int nn = 0; nn < nb_row / 3; nn++) {
538 for (
int dd = 0;
dd < 3;
dd++) {
539 for (int DD = 0; DD < 3; DD++) {
540 ND(3 * nn + dd, DD) += row_data.getN(gg)[nn] *
D(dd, DD);
541 }
542 }
543 }
544 for (int nn = 0; nn < nb_row / 3; nn++) {
545 for (
int dd = 0;
dd < 3;
dd++) {
546 for (int NN = 0; NN < nb_col / 3; NN++) {
547 for (int DD = 0; DD < 3; DD++) {
548 K(3 * nn + dd, 3 * NN + DD) +=
549 w *
ND(3 * nn + dd, DD) * col_data.getN(gg)[NN];
550 }
551 }
552 }
553 }
554 }
556 &row_data.getIndices()[0], nb_col,
557 &col_data.getIndices()[0], &
K(0, 0), ADD_VALUES);
558 } catch (const std::exception &ex) {
559 std::ostringstream ss;
560 ss << "throw in method: " << ex.what() << std::endl;
561 SETERRQ(PETSC_COMM_SELF, 1, ss.str().c_str());
562 }
564 }
#define MoFEMFunctionReturnHot(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 ...
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.