v0.15.0
Loading...
Searching...
No Matches
EshelbianPlasticity::ContactTree Struct Reference

#include "users_modules/eshelbian_plasticity/src/EshelbianContact.hpp"

Inheritance diagram for EshelbianPlasticity::ContactTree:
[legend]
Collaboration diagram for EshelbianPlasticity::ContactTree:
[legend]

Classes

struct  FaceData
 

Public Types

using Base = PostProcBrokenMeshInMoabBase<FaceElementForcesAndSourcesCore>
 
using MapFaceData = std::map<EntityHandle, std::vector<FaceData>>
 

Public Member Functions

 ContactTree (MoFEM::Interface &m_field, boost::shared_ptr< moab::Core > core_mesh_ptr, int max_order, std::map< int, Range > &&body_map)
 
MoFEMErrorCode preProcess ()
 
MoFEMErrorCode postProcess ()
 
boost::shared_ptr< OrientedBoxTreeTool > & getTreeSurfPtr ()
 
auto getRootSetSurf ()
 
int getMaxLevel () const
 
auto findFaceDataVecPtr (EntityHandle fe_ent)
 
auto getFaceDataPtr (std::vector< FaceData >::iterator &it, int gg, std::vector< FaceData > *vec_ptr)
 

Protected Member Functions

MoFEMErrorCode buildTree (Range &ents)
 

Protected Attributes

boost::shared_ptr< OrientedBoxTreeTool > treeSurfPtr
 
EntityHandle rootSetSurf
 
Tag thEleId
 
Tag thBodyId
 
Tag thSmallX
 
Tag thLargeX
 
Tag thTraction
 
MapFaceData shadowDataMap
 
std::map< int, RangebodyMap
 
const int maxOrder
 

Friends

struct OpMoveNode
 
struct OpTreeSearch
 

Detailed Description

Definition at line 34 of file EshelbianContact.hpp.

Member Typedef Documentation

◆ Base

◆ MapFaceData

Definition at line 74 of file EshelbianContact.hpp.

Constructor & Destructor Documentation

◆ ContactTree()

EshelbianPlasticity::ContactTree::ContactTree ( MoFEM::Interface & m_field,
boost::shared_ptr< moab::Core > core_mesh_ptr,
int max_order,
std::map< int, Range > && body_map )

< So far only linear geometry is implemented for contact

Definition at line 961 of file EshelbianContact.cpp.

964 : Base(m_field, core_mesh_ptr, "contact"), maxOrder(max_order),
965 bodyMap(body_map) {
966
967 auto ref_ele_ptr = boost::make_shared<PostProcGenerateRefMesh<MBTRI>>();
968 ref_ele_ptr->hoNodes =
969 PETSC_FALSE; ///< So far only linear geometry is implemented for contact
970
971 CHK_THROW_MESSAGE(ref_ele_ptr->getOptions(optionsPrefix), "getOptions");
972 CHK_THROW_MESSAGE(ref_ele_ptr->generateReferenceElementMesh(),
973 "Error when generating reference element");
974
975 MOFEM_LOG("EP", Sev::inform) << "Contact hoNodes " << ref_ele_ptr->hoNodes
976 ? "true"
977 : "false";
978 MOFEM_LOG("EP", Sev::inform)
979 << "Contact maxOrder " << ref_ele_ptr->defMaxLevel;
980
981 refElementsMap[MBTRI] = ref_ele_ptr;
982
983 int def_ele_id = -1;
984 CHKERR getPostProcMesh().tag_get_handle("ELE_ID", 1, MB_TYPE_INTEGER, thEleId,
985 MB_TAG_CREAT | MB_TAG_DENSE,
986 &def_ele_id);
987 CHKERR getPostProcMesh().tag_get_handle("BODY_ID", 1, MB_TYPE_INTEGER,
988 thBodyId, MB_TAG_CREAT | MB_TAG_DENSE,
989 &def_ele_id);
990
991 // std::vector<int> def_ids(3 * nb_bases, 0);
992 // CHKERR getPostProcMesh().tag_get_handle("IDS", 3 * nb_bases,
993 // MB_TYPE_INTEGER,
994 // thIds, MB_TAG_CREAT | MB_TAG_DENSE,
995 // &*def_ids.begin());
996 // std::vector<double> def_coeffs(3 * nb_bases, 0);
997 // CHKERR getPostProcMesh().tag_get_handle("COEFF", 3 * nb_bases,
998 // MB_TYPE_DOUBLE,
999 // thCoeff, MB_TAG_CREAT |
1000 // MB_TAG_DENSE,
1001 // &*def_coeffs.begin());
1002 // std::vector<double> def_basses(nb_bases, 0);
1003 // CHKERR getPostProcMesh().tag_get_handle("BASES", nb_bases, MB_TYPE_DOUBLE,
1004 // thBases, MB_TAG_CREAT |
1005 // MB_TAG_DENSE,
1006 // &*def_basses.begin());
1007
1008 std::array<double, 3> def_small_x{0., 0., 0.};
1009 CHKERR getPostProcMesh().tag_get_handle("x", 3, MB_TYPE_DOUBLE, thSmallX,
1010 MB_TAG_CREAT | MB_TAG_DENSE,
1011 def_small_x.data());
1012 CHKERR getPostProcMesh().tag_get_handle("X", 3, MB_TYPE_DOUBLE, thLargeX,
1013 MB_TAG_CREAT | MB_TAG_DENSE,
1014 def_small_x.data());
1015
1016 std::array<double, 3> def_tractions{0., 0., 0.};
1017 CHKERR getPostProcMesh().tag_get_handle(
1018 "TRACTION", 3, MB_TYPE_DOUBLE, thTraction, MB_TAG_CREAT | MB_TAG_DENSE,
1019 &*def_tractions.begin());
1020}
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define CHKERR
Inline error check.
#define MOFEM_LOG(channel, severity)
Log.
PostProcBrokenMeshInMoabBase< FaceElementForcesAndSourcesCore > Base

