v0.14.0
Loading...
Searching...
No Matches
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)
 
MoFEMErrorCode integratePiola (EntData &row_data, EntData &col_data)
 
MoFEMErrorCode integrateHencky (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, ScaleOff scale_off=[]() { return 1;})
 
virtual MoFEMErrorCode integrate (EntData &data)
 
virtual MoFEMErrorCode integrate (int row_side, EntityType row_type, EntData &data)
 
virtual MoFEMErrorCode integrate (EntData &row_data, EntData &col_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
 
ScaleOff scaleOff
 

Additional Inherited Members

- Public Types inherited from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >
using ScaleOff = boost::function< double()>
 

Detailed Description

Definition at line 637 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 
)
inline

Definition at line 639 of file EshelbianPlasticity.hpp.

643 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false),
644 alphaU(alpha) {
645 sYmm = false;
646 }
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 >.

Examples
EshelbianOperators.cpp.

Definition at line 1287 of file EshelbianOperators.cpp.

1288 {
1290 if (dataAtPts->physicsPtr->dependentVariablesPiola.size()) {
1291 CHKERR integratePiola(row_data, col_data);
1292 } else {
1293 CHKERR integrateHencky(row_data, col_data);
1294 }
1296}
#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
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
MoFEMErrorCode integrateHencky(EntData &row_data, EntData &col_data)
MoFEMErrorCode integratePiola(EntData &row_data, EntData &col_data)

◆ integrateHencky()

MoFEMErrorCode EshelbianPlasticity::OpSpatialPhysical_du_du::integrateHencky ( EntData row_data,
EntData col_data 
)
Examples
EshelbianOperators.cpp.

Definition at line 1298 of file EshelbianOperators.cpp.

