v0.15.4
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
OpBrokenPressureBc Struct Reference

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

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

Public Member Functions

 OpBrokenPressureBc (const std::string row_field, boost::shared_ptr< PressureBcVec > bc_data, boost::shared_ptr< double > piola_scale_ptr, boost::shared_ptr< MatrixDouble > hybrid_grad_disp, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv)
 
MoFEMErrorCode iNtegrate (EntData &data)
 

Protected Attributes

boost::shared_ptr< PressureBcVec > bcData
 
boost::shared_ptr< doublepiolaScalePtr
 
boost::shared_ptr< MatrixDouble > hybridGradDispPtr
 
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
 

Detailed Description

Examples
/home/lk58p/mofem_install/vanilla_dev_release/mofem-cephas/mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianPlasticity.cpp.

Definition at line 499 of file EshelbianOperators.hpp.

Constructor & Destructor Documentation

◆ OpBrokenPressureBc()

OpBrokenPressureBc::OpBrokenPressureBc ( const std::string  row_field,
boost::shared_ptr< PressureBcVec >  bc_data,
boost::shared_ptr< double piola_scale_ptr,
boost::shared_ptr< MatrixDouble >  hybrid_grad_disp,
std::map< std::string, boost::shared_ptr< ScalingMethod > >  smv 
)
inline

Definition at line 501 of file EshelbianOperators.hpp.

506 : FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase(
507 row_field, row_field, FaceUserDataOperator::OPROW),
508 bcData(bc_data), piolaScalePtr(), hybridGradDispPtr(hybrid_grad_disp),
509 scalingMethodsMap(smv) {}
boost::shared_ptr< MatrixDouble > hybridGradDispPtr
boost::shared_ptr< double > piolaScalePtr
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
boost::shared_ptr< PressureBcVec > bcData

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode OpBrokenPressureBc::iNtegrate ( EntData data)
Examples
mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianOperators.cpp.

Definition at line 1969 of file EshelbianOperators.cpp.

1969 {
1971
1972 FTENSOR_INDEX(3, i);
1973
1974 int nb_dofs = data.getFieldData().size();
1975 int nb_integration_pts = getGaussPts().size2();
1976 int nb_base_functions = data.getN().size2();
1977
1978 double time = getFEMethod()->ts_t;
1981 }
1982
1983#ifndef NDEBUG
1984 if (this->locF.size() != nb_dofs)
1985 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1986 "Size of locF %ld != nb_dofs %d", this->locF.size(), nb_dofs);
1987#endif // NDEBUG
1988
1989 auto integrate_rhs = [&](auto &bc, auto calc_tau, double time_scale) {
1991
1992 auto val = bc.val;
1993 auto t_row_base = data.getFTensor0N();
1994 auto t_w = getFTensor0IntegrationWeight();
1995 auto t_coords = getFTensor1CoordsAtGaussPts();
1996 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1997 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1998
1999 auto t_grad_gamma_u = getFTensor2FromMat<3, 2>(*hybridGradDispPtr);
2000
2001 double scale = (piolaScalePtr) ? 1. / (*piolaScalePtr) : 1.0;
2002
2003 for (int gg = 0; gg != nb_integration_pts; ++gg) {
2004
2010
2012 if (EshelbianCore::stretchSelector == LINEAR &&
2013 EshelbianCore::gradApproximator < MODERATE_ROT) {
2014
2015 t_normal(i) = (FTensor::levi_civita<double>(i, j, k) * t_tangent1(j)) *
2016 t_tangent2(k);
2017 } else {
2018 t_normal(i) = (FTensor::levi_civita<double>(i, j, k) *
2019 (t_tangent1(j) + t_grad_gamma_u(j, N0))) *
2020 (t_tangent2(k) + t_grad_gamma_u(k, N1));
2021 }
2022 auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
2023 auto t_val = FTensor::Tensor1<double, 3>();
2024 t_val(i) = (time_scale * t_w * tau * scale * val) * t_normal(i);
2025
2026 auto t_f = getFTensor1FromPtr<3>(&*this->locF.begin());
2027 int rr = 0;
2028 for (; rr != nb_dofs / SPACE_DIM; ++rr) {
2029 t_f(i) += t_row_base * t_val(i);
2030 ++t_row_base;
2031 ++t_f;
2032 }
2033
2034 for (; rr != nb_base_functions; ++rr)
2035 ++t_row_base;
2036 ++t_w;
2037 ++t_coords;
2038 ++t_tangent1;
2039 ++t_tangent2;
2040 ++t_grad_gamma_u;
2041 }
2042 this->locF /= 2.;
2043
2045 };
2046
2047 // get entity of face
2048 EntityHandle fe_ent = getFEEntityHandle();
2049 for (auto &bc : *(bcData)) {
2050 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2051
2052 double time_scale = 1;
2053 if (scalingMethodsMap.find(bc.blockName) != scalingMethodsMap.end()) {
2054 time_scale *= scalingMethodsMap.at(bc.blockName)->getScale(time);
2055 }
2056
2057 int nb_dofs = data.getFieldData().size();
2058 if (nb_dofs) {
2059 CHKERR integrate_rhs(
2060 bc, [](double, double, double) { return 1; }, time_scale);
2061 }
2062 }
2063 }
2065}
#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 ...
@ 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.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
static enum StretchSelector stretchSelector
static double dynamicTime
static enum RotSelector gradApproximator
static PetscBool dynamicRelaxation
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....
const VectorDouble & getFieldData() const
Get DOF values on entity.
double scale
Definition plastic.cpp:123

Member Data Documentation

◆ bcData

boost::shared_ptr<PressureBcVec> OpBrokenPressureBc::bcData
protected

Definition at line 514 of file EshelbianOperators.hpp.

◆ hybridGradDispPtr

boost::shared_ptr<MatrixDouble> OpBrokenPressureBc::hybridGradDispPtr
protected

Definition at line 516 of file EshelbianOperators.hpp.

◆ piolaScalePtr

boost::shared_ptr<double> OpBrokenPressureBc::piolaScalePtr
protected

Definition at line 515 of file EshelbianOperators.hpp.

◆ scalingMethodsMap

std::map<std::string, boost::shared_ptr<ScalingMethod> > OpBrokenPressureBc::scalingMethodsMap
protected

Definition at line 517 of file EshelbianOperators.hpp.


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