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

#include <users_modules/multifield_plasticity/src/PlasticOperators.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 iNtegrate (EntData &row_data, EntData &col_data)
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 

Detailed Description

Definition at line 144 of file PlasticOperators.hpp.

Constructor & Destructor Documentation

◆ OpCalculatePlasticFlowLhs_dEP()

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 506 of file PlasticOperators.cpp.

509 : DomainEleOpAssembly(row_field_name, col_field_name,
510 DomainEleOpAssembly::OPROWCOL),
511 commonDataPtr(common_data_ptr) {
512 sYmm = false;
513}
FormsIntegrators< DomainEleOp >::Assembly< USER_ASSEMBLE >::OpBase DomainEleOpAssembly
boost::shared_ptr< CommonData > commonDataPtr

Member Function Documentation

◆ iNtegrate()

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

Definition at line 515 of file PlasticOperators.cpp.

516 {
518
519 const size_t nb_row_dofs = row_data.getIndices().size();
520 const size_t nb_col_dofs = col_data.getIndices().size();
521 if (nb_row_dofs && nb_col_dofs) {
522
523 auto get_dt = [&]() {
524 double dt;
525 CHKERR TSGetTimeStep(getFEMethod()->ts, &dt);
526 dt = 1;
527 return dt;
528 };
529 const auto dt = get_dt();
530
531 const size_t nb_integration_pts = row_data.getN().size1();
532 const size_t nb_row_base_functions = row_data.getN().size2();
533 auto t_w = getFTensor0IntegrationWeight();
534
535 auto get_row_base = [&]() {
536 if (commonDataPtr->isDualBase) {
537 double *base_ptr = &*commonDataPtr->dualBaseMat.data().begin();
538 return Tensor0<PackPtr<double *, 1>>(base_ptr);
539 } else {
540 return row_data.getFTensor0N();
541 }
542 };
543 auto t_row_base = get_row_base();
544
545 auto &diff_dev = commonDataPtr->diffDeviator;
546 auto t_f = getFTensor0FromVec(*(commonDataPtr->plasticSurfacePtr));
547 auto t_tau_dot = getFTensor0FromVec(*(commonDataPtr->plasticTauDotPtr));
548 auto t_flow =
549 getFTensor2SymmetricFromMat<3>(*(commonDataPtr->plasticFlowPtr));
550
551 auto t_D = getFTensor4DdgFromMat<3, 3, 0>(*commonDataPtr->mtD);
552 auto t_D_Deviator =
553 getFTensor4DdgFromMat<3, 3, 0>(*commonDataPtr->mtD_Deviator);
554
555 auto t_omega = getFTensor1FromMat<3>(*commonDataPtr->guidingVelocityPtr);
556 bool is_rotating = commonDataPtr->guidingVelocityPtr->size2() > 1;
557
558 auto t_diff_plastic_strain = diff_tensor();
559
560 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
561 double alpha = dt * getMeasure() * t_w;
562 double c1 = alpha * getTSa();
563 const double c0 = alpha * t_tau_dot;
564
565
566 auto t_diff_plastic_flow_dstrain = diff_plastic_flow_kin_hard_dstrain(
567 t_D_Deviator, diff_plastic_flow_dstress(t_f, t_flow, diff_dev));
568 Ddg<double, 3, 3> my_tensor;
569 my_tensor(i, j, k, l) =
570 (t_D(i, j, m, n) * (c1 * t_diff_plastic_strain(m, n, k, l) +
571 c0 * t_diff_plastic_flow_dstrain(m, n, k, l)));
572
573 size_t rr = 0;
574 for (; rr != nb_row_dofs / 6; ++rr) {
575
576 // t4(T d0000, T d0001, T d0002, T d0010, T d0011, T d0012, T d0020,
577 // T d0021, T d0022, T d0100, T d0101, T d0102, T d0110, T d0111,
578 // T d0112, T d0120, T d0121, T d0122, T d0200, T d0201, T d0202,
579 // T d0210, T d0211, T d0212, T d0220, T d0221, T d0222, T d1000,
580 // T d1001, T d1002, T d1010, T d1011, T d1012, T d1020, T d1021,
581 // T d1022, T d1100, T d1101, T d1102, T d1110, T d1111, T d1112,
582 // T d1120, T d1121, T d1122, T d1200, T d1201, T d1202, T d1210,
583 // T d1211, T d1212, T d1220, T d1221, T d1222, T d2000, T d2001,
584 // T d2002, T d2010, T d2011, T d2012, T d2020, T d2021, T d2022,
585 // T d2100, T d2101, T d2102, T d2110, T d2111, T d2112, T d2120,
586 // T d2121, T d2122, T d2200, T d2201, T d2202, T d2210, T d2211,
587 // T d2212, T d2220, T d2221, T d2222);
588
589 Tensor4<PackPtr<double *, 6>, 3, 3, 3, 3> t_mat{
590
591 &locMat(6 * rr + 0, 0), // 0000
592 &locMat(6 * rr + 0, 1), // 0001
593 &locMat(6 * rr + 0, 2), // 0002
594 &locMat(6 * rr + 0, 1), // 0010
595 &locMat(6 * rr + 0, 3), // 0011
596 &locMat(6 * rr + 0, 4), // 0012
597 &locMat(6 * rr + 0, 2), // 0020
598 &locMat(6 * rr + 0, 4), // 0021
599 &locMat(6 * rr + 0, 5), // 0022
600
601 &locMat(6 * rr + 1, 0), // 0100
602 &locMat(6 * rr + 1, 1), // 0101
603 &locMat(6 * rr + 1, 2), // 0102
604 &locMat(6 * rr + 1, 1), // 0110
605 &locMat(6 * rr + 1, 3), // 0111
606 &locMat(6 * rr + 1, 4), // 0112
607 &locMat(6 * rr + 1, 2), // 0120
608 &locMat(6 * rr + 1, 4), // 0121
609 &locMat(6 * rr + 1, 5), // 0122
610
611 &locMat(6 * rr + 2, 0), // 0200
612 &locMat(6 * rr + 2, 1), // 0201
613 &locMat(6 * rr + 2, 2), // 0202
614 &locMat(6 * rr + 2, 1), // 0210
615 &locMat(6 * rr + 2, 3), // 0211
616 &locMat(6 * rr + 2, 4), // 0212
617 &locMat(6 * rr + 2, 2), // 0220
618 &locMat(6 * rr + 2, 4), // 0221
619 &locMat(6 * rr + 2, 5), // 0222
620
621 &locMat(6 * rr + 1, 0), // 1000
622 &locMat(6 * rr + 1, 1), // 1001
623 &locMat(6 * rr + 1, 2), // 1002
624 &locMat(6 * rr + 1, 1), // 1010
625 &locMat(6 * rr + 1, 3), // 1011
626 &locMat(6 * rr + 1, 4), // 1012
627 &locMat(6 * rr + 1, 2), // 1020
628 &locMat(6 * rr + 1, 4), // 1021
629 &locMat(6 * rr + 1, 5), // 1022
630
631 &locMat(6 * rr + 3, 0), // 1100
632 &locMat(6 * rr + 3, 1), // 1101
633 &locMat(6 * rr + 3, 2), // 1102
634 &locMat(6 * rr + 3, 1), // 1110
635 &locMat(6 * rr + 3, 3), // 1111
636 &locMat(6 * rr + 3, 4), // 1112
637 &locMat(6 * rr + 3, 2), // 1120
638 &locMat(6 * rr + 3, 4), // 1121
639 &locMat(6 * rr + 3, 5), // 1122
640
641 &locMat(6 * rr + 4, 0), // 1200
642 &locMat(6 * rr + 4, 1), // 1201
643 &locMat(6 * rr + 4, 2), // 1202
644 &locMat(6 * rr + 4, 1), // 1210
645 &locMat(6 * rr + 4, 3), // 1211
646 &locMat(6 * rr + 4, 4), // 1212
647 &locMat(6 * rr + 4, 2), // 1220
648 &locMat(6 * rr + 4, 4), // 1221
649 &locMat(6 * rr + 4, 5), // 1222
650
651 &locMat(6 * rr + 2, 0), // 2000
652 &locMat(6 * rr + 2, 1), // 2001
653 &locMat(6 * rr + 2, 2), // 2002
654 &locMat(6 * rr + 2, 1), // 2010
655 &locMat(6 * rr + 2, 3), // 2011
656 &locMat(6 * rr + 2, 4), // 2012
657 &locMat(6 * rr + 2, 2), // 2020
658 &locMat(6 * rr + 2, 4), // 2021
659 &locMat(6 * rr + 2, 5), // 2022
660
661 &locMat(6 * rr + 4, 0), // 2100
662 &locMat(6 * rr + 4, 1), // 2101
663 &locMat(6 * rr + 4, 2), // 2102
664 &locMat(6 * rr + 4, 1), // 2110
665 &locMat(6 * rr + 4, 3), // 2111
666 &locMat(6 * rr + 4, 4), // 2112
667 &locMat(6 * rr + 4, 2), // 2120
668 &locMat(6 * rr + 4, 4), // 2121
669 &locMat(6 * rr + 4, 5), // 2122
670
671 &locMat(6 * rr + 5, 0), // 2200
672 &locMat(6 * rr + 5, 1), // 2201
673 &locMat(6 * rr + 5, 2), // 2202
674 &locMat(6 * rr + 5, 1), // 2210
675 &locMat(6 * rr + 5, 3), // 2211
676 &locMat(6 * rr + 5, 4), // 2212
677 &locMat(6 * rr + 5, 2), // 2220
678 &locMat(6 * rr + 5, 4), // 2221
679 &locMat(6 * rr + 5, 5) // 2222
680
681 };
682
683 auto t_col_base = col_data.getFTensor0N(gg, 0);
684 auto t_col_diff_base = col_data.getFTensor1DiffN<3>(gg, 0);
685 for (size_t cc = 0; cc != nb_col_dofs / 6; ++cc) {
686 t_mat(i, j, k, l) += my_tensor(i, j, k, l) * t_col_base * t_row_base;
687
688 if (is_rotating)
689 t_mat(i, j, k, l) +=
690 t_row_base *
691 (t_D(i, j, m, n) * (alpha * t_diff_plastic_strain(m, n, k, l) *
692 (t_col_diff_base(i) * t_omega(i))));
693
694 ++t_mat;
695 ++t_col_diff_base;
696 ++t_col_base;
697 }
698
699 ++t_row_base;
700 }
701 for (; rr < nb_row_base_functions; ++rr)
702 ++t_row_base;
703
704 if (is_rotating)
705 ++t_omega;
706
707 ++t_w;
708 ++t_f;
709 ++t_flow;
710 ++t_tau_dot;
711 }
712 }
713
715}
#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< '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
auto diff_plastic_flow_kin_hard_dstrain(Ddg< T, 3, 3 > &t_D, Ddg< double, 3, 3 > &&t_diff_plastic_flow_dstress)
auto diff_plastic_flow_dstress(long double f, Tensor2_symmetric< T, 3 > &t_flow, Ddg< double, 3, 3 > &t_diff_deviator)
auto diff_tensor()
[Operators definitions]
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_dEP::commonDataPtr
private

Definition at line 151 of file PlasticOperators.hpp.


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