v0.14.0
Public Member Functions | Private Attributes | List of all members
EshelbianPlasticity::OpSpatialPhysical_du_du Struct Reference
Inheritance diagram for EshelbianPlasticity::OpSpatialPhysical_du_du:
[legend]
Collaboration diagram for EshelbianPlasticity::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)
 
MoFEMErrorCode integratePiola (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
 
MatrixDouble dP
 

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 105 of file EshelbianADOL-C.cpp.

Constructor & Destructor Documentation

◆ OpSpatialPhysical_du_du()

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

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

109  : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false),
110  alphaU(alpha) {
111  sYmm = false;
112  }

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 122 of file EshelbianADOL-C.cpp.

123  {
124  return integratePiola(row_data, col_data);
125 }

◆ integratePiola()

MoFEMErrorCode EshelbianPlasticity::OpSpatialPhysical_du_du::integratePiola ( EntData row_data,
EntData col_data 
)

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

128  {
130 
133  auto t_L = symm_L_tensor();
134  auto t_diff = diff_tensor();
135 
136  int nb_integration_pts = row_data.getN().size1();
137  int row_nb_dofs = row_data.getIndices().size();
138  int col_nb_dofs = col_data.getIndices().size();
139 
140  auto get_ftensor2 = [](MatrixDouble &m, const int r, const int c) {
142  size_symm>(
143 
144  &m(r + 0, c + 0), &m(r + 0, c + 1), &m(r + 0, c + 2), &m(r + 0, c + 3),
145  &m(r + 0, c + 4), &m(r + 0, c + 5),
146 
147  &m(r + 1, c + 0), &m(r + 1, c + 1), &m(r + 1, c + 2), &m(r + 1, c + 3),
148  &m(r + 1, c + 4), &m(r + 1, c + 5),
149 
150  &m(r + 2, c + 0), &m(r + 2, c + 1), &m(r + 2, c + 2), &m(r + 2, c + 3),
151  &m(r + 2, c + 4), &m(r + 2, c + 5),
152 
153  &m(r + 3, c + 0), &m(r + 3, c + 1), &m(r + 3, c + 2), &m(r + 3, c + 3),
154  &m(r + 3, c + 4), &m(r + 3, c + 5),
155 
156  &m(r + 4, c + 0), &m(r + 4, c + 1), &m(r + 4, c + 2), &m(r + 4, c + 3),
157  &m(r + 4, c + 4), &m(r + 4, c + 5),
158 
159  &m(r + 5, c + 0), &m(r + 5, c + 1), &m(r + 5, c + 2), &m(r + 5, c + 3),
160  &m(r + 5, c + 4), &m(r + 5, c + 5)
161 
162  );
163  };
170 
171  auto v = getVolume();
172  auto t_w = getFTensor0IntegrationWeight();
173 
174  auto get_dP = [&]() {
175  dP.resize(size_symm * size_symm, nb_integration_pts, false);
176  auto ts_a = getTSa();
177 
178  auto t_P = getFTensor2FromMat<3, 3>(dataAtPts->PAtPts);
179  auto r_P_du = getFTensor4FromMat<3, 3, 3, 3>(dataAtPts->P_du);
180  auto t_approx_P_adjont_dstretch =
181  getFTensor2FromMat<3, 3>(dataAtPts->adjointPdstretchAtPts);
182  auto t_dot_log_u =
183  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchDotTensorAtPts);
184  auto t_u = getFTensor2SymmetricFromMat<3>(dataAtPts->stretchTensorAtPts);
185  auto t_diff_u =
186  getFTensor4DdgFromMat<3, 3, 1>(dataAtPts->diffStretchTensorAtPts);
187  auto t_eigen_vals = getFTensor1FromMat<3>(dataAtPts->eigenVals);
188  auto t_eigen_vecs = getFTensor2FromMat<3, 3>(dataAtPts->eigenVecs);
189  auto &nbUniq = dataAtPts->nbUniq;
190 
191  auto t_dP = getFTensor2FromMat<size_symm, size_symm>(dP);
192  for (auto gg = 0; gg != nb_integration_pts; ++gg) {
193 
195  t_deltaP(i, j) = t_approx_P_adjont_dstretch(i, j) - t_P(i, j);
196 
198  t_Ldiff_u(i, j, L) = t_diff_u(i, j, m, n) * t_L(m, n, L);
199  t_dP(L, J) =
200  -t_Ldiff_u(i, j, L) * (r_P_du(i, j, k, l) * t_Ldiff_u(k, l, J));
201  // viscous stress derivative
202  t_dP(L, J) -= (alphaU * ts_a) *
203  (t_L(i, j, L) * (t_diff(i, j, k, l) * t_L(k, l, J)));
204 
207  t_deltaP_sym(i, j) = (t_deltaP(i, j) || t_deltaP(j, i));
208  t_deltaP_sym(i, j) /= 2.0;
209  auto t_diff2_uP2 = EigenMatrix::getDiffDiffMat(
210  t_eigen_vals, t_eigen_vecs, EshelbianCore::f, EshelbianCore::d_f,
211  EshelbianCore::dd_f, t_deltaP_sym, nbUniq[gg]);
212  t_dP(L, J) += t_L(i, j, L) * (t_diff2_uP2(i, j, k, l) * t_L(k, l, J));
213  }
214 
215  ++t_P;
216  ++t_dP;
217  ++r_P_du;
218  ++t_approx_P_adjont_dstretch;
219  ++t_dot_log_u;
220  ++t_u;
221  ++t_diff_u;
222  ++t_eigen_vals;
223  ++t_eigen_vecs;
224  }
225 
226  return getFTensor2FromMat<size_symm, size_symm>(dP);
227  };
228 
229  int row_nb_base_functions = row_data.getN().size2();
230  auto t_row_base_fun = row_data.getFTensor0N();
231 
232  auto t_dP = get_dP();
233  for (int gg = 0; gg != nb_integration_pts; ++gg) {
234  double a = v * t_w;
235 
236  int rr = 0;
237  for (; rr != row_nb_dofs / 6; ++rr) {
238  auto t_col_base_fun = col_data.getFTensor0N(gg, 0);
239  auto t_m = get_ftensor2(K, 6 * rr, 0);
240  for (int cc = 0; cc != col_nb_dofs / 6; ++cc) {
241  const double b = a * t_row_base_fun * t_col_base_fun;
242  t_m(L, J) += b * t_dP(L, J);
243  ++t_m;
244  ++t_col_base_fun;
245  }
246  ++t_row_base_fun;
247  }
248 
249  for (; rr != row_nb_base_functions; ++rr) {
250  ++t_row_base_fun;
251  }
252 
253  ++t_w;
254  ++t_dP;
255  }
257 }

Member Data Documentation

◆ alphaU

const double EshelbianPlasticity::OpSpatialPhysical_du_du::alphaU
private

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

◆ dP

MatrixDouble EshelbianPlasticity::OpSpatialPhysical_du_du::dP
private

Definition at line 118 of file EshelbianADOL-C.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
EshelbianPlasticity::OpSpatialPhysical_du_du::dP
MatrixDouble dP
Definition: EshelbianADOL-C.cpp:118
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
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
sdf.r
int r
Definition: sdf.py:8
FTensor::Tensor2
Definition: Tensor2_value.hpp:16
EshelbianPlasticity::OpSpatialPhysical_du_du::alphaU
const double alphaU
Definition: EshelbianADOL-C.cpp:117
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
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::symm_L_tensor
auto symm_L_tensor()
Definition: EshelbianAux.hpp:52
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
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
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
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
EshelbianPlasticity::OpSpatialPhysical_du_du::integratePiola
MoFEMErrorCode integratePiola(EntData &row_data, EntData &col_data)
Definition: EshelbianADOL-C.cpp:127
EshelbianPlasticity::OpAssembleVolume::OpAssembleVolume
OpAssembleVolume(const std::string &field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type)
Definition: EshelbianPlasticity.hpp:518
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