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

Public Member Functions

 OpSpatialPhysical_du_du (std::string row_field, 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 (std::string row_field, 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 (std::string row_field, 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 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)
 

Private Attributes

const double alphaU
 

Additional Inherited Members

- Public Types inherited from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >
using ScaleOff = boost::function< double()>
 
- 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
 

Detailed Description

Definition at line 76 of file HMHNeohookean.cpp.

Constructor & Destructor Documentation

◆ OpSpatialPhysical_du_du()

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

Definition at line 230 of file HMHNeohookean.cpp.

233  : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false),
234  alphaU(alpha) {
235  sYmm = false;
236 }

Member Function Documentation

◆ integrate()

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

Reimplemented from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >.

Definition at line 239 of file HMHNeohookean.cpp.

240  {
242 
243  auto neohookean_ptr =
244  boost::dynamic_pointer_cast<HMHNeohookean>(dataAtPts->physicsPtr);
245  if (!neohookean_ptr) {
246  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
247  "Pointer to HMHNeohookean is null");
248  }
249 
250 #ifdef NDEBUG
252  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
253  "Stretch selector is not equal to LOG");
254  } else {
255  if (EshelbianCore::exponentBase != exp(1)) {
256  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
257  "Exponent base is not equal to exp(1)");
258  }
259  }
260 #endif // NDEBUG
261 
262  const auto c10 = neohookean_ptr->c10;
263  const auto lambda = neohookean_ptr->K;
264 
267 
268  constexpr auto t_kd_sym = FTensor::Kronecker_Delta_symmetric<int>();
269  constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
270 
271  auto t_L = symm_L_tensor();
272  auto t_diff = diff_tensor();
273 
274  int nb_integration_pts = row_data.getN().size1();
275  int row_nb_dofs = row_data.getIndices().size();
276  int col_nb_dofs = col_data.getIndices().size();
277 
278  auto get_ftensor2 = [](MatrixDouble &m, const int r, const int c) {
280  size_symm>(
281 
282  &m(r + 0, c + 0), &m(r + 0, c + 1), &m(r + 0, c + 2), &m(r + 0, c + 3),
283  &m(r + 0, c + 4), &m(r + 0, c + 5),
284 
285  &m(r + 1, c + 0), &m(r + 1, c + 1), &m(r + 1, c + 2), &m(r + 1, c + 3),
286  &m(r + 1, c + 4), &m(r + 1, c + 5),
287 
288  &m(r + 2, c + 0), &m(r + 2, c + 1), &m(r + 2, c + 2), &m(r + 2, c + 3),
289  &m(r + 2, c + 4), &m(r + 2, c + 5),
290 
291  &m(r + 3, c + 0), &m(r + 3, c + 1), &m(r + 3, c + 2), &m(r + 3, c + 3),
292  &m(r + 3, c + 4), &m(r + 3, c + 5),
293 
294  &m(r + 4, c + 0), &m(r + 4, c + 1), &m(r + 4, c + 2), &m(r + 4, c + 3),
295  &m(r + 4, c + 4), &m(r + 4, c + 5),
296 
297  &m(r + 5, c + 0), &m(r + 5, c + 1), &m(r + 5, c + 2), &m(r + 5, c + 3),
298  &m(r + 5, c + 4), &m(r + 5, c + 5)
299 
300  );
301  };
302 
309 
310  auto v = getVolume();
311  auto ts_a = getTSa();
312  auto t_w = getFTensor0IntegrationWeight();
313 
314  int row_nb_base_functions = row_data.getN().size2();
315  auto t_row_base_fun = row_data.getFTensor0N();
316 
317  auto t_grad_h1 = getFTensor2FromMat<3, 3>(dataAtPts->wGradH1AtPts);
318  auto t_diff_u =
319  getFTensor4DdgFromMat<3, 3, 1>(dataAtPts->diffStretchTensorAtPts);
320  auto t_total_log_u =
321  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTotalTensorAtPts);
322  auto t_u = getFTensor2SymmetricFromMat<3>(dataAtPts->stretchTensorAtPts);
323  auto t_approx_P_adjont_dstretch =
324  getFTensor2FromMat<3, 3>(dataAtPts->adjointPdstretchAtPts);
325  auto t_eigen_vals = getFTensor1FromMat<3>(dataAtPts->eigenVals);
326  auto t_eigen_vecs = getFTensor2FromMat<3, 3>(dataAtPts->eigenVecs);
327  auto &nbUniq = dataAtPts->nbUniq;
328 
329  auto t_P = getFTensor2FromMat<3, 3>(dataAtPts->PAtPts);
330  auto r_P_du = getFTensor4FromMat<3, 3, 3, 3>(dataAtPts->P_du);
331 
332  for (int gg = 0; gg != nb_integration_pts; ++gg) {
333  double a = v * t_w;
334  ++t_w;
335 
338  t_h1(i, j) = t_grad_h1(i, j) + t_kd(i, j);
339 
341  case NO_H1_CONFIGURATION:
342  t_Ldiff_u(i, j, L) = t_diff_u(i, j, k, l) * t_L(k, l, L);
343  break;
344  case LARGE_ROT:
345  case MODERATE_ROT:
346  t_Ldiff_u(i, j, L) = (t_diff_u(i, m, k, l) * t_h1(m, j)) * t_L(k, l, L);
347  break;
348  case SMALL_ROT:
349  t_Ldiff_u(i, j, L) = t_diff_u(i, j, k, l) * t_L(k, l, L);
350  break;
351  };
352  ++t_diff_u;
353  ++t_grad_h1;
354 
355  const double tr = t_total_log_u(i, j) * t_kd_sym(i, j);
356  const double det_u = EshelbianCore::f(tr);
358  Simga_J_dtr(L) =
359  (+lambda * (2 * det_u * det_u - det_u)) * (t_kd(i, j) * t_L(i, j, L));
360  ++t_total_log_u;
361 
363  t_dP(L, J) = (-2.0 * c10) * (t_Ldiff_u(i, j, L) * t_Ldiff_u(i, j, J));
364  t_dP(L, J) -= (t_L(i, j, L) * t_kd(i, j)) * Simga_J_dtr(J);
365  t_dP(L, J) -=
366  (alphaU * ts_a) * (t_L(i, j, L) * (t_diff(i, j, k, l) * t_L(k, l, J)));
367 
369  t_Sigma_u(i, j) = 2.0 * c10 * (t_u(i, m) * t_h1(m, j));
370  ++t_u;
371 
373  t_deltaP(i, j) =
374  t_approx_P_adjont_dstretch(i, j) - t_h1(j, n) * t_Sigma_u(i, n);
375  ++t_approx_P_adjont_dstretch;
376 
379  t_deltaP_sym(i, j) = (t_deltaP(i, j) || t_deltaP(j, i));
380  t_deltaP_sym(i, j) /= 2.0;
381  auto t_diff2_uP2 = EigenMatrix::getDiffDiffMat(
382  t_eigen_vals, t_eigen_vecs, EshelbianCore::f, EshelbianCore::d_f,
383  EshelbianCore::dd_f, t_deltaP_sym, nbUniq[gg]);
384  t_dP(L, J) += t_L(i, j, L) * (t_diff2_uP2(i, j, k, l) * t_L(k, l, J));
385  }
386  ++t_eigen_vals;
387  ++t_eigen_vecs;
388 
389  int rr = 0;
390  for (; rr != row_nb_dofs / size_symm; ++rr) {
391  auto t_col_base_fun = col_data.getFTensor0N(gg, 0);
392  auto t_m = get_ftensor2(K, 6 * rr, 0);
393  for (int cc = 0; cc != col_nb_dofs / size_symm; ++cc) {
394  double b = a * t_row_base_fun * t_col_base_fun;
395  t_m(L, J) += b * t_dP(L, J);
396  ++t_m;
397  ++t_col_base_fun;
398  }
399  ++t_row_base_fun;
400  }
401 
402  for (; rr != row_nb_base_functions; ++rr) {
403  ++t_row_base_fun;
404  }
405 
406  ++t_P;
407  ++r_P_du;
408  }
409 
411 }

