v0.9.0
Public Member Functions | Public Attributes | List of all members
CellEngineering::PostProcTraction Struct Reference

Shave results on mesh tags for post-processing. More...

#include <users_modules/cell_engineering/src/CellForces.hpp>

Inheritance diagram for CellEngineering::PostProcTraction:
[legend]
Collaboration diagram for CellEngineering::PostProcTraction:
[legend]

Public Member Functions

 PostProcTraction (MoFEM::Interface &m_field, moab::Interface &post_proc_mesh, std::vector< EntityHandle > &map_gauss_pts, CommonData &common_data)
 
MoFEMErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 Here real work is done. More...
 

Public Attributes

MoFEM::InterfacemField
 
moab::Interface & postProcMesh
 
std::vector< EntityHandle > & mapGaussPts
 
CommonDatacommonData
 

Detailed Description

Shave results on mesh tags for post-processing.

Examples
cell_forces.cpp.

Definition at line 600 of file CellForces.hpp.

Constructor & Destructor Documentation

◆ PostProcTraction()

CellEngineering::PostProcTraction::PostProcTraction ( MoFEM::Interface m_field,
moab::Interface &  post_proc_mesh,
std::vector< EntityHandle > &  map_gauss_pts,
CommonData common_data 
)

Constructor

Definition at line 611 of file CellForces.hpp.

615  "RHO", ForcesAndSourcesCore::UserDataOperator::OPROW),
616  mField(m_field), postProcMesh(post_proc_mesh),
617  mapGaussPts(map_gauss_pts), commonData(common_data) {}
moab::Interface & postProcMesh
Definition: CellForces.hpp:604
CommonData & commonData
Definition: CellForces.hpp:606
MoFEM::Interface & mField
Definition: CellForces.hpp:603
ForcesAndSourcesCore::UserDataOperator UserDataOperator
std::vector< EntityHandle > & mapGaussPts
Definition: CellForces.hpp:605

Member Function Documentation

◆ doWork()

MoFEMErrorCode CellEngineering::PostProcTraction::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 
)

Here real work is done.

Definition at line 622 of file CellForces.hpp.

623  {
625 
626  if (type != MBVERTEX)
628 
629  double def_val[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
630  Tag th_force, th_force_potential, th_grad_force;
631  CHKERR postProcMesh.tag_get_handle("FORCE", 3, MB_TYPE_DOUBLE, th_force,
632  MB_TAG_CREAT | MB_TAG_SPARSE, def_val);
633 
634  if (commonData.forcePotentialAtGaussPoints.size() > 0) {
635  CHKERR postProcMesh.tag_get_handle("FORCE_POTENTIAL", 1, MB_TYPE_DOUBLE,
636  th_force_potential,
637  MB_TAG_CREAT | MB_TAG_SPARSE, def_val);
638  }
639  if (commonData.gradForceAtGaussPtrs.size1() > 0) {
640  CHKERR postProcMesh.tag_get_handle("FORCE_GRADIENT", 9, MB_TYPE_DOUBLE,
641  th_grad_force,
642  MB_TAG_CREAT | MB_TAG_SPARSE, def_val);
643  }
644 
645  int nb_gauss_pts = data.getN().size1();
646  if (mapGaussPts.size() != (unsigned int)nb_gauss_pts) {
647  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
648  }
649 
650  for (int gg = 0; gg < nb_gauss_pts; gg++) {
651  const double force[] = {commonData.forceAtGaussPts(gg, 0),
652  commonData.forceAtGaussPts(gg, 1), 0};
653  CHKERR postProcMesh.tag_set_data(th_force, &mapGaussPts[gg], 1, force);
654  if (commonData.forcePotentialAtGaussPoints.size() > 0) {
655  CHKERR postProcMesh.tag_set_data(
656  th_force_potential, &mapGaussPts[gg], 1,
658  }
659  if (commonData.gradForceAtGaussPtrs.size1() > 0) {
660  const double grad_force[] = {commonData.gradForceAtGaussPtrs(gg, 0),
662  0,
665  0,
666  0,
667  0,
668  0};
669  CHKERR postProcMesh.tag_set_data(th_grad_force, &mapGaussPts[gg], 1,
670  grad_force);
671 
672  }
673  }
674 
676  }
moab::Interface & postProcMesh
Definition: CellForces.hpp:604
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
CommonData & commonData
Definition: CellForces.hpp:606
VectorDouble forcePotentialAtGaussPoints
Definition: CellForces.hpp:34
#define CHKERR
Inline error check.
Definition: definitions.h:596
MatrixDouble gradForceAtGaussPtrs
Definition: CellForces.hpp:35
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
std::vector< EntityHandle > & mapGaussPts
Definition: CellForces.hpp:605

Member Data Documentation

◆ commonData

CommonData& CellEngineering::PostProcTraction::commonData

Definition at line 606 of file CellForces.hpp.

◆ mapGaussPts

std::vector<EntityHandle>& CellEngineering::PostProcTraction::mapGaussPts

Definition at line 605 of file CellForces.hpp.

◆ mField

MoFEM::Interface& CellEngineering::PostProcTraction::mField

Definition at line 603 of file CellForces.hpp.

◆ postProcMesh

moab::Interface& CellEngineering::PostProcTraction::postProcMesh

Definition at line 604 of file CellForces.hpp.


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