v0.16.3
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
EshelbianPlasticity::HMHNeohookean::OpTangent Struct Reference
Inheritance diagram for EshelbianPlasticity::HMHNeohookean::OpTangent:
[legend]
Collaboration diagram for EshelbianPlasticity::HMHNeohookean::OpTangent:
[legend]

Public Member Functions

 OpTangent (const std::string &row_field, const std::string &col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha_u)
 
MoFEMErrorCode iNtegrate (EntData &row_data, EntData &col_data) override
 

Private Attributes

boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 
const double alphaU
 

Detailed Description

Definition at line 356 of file HMHNeohookean.cpp.

Constructor & Destructor Documentation

◆ OpTangent()

EshelbianPlasticity::HMHNeohookean::OpTangent::OpTangent ( const std::string &  row_field,
const std::string &  col_field,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
const double  alpha_u 
)
inline

Definition at line 357 of file HMHNeohookean.cpp.

360 : FormBase(row_field, col_field, FormBase::OPROWCOL),
361 dataAtPts(std::move(data_ptr)), alphaU(alpha_u) {
362 sYmm = false;
364 "Unsupported direct Neo-Hookean configuration");
365 if (!std::isfinite(alphaU))
367 "Neo-Hookean stretch viscosity must be finite");
368 }
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
static MoFEMErrorCode checkDirectConfiguration()
typename FormsIntegrators< VolUserDataOperator >::Assembly< A >::OpBase FormBase

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode EshelbianPlasticity::HMHNeohookean::OpTangent::iNtegrate ( EntData row_data,
EntData col_data 
)
inlineoverride

Definition at line 370 of file HMHNeohookean.cpp.

370 {
372 FTENSOR_INDEXES(3, i, j, k, l);
374 const auto material_ptr = getMaterial(dataAtPts);
375 const auto parameters = material_ptr->getParameters(getFEEntityHandle());
376 const auto t_packed_basis = FTensor::SymmLTensor<double, 3>();
377 constexpr auto t_identity = FTensor::Kronecker_Delta<int>();
378 PackedTangent t_viscous_metric;
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);
387 auto t_row = row_data.getFTensor0N();
388 auto t_grad_row = row_data.getFTensor1DiffN<3>();
389 auto t_weight = getFTensor0IntegrationWeight();
390#ifndef NDEBUG
391 if (dataAtPts->nbUniq.size() != nbIntegrationPts)
392 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
393 "Neo-Hookean tangent requires current geometric eigendata");
394#endif
395 for (int gg = 0; gg != nbIntegrationPts; ++gg) {
396 Material::SymmetricTensor t_log_stretch;
397 t_log_stretch(i, j) = t_h(i, j);
398 PackedTangent t_tangent;
399 double energy;
400 CHKERR evaluateDirect(parameters, t_log_stretch, energy, nullptr,
401 &t_tangent);
402 Material::SymmetricTensor t_symmetric_pullback;
403 t_symmetric_pullback(i, j) =
404 (t_pullback(i, j) || t_pullback(j, i)) / 2.;
405 const auto t_work_curvature = EigenMatrix::getDiffDiffMat(
406 t_eigenvalues, t_eigenvectors, EshelbianCore::f, EshelbianCore::d_f,
407 EshelbianCore::dd_f, t_symmetric_pullback, dataAtPts->nbUniq[gg]);
408 t_tangent(L, J) -=
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;
414 for (; rr != nbRows / size_symm; ++rr) {
415 auto t_col = col_data.getFTensor0N(gg, 0);
416 auto t_grad_col = col_data.getFTensor1DiffN<3>(gg, 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,...)
Kronecker Delta class.
#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
Definition level_set.cpp:30
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 &parameters, 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.

Member Data Documentation

◆ alphaU

const double EshelbianPlasticity::HMHNeohookean::OpTangent::alphaU
private

Definition at line 445 of file HMHNeohookean.cpp.

◆ dataAtPts

boost::shared_ptr<DataAtIntegrationPts> EshelbianPlasticity::HMHNeohookean::OpTangent::dataAtPts
private

Definition at line 444 of file HMHNeohookean.cpp.


The documentation for this struct was generated from the following file: