v0.14.0
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
OpPlasticTools::OpCalculatePlasticFlowLhs_dU< LOGSTRAIN > Struct Template Reference

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

Inheritance diagram for OpPlasticTools::OpCalculatePlasticFlowLhs_dU< LOGSTRAIN >:
[legend]
Collaboration diagram for OpPlasticTools::OpCalculatePlasticFlowLhs_dU< LOGSTRAIN >:
[legend]

Public Member Functions

 OpCalculatePlasticFlowLhs_dU (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

template<bool LOGSTRAIN>
struct OpPlasticTools::OpCalculatePlasticFlowLhs_dU< LOGSTRAIN >

Definition at line 134 of file PlasticOperators.hpp.

Constructor & Destructor Documentation

◆ OpCalculatePlasticFlowLhs_dU()

template<bool LOGSTRAIN>
OpPlasticTools::OpCalculatePlasticFlowLhs_dU< LOGSTRAIN >::OpCalculatePlasticFlowLhs_dU ( const std::string  row_field_name,
const std::string  col_field_name,
boost::shared_ptr< CommonData common_data_ptr 
)

Definition at line 346 of file PlasticOperators.cpp.

349 : DomainEleOpAssembly(row_field_name, col_field_name,
350 DomainEleOpAssembly::OPROWCOL),
351 commonDataPtr(common_data_ptr) {
352 sYmm = false;
353}
FormsIntegrators< DomainEleOp >::Assembly< USER_ASSEMBLE >::OpBase DomainEleOpAssembly
boost::shared_ptr< CommonData > commonDataPtr

Member Function Documentation

◆ iNtegrate()

template<bool LOGSTRAIN>
MoFEMErrorCode OpPlasticTools::OpCalculatePlasticFlowLhs_dU< LOGSTRAIN >::iNtegrate ( EntData row_data,
EntData col_data 
)

Definition at line 355 of file PlasticOperators.cpp.

357 {
359
360 const size_t nb_row_dofs = row_data.getIndices().size();
361 const size_t nb_col_dofs = col_data.getIndices().size();
362 if (nb_row_dofs && nb_col_dofs) {
363
364 auto get_dt = [&]() {
365 double dt;
366 CHKERR TSGetTimeStep(getFEMethod()->ts, &dt);
367 dt = 1;
368 return dt;
369 };
370 const auto dt = get_dt();
371
372 const size_t nb_integration_pts = row_data.getN().size1();
373 const size_t nb_row_base_functions = row_data.getN().size2();
374 auto t_w = getFTensor0IntegrationWeight();
375
376 auto get_row_base = [&]() {
377 if (commonDataPtr->isDualBase) {
378 double *base_ptr = &*commonDataPtr->dualBaseMat.data().begin();
379 return Tensor0<PackPtr<double *, 1>>(base_ptr);
380 } else {
381 return row_data.getFTensor0N();
382 }
383 };
384 auto t_row_base = get_row_base();
385
386 auto t_f = getFTensor0FromVec(*(commonDataPtr->plasticSurfacePtr));
387 auto t_tau_dot = getFTensor0FromVec(*(commonDataPtr->plasticTauDotPtr));
388 auto &diff_dev = commonDataPtr->diffDeviator;
389 auto t_flow =
390 getFTensor2SymmetricFromMat<3>(*(commonDataPtr->plasticFlowPtr));
391 auto t_D = getFTensor4DdgFromMat<3, 3, 0>(*commonDataPtr->mtD);
392 auto t_D_Deviator =
393 getFTensor4DdgFromMat<3, 3, 0>(*commonDataPtr->mtD_Deviator);
394
395 MatrixDouble &dE_dF = *(commonDataPtr->dE_dF_mat);
396 auto t_dE_dF = getFTensor4FromMat<3, 3, 3, 3>(dE_dF);
397
398 auto t_diff_symmetrize = diff_symmetrize();
399
400 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
401
402 double alpha = dt * getMeasure() * t_w;
403 auto t_diff_plastic_flow_dstrain = diff_plastic_flow_dstrain(
404 t_D_Deviator, diff_plastic_flow_dstress(t_f, t_flow, diff_dev));
405 Ddg<double, 3, 3> t_flow_stress_dstrain;
406 t_flow_stress_dstrain(i, j, k, l) =
407 t_D(i, j, m, n) * t_diff_plastic_flow_dstrain(m, n, k, l);
408 Tensor4<double, 3, 3, 3, 3> t_diff_plastic_flow_stress_dgrad;
409
410 if (!LOGSTRAIN)
411 t_diff_plastic_flow_stress_dgrad(i, j, k, l) =
412 t_flow_stress_dstrain(i, j, m, n) * t_diff_symmetrize(m, n, k, l);
413 else {
414
415 Tensor4<double, 3, 3, 3, 3> t_diff_plastic_flow_stress_dgrads;
416 t_diff_plastic_flow_stress_dgrads(i, j, k, l) =
417 t_flow_stress_dstrain(i, j, m, n) * t_diff_symmetrize(m, n, k, l);
418 t_diff_plastic_flow_stress_dgrad(i, j, k, l) = 0.;
419 for (int i = 0; i != 3; ++i)
420 for (int j = 0; j != 3; ++j)
421 for (int k = 0; k != 3; ++k)
422 for (int l = 0; l != 3; ++l)
423 for (int m = 0; m != 3; ++m)
424 for (int n = 0; n != 3; ++n)
425 t_diff_plastic_flow_stress_dgrad(i, j, k, l) +=
426 t_diff_plastic_flow_stress_dgrads(i, j, m, n) *
427 t_dE_dF(m, n, k, l);
428 }
429
430 size_t rr = 0;
431 for (; rr != nb_row_dofs / 6; ++rr) {
432
433 // t3(T d000, T d001, T d002, T d010, T d011, T d012, T d020, T d021,
434 // T d022, T d100, T d101, T d102, T d110, T d111, T d112, T d120,
435 // T d121, T d122, T d200, T d201, T d202, T d210, T d211, T d212,
436 // T d220, T d221, T d222);
437
438 Tensor3<PackPtr<double *, 3>, 3, 3, 3> t_mat{
439 &locMat(6 * rr + 0, 0), // 000
440 &locMat(6 * rr + 0, 1), // 001
441 &locMat(6 * rr + 0, 2), // 002
442
443 &locMat(6 * rr + 1, 0), // 010
444 &locMat(6 * rr + 1, 1), // 011
445 &locMat(6 * rr + 1, 2), // 012
446
447 &locMat(6 * rr + 2, 0), // 020
448 &locMat(6 * rr + 2, 1), // 021
449 &locMat(6 * rr + 2, 2), // 022
450
451 &locMat(6 * rr + 1, 0), // 100
452 &locMat(6 * rr + 1, 1), // 101
453 &locMat(6 * rr + 1, 2), // 102
454
455 &locMat(6 * rr + 3, 0), // 110
456 &locMat(6 * rr + 3, 1), // 111
457 &locMat(6 * rr + 3, 2), // 112
458
459 &locMat(6 * rr + 4, 0), // 120
460 &locMat(6 * rr + 4, 1), // 121
461 &locMat(6 * rr + 4, 2), // 122
462
463 &locMat(6 * rr + 2, 0), // 200
464 &locMat(6 * rr + 2, 1), // 201
465 &locMat(6 * rr + 2, 2), // 202
466
467 &locMat(6 * rr + 4, 0), // 210
468 &locMat(6 * rr + 4, 1), // 211
469 &locMat(6 * rr + 4, 2), // 212
470
471 &locMat(6 * rr + 5, 0), // 220
472 &locMat(6 * rr + 5, 1), // 221
473 &locMat(6 * rr + 5, 2) // 222
474 };
475
476 const double c0 = alpha * t_row_base * t_tau_dot;
477
478 auto t_col_diff_base = col_data.getFTensor1DiffN<3>(gg, 0);
479 for (size_t cc = 0; cc != nb_col_dofs / 3; ++cc) {
480
481 t_mat(i, j, l) -= c0 * (t_diff_plastic_flow_stress_dgrad(i, j, l, k) *
482 t_col_diff_base(k));
483
484 ++t_mat;
485 ++t_col_diff_base;
486 }
487
488 ++t_row_base;
489 }
490 for (; rr < nb_row_base_functions; ++rr)
491 ++t_row_base;
492
493 if (LOGSTRAIN)
494 ++t_dE_dF;
495
496 ++t_w;
497 ++t_f;
498 ++t_flow;
499 ++t_tau_dot;
500 }
501 }
502
504}
#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_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)
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

template<bool LOGSTRAIN>
boost::shared_ptr<CommonData> OpPlasticTools::OpCalculatePlasticFlowLhs_dU< LOGSTRAIN >::commonDataPtr
private

Definition at line 141 of file PlasticOperators.hpp.


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