- std::vector<INTERP_KERNEL::NormalizedCellType> gt(sup->getAllGeoTypes());
- if(gt.size()!=1)
- throw INTERP_KERNEL::Exception("MEDFileMeshSupports::getNumberOfNodesInConnOf : on cells only one geometric type allowed !");
- const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel(gt[0]));
- return sup->getNumberOfCellsAtLevel(0)*cm.getNumberOfNodes();
+ std::vector<INTERP_KERNEL::NormalizedCellType> gts(sup->getAllGeoTypes());
+ if(std::find(gts.begin(),gts.end(),gt) == gts.end())
+ throw INTERP_KERNEL::Exception("MEDFileMeshSupports::getNumberOfNodesInConnOf : specified geometric type not found !");
+ const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel(gt));
+ return sup->getNumberOfCellsWithType(gt)*cm.getNumberOfNodes();