v0.14.0
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
OpPlasticTools::OpCalculatePlasticFlowRhs Struct Reference

#include <users_modules/multifield_plasticity/src/PlasticOperators.hpp>

Inheritance diagram for OpPlasticTools::OpCalculatePlasticFlowRhs:
[legend]
Collaboration diagram for OpPlasticTools::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)
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 

Detailed Description

Definition at line 102 of file PlasticOperators.hpp.

Constructor & Destructor Documentation

◆ OpCalculatePlasticFlowRhs()

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

[Calculate stress]

Definition at line 116 of file PlasticOperators.cpp.

118 : DomainEleOpAssembly(field_name, field_name, DomainEleOpAssembly::OPROW),
119 commonDataPtr(common_data_ptr) {}
FormsIntegrators< DomainEleOp >::Assembly< USER_ASSEMBLE >::OpBase DomainEleOpAssembly
constexpr auto field_name
boost::shared_ptr< CommonData > commonDataPtr

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode OpPlasticTools::OpCalculatePlasticFlowRhs::iNtegrate ( EntitiesFieldData::EntData data)

Definition at line 121 of file PlasticOperators.cpp.

121 {
123 const size_t nb_dofs = data.getIndices().size();
124 if (nb_dofs) {
125
126 auto get_dt = [&]() {
127 double dt;
128 CHKERR TSGetTimeStep(getFEMethod()->ts, &dt);
129 dt = 1;
130 return dt;
131 };
132 const auto dt = get_dt();
133
134 auto t_flow =
135 getFTensor2SymmetricFromMat<3>(*(commonDataPtr->plasticFlowPtr));
136
137 auto t_plastic_strain_dot =
138 getFTensor2SymmetricFromMat<3>(*(commonDataPtr->plasticStrainDotPtr));
139 auto t_tau_dot = getFTensor0FromVec(*(commonDataPtr->plasticTauDotPtr));
140
141 auto t_D = getFTensor4DdgFromMat<3, 3, 0>(*commonDataPtr->mtD);
142
143 const size_t nb_integration_pts = data.getN().size1();
144 const size_t nb_base_functions = data.getN().size2();
145 auto t_w = getFTensor0IntegrationWeight();
146 auto t_base = data.getFTensor0N();
147
148 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
149 double alpha = dt * getMeasure() * t_w;
150
151 Tensor2<PackPtr<double *, 6>, 3, 3> t_nf{&locF(0), &locF(1), &locF(2),
152 &locF(1), &locF(3), &locF(4),
153 &locF(2), &locF(4), &locF(5)};
154
155 Tensor2_symmetric<double, 3> t_flow_stress_diff;
156 t_flow_stress_diff(i, j) = t_D(i, j, k, l) * (t_plastic_strain_dot(k, l) -
157 t_tau_dot * t_flow(k, l));
158
159 size_t bb = 0;
160 for (; bb != nb_dofs / 6; ++bb) {
161 t_nf(i, j) += alpha * t_base * t_flow_stress_diff(i, j);
162 ++t_base;
163 ++t_nf;
164 }
165 for (; bb < nb_base_functions; ++bb)
166 ++t_base;
167
168 ++t_flow;
169 ++t_plastic_strain_dot;
170 ++t_tau_dot;
171 ++t_w;
172 }
173 }
174
176}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define CHKERR
Inline error check.
Definition: definitions.h:535
FTensor::Index< 'i', SPACE_DIM > i
double dt
Definition: heat_method.cpp:26
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorInt & getIndices() const
Get global indices of dofs on entity.

Member Data Documentation

◆ commonDataPtr

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

Definition at line 108 of file PlasticOperators.hpp.


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