v0.15.0
Loading...
Searching...
No Matches
EshelbianPlasticity::OpBrokenPressureBc Struct Reference

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

Inheritance diagram for EshelbianPlasticity::OpBrokenPressureBc:
[legend]
Collaboration diagram for EshelbianPlasticity::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< PressureBcVecbcData
 
boost::shared_ptr< doublepiolaScalePtr
 
boost::shared_ptr< MatrixDouble > hybridGradDispPtr
 
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
 

Detailed Description

Definition at line 507 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ OpBrokenPressureBc()

EshelbianPlasticity::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 509 of file EshelbianPlasticity.hpp.

515 {
516 AnalyticalDisplacementBc(std::string name, std::vector<double> attr,
517 Range faces);

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode OpBrokenPressureBc::iNtegrate ( EntData & data)
Examples
EshelbianOperators.cpp.

Definition at line 1991 of file EshelbianOperators.cpp.

1991 {
1993
1994 FTENSOR_INDEX(3, i);
1995
1996 int nb_dofs = data.getFieldData().size();
1997 int nb_integration_pts = getGaussPts().size2();
1998 int nb_base_functions = data.getN().size2();
1999
2000 double time = getFEMethod()->ts_t;
2003 }
2004
2005#ifndef NDEBUG
2006 if (this->locF.size() != nb_dofs)
2007 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
2008 "Size of locF %ld != nb_dofs %d", this->locF.size(), nb_dofs);
2009#endif // NDEBUG
2010
2011 auto integrate_rhs = [&](auto &bc, auto calc_tau, double time_scale) {
2013
2014 auto val = bc.val;
2015 auto t_row_base = data.getFTensor0N();
2016 auto t_w = getFTensor0IntegrationWeight();
2017 auto t_coords = getFTensor1CoordsAtGaussPts();
2018 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
2019 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
2020
2021 auto t_grad_gamma_u = getFTensor2FromMat<3, 2>(*hybridGradDispPtr);
2022
2023 double scale = (piolaScalePtr) ? 1. / (*piolaScalePtr) : 1.0;
2024
2025 for (int gg = 0; gg != nb_integration_pts; ++gg) {
2026
2032
2036
2037 t_normal(i) = (FTensor::levi_civita<double>(i, j, k) * t_tangent1(j)) *
2038 t_tangent2(k);
2039 } else {
2040 t_normal(i) = (FTensor::levi_civita<double>(i, j, k) *
2041 (t_tangent1(j) + t_grad_gamma_u(j, N0))) *
2042 (t_tangent2(k) + t_grad_gamma_u(k, N1));
2043 }
2044 auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
2045 auto t_val = FTensor::Tensor1<double, 3>();
2046 t_val(i) = (time_scale * t_w * tau * scale * val) * t_normal(i);
2047
2048 auto t_f = getFTensor1FromPtr<3>(&*this->locF.begin());
2049 int rr = 0;
2050 for (; rr != nb_dofs / SPACE_DIM; ++rr) {
2051 t_f(i) += t_row_base * t_val(i);
2052 ++t_row_base;
2053 ++t_f;
2054 }
2055
2056 for (; rr != nb_base_functions; ++rr)
2057 ++t_row_base;
2058 ++t_w;
2059 ++t_coords;
2060 ++t_tangent1;
2061 ++t_tangent2;
2062 ++t_grad_gamma_u;
2063 }
2064 this->locF /= 2.;
2065
2067 };
2068
2069 // get entity of face
2070 EntityHandle fe_ent = getFEEntityHandle();
2071 for (auto &bc : *(bcData)) {
2072 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2073
2074 double time_scale = 1;
2075 if (scalingMethodsMap.find(bc.blockName) != scalingMethodsMap.end()) {
2076 time_scale *= scalingMethodsMap.at(bc.blockName)->getScale(time);
2077 }
2078
2079 int nb_dofs = data.getFieldData().size();
2080 if (nb_dofs) {
2081 CHKERR integrate_rhs(
2082 bc, [](double, double, double) { return 1; }, time_scale);
2083 }
2084 }
2085 }
2087}
#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
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
FTensor::Tensor2< FTensor::PackPtr< double *, 1 >, Tensor_Dim1, Tensor_Dim2 > getFTensor2FromMat(MatrixDouble &data)
Get tensor rank 2 (matrix) form data matrix.
FTensor::Tensor1< FTensor::PackPtr< double *, S >, DIM > getFTensor1FromPtr(double *ptr)
Make Tensor1 from pointer.
double scale
Definition plastic.cpp:123
static enum StretchSelector stretchSelector
boost::shared_ptr< PressureBcVec > bcData
boost::shared_ptr< MatrixDouble > hybridGradDispPtr
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
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 dofs values

Member Data Documentation

◆ bcData

boost::shared_ptr<PressureBcVec> EshelbianPlasticity::OpBrokenPressureBc::bcData
protected
Examples
EshelbianOperators.cpp.

Definition at line 522 of file EshelbianPlasticity.hpp.

◆ hybridGradDispPtr

boost::shared_ptr<MatrixDouble> EshelbianPlasticity::OpBrokenPressureBc::hybridGradDispPtr
protected
Examples
EshelbianOperators.cpp.

Definition at line 524 of file EshelbianPlasticity.hpp.

◆ piolaScalePtr

boost::shared_ptr<double> EshelbianPlasticity::OpBrokenPressureBc::piolaScalePtr
protected
Examples
EshelbianOperators.cpp.

Definition at line 523 of file EshelbianPlasticity.hpp.

◆ scalingMethodsMap

std::map<std::string, boost::shared_ptr<ScalingMethod> > EshelbianPlasticity::OpBrokenPressureBc::scalingMethodsMap
protected
Examples
EshelbianOperators.cpp.

Definition at line 525 of file EshelbianPlasticity.hpp.


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