v0.13.2
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
OpPlasticTools::OpCalculatePlasticInternalForceLhs_dEP< LOGSTRAIN > Struct Template Reference

#include <users_modules/multifield_plasticity/src/PlasticOperators.hpp>

Inheritance diagram for OpPlasticTools::OpCalculatePlasticInternalForceLhs_dEP< LOGSTRAIN >:
[legend]
Collaboration diagram for OpPlasticTools::OpCalculatePlasticInternalForceLhs_dEP< LOGSTRAIN >:
[legend]

Public Member Functions

 OpCalculatePlasticInternalForceLhs_dEP (const std::string row_field_name, const std::string col_field_name, boost::shared_ptr< CommonData > common_data_ptr, boost::shared_ptr< MatrixDouble > mat_D_ptr)
 
MoFEMErrorCode iNtegrate (EntData &row_data, EntData &col_data)
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 
boost::shared_ptr< MatrixDouble > matDPtr
 

Detailed Description

template<bool LOGSTRAIN>
struct OpPlasticTools::OpCalculatePlasticInternalForceLhs_dEP< LOGSTRAIN >

Definition at line 121 of file PlasticOperators.hpp.

Constructor & Destructor Documentation

◆ OpCalculatePlasticInternalForceLhs_dEP()

template<bool LOGSTRAIN>
OpPlasticTools::OpCalculatePlasticInternalForceLhs_dEP< LOGSTRAIN >::OpCalculatePlasticInternalForceLhs_dEP ( const std::string  row_field_name,
const std::string  col_field_name,
boost::shared_ptr< CommonData common_data_ptr,
boost::shared_ptr< MatrixDouble >  mat_D_ptr 
)

Definition at line 228 of file PlasticOperators.cpp.

233 : DomainEleOpAssembly(row_field_name, col_field_name,
234 DomainEleOpAssembly::OPROWCOL),
235 commonDataPtr(common_data_ptr), matDPtr(mat_D_ptr) {
236 sYmm = false;
237}
FormsIntegrators< DomainEleOp >::Assembly< USER_ASSEMBLE >::OpBase DomainEleOpAssembly

Member Function Documentation

◆ iNtegrate()

template<bool LOGSTRAIN>
MoFEMErrorCode OpPlasticTools::OpCalculatePlasticInternalForceLhs_dEP< LOGSTRAIN >::iNtegrate ( EntData row_data,
EntData col_data 
)

Definition at line 239 of file PlasticOperators.cpp.

