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

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

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

Public Member Functions

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

Protected Attributes

boost::shared_ptr< TractionBcVecbcData
 

Detailed Description

Definition at line 674 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ OpBrokenTractionBc()

EshelbianPlasticity::OpBrokenTractionBc::OpBrokenTractionBc ( const std::string  row_field,
boost::shared_ptr< TractionBcVec bc_data 
)
inline

Definition at line 676 of file EshelbianPlasticity.hpp.

679  row_field, row_field, FaceUserDataOperator::OPROW),
680  bcData(bc_data) {}

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode EshelbianPlasticity::OpBrokenTractionBc::iNtegrate ( EntData data)

Definition at line 861 of file EshelbianOperators.cpp.

861  {
863 
864  FTENSOR_INDEX(3, i);
865 
866  int nb_dofs = data.getFieldData().size();
867  int nb_integration_pts = getGaussPts().size2();
868  int nb_base_functions = data.getN().size2();
869  double ts_t = getFEMethod()->ts_t;
870 
871 #ifndef NDEBUG
872  if (this->locF.size() != nb_dofs)
873  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
874  "Size of locF %d != nb_dofs %d", this->locF.size(), nb_dofs);
875 #endif // NDEBUG
876 
877  auto integrate_rhs = [&](auto &bc) {
879 
880  auto t_val = getFTensor1FromPtr<3>(&*bc.vals.begin());
881  auto t_row_base = data.getFTensor0N();
882  auto t_w = getFTensor0IntegrationWeight();
883 
884  for (int gg = 0; gg != nb_integration_pts; ++gg) {
885  auto t_f = getFTensor1FromPtr<3>(&*this->locF.begin());
886  int rr = 0;
887  for (; rr != nb_dofs / SPACE_DIM; ++rr) {
888  t_f(i) -= ts_t * t_w * t_row_base * t_val(i);
889  ++t_row_base;
890  ++t_f;
891  }
892  for (; rr != nb_base_functions; ++rr)
893  ++t_row_base;
894  ++t_w;
895  }
896 
897  this->locF *= getMeasure();
899  };
900 
901  auto integrate_rhs_cook = [&](auto &bc) {
903 
904  auto t_val = getFTensor1FromPtr<3>(&*bc.vals.begin());
905  auto t_row_base = data.getFTensor0N();
906  auto t_w = getFTensor0IntegrationWeight();
907  auto t_coords = getFTensor1CoordsAtGaussPts();
908 
909  for (int gg = 0; gg != nb_integration_pts; ++gg) {
910 
911  auto calc_tau = [](double y) {
912  y -= 44;
913  y /= (60 - 44);
914  return -y * (y - 1) / 0.25;
915  };
916 
917  const auto tau = calc_tau(t_coords(1));
918  auto t_f = getFTensor1FromPtr<3>(&*this->locF.begin());
919  int rr = 0;
920  for (; rr != nb_dofs / SPACE_DIM; ++rr) {
921  t_f(i) -= ts_t * t_w * t_row_base * tau * t_val(i);
922  ++t_row_base;
923  ++t_f;
924  }
925 
926  for (; rr != nb_base_functions; ++rr)
927  ++t_row_base;
928  ++t_w;
929  ++t_coords;
930  }
931 
932  // Multiply by 2 since we integrate on triangle, and hybrid constrain is
933  // multiplied by norm.
934  this->locF *= 2. * getMeasure();
935 
937  };
938 
939  // get entity of face
940  EntityHandle fe_ent = getFEEntityHandle();
941  for (auto &bc : *(bcData)) {
942  if (bc.faces.find(fe_ent) != bc.faces.end()) {
943 
944  int nb_dofs = data.getFieldData().size();
945  if (nb_dofs) {
946 
947  if (std::regex_match(bc.blockName, std::regex(".*COOK.*")))
948  CHKERR integrate_rhs_cook(bc);
949  else
950  CHKERR integrate_rhs(bc);
951  }
952  }
953  }
954 
956 }

Member Data Documentation

◆ bcData

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

Definition at line 685 of file EshelbianPlasticity.hpp.


The documentation for this struct was generated from the following files:
EntityHandle
MoFEM::EntitiesFieldData::EntData::getFieldData
const VectorDouble & getFieldData() const
get dofs values
Definition: EntitiesFieldData.hpp:1254
OpBase
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition: radiation.cpp:29
FTENSOR_INDEX
#define FTENSOR_INDEX(DIM, I)
Definition: Templates.hpp:2011
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
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
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
EshelbianPlasticity::OpBrokenTractionBc::bcData
boost::shared_ptr< TractionBcVec > bcData
Definition: EshelbianPlasticity.hpp:685
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
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