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

Classes

struct  BlockData
 
struct  OpCalculateHelmholtzFreeEnergy
 Calculate energy density for Hencky material model. More...
 
struct  OpCalculateStretchFromStress
 
struct  OpHenckyJacobian
 
struct  OpSpatialPhysical
 
struct  OpSpatialPhysical_du_du
 
struct  OpSpatialPhysicalExternalStrain
 
struct  OpTopoSpatialPhysical
 

Public Member Functions

 HMHHencky (MoFEM::Interface &m_field, const double E, const double nu, const Features features)
 
UserDataOperatorreturnOpJacobian (const bool eval_rhs, const bool eval_lhs, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr) override
 
VolUserDataOperatorreturnOpSpatialPhysical (const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha_u) override
 
VolUserDataOperatorreturnOpSpatialPhysicalExternalStrain (const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< ExternalStrainVec > external_strain_vec_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv) override
 
VolUserDataOperatorreturnOpSpatialPhysical_du_du (std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha) override
 
VolUserDataOperatorreturnOpCalculateHelmholtzFreeEnergy (boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< double > total_helmholtz_free_energy_ptr) override
 
bool providesHelmholtzFreeEnergy () const override
 
VolUserDataOperatorreturnOpCalculateStretchFromStress (boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr, boost::shared_ptr< MatrixDouble > strain_ptr) override
 
VolUserDataOperatorreturnOpCalculateStretchFromStress (boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr, boost::shared_ptr< MatrixDouble > strain_ptr, boost::shared_ptr< MatrixDouble > stress_ptr, VectorPtr external_pressure_ptr) override
 
VolUserDataOperatorreturnOpCalculateVarStretchFromStress (boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr) override
 
MoFEMErrorCode getOptions ()
 
MoFEMErrorCode extractBlockData (Sev sev)
 
MoFEMErrorCode extractBlockData (std::vector< const CubitMeshSets * > meshset_vec_ptr, Sev sev)
 
template<int STRIDEMATD, typename OP_PTR >
MoFEMErrorCode computeMaterialParamsAtPts (OP_PTR op_ptr, EntitiesFieldData::EntData &data, boost::shared_ptr< DataAtIntegrationPts > dataAtGaussPts)
 
virtual VolUserDataOperatorreturnOpTopoSpatialPhysical (const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, SmartPetscObj< Vec > assemble_vec, boost::shared_ptr< TopologicalData > topo_ptr, const double alpha_u, boost::shared_ptr< double > J_ptr) override
 
- Public Member Functions inherited from EshelbianPlasticity::PhysicalEquations
 PhysicalEquations (MaterialModel model, Features features)
 
virtual ~PhysicalEquations ()=default
 
MoFEMErrorCode checkSetup (const EshelbianCore &ep) const
 Check material capabilities after geometry and boundary setup.
 
MaterialModel getMaterialModel () const
 
const FeaturesgetFeatures () const
 
std::vector< FieldDefinitiongetMaterialFieldDefinitions (const EshelbianCore &ep) const
 
std::vector< std::string > getMaterialFields (const EshelbianCore &ep) const
 Active material unknowns used by the element, DMs and field split.
 
std::vector< std::pair< std::string, std::string > > getMaterialCouplings (const EshelbianCore &ep) const
 Material-dependent blocks; each pair also represents its transpose.
 
std::vector< std::pair< std::string, std::string > > getMaterialEmptyBlocks (const EshelbianCore &ep) const
 
MoFEMErrorCode pushMaterialFields (const EshelbianCore &ep, boost::ptr_deque< UserDataOperator > &pipeline, boost::shared_ptr< DataAtIntegrationPts > data_ptr, FieldState state=CURRENT)
 Evaluate the selected fields, or recover stretch from the matching stress.
 
MoFEMErrorCode pushMaterialRates (const EshelbianCore &ep, boost::ptr_deque< UserDataOperator > &pipeline, boost::shared_ptr< DataAtIntegrationPts > data_ptr)
 
MoFEMErrorCode pushMaterialEvaluation (const EshelbianCore &ep, boost::ptr_deque< UserDataOperator > &pipeline, boost::shared_ptr< DataAtIntegrationPts > data_ptr, bool rhs, bool lhs)
 Evaluate constitutive data after kinematics and before material assembly.
 
virtual MoFEMErrorCode pushHelmholtzStateGradient (const EshelbianCore &ep, boost::ptr_deque< UserDataOperator > &pipeline, boost::shared_ptr< DataAtIntegrationPts > data_ptr)
 Assemble the physical Helmholtz state derivative at equilibrium.
 
