v0.8.23
Public Member Functions | List of all members
EshelbianPlasticity::OpSpatialPhysical_du_dx Struct Reference

#include <users_modules/eshelbian_plasticty/src/EshelbianPlasticity.hpp>

Inheritance diagram for EshelbianPlasticity::OpSpatialPhysical_du_dx:
[legend]
Collaboration diagram for EshelbianPlasticity::OpSpatialPhysical_du_dx:
[legend]

Public Member Functions

 OpSpatialPhysical_du_dx (const std::string &row_field, const std::string &col_field, boost::shared_ptr< DataAtIntegrationPts > &data_ptr, const bool assemble_off=false)
 
MoFEMErrorCode integrate (EntData &row_data, EntData &col_data)
 
- Public Member Functions inherited from EshelbianPlasticity::OpAssembleVolume
 OpAssembleVolume (const std::string &field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type)
 
 OpAssembleVolume (const std::string &row_field, const std::string &col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type, const bool assemble_symmetry)
 
- Public Member Functions inherited from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >
 OpAssembleBasic (const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type)
 
 OpAssembleBasic (const std::string &row_field, const std::string &col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type, const bool assemble_symmetry)
 
virtual MoFEMErrorCode integrate (EntData &data)
 
virtual MoFEMErrorCode integrate (int row_side, EntityType row_type, EntData &data)
 
virtual MoFEMErrorCode assemble (EntData &data)
 
virtual MoFEMErrorCode assemble (int row_side, EntityType row_type, EntData &data)
 
virtual MoFEMErrorCode assemble (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 

Additional Inherited Members

- Public Attributes inherited from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >
const bool assembleSymmetry
 
boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 data at integration pts More...
 
VectorDouble nF
 local right hand side vector More...
 
MatrixDouble K
 local tangent matrix More...
 
MatrixDouble transposeK
 

Detailed Description

Definition at line 1013 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ OpSpatialPhysical_du_dx()

EshelbianPlasticity::OpSpatialPhysical_du_dx::OpSpatialPhysical_du_dx ( const std::string &  row_field,
const std::string &  col_field,
boost::shared_ptr< DataAtIntegrationPts > &  data_ptr,
const bool  assemble_off = false 
)

Definition at line 1014 of file EshelbianPlasticity.hpp.

1018  : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL,
1019  assemble_off) {
1020  sYmm = false;
1021  }
OpAssembleVolume(const std::string &field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type)

Member Function Documentation

◆ integrate()

MoFEMErrorCode EshelbianPlasticity::OpSpatialPhysical_du_dx::integrate ( EntData row_data,
EntData col_data 
)
virtual

Reimplemented from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >.

Definition at line 1114 of file EshelbianOperators.cpp.

1115  {
1117 
1118  int row_nb_dofs = row_data.getIndices().size();
1119  int col_nb_dofs = col_data.getIndices().size();
1120 
1121  auto get_ftensor3 = [](MatrixDouble &m, const int r, const int c) {
1123 
1124  &m(r + 0, c + 0), &m(r + 0, c + 1), &m(r + 0, c + 2),
1125 
1126  &m(r + 1, c + 0), &m(r + 1, c + 1), &m(r + 1, c + 2),
1127 
1128  &m(r + 2, c + 0), &m(r + 2, c + 1), &m(r + 2, c + 2),
1129 
1130  &m(r + 3, c + 0), &m(r + 3, c + 1), &m(r + 3, c + 2),
1131 
1132  &m(r + 4, c + 0), &m(r + 4, c + 1), &m(r + 4, c + 2),
1133 
1134  &m(r + 5, c + 0), &m(r + 5, c + 1), &m(r + 5, c + 2)
1135 
1136  );
1137  };
1138 
1139  auto v = getVolume();
1140  auto t_w = getFTensor0IntegrationWeight();
1141  auto t_approx_P = getFTensor2FromMat<3, 3>(*(dataAtPts->approxPAtPts));
1142  auto t_P = getFTensor2FromMat<3, 3>(*(dataAtPts->PAtPts));
1143  auto t_P_dh0 = getFTensor3FromMat(*(dataAtPts->P_dh0));
1144  auto t_P_dh1 = getFTensor3FromMat(*(dataAtPts->P_dh1));
1145  auto t_P_dh2 = getFTensor3FromMat(*(dataAtPts->P_dh2));
1146  auto t_R = getFTensor2FromMat<3, 3>(*(dataAtPts->rotMatAtPts));
1147  auto t_x_grad = getFTensor2FromMat<3, 3>(*(dataAtPts->xGradAtPts));
1148  auto t_u = getFTensor2SymmetricFromMat<3>(*(dataAtPts->streachTensorAtPts));
1149 
1156 
1157  FTensor::Number<0> N0;
1158  FTensor::Number<1> N1;
1159  FTensor::Number<2> N2;
1160 
1161  int nb_integration_pts = row_data.getN().size1();
1162  int row_nb_base_functions = row_data.getN().size2();
1163  auto t_row_base_fun = row_data.getFTensor0N();
1164 
1165  for (int gg = 0; gg != nb_integration_pts; ++gg) {
1166  double a = v * t_w;
1167 
1169  t_delta_P(i, j) = t_R(l, i) * t_approx_P(l, j) - t_P(i, j);
1170 
1172  t_P_dh(i, j, N0, l) = t_x_grad(j, m) * t_P_dh0(i, m, l);
1173  t_P_dh(i, j, N1, l) = t_x_grad(j, m) * t_P_dh1(i, m, l);
1174  t_P_dh(i, j, N2, l) = t_x_grad(j, m) * t_P_dh2(i, m, l);
1175 
1177  for (int ii = 0; ii != 3; ++ii)
1178  for (int jj = 0; jj != 3; ++jj)
1179  t_delta_h(ii, jj) = t_u(ii, jj);
1180 
1181  for (int ii = 0; ii != 3; ++ii)
1182  t_delta_h(ii, ii) += 1;
1183 
1184  FTensor::Tensor4<double, 3, 3, 3, 3> t_P_intermidiate_dh;
1185  t_P_intermidiate_dh(i, j, k, l) = t_P_dh(i, j, m, l) * t_delta_h(m, k);
1186 
1187  int rr = 0;
1188  for (; rr != row_nb_dofs / 6; ++rr) {
1189 
1190  auto t_col_diff_base_fun = col_data.getFTensor1DiffN<3>(gg, 0);
1191  auto t_m = get_ftensor3(K, 6 * rr, 0);
1192  const double b = a * t_row_base_fun;
1193 
1194  for (int cc = 0; cc != col_nb_dofs / 3; ++cc) {
1195 
1196  FTensor::Tensor1<double, 3> t_dgrad_x_deltaP;
1197  t_dgrad_x_deltaP(i) = b * t_col_diff_base_fun(k) * t_delta_P(i, k);
1198 
1199  FTensor::Tensor3<double, 3, 3, 3> t_col_P_delta_dh;
1200  t_col_P_delta_dh(i, j, k) =
1201  b * (t_P_intermidiate_dh(i, j, k, l) * t_col_diff_base_fun(l));
1202 
1203  for (int ii = 0; ii != 3; ++ii)
1204  for (int jj = 0; jj != 3; ++jj) {
1205  t_m(ii, jj, jj) += t_dgrad_x_deltaP(ii);
1206  for (int kk = 0; kk != 3; ++kk)
1207  t_m(ii, jj, kk) -= t_col_P_delta_dh(ii, jj, kk);
1208  }
1209 
1210  ++t_m;
1211  ++t_col_diff_base_fun;
1212  }
1213 
1214  ++t_row_base_fun;
1215  }
1216 
1217  for (; rr != row_nb_base_functions; ++rr)
1218  ++t_row_base_fun;
1219 
1220  ++t_approx_P;
1221  ++t_P;
1222  ++t_P_dh0;
1223  ++t_P_dh1;
1224  ++t_P_dh2;
1225  ++t_u;
1226  ++t_x_grad;
1227  ++t_R;
1228  ++t_w;
1229  }
1230 
1232 }
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:77
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
FTensor::Tensor3< FTensor::PackPtr< double *, 1 >, 3, 3, 3 > getFTensor3FromMat(MatrixDouble &m)
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406

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