v0.9.0
Public Member Functions | Public Attributes | List of all members
PostProcFaceOnRefinedMesh::OpGetFieldGradientValuesOnSkin Struct Reference

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

Inherits UserDataOperator.

Collaboration diagram for PostProcFaceOnRefinedMesh::OpGetFieldGradientValuesOnSkin:
[legend]

Public Member Functions

 OpGetFieldGradientValuesOnSkin (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 > grad_mat_ptr, bool save_on_tag)
 
MoFEMErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 

Public Attributes

moab::Interface & postProcMesh
 
std::vector< EntityHandle > & mapGaussPts
 
boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > sideOpFe
 
const std::string feVolName
 
boost::shared_ptr< MatrixDouble > gradMatPtr
 
const std::string tagName
 
const bool saveOnTag
 

Detailed Description

Definition at line 772 of file PostProcOnRefMesh.hpp.

Constructor & Destructor Documentation

◆ OpGetFieldGradientValuesOnSkin()

PostProcFaceOnRefinedMesh::OpGetFieldGradientValuesOnSkin::OpGetFieldGradientValuesOnSkin ( 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 >  grad_mat_ptr,
bool  save_on_tag 
)

Definition at line 783 of file PostProcOnRefMesh.hpp.

791  field_name, UserDataOperator::OPCOL),
792  postProcMesh(post_proc_mesh), mapGaussPts(map_gauss_pts),
793  sideOpFe(side_fe), feVolName(vol_fe_name),
794  gradMatPtr(grad_mat_ptr), tagName(tag_name), saveOnTag(save_on_tag) {}
moab::Interface & postProcMesh
const std::string feVolName
boost::shared_ptr< MatrixDouble > gradMatPtr
boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > sideOpFe
ForcesAndSourcesCore::UserDataOperator UserDataOperator
std::vector< EntityHandle > & mapGaussPts
const std::string tagName
const bool saveOnTag

Member Function Documentation

◆ doWork()

MoFEMErrorCode PostProcFaceOnRefinedMesh::OpGetFieldGradientValuesOnSkin::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 
)

Definition at line 816 of file PostProcOnRefMesh.cpp.

817  {
819 
820  if (type != MBVERTEX)
822 
823  CHKERR loopSideVolumes(feVolName, *sideOpFe);
824 
825  // quit if tag is not needed
826  if (!saveOnTag)
828 
829  const MoFEM::FEDofEntity *dof_ptr = data.getFieldDofs()[0].get();
830  int rank = dof_ptr->getNbOfCoeffs();
831 
832  int tag_length = rank * 3;
833  FieldSpace space = dof_ptr->getSpace();
834 
835  double def_VAL[tag_length];
836  bzero(def_VAL, tag_length * sizeof(double));
837  Tag th;
838  CHKERR postProcMesh.tag_get_handle(tagName.c_str(), tag_length,
839  MB_TYPE_DOUBLE, th,
840  MB_TAG_CREAT | MB_TAG_SPARSE, def_VAL);
841 
842  // zero tags, this for Vertex if H1 and TRI if Hdiv, EDGE for Hcurl
843  // no need for L2
844  const void *tags_ptr[mapGaussPts.size()];
845  int nb_gauss_pts = data.getN().size1();
846  if (mapGaussPts.size() != (unsigned int)nb_gauss_pts ||
847  nb_gauss_pts != gradMatPtr->size2()) {
848  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
849  }
850  switch (space) {
851  case H1:
852  case L2:
853 
854  CHKERR postProcMesh.tag_get_by_ptr(th, &mapGaussPts[0], mapGaussPts.size(),
855  tags_ptr);
856  // FIXME: this is not very efficient
857  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
858  for (int rr = 0; rr != rank; ++rr) {
859  for (int dd = 0; dd != 3; ++dd) {
860  const double *my_ptr2 = static_cast<const double *>(tags_ptr[gg]);
861  double *my_ptr = const_cast<double *>(my_ptr2);
862  my_ptr[rank * rr + dd] = (*gradMatPtr)(rank * rr + dd, gg);
863  }
864  }
865  }
866  break;
867  default:
868  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
869  "field with that space is not implemented");
870  }
871 
873 }
moab::Interface & postProcMesh
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
FieldCoefficientsNumber getNbOfCoeffs() const
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
const std::string feVolName
keeps information about indexed dofs for the finite element
boost::shared_ptr< MatrixDouble > gradMatPtr
FieldSpace getSpace() const
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
FieldSpace
approximation spaces
Definition: definitions.h:168
boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > sideOpFe
#define CHKERR
Inline error check.
Definition: definitions.h:596
const VectorDofs & getFieldDofs() const
get dofs data stature FEDofEntity
std::vector< EntityHandle > & mapGaussPts
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
const std::string tagName
continuous field
Definition: definitions.h:171
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const bool saveOnTag
field with C-1 continuity
Definition: definitions.h:174

Member Data Documentation

◆ feVolName

const std::string PostProcFaceOnRefinedMesh::OpGetFieldGradientValuesOnSkin::feVolName

Definition at line 778 of file PostProcOnRefMesh.hpp.

◆ gradMatPtr

boost::shared_ptr<MatrixDouble> PostProcFaceOnRefinedMesh::OpGetFieldGradientValuesOnSkin::gradMatPtr

Definition at line 779 of file PostProcOnRefMesh.hpp.

◆ mapGaussPts

std::vector<EntityHandle>& PostProcFaceOnRefinedMesh::OpGetFieldGradientValuesOnSkin::mapGaussPts

Definition at line 776 of file PostProcOnRefMesh.hpp.

◆ postProcMesh

moab::Interface& PostProcFaceOnRefinedMesh::OpGetFieldGradientValuesOnSkin::postProcMesh

Definition at line 775 of file PostProcOnRefMesh.hpp.

◆ saveOnTag

const bool PostProcFaceOnRefinedMesh::OpGetFieldGradientValuesOnSkin::saveOnTag

Definition at line 781 of file PostProcOnRefMesh.hpp.

◆ sideOpFe

boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> PostProcFaceOnRefinedMesh::OpGetFieldGradientValuesOnSkin::sideOpFe

Definition at line 777 of file PostProcOnRefMesh.hpp.

◆ tagName

const std::string PostProcFaceOnRefinedMesh::OpGetFieldGradientValuesOnSkin::tagName

Definition at line 780 of file PostProcOnRefMesh.hpp.


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