449 {
450 PetscFunctionBegin;
451
452 try {
453 int nb_row = row_data.getIndices().size();
454 int nb_col = col_data.getIndices().size();
455
456 if(nb_row == 0) PetscFunctionReturn(0);
457 if(nb_col == 0) PetscFunctionReturn(0);
458
459
460
461 const FENumeredDofEntity *dof_ptr;
462 ierr = getNumeredEntFiniteElementPtr()->getRowDofsByPetscGlobalDofIdx(row_data.getIndices()[0],&dof_ptr); CHKERRQ(
ierr);
463 int rank = dof_ptr->getNbOfCoeffs();
464 for(unsigned int gg = 0;gg<row_data.getN().size1();gg++) {
465 double area;
467 area = norm_2(getNormalsAtGaussPt(gg))*0.5;
468 } else {
469 area = getArea();
470 }
471 double val = getGaussPts()(2,gg)*area;
474
475
476
477
478
479
480
481 if(gg==0){
483 } else {
485 }
486 }
487 CU=prod(
K, col_data.getFieldData());
488 CTLam=prod(trans(
K),row_data.getFieldData());
489
490
492 if(
F == PETSC_NULL) {
493 myF = getFEMethod()->snes_f;
494 }
495
496 ierr =
VecSetValues(myF,row_data.getIndices().size(),&row_data.getIndices()[0],&
CU[0],ADD_VALUES); CHKERRQ(
ierr);
498
499 } catch (const std::exception& ex) {
500 ostringstream ss;
501 ss << "throw in method: " << ex.what() << endl;
502 SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
503 }
504
505 PetscFunctionReturn(0);
506 }
static PetscErrorCode ierr
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, DataForcesAndSurcesCore::EntData &col_data, MatrixDouble &N_mat)