v0.13.0
Public Member Functions | Private Attributes | List of all members
PlasticOps::OpCalculatePlasticFlowRhs Struct Reference

#include <users_modules/tutorials/adv-0/src/PlasticOps.hpp>

Inheritance diagram for PlasticOps::OpCalculatePlasticFlowRhs:
[legend]
Collaboration diagram for PlasticOps::OpCalculatePlasticFlowRhs:
[legend]

Public Member Functions

 OpCalculatePlasticFlowRhs (const std::string field_name, boost::shared_ptr< CommonData > common_data_ptr)
 [Calculate stress] More...
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 
- Public Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
 OpBaseImpl (const std::string row_field_name, const std::string col_field_name, const OpType type)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 Do calculations for the left hand side. More...
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntData &row_data)
 Do calculations for the right hand side. More...
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 

Additional Inherited Members

- Public Types inherited from MoFEM::OpBaseImpl< A, EleOp >
using OpType = typename EleOp::OpType
 
using EntData = EntitiesFieldData::EntData
 
- Protected Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
template<int DIM>
FTensor::Tensor1< FTensor::PackPtr< double *, DIM >, DIM > getNf ()
 
template<int DIM>
FTensor::Tensor2< FTensor::PackPtr< double *, DIM >, DIM, DIM > getLocMat (const int rr)
 
virtual MoFEMErrorCode iNtegrate (EntData &row_data, EntData &col_data)
 Integrate grad-grad operator. More...
 
virtual MoFEMErrorCode aSsemble (EntData &row_data, EntData &col_data, const bool trans)=0
 
virtual MoFEMErrorCode iNtegrate (EntData &data)
 Class dedicated to integrate operator. More...
 
virtual MoFEMErrorCode aSsemble (EntData &data)=0
 
- Protected Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
int nbRows
 number of dofs on rows More...
 
int nbCols
 number if dof on column More...
 
int nbIntegrationPts
 number of integration points More...
 
int nbRowBaseFunctions
 number or row base functions More...
 
int rowSide
 row side number More...
 
int colSide
 column side number More...
 
EntityType rowType
 row type More...
 
EntityType colType
 column type More...
 
bool assembleTranspose
 
bool onlyTranspose
 
MatrixDouble locMat
 local entity block matrix More...
 
MatrixDouble locMatTranspose
 local entity block matrix More...
 
VectorDouble locF
 local entity vector More...
 

Detailed Description

Definition at line 128 of file PlasticOps.hpp.

Constructor & Destructor Documentation

◆ OpCalculatePlasticFlowRhs()

PlasticOps::OpCalculatePlasticFlowRhs::OpCalculatePlasticFlowRhs ( const std::string  field_name,
boost::shared_ptr< CommonData common_data_ptr 
)

[Calculate stress]

Examples
PlasticOps.hpp, and PlasticOpsGeneric.hpp.

Definition at line 96 of file PlasticOpsGeneric.hpp.

98  : AssemblyDomainEleOp(field_name, field_name, DomainEleOp::OPROW),
99  commonDataPtr(common_data_ptr) {}
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::OpBase AssemblyDomainEleOp
Definition: plastic.cpp:63
boost::shared_ptr< CommonData > commonDataPtr
Definition: PlasticOps.hpp:134

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode PlasticOps::OpCalculatePlasticFlowRhs::iNtegrate ( EntitiesFieldData::EntData data)
Examples
PlasticOps.hpp, and PlasticOpsGeneric.hpp.

Definition at line 114 of file PlasticOpsGeneric.hpp.

114  {
116 
117  auto t_flow =
118  getFTensor2SymmetricFromMat<SPACE_DIM>(commonDataPtr->plasticFlow);
119 
120  auto t_plastic_strain_dot =
121  getFTensor2SymmetricFromMat<SPACE_DIM>(commonDataPtr->plasticStrainDot);
122  auto t_tau_dot = getFTensor0FromVec(commonDataPtr->plasticTauDot);
123 
124  auto t_D =
125  getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(*commonDataPtr->mDPtr);
126  constexpr auto size_symm = (SPACE_DIM * (SPACE_DIM + 1)) / 2;
127 
128  const size_t nb_integration_pts = data.getN().size1();
129  const size_t nb_base_functions = data.getN().size2();
130  auto t_w = getFTensor0IntegrationWeight();
131  auto t_base = data.getFTensor0N();
132 
133  auto &nf = AssemblyDomainEleOp::locF;
134 
135  for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
136  double alpha = getMeasure() * t_w;
137 
138  auto t_nf = get_nf(nf, FTensor::Number<SPACE_DIM>());
139 
140  const double tau_dot = t_tau_dot;
141 
143  t_flow_stress_diff(i, j) = t_D(i, j, k, l) * (t_plastic_strain_dot(k, l) -
144  t_tau_dot * t_flow(k, l));
145 
146  size_t bb = 0;
147  for (; bb != AssemblyDomainEleOp::nbRows / size_symm; ++bb) {
148  t_nf(i, j) += (alpha * t_base) * t_flow_stress_diff(i, j);
149  ++t_base;
150  ++t_nf;
151  }
152  for (; bb < nb_base_functions; ++bb)
153  ++t_base;
154 
155  ++t_flow;
156  ++t_plastic_strain_dot;
157  ++t_tau_dot;
158  ++t_w;
159  }
160 
162 }
constexpr int SPACE_DIM
constexpr double alpha
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:149
static FTensor::Tensor2< FTensor::PackPtr< double *, 3 >, 2, 2 > get_nf(VectorDouble &nf, FTensor::Number< 2 >)
FTensor::Index< 'j', SPACE_DIM > j
[Common data]
Definition: PlasticOps.hpp:91
FTensor::Index< 'l', SPACE_DIM > l
Definition: PlasticOps.hpp:93
FTensor::Index< 'k', SPACE_DIM > k
Definition: PlasticOps.hpp:92
FTensor::Index< 'i', SPACE_DIM > i
Definition: PlasticOps.hpp:95
VectorDouble locF
local entity vector
int nbRows
number of dofs on rows

Member Data Documentation

◆ commonDataPtr

boost::shared_ptr<CommonData> PlasticOps::OpCalculatePlasticFlowRhs::commonDataPtr
private
Examples
PlasticOps.hpp, and PlasticOpsGeneric.hpp.

Definition at line 134 of file PlasticOps.hpp.


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