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

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

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

Public Types

using OP = VolumeElementForcesAndSourcesCoreOnSide::UserDataOperator
 

Public Member Functions

 OpFaceSideMaterialForce (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

Examples
EshelbianPlasticity.cpp.

Definition at line 927 of file EshelbianOperators.hpp.

Member Typedef Documentation

◆ OP

using OpFaceSideMaterialForce::OP = VolumeElementForcesAndSourcesCoreOnSide::UserDataOperator

Definition at line 931 of file EshelbianOperators.hpp.

Constructor & Destructor Documentation

◆ OpFaceSideMaterialForce()

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

Definition at line 933 of file EshelbianOperators.hpp.

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

Member Function Documentation

◆ doWork()

MoFEMErrorCode OpFaceSideMaterialForce::doWork ( int  side,
EntityType  type,
EntData data 
)
Examples
EshelbianOperators.cpp.

Definition at line 3324 of file EshelbianOperators.cpp.

3325 {
3327
3337
3338 dataAtPts->faceMaterialForceAtPts.resize(3, getGaussPts().size2(), false);
3339 dataAtPts->normalPressureAtPts.resize(getGaussPts().size2(), false);
3340 if (getNinTheLoop() == 0) {
3341 dataAtPts->faceMaterialForceAtPts.clear();
3342 dataAtPts->normalPressureAtPts.clear();
3343 }
3344 auto loop_size = getLoopSize();
3345 if (loop_size == 1) {
3346 auto numebered_fe_ptr = getSidePtrFE()->numeredEntFiniteElementPtr;
3347 auto pstatus = numebered_fe_ptr->getPStatus();
3348 if (pstatus & (PSTATUS_SHARED | PSTATUS_MULTISHARED)) {
3349 loop_size = 2;
3350 }
3351 }
3352
3354
3355 auto t_normal = getFTensor1NormalsAtGaussPts();
3356 auto t_T = getFTensor1FromMat<SPACE_DIM>(
3357 dataAtPts->faceMaterialForceAtPts); //< face material force
3358 auto t_p =
3359 getFTensor0FromVec(dataAtPts->normalPressureAtPts); //< normal pressure
3360 auto t_P = getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(dataAtPts->approxPAtPts);
3361 auto t_grad_u_gamma =
3362 getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(dataAtPts->gradHybridDispAtPts);
3363 auto t_strain =
3364 getFTensor2SymmetricFromMat<SPACE_DIM>(dataAtPts->logStretchTensorAtPts);
3365 auto t_omega = getFTensor1FromMat<3>(dataAtPts->rotAxisAtPts);
3366
3373
3374 auto next = [&]() {
3375 ++t_normal;
3376 ++t_P;
3377 ++t_omega;
3378 ++t_grad_u_gamma;
3379 ++t_strain;
3380 ++t_T;
3381 ++t_p;
3382 };
3383
3385 case GRIFFITH_FORCE:
3386 for (auto gg = 0; gg != getGaussPts().size2(); ++gg) {
3387 t_N(I) = t_normal(I);
3388 t_N.normalize();
3389
3390 t_A(i, j) = levi_civita(i, j, k) * t_omega(k);
3391 t_R(i, k) = t_kd(i, k) + t_A(i, k);
3392
3393 t_grad_u(i, j) = t_R(i, j) + t_strain(i, j);
3394 t_T(I) +=
3395 t_N(J) * (t_grad_u(i, I) * t_P(i, J)) / loop_size;
3396 // note that works only for Hooke material, for nonlinear material we need
3397 // strain energy expressed by stress
3398 t_T(I) -= t_N(I) * ((t_strain(i, K) * t_P(i, K)) / 2.) / loop_size;
3399
3400 t_p += t_N(I) * (t_N(J) * (t_grad_u_gamma(i, I) * t_P(i, J))) / loop_size;
3401
3402 next();
3403 }
3404 break;
3405 case GRIFFITH_SKELETON:
3406 for (auto gg = 0; gg != getGaussPts().size2(); ++gg) {
3407 t_N(I) = t_normal(I);
3408 t_N.normalize();
3409
3410 // t_PM(i, j) = t_N(i) * t_N(j);
3411
3412 // t_A(i, j) =
3413 // t_PM(i, m) * (levi_civita(m, l, k) * t_omega(k)) * t_PM(l, j) +
3414 // (t_grad_u_gamma(i, j) - t_grad_u_gamma(j, i));
3415 // // t_A(i, j) = levi_civita(i, j, k) * t_omega(k);
3416
3417
3418 // t_R(i, k) = t_kd(i, k) + t_A(i, k);
3419
3420 t_grad_u(i, j) = t_kd(i, j) +
3421 (t_grad_u_gamma(i, j) - t_grad_u_gamma(j, i)) / 2. +
3422 t_strain(i, j);
3423
3424 t_T(I) += t_N(J) * (t_grad_u(i, I) * t_P(i, J)) / loop_size;
3425 // note that works only for Hooke material, for nonlinear material we need
3426 // strain energy expressed by stress
3427 t_T(I) -= t_N(I) * ((t_strain(i, K) * t_P(i, K)) / 2.) / loop_size;
3428
3429 // calculate nominal face pressure
3430 t_p += t_N(I) * (t_N(J) * (t_grad_u_gamma(i, I) * t_P(i, J))) / loop_size;
3431
3432 next();
3433 }
3434 break;
3435
3436 default:
3437 SETERRQ(PETSC_COMM_WORLD, MOFEM_NOT_IMPLEMENTED,
3438 "Grffith energy release "
3439 "selector not implemented");
3440 };
3441
3442#ifndef NDEBUG
3443 auto side_fe_ptr = getSidePtrFE();
3444 auto side_fe_mi_ptr = side_fe_ptr->numeredEntFiniteElementPtr;
3445 auto pstatus = side_fe_mi_ptr->getPStatus();
3446 if (pstatus) {
3447 auto owner = side_fe_mi_ptr->getOwnerProc();
3448 MOFEM_LOG("SELF", Sev::noisy)
3449 << "OpFaceSideMaterialForce: owner proc is not 0, owner proc: " << owner
3450 << " " << getPtrFE()->mField.get_comm_rank() << " n in the loop "
3451 << getNinTheLoop() << " loop size " << getLoopSize();
3452 }
3453#endif // NDEBUG
3454
3456}
#define FTENSOR_INDEX(DIM, I)
constexpr int SPACE_DIM
Kronecker Delta class symmetric.
Tensor1< T, Tensor_Dim > normalize()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_NOT_IMPLEMENTED
Definition definitions.h:32
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
constexpr auto t_kd
#define MOFEM_LOG(channel, severity)
Log.
FTensor::Index< 'i', SPACE_DIM > i
const double n
refractive index of diffusive medium
FTensor::Index< 'J', DIM1 > J
Definition level_set.cpp:30
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
constexpr std::enable_if<(Dim0<=2 &&Dim1<=2), Tensor2_Expr< Levi_Civita< T >, T, Dim0, Dim1, i, j > >::type levi_civita(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
levi_civita functions to make for easy adhoc use
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
constexpr IntegrationType I
FTensor::Index< 'm', 3 > m
static enum EnergyReleaseSelector energyReleaseSelector

Member Data Documentation

◆ dataAtPts

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

data at integration pts

Definition at line 940 of file EshelbianOperators.hpp.


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