v0.10.0
Public Member Functions | Private Attributes | List of all members
OpPlasticTools::OpCalculateContrainsLhs_dEP Struct Reference

#include <users_modules/basic_finite_elements/lessons/src/PlasticOps.hpp>

Inheritance diagram for OpPlasticTools::OpCalculateContrainsLhs_dEP:
[legend]
Collaboration diagram for OpPlasticTools::OpCalculateContrainsLhs_dEP:
[legend]

Public Member Functions

 OpCalculateContrainsLhs_dEP (const std::string row_field_name, const std::string col_field_name, boost::shared_ptr< CommonData > common_data_ptr)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 
 OpCalculateContrainsLhs_dEP (const std::string row_field_name, const std::string col_field_name, boost::shared_ptr< CommonData > common_data_ptr)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 
MatrixDouble locMat
 

Detailed Description

Examples
lesson7_plastic.cpp.

Definition at line 177 of file PlasticOps.hpp.

Constructor & Destructor Documentation

◆ OpCalculateContrainsLhs_dEP() [1/2]

OpPlasticTools::OpCalculateContrainsLhs_dEP::OpCalculateContrainsLhs_dEP ( const std::string  row_field_name,
const std::string  col_field_name,
boost::shared_ptr< CommonData common_data_ptr 
)

Definition at line 987 of file PlasticOps.hpp.

990  : DomainEleOp(row_field_name, col_field_name, DomainEleOp::OPROWCOL),
991  commonDataPtr(common_data_ptr) {
992  sYmm = false;
993 }
DomainEle::UserDataOperator DomainEleOp
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:186

◆ OpCalculateContrainsLhs_dEP() [2/2]

OpPlasticTools::OpCalculateContrainsLhs_dEP::OpCalculateContrainsLhs_dEP ( const std::string  row_field_name,
const std::string  col_field_name,
boost::shared_ptr< CommonData common_data_ptr 
)

Member Function Documentation

◆ doWork() [1/2]

MoFEMErrorCode OpPlasticTools::OpCalculateContrainsLhs_dEP::doWork ( int  row_side,
int  col_side,
EntityType  row_type,
EntityType  col_type,
EntData row_data,
EntData col_data 
)

Definition at line 995 of file PlasticOps.hpp.

999  {
1001 
1002  const size_t nb_row_dofs = row_data.getIndices().size();
1003  const size_t nb_col_dofs = col_data.getIndices().size();
1004  if (nb_row_dofs && nb_col_dofs) {
1005 
1006  locMat.resize(nb_row_dofs, nb_col_dofs, false);
1007  locMat.clear();
1008 
1009  const size_t nb_integration_pts = row_data.getN().size1();
1010  const size_t nb_row_base_functions = row_data.getN().size2();
1011  auto t_w = getFTensor0IntegrationWeight();
1012  auto t_row_base = row_data.getFTensor0N();
1013  auto t_f = getFTensor0FromVec(*(commonDataPtr->plasticSurfacePtr));
1014  auto t_tau = getFTensor0FromVec(*(commonDataPtr->plasticTauPtr));
1015  auto t_tau_dot = getFTensor0FromVec(*(commonDataPtr->plasticTauDotPtr));
1016  auto t_flow =
1017  getFTensor2SymmetricFromMat<2>(*(commonDataPtr->plasticFlowPtr));
1018  auto &t_D = commonDataPtr->tD;
1019 
1020  for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
1021  double alpha = getMeasure() * t_w;
1022 
1023  auto mat_ptr = locMat.data().begin();
1024  auto t_diff_constrain_dstrain = diff_constrain_dstrain(
1025  t_D,
1027  diff_constrain_df(t_tau_dot, t_f - hardening(t_tau)), t_flow));
1028 
1030  &locMat(0, 0), &locMat(0, 1), &locMat(0, 2)};
1031 
1032  size_t rr = 0;
1033  for (; rr != nb_row_dofs; ++rr) {
1034 
1035  auto t_col_base = col_data.getFTensor0N(gg, 0);
1036  for (size_t cc = 0; cc != nb_col_dofs / 3; cc++) {
1037 
1038  t_mat(i, j) -=
1039  alpha * t_row_base * t_col_base * t_diff_constrain_dstrain(i, j);
1040 
1041  ++t_mat;
1042  ++t_col_base;
1043  }
1044 
1045  ++t_row_base;
1046  }
1047  for (; rr != nb_row_base_functions; ++rr)
1048  ++t_row_base;
1049 
1050  ++t_f;
1051  ++t_tau;
1052  ++t_tau_dot;
1053  ++t_flow;
1054  ++t_w;
1055  }
1056 
1057  CHKERR MatSetValues(getSNESB(), row_data, col_data, &*locMat.data().begin(),
1058  ADD_VALUES);
1059  }
1060 
1062 }
static FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:143
auto hardening(double tau)
Definition: PlasticOps.hpp:281
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
auto diff_constrain_dstress(double &&diff_constrain_df, FTensor::Tensor2_symmetric< T, 2 > &t_plastic_flow)
Definition: PlasticOps.hpp:385
const VectorInt & getIndices() const
Get global indices of dofs on entity.
FTensor::Index< 'i', 2 > i
[Common data]
Definition: PlasticOps.hpp:63
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:186
auto diff_constrain_dstrain(FTensor::Ddg< T, 2, 2 > &t_D, FTensor::Tensor2_symmetric< T, 2 > &&t_diff_constrain_dstress)
Definition: PlasticOps.hpp:393
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
FTensor::Index< 'j', 2 > j
Definition: PlasticOps.hpp:64
auto diff_constrain_df(double tau, double f)
Definition: PlasticOps.hpp:379

◆ doWork() [2/2]

MoFEMErrorCode OpPlasticTools::OpCalculateContrainsLhs_dEP::doWork ( int  row_side,
int  col_side,
EntityType  row_type,
EntityType  col_type,
EntData row_data,
EntData col_data 
)

Member Data Documentation

◆ commonDataPtr

boost::shared_ptr< CommonData > OpPlasticTools::OpCalculateContrainsLhs_dEP::commonDataPtr
private

Definition at line 186 of file PlasticOps.hpp.

◆ locMat

MatrixDouble OpPlasticTools::OpCalculateContrainsLhs_dEP::locMat
private

Definition at line 187 of file PlasticOps.hpp.


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