MoFEMErrorCode pushStretchFromStress (const EshelbianCore &ep, boost::ptr_deque< UserDataOperator > &pipeline, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< MatrixDouble > strain_ptr=nullptr, boost::shared_ptr< MatrixDouble > stress_ptr=nullptr)
 
MoFEMErrorCode pushMaterialResidual (const EshelbianCore &ep, boost::ptr_deque< UserDataOperator > &pipeline, boost::shared_ptr< DataAtIntegrationPts > data_ptr)
 
MoFEMErrorCode pushMaterialTangent (const EshelbianCore &ep, boost::ptr_deque< UserDataOperator > &pipeline, boost::shared_ptr< DataAtIntegrationPts > data_ptr)
 
MoFEMErrorCode pushEnergyEvaluation (const EshelbianCore &ep, boost::ptr_deque< UserDataOperator > &pipeline, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< double > total_energy_ptr)
 
MoFEMErrorCode pushMaterialForceFields (const EshelbianCore &ep, boost::ptr_deque< UserDataOperator > &pipeline, boost::shared_ptr< DataAtIntegrationPts > data_ptr)
 
MoFEMErrorCode pushPostProc (const EshelbianCore &ep, boost::ptr_deque< UserDataOperator > &pipeline, boost::shared_ptr< DataAtIntegrationPts > data_ptr, MaterialPostProcData &output)
 
MoFEMErrorCode pushMaterialVariation (const EshelbianCore &ep, boost::ptr_deque< UserDataOperator > &pipeline, boost::shared_ptr< DataAtIntegrationPts > data_ptr, SmartPetscObj< Vec > variation, MaterialPostProcData *output=nullptr)
 
MoFEMErrorCode pushPostProcResidual (const EshelbianCore &ep, boost::ptr_deque< UserDataOperator > &pipeline, boost::shared_ptr< DataAtIntegrationPts > data_ptr, SmartPetscObj< Vec > residual, MaterialPostProcData &output)
 
MoFEMErrorCode pushSkeletonEvaluation (const EshelbianCore &ep, VolumeElementForcesAndSourcesCoreOnSide &fe, boost::shared_ptr< DataAtIntegrationPts > data_ptr, SmartPetscObj< Vec > residual, MaterialPostProcData &output)
 
virtual MoFEMErrorCode pushAuxiliaryLogarithmicStressOps (const EshelbianCore &ep, boost::ptr_deque< UserDataOperator > &pipeline, boost::shared_ptr< DataAtIntegrationPts > data_ptr, bool lhs)
 Assemble the selected material field group after kinematic reconstruction.
 
virtual MoFEMErrorCode pushAuxiliaryLogarithmicMaterialEvaluation (const EshelbianCore &ep, boost::ptr_deque< UserDataOperator > &pipeline, boost::shared_ptr< DataAtIntegrationPts > data_ptr, bool lhs=false)
 Evaluate the auxiliary material copy and energies without assembly.
 
virtual VolUserDataOperatorreturnOpCalculateStretchFromStress (boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr, boost::shared_ptr< MatrixDouble > strain_ptr, VectorPtr external_pressure_ptr)
 
virtual VolUserDataOperatorreturnOpCalculateExternalPressure (VectorPtr external_pressure_ptr, boost::shared_ptr< ExternalStrainVec > external_strain_vec_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv)
 

Static Public Attributes

static constexpr int StrideMatD
 
- Static Public Attributes inherited from EshelbianPlasticity::PhysicalEquations
static const Features noStretchMask
 

Private Types

enum  HenckyMatType { HOMOGENEOUS , HETEROGENEOUS , ANALYTICAL }
 

Private Attributes

MoFEM::InterfacemField
 
std::vector< BlockDatablockData
 
double E
 
double nu
 
PetscBool effectiveNehookeanStiffness = PETSC_FALSE
 
double effectiveDiagonalStrain = 0
 

Additional Inherited Members

- Public Types inherited from EshelbianPlasticity::PhysicalEquations
enum  MaterialModel {
  StVenantKirchhoff , MooneyRivlin , Hencky , Neohookean ,
  Meta , LastMaterial
}
 
enum  Feature {
  DIRECT_STRETCH = 0 , NO_STRETCH_LINEAR , NO_STRETCH_NONLINEAR , AUXILIARY_LOGARITHMIC_STRESS ,
  NON_HOMOGENEOUS_MATERIAL , LAST_FEATURE
}
 