1299 {
1301
1304 auto t_L = symm_L_tensor();
1305 auto t_diff = diff_tensor();
1306
1307 int nb_integration_pts = row_data.getN().size1();
1308 int row_nb_dofs = row_data.getIndices().size();
1309 int col_nb_dofs = col_data.getIndices().size();
1310
1311 auto get_ftensor2 = [](MatrixDouble &m, const int r, const int c) {
1313 size_symm>(
1314
1315 &m(r + 0, c + 0), &m(r + 0, c + 1), &m(r + 0, c + 2), &m(r + 0, c + 3),
1316 &m(r + 0, c + 4), &m(r + 0, c + 5),
1317
1318 &m(r + 1, c + 0), &m(r + 1, c + 1), &m(r + 1, c + 2), &m(r + 1, c + 3),
1319 &m(r + 1, c + 4), &m(r + 1, c + 5),
1320
1321 &m(r + 2, c + 0), &m(r + 2, c + 1), &m(r + 2, c + 2), &m(r + 2, c + 3),
1322 &m(r + 2, c + 4), &m(r + 2, c + 5),
1323
1324 &m(r + 3, c + 0), &m(r + 3, c + 1), &m(r + 3, c + 2), &m(r + 3, c + 3),
1325 &m(r + 3, c + 4), &m(r + 3, c + 5),
1326
1327 &m(r + 4, c + 0), &m(r + 4, c + 1), &m(r + 4, c + 2), &m(r + 4, c + 3),
1328 &m(r + 4, c + 4), &m(r + 4, c + 5),
1329
1330 &m(r + 5, c + 0), &m(r + 5, c + 1), &m(r + 5, c + 2), &m(r + 5, c + 3),
1331 &m(r + 5, c + 4), &m(r + 5, c + 5)
1332
1333 );
1334 };
1341
1345
1346 auto v = getVolume();
1347 auto t_w = getFTensor0IntegrationWeight();
1348
1349 auto t_approx_P_adjont_dstretch =
1350 getFTensor2FromMat<3, 3>(dataAtPts->adjontPdstretchAtPts);
1351 auto t_dot_log_u =
1352 getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchDotTensorAtPts);
1353 auto t_u = getFTensor2SymmetricFromMat<3>(dataAtPts->stretchTensorAtPts);
1354 auto t_diff_u =
1355 getFTensor4DdgFromMat<3, 3, 1>(dataAtPts->diffStretchTensorAtPts);
1356 auto t_eigen_vals = getFTensor1FromMat<3>(dataAtPts->eigenVals);
1357 auto t_eigen_vecs = getFTensor2FromMat<3, 3>(dataAtPts->eigenVecs);
1358 auto &nbUniq = dataAtPts->nbUniq;
1359
1360 int row_nb_base_functions = row_data.getN().size2();
1361 auto t_row_base_fun = row_data.getFTensor0N();
1362
1363 auto t_D = getFTensor4DdgFromMat<3, 3, 0>(dataAtPts->matD);
1364
1365 const double ts_a = getTSa();
1366 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1367 double a = v * t_w;
1368
1370
1372 // Work of symmetric tensor on undefined tensor is equal to the work of
1373 // the symmetric part of it
1375 t_sym(i, j) = (t_approx_P_adjont_dstretch(i, j) ||
1376 t_approx_P_adjont_dstretch(j, i));
1377 t_sym(i, j) /= 2.0;
1378 auto t_diff2_uP2 = EigenMatrix::getDiffDiffMat(
1379 t_eigen_vals, t_eigen_vecs, EshelbianCore::f, EshelbianCore::d_f,
1380 EshelbianCore::dd_f, t_sym, nbUniq[gg]);
1381 t_dP(L, J) =
1382 t_L(i, j, L) *
1383 ((t_diff2_uP2(i, j, k, l) + t_diff2_uP2(k, l, i, j)) * t_L(k, l, J)) /
1384 2.;
1385 } else {
1386 t_dP(L, J) = 0;
1387 }
1388
1389 t_dP(L, J) -= (1 + alphaU * ts_a) *
1390 (t_L(i, j, L) *
1391 ((t_D(i, j, m, n) * t_diff(m, n, k, l)) * t_L(k, l, J)));
1392
1393 int rr = 0;
1394 for (; rr != row_nb_dofs / 6; ++rr) {
1395 auto t_col_base_fun = col_data.getFTensor0N(gg, 0);
1396 auto t_m = get_ftensor2(K, 6 * rr, 0);
1397 for (int cc = 0; cc != col_nb_dofs / 6; ++cc) {
1398 const double b = a * t_row_base_fun * t_col_base_fun;
1399 t_m(L, J) += b * t_dP(L, J);
1400 ++t_m;
1401 ++t_col_base_fun;
1402 }
1403 ++t_row_base_fun;
1404 }
1405
1406 for (; rr != row_nb_base_functions; ++rr) {
1407 ++t_row_base_fun;
1408 }
1409
1410 ++t_w;
1411 ++t_approx_P_adjont_dstretch;
1412 ++t_dot_log_u;
1413 ++t_u;
1414 ++t_diff_u;
1415 ++t_eigen_vals;
1416 ++t_eigen_vecs;
1417 }
1419}
static Index< 'J', 3 > J
static Number< 2 > N2
static Number< 1 > N1
static Number< 0 > N0
constexpr double a
FTensor::Index< 'n', SPACE_DIM > n
FTensor::Index< 'm', SPACE_DIM > m
FTensor::Index< 'i', SPACE_DIM > i
const double c
speed of light (cm/ns)
const double v
phase velocity of light in medium (cm/ns)
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
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)
static constexpr auto size_symm
int r
Definition: sdf.py:8
static boost::function< double(const double)> dd_f
static enum StretchSelector stretchSelector
static boost::function< double(const double)> d_f
static boost::function< double(const double)> f
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.

◆ integratePiola()

MoFEMErrorCode EshelbianPlasticity::OpSpatialPhysical_du_du::integratePiola ( EntData row_data,
EntData col_data 
)
Examples
EshelbianOperators.cpp.

Definition at line 1421 of file EshelbianOperators.cpp.

