53 "Reads Tecplot dat file for FE block triangular format."),
78 cout <<
"Processing input dat file" << endl;
81 string line, word, tag;
82 std::ifstream datFile;
86 string fname =
m_f->m_inputfiles[
"dat"][0];
89 datFile.open(fname.c_str());
92 cerr <<
"Error opening file: " << fname << endl;
97 while (!datFile.eof())
99 getline(datFile, line);
101 if(line.find(
"VARIABLES") != string::npos)
103 vector<string> variables;
104 std::size_t pos = line.find(
'=');
110 line.substr(pos).c_str(), variables);
111 ASSERTL0(valid,
"Unable to process list of field variable in "
112 " VARIABLES list: "+ line.substr(pos));
116 for(
int i = 3; i < variables.size(); ++i)
118 m_f->m_fieldPts->m_fields.push_back(variables[i]);
126 m_f->m_fieldPts->m_ptsDim = 3;
127 m_f->m_fieldPts->m_nFields =
m_f->m_fieldPts->m_fields.size();
128 m_f->m_fieldPts->m_pts = Array<OneD, Array<OneD, NekDouble> > (
129 m_f->m_fieldPts->m_nFields +
130 m_f->m_fieldPts->m_ptsDim);
134 while (!datFile.eof())
136 getline(datFile, line);
138 if((line.find(
"ZONE") != string::npos)||
139 (line.find(
"Zone") != string::npos)||
140 (line.find(
"zone") != string::npos))
150 std::ifstream &datFile,
154 ASSERTL0(line.find(
"FEBlock") != string::npos,
155 "Routine only set up for FEBLock format");
156 ASSERTL0(line.find(
"ET") != string::npos,
157 "Routine only set up TRIANLES");
170 start = tag.find(
"N=");
171 end = tag.find_first_of(
',',start);
172 int nvert = atoi(tag.substr(start+2,end).c_str());
175 start = tag.find(
"E=");
176 end = tag.find_first_of(
',',start);
177 int nelmt = atoi(tag.substr(start+2,end).c_str());
181 int norigpts =
m_f->m_fieldPts->m_pts[0].num_elements();
182 int totfields =
m_f->m_fieldPts->m_pts.num_elements();
183 Array<OneD, Array<OneD, NekDouble> > origpts(totfields);
184 for(
int i = 0; i < totfields; ++i)
186 origpts[i] =
m_f->m_fieldPts->m_pts[i];
187 m_f->m_fieldPts->m_pts[i] =
188 Array<OneD, NekDouble>(norigpts + nvert);
192 for(
int n = 0; n < totfields; ++n)
195 for(
int i = 0; i < norigpts; ++i)
197 m_f->m_fieldPts->m_pts[n][i] = origpts[n][i];
199 for(
int i = 0; i < nvert; ++i)
202 m_f->m_fieldPts->m_pts[n][norigpts+i] = value;
208 Array<OneD, int> conn(3*nelmt);
209 for(
int i = 0; i < 3*nelmt; ++i)
213 conn[i] = norigpts + intvalue;
215 m_f->m_fieldPts->m_ptsConn.push_back(conn);
217 getline(datFile, line);