v0.15.5
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
OpFaceMaterialForce Struct Reference

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

Inheritance diagram for OpFaceMaterialForce:
[legend]
Collaboration diagram for OpFaceMaterialForce:
[legend]

Public Types

using OP = FaceElementForcesAndSourcesCore::UserDataOperator
 

Public Member Functions

 OpFaceMaterialForce (boost::shared_ptr< DataAtIntegrationPts > data_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Private Attributes

boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 data at integration pts
 

Detailed Description

Definition at line 947 of file EshelbianOperators.hpp.

Member Typedef Documentation

◆ OP

using OpFaceMaterialForce::OP = FaceElementForcesAndSourcesCore::UserDataOperator

Definition at line 951 of file EshelbianOperators.hpp.

Constructor & Destructor Documentation

◆ OpFaceMaterialForce()

OpFaceMaterialForce::OpFaceMaterialForce ( boost::shared_ptr< DataAtIntegrationPts data_ptr)
inline

Definition at line 953 of file EshelbianOperators.hpp.

954 : OP(NOSPACE, OPSPACE), dataAtPts(data_ptr) {}
@ NOSPACE
Definition definitions.h:83
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
FaceElementForcesAndSourcesCore::UserDataOperator OP

Member Function Documentation

◆ doWork()

MoFEMErrorCode OpFaceMaterialForce::doWork ( int  side,
EntityType  type,
EntData data 
)
Examples
mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianOperators.cpp.

Definition at line 3491 of file EshelbianOperators.cpp.

3492 {
3494
3495#ifndef NDEBUG
3496 auto fe_mi_ptr = getFEMethod()->numeredEntFiniteElementPtr;
3497 auto pstatus = fe_mi_ptr->getPStatus();
3498 if (pstatus) {
3499 auto owner = fe_mi_ptr->getOwnerProc();
3500 MOFEM_LOG("SELF", Sev::noisy)
3501 << "OpFaceMaterialForce: owner proc is not 0, owner proc: " << owner
3502 << " " << getPtrFE()->mField.get_comm_rank();
3503 }
3504#endif // NDEBUG
3505
3507
3509 t_face_T(I) = 0.;
3510 double face_pressure = 0.;
3511 auto t_T = getFTensor1FromMat<SPACE_DIM>(
3512 dataAtPts->faceMaterialForceAtPts); //< face material force
3513 auto t_p =
3514 getFTensor0FromVec(dataAtPts->normalPressureAtPts); //< normal pressure
3515 auto t_w = getFTensor0IntegrationWeight();
3516 for (auto gg = 0; gg != getGaussPts().size2(); ++gg) {
3517 t_face_T(I) += t_w * t_T(I);
3518 face_pressure += t_w * t_p;
3519 ++t_w;
3520 ++t_T;
3521 ++t_p;
3522 }
3523 t_face_T(I) *= getMeasure();
3524 face_pressure *= getMeasure();
3525
3526 auto get_tag = [&](auto name, auto dim) {
3527 auto &moab = getPtrFE()->mField.get_moab();
3528 Tag tag;
3529 double def_val[] = {0., 0., 0.};
3530 CHK_MOAB_THROW(moab.tag_get_handle(name, dim, MB_TYPE_DOUBLE, tag,
3531 MB_TAG_CREAT | MB_TAG_SPARSE, def_val),
3532 "create tag");
3533 return tag;
3534 };
3535
3536 auto set_tag = [&](auto &&tag, auto ptr) {
3537 auto &moab = getPtrFE()->mField.get_moab();
3538 auto face = getPtrFE()->getFEEntityHandle();
3539 CHK_MOAB_THROW(moab.tag_set_data(tag, &face, 1, ptr), "set tag");
3540 };
3541
3542 set_tag(get_tag("MaterialForce", 3), &t_face_T(0));
3543 set_tag(get_tag("FacePressure", 1), &face_pressure);
3544
3546}
#define FTENSOR_INDEX(DIM, I)
constexpr int SPACE_DIM
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MOFEM_LOG(channel, severity)
Log.
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
constexpr IntegrationType I

Member Data Documentation

◆ dataAtPts

boost::shared_ptr<DataAtIntegrationPts> OpFaceMaterialForce::dataAtPts
private

data at integration pts

Definition at line 960 of file EshelbianOperators.hpp.


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