Member Function Documentation

◆ buildTree()

MoFEMErrorCode EshelbianPlasticity::ContactTree::buildTree ( Range & ents)
protected

Definition at line 1071 of file EshelbianContact.cpp.

1071 {
1073 // MOFEM_LOG("SELF", Sev::inform) << ents << endl;
1074
1075 treeSurfPtr = boost::shared_ptr<OrientedBoxTreeTool>(
1076 new OrientedBoxTreeTool(&getPostProcMesh(), "ROOTSETSURF", true));
1077 CHKERR treeSurfPtr->build(ents, rootSetSurf);
1078
1079 // CHKERR treeSurfPtr->stats(rootSetSurf, std::cerr);
1080
1082}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
boost::shared_ptr< OrientedBoxTreeTool > treeSurfPtr

◆ findFaceDataVecPtr()

auto EshelbianPlasticity::ContactTree::findFaceDataVecPtr ( EntityHandle fe_ent)
inline

Definition at line 76 of file EshelbianContact.hpp.

76 {
77 auto &map_face_data = shadowDataMap;
78 auto it = map_face_data.find(fe_ent);
79 if (it == map_face_data.end()) {
80 return (std::vector<FaceData> *)nullptr;
81 }
82 return &(it->second);
83 }

◆ getFaceDataPtr()

auto EshelbianPlasticity::ContactTree::getFaceDataPtr ( std::vector< FaceData >::iterator & it,
int gg,
std::vector< FaceData > * vec_ptr )
inline

Definition at line 85 of file EshelbianContact.hpp.

86 {
87 FaceData *face_data_ptr = nullptr;
88 if (it != vec_ptr->end()) {
89 if (it->gaussPtNb == gg) {
90 face_data_ptr = &(*it);
91 ++it;
92 }
93 }
94 return face_data_ptr;
95 }

◆ getMaxLevel()

int EshelbianPlasticity::ContactTree::getMaxLevel ( ) const
inline

Definition at line 49 of file EshelbianContact.hpp.

49{ return refElementsMap.at(MBTRI)->defMaxLevel; }

◆ getRootSetSurf()

auto EshelbianPlasticity::ContactTree::getRootSetSurf ( )
inline

Definition at line 48 of file EshelbianContact.hpp.

48{ return rootSetSurf; }

◆ getTreeSurfPtr()

boost::shared_ptr< OrientedBoxTreeTool > & EshelbianPlasticity::ContactTree::getTreeSurfPtr ( )
inline

