- bool isFamilyPresent = (theFamilyName != "");
- int aNbCells = 0, aCellsSize = 0;
- if(!isFamilyPresent){
- TCellsConn::const_iterator aCellsConnIter = myCellsConn.begin();
- for(; aCellsConnIter != myCellsConn.end(); aCellsConnIter++){
- const TConnForCellType& aConnForCellType = aCellsConnIter->second;
- if(!aConnForCellType.empty()){
- aNbCells += aConnForCellType.size();
- aCellsSize += aConnForCellType.size()*(aConnForCellType[0].size()+1);
- }
- }
- }else{
- TFamilyMap::const_iterator aFamilyMapIter = myFamilyMap.find(theFamilyName);
- if(aFamilyMapIter == myFamilyMap.end())
- throw std::runtime_error("GetCellsDims >> There is no family on the mesh with entity !!!");
- const TFamily& aFamily = aFamilyMapIter->second;
- const TFamily::TSubMesh& aSubMesh = aFamily.mySubMesh;
- TFamily::TSubMesh::const_iterator aSubMeshIter = aSubMesh.begin();
- for(; aSubMeshIter != aSubMesh.end(); aSubMeshIter++){
- const TFamily::TSubMeshOnCellType& aSubMeshOnCellType = aSubMeshIter->second;
- if(!aSubMeshOnCellType.empty()){
- int tmp = aSubMeshOnCellType.size();
- aNbCells += tmp;
- int aVtkType = aSubMeshIter->first;
- int aVtkSize = aVtkCellInfoMap[aVtkType].mySize;
- aCellsSize += tmp*(aVtkSize+1);
- }
- }
- }
- return make_pair(aNbCells,aCellsSize);
+ if(theFamilyName == "")
+ return make_pair(myNbCells,myCellsSize);
+ TFamilyMap::const_iterator aFamilyMapIter = myFamilyMap.find(theFamilyName);
+ if(aFamilyMapIter == myFamilyMap.end())
+ throw std::runtime_error("GetCellsDims >> There is no family on the mesh with entity !!!");
+ const PFamily& aFamily = aFamilyMapIter->second;
+ return make_pair(aFamily->myNbCells,aFamily->myCellsSize);