v0.14.0
Public Member Functions | List of all members
EshelbianPlasticity::OpHMHH Struct Reference
Inheritance diagram for EshelbianPlasticity::OpHMHH:
[legend]
Collaboration diagram for EshelbianPlasticity::OpHMHH:
[legend]

Public Member Functions

 OpHMHH (const int tag, const bool eval_rhs, const bool eval_lhs, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
 
MoFEMErrorCode evaluateRhs (EntData &data)
 
MoFEMErrorCode evaluateLhs (EntData &data)
 
- Public Member Functions inherited from EshelbianPlasticity::OpJacobian
 OpJacobian (const int tag, const bool eval_rhs, const bool eval_lhs, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Additional Inherited Members

- Protected Member Functions inherited from EshelbianPlasticity::OpJacobian
 OpJacobian ()
 
- Protected Attributes inherited from EshelbianPlasticity::OpJacobian
int tAg = -1
 adol-c tape More...
 
bool evalRhs = false
 
bool evalLhs = false
 
boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 data at integration pts More...
 
boost::shared_ptr< PhysicalEquationsphysicsPtr
 material physical equations More...
 

Detailed Description

Definition at line 277 of file EshelbianADOL-C.cpp.

Constructor & Destructor Documentation

◆ OpHMHH()

EshelbianPlasticity::OpHMHH::OpHMHH ( const int  tag,
const bool  eval_rhs,
const bool  eval_lhs,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
boost::shared_ptr< PhysicalEquations physics_ptr 
)
inline

Definition at line 278 of file EshelbianADOL-C.cpp.

281  : OpJacobian(tag, eval_rhs, eval_lhs, data_ptr, physics_ptr) {}

Member Function Documentation

◆ evaluateLhs()

MoFEMErrorCode EshelbianPlasticity::OpHMHH::evaluateLhs ( EntData data)
virtual

Implements EshelbianPlasticity::OpJacobian.

Definition at line 361 of file EshelbianADOL-C.cpp.

361  {
371 
372  const int number_of_active_variables = physicsPtr->activeVariables.size();
373  const int number_of_dependent_variables =
374  physicsPtr->dependentVariablesPiola.size();
375  std::vector<double *> jac_ptr(number_of_dependent_variables);
376  for (unsigned int n = 0; n != number_of_dependent_variables; ++n) {
377  jac_ptr[n] =
378  &(physicsPtr
379  ->dependentVariablesPiolaDirevatives[n *
380  number_of_active_variables]);
381  }
382 
383  const auto nb_integration_pts = getGaussPts().size2();
384 
385  auto create_data_mat = [nb_integration_pts](auto &m) {
386  m.resize(9, nb_integration_pts, false);
387  };
388 
389  dataAtPts->P_du.resize(81, nb_integration_pts, false);
390 
391  auto iu = getFTensor2SymmetricFromMat<3>(dataAtPts->stretchTensorAtPts);
392  auto t_grad_h1 = getFTensor2FromMat<3, 3>(dataAtPts->wGradH1AtPts);
393  auto r_P_du = getFTensor4FromMat<3, 3, 3, 3>(dataAtPts->P_du);
394 
398 
399  constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
400 
401  for (unsigned int gg = 0; gg != nb_integration_pts; ++gg) {
402 
404 
406  case NO_H1_CONFIGURATION:
407  t_h1(i, j) = t_kd(i, j);
408  physicsPtr->get_h()(i, j) = iu(i, k) * t_h1(k, j);
409  break;
410  case LARGE_ROT:
411  case MODERATE_ROT:
412  t_h1(i, j) = t_grad_h1(i, j) + t_kd(i, j);
413  physicsPtr->get_h()(i, j) = iu(i, k) * t_h1(k, j);
414  break;
415  case SMALL_ROT:
416  physicsPtr->get_h()(i, j) = iu(i, j);
417  break;
418  };
419 
420  // play recorder for jacobians
421  int r = ::jacobian(tAg, number_of_dependent_variables,
422  number_of_active_variables,
423  &physicsPtr->activeVariables[0], &jac_ptr[0]);
424  if (r < 0) {
425  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
426  "ADOL-C function evaluation with error");
427  }
428 
430  t_P_dh_tmp(i, j, N0, k) = physicsPtr->get_P_dh0()(i, j, k);
431  t_P_dh_tmp(i, j, N1, k) = physicsPtr->get_P_dh1()(i, j, k);
432  t_P_dh_tmp(i, j, N2, k) = physicsPtr->get_P_dh2()(i, j, k);
433 
435  case NO_H1_CONFIGURATION:
436  case LARGE_ROT:
437  case MODERATE_ROT: {
439  t_h1_du(i, j, m, n) = t_kd(i, m) * (t_kd(k, n) * t_h1(k, j));
440  r_P_du(k, l, m, n) =
441  (t_P_dh_tmp(i, j, o, p) * t_h1_du(o, p, m, n)) * t_h1_du(i, j, k, l);
442  } break;
443  case SMALL_ROT:
444  r_P_du(i, j, m, n) = t_P_dh_tmp(i, j, m, n);
445  break;
446  };
447 
448  ++iu;
449  ++t_grad_h1;
450  ++r_P_du;
451  }
453 }