enum  FieldState { CURRENT , PREVIOUS }
 
using Features = std::bitset< LAST_FEATURE >
 
- Static Public Member Functions inherited from EshelbianPlasticity::PhysicalEquations
static MoFEMErrorCode create (EshelbianCore &ep)
 Select and configure the material before registering fields and DMs.
 
- Protected Attributes inherited from EshelbianPlasticity::PhysicalEquations
Features materialFeatures
 

Detailed Description

Definition at line 37 of file HMHHencky.cpp.

Member Enumeration Documentation

◆ HenckyMatType

Enumerator
HOMOGENEOUS 
HETEROGENEOUS 
ANALYTICAL 

Definition at line 647 of file HMHHencky.cpp.

Constructor & Destructor Documentation

◆ HMHHencky()

EshelbianPlasticity::HMHHencky::HMHHencky ( MoFEM::Interface m_field,
const double  E,
const double  nu,
const Features  features 
)
inline

Definition at line 39 of file HMHHencky.cpp.

41 : PhysicalEquations(Hencky, features), mField(m_field), E(E), nu(nu) {
42 CHK_THROW_MESSAGE(getOptions(), "getOptions failed");
44 "Can not get data from block");
45 for (const auto &block : blockData) {
46 if (block.matType != HenckyMatType::HOMOGENEOUS) {
48 MOFEM_LOG("WORLD", Sev::verbose)
49 << "Found non-homogeneous material block: " << block.blockName;
50 break;
51 }
52 }
53 }
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
const char features[]
#define MOFEM_LOG(channel, severity)
Log.
MoFEMErrorCode extractBlockData(Sev sev)
std::vector< BlockData > blockData
PhysicalEquations(MaterialModel model, Features features)

Member Function Documentation

◆ computeMaterialParamsAtPts()

template<int STRIDEMATD, typename OP_PTR >
MoFEMErrorCode EshelbianPlasticity::HMHHencky::computeMaterialParamsAtPts ( OP_PTR  op_ptr,
EntitiesFieldData::EntData &  data,
boost::shared_ptr< DataAtIntegrationPts dataAtGaussPts 
)
inline

Definition at line 382 of file HMHHencky.cpp.