240 {
242
243 const size_t nb_row_dofs = row_data.getIndices().size();
244 const size_t nb_col_dofs = col_data.getIndices().size();
245 if (nb_row_dofs && nb_col_dofs) {
246
247 const size_t nb_integration_pts = row_data.getN().size1();
248 const size_t nb_row_base_functions = row_data.getN().size2();
249 auto t_w = getFTensor0IntegrationWeight();
250 auto t_row_diff_base = row_data.getFTensor1DiffN<3>();
251 auto t_D = getFTensor4DdgFromMat<3, 3, 0>(*matDPtr);
252
253 MatrixDouble &dE_dF = *(commonDataPtr->dE_dF_mat);
254 auto t_dE_dF = getFTensor4FromMat<3, 3, 3, 3>(dE_dF);
256 auto t_L = symm_L_tensor();
257 auto t_diff_symmetrize = diff_symmetrize();
258
260 Dg<double, 3, 6> t_DL;
261 if (!LOGSTRAIN) {
262 t_DL(i, j, L) = 0;
263 for (int ii = 0; ii != 3; ++ii)
264 for (int jj = ii; jj != 3; ++jj)
265 for (int kk = 0; kk != 3; ++kk)
266 for (int ll = 0; ll != 3; ++ll)
267 for (int LL = 0; LL != 6; ++LL)
268 t_DL(ii, jj, LL) += t_D(ii, jj, kk, ll) * t_L(kk, ll, LL);
269 }
270
271 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
272 double alpha = getMeasure() * t_w;
273
274 if (LOGSTRAIN) {
276 // D2_symm(i, j, k, l) = 0.;
277
278 // FIXME: that transpose is not necessary
279 // for (int i = 0; i != 3; ++i)
280 // for (int jj = 0; jj != 3; ++jj)
281 // for (int k = 0; k != 3; ++k)
282 // for (int l = 0; l != 3; ++l)
283 // for (int m = 0; m != 3; ++m)
284 // for (int n = 0; n != 3; ++n)
285 // D2_symm(k, l, m, n) +=
286 // t_D(i, jj, m, n) * t_dE_dF(i, jj, k, l);
287 D2_symm(k, l, m, n) = t_D(m, n, i, j) * t_dE_dF(i, j, k, l);
288
289 t_DLs(i, j, L) = 0;
290 for (int ii = 0; ii != 3; ++ii)
291 for (int jj = 0; jj != 3; ++jj)
292 for (int kk = 0; kk != 3; ++kk)
293 for (int ll = 0; ll != 3; ++ll)
294 for (int LL = 0; LL != 6; ++LL)
295 t_DLs(ii, jj, LL) +=
296 D2_symm(ii, jj, kk, ll) * t_L(kk, ll, LL);
297 }
298
299 size_t rr = 0;
300 for (; rr != nb_row_dofs / 3; ++rr) {
301
302 Tensor2<PackPtr<double *, 6>, 3, 6> t_mat{
303 &locMat(3 * rr + 0, 0), &locMat(3 * rr + 0, 1),
304 &locMat(3 * rr + 0, 2), &locMat(3 * rr + 0, 3),
305 &locMat(3 * rr + 0, 4), &locMat(3 * rr + 0, 5),
306 &locMat(3 * rr + 1, 0), &locMat(3 * rr + 1, 1),
307 &locMat(3 * rr + 1, 2), &locMat(3 * rr + 1, 3),
308 &locMat(3 * rr + 1, 4), &locMat(3 * rr + 1, 5),
309 &locMat(3 * rr + 2, 0), &locMat(3 * rr + 2, 1),
310 &locMat(3 * rr + 2, 2), &locMat(3 * rr + 2, 3),
311 &locMat(3 * rr + 2, 4), &locMat(3 * rr + 2, 5)};
312
313 auto t_col_base = col_data.getFTensor0N(gg, 0);
315
316 if (LOGSTRAIN) {
317 t_tmp(i, L) = (t_DLs(i, j, L) * (alpha * t_row_diff_base(j)));
318
319 } else
320 t_tmp(i, L) = (t_DL(i, j, L) * (alpha * t_row_diff_base(j)));
321
322 for (size_t cc = 0; cc != nb_col_dofs / 6; ++cc) {
323
324 t_mat(i, L) -= (t_col_base * t_tmp(i, L));
325
326 ++t_mat;
327 ++t_col_base;
328 }
329
330 ++t_row_diff_base;
331 }
332
333 if (LOGSTRAIN)
334 ++t_dE_dF;
335
336 for (; rr < nb_row_base_functions; ++rr)
337 ++t_row_diff_base;
338 ++t_w;
339 }
340 }
341
343}
#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
FTensor::Index< 'n', SPACE_DIM > n
FTensor::Index< 'm', SPACE_DIM > m
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
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.

Member Data Documentation

◆ commonDataPtr

template<bool LOGSTRAIN>
boost::shared_ptr<CommonData> OpPlasticTools::OpCalculatePlasticInternalForceLhs_dEP< LOGSTRAIN >::commonDataPtr
private

Definition at line 129 of file PlasticOperators.hpp.

◆ matDPtr

template<bool LOGSTRAIN>
boost::shared_ptr<MatrixDouble> OpPlasticTools::OpCalculatePlasticInternalForceLhs_dEP< LOGSTRAIN >::matDPtr
private

Definition at line 130 of file PlasticOperators.hpp.


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