45 {
46 PetscFunctionBegin;
47
48 try {
49 if(row_data.getIndices().size()==0) PetscFunctionReturn(0);
50 if(col_data.getIndices().size()==0) PetscFunctionReturn(0);
51 if(col_type==MBVERTEX) {
52
53
54 const FENumeredDofEntity *dof_ptr;
55 ierr = getNumeredEntFiniteElementPtr()->getColDofsByPetscGlobalDofIdx(col_data.getIndices()[0],&dof_ptr); CHKERRQ(
ierr);
56 int rank = dof_ptr->getNbOfCoeffs();
57
62
63 switch(rank) {
64 case 3:
65 for(int nn=0; nn<3; nn++){
69 }
70 break;
71 case 1:
75 break;
76 default:
77 SETERRQ(PETSC_COMM_SELF,1,"not implemented");
78 }
79
80
81 int nb_rows=row_data.getIndices().size();
82 int nb_cols=col_data.getIndices().size();
84 Aij,nb_rows,&row_data.getIndices()[0],nb_cols,&col_data.getIndices()[0],&
Mat_face(0,0),ADD_VALUES
86
87
90 Aij,nb_cols,&col_data.getIndices()[0],nb_rows,&row_data.getIndices()[0],&
Mat_face_Tran(0,0),ADD_VALUES
92
93 }
94 } catch (const std::exception& ex) {
95 ostringstream ss;
96 ss << "throw in method: " << ex.what() << endl;
97 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
98 }
99 PetscFunctionReturn(0);
100 }
static PetscErrorCode ierr
MoFEMErrorCode MatSetValues(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Assemble PETSc matrix.
MatrixDouble Mat_face_Tran