Definition at line 45 of file EshelbianContact.hpp.

45 {
46 return treeSurfPtr;
47 }

◆ postProcess()

MoFEMErrorCode EshelbianPlasticity::ContactTree::postProcess ( )

Definition at line 1028 of file EshelbianContact.cpp.

1028 {
1030
1031 CHKERR Base::postProcess();
1032 shadowDataMap.clear();
1033
1034 PetscBarrier(nullptr);
1035
1036 ParallelComm *pcomm_post_proc_mesh =
1037 ParallelComm::get_pcomm(&getPostProcMesh(), MYPCOMM_INDEX);
1038 if (pcomm_post_proc_mesh == nullptr)
1039 SETERRQ(PETSC_COMM_WORLD, MOFEM_DATA_INCONSISTENCY, "PComm not allocated");
1040
1041 // MOFEM_LOG("EP", Sev::verbose) << "ContactTree broadcast entities";
1042
1043 auto brodacts = [&](auto &brodacts_ents) {
1045 Range recived_ents;
1046 for (auto rr = 0; rr != mField.get_comm_size(); ++rr) {
1047 pcomm_post_proc_mesh->broadcast_entities(
1048 rr, rr == mField.get_comm_rank() ? brodacts_ents : recived_ents,
1049 false, true);
1050 }
1052 };
1053
1054 Range brodacts_ents;
1055 CHKERR getPostProcMesh().get_entities_by_dimension(0, 2, brodacts_ents, true);
1056 CHKERR brodacts(brodacts_ents);
1057
1058 // MOFEM_LOG("EP", Sev::verbose) << "ContactTree build tree";
1059
1060 Range ents;
1061 CHKERR getPostProcMesh().get_entities_by_dimension(0, 2, ents, true);
1062 CHKERR buildTree(ents);
1063
1064#ifndef NDEBUG
1065 CHKERR writeFile("debug_tree.h5m");
1066#endif // NDEBUG
1067
1069}
#define MYPCOMM_INDEX
default communicator number PCOMM
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
MoFEMErrorCode buildTree(Range &ents)

◆ preProcess()

MoFEMErrorCode EshelbianPlasticity::ContactTree::preProcess ( )

Definition at line 1022 of file EshelbianContact.cpp.

1022 {
1024 CHKERR Base::preProcess();
1026}

Friends And Related Symbol Documentation

◆ OpMoveNode

friend struct OpMoveNode
friend

Definition at line 51 of file EshelbianContact.hpp.

◆ OpTreeSearch

friend struct OpTreeSearch
friend

Definition at line 52 of file EshelbianContact.hpp.

Member Data Documentation

◆ bodyMap

std::map<int, Range> EshelbianPlasticity::ContactTree::bodyMap
protected

Definition at line 113 of file EshelbianContact.hpp.

◆ maxOrder

const int EshelbianPlasticity::ContactTree::maxOrder
protected

Definition at line 115 of file EshelbianContact.hpp.

◆ rootSetSurf

EntityHandle EshelbianPlasticity::ContactTree::rootSetSurf
protected

Definition at line 100 of file EshelbianContact.hpp.

◆ shadowDataMap

MapFaceData EshelbianPlasticity::ContactTree::shadowDataMap
protected

Definition at line 111 of file EshelbianContact.hpp.

◆ thBodyId

Tag EshelbianPlasticity::ContactTree::thBodyId
protected

Definition at line 106 of file EshelbianContact.hpp.

◆ thEleId

Tag EshelbianPlasticity::ContactTree::thEleId
protected

Definition at line 102 of file EshelbianContact.hpp.

◆ thLargeX

Tag EshelbianPlasticity::ContactTree::thLargeX
protected

Definition at line 108 of file EshelbianContact.hpp.

◆ thSmallX

Tag EshelbianPlasticity::ContactTree::thSmallX
protected

Definition at line 107 of file EshelbianContact.hpp.

◆ thTraction

Tag EshelbianPlasticity::ContactTree::thTraction
protected

Definition at line 109 of file EshelbianContact.hpp.

◆ treeSurfPtr

boost::shared_ptr<OrientedBoxTreeTool> EshelbianPlasticity::ContactTree::treeSurfPtr
protected

Definition at line 99 of file EshelbianContact.hpp.


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