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

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

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

Public Member Functions

 OpCalculatePlasticFlowLhs_dTAU (const std::string row_field_name, const std::string col_field_name, boost::shared_ptr< CommonData > common_data_ptr)
 
MoFEMErrorCode iNtegrate (EntData &row_data, EntData &col_data)
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 

Detailed Description

Definition at line 154 of file PlasticOperators.hpp.

Constructor & Destructor Documentation

◆ OpCalculatePlasticFlowLhs_dTAU()

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

Definition at line 717 of file PlasticOperators.cpp.

720 : DomainEleOpAssembly(row_field_name, col_field_name,
722 commonDataPtr(common_data_ptr) {
723 sYmm = false;
724}
FormsIntegrators< DomainEleOp >::Assembly< USER_ASSEMBLE >::OpBase DomainEleOpAssembly
@ OPROWCOL
operator doWork is executed on FE rows &columns
boost::shared_ptr< CommonData > commonDataPtr

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode OpPlasticTools::OpCalculatePlasticFlowLhs_dTAU::iNtegrate ( EntData row_data,
EntData col_data 
)

Definition at line 726 of file PlasticOperators.cpp.

727 {
729
730 const size_t nb_row_dofs = row_data.getIndices().size();
731 const size_t nb_col_dofs = col_data.getIndices().size();
732 if (nb_row_dofs && nb_col_dofs) {
733
734 auto get_dt = [&]() {
735 double dt;
736 CHKERR TSGetTimeStep(getFEMethod()->ts, &dt);
737 dt = 1;
738 return dt;
739 };
740 const auto dt = get_dt();
741
742 const size_t nb_integration_pts = row_data.getN().size1();
743 auto t_w = getFTensor0IntegrationWeight();
744 auto t_flow =
745 getFTensor2SymmetricFromMat<3>(*(commonDataPtr->plasticFlowPtr));
746
747 auto get_row_base = [&]() {
748 if (commonDataPtr->isDualBase) {
749 double *base_ptr = &*commonDataPtr->dualBaseMat.data().begin();
750 return Tensor0<PackPtr<double *, 1>>(base_ptr);
751 } else {
752 return row_data.getFTensor0N();
753 }
754 };
755 auto t_row_base = get_row_base();
756
757 auto t_omega = getFTensor1FromMat<3>(*commonDataPtr->guidingVelocityPtr);
758 bool is_rotating = commonDataPtr->guidingVelocityPtr->size2() > 1;
759
760 auto t_D = getFTensor4DdgFromMat<3, 3, 0>(*commonDataPtr->mtD);
761
762 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
763 double alpha = dt * t_w * getMeasure();
764 double beta = alpha * getTSa();
765
766 Tensor2_symmetric<double, 3> t_flow_stress;
767 t_flow_stress(i, j) = t_D(i, j, m, n) * t_flow(m, n);
768
769 for (size_t rr = 0; rr != nb_row_dofs / 6; ++rr) {
770
771 Tensor2<PackPtr<double *, 1>, 3, 3> t_mat{
772 &locMat(6 * rr + 0, 0), &locMat(6 * rr + 1, 0),
773 &locMat(6 * rr + 2, 0), &locMat(6 * rr + 1, 0),
774 &locMat(6 * rr + 3, 0), &locMat(6 * rr + 4, 0),
775 &locMat(6 * rr + 2, 0), &locMat(6 * rr + 4, 0),
776 &locMat(6 * rr + 5, 0)};
777
778 auto t_col_base = col_data.getFTensor0N(gg, 0);
779 auto t_col_diff_base = col_data.getFTensor1DiffN<3>(gg, 0);
780 for (size_t cc = 0; cc != nb_col_dofs; cc++) {
781 t_mat(i, j) -= beta * t_row_base * t_col_base * t_flow_stress(i, j);
782 if (is_rotating)
783 t_mat(i, j) -= alpha * t_row_base *
784 t_flow_stress(i, j) *
785 (t_col_diff_base(k) * t_omega(k));
786 ++t_mat;
787 ++t_col_base;
788 ++t_col_diff_base;
789 }
790
791 ++t_row_base;
792 }
793 if (is_rotating)
794 ++t_omega;
795 ++t_w;
796 ++t_flow;
797 }
798 }
799
801}
#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< 'n', SPACE_DIM > n
FTensor::Index< 'm', SPACE_DIM > m
FTensor::Index< 'i', SPACE_DIM > i
double dt
Definition: heat_method.cpp:26
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
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::OpCalculatePlasticFlowLhs_dTAU::commonDataPtr
private

Definition at line 161 of file PlasticOperators.hpp.


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