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

Public Member Functions

 OpSpatialPhysical (const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha_u)
 
MoFEMErrorCode integrate (EntData &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 (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)
 

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 57 of file HMHNeohookean.cpp.

Constructor & Destructor Documentation

◆ OpSpatialPhysical()

EshelbianPlasticity::HMHNeohookean::OpSpatialPhysical::OpSpatialPhysical ( const std::string &  field_name,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
const double  alpha_u 
)

Definition at line 94 of file HMHNeohookean.cpp.

97  : OpAssembleVolume(field_name, data_ptr, OPROW), alphaU(alpha_u) {}

Member Function Documentation

◆ integrate()

MoFEMErrorCode EshelbianPlasticity::HMHNeohookean::OpSpatialPhysical::integrate ( EntData data)
virtual

Reimplemented from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >.

Definition at line 99 of file HMHNeohookean.cpp.

99  {
101 
102  auto neohookean_ptr =
103  boost::dynamic_pointer_cast<HMHNeohookean>(dataAtPts->physicsPtr);
104  if (!neohookean_ptr) {
105  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
106  "Pointer to HMHNeohookean is null");
107  }
108 
109 #ifdef NDEBUG
111  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
112  "Stretch selector is not equal to LOG");
113  } else {
114  if (EshelbianCore::exponentBase != exp(1)) {
115  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
116  "Exponent base is not equal to exp(1)");
117  }
118  }
119 #endif // NDEBUG
120 
121  const auto c10 = neohookean_ptr->c10;
122  const auto K = neohookean_ptr->K;
123 
125  auto t_L = symm_L_tensor();
126 
127  constexpr auto t_kd_sym = FTensor::Kronecker_Delta_symmetric<int>();
128  constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
129 
130  int nb_dofs = data.getIndices().size();
131  int nb_integration_pts = data.getN().size1();
132  auto v = getVolume();
133  auto t_w = getFTensor0IntegrationWeight();
134  auto t_approx_P_adjont_log_du =
135  getFTensor1FromMat<size_symm>(dataAtPts->adjointPdUAtPts);
136  auto t_u = getFTensor2SymmetricFromMat<3>(dataAtPts->stretchTensorAtPts);
137  auto t_grad_h1 = getFTensor2FromMat<3, 3>(dataAtPts->wGradH1AtPts);
138  auto t_total_log_u =
139  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTotalTensorAtPts);
140  auto t_dot_log_u =
141  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchDotTensorAtPts);
142  auto t_diff_u =
143  getFTensor4DdgFromMat<3, 3, 1>(dataAtPts->diffStretchTensorAtPts);
144  auto t_log_u =
145  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTensorAtPts);
146  auto t_log_u2_h1 =
147  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretch2H1AtPts);
148 
149  auto t_diff = diff_tensor();
150 
157 
158  auto get_ftensor2 = [](auto &v) {
160  &v[0], &v[1], &v[2], &v[3], &v[4], &v[5]);
161  };
162 
163  int nb_base_functions = data.getN().size2();
164  auto t_row_base_fun = data.getFTensor0N();
165  for (int gg = 0; gg != nb_integration_pts; ++gg) {
166  double a = v * t_w;
167  ++t_w;
168 
171 
173  case NO_H1_CONFIGURATION:
174  t_h1(i, j) = t_kd(i, j);
175  // t_h1_du(i, j, m, n) = t_kd(i, m) * t_kd(j, n);
176  t_Ldiff_u(i, j, L) = t_diff_u(i, j, k, l) * t_L(k, l, L);
177  break;
178  case LARGE_ROT:
179  case MODERATE_ROT:
180  t_h1(i, j) = t_grad_h1(i, j) + t_kd(i, j);
181  // t_h1_du(i, j, m, n) = t_kd(i, m) * (t_kd(k, n) * t_h1(k, j));
182  t_Ldiff_u(i, j, L) = (t_diff_u(i, m, k, l) * t_h1(m, j)) * t_L(k, l, L);
183  break;
184  case SMALL_ROT:
185  t_h1(i, j) = t_kd(i, j);
186  // t_h1_du(i, j, m, n) = t_kd(i, m) * t_kd(j, n);
187  t_Ldiff_u(i, j, L) = t_diff_u(i, j, k, l) * t_L(k, l, L);
188  break;
189  };
190  ++t_diff_u;
191  ++t_grad_h1;
192 
194  t_Sigma_u(i, j) = 2.0 * c10 * (t_u(i, m) * t_h1(m, j));
195  const double tr = t_total_log_u(i, j) * t_kd_sym(i, j);
196  const double J = EshelbianCore::f(tr);
197  const double Simga_J = -2 * c10 + K * (J - 1) * J;
198 
200  t_viscous_P(i, j) =
201  alphaU *
202  t_dot_log_u(i,
203  j); // That is cheat, should be split on axial and deviator
204 
206  t_residual(L) = t_approx_P_adjont_log_du(L);
207  t_residual(L) -= t_Ldiff_u(i, j, L) * t_Sigma_u(i, j);
208  t_residual(L) -= (t_L(i, j, L) * t_kd(i, j)) * Simga_J;
209  t_residual(L) -= t_L(i, j, L) * t_viscous_P(i, j);
210  t_residual(L) *= a;
211 
212  ++t_approx_P_adjont_log_du;
213  ++t_u;
214  ++t_total_log_u;
215  ++t_dot_log_u;
216 
217  auto t_nf = getFTensor1FromPtr<size_symm>(&*nF.data().begin());
218  int bb = 0;
219  for (; bb != nb_dofs / size_symm; ++bb) {
220  t_nf(L) += t_row_base_fun * t_residual(L);
221  ++t_nf;
222  ++t_row_base_fun;
223  }
224  for (; bb != nb_base_functions; ++bb)
225  ++t_row_base_fun;
226  }
228 }

Member Data Documentation

◆ alphaU

const double EshelbianPlasticity::HMHNeohookean::OpSpatialPhysical::alphaU
private

Definition at line 66 of file HMHNeohookean.cpp.


The documentation for this struct was generated from the following file:
EshelbianPlasticity::size_symm
constexpr static auto size_symm
Definition: EshelbianAux.hpp:39
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
EshelbianPlasticity::EshelbianCore::exponentBase
static double exponentBase
Definition: EshelbianPlasticity.hpp:902
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
EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >::nF
VectorDouble nF
local right hand side vector
Definition: EshelbianPlasticity.hpp:426
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:13
FTENSOR_INDEX
#define FTENSOR_INDEX(DIM, I)
Definition: Templates.hpp:2011
EshelbianPlasticity::NO_H1_CONFIGURATION
@ NO_H1_CONFIGURATION
Definition: EshelbianPlasticity.hpp:43
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
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
EshelbianPlasticity::HMHNeohookean::OpSpatialPhysical::alphaU
const double alphaU
Definition: HMHNeohookean.cpp:66
t_kd
constexpr auto t_kd
Definition: free_surface.cpp:137
EshelbianPlasticity::symm_L_tensor
auto symm_L_tensor()
Definition: EshelbianAux.hpp:52
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
FTensor::Index
Definition: Index.hpp:23
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
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