384 {
386
387 auto getMaterialParams = [&](double E, double nu) {
390 }
391
392 const double bulk_modulus_K = E / (3 * (1 - 2 * nu));
393 const double shear_modulus_G = E / (2 * (1 + nu));
394 const double lambda = bulk_modulus_K - 2 * shear_modulus_G / 3;
395 return EffectiveElasticParams{E, nu, bulk_modulus_K, shear_modulus_G,
396 lambda};
397 };
398
399 auto fe_ent = op_ptr->getNumeredEntFiniteElementPtr()->getEnt();
400 int nb_integration_pts = op_ptr->getGaussPts().size2();
401
402 dataAtGaussPts->muAtPts.resize(nb_integration_pts, false);
403 dataAtGaussPts->lambdaAtPts.resize(nb_integration_pts, false);
404 dataAtGaussPts->muAtPts.clear();
405 dataAtGaussPts->lambdaAtPts.clear();
406
407 dataAtGaussPts->youngModulusAtPts.resize(nb_integration_pts, false);
408 dataAtGaussPts->youngModulusAtPts.clear();
409
410 auto t_young_modulus =
411 getFTensor0FromVec(dataAtGaussPts->youngModulusAtPts);
412 auto t_mu = getFTensor0FromVec(dataAtGaussPts->muAtPts);
413 auto t_lambda = getFTensor0FromVec(dataAtGaussPts->lambdaAtPts);
414
415 MatrixSizeHelper<
416 GetFTensor4DdgFromMatType<SPACE_DIM, SPACE_DIM, STRIDEMATD, DL>,
417 DL>::size(dataAtGaussPts->matD, nb_integration_pts);
418 MatrixSizeHelper<
419 GetFTensor4DdgFromMatType<SPACE_DIM, SPACE_DIM, STRIDEMATD, DL>,
420 DL>::size(dataAtGaussPts->matAxiatorD, nb_integration_pts);
421 MatrixSizeHelper<
422 GetFTensor4DdgFromMatType<SPACE_DIM, SPACE_DIM, STRIDEMATD, DL>,
423 DL>::size(dataAtGaussPts->matDeviatorD, nb_integration_pts);
424 MatrixSizeHelper<
425 GetFTensor4DdgFromMatType<SPACE_DIM, SPACE_DIM, STRIDEMATD, DL>,
426 DL>::size(dataAtGaussPts->matInvD, nb_integration_pts);
427
428 dataAtGaussPts->matD.clear();
429 dataAtGaussPts->matAxiatorD.clear();
430 dataAtGaussPts->matDeviatorD.clear();
431 dataAtGaussPts->matInvD.clear();
432
438
439 auto t_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, STRIDEMATD>(
440 dataAtGaussPts->matD);
441 auto t_axiator_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, STRIDEMATD>(
442 dataAtGaussPts->matAxiatorD);
443 auto t_deviator_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, STRIDEMATD>(
444 dataAtGaussPts->matDeviatorD);
445 auto t_inv_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, STRIDEMATD>(
446 dataAtGaussPts->matInvD);
447
448 auto next = [&]() {
449 ++t_young_modulus;
450 ++t_mu;
451 ++t_lambda;
452 ++t_D;
453 ++t_axiator_D;
454 ++t_deviator_D;
455 ++t_inv_D;
456 };
457
458 auto evalMatD = [&](double bulk_modulus_K, double shear_modulus_G) {
460 t_axiator_D(i, j, k, l) = (bulk_modulus_K - (2. / 3.) * shear_modulus_G) *
461 t_kd(i, j) * t_kd(k, l);
462 t_deviator_D(i, j, k, l) =
463 2 * shear_modulus_G * ((t_kd(i, k) ^ t_kd(j, l)) / 4.);
464 t_D(i, j, k, l) = t_axiator_D(i, j, k, l) + t_deviator_D(i, j, k, l);
466 };
467
468 auto evalInvMatDPtr = [&](double bulk_modulus_K, double shear_modulus_G) {
470 const double A = 1. / (2. * shear_modulus_G);
471 const double B =
472 (1. / (9. * bulk_modulus_K)) - (1. / (6. * shear_modulus_G));
473 t_inv_D(i, j, k, l) =
474 A * ((t_kd(i, k) ^ t_kd(j, l)) / 4.) + B * t_kd(i, j) * t_kd(k, l);
476 };
477
478 // from block data (MAT_ELASTIC) or (ANALYTICAL_ELASTIC) if provided,
479 // otherwise from command line options
480 for (auto &b : this->blockData) {
481 if (b.blockEnts.find(op_ptr->getFEEntityHandle()) != b.blockEnts.end()) {
482
483 if (b.matType == HMHHencky::HenckyMatType::ANALYTICAL) {
485 analytical_elastic = getAnalyticalElastic(op_ptr, b.blockName);
486
487 auto t_analytical_elastic = getFTensor0FromVec(analytical_elastic);
488
489 for (int gg = 0; gg != nb_integration_pts; ++gg) {
490 const auto material_params =
491 getMaterialParams(t_analytical_elastic, b.poissonRatio);
492 t_young_modulus = material_params.youngModulus;
493 t_mu = material_params.shearModulusG;
494 t_lambda = material_params.lambda;
495
496 CHKERR evalMatD(material_params.bulkModulusK,
497 material_params.shearModulusG);
498 CHKERR evalInvMatDPtr(material_params.bulkModulusK,
499 material_params.shearModulusG);
500 ++t_analytical_elastic;
501 next();
502 }
503
504 } else if (b.matType == HMHHencky::HenckyMatType::HETEROGENEOUS) {
505 Tag tag_heterogenous_mat;
506 CHKERR op_ptr->getPtrFE()->mField.get_moab().tag_get_handle(
508 tag_heterogenous_mat);
509 int tag_length;
510 CHKERR op_ptr->getPtrFE()->mField.get_moab().tag_get_length(
511 tag_heterogenous_mat, tag_length);
512 if (tag_length != 1) {
513 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
514 "heterogeneous Young's modulus tag should be 1 but is %d",
515 tag_length);
516 }
518 // Constant interpolation (element-wise)
519 double elem_young_mod = 0.0;
520 CHKERR op_ptr->getPtrFE()->mField.get_moab().tag_get_data(
521 tag_heterogenous_mat, &fe_ent, 1, &elem_young_mod);
522
523 for (int gg = 0; gg != nb_integration_pts; ++gg) {
524 const auto material_params =
525 getMaterialParams(elem_young_mod, b.poissonRatio);
526 t_young_modulus = material_params.youngModulus;
527 t_mu = material_params.shearModulusG;
528 t_lambda = material_params.lambda;
529
530 CHKERR evalMatD(material_params.bulkModulusK,
531 material_params.shearModulusG);
532 CHKERR evalInvMatDPtr(material_params.bulkModulusK,
533 material_params.shearModulusG);
534 next();
535 }
537 // Linear interpolation (vertex-based)
538 const EntityHandle *vert_conn;
539 int vert_num;
540 CHKERR op_ptr->getPtrFE()->mField.get_moab().get_connectivity(
541 fe_ent, vert_conn, vert_num, true);
542
543 VectorDouble vert_young_mod(vert_num);
544 CHKERR op_ptr->getPtrFE()->mField.get_moab().tag_get_data(
545 tag_heterogenous_mat, vert_conn, vert_num, &vert_young_mod[0]);
546
547 auto t_shape_n = data.getFTensor0N();
548 int nb_shape_fn = data.getN(NOBASE).size2();
549
550 for (int gg = 0; gg != nb_integration_pts; ++gg) {
551 t_young_modulus = 0; // Initialize to zero before accumulation
552 auto t_vert_young_mod = getFTensor0FromVec(vert_young_mod);
553 for (int bb = 0; bb != nb_shape_fn; ++bb) {
554 t_young_modulus += t_vert_young_mod * t_shape_n;
555 ++t_vert_young_mod;
556 ++t_shape_n;
557 }
558 const auto material_params =
559 getMaterialParams(t_young_modulus, b.poissonRatio);
560 t_young_modulus = material_params.youngModulus;
561 t_mu = material_params.shearModulusG;
562 t_lambda = material_params.lambda;
563
564 CHKERR evalMatD(material_params.bulkModulusK,
565 material_params.shearModulusG);
566 CHKERR evalInvMatDPtr(material_params.bulkModulusK,
567 material_params.shearModulusG);
568 next();
569 }
570 } else {
571 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
572 "Unsupported heterogeneous Young's modulus interpolation "
573 "order %d",
575 }
576 } else {
577 // MAT_ELASTIC block with homogeneous material properties
578 for (int gg = 0; gg != nb_integration_pts; ++gg) {
579 t_young_modulus = b.youngModulus;
580 t_mu = b.shearModulusG;
581 t_lambda = b.bulkModulusK - 2 * b.shearModulusG / 3;
582
583 CHKERR evalMatD(b.bulkModulusK, b.shearModulusG);
584 CHKERR evalInvMatDPtr(b.bulkModulusK, b.shearModulusG);
585 next();
586 }
587 }
589 }
590 }
591
592 // From command line options if no block data is provided
593 const auto material_params = getMaterialParams(this->E, this->nu);
594
595 for (int gg = 0; gg != nb_integration_pts; ++gg) {
596 t_young_modulus = material_params.youngModulus;
597 t_mu = material_params.shearModulusG;
598 t_lambda = material_params.lambda;
599 CHKERR evalMatD(material_params.bulkModulusK,
600 material_params.shearModulusG);
601 CHKERR evalInvMatDPtr(material_params.bulkModulusK,
602 material_params.shearModulusG);
603 next();
604 }
605
607 }
#define FTENSOR_INDEX(DIM, I)
constexpr int SPACE_DIM
Kronecker Delta class symmetric.
@ NOBASE
Definition definitions.h:59
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
@ MOFEM_NOT_IMPLEMENTED
Definition definitions.h:32
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
double bulk_modulus_K
double shear_modulus_G
constexpr auto t_kd
FTensor::Index< 'i', SPACE_DIM > i
static double lambda
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
static auto calc_effective_elastic_params(double E, double nu, double diagonal_strain)
Definition HMHHencky.cpp:20
VectorDouble getAnalyticalElastic(OP_PTR op_ptr, const std::string block_name)
DataLayoutTraits< DataLayout::GaussByCoeffs > DL
UBlasVector< double > VectorDouble
Definition Types.hpp:68
analytical_elastic(delta_t, t, x, y, z, block_name)
constexpr AssemblyType A
static std::string heterogeneousYoungModTagName
static int meshTransferInterpOrder