Member Data Documentation

◆ alphaU

const double EshelbianPlasticity::HMHNeohookean::OpSpatialPhysical_du_du::alphaU
private

Definition at line 83 of file HMHNeohookean.cpp.


The documentation for this struct was generated from the following file:
EshelbianPlasticity::LINEAR
@ LINEAR
Definition: EshelbianPlasticity.hpp:44
EshelbianPlasticity::size_symm
constexpr static auto size_symm
Definition: EshelbianAux.hpp:39
EshelbianPlasticity::EshelbianCore::dd_f
static boost::function< double(const double)> dd_f
Definition: EshelbianPlasticity.hpp:905
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
EshelbianPlasticity::EshelbianCore::exponentBase
static double exponentBase
Definition: EshelbianPlasticity.hpp:902
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
FTensor::Kronecker_Delta
Kronecker Delta class.
Definition: Kronecker_Delta.hpp:15
EshelbianPlasticity::diff_tensor
auto diff_tensor()
Definition: EshelbianAux.hpp:41
J
FTensor::Index< 'J', DIM1 > J
Definition: level_set.cpp:30
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:13
EshelbianPlasticity::EshelbianCore::d_f
static boost::function< double(const double)> d_f
Definition: EshelbianPlasticity.hpp:904
FTENSOR_INDEX
#define FTENSOR_INDEX(DIM, I)
Definition: Templates.hpp:2011
EshelbianPlasticity::NO_H1_CONFIGURATION
@ NO_H1_CONFIGURATION
Definition: EshelbianPlasticity.hpp:43
sdf.r
int r
Definition: sdf.py:8
FTensor::Tensor2
Definition: Tensor2_value.hpp:16
MoFEM::EntitiesFieldData::EntData::getFTensor0N
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
Definition: EntitiesFieldData.hpp:1502
c
const double c
speed of light (cm/ns)
Definition: initial_diffusion.cpp:39
FTensor::Tensor3
Definition: Tensor3_value.hpp:12
SPACE_DIM
constexpr int SPACE_DIM
Definition: child_and_parent.cpp:16
EshelbianPlasticity::EshelbianCore::gradApproximator
static enum RotSelector gradApproximator
Definition: EshelbianPlasticity.hpp:897
a
constexpr double a
Definition: approx_sphere.cpp:30
EshelbianPlasticity::EshelbianCore::stretchSelector
static enum StretchSelector stretchSelector
Definition: EshelbianPlasticity.hpp:898
EshelbianPlasticity::EshelbianCore::f
static boost::function< double(const double)> f
Definition: EshelbianPlasticity.hpp:903
MoFEM::EntitiesFieldData::EntData::getIndices
const VectorInt & getIndices() const
Get global indices of dofs on entity.
Definition: EntitiesFieldData.hpp:1214
MoFEM::L
VectorDouble L
Definition: Projection10NodeCoordsOnField.cpp:124
EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >::dataAtPts
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
Definition: EshelbianPlasticity.hpp:412
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
EshelbianPlasticity::symm_L_tensor
auto symm_L_tensor()
Definition: EshelbianAux.hpp:52
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::LARGE_ROT
@ LARGE_ROT
Definition: EshelbianPlasticity.hpp:43
EshelbianPlasticity::LOG
@ LOG
Definition: EshelbianPlasticity.hpp:44
MoFEM::EntitiesFieldData::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: EntitiesFieldData.hpp:1318
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
EshelbianPlasticity::HMHNeohookean::OpSpatialPhysical_du_du::alphaU
const double alphaU
Definition: HMHNeohookean.cpp:83
lambda
static double lambda
Definition: incompressible_elasticity.cpp:199
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)
Definition: MatrixFunction.cpp:78
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
FTensor::Kronecker_Delta_symmetric
Kronecker Delta class symmetric.
Definition: Kronecker_Delta.hpp:49
EshelbianPlasticity::OpAssembleVolume::OpAssembleVolume
OpAssembleVolume(const std::string &field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type)
Definition: EshelbianPlasticity.hpp:518
EshelbianPlasticity::HMHNeohookean::c10
double c10
Definition: HMHNeohookean.cpp:48
EshelbianPlasticity::MODERATE_ROT
@ MODERATE_ROT
Definition: EshelbianPlasticity.hpp:43
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >::K
MatrixDouble K
local tangent matrix
Definition: EshelbianPlasticity.hpp:427
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