317 {
318 PetscFunctionBegin;
319
321
323 if(
dAta.
tRis.find(getNumeredEntFiniteElementPtr()->getEnt())==
dAta.
tRis.end()) PetscFunctionReturn(0);
324
325 auto weak_ptr_dof =
326 getNumeredEntFiniteElementPtr()->getRowDofsByPetscGlobalDofIdx(
327 data.getIndices()[0]);
328 const FENumeredDofEntity *dof_ptr;
329 if (auto ptr = weak_ptr_dof.lock())
330 dof_ptr = ptr.get();
331 else
333
334 rank = dof_ptr->getNbOfCoeffs();
336
338
339
341 scaled_given_strain.resize(6);
343
345
346 f.resize(
D_mat.size1(),
false);
347 noalias(
f) = prod(
D_mat, scaled_given_strain);
349
350
351
352
353
355 if(
F == PETSC_NULL) {
356 myF = getFEMethod()->snes_f;
357 }
358
359 ierr =
VecSetValues(myF,data.getIndices().size(),&data.getIndices()[0],&
f[0],ADD_VALUES); CHKERRQ(
ierr);
360 PetscFunctionReturn(0);
361 }
static PetscErrorCode ierr
@ MOFEM_DATA_INCONSISTENCY
const FTensor::Tensor2< T, Dim, Dim > Vec
UBlasVector< double > VectorDouble
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
PetscErrorCode calculateDmat(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
static MoFEMErrorCode applyScale(const FEMethod *fe, boost::ptr_vector< MethodForForceScaling > &methods_op, VectorDouble &nf)