◆ extractBlockData() [1/2]

MoFEMErrorCode EshelbianPlasticity::HMHHencky::extractBlockData ( Sev  sev)
inline

Definition at line 307 of file HMHHencky.cpp.

307 {
308 return extractBlockData(
309
310 mField.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
311
312 (boost::format("(.*)%s(.*)") % "_ELASTIC").str()
313
314 )),
315
316 sev);
317 }
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.

◆ extractBlockData() [2/2]

MoFEMErrorCode EshelbianPlasticity::HMHHencky::extractBlockData ( std::vector< const CubitMeshSets * >  meshset_vec_ptr,
Sev  sev 
)
inline

Definition at line 320 of file HMHHencky.cpp.

321 {
323
324 for (auto m : meshset_vec_ptr) {
325 MOFEM_TAG_AND_LOG("WORLD", sev, "MatBlock") << *m;
326 std::string block_name = m->getName();
327
328 auto block_name_heterogeneous = "(.*)HETEROGENEOUS_ELASTIC(.*)";
329 auto block_name_analytical = "(.*)ANALYTICAL_ELASTIC(.*)";
330 std::regex reg_name_heterogeneous(block_name_heterogeneous);
331 std::regex reg_name_analytical(block_name_analytical);
332 const bool is_heterogeneous =
333 std::regex_match(block_name, reg_name_heterogeneous);
334 const bool is_analytical =
335 std::regex_match(block_name, reg_name_analytical);
336
337 std::vector<double> block_data;
338 CHKERR m->getAttributes(block_data);
339 if (block_data.size() < 2) {
340 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
341 "Expected that block has atleast two attributes");
342 }
343 auto get_block_ents = [&]() {
344 Range ents;
345 CHKERR mField.get_moab().get_entities_by_handle(m->meshset, ents, true);
346 return ents;
347 };
348
349 double young_modulus = block_data[0];
350 double poisson_ratio = block_data[1];
351
353 if (is_heterogeneous) {
355 } else if (is_analytical) {
356 mat_type = HenckyMatType::ANALYTICAL;
357 }
358
360 mat_type == HenckyMatType::HOMOGENEOUS) {
361 const auto effective_params = calc_effective_elastic_params(
363 young_modulus = effective_params.youngModulus;
364 poisson_ratio = effective_params.poissonRatio;
365 }
366
367 double bulk_modulus_K = young_modulus / (3 * (1 - 2 * poisson_ratio));
368 double shear_modulus_G = young_modulus / (2 * (1 + poisson_ratio));
369
370 MOFEM_TAG_AND_LOG("WORLD", sev, "MatBlock")
371 << "E = " << young_modulus << " nu = " << poisson_ratio;
372
373 blockData.push_back({block_name, young_modulus, poisson_ratio,
374 bulk_modulus_K, shear_modulus_G, get_block_ents(),
375 mat_type});
376 }
377 MOFEM_LOG_CHANNEL("WORLD");
379 }
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
FTensor::Index< 'm', 3 > m
virtual moab::Interface & get_moab()=0
double young_modulus
Young modulus.
Definition plastic.cpp:125
double poisson_ratio
Poisson ratio.
Definition plastic.cpp:126

