v0.14.0
Public Member Functions | Protected Attributes | List of all members
OpBrokenTractionBc Struct Reference

#include <users_modules/eshelbian_plasticit/src/EshelbianOperators.hpp>

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

Public Member Functions

 OpBrokenTractionBc (const std::string row_field, boost::shared_ptr< TractionBcVec > bc_data, boost::shared_ptr< double > piola_scale_ptr, std::vector< boost::shared_ptr< ScalingMethod >> smv)
 
MoFEMErrorCode iNtegrate (EntData &data)
 

Protected Attributes

boost::shared_ptr< TractionBcVec > bcData
 
boost::shared_ptr< doublepiolaScalePtr
 
std::vector< boost::shared_ptr< ScalingMethod > > scalingMethodsVec
 

Detailed Description

Examples
EshelbianPlasticity.cpp.

Definition at line 334 of file EshelbianOperators.hpp.

Constructor & Destructor Documentation

◆ OpBrokenTractionBc()

OpBrokenTractionBc::OpBrokenTractionBc ( const std::string  row_field,
boost::shared_ptr< TractionBcVec >  bc_data,
boost::shared_ptr< double piola_scale_ptr,
std::vector< boost::shared_ptr< ScalingMethod >>  smv 
)
inline

Definition at line 336 of file EshelbianOperators.hpp.

341  row_field, row_field, FaceUserDataOperator::OPROW),
342  bcData(bc_data), piolaScalePtr(), scalingMethodsVec(smv) {}

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode OpBrokenTractionBc::iNtegrate ( EntData data)
Examples
EshelbianOperators.cpp.

Definition at line 1278 of file EshelbianOperators.cpp.

1278  {
1280 
1281  FTENSOR_INDEX(3, i);
1282 
1283  int nb_dofs = data.getFieldData().size();
1284  int nb_integration_pts = getGaussPts().size2();
1285  int nb_base_functions = data.getN().size2();
1286 
1287  double ts_t = getFEMethod()->ts_t;
1290  }
1291 
1292  double time_scale = 1;
1293  for (auto &sm : scalingMethodsVec) {
1294  time_scale *= sm->getScale(ts_t);
1295  }
1296 
1297 #ifndef NDEBUG
1298  if (this->locF.size() != nb_dofs)
1299  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1300  "Size of locF %d != nb_dofs %d", this->locF.size(), nb_dofs);
1301 #endif // NDEBUG
1302 
1303  auto integrate_rhs = [&](auto &bc, auto calc_tau) {
1305 
1306  auto t_val = getFTensor1FromPtr<3>(&*bc.vals.begin());
1307  auto t_row_base = data.getFTensor0N();
1308  auto t_w = getFTensor0IntegrationWeight();
1309  auto t_coords = getFTensor1CoordsAtGaussPts();
1310 
1311  double scale = (piolaScalePtr) ? 1. / (*piolaScalePtr) : 1.0;
1312 
1313  for (int gg = 0; gg != nb_integration_pts; ++gg) {
1314 
1315  const auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
1316  auto t_f = getFTensor1FromPtr<3>(&*this->locF.begin());
1317  int rr = 0;
1318  for (; rr != nb_dofs / SPACE_DIM; ++rr) {
1319  t_f(i) -= time_scale * t_w * t_row_base * tau * (t_val(i) * scale);
1320  ++t_row_base;
1321  ++t_f;
1322  }
1323 
1324  for (; rr != nb_base_functions; ++rr)
1325  ++t_row_base;
1326  ++t_w;
1327  ++t_coords;
1328  }
1329  // Multiply by 2 since we integrate on triangle, and hybrid constrain is
1330  // multiplied by norm.
1331  this->locF *= 2. * getMeasure();
1333  };
1334 
1335  // get entity of face
1336  EntityHandle fe_ent = getFEEntityHandle();
1337  for (auto &bc : *(bcData)) {
1338  if (bc.faces.find(fe_ent) != bc.faces.end()) {
1339 
1340  int nb_dofs = data.getFieldData().size();
1341  if (nb_dofs) {
1342 
1343  if (std::regex_match(bc.blockName, std::regex(".*COOK.*"))) {
1344  auto calc_tau = [](double, double y, double) {
1345  y -= 44;
1346  y /= (60 - 44);
1347  return -y * (y - 1) / 0.25;
1348  };
1349  CHKERR integrate_rhs(bc, calc_tau);
1350  } else {
1351  CHKERR integrate_rhs(bc, [](double, double, double) { return 1; });
1352  }
1353  }
1354  }
1355  }
1357 }

Member Data Documentation

◆ bcData

boost::shared_ptr<TractionBcVec> OpBrokenTractionBc::bcData
protected

Definition at line 347 of file EshelbianOperators.hpp.

◆ piolaScalePtr

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

Definition at line 348 of file EshelbianOperators.hpp.

◆ scalingMethodsVec

std::vector<boost::shared_ptr<ScalingMethod> > OpBrokenTractionBc::scalingMethodsVec
protected

Definition at line 349 of file EshelbianOperators.hpp.


The documentation for this struct was generated from the following files:
OpBrokenTractionBc::scalingMethodsVec
std::vector< boost::shared_ptr< ScalingMethod > > scalingMethodsVec
Definition: EshelbianOperators.hpp:349
EntityHandle
MoFEM::EntitiesFieldData::EntData::getFieldData
const VectorDouble & getFieldData() const
get dofs values
Definition: EntitiesFieldData.hpp:1254
OpBrokenTractionBc::bcData
boost::shared_ptr< TractionBcVec > bcData
Definition: EshelbianOperators.hpp:347
OpBase
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition: radiation.cpp:29
FTENSOR_INDEX
#define FTENSOR_INDEX(DIM, I)
Definition: Templates.hpp:2013
scale
double scale
Definition: plastic.cpp:123
OpBrokenTractionBc::piolaScalePtr
boost::shared_ptr< double > piolaScalePtr
Definition: EshelbianOperators.hpp:348
MoFEM::EntitiesFieldData::EntData::getFTensor0N
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
Definition: EntitiesFieldData.hpp:1502
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
SPACE_DIM
constexpr int SPACE_DIM
Definition: child_and_parent.cpp:16
double
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
EshelbianCore::dynamicRelaxation
static PetscBool dynamicRelaxation
Definition: EshelbianCore.hpp:20
MoFEM::EntitiesFieldData::EntData::getN
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
Definition: EntitiesFieldData.hpp:1318
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
EshelbianCore::dynamicTime
static double dynamicTime
Definition: EshelbianCore.hpp:23
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359