374 {
375 PetscFunctionBegin;
376
377 try {
378
379 if(row_data.getIndices().size()==0) PetscFunctionReturn(0);
380 if(col_data.getIndices().size()==0) PetscFunctionReturn(0);
381 if(row_type == MBEDGE && row_side >= 3) PetscFunctionReturn(0);
382 if(col_type == MBEDGE && col_side >= 3) PetscFunctionReturn(0);
383 if(row_type == MBTRI && row_side == 4) PetscFunctionReturn(0);
384 if(col_type == MBTRI && col_side == 4) PetscFunctionReturn(0);
385
386
387
388
389 int rank = col_data.getFieldDofs()[0]->getNbOfCoeffs();
390
393
394
395
396 for(unsigned int gg = 0;gg<col_data.getN().size1();gg++) {
397 double area;
399 area = cblas_dnrm2(3,&normal_f3[0],1)*0.5;
400 double val = getGaussPts()(2,gg)*area;
401
402 if(row_type == MBVERTEX) {
404
405 }
406 else {
408
409 if(col_type == MBVERTEX) {
411
412 }
413 else {
415 if(gg==0){
416
417
418 NTN=prod(trans(N_mat_row),N_mat_col);
420 }else{
421 NTN=prod(trans(N_mat_row),N_mat_col);
423 }
424 }
430
431
432
433
434
435
436
437 for(unsigned int gg = 0;gg<col_data.getN().size1();gg++) {
438 double area;
440 area = cblas_dnrm2(3,&normal_f3[0],1)*0.5;
441 double val = getGaussPts()(2,gg)*area;
442
443 if(row_type == MBVERTEX) {
445
446 }
447 else {
449
450 if(col_type == MBVERTEX) {
452
453 }
454 else {
456 if(gg==0){
457
458
459 NTN=prod(trans(N_mat_row),N_mat_col);
461 }else{
462 NTN=prod(trans(N_mat_row),N_mat_col);
464 }
465 }
471
472
473
474
475
476
477
478 } catch (const std::exception& ex) {
479 ostringstream ss;
480 ss << "throw in method: " << ex.what() << endl;
481 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
482 }
483
484
485 PetscFunctionReturn(0);
486 }
static PetscErrorCode ierr
UBlasMatrix< double > MatrixDouble
UBlasVector< double > VectorDouble
MoFEMErrorCode MatSetValues(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Assemble PETSc matrix.
ublas::vector< map< EntityType, map< int, ublas::vector< int > > > > RowInd
ublas::vector< map< EntityType, map< int, MatrixDouble > > > ColN
ublas::vector< map< EntityType, map< int, MatrixDouble > > > RowN
ublas::vector< map< EntityType, map< int, ublas::vector< int > > > > ColInd
PetscErrorCode shapeMatNew(int rank, unsigned int gg, MatrixDouble &RowN, MatrixDouble &N_mat, int div=1)
ublas::vector< int > rrvec
ublas::vector< int > ccvec