◆ evaluateRhs()

MoFEMErrorCode EshelbianPlasticity::OpHMHH::evaluateRhs ( EntData data)
virtual

Implements EshelbianPlasticity::OpJacobian.

Definition at line 287 of file EshelbianADOL-C.cpp.

287  {
295 
296  const auto nb_integration_pts = getGaussPts().size2();
297  auto iu = getFTensor2SymmetricFromMat<3>(dataAtPts->stretchTensorAtPts);
298  auto t_grad_h1 = getFTensor2FromMat<3, 3>(dataAtPts->wGradH1AtPts);
299 
300  auto create_data_vec = [nb_integration_pts](auto &v) {
301  v.resize(nb_integration_pts, false);
302  };
303  auto create_data_mat = [nb_integration_pts](auto &m) {
304  m.resize(9, nb_integration_pts, false);
305  };
306 
307  create_data_mat(dataAtPts->PAtPts);
308 
309  constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
310  auto r_P = getFTensor2FromMat<3, 3>(dataAtPts->PAtPts);
311  for (unsigned int gg = 0; gg != nb_integration_pts; ++gg) {
312 
314 
316  case NO_H1_CONFIGURATION:
317  t_h1(i, j) = t_kd(i, j);
318  physicsPtr->get_h()(i, j) = iu(i, j);
319  break;
320  case LARGE_ROT:
321  case MODERATE_ROT:
322  t_h1(i, j) = t_grad_h1(i, j) + t_kd(i, j);
323  physicsPtr->get_h()(i, j) = iu(i, k) * t_h1(k, j);
324  break;
325  case SMALL_ROT:
326  physicsPtr->get_h()(i, j) = iu(i, j);
327  break;
328  };
329 
330  int r = ::function(tAg, physicsPtr->dependentVariablesPiola.size(),
331  physicsPtr->activeVariables.size(),
332  &physicsPtr->activeVariables[0],
333  &physicsPtr->dependentVariablesPiola[0]);
334  if (r < 0) { // function is locally analytic
335  SETERRQ1(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
336  "ADOL-C function evaluation with error r = %d", r);
337  }
338 
340  case NO_H1_CONFIGURATION:
341  r_P(i, j) = physicsPtr->get_P()(i, j);
342  break;
343  case LARGE_ROT:
344  case MODERATE_ROT: {
346  t_h1_du(i, j, m, n) = t_kd(i, m) * (t_kd(k, n) * t_h1(k, j));
347  r_P(k, l) = physicsPtr->get_P()(i, j) * t_h1_du(i, j, k, l);
348  }; break;
349  case SMALL_ROT:
350  r_P(i, j) = physicsPtr->get_P()(i, j);
351  break;
352  };
353 
354  ++iu;
355  ++t_grad_h1;
356  ++r_P;
357  }
359 }

The documentation for this struct was generated from the following file:
FTensor::Kronecker_Delta
Kronecker Delta class.
Definition: Kronecker_Delta.hpp:15
EshelbianPlasticity::OpJacobian::physicsPtr
boost::shared_ptr< PhysicalEquations > physicsPtr
material physical equations
Definition: EshelbianPlasticity.hpp:403
EshelbianPlasticity::NO_H1_CONFIGURATION
@ NO_H1_CONFIGURATION
Definition: EshelbianPlasticity.hpp:43
sdf.r
int r
Definition: sdf.py:8
FTensor::Tensor2< double, 3, 3 >
EshelbianPlasticity::OpJacobian::tAg
int tAg
adol-c tape
Definition: EshelbianPlasticity.hpp:396
FTensor::Number< 0 >
EshelbianPlasticity::EshelbianCore::gradApproximator
static enum RotSelector gradApproximator
Definition: EshelbianPlasticity.hpp:897
MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_OPERATION_UNSUCCESSFUL
Definition: definitions.h:34
FTensor::Tensor4
Definition: Tensor4_value.hpp:18
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
t_kd
constexpr auto t_kd
Definition: free_surface.cpp:137
FTensor::Index< 'i', 3 >
convert.n
n
Definition: convert.py:82
v
const double v
phase velocity of light in medium (cm/ns)
Definition: initial_diffusion.cpp:40
EshelbianPlasticity::SMALL_ROT
@ SMALL_ROT
Definition: EshelbianPlasticity.hpp:43
EshelbianPlasticity::OpJacobian::OpJacobian
OpJacobian()
Definition: EshelbianPlasticity.hpp:394
EshelbianPlasticity::LARGE_ROT
@ LARGE_ROT
Definition: EshelbianPlasticity.hpp:43
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
EshelbianPlasticity::OpJacobian::dataAtPts
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
Definition: EshelbianPlasticity.hpp:401
EshelbianPlasticity::MODERATE_ROT
@ MODERATE_ROT
Definition: EshelbianPlasticity.hpp:43
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:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21