370 {
375 const auto parameters = material_ptr->getParameters(getFEEntityHandle());
376 const auto t_packed_basis = FTensor::SymmLTensor<double, 3>();
379 t_viscous_metric(L,
J) =
380 t_packed_basis(
i,
j, L) * t_packed_basis(
i,
j,
J);
381 const double ts_a = getTSa();
382 const double alpha_grad_u = material_ptr->alphaGradU;
383 auto t_h =
dataAtPts->getFTensorLogStretch(nbIntegrationPts);
384 auto t_pullback =
dataAtPts->getFTensorAdjointPdstretch(nbIntegrationPts);
385 auto t_eigenvalues =
dataAtPts->getFTensorEigenVals(nbIntegrationPts);
386 auto t_eigenvectors =
dataAtPts->getFTensorEigenVecs(nbIntegrationPts);
389 auto t_weight = getFTensor0IntegrationWeight();
390#ifndef NDEBUG
391 if (
dataAtPts->nbUniq.size() != nbIntegrationPts)
393 "Neo-Hookean tangent requires current geometric eigendata");
394#endif
395 for (int gg = 0; gg != nbIntegrationPts; ++gg) {
397 t_log_stretch(
i,
j) = t_h(
i,
j);
399 double energy;
401 &t_tangent);
403 t_symmetric_pullback(
i,
j) =
404 (t_pullback(
i,
j) || t_pullback(
j,
i)) / 2.;
409 t_packed_basis(
i,
j, L) *
410 (t_work_curvature(
i,
j,
k,
l) * t_packed_basis(
k,
l,
J));
411 t_tangent(L,
J) += (
alphaU * ts_a) * t_viscous_metric(L,
J);
412 const double alpha = getMeasure() * t_weight;
413 int rr = 0;
417 auto t_matrix = getLocMat<size_symm>(
size_symm * rr);
418 for (
int cc = 0; cc != nbCols /
size_symm; ++cc) {
419 t_matrix(L,
J) += alpha * t_row * t_col * t_tangent(L,
J);
420 const double gradient_weight =
421 alpha * alpha_grad_u * ts_a * (t_grad_row(
i) * t_grad_col(
i));
422 t_matrix(L,
J) += gradient_weight * t_identity(L,
J);
423 ++t_matrix;
424 ++t_col;
425 ++t_grad_col;
426 }
427 ++t_row;
428 ++t_grad_row;
429 }
430 for (; rr != nbRowBaseFunctions; ++rr) {
431 ++t_row;
432 ++t_grad_row;
433 }
434 ++t_weight;
435 ++t_h;
436 ++t_pullback;
437 ++t_eigenvalues;
438 ++t_eigenvectors;
439 }
441 }
#define FTENSOR_INDEXES(DIM,...)
#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', SPACE_DIM > i
FTensor::Index< 'J', DIM1 > J
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
auto getDiffDiffMat(A &&t_val, B &&t_vec, Fun< double > f, Fun< double > d_f, Fun< double > dd_f, C &&t_S, const int nb)
Get the Diff Diff Mat object.
static constexpr auto size_symm
static boost::function< double(const double)> f
static boost::function< double(const double)> dd_f
static boost::function< double(const double)> d_f
static boost::shared_ptr< HMHNeohookean > getMaterial(const boost::shared_ptr< DataAtIntegrationPts > &data_ptr)
FTensor::Tensor2< double, size_symm, size_symm > PackedTangent
static MoFEMErrorCode evaluateDirect(const Material::Parameters ¶meters, const Material::SymmetricTensor &t_log_stretch, double &energy, PackedStress *stress_ptr=nullptr, PackedTangent *tangent_ptr=nullptr)
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
auto getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.