v0.10.0
Public Member Functions | Private Attributes | List of all members
OpElasticTools::OpSaveReactionForces Struct Reference

[Operators definitions] More...

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

Inheritance diagram for OpElasticTools::OpSaveReactionForces:
[legend]
Collaboration diagram for OpElasticTools::OpSaveReactionForces:
[legend]

Public Member Functions

 OpSaveReactionForces (MoFEM::Interface &m_field, const std::string field_name, moab::Interface &post_proc_mesh, std::vector< EntityHandle > &map_gauss_pts, boost::shared_ptr< CommonData > common_data_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Private Attributes

MoFEM::InterfacemField
 
moab::Interface & postProcMesh
 
std::vector< EntityHandle > & mapGaussPts
 
boost::shared_ptr< CommonDatacommonDataPtr
 

Detailed Description

[Operators definitions]

Definition at line 917 of file ElasticOperators.hpp.

Constructor & Destructor Documentation

◆ OpSaveReactionForces()

OpElasticTools::OpSaveReactionForces::OpSaveReactionForces ( MoFEM::Interface m_field,
const std::string  field_name,
moab::Interface &  post_proc_mesh,
std::vector< EntityHandle > &  map_gauss_pts,
boost::shared_ptr< CommonData common_data_ptr 
)

Definition at line 947 of file ElasticOperators.cpp.

951  : DomainEleOp(field_name, DomainEleOp::OPROW), mField(m_field),
952  postProcMesh(post_proc_mesh), mapGaussPts(map_gauss_pts),
953  commonDataPtr(common_data_ptr) {
954  // Operator is only executed for vertices
955  std::fill(&doEntities[MBEDGE], &doEntities[MBMAXTYPE], false);
956 }
std::vector< EntityHandle > & mapGaussPts
DomainEle::UserDataOperator DomainEleOp
boost::shared_ptr< CommonData > commonDataPtr

Member Function Documentation

◆ doWork()

MoFEMErrorCode OpElasticTools::OpSaveReactionForces::doWork ( int  side,
EntityType  type,
EntData data 
)

Definition at line 958 of file ElasticOperators.cpp.

959  {
961 
962  auto get_tag = [&](const std::string name, size_t size) {
963  std::array<double, 9> def;
964  std::fill(def.begin(), def.end(), 0);
965  Tag th;
966  CHKERR postProcMesh.tag_get_handle(name.c_str(), size, MB_TYPE_DOUBLE, th,
967  MB_TAG_CREAT | MB_TAG_SPARSE,
968  def.data());
969  return th;
970  };
971 
972  auto th_react = get_tag("REACTIONS", 3);
973  size_t nb_gauss_pts = data.getN().size1();
974  VectorDouble vAlues(data.getFieldData().size());
975 
976  const size_t rank = data.getFieldDofs()[0]->getNbOfCoeffs();
977 
978  int dd = 0;
979  for (auto &dof : data.getFieldDofs()) {
980  auto ent = dof->getEnt();
981  // ents_vec[dd] = ent;
982  const size_t idx = dof->getDofCoeffIdx();
983 
984  double tag_val[rank];
985  CHKERR mField.get_moab().tag_get_data(commonDataPtr->reactionTag, &ent, 1,
986  tag_val);
987  vAlues(dd++) = tag_val[idx];
988  }
989 
990  const void *tags_ptr[mapGaussPts.size()];
991  CHKERR postProcMesh.tag_get_by_ptr(th_react, &mapGaussPts[0],
992  mapGaussPts.size(), tags_ptr);
993  for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
994  for (int rr = 0; rr != rank; rr++) {
995  // its ugly, but tested in PostProcOnRefMesh
996  const double val = cblas_ddot((vAlues.size() / rank), &(data.getN(gg)[0]),
997  1, &vAlues(rr), rank);
998  ((double *)tags_ptr[gg])[rr] += val;
999  }
1000  }
1001 
1003 }
virtual moab::Interface & get_moab()=0
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
double cblas_ddot(const int N, const double *X, const int incX, const double *Y, const int incY)
Definition: cblas_ddot.c:12
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:33
std::vector< EntityHandle > & mapGaussPts
#define CHKERR
Inline error check.
Definition: definitions.h:604
const VectorDofs & getFieldDofs() const
get dofs data stature FEDofEntity
boost::shared_ptr< CommonData > commonDataPtr
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
ublas::vector< double, DoubleAllocator > VectorDouble
Definition: Types.hpp:74
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorDouble & getFieldData() const
get dofs values

Member Data Documentation

◆ commonDataPtr

boost::shared_ptr<CommonData> OpElasticTools::OpSaveReactionForces::commonDataPtr
private

Definition at line 928 of file ElasticOperators.hpp.

◆ mapGaussPts

std::vector<EntityHandle>& OpElasticTools::OpSaveReactionForces::mapGaussPts
private

Definition at line 927 of file ElasticOperators.hpp.

◆ mField

MoFEM::Interface& OpElasticTools::OpSaveReactionForces::mField
private

Definition at line 925 of file ElasticOperators.hpp.

◆ postProcMesh

moab::Interface& OpElasticTools::OpSaveReactionForces::postProcMesh
private

Definition at line 926 of file ElasticOperators.hpp.


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