◆ getOptions()

MoFEMErrorCode EshelbianPlasticity::HMHHencky::getOptions ( )
inline

Definition at line 276 of file HMHHencky.cpp.

276 {
278 PetscOptionsBegin(PETSC_COMM_WORLD, "hencky_", "", "none");
279
280 CHKERR PetscOptionsScalar("-young_modulus", "Young modulus", "", E, &E,
281 PETSC_NULLPTR);
282 CHKERR PetscOptionsScalar("-poisson_ratio", "poisson ratio", "", nu, &nu,
283 PETSC_NULLPTR);
284 CHKERR PetscOptionsBool("-effective_neohookean_stiffness",
285 "Use effective Neo-Hookean stiffness", "",
287 &effectiveNehookeanStiffness, PETSC_NULLPTR);
288 CHKERR PetscOptionsScalar("-effective_diagonal_strain",
289 "Diagonal logarithmic strain for effective "
290 "Neo-Hookean stiffness",
292 &effectiveDiagonalStrain, PETSC_NULLPTR);
293
294 PetscOptionsEnd();
295
296 MOFEM_LOG("EP", Sev::inform)
297 << "Hencky: E = " << E << " nu = " << nu
298 << " effective_neohookean_stiffness = "
299 << (effectiveNehookeanStiffness ? "true" : "false")
300 << " effective_diagonal_strain = " << effectiveDiagonalStrain;
301
302 CHKERRG(ierr);
303
305 }
static PetscErrorCode ierr
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.

◆ providesHelmholtzFreeEnergy()

bool EshelbianPlasticity::HMHHencky::providesHelmholtzFreeEnergy ( ) const
inlineoverridevirtual

True when the material supplies its Helmholtz free energy.

Reimplemented from EshelbianPlasticity::PhysicalEquations.

Definition at line 211 of file HMHHencky.cpp.

211{ return true; }

◆ returnOpCalculateHelmholtzFreeEnergy()

VolUserDataOperator * EshelbianPlasticity::HMHHencky::returnOpCalculateHelmholtzFreeEnergy ( boost::shared_ptr< DataAtIntegrationPts data_ptr,
boost::shared_ptr< double total_helmholtz_free_energy_ptr 
)
inlineoverridevirtual

Reimplemented from EshelbianPlasticity::PhysicalEquations.

Definition at line 198 of file HMHHencky.cpp.

200 {
201
203 return new OpCalculateHelmholtzFreeEnergy<StrideMatD>(
204 data_ptr, total_helmholtz_free_energy_ptr);
205 } else {
206 return new OpCalculateHelmholtzFreeEnergy<0>(
207 data_ptr, total_helmholtz_free_energy_ptr);
208 }
209 }

◆ returnOpCalculateStretchFromStress() [1/2]

VolUserDataOperator * EshelbianPlasticity::HMHHencky::returnOpCalculateStretchFromStress ( boost::shared_ptr< DataAtIntegrationPts data_ptr,
boost::shared_ptr< PhysicalEquations physics_ptr,
boost::shared_ptr< MatrixDouble >  strain_ptr 
)
inlineoverridevirtual

Reimplemented from EshelbianPlasticity::PhysicalEquations.

Definition at line 230 of file HMHHencky.cpp.

233 {
235 std::move(data_ptr), std::move(physics_ptr), std::move(strain_ptr),
236 nullptr, nullptr);
237 }
VolUserDataOperator * returnOpCalculateStretchFromStress(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr, boost::shared_ptr< MatrixDouble > strain_ptr) override

◆ returnOpCalculateStretchFromStress() [2/2]

VolUserDataOperator * EshelbianPlasticity::HMHHencky::returnOpCalculateStretchFromStress ( boost::shared_ptr< DataAtIntegrationPts data_ptr,
boost::shared_ptr< PhysicalEquations physics_ptr,
boost::shared_ptr< MatrixDouble >  strain_ptr,
boost::shared_ptr< MatrixDouble >  stress_ptr,
VectorPtr  external_pressure_ptr 
)
inlineoverridevirtual

Reimplemented from EshelbianPlasticity::PhysicalEquations.

Definition at line 239 of file HMHHencky.cpp.

244 {
245 auto hencky_ptr = boost::dynamic_pointer_cast<HMHHencky>(physics_ptr);
246
248 return new OpCalculateStretchFromStress<StrideMatD>(
249 data_ptr,
250 strain_ptr ? strain_ptr : data_ptr->getLogStretchTensorAtPts(),
251 stress_ptr ? stress_ptr : data_ptr->getApproxPAtPts(), hencky_ptr);
252 } else {
253 return new OpCalculateStretchFromStress<0>(
254 data_ptr,
255 strain_ptr ? strain_ptr : data_ptr->getLogStretchTensorAtPts(),
256 stress_ptr ? stress_ptr : data_ptr->getApproxPAtPts(), hencky_ptr);
257 }
258 }

◆ returnOpCalculateVarStretchFromStress()

VolUserDataOperator * EshelbianPlasticity::HMHHencky::returnOpCalculateVarStretchFromStress ( boost::shared_ptr< DataAtIntegrationPts data_ptr,
boost::shared_ptr< PhysicalEquations physics_ptr 
)
inlineoverridevirtual

Reimplemented from EshelbianPlasticity::PhysicalEquations.

Definition at line 260 of file HMHHencky.cpp.

262 {
263 auto hencky_ptr = boost::dynamic_pointer_cast<HMHHencky>(physics_ptr);
264
266 return new OpCalculateStretchFromStress<StrideMatD>(
267 data_ptr, data_ptr->getVarLogStreachPts(), data_ptr->getVarPiolaPts(),
268 hencky_ptr);
269 } else {
270 return new OpCalculateStretchFromStress<0>(
271 data_ptr, data_ptr->getVarLogStreachPts(), data_ptr->getVarPiolaPts(),
272 hencky_ptr);
273 }
274 }

◆ returnOpJacobian()

UserDataOperator * EshelbianPlasticity::HMHHencky::returnOpJacobian ( const bool  eval_rhs,
const bool  eval_lhs,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
boost::shared_ptr< PhysicalEquations physics_ptr 
)
inlineoverridevirtual

Reimplemented from EshelbianPlasticity::PhysicalEquations.

Definition at line 84 of file HMHHencky.cpp.

86 {
87
88 auto hencky_ptr = boost::dynamic_pointer_cast<HMHHencky>(physics_ptr);
89
91 return new OpHenckyJacobian<StrideMatD>(data_ptr, hencky_ptr);
92 return new OpHenckyJacobian<0>(data_ptr, hencky_ptr);
93 }

◆ returnOpSpatialPhysical()

VolUserDataOperator * EshelbianPlasticity::HMHHencky::returnOpSpatialPhysical ( const std::string &  field_name,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
const double  alpha_u 
)
inlineoverridevirtual

Reimplemented from EshelbianPlasticity::PhysicalEquations.

Definition at line 111 of file HMHHencky.cpp.

113 {
115 return new OpSpatialPhysical<StrideMatD>(field_name, data_ptr, alpha_u);
116 } else {
117 return new OpSpatialPhysical<0>(field_name, data_ptr, alpha_u);
118 }
119 }
constexpr auto field_name

◆ returnOpSpatialPhysical_du_du()

VolUserDataOperator * EshelbianPlasticity::HMHHencky::returnOpSpatialPhysical_du_du ( std::string  row_field,
std::string  col_field,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
const double  alpha 
)
inlineoverridevirtual

Reimplemented from EshelbianPlasticity::PhysicalEquations.

Definition at line 157 of file HMHHencky.cpp.

160 {
161
163 return new OpSpatialPhysical_du_du<StrideMatD>(row_field, col_field,
164 data_ptr, alpha);
165 } else {
166 return new OpSpatialPhysical_du_du<0>(row_field, col_field, data_ptr,
167 alpha);
168 }
169 }

◆ returnOpSpatialPhysicalExternalStrain()

VolUserDataOperator * EshelbianPlasticity::HMHHencky::returnOpSpatialPhysicalExternalStrain ( const std::string &  field_name,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
boost::shared_ptr< ExternalStrainVec external_strain_vec_ptr,
std::map< std::string, boost::shared_ptr< ScalingMethod > >  smv 
)
inlineoverridevirtual

Reimplemented from EshelbianPlasticity::PhysicalEquations.

Definition at line 135 of file HMHHencky.cpp.

139 {
140 return new OpSpatialPhysicalExternalStrain(field_name, data_ptr,
141 external_strain_vec_ptr, smv);
142 }

◆ returnOpTopoSpatialPhysical()

virtual VolUserDataOperator * EshelbianPlasticity::HMHHencky::returnOpTopoSpatialPhysical ( const std::string &  field_name,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
SmartPetscObj< Vec >  assemble_vec,
boost::shared_ptr< TopologicalData topo_ptr,
const double  alpha_u,
boost::shared_ptr< double J_ptr 
)
inlineoverridevirtual

Reimplemented from EshelbianPlasticity::PhysicalEquations.

Definition at line 634 of file HMHHencky.cpp.

639 {
640 return new OpTopoSpatialPhysical(field_name, data_ptr, assemble_vec,
641 topo_ptr, alpha_u, J_ptr);
642 }

Member Data Documentation

◆ blockData

std::vector<BlockData> EshelbianPlasticity::HMHHencky::blockData
private

Definition at line 657 of file HMHHencky.cpp.

◆ E

double EshelbianPlasticity::HMHHencky::E
private

Definition at line 659 of file HMHHencky.cpp.

◆ effectiveDiagonalStrain

double EshelbianPlasticity::HMHHencky::effectiveDiagonalStrain = 0
private

Definition at line 662 of file HMHHencky.cpp.

◆ effectiveNehookeanStiffness

PetscBool EshelbianPlasticity::HMHHencky::effectiveNehookeanStiffness = PETSC_FALSE
private

Definition at line 661 of file HMHHencky.cpp.

◆ mField

MoFEM::Interface& EshelbianPlasticity::HMHHencky::mField
private

Definition at line 645 of file HMHHencky.cpp.

◆ nu

double EshelbianPlasticity::HMHHencky::nu
private

Definition at line 660 of file HMHHencky.cpp.

◆ StrideMatD

constexpr int EshelbianPlasticity::HMHHencky::StrideMatD
staticconstexpr

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