v0.16.0
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 489 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 491 of file EshelbianOperators.hpp.

496 : FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase(
497 row_field, row_field, FaceUserDataOperator::OPROW),
498 bcData(bc_data), piolaScalePtr(), hybridGradDispPtr(hybrid_grad_disp),
499 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
/home/lk58p/mofem_install/vanilla_dev_release/mofem-cephas/mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianOperators.cpp.

Definition at line 2217 of file EshelbianOperators.cpp.

2217 {
2219
2220 FTENSOR_INDEX(3, i);
2221
2222 int nb_dofs = data.getFieldData().size();
2223 int nb_integration_pts = getGaussPts().size2();
2224 int nb_base_functions = data.getN().size2();
2225
2226 double time = getFEMethod()->ts_t;
2229 }
2230
2231#ifndef NDEBUG
2232 if (this->locF.size() != nb_dofs)
2233 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
2234 "Size of locF %ld != nb_dofs %d", this->locF.size(), nb_dofs);
2235#endif // NDEBUG
2236
2237 auto integrate_rhs = [&](auto &bc, auto calc_tau, double time_scale) {
2239
2240 auto val = bc.val;
2241 auto t_row_base = data.getFTensor0N();
2242 auto t_w = getFTensor0IntegrationWeight();
2243 auto t_coords = getFTensor1CoordsAtGaussPts();
2244 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
2245 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
2246
2247 auto t_grad_gamma_u = getFTensor2FromMat<3, 2, -1, DL>(*hybridGradDispPtr);
2248
2249 double scale = (piolaScalePtr) ? 1. / (*piolaScalePtr) : 1.0;
2250
2251 for (int gg = 0; gg != nb_integration_pts; ++gg) {
2252
2258
2260 if (EshelbianCore::stretchSelector == LINEAR &&
2261 EshelbianCore::gradApproximator < MODERATE_ROT) {
2262
2263 t_normal(i) = (FTensor::levi_civita<double>(i, j, k) * t_tangent1(j)) *
2264 t_tangent2(k);
2265 } else {
2266 t_normal(i) = (FTensor::levi_civita<double>(i, j, k) *
2267 (t_tangent1(j) + t_grad_gamma_u(j, N0))) *
2268 (t_tangent2(k) + t_grad_gamma_u(k, N1));
2269 }
2270 auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
2271 auto t_val = FTensor::Tensor1<double, 3>();
2272 t_val(i) = (time_scale * t_w * tau * scale * val) * t_normal(i);
2273
2274 auto t_f = getFTensor1FromPtr<3>(&*this->locF.begin());
2275 int rr = 0;
2276 for (; rr != nb_dofs / SPACE_DIM; ++rr) {
2277 t_f(i) += t_row_base * t_val(i);
2278 ++t_row_base;
2279 ++t_f;
2280 }
2281
2282 for (; rr != nb_base_functions; ++rr)
2283 ++t_row_base;
2284 ++t_w;
2285 ++t_coords;
2286 ++t_tangent1;
2287 ++t_tangent2;
2288 ++t_grad_gamma_u;
2289 }
2290 this->locF /= 2.;
2291
2293 };
2294
2295 // get entity of face
2296 EntityHandle fe_ent = getFEEntityHandle();
2297 for (auto &bc : *(bcData)) {
2298 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2299
2300 double time_scale = 1;
2301 if (scalingMethodsMap.find(bc.blockName) != scalingMethodsMap.end()) {
2302 time_scale *= scalingMethodsMap.at(bc.blockName)->getScale(time);
2303 }
2304
2305 int nb_dofs = data.getFieldData().size();
2306 if (nb_dofs) {
2307 CHKERR integrate_rhs(
2308 bc, [](double, double, double) { return 1; }, time_scale);
2309 }
2310 }
2311 }
2313}
#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
DataLayoutTraits< DataLayout::GaussByCoeffs > DL
Definition MatHuHu.hpp:33
auto getFTensor2FromMat(M &data)
Get tensor rank 2 (matrix) form data matrix.
static enum StretchSelector stretchSelector
static enum RotSelector gradApproximator
static PetscBool physicalTimeFlg
static double currentPhysicalTime
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:124

Member Data Documentation

◆ bcData

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

Definition at line 504 of file EshelbianOperators.hpp.

◆ hybridGradDispPtr

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

Definition at line 506 of file EshelbianOperators.hpp.

◆ piolaScalePtr

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

Definition at line 505 of file EshelbianOperators.hpp.

◆ scalingMethodsMap

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

Definition at line 507 of file EshelbianOperators.hpp.


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