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

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

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

Public Member Functions

 OpCalculatePlasticFlowLhs_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)
 
 OpCalculatePlasticFlowLhs_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 138 of file PlasticOps.hpp.

Constructor & Destructor Documentation

◆ OpCalculatePlasticFlowLhs_dEP() [1/2]

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

Definition at line 750 of file PlasticOps.hpp.

753  : DomainEleOp(row_field_name, col_field_name, DomainEleOp::OPROWCOL),
754  commonDataPtr(common_data_ptr) {
755  sYmm = false;
756 }
DomainEle::UserDataOperator DomainEleOp
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:147

◆ OpCalculatePlasticFlowLhs_dEP() [2/2]

OpPlasticTools::OpCalculatePlasticFlowLhs_dEP::OpCalculatePlasticFlowLhs_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::OpCalculatePlasticFlowLhs_dEP::doWork ( int  row_side,
int  col_side,
EntityType  row_type,
EntityType  col_type,
EntData row_data,
EntData col_data 
)

Definition at line 758 of file PlasticOps.hpp.

762  {
764 
765  const size_t nb_row_dofs = row_data.getIndices().size();
766  const size_t nb_col_dofs = col_data.getIndices().size();
767  if (nb_row_dofs && nb_col_dofs) {
768 
769  locMat.resize(nb_row_dofs, nb_col_dofs, false);
770  locMat.clear();
771 
772  const size_t nb_integration_pts = row_data.getN().size1();
773  const size_t nb_row_base_functions = row_data.getN().size2();
774  auto t_w = getFTensor0IntegrationWeight();
775  auto t_row_base = row_data.getFTensor0N();
776  auto t_f = getFTensor0FromVec(*(commonDataPtr->plasticSurfacePtr));
777  auto t_tau_dot = getFTensor0FromVec(*(commonDataPtr->plasticTauDotPtr));
778  auto t_flow =
779  getFTensor2SymmetricFromMat<2>(*(commonDataPtr->plasticFlowPtr));
780 
781  auto &t_D = commonDataPtr->tD;
782  auto t_diff_plastic_strain = diff_tensor();
783 
784  for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
785  double alpha = getMeasure() * t_w;
786  double beta = alpha * getTSa();
787 
788  size_t rr = 0;
789  for (; rr != nb_row_dofs / 3; ++rr) {
790 
791  const double c0 = alpha * t_row_base * t_tau_dot;
792  const double c1 = beta * t_row_base;
793 
794  auto t_diff_plastic_flow_dstrain = diff_plastic_flow_dstrain(
795  t_D, diff_plastic_flow_dstress(t_f, t_flow,
797 
799 
800  &locMat(3 * rr + 0, 0), &locMat(3 * rr + 0, 1),
801  &locMat(3 * rr + 0, 2),
802 
803  &locMat(3 * rr + 1, 0), &locMat(3 * rr + 1, 1),
804  &locMat(3 * rr + 1, 2),
805 
806  &locMat(3 * rr + 2, 0), &locMat(3 * rr + 2, 1),
807  &locMat(3 * rr + 2, 2)
808 
809  };
810 
811  auto t_col_base = col_data.getFTensor0N(gg, 0);
812  for (size_t cc = 0; cc != nb_col_dofs / 3; ++cc) {
813 
814  t_mat(i, j, k, l) +=
815  t_col_base * (t_D(i, j, m, n) *
816  (c1 * t_diff_plastic_strain(m, n, k, l) +
817  c0 * t_diff_plastic_flow_dstrain(m, n, k, l)));
818 
819  ++t_mat;
820  ++t_col_base;
821  }
822 
823  ++t_row_base;
824  }
825  for (; rr < nb_row_base_functions; ++rr)
826  ++t_row_base;
827 
828  ++t_w;
829  ++t_f;
830  ++t_flow;
831  ++t_tau_dot;
832  }
833 
834  CHKERR MatSetValues(getTSB(), row_data, col_data, &*locMat.data().begin(),
835  ADD_VALUES);
836  }
837 
839 }
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
FTensor::Index< 'm', 2 > m
Definition: PlasticOps.hpp:67
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
const VectorInt & getIndices() const
Get global indices of dofs on entity.
FTensor::Index< 'i', 2 > i
[Common data]
Definition: PlasticOps.hpp:63
auto diff_tensor()
[Operators definitions]
Definition: PlasticOps.hpp:218
auto diff_deviator(FTensor::Ddg< double, 2, 2 > &&t_diff_stress)
Definition: PlasticOps.hpp:258
#define CHKERR
Inline error check.
Definition: definitions.h:604
auto diff_plastic_flow_dstrain(FTensor::Ddg< T, 2, 2 > &t_D, FTensor::Ddg< double, 2, 2 > &&t_diff_plastic_flow_dstress)
Definition: PlasticOps.hpp:341
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:147
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
FTensor::Index< 'n', 2 > n
Definition: PlasticOps.hpp:68
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
FTensor::Index< 'k', 2 > k
Definition: PlasticOps.hpp:65
auto diff_plastic_flow_dstress(double f, FTensor::Tensor2_symmetric< T, 2 > &t_flow, FTensor::Ddg< double, 3, 2 > &&t_diff_deviator)
Definition: PlasticOps.hpp:327
FTensor::Index< 'l', 2 > l
Definition: PlasticOps.hpp:66
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
FTensor::Index< 'j', 2 > j
Definition: PlasticOps.hpp:64

◆ doWork() [2/2]

MoFEMErrorCode OpPlasticTools::OpCalculatePlasticFlowLhs_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::OpCalculatePlasticFlowLhs_dEP::commonDataPtr
private

Definition at line 147 of file PlasticOps.hpp.

◆ locMat

MatrixDouble OpPlasticTools::OpCalculatePlasticFlowLhs_dEP::locMat
private

Definition at line 148 of file PlasticOps.hpp.


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