v0.9.1
Public Member Functions | Public Attributes | List of all members
EshelbianPlasticity::OpPostProcDataStructure Struct Reference

#include <users_modules/eshelbian_plasticty/src/EshelbianPlasticity.hpp>

Inherits VolUserDataOperator.

Public Member Functions

 OpPostProcDataStructure (moab::Interface &post_proc_mesh, std::vector< EntityHandle > &map_gauss_pts, const std::string field_name, boost::shared_ptr< DataAtIntegrationPts > &data_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Public Attributes

moab::Interface & postProcMesh
 
std::vector< EntityHandle > & mapGaussPts
 
boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 

Detailed Description

Definition at line 1070 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ OpPostProcDataStructure()

EshelbianPlasticity::OpPostProcDataStructure::OpPostProcDataStructure ( moab::Interface &  post_proc_mesh,
std::vector< EntityHandle > &  map_gauss_pts,
const std::string  field_name,
boost::shared_ptr< DataAtIntegrationPts > &  data_ptr 
)

Definition at line 1076 of file EshelbianPlasticity.hpp.

1080  : VolUserDataOperator(field_name, UserDataOperator::OPROW),
1081  postProcMesh(post_proc_mesh), mapGaussPts(map_gauss_pts),
1082  dataAtPts(data_ptr) {}
std::vector< EntityHandle > & mapGaussPts
VolumeElementForcesAndSourcesCore::UserDataOperator VolUserDataOperator
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
moab::Interface & postProcMesh

Member Function Documentation

◆ doWork()

MoFEMErrorCode EshelbianPlasticity::OpPostProcDataStructure::doWork ( int  side,
EntityType  type,
EntData data 
)

Definition at line 2368 of file EshelbianOperators.cpp.

2369  {
2371  if (type != MBVERTEX)
2373 
2374  auto create_tag = [this](const std::string tag_name, const int size) {
2375  double def_VAL[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
2376  Tag th;
2377  CHKERR postProcMesh.tag_get_handle(tag_name.c_str(), size, MB_TYPE_DOUBLE,
2378  th, MB_TAG_CREAT | MB_TAG_SPARSE,
2379  def_VAL);
2380  return th;
2381  };
2382 
2383  Tag th_w = create_tag("SpatialDisplacement", 3);
2384  Tag th_omega = create_tag("Omega", 3);
2385  Tag th_approxP = create_tag("Piola1Stress", 9);
2386  Tag th_sigma = create_tag("CauchyStress", 9);
2387  Tag th_log_u = create_tag("LogSpatialStreach", 9);
2388  Tag th_u = create_tag("SpatialStreach", 9);
2389  Tag th_h = create_tag("h", 9);
2390  Tag th_X = create_tag("X", 3);
2391  Tag th_detF = create_tag("detF", 1);
2392  Tag th_angular_momentum = create_tag("AngularMomentum", 3);
2393 
2394  int nb_gauss_pts = data.getN().size1();
2395  if (mapGaussPts.size() != (unsigned int)nb_gauss_pts) {
2396  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
2397  "Nb. of integration points is not equal to number points on "
2398  "post-processing mesh");
2399  }
2400 
2401  auto t_w = getFTensor1FromMat<3>(*(dataAtPts->wAtPts));
2402  auto t_omega = getFTensor1FromMat<3>(*(dataAtPts->rotAxisAtPts));
2403  auto t_h = getFTensor2FromMat<3, 3>(*(dataAtPts->hAtPts));
2404  auto t_log_u =
2405  getFTensor2SymmetricFromMat<3>(*(dataAtPts->logStreachTensorAtPts));
2406  auto t_u = getFTensor2SymmetricFromMat<3>(*(dataAtPts->streachTensorAtPts));
2407  auto t_R = getFTensor2FromMat<3, 3>(*(dataAtPts->rotMatAtPts));
2408  auto t_approx_P = getFTensor2FromMat<3, 3>(*(dataAtPts->approxPAtPts));
2409  auto t_coords = getFTensor1CoordsAtGaussPts();
2410 
2415 
2416  // vectors
2417  VectorDouble3 v(3);
2418  FTensor::Tensor1<FTensor::PackPtr<double *, 0>, 3> t_v(&v[0], &v[1], &v[2]);
2419  auto save_vec_tag = [&](auto &th, auto &t_d, const int gg) {
2421  t_v(i) = t_d(i);
2422  CHKERR postProcMesh.tag_set_data(th, &mapGaussPts[gg], 1,
2423  &*v.data().begin());
2425  };
2426 
2427  MatrixDouble3by3 m(3, 3);
2429  &m(0, 0), &m(0, 1), &m(0, 2),
2430 
2431  &m(1, 0), &m(1, 1), &m(1, 2),
2432 
2433  &m(2, 0), &m(2, 1), &m(2, 2));
2434 
2435  auto save_mat_tag = [&](auto &th, auto &t_d, const int gg) {
2437  t_m(i, j) = t_d(i, j);
2438  CHKERR postProcMesh.tag_set_data(th, &mapGaussPts[gg], 1,
2439  &*m.data().begin());
2441  };
2442 
2443  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
2444 
2445  // vetors
2446  CHKERR save_vec_tag(th_w, t_w, gg);
2447  CHKERR save_vec_tag(th_X, t_coords, gg);
2448  CHKERR save_vec_tag(th_omega, t_omega, gg);
2449 
2450  // tensors
2451  CHKERR save_mat_tag(th_h, t_h, gg);
2452 
2453  FTensor::Tensor2<double, 3, 3> t_log_u_tmp;
2454  for (int ii = 0; ii != 3; ++ii)
2455  for (int jj = 0; jj != 3; ++jj)
2456  t_log_u_tmp(ii, jj) = t_log_u(ii, jj);
2457 
2458  CHKERR save_mat_tag(th_log_u, t_log_u_tmp, gg);
2459 
2461  for (int ii = 0; ii != 3; ++ii)
2462  for (int jj = 0; jj != 3; ++jj)
2463  t_u_tmp(ii, jj) = t_u(ii, jj);
2464 
2465  CHKERR save_mat_tag(th_u, t_u_tmp, gg);
2466  CHKERR save_mat_tag(th_approxP, t_approx_P, gg);
2467 
2468  const double jac = dEterminant(t_h);
2470  t_cauchy(i, j) = (1. / jac) * (t_approx_P(i, k) * t_h(j, k));
2471  CHKERR save_mat_tag(th_sigma, t_cauchy, gg);
2472  CHKERR postProcMesh.tag_set_data(th_detF, &mapGaussPts[gg], 1, &jac);
2473 
2475  t_PhT(i, k) = t_approx_P(i, j) * t_R(k, j);
2476  FTensor::Tensor1<double, 3> t_leviPRT;
2477  t_leviPRT(k) = levi_civita(i, l, k) * t_PhT(i, l);
2478 
2479  CHKERR postProcMesh.tag_set_data(th_angular_momentum, &mapGaussPts[gg], 1,
2480  &t_leviPRT(0));
2481 
2482  ++t_w;
2483  ++t_h;
2484  ++t_log_u;
2485  ++t_u;
2486  ++t_omega;
2487  ++t_R;
2488  ++t_approx_P;
2489  ++t_coords;
2490  }
2491 
2493 }
std::vector< EntityHandle > & mapGaussPts
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:482
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:513
static double dEterminant(T &t)
Calculate the determinant of a 3x3 matrix or a tensor of rank 2.
Definition: Templates.hpp:452
FTensor::Index< 'm', 2 > m
Definition: PlasticOps.hpp:67
MatrixBoundedArray< double, 9 > MatrixDouble3by3
Definition: Types.hpp:97
#define CHKERR
Inline error check.
Definition: definitions.h:601
FTensor::Index< 'k', 2 > k
Definition: ContactOps.hpp:28
VectorBoundedArray< double, 3 > VectorDouble3
Definition: Types.hpp:87
FTensor::Index< 'j', 2 > j
Definition: ContactOps.hpp:27
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
moab::Interface & postProcMesh
FTensor::Index< 'l', 2 > l
Definition: ContactOps.hpp:29
FTensor::Index< 'i', 2 > i
[Common data]
Definition: ContactOps.hpp:26
constexpr std::enable_if<(Dim0<=2 &&Dim1<=2), Tensor2_Expr< Levi_Civita< T >, T, Dim0, Dim1, i, j > >::type levi_civita(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
levi_civita functions to make for easy adhoc use

Member Data Documentation

◆ dataAtPts

boost::shared_ptr<DataAtIntegrationPts> EshelbianPlasticity::OpPostProcDataStructure::dataAtPts

Definition at line 1074 of file EshelbianPlasticity.hpp.

◆ mapGaussPts

std::vector<EntityHandle>& EshelbianPlasticity::OpPostProcDataStructure::mapGaussPts

Definition at line 1073 of file EshelbianPlasticity.hpp.

◆ postProcMesh

moab::Interface& EshelbianPlasticity::OpPostProcDataStructure::postProcMesh

Definition at line 1072 of file EshelbianPlasticity.hpp.


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