v0.14.0
Public Member Functions | Public Attributes | List of all members
PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl< RANK > Struct Template Reference

#include <users_modules/basic_finite_elements/src/PostProcOnRefMesh.hpp>

Inheritance diagram for PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl< RANK >:
[legend]
Collaboration diagram for PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl< RANK >:
[legend]

Public Member Functions

 OpGetFieldValuesOnSkinImpl (moab::Interface &post_proc_mesh, std::vector< EntityHandle > &map_gauss_pts, const std::string field_name, const std::string tag_name, boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > side_fe, const std::string vol_fe_name, boost::shared_ptr< MatrixDouble > mat_ptr, bool save_on_tag)
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 

Public Attributes

moab::Interface & postProcMesh
 
std::vector< EntityHandle > & mapGaussPts
 
boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSidesideOpFe
 
const std::string feVolName
 
boost::shared_ptr< MatrixDouble > matPtr
 
const std::string tagName
 
const std::string fieldName
 
const bool saveOnTag
 

Detailed Description

template<int RANK>
struct PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl< RANK >

Definition at line 1063 of file PostProcOnRefMesh.hpp.

Constructor & Destructor Documentation

◆ OpGetFieldValuesOnSkinImpl()

template<int RANK>
PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl< RANK >::OpGetFieldValuesOnSkinImpl ( moab::Interface &  post_proc_mesh,
std::vector< EntityHandle > &  map_gauss_pts,
const std::string  field_name,
const std::string  tag_name,
boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide side_fe,
const std::string  vol_fe_name,
boost::shared_ptr< MatrixDouble >  mat_ptr,
bool  save_on_tag 
)
inline

Definition at line 1075 of file PostProcOnRefMesh.hpp.

1084  postProcMesh(post_proc_mesh), mapGaussPts(map_gauss_pts),
1085  sideOpFe(side_fe), feVolName(vol_fe_name), matPtr(mat_ptr),
1086  tagName(tag_name), fieldName(field_name), saveOnTag(save_on_tag) {}

Member Function Documentation

◆ doWork()

template<int RANK>
MoFEMErrorCode PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl< RANK >::doWork ( int  side,
EntityType  type,
EntitiesFieldData::EntData data 
)

Definition at line 930 of file PostProcOnRefMesh.cpp.

931  {
933 
934  if (type != MBVERTEX)
936 
937  CHKERR loopSideVolumes(feVolName, *sideOpFe);
938 
939  // quit if tag is not needed
940  if (!saveOnTag)
942 
943  auto &m_field = getPtrFE()->mField;
944  auto field_ptr = m_field.get_field_structure(fieldName);
945  const int rank = field_ptr->getNbOfCoeffs();
946  FieldSpace space = field_ptr->getSpace();
947 
948  // auto dof_ptr = data.getFieldDofs()[0];
949  // int rank = dof_ptr->getNbOfCoeffs();
950  // FieldSpace space = dof_ptr->getSpace();
951 
952  int full_size = rank * RANK;
953  if (space == HDIV)
954  full_size *= 3;
955  // for paraview
956  int tag_length = full_size > 3 && full_size < 9 ? 9 : full_size;
957  double def_VAL[tag_length];
958  bzero(def_VAL, tag_length * sizeof(double));
959  Tag th;
960  CHKERR postProcMesh.tag_get_handle(tagName.c_str(), tag_length,
961  MB_TYPE_DOUBLE, th,
962  MB_TAG_CREAT | MB_TAG_SPARSE, def_VAL);
963 
964  // zero tags, this for Vertex if H1 and TRI if Hdiv, EDGE for Hcurl
965  // no need for L2
966  const void *tags_ptr[mapGaussPts.size()];
967  int nb_gauss_pts = data.getN().size1();
968  if (mapGaussPts.size() != (unsigned int)nb_gauss_pts ||
969  nb_gauss_pts != matPtr->size2()) {
970  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
971  }
972  switch (space) {
973  case H1:
974  case L2:
975  case HDIV:
976 
977  CHKERR postProcMesh.tag_get_by_ptr(th, &mapGaussPts[0], mapGaussPts.size(),
978  tags_ptr);
979 
980  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
981  const double *my_ptr2 = static_cast<const double *>(tags_ptr[gg]);
982  double *my_ptr = const_cast<double *>(my_ptr2);
983  for (int rr = 0; rr != RANK; ++rr) {
984  for (int dd = 0; dd != rank; ++dd) {
985  my_ptr[rank * rr + dd] = (*matPtr)(rank * rr + dd, gg);
986  }
987  }
988  }
989 
990  break;
991  default:
992  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
993  "field with that space is not implemented");
994  }
995 
997 }

