426 {
428
430
432 if (nb_dofs) {
433
434 auto t_grad = getFTensor1FromMat<3>(*
uGradPtr);
435
436 auto nb_base_functions = data.
getN().size2();
437 auto nb_gauss_pts = getGaussPts().size2();
438 std::array<double, MAX_DOFS_ON_ENTITY> nf;
439 std::fill(nf.begin(), &nf[nb_dofs], 0);
440
442 auto t_w = getFTensor0IntegrationWeight();
443 auto a = getMeasure();
444
445 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
447
448 const auto l2 = t_grad(
i) * t_grad(
i);
450 if (l2 > std::numeric_limits<double>::epsilon())
451 t_one(
i) = t_grad(
i) / std::sqrt(l2);
452 else
454
455 size_t bb = 0;
456 for (; bb != nb_dofs; ++bb) {
457 nf[bb] -=
alpha * t_diff_base(
i) * t_one(
i);
458 ++t_diff_base;
459 }
460
461 for (; bb < nb_base_functions; ++bb) {
462 ++t_diff_base;
463 }
464
465 ++t_grad;
466 }
467
468 CHKERR VecSetValues<MoFEM::EssentialBcStorage>(getKSPf(), data, &nf[0],
469 ADD_VALUES);
470 }
471
473}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FTensor::Index< 'i', 3 > i
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorInt & getIndices() const
Get global indices of dofs on entity.