v0.16.3
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< DataAtIntegrationPts > dataAtPts
 
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 376 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 377 of file EshelbianOperators.hpp.

379 : UserDataOperator(H1, OPLAST), dataAtPts(data_ptr), tagName(tag_name) {
380 std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE], false);
381 doEntities[MBVERTEX] = true;
382 }
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 1354 of file EshelbianOperators.cpp.

1355 {
1357
1358 int nb_integration_pts = getGaussPts().size2();
1359
1360 Tag tag;
1361 CHKERR getPtrFE() -> mField.get_moab().tag_get_handle(tagName.c_str(), tag);
1362 int tag_length;
1363 CHKERR getPtrFE() -> mField.get_moab().tag_get_length(tag, tag_length);
1364 if (tag_length != 9) {
1365 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1366 "Number of internal stress components should be 9 but is %d",
1367 tag_length);
1368 }
1369
1370 VectorDouble const_stress_vec(9);
1371 auto fe_ent = getNumeredEntFiniteElementPtr()->getEnt();
1372 CHKERR getPtrFE() -> mField.get_moab().tag_get_data(
1373 tag, &fe_ent, 1, &*const_stress_vec.data().begin());
1374 auto t_const_stress = getFTensor1FromArray<9, 9>(const_stress_vec);
1375
1376 auto get_internal_stress =
1378 dataAtPts->internalStressAtPts, nb_integration_pts);
1379 dataAtPts->internalStressAtPts.clear();
1380 auto t_internal_stress = get_internal_stress();
1381
1382 FTensor::Index<'L', 9> L;
1383 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1384 t_internal_stress(L) = t_const_stress(L);
1385 ++t_internal_stress;
1386 }
1387
1389}
#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 1392 of file EshelbianOperators.cpp.

1393 {
1395
1396 int nb_integration_pts = getGaussPts().size2();
1397
1398 Tag tag;
1399 CHKERR getPtrFE() -> mField.get_moab().tag_get_handle(tagName.c_str(), tag);
1400 int tag_length;
1401 CHKERR getPtrFE() -> mField.get_moab().tag_get_length(tag, tag_length);
1402 if (tag_length != 9) {
1403 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1404 "Number of internal stress components should be 9 but is %d",
1405 tag_length);
1406 }
1407
1408 auto fe_ent = getNumeredEntFiniteElementPtr()->getEnt();
1409 const EntityHandle *vert_conn;
1410 int vert_num;
1411 CHKERR getPtrFE() -> mField.get_moab().get_connectivity(fe_ent, vert_conn,
1412 vert_num, true);
1413 VectorDouble vert_data(vert_num * tag_length);
1414 CHKERR getPtrFE() -> mField.get_moab().tag_get_data(tag, vert_conn, vert_num,
1415 &vert_data[0]);
1416
1417 auto get_internal_stress =
1419 dataAtPts->internalStressAtPts, nb_integration_pts);
1420 dataAtPts->internalStressAtPts.clear();
1421 auto t_internal_stress = get_internal_stress();
1422
1423 auto t_shape_n = data.getFTensor0N();
1424 int nb_shape_fn = data.getN(NOBASE).size2();
1425 FTensor::Index<'L', 9> L;
1426 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1427 auto t_vert_data = getFTensor1FromArray<9, 9>(vert_data);
1428 for (int bb = 0; bb != nb_shape_fn; ++bb) {
1429 t_internal_stress(L) += t_vert_data(L) * t_shape_n;
1430 ++t_vert_data;
1431 ++t_shape_n;
1432 }
1433 ++t_internal_stress;
1434 }
1435
1437}
@ 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 386 of file EshelbianOperators.hpp.

◆ tagName

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

Definition at line 387 of file EshelbianOperators.hpp.


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