Member Data Documentation

◆ feVolName

template<int RANK>
const std::string PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl< RANK >::feVolName

Definition at line 1069 of file PostProcOnRefMesh.hpp.

◆ fieldName

template<int RANK>
const std::string PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl< RANK >::fieldName

Definition at line 1072 of file PostProcOnRefMesh.hpp.

◆ mapGaussPts

template<int RANK>
std::vector<EntityHandle>& PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl< RANK >::mapGaussPts

Definition at line 1067 of file PostProcOnRefMesh.hpp.

◆ matPtr

template<int RANK>
boost::shared_ptr<MatrixDouble> PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl< RANK >::matPtr

Definition at line 1070 of file PostProcOnRefMesh.hpp.

◆ postProcMesh

template<int RANK>
moab::Interface& PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl< RANK >::postProcMesh

Definition at line 1066 of file PostProcOnRefMesh.hpp.

◆ saveOnTag

template<int RANK>
const bool PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl< RANK >::saveOnTag

Definition at line 1073 of file PostProcOnRefMesh.hpp.

◆ sideOpFe

Definition at line 1068 of file PostProcOnRefMesh.hpp.

◆ tagName

template<int RANK>
const std::string PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl< RANK >::tagName

Definition at line 1071 of file PostProcOnRefMesh.hpp.


The documentation for this struct was generated from the following files:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl::saveOnTag
const bool saveOnTag
Definition: PostProcOnRefMesh.hpp:1073
PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl::fieldName
const std::string fieldName
Definition: PostProcOnRefMesh.hpp:1072
H1
@ H1
continuous field
Definition: definitions.h:85
PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl::tagName
const std::string tagName
Definition: PostProcOnRefMesh.hpp:1071
L2
@ L2
field with C-1 continuity
Definition: definitions.h:88
MoFEM::th
Tag th
Definition: Projection10NodeCoordsOnField.cpp:122
FieldSpace
FieldSpace
approximation spaces
Definition: definitions.h:82
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl::matPtr
boost::shared_ptr< MatrixDouble > matPtr
Definition: PostProcOnRefMesh.hpp:1070
convert.type
type
Definition: convert.py:64
PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl::feVolName
const std::string feVolName
Definition: PostProcOnRefMesh.hpp:1069
MoFEM::ForcesAndSourcesCore::UserDataOperator::OPCOL
@ OPCOL
operator doWork function is executed on FE columns
Definition: ForcesAndSourcesCore.hpp:568
PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl::sideOpFe
boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > sideOpFe
Definition: PostProcOnRefMesh.hpp:1068
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl::postProcMesh
moab::Interface & postProcMesh
Definition: PostProcOnRefMesh.hpp:1066
FTensor::dd
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
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:1305
PostProcFaceOnRefinedMesh::OpGetFieldValuesOnSkinImpl::mapGaussPts
std::vector< EntityHandle > & mapGaussPts
Definition: PostProcOnRefMesh.hpp:1067
UserDataOperator
ForcesAndSourcesCore::UserDataOperator UserDataOperator
Definition: HookeElement.hpp:75
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
HDIV
@ HDIV
field with continuous normal traction
Definition: definitions.h:87
MOFEM_NOT_IMPLEMENTED
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346