v0.10.0
Public Member Functions | Public Attributes | List of all members
EshelbianPlasticity::OpSpatialPhysical_du_du Struct Reference

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

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

Public Member Functions

 OpSpatialPhysical_du_du (const std::string &row_field, const std::string &col_field, boost::shared_ptr< DataAtIntegrationPts > &data_ptr, const double alpha)
 
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)
 

Public Attributes

const double alphaU
 
- 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 927 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ OpSpatialPhysical_du_du()

EshelbianPlasticity::OpSpatialPhysical_du_du::OpSpatialPhysical_du_du ( const std::string &  row_field,
const std::string &  col_field,
boost::shared_ptr< DataAtIntegrationPts > &  data_ptr,
const double  alpha 
)

Definition at line 929 of file EshelbianPlasticity.hpp.

933  : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false),
934  alphaU(alpha) {
935  sYmm = false;
936  }

Member Function Documentation

◆ integrate()

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

Reimplemented from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >.

Definition at line 1040 of file EshelbianOperators.cpp.

1041  {
1043 
1044  int nb_integration_pts = row_data.getN().size1();
1045  int row_nb_dofs = row_data.getIndices().size();
1046  int col_nb_dofs = col_data.getIndices().size();
1047  auto get_ftensor4 = [](MatrixDouble &m, const int r, const int c) {
1049 
1050  &m(r + 0, c + 0), &m(r + 0, c + 1), &m(r + 0, c + 2), &m(r + 0, c + 3),
1051  &m(r + 0, c + 4), &m(r + 0, c + 5),
1052 
1053  &m(r + 1, c + 0), &m(r + 1, c + 1), &m(r + 1, c + 2), &m(r + 1, c + 3),
1054  &m(r + 1, c + 4), &m(r + 1, c + 5),
1055 
1056  &m(r + 2, c + 0), &m(r + 2, c + 1), &m(r + 2, c + 2), &m(r + 2, c + 3),
1057  &m(r + 2, c + 4), &m(r + 2, c + 5),
1058 
1059  &m(r + 3, c + 0), &m(r + 3, c + 1), &m(r + 3, c + 2), &m(r + 3, c + 3),
1060  &m(r + 3, c + 4), &m(r + 3, c + 5),
1061 
1062  &m(r + 4, c + 0), &m(r + 4, c + 1), &m(r + 4, c + 2), &m(r + 4, c + 3),
1063  &m(r + 4, c + 4), &m(r + 4, c + 5),
1064 
1065  &m(r + 5, c + 0), &m(r + 5, c + 1), &m(r + 5, c + 2), &m(r + 5, c + 3),
1066  &m(r + 5, c + 4), &m(r + 5, c + 5)
1067 
1068  );
1069  };
1076 
1080 
1081  auto v = getVolume();
1082  auto t_w = getFTensor0IntegrationWeight();
1083  auto t_P_dh0 = getFTensor3FromMat(dataAtPts->P_dh0);
1084  auto t_P_dh1 = getFTensor3FromMat(dataAtPts->P_dh1);
1085  auto t_P_dh2 = getFTensor3FromMat(dataAtPts->P_dh2);
1086  auto t_R = getFTensor2FromMat<3, 3>(dataAtPts->rotMatAtPts);
1087  auto t_approx_P = getFTensor2FromMat<3, 3>(dataAtPts->approxPAtPts);
1088  auto t_P = getFTensor2FromMat<3, 3>(dataAtPts->PAtPts);
1089  auto t_dot_log_u =
1090  getFTensor2SymmetricFromMat<3>(dataAtPts->logStreachDotTensorAtPts);
1091  auto t_u = getFTensor2SymmetricFromMat<3>(dataAtPts->streachTensorAtPts);
1092  auto t_diff_u =
1093  getFTensor4DdgFromMat<3, 3, 1>(dataAtPts->diffStreachTensorAtPts);
1094  auto t_eigen_vals = getFTensor1FromMat<3>(dataAtPts->eigenVals);
1095  auto t_eigen_vecs = getFTensor2FromMat<3, 3>(dataAtPts->eigenVecs);
1096  auto &nbUniq = dataAtPts->nbUniq;
1097 
1098  constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
1100  t_one4(i, j, k, l) = t_kd(j, l) * t_kd(i, k);
1101 
1102  FTensor::Tensor4<double, 3, 3, 3, 3> t_one4_symmetric;
1103  t_one4_symmetric(i, j, k, l) = 0;
1104  for (auto ii : {0, 1, 2})
1105  for (auto jj : {0, 1, 2})
1106  for (auto kk : {0, 1, 2})
1107  for (auto ll : {0, 1, 2}) {
1108 
1109  if (ll != kk)
1110  t_one4_symmetric(ii, jj, kk, ll) =
1111  t_one4(ii, jj, kk, ll) + t_one4(ii, jj, ll, kk);
1112  else
1113  t_one4_symmetric(ii, jj, kk, ll) = t_one4(ii, jj, kk, ll);
1114  }
1115 
1116  int row_nb_base_functions = row_data.getN().size2();
1117  auto t_row_base_fun = row_data.getFTensor0N();
1118 
1120  t_one(i, j) = 0;
1121  for (auto ii : {0, 1, 2})
1122  t_one(ii, ii) = 1;
1123 
1124  const double ts_a = getTSa();
1125  for (int gg = 0; gg != nb_integration_pts; ++gg) {
1126  double a = v * t_w;
1127 
1129  t_P_dh(i, j, N0, k) = t_P_dh0(i, j, k);
1130  t_P_dh(i, j, N1, k) = t_P_dh1(i, j, k);
1131  t_P_dh(i, j, N2, k) = t_P_dh2(i, j, k);
1132 
1134  t_RTP(i, j) = t_R(k, i) * t_approx_P(k, j);
1136  t_deltaP(i, j) = t_RTP(i, j) - t_P(i, j);
1137 
1139  t_dot_u(i, j) = t_u(i, k) * t_dot_log_u(k, j);
1140 
1142  t_stress_diff(i, j, k, l) = 0;
1143  for (int ii = 0; ii != 3; ++ii)
1144  for (int jj = 0; jj != 3; ++jj)
1145  for (int kk = 0; kk != 3; ++kk)
1146  for (int ll = 0; ll != 3; ++ll)
1147  for (int mm = 0; mm != 3; ++mm)
1148  for (int nn = 0; nn != 3; ++nn)
1149  t_stress_diff(ii, jj, mm, nn) -=
1150  t_P_dh(ii, jj, kk, ll) * t_diff_u(kk, ll, mm, nn);
1151 
1152  FTensor::Tensor2_symmetric<double, 3> t_viscous_stress;
1153  t_viscous_stress(i, j) = alphaU * t_dot_log_u(i, j);
1154  FTensor::Tensor4<double, 3, 3, 3, 3> t_viscous_stress_diff;
1155  t_viscous_stress_diff(i, j, k, l) = t_one4_symmetric(i, j, k, l);
1156  t_viscous_stress_diff(i, j, k, l) *= (ts_a * alphaU);
1157 
1159  t_deltaP2(i, j) = t_deltaP(i, j) - t_viscous_stress(i, j);
1160 
1161  auto t_diff2_uP2 = EigenMatrix::getDiffDiffMat(
1162  t_eigen_vals, t_eigen_vecs, f, d_f, dd_f, t_deltaP2, nbUniq[gg]);
1163  for (int ii = 0; ii != 3; ++ii) {
1164  for (int jj = 0; jj < ii; ++jj) {
1165  for (int kk = 0; kk != 3; ++kk) {
1166  for (int ll = 0; ll != kk; ++ll) {
1167  t_diff2_uP2(ii, jj, kk, ll) *= 2;
1168  }
1169  }
1170  }
1171  }
1172  for (int ii = 0; ii != 3; ++ii) {
1173  for (int jj = ii; jj != 3; ++jj) {
1174  for (int kk = 0; kk != 3; ++kk) {
1175  for (int ll = 0; ll < kk; ++ll) {
1176  t_diff2_uP2(ii, jj, kk, ll) *= 2;
1177  }
1178  }
1179  }
1180  }
1181 
1182  int rr = 0;
1183  for (; rr != row_nb_dofs / 6; ++rr) {
1184 
1185  auto t_col_base_fun = col_data.getFTensor0N(gg, 0);
1186  auto t_m = get_ftensor4(K, 6 * rr, 0);
1187 
1188  for (int cc = 0; cc != col_nb_dofs / 6; ++cc) {
1189 
1190  const double b = a * t_row_base_fun * t_col_base_fun;
1191 
1192  for (int ii = 0; ii != 3; ++ii)
1193  for (int jj = ii; jj != 3; ++jj)
1194  for (int kk = 0; kk != 3; ++kk)
1195  for (int ll = kk; ll != 3; ++ll)
1196  for (int mm = 0; mm != 3; ++mm)
1197  for (int nn = 0; nn != 3; ++nn)
1198  t_m(ii, jj, kk, ll) +=
1199  b * t_diff_u(mm, nn, ii, jj) *
1200  (t_stress_diff(mm, nn, kk, ll) -
1201  t_viscous_stress_diff(mm, nn, kk, ll));
1202 
1203  t_m(i, j, k, l) += b * t_diff2_uP2(i, j, k, l);
1204 
1205  ++t_m;
1206  ++t_col_base_fun;
1207  }
1208 
1209  ++t_row_base_fun;
1210  }
1211  for (; rr != row_nb_base_functions; ++rr)
1212  ++t_row_base_fun;
1213 
1214  ++t_w;
1215  ++t_P_dh0;
1216  ++t_P_dh1;
1217  ++t_P_dh2;
1218  ++t_R;
1219  ++t_approx_P;
1220  ++t_P;
1221  ++t_dot_log_u;
1222  ++t_u;
1223  ++t_diff_u;
1224  ++t_eigen_vals;
1225  ++t_eigen_vecs;
1226  }
1228 }

Member Data Documentation

◆ alphaU

const double EshelbianPlasticity::OpSpatialPhysical_du_du::alphaU

Definition at line 928 of file EshelbianPlasticity.hpp.


The documentation for this struct was generated from the following files:
EshelbianPlasticity::f
double f(const double v)
Definition: EshelbianOperators.cpp:22
FTensor::Tensor2< double, 3, 3 >
N2
static Number< 2 > N2
Definition: BasicFeTools.hpp:91
EshelbianPlasticity::getFTensor3FromMat
FTensor::Tensor3< FTensor::PackPtr< double *, 1 >, 3, 3, 3 > getFTensor3FromMat(MatrixDouble &m)
Definition: EshelbianPlasticity.hpp:24
EshelbianPlasticity::dd_f
double dd_f(const double v)
Definition: EshelbianOperators.cpp:24
n
static Index< 'n', 3 > n
Definition: BasicFeTools.hpp:78
EshelbianPlasticity::d_f
double d_f(const double v)
Definition: EshelbianOperators.cpp:23
MoFEM::DataForcesAndSourcesCore::EntData::getIndices
const VectorInt & getIndices() const
Get global indices of dofs on entity.
Definition: DataStructures.hpp:1178
MoFEM::Types::MatrixDouble
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:76
EigenMatrix::getDiffDiffMat
FTensor::Ddg< double, 3, 3 > getDiffDiffMat(Val< double, 3 > &t_val, Vec< double, 3 > &t_vec, Fun< double > f, Fun< double > d_f, Fun< double > dd_f, FTensor::Tensor2< double, 3, 3 > &t_S, const int nb)
Get the Diff Diff Mat object.
Definition: MatrixFunction.cpp:78
FTensor::Number< 0 >
N0
static Number< 0 > N0
Definition: BasicFeTools.hpp:89
FTensor::Kronecker_Delta
Kronecker Delta class.
Definition: Kronecker_Delta.hpp:15
m
static Index< 'm', 3 > m
Definition: BasicFeTools.hpp:77
ElectroPhysiology::alpha
const double alpha
Definition: ElecPhysOperators.hpp:28
FTensor::Ddg
Definition: Ddg_value.hpp:8
FTensor::Tensor4< double, 3, 3, 3, 3 >
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:14
FTensor::Index< 'i', 3 >
ElectroPhysiology::b
const double b
Definition: ElecPhysOperators.hpp:30
MoFEM::DataForcesAndSourcesCore::EntData::getFTensor0N
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
Definition: DataStructures.hpp:1459
N1
static Number< 1 > N1
Definition: BasicFeTools.hpp:90
EshelbianPlasticity::OpAssembleVolume::OpAssembleVolume
OpAssembleVolume(const std::string &field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type)
Definition: EshelbianPlasticity.hpp:733
EshelbianPlasticity::OpSpatialPhysical_du_du::alphaU
const double alphaU
Definition: EshelbianPlasticity.hpp:928
EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >::dataAtPts
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
Definition: EshelbianPlasticity.hpp:603
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
MoFEM::DataForcesAndSourcesCore::EntData::getN
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
Definition: DataStructures.hpp:1288
ElectroPhysiology::c
const double c
Definition: ElecPhysOperators.hpp:31
EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >::K
MatrixDouble K
local tangent matrix
Definition: EshelbianPlasticity.hpp:617
i
FTensor::Index< 'i', 3 > i
Definition: matrix_function.cpp:18
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21
ReactionDiffusionEquation::r
const double r
rate factor
Definition: reaction_diffusion.cpp:33