467 {
468 PetscFunctionBegin;
469
470 try {
471 int nb_row = row_data.getIndices().size();
472 int nb_col = col_data.getIndices().size();
473
474 if(nb_row == 0) PetscFunctionReturn(0);
475 if(nb_col == 0) PetscFunctionReturn(0);
476
477 auto weak_ptr_dof =
478 getNumeredEntFiniteElementPtr()->getRowDofsByPetscGlobalDofIdx(
479 row_data.getIndices()[0]);
480 const FENumeredDofEntity *dof_ptr;
481 if (auto ptr = weak_ptr_dof.lock())
482 dof_ptr = ptr.get();
483 else
485
486 int rank = dof_ptr->getNbOfCoeffs();
487
488 for(unsigned int gg = 0;gg<row_data.getN().size1();gg++) {
489 double area;
491 area = norm_2(getNormalsAtGaussPts(gg))*0.5;
492 } else {
493 area = getArea();
494 }
495 double val = getGaussPts()(2,gg)*area;
498
499
500
501
502
503
504
505 if(gg==0){
507 } else {
509 }
510 }
511 CU=prod(
K, col_data.getFieldData());
512 CTLam=prod(trans(
K),row_data.getFieldData());
513
514
516 if(
F == PETSC_NULL) {
517 myF = getFEMethod()->snes_f;
518 }
519
520 ierr =
VecSetValues(myF,row_data.getIndices().size(),&row_data.getIndices()[0],&
CU[0],ADD_VALUES); CHKERRQ(
ierr);
522
523 } catch (const std::exception& ex) {
524 ostringstream ss;
525 ss << "throw in method: " << ex.what() << endl;
526 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
527 }
528
529 PetscFunctionReturn(0);
530 }
static PetscErrorCode ierr
@ MOFEM_DATA_INCONSISTENCY
const FTensor::Tensor2< T, Dim, Dim > Vec
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
PetscErrorCode shapeMat(int rank, unsigned int gg, DataForcesAndSourcesCore::EntData &col_data, MatrixDouble &N_mat)