v0.9.1
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 alpha_u
 
- 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 901 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 903 of file EshelbianPlasticity.hpp.

907  : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false),
908  alpha_u(alpha) {
909  sYmm = false;
910  }
OpAssembleVolume(const std::string &field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type)

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 1269 of file EshelbianOperators.cpp.

1270  {
1272 
1273  int nb_integration_pts = row_data.getN().size1();
1274  int row_nb_dofs = row_data.getIndices().size();
1275  int col_nb_dofs = col_data.getIndices().size();
1276  auto get_ftensor4 = [](MatrixDouble &m, const int r, const int c) {
1278 
1279  &m(r + 0, c + 0), &m(r + 0, c + 1), &m(r + 0, c + 2), &m(r + 0, c + 3),
1280  &m(r + 0, c + 4), &m(r + 0, c + 5),
1281 
1282  &m(r + 1, c + 0), &m(r + 1, c + 1), &m(r + 1, c + 2), &m(r + 1, c + 3),
1283  &m(r + 1, c + 4), &m(r + 1, c + 5),
1284 
1285  &m(r + 2, c + 0), &m(r + 2, c + 1), &m(r + 2, c + 2), &m(r + 2, c + 3),
1286  &m(r + 2, c + 4), &m(r + 2, c + 5),
1287 
1288  &m(r + 3, c + 0), &m(r + 3, c + 1), &m(r + 3, c + 2), &m(r + 3, c + 3),
1289  &m(r + 3, c + 4), &m(r + 3, c + 5),
1290 
1291  &m(r + 4, c + 0), &m(r + 4, c + 1), &m(r + 4, c + 2), &m(r + 4, c + 3),
1292  &m(r + 4, c + 4), &m(r + 4, c + 5),
1293 
1294  &m(r + 5, c + 0), &m(r + 5, c + 1), &m(r + 5, c + 2), &m(r + 5, c + 3),
1295  &m(r + 5, c + 4), &m(r + 5, c + 5)
1296 
1297  );
1298  };
1305 
1306  FTensor::Number<0> N0;
1307  FTensor::Number<1> N1;
1308  FTensor::Number<2> N2;
1309 
1310  auto v = getVolume();
1311  auto t_w = getFTensor0IntegrationWeight();
1312  auto t_P_dh0 = getFTensor3FromMat(*(dataAtPts->P_dh0));
1313  auto t_P_dh1 = getFTensor3FromMat(*(dataAtPts->P_dh1));
1314  auto t_P_dh2 = getFTensor3FromMat(*(dataAtPts->P_dh2));
1315  auto t_R = getFTensor2FromMat<3, 3>(*(dataAtPts->rotMatAtPts));
1316  auto t_approx_P = getFTensor2FromMat<3, 3>(*(dataAtPts->approxPAtPts));
1317  auto t_P = getFTensor2FromMat<3, 3>(*(dataAtPts->PAtPts));
1318  auto t_dot_log_u =
1319  getFTensor2SymmetricFromMat<3>(*(dataAtPts->logStreachDotTensorAtPts));
1320  auto t_u = getFTensor2SymmetricFromMat<3>(*(dataAtPts->streachTensorAtPts));
1321  auto t_diff_u = FTensor::Tensor4<FTensor::PackPtr<double *, 1>, 3, 3, 3, 3>(
1322  &(*dataAtPts->diffStreachTensorAtPts)(0, 0),
1323  (*dataAtPts->diffStreachTensorAtPts).size2());
1324  std::array<FTensor::Tensor4<FTensor::PackPtr<double *, 1>, 3, 3, 3, 3>, 6>
1325  t_diff2_u = {
1326 
1328  &dataAtPts->expLogUHessian[0](0, 0),
1329  dataAtPts->expLogUHessian[0].size2()),
1331  &dataAtPts->expLogUHessian[1](0, 0),
1332  dataAtPts->expLogUHessian[1].size2()),
1334  &dataAtPts->expLogUHessian[2](0, 0),
1335  dataAtPts->expLogUHessian[2].size2()),
1337  &dataAtPts->expLogUHessian[3](0, 0),
1338  dataAtPts->expLogUHessian[3].size2()),
1340  &dataAtPts->expLogUHessian[4](0, 0),
1341  dataAtPts->expLogUHessian[4].size2()),
1343  &dataAtPts->expLogUHessian[5](0, 0),
1344  dataAtPts->expLogUHessian[5].size2())
1345 
1346  };
1347 
1350  t_one2(i, j) = 0;
1351  for (auto ii : {0, 1, 2})
1352  t_one2(ii, ii) = 1;
1353  t_one4(i, j, k, l) = t_one2(j, l) * t_one2(i, k);
1354 
1355  FTensor::Tensor4<double, 3, 3, 3, 3> t_one4_symmetric;
1356  t_one4_symmetric(i, j, k, l) = 0;
1357  for (auto ii : {0, 1, 2})
1358  for (auto jj : {0, 1, 2})
1359  for (auto kk : {0, 1, 2})
1360  for (auto ll : {0, 1, 2}) {
1361 
1362  if (ll != kk)
1363  t_one4_symmetric(ii, jj, kk, ll) =
1364  t_one4(ii, jj, kk, ll) + t_one4(ii, jj, ll, kk);
1365  else
1366  t_one4_symmetric(ii, jj, kk, ll) = t_one4(ii, jj, kk, ll);
1367  }
1368 
1369  int row_nb_base_functions = row_data.getN().size2();
1370  auto t_row_base_fun = row_data.getFTensor0N();
1371 
1373  t_one(i, j) = 0;
1374  for (auto ii : {0, 1, 2})
1375  t_one(ii, ii) = 1;
1376 
1377  const double ts_a = getTSa();
1378  for (int gg = 0; gg != nb_integration_pts; ++gg) {
1379  double a = v * t_w;
1380 
1382  t_P_dh(i, j, N0, k) = t_P_dh0(i, j, k);
1383  t_P_dh(i, j, N1, k) = t_P_dh1(i, j, k);
1384  t_P_dh(i, j, N2, k) = t_P_dh2(i, j, k);
1385 
1387  t_RTP(i, j) = t_R(k, i) * t_approx_P(k, j);
1389  t_deltaP(i, j) = t_RTP(i, j) - t_P(i, j);
1390 
1392  t_dot_u(i, j) = t_u(i, k) * t_dot_log_u(k, j);
1393 
1395  t_stress_diff(i, j, k, l) = 0;
1396  for (auto ii : {0, 1, 2})
1397  for (auto jj : {0, 1, 2})
1398  for (auto kk : {0, 1, 2})
1399  for (auto ll : {0, 1, 2})
1400  for (auto mm : {0, 1, 2})
1401  for (auto nn : {0, 1, 2})
1402  t_stress_diff(ii, jj, mm, nn) -=
1403  t_P_dh(ii, jj, kk, ll) * t_diff_u(kk, ll, mm, nn);
1404 
1406  t_dot_u_diff(i, j, k, l) = 0;
1407  for (auto ii : {0, 1, 2})
1408  for (auto jj : {0, 1, 2})
1409  for (auto kk : {0, 1, 2})
1410  for (auto ll : {0, 1, 2})
1411  for (auto mm : {0, 1, 2})
1412  t_dot_u_diff(ii, jj, kk, ll) +=
1413  t_diff_u(ii, mm, kk, ll) * t_dot_log_u(mm, jj) +
1414  ts_a * t_u(ii, mm) * t_one4_symmetric(mm, jj, kk, ll);
1415 
1416  auto t_viscous_stress = calculate_dot_deviator(t_dot_u);
1417  // t_viscous_stress(i, j) = t_dot_u(i, j);
1418  t_viscous_stress(i, j) *= alpha_u;
1419 
1420  auto t_viscous_stress_diff =
1421  calculate_diff_dot_deviator(t_dot_u, t_dot_u_diff);
1422  // t_viscous_stress_diff(i, j, k, l) = t_dot_u_diff(i, j, k, l);
1423  t_viscous_stress_diff(i, j, k, l) *= alpha_u;
1424 
1425  int rr = 0;
1426  for (; rr != row_nb_dofs / 6; ++rr) {
1427 
1428  auto t_col_base_fun = col_data.getFTensor0N(gg, 0);
1429  auto t_m = get_ftensor4(K, 6 * rr, 0);
1430 
1431  for (int cc = 0; cc != col_nb_dofs / 6; ++cc) {
1432 
1433  const double b = a * t_row_base_fun * t_col_base_fun;
1434 
1435  for (int ii : {0, 1, 2})
1436  for (int jj = 0; jj <= ii; ++jj)
1437  for (int kk : {0, 1, 2})
1438  for (int ll = 0; ll <= kk; ++ll)
1439  for (int mm : {0, 1, 2})
1440  for (int nn : {0, 1, 2})
1441  t_m(ii, jj, kk, ll) +=
1442  b * t_diff_u(mm, nn, ii, jj) *
1443  (t_stress_diff(mm, nn, kk, ll) - t_viscous_stress_diff(mm, nn, kk, ll));
1444 
1445  for (int ii : {0, 1, 2})
1446  for (int jj = 0; jj <= ii; ++jj) {
1447  int ss = 0;
1448  for (int kk : {0, 1, 2})
1449  for (int ll = 0; ll <= kk; ++ll, ++ss)
1450  for (int mm : {0, 1, 2})
1451  for (int nn : {0, 1, 2})
1452  t_m(ii, jj, kk, ll) +=
1453  b * (t_diff2_u[ss])(mm, nn, ii, jj) *
1454  (t_deltaP(mm, nn) - t_viscous_stress(mm, nn));
1455  }
1456 
1457  ++t_m;
1458  ++t_col_base_fun;
1459  }
1460 
1461  ++t_row_base_fun;
1462  }
1463  for (; rr != row_nb_base_functions; ++rr)
1464  ++t_row_base_fun;
1465 
1466  ++t_w;
1467  ++t_P_dh0;
1468  ++t_P_dh1;
1469  ++t_P_dh2;
1470  ++t_R;
1471  ++t_approx_P;
1472  ++t_P;
1473  ++t_dot_log_u;
1474  ++t_u;
1475  ++t_diff_u;
1476  for (auto ll : {0, 1, 2, 3, 4, 5})
1477  ++(t_diff2_u[ll]);
1478  }
1480 }
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:74
FTensor::Index< 'n', 2 > n
Definition: PlasticOps.hpp:68
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:482
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
const VectorInt & getIndices() const
Get global indices of dofs on entity.
FTensor::Tensor3< FTensor::PackPtr< double *, 1 >, 3, 3, 3 > getFTensor3FromMat(MatrixDouble &m)
FTensor::Index< 'm', 2 > m
Definition: PlasticOps.hpp:67
static FTensor::Tensor2< typename TensorTypeExtractor< T >::Type, 3, 3 > calculate_dot_deviator(FTensor::Tensor2< T, 3, 3 > &t)
FTensor::Index< 'k', 2 > k
Definition: ContactOps.hpp:28
FTensor::Index< 'j', 2 > j
Definition: ContactOps.hpp:27
static FTensor::Tensor4< typename TensorTypeExtractor< T >::Type, 3, 3, 3, 3 > calculate_diff_dot_deviator(FTensor::Tensor2< T, 3, 3 > &t, FTensor::Tensor4< T, 3, 3, 3, 3 > &t_diff)
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
FTensor::Index< 'l', 2 > l
Definition: ContactOps.hpp:29
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
FTensor::Index< 'i', 2 > i
[Common data]
Definition: ContactOps.hpp:26

Member Data Documentation

◆ alpha_u

const double EshelbianPlasticity::OpSpatialPhysical_du_du::alpha_u

Definition at line 902 of file EshelbianPlasticity.hpp.


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