1 #include "UNV2417_Structure.hxx"
2 #include "UNV_Utilities.hxx"
6 using namespace UNV2417;
9 static int MYDEBUG = 1;
11 static int MYDEBUG = 0;
15 static string _group_labels[] = {"2417", "2429", "2430", "2432", "2435"};
18 //static string _label_dataset = "2435";
20 void UNV2417::Read(std::ifstream& in_stream, TDataSet& theDataSet)
23 EXCEPTION(runtime_error,"ERROR: Input file not good.");
25 std::string olds, news;
28 in_stream >> olds >> news;
30 * a "-1" followed by a number means the beginning of a dataset
31 * stop combing at the end of the file
33 while( ((olds != "-1") || (news == "-1") ) && !in_stream.eof() ){
39 for (int i = 0; i < NBGROUP; i++) {
40 if (news == _group_labels[i]) {
41 ReadGroup(news, in_stream, theDataSet);
49 void UNV2417::ReadGroup(const std::string& myGroupLabel, std::ifstream& in_stream, TDataSet& theDataSet)
52 for(; !in_stream.eof();){
55 // end of dataset is reached
62 in_stream>>aTmp; // miss not necessary values
70 in_stream>>aRec.GroupName;
75 for(int j=0; j < n_nodes; j++){
78 if (myGroupLabel.compare("2435") == 0) {
84 aNum = aRec.NodeList.size();
85 aRec.NodeList.resize(aNum + 1);
86 aRec.NodeList[aNum] = aElId;
89 aNum = aRec.ElementList.size();
90 aRec.ElementList.resize(aNum + 1);
91 aRec.ElementList[aNum] = aElId;
95 theDataSet.insert(TDataSet::value_type(aId,aRec));