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 398 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 399 of file EshelbianOperators.hpp.

401 : UserDataOperator(H1, OPLAST), dataAtPts(data_ptr), tagName(tag_name) {
402 std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE], false);
403 doEntities[MBVERTEX] = true;
404 }
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 1275 of file EshelbianOperators.cpp.

1276 {
1278
1279 int nb_integration_pts = getGaussPts().size2();
1280
1281 Tag tag;
1282 CHKERR getPtrFE() -> mField.get_moab().tag_get_handle(tagName.c_str(), tag);
1283 int tag_length;
1284 CHKERR getPtrFE() -> mField.get_moab().tag_get_length(tag, tag_length);
1285 if (tag_length != 9) {
1286 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1287 "Number of internal stress components should be 9 but is %d",
1288 tag_length);
1289 }
1290
1291 VectorDouble const_stress_vec(9);
1292 auto fe_ent = getNumeredEntFiniteElementPtr()->getEnt();
1293 CHKERR getPtrFE() -> mField.get_moab().tag_get_data(
1294 tag, &fe_ent, 1, &*const_stress_vec.data().begin());
1295 auto t_const_stress = getFTensor1FromArray<9, 9>(const_stress_vec);
1296
1297 auto get_internal_stress =
1299 dataAtPts->internalStressAtPts, nb_integration_pts);
1300 dataAtPts->internalStressAtPts.clear();
1301 auto t_internal_stress = get_internal_stress();
1302
1303 FTensor::Index<'L', 9> L;
1304 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1305 t_internal_stress(L) = t_const_stress(L);
1306 ++t_internal_stress;
1307 }
1308
1310}
#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 1313 of file EshelbianOperators.cpp.

1314 {
1316
1317 int nb_integration_pts = getGaussPts().size2();
1318
1319 Tag tag;
1320 CHKERR getPtrFE() -> mField.get_moab().tag_get_handle(tagName.c_str(), tag);
1321 int tag_length;
1322 CHKERR getPtrFE() -> mField.get_moab().tag_get_length(tag, tag_length);
1323 if (tag_length != 9) {
1324 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1325 "Number of internal stress components should be 9 but is %d",
1326 tag_length);
1327 }
1328
1329 auto fe_ent = getNumeredEntFiniteElementPtr()->getEnt();
1330 const EntityHandle *vert_conn;
1331 int vert_num;
1332 CHKERR getPtrFE() -> mField.get_moab().get_connectivity(fe_ent, vert_conn,
1333 vert_num, true);
1334 VectorDouble vert_data(vert_num * tag_length);
1335 CHKERR getPtrFE() -> mField.get_moab().tag_get_data(tag, vert_conn, vert_num,
1336 &vert_data[0]);
1337
1338 auto get_internal_stress =
1340 dataAtPts->internalStressAtPts, nb_integration_pts);
1341 dataAtPts->internalStressAtPts.clear();
1342 auto t_internal_stress = get_internal_stress();
1343
1344 auto t_shape_n = data.getFTensor0N();
1345 int nb_shape_fn = data.getN(NOBASE).size2();
1346 FTensor::Index<'L', 9> L;
1347 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1348 auto t_vert_data = getFTensor1FromArray<9, 9>(vert_data);
1349 for (int bb = 0; bb != nb_shape_fn; ++bb) {
1350 t_internal_stress(L) += t_vert_data(L) * t_shape_n;
1351 ++t_vert_data;
1352 ++t_shape_n;
1353 }
1354 ++t_internal_stress;
1355 }
1356
1358}
@ 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 408 of file EshelbianOperators.hpp.

◆ tagName

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

Definition at line 409 of file EshelbianOperators.hpp.


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