1422 {
1424
1427 auto t_L = symm_L_tensor();
1428 auto t_diff = diff_tensor();
1429
1430 int nb_integration_pts = row_data.getN().size1();
1431 int row_nb_dofs = row_data.getIndices().size();
1432 int col_nb_dofs = col_data.getIndices().size();
1433
1434 auto get_ftensor2 = [](MatrixDouble &m, const int r, const int c) {
1436 size_symm>(
1437
1438 &m(r + 0, c + 0), &m(r + 0, c + 1), &m(r + 0, c + 2), &m(r + 0, c + 3),
1439 &m(r + 0, c + 4), &m(r + 0, c + 5),
1440
1441 &m(r + 1, c + 0), &m(r + 1, c + 1), &m(r + 1, c + 2), &m(r + 1, c + 3),
1442 &m(r + 1, c + 4), &m(r + 1, c + 5),
1443
1444 &m(r + 2, c + 0), &m(r + 2, c + 1), &m(r + 2, c + 2), &m(r + 2, c + 3),
1445 &m(r + 2, c + 4), &m(r + 2, c + 5),
1446
1447 &m(r + 3, c + 0), &m(r + 3, c + 1), &m(r + 3, c + 2), &m(r + 3, c + 3),
1448 &m(r + 3, c + 4), &m(r + 3, c + 5),
1449
1450 &m(r + 4, c + 0), &m(r + 4, c + 1), &m(r + 4, c + 2), &m(r + 4, c + 3),
1451 &m(r + 4, c + 4), &m(r + 4, c + 5),
1452
1453 &m(r + 5, c + 0), &m(r + 5, c + 1), &m(r + 5, c + 2), &m(r + 5, c + 3),
1454 &m(r + 5, c + 4), &m(r + 5, c + 5)
1455
1456 );
1457 };
1464
1465 auto v = getVolume();
1466 auto t_w = getFTensor0IntegrationWeight();
1467 auto r_P_du = getFTensor4FromMat<3, 3, 3, 3>(dataAtPts->P_du);
1468
1469 auto t_approx_P_adjont_dstretch =
1470 getFTensor2FromMat<3, 3>(dataAtPts->adjontPdstretchAtPts);
1471 auto t_P = getFTensor2FromMat<3, 3>(dataAtPts->PAtPts);
1472 auto t_dot_log_u =
1473 getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchDotTensorAtPts);
1474 auto t_u = getFTensor2SymmetricFromMat<3>(dataAtPts->stretchTensorAtPts);
1475 auto t_diff_u =
1476 getFTensor4DdgFromMat<3, 3, 1>(dataAtPts->diffStretchTensorAtPts);
1477 auto t_eigen_vals = getFTensor1FromMat<3>(dataAtPts->eigenVals);
1478 auto t_eigen_vecs = getFTensor2FromMat<3, 3>(dataAtPts->eigenVecs);
1479 auto &nbUniq = dataAtPts->nbUniq;
1480
1481 int row_nb_base_functions = row_data.getN().size2();
1482 auto t_row_base_fun = row_data.getFTensor0N();
1483
1484 const double ts_a = getTSa();
1485 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1486 double a = v * t_w;
1487
1489 t_deltaP(i, j) = t_approx_P_adjont_dstretch(i, j) - t_P(i, j);
1490
1491 // Work of symmetric tensor on undefined tensor is equal to the work of the
1492 // symmetric part of it
1494
1497 t_deltaP_sym(i, j) = (t_deltaP(i, j) || t_deltaP(j, i));
1498 t_deltaP_sym(i, j) /= 2.0;
1499 auto t_diff2_uP2 = EigenMatrix::getDiffDiffMat(
1500 t_eigen_vals, t_eigen_vecs, EshelbianCore::f, EshelbianCore::d_f,
1501 EshelbianCore::dd_f, t_deltaP_sym, nbUniq[gg]);
1502 t_dP(L, J) = t_L(i, j, L) * (t_diff2_uP2(i, j, k, l) * t_L(k, l, J));
1503 } else {
1504 t_dP(L, J) = 0;
1505 }
1506
1508 t_Ldiff_u(i, j, L) = t_diff_u(i, j, m, n) * t_L(m, n, L);
1509 t_dP(L, J) -=
1510 t_Ldiff_u(i, j, L) * (r_P_du(i, j, k, l) * t_Ldiff_u(k, l, J));
1511 // viscous stress derivative
1512 t_dP(L, J) -=
1513 (alphaU * ts_a) * (t_L(i, j, L) * (t_diff(i, j, k, l) * t_L(k, l, J)));
1514
1515 int rr = 0;
1516 for (; rr != row_nb_dofs / 6; ++rr) {
1517 auto t_col_base_fun = col_data.getFTensor0N(gg, 0);
1518 auto t_m = get_ftensor2(K, 6 * rr, 0);
1519 for (int cc = 0; cc != col_nb_dofs / 6; ++cc) {
1520 const double b = a * t_row_base_fun * t_col_base_fun;
1521 t_m(L, J) += b * t_dP(L, J);
1522 ++t_m;
1523 ++t_col_base_fun;
1524 }
1525 ++t_row_base_fun;
1526 }
1527
1528 for (; rr != row_nb_base_functions; ++rr) {
1529 ++t_row_base_fun;
1530 }
1531
1532 ++t_w;
1533 ++r_P_du;
1534 ++t_P;
1535 ++t_approx_P_adjont_dstretch;
1536 ++t_dot_log_u;
1537 ++t_u;
1538 ++t_diff_u;
1539 ++t_eigen_vals;
1540 ++t_eigen_vecs;
1541 }
1543}

Member Data Documentation

◆ alphaU

const double EshelbianPlasticity::OpSpatialPhysical_du_du::alphaU
Examples
EshelbianOperators.cpp.

Definition at line 638 of file EshelbianPlasticity.hpp.


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