}
}
+
+ //---------------------------------------------------------------
+ void
+ BuildFamilyMap(PMEDMesh theMesh,
+ const TFamilyCounterMap& theFamilyNbCellsCounterMap,
+ const TFamilyCounterMap& theFamilyCellsSizeCounterMap,
+ const MED::TEntityInfo& theEntityInfo,
+ const MED::TElemGroup& theElemGroup,
+ const MED::TFamilyGroup& theFamilyGroup,
+ MED::PWrapper theMEDWrapper)
+ {
+ MED::PMeshInfo aMeshInfo = theMesh->myMeshInfo;
+ MED::TFamilyByEntity aFamilyByEntity = MED::GetFamiliesByEntity(theMEDWrapper,theElemGroup,theFamilyGroup);
+ MED::TFamilyByEntity::const_iterator aFamilyByEntityIter = aFamilyByEntity.begin();
+ INITMSG(MY_FAMILY_DEBUG,"BuildFamilyMap:\n");
+ for(; aFamilyByEntityIter != aFamilyByEntity.end(); aFamilyByEntityIter++){
+ const MED::EEntiteMaillage& aMEntity = aFamilyByEntityIter->first;
+ const MED::TFamilyGroup& aFamilyGroup = aFamilyByEntityIter->second;
+
+ TEntity aVEntity = MEDEntityToVTK(aMEntity);
+ PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[aVEntity];
+ TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+
+ if(aFamilyGroup.empty())
+ continue;
+
+ INITMSG(MY_FAMILY_DEBUG,
+ "- aMEntity = "<<aMEntity<<
+ "; aVEntity = "<<aVEntity<<
+ endl);
+
+ MED::TFamilyGroup::const_iterator aFamilyGroupIter = aFamilyGroup.begin();
+ for(; aFamilyGroupIter != aFamilyGroup.end(); aFamilyGroupIter++){
+ const MED::PFamilyInfo& aFamilyInfo = *aFamilyGroupIter;
+ if (aFamilyInfo->GetId() == 0)
+ continue;
+
+ TInt anId = aFamilyInfo->GetId();
+ std::string aFamilyName = aFamilyInfo->GetName();
+ PMEDFamily aFamily = aFamilyMap[aFamilyName](new TMEDFamily());
+
+ aFamily->myId = anId;
+ aFamily->myName = aFamilyInfo->GetName();
+ aFamily->myEntity = aVEntity;
+ {
+ aFamily->myNbCells = 0;
+ TFamilyCounterMap::const_iterator anIter = theFamilyNbCellsCounterMap.find(anId);
+ if(anIter != theFamilyNbCellsCounterMap.end())
+ aFamily->myNbCells = anIter->second;
+ }
+ {
+ aFamily->myCellsSize = 0;
+ TFamilyCounterMap::const_iterator anIter = theFamilyCellsSizeCounterMap.find(anId);
+ if(anIter != theFamilyCellsSizeCounterMap.end())
+ aFamily->myCellsSize = anIter->second;
+ }
+
+ INITMSG(MY_FAMILY_DEBUG,
+ "- aFamilyName = '"<<aFamily->myName<<"'"<<
+ "; myId = "<<aFamily->myId<<"; "<<
+ "; aNbAttr = "<<aFamilyInfo->GetNbAttr()<<
+ "; aNbGroup = "<<aFamilyInfo->GetNbGroup()<<
+ "; myEntity = "<<aFamily->myEntity<<
+ "; myNbCells = "<<aFamily->myNbCells<<
+ "; myCellsSize = "<<aFamily->myCellsSize<<
+ endl);
+
+ VISU::TBindGroups& aBindGroups = aFamily->myGroups;
+ const TInt aNbGroup = aFamilyInfo->GetNbGroup();
+ for(TInt i = 0; i < aNbGroup; i++){
+ std::string aGroupName = aFamilyInfo->GetGroupName(i);
+ aBindGroups.insert(aGroupName);
+ INITMSG(MY_FAMILY_DEBUG,"- aGroupName = '"<<aGroupName<<"'\n");
+ }
+ }
+ }
+ }
}
MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo);
- MED::TElemGroup aElemGroup = MED::GetElemsByEntity(aMed,aMeshInfo,aEntityInfo);
+ MED::TElemGroup anElemGroup = MED::GetElemsByEntity(aMed,aMeshInfo,aEntityInfo);
// creating TMesh structure and TMeshOnEntityMap
TInt aDim = aMeshInfo->GetDim();
#endif
MED::TFamilyGroup aFamilyGroup = MED::GetFamilies(aMed,aMeshInfo);
- MED::TFamilyByEntity aFamilyByEntity = MED::GetFamiliesByEntity(aMed,aElemGroup,aFamilyGroup);
- MED::TFamilyByEntity::const_iterator aFamilyByEntityIter = aFamilyByEntity.begin();
- BEGMSG(MY_FAMILY_DEBUG,"TFamilyByEntity:\n");
- for(; aFamilyByEntityIter != aFamilyByEntity.end(); aFamilyByEntityIter++){
- const MED::EEntiteMaillage& aMEntity = aFamilyByEntityIter->first;
- const MED::TFamilyGroup& aFamilyGroup = aFamilyByEntityIter->second;
-
- TEntity aVEntity = MEDEntityToVTK(aMEntity);
- PMEDMeshOnEntity aMeshOnEntity = aMesh->myMeshOnEntityMap[aVEntity];
- TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
-
- if(aFamilyGroup.empty())
- continue;
-
- INITMSG(MY_FAMILY_DEBUG,"aMEntity = "<<aMEntity<<"; aVEntity = "<<aVEntity<<"\n");
- MED::TFamilyGroup::const_iterator aFamilyGroupIter = aFamilyGroup.begin();
- for(; aFamilyGroupIter != aFamilyGroup.end(); aFamilyGroupIter++){
- const MED::PFamilyInfo& aFamilyInfo = *aFamilyGroupIter;
- if (aFamilyInfo->GetId() == 0)
- continue;
-
- const std::string& aFamilyName = aFamilyInfo->GetName();
- PMEDFamily aFamily = aFamilyMap[aFamilyName](new TMEDFamily());
-
- aFamily->myId = aFamilyInfo->GetId();
- aFamily->myName = aFamilyInfo->GetName();
- aFamily->myEntity = aVEntity;
- aFamily->myNbCells = aFamilyNbCellsCounterMap[aFamily->myId];
- aFamily->myCellsSize = aFamilyCellsSizeCounterMap[aFamily->myId];
-
- INITMSG(MY_FAMILY_DEBUG,"aFamilyName = '"<<aFamily->myName<<
- "'; myId = "<<aFamily->myId<<"; "<<
- "; aNbAttr = "<<aFamilyInfo->GetNbAttr()<<
- "; aNbGroup = "<<aFamilyInfo->GetNbGroup()<<
- "; myEntity = "<<aFamily->myEntity<<
- "; myNbCells = "<<aFamily->myNbCells<<
- "; myCellsSize = "<<aFamily->myCellsSize<<"\n");
-
- VISU::TBindGroups& aBindGroups = aFamily->myGroups;
- const TInt aNbGroup = aFamilyInfo->GetNbGroup();
- for(TInt i = 0; i < aNbGroup; i++){
- const string& aGroupName = aFamilyInfo->GetGroupName(i);
- aBindGroups.insert(aGroupName);
- INITMSG(MY_FAMILY_DEBUG,"aGroupName = '"<<aGroupName<<"'\n");
- }
- }
- }
+ BuildFamilyMap(aMesh,
+ aFamilyNbCellsCounterMap,
+ aFamilyCellsSizeCounterMap,
+ aEntityInfo,
+ anElemGroup,
+ aFamilyGroup,
+ aMed);
+
BEGMSG(MY_GROUP_DEBUG,"TGroup:\n");
TGroupMap& aGroupMap = aMesh->myGroupMap;
MED::TGroupInfo aGroupInfo = GetFamiliesByGroup(aFamilyGroup);