v0.10.0
Public Member Functions | Private Attributes | List of all members
OpPlasticTools::OpCalculatePlasticInternalForceLhs_dEP Struct Reference

#include <users_modules/basic_finite_elements/lessons/src/PlasticOps.hpp>

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

Public Member Functions

 OpCalculatePlasticInternalForceLhs_dEP (const std::string row_field_name, const std::string col_field_name, boost::shared_ptr< CommonData > common_data_ptr)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 
 OpCalculatePlasticInternalForceLhs_dEP (const std::string row_field_name, const std::string col_field_name, boost::shared_ptr< CommonData > common_data_ptr)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 
MatrixDouble locMat
 

Detailed Description

Examples
lesson7_plastic.cpp.

Definition at line 112 of file PlasticOps.hpp.

Constructor & Destructor Documentation

◆ OpCalculatePlasticInternalForceLhs_dEP() [1/2]

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

Definition at line 575 of file PlasticOps.hpp.

578  : DomainEleOp(row_field_name, col_field_name, DomainEleOp::OPROWCOL),
579  commonDataPtr(common_data_ptr) {
580  sYmm = false;
581 }
DomainEle::UserDataOperator DomainEleOp

◆ OpCalculatePlasticInternalForceLhs_dEP() [2/2]

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

Member Function Documentation

◆ doWork() [1/2]

MoFEMErrorCode OpPlasticTools::OpCalculatePlasticInternalForceLhs_dEP::doWork ( int  row_side,
int  col_side,
EntityType  row_type,
EntityType  col_type,
EntData row_data,
EntData col_data 
)

Definition at line 583 of file PlasticOps.hpp.

585  {
587 
588  const size_t nb_row_dofs = row_data.getIndices().size();
589  const size_t nb_col_dofs = col_data.getIndices().size();
590  if (nb_row_dofs && nb_col_dofs) {
591 
592  locMat.resize(nb_row_dofs, nb_col_dofs, false);
593  locMat.clear();
594 
595  const size_t nb_integration_pts = row_data.getN().size1();
596  const size_t nb_row_base_functions = row_data.getN().size2();
597  auto t_w = getFTensor0IntegrationWeight();
598  auto t_row_diff_base = row_data.getFTensor1DiffN<2>();
599  auto &t_D = commonDataPtr->tD;
600 
601  for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
602  double alpha = getMeasure() * t_w;
603 
604  size_t rr = 0;
605  for (; rr != nb_row_dofs / 2; ++rr) {
606 
608 
609  &locMat(2 * rr + 0, 0), &locMat(2 * rr + 0, 1),
610  &locMat(2 * rr + 0, 2),
611 
612  &locMat(2 * rr + 1, 0), &locMat(2 * rr + 1, 1),
613  &locMat(2 * rr + 1, 2)
614 
615  };
616 
617  auto t_col_base = col_data.getFTensor0N(gg, 0);
618  for (size_t cc = 0; cc != nb_col_dofs / 3; ++cc) {
619 
620  // I mix up the indices here so that it behaves like a
621  // Dg. That way I don't have to have a separate wrapper
622  // class Christof_Expr, which simplifies things.
623  // You cyclicly has to shift index, i, j, k -> l, i, j
625  t_tmp(l, i, k) =
626  (t_D(i, j, k, l) * ((alpha * t_col_base) * t_row_diff_base(j)));
627 
628  for (int ii = 0; ii != 2; ++ii)
629  for (int kk = 0; kk != 2; ++kk)
630  for (int ll = 0; ll != 2; ++ll)
631  t_mat(ii, kk, ll) -= t_tmp(ii, kk, ll);
632 
633  ++t_mat;
634  ++t_col_base;
635  }
636 
637  ++t_row_diff_base;
638  }
639 
640  for (; rr < nb_row_base_functions; ++rr)
641  ++t_row_diff_base;
642 
643  ++t_w;
644  }
645 
646  MatSetValues(getSNESB(), row_data, col_data, &*locMat.data().begin(),
647  ADD_VALUES);
648  }
649 
651 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
FTensor::Tensor1< double *, Tensor_Dim > getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
const VectorInt & getIndices() const
Get global indices of dofs on entity.
FTensor::Index< 'i', 2 > i
[Common data]
Definition: PlasticOps.hpp:63
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
FTensor::Index< 'k', 2 > k
Definition: PlasticOps.hpp:65
FTensor::Index< 'l', 2 > l
Definition: PlasticOps.hpp:66
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
FTensor::Index< 'j', 2 > j
Definition: PlasticOps.hpp:64

◆ doWork() [2/2]

MoFEMErrorCode OpPlasticTools::OpCalculatePlasticInternalForceLhs_dEP::doWork ( int  row_side,
int  col_side,
EntityType  row_type,
EntityType  col_type,
EntData row_data,
EntData col_data 
)

Member Data Documentation

◆ commonDataPtr

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

Definition at line 121 of file PlasticOps.hpp.

◆ locMat

MatrixDouble OpPlasticTools::OpCalculatePlasticInternalForceLhs_dEP::locMat
private

Definition at line 122 of file PlasticOps.hpp.


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