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

Public Member Functions

 OpResidual (const std::string &field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha_u)
 
MoFEMErrorCode iNtegrate (EntData &row_data) override
 

Private Attributes

boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 
const double alphaU
 

Detailed Description

Definition at line 266 of file HMHNeohookean.cpp.

Constructor & Destructor Documentation

◆ OpResidual()

EshelbianPlasticity::HMHNeohookean::OpResidual::OpResidual ( const std::string &  field,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
const double  alpha_u 
)
inline

Definition at line 267 of file HMHNeohookean.cpp.

270 : FormBase(field, field, FormBase::OPROW),
271 dataAtPts(std::move(data_ptr)), alphaU(alpha_u) {
273 "Unsupported direct Neo-Hookean configuration");
274 if (!std::isfinite(alphaU))
276 "Neo-Hookean stretch viscosity must be finite");
277 }
#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::OpResidual::iNtegrate ( EntData row_data)
inlineoverride

Definition at line 279 of file HMHNeohookean.cpp.

279 {
281 FTENSOR_INDEXES(3, i, j);
283 const auto t_packed_basis = FTensor::SymmLTensor<double, 3>();
284 const auto material_ptr = getMaterial(dataAtPts);
285 const auto parameters = material_ptr->getParameters(getFEEntityHandle());
286 const double alpha_grad_u = material_ptr->alphaGradU;
287 auto t_h = dataAtPts->getFTensorLogStretch(nbIntegrationPts);
288 auto t_physical = dataAtPts->getFTensorAdjointPdU(nbIntegrationPts);
289 // Inactive viscosity terms do not introduce rate-data dependencies.
290 std::optional<decltype(dataAtPts->getFTensorLogStretchDot(
291 nbIntegrationPts))>
292 t_dot_h;
293 std::optional<decltype(dataAtPts->getFTensorGradLogStretchDot(
294 nbIntegrationPts))>
295 t_grad_dot_h;
296 if (alphaU != 0.)
297 t_dot_h.emplace(dataAtPts->getFTensorLogStretchDot(nbIntegrationPts));
298 if (alpha_grad_u != 0.)
299 t_grad_dot_h.emplace(
300 dataAtPts->getFTensorGradLogStretchDot(nbIntegrationPts));
301 auto t_row = row_data.getFTensor0N();
302 auto t_grad_row = row_data.getFTensor1DiffN<3>();
303 auto t_weight = getFTensor0IntegrationWeight();
304 for (int gg = 0; gg != nbIntegrationPts; ++gg) {
305 Material::SymmetricTensor t_log_stretch;
306 t_log_stretch(i, j) = t_h(i, j);
307 PackedStress t_stress;
308 double energy;
309 CHKERR evaluateDirect(parameters, t_log_stretch, energy, &t_stress);
310 const double alpha = getMeasure() * t_weight;
311 PackedStress t_residual;
312 t_residual(L) = t_stress(L) - t_physical(L);
313 if (t_dot_h)
314 t_residual(L) +=
315 alphaU * (t_packed_basis(i, j, L) * (*t_dot_h)(i, j));
317 t_gradient(L, i) = 0.;
318 if (t_grad_dot_h)
319 t_gradient(L, i) = alpha_grad_u * (*t_grad_dot_h)(L, i);
320 auto t_nf = getNf<size_symm>();
321 int rr = 0;
322 for (; rr != nbRows / size_symm; ++rr) {
323 t_nf(L) += alpha *
324 (t_row * t_residual(L) + t_grad_row(i) * t_gradient(L, i));
325 ++t_nf;
326 ++t_row;
327 ++t_grad_row;
328 }
329 for (; rr != nbRowBaseFunctions; ++rr) {
330 ++t_row;
331 ++t_grad_row;
332 }
333 ++t_weight;
334 ++t_h;
335 ++t_physical;
336 if (t_dot_h)
337 ++*t_dot_h;
338 if (t_grad_dot_h)
339 ++*t_grad_dot_h;
340 }
342 }
#define FTENSOR_INDEXES(DIM,...)
#define FTENSOR_INDEX(DIM, I)
#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', 3 > j
static constexpr auto size_symm
static boost::shared_ptr< HMHNeohookean > getMaterial(const boost::shared_ptr< DataAtIntegrationPts > &data_ptr)
FTensor::Tensor1< double, size_symm > PackedStress
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::OpResidual::alphaU
private

Definition at line 346 of file HMHNeohookean.cpp.

◆ dataAtPts

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

Definition at line 345 of file HMHNeohookean.cpp.


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