Пример #1
0
void UNV2417::ReadGroup(const std::string& myGroupLabel, std::ifstream& in_stream, TDataSet& theDataSet)
{
  TGroupId aId;
  for(; !in_stream.eof();){
    in_stream >> aId ;
    if(aId == -1){
      // end of dataset is reached
      break;
    }

    int n_nodes;
    TRecord aRec;
    int aTmp;
    in_stream>>aTmp; // miss not necessary values
    in_stream>>aTmp;
    in_stream>>aTmp;
    in_stream>>aTmp;
    in_stream>>aTmp;
    in_stream>>aTmp;
    in_stream>>n_nodes;

    std::getline(in_stream, aRec.GroupName, '\n'); // Finalise previous reading
    std::getline(in_stream, aRec.GroupName, '\n');

    int aElType;
    int aElId;
    int aNum;
    for(int j=0; j < n_nodes; j++){
      in_stream>>aElType;
      in_stream>>aElId;
      if ((myGroupLabel.compare("2435") == 0) ||
	  (myGroupLabel.compare("2452") == 0) ||
	  (myGroupLabel.compare("2467") == 0) ||
	  (myGroupLabel.compare("2477") == 0)) {
	in_stream>>aTmp;
	in_stream>>aTmp;
      }
      switch (aElType) {
      case 7: // Nodes
	aNum = aRec.NodeList.size();
	aRec.NodeList.resize(aNum + 1);
	aRec.NodeList[aNum] = aElId;
	break;
      case 8: // Elements
	aNum = aRec.ElementList.size();
	aRec.ElementList.resize(aNum + 1);
	aRec.ElementList[aNum] = aElId;
	break;
      }
    }
    theDataSet.insert(TDataSet::value_type(aId,aRec));
  }