601 {
603
605 OpMatBlocks(std::string
field_name, boost::shared_ptr<MatrixDouble>
m,
608 std::vector<const CubitMeshSets *> meshset_vec_ptr,
613 std::fill(&(doEntities[MBEDGE]), &(doEntities[MBMAXTYPE]), false);
615 "Can not get data from block");
616 }
617
619 EntitiesFieldData::EntData &data) {
621
622 for (auto &b : blockData) {
623
624 if (b.blockEnts.find(getFEEntityHandle()) != b.blockEnts.end()) {
625 CHKERR getMatDPtr(matDPtr, b.bulkModulusK * scaleYoungModulus,
626 b.shearModulusG * scaleYoungModulus);
628 }
629 }
630
631 CHKERR getMatDPtr(matDPtr, bulkModulusKDefault * scaleYoungModulus,
632 shearModulusGDefault * scaleYoungModulus);
634 }
635
636 private:
637 boost::shared_ptr<MatrixDouble> matDPtr;
638 const double scaleYoungModulus;
639
641 double bulkModulusK;
642 double shearModulusG;
644 };
645
646 double bulkModulusKDefault;
647 double shearModulusGDefault;
648 std::vector<BlockData> blockData;
649
652 std::vector<const CubitMeshSets *> meshset_vec_ptr,
653 Sev sev) {
655
656 for (
auto m : meshset_vec_ptr) {
658 std::vector<double> block_data;
659 CHKERR m->getAttributes(block_data);
660 if (block_data.size() != 2) {
662 "Expected that block has two attribute");
663 }
664 auto get_block_ents = [&]() {
667 m_field.
get_moab().get_entities_by_handle(
m->meshset, ents,
true);
668 return ents;
669 };
670
675
678
679 blockData.push_back(
681 }
684 }
685
686 MoFEMErrorCode getMatDPtr(boost::shared_ptr<MatrixDouble> mat_D_ptr,
689
690 auto set_material_stiffness = [&]() {
696 double A = (DIM == 2)
699 : 1;
700 auto t_D = getFTensor4DdgFromMat<DIM, DIM, 0>(*mat_D_ptr);
705 };
706
707 constexpr auto size_symm = (DIM * (DIM + 1)) / 2;
709 set_material_stiffness();
711 }
712 };
713
716
717 CHKERR PetscOptionsBegin(PETSC_COMM_WORLD,
"hencky_",
"",
"none");
718 CHKERR PetscOptionsScalar(
"-young_modulus",
"Young modulus",
"",
E, &
E,
719 PETSC_NULL);
720 CHKERR PetscOptionsScalar(
"-poisson_ratio",
"poisson ratio",
"", nu, &nu,
721 PETSC_NULL);
722 ierr = PetscOptionsEnd();
723
726 pip.push_back(new OpMatBlocks(
728
729
730 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
731
732 (boost::format("%s(.*)") % block_name).str()
733
734 )),
736
737 ));
738
740}
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
static PetscErrorCode ierr
Kronecker Delta class symmetric.
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#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
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FTensor::Index< 'm', SPACE_DIM > m
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
double young_modulus
Young modulus.
constexpr auto field_name
virtual moab::Interface & get_moab()=0
virtual MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
Operator for bi-linear form, usually to calculate values on left hand side.
Deprecated interface functions.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.