v0.16.0
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
OpGetInternalStress< INTERP_ORDER > Struct Template Reference

#include "users_modules/eshelbian_plasticity/src/EshelbianOperators.hpp"

Inheritance diagram for OpGetInternalStress< INTERP_ORDER >:
[legend]
Collaboration diagram for OpGetInternalStress< INTERP_ORDER >:
[legend]

Public Member Functions

 OpGetInternalStress (boost::shared_ptr< DataAtIntegrationPts > data_ptr, std::string tag_name="")
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Private Attributes

boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 
std::string tagName
 

Detailed Description

template<int INTERP_ORDER>
struct OpGetInternalStress< INTERP_ORDER >
Examples
/home/lk58p/mofem_install/vanilla_dev_release/mofem-cephas/mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianPlasticity.cpp.

Definition at line 371 of file EshelbianOperators.hpp.

Constructor & Destructor Documentation

◆ OpGetInternalStress()

template<int INTERP_ORDER>
OpGetInternalStress< INTERP_ORDER >::OpGetInternalStress ( boost::shared_ptr< DataAtIntegrationPts data_ptr,
std::string  tag_name = "" 
)
inline

Definition at line 372 of file EshelbianOperators.hpp.

374 : UserDataOperator(H1, OPLAST), dataAtPts(data_ptr), tagName(tag_name) {
375 std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE], false);
376 doEntities[MBVERTEX] = true;
377 }
ForcesAndSourcesCore::UserDataOperator UserDataOperator
@ H1
continuous field
Definition definitions.h:85
boost::shared_ptr< DataAtIntegrationPts > dataAtPts

Member Function Documentation

◆ doWork() [1/3]

template<int INTERP_ORDER>
MoFEMErrorCode OpGetInternalStress< INTERP_ORDER >::doWork ( int  side,
EntityType  type,
EntData data 
)

◆ doWork() [2/3]

MoFEMErrorCode OpGetInternalStress< 0 >::doWork ( int  side,
EntityType  type,
EntData data 
)

Definition at line 1011 of file EshelbianOperators.cpp.

1012 {
1014
1015 int nb_integration_pts = getGaussPts().size2();
1016
1017 Tag tag;
1018 CHKERR getPtrFE() -> mField.get_moab().tag_get_handle(tagName.c_str(), tag);
1019 int tag_length;
1020 CHKERR getPtrFE() -> mField.get_moab().tag_get_length(tag, tag_length);
1021 if (tag_length != 9) {
1022 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1023 "Number of internal stress components should be 9 but is %d",
1024 tag_length);
1025 }
1026
1027 VectorDouble const_stress_vec(9);
1028 auto fe_ent = getNumeredEntFiniteElementPtr()->getEnt();
1029 CHKERR getPtrFE() -> mField.get_moab().tag_get_data(
1030 tag, &fe_ent, 1, &*const_stress_vec.data().begin());
1031 auto t_const_stress = getFTensor1FromArray<9, 9>(const_stress_vec);
1032
1033 auto get_internal_stress =
1035 dataAtPts->internalStressAtPts, nb_integration_pts);
1036 dataAtPts->internalStressAtPts.clear();
1037 auto t_internal_stress = get_internal_stress();
1038
1039 FTensor::Index<'L', 9> L;
1040 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1041 t_internal_stress(L) = t_const_stress(L);
1042 ++t_internal_stress;
1043 }
1044
1046}
#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
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
DataLayoutTraits< DataLayout::GaussByCoeffs > DL
Definition MatHuHu.hpp:33
decltype(GetFTensor1FromMatImpl< Tensor_Dim, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor1FromMatType

◆ doWork() [3/3]

MoFEMErrorCode OpGetInternalStress< 1 >::doWork ( int  side,
EntityType  type,
EntData data 
)

Definition at line 1049 of file EshelbianOperators.cpp.

1050 {
1052
1053 int nb_integration_pts = getGaussPts().size2();
1054
1055 Tag tag;
1056 CHKERR getPtrFE() -> mField.get_moab().tag_get_handle(tagName.c_str(), tag);
1057 int tag_length;
1058 CHKERR getPtrFE() -> mField.get_moab().tag_get_length(tag, tag_length);
1059 if (tag_length != 9) {
1060 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1061 "Number of internal stress components should be 9 but is %d",
1062 tag_length);
1063 }
1064
1065 auto fe_ent = getNumeredEntFiniteElementPtr()->getEnt();
1066 const EntityHandle *vert_conn;
1067 int vert_num;
1068 CHKERR getPtrFE() -> mField.get_moab().get_connectivity(fe_ent, vert_conn,
1069 vert_num, true);
1070 VectorDouble vert_data(vert_num * tag_length);
1071 CHKERR getPtrFE() -> mField.get_moab().tag_get_data(tag, vert_conn, vert_num,
1072 &vert_data[0]);
1073
1074 auto get_internal_stress =
1076 dataAtPts->internalStressAtPts, nb_integration_pts);
1077 dataAtPts->internalStressAtPts.clear();
1078 auto t_internal_stress = get_internal_stress();
1079
1080 auto t_shape_n = data.getFTensor0N();
1081 int nb_shape_fn = data.getN(NOBASE).size2();
1082 FTensor::Index<'L', 9> L;
1083 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1084 auto t_vert_data = getFTensor1FromArray<9, 9>(vert_data);
1085 for (int bb = 0; bb != nb_shape_fn; ++bb) {
1086 t_internal_stress(L) += t_vert_data(L) * t_shape_n;
1087 ++t_vert_data;
1088 ++t_shape_n;
1089 }
1090 ++t_internal_stress;
1091 }
1092
1094}
@ NOBASE
Definition definitions.h:59
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....

Member Data Documentation

◆ dataAtPts

template<int INTERP_ORDER>
boost::shared_ptr<DataAtIntegrationPts> OpGetInternalStress< INTERP_ORDER >::dataAtPts
private

Definition at line 381 of file EshelbianOperators.hpp.

◆ tagName

template<int INTERP_ORDER>
std::string OpGetInternalStress< INTERP_ORDER >::tagName
private

Definition at line 382 of file EshelbianOperators.hpp.


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