489 {
491
492 try {
493 int nb_row = row_data.getIndices().size();
495 int nb_col = col_data.getIndices().size();
500 }
501
502
504 K.resize(nb_row,nb_col);
506 int nb_gauss_pts = row_data.getN().size1();
507 for(int gg = 0;gg<nb_gauss_pts;gg++) {
509 double w = getGaussPts()(2,gg)*cblas_dnrm2(3,&getNormalsAtGaussPtsF3()(gg,0),1)*0.5;
511 for(int nn = 0; nn<nb_row/3;nn++) {
512 for(
int dd = 0;
dd<3;
dd++) {
513 for(int DD = 0;DD<3;DD++) {
514 ND(3*nn+dd,DD) += row_data.getN(gg)[nn]*
D(dd,DD);
515 }
516 }
517 }
518 for(int nn = 0; nn<nb_row/3; nn++) {
519 for(
int dd = 0;
dd<3;
dd++) {
520 for(int NN = 0; NN<nb_col/3; NN++) {
521 for(int DD = 0; DD<3;DD++) {
522 K(3*nn+dd,3*NN+DD) +=
w*
ND(3*nn+dd,DD)*col_data.getN(gg)[NN];
523 }
524 }
525 }
526 }
527 }
529 nb_row,&row_data.getIndices()[0],
530 nb_col,&col_data.getIndices()[0],
533 } catch (const std::exception& ex) {
534 std::ostringstream ss;
535 ss << "throw in method: " << ex.what() << std::endl;
536 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
537 }
539 }
static PetscErrorCode ierr
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
#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.