4 std::vector< std::vector<int> > rFieldMappings, std::vector<index_order> rIndexOrder,
5 std::vector<adj_map> conv_factor, std::vector<adj_map> norm_val){
11 ret =
new tecplot_data(infile, outfile, loud, infile_name, dim, rFieldMappings, rIndexOrder, conv_factor, norm_val);
15 outfile <<
"ERROR | File \"" << infile_name <<
"\": ";
16 outfile <<
"Unsupported file format" <<
"\n";
18 cout <<
"ERROR | File \"" << infile_name <<
"\": ";
19 cout <<
"Unsupported file format" <<
"\n";
32 infile.seekg(0, std::ios::beg);
37 bool zone_found =
false;
38 bool zonetype_found =
false;
39 bool datapacking_found =
false;
43 bool ijk[3] = {
false,
false,
false};
44 bool nodes_elements[2] = {
false,
false};
60 while(fdstr.c_str()[
offset] ==
' ' && offset < fdstr.length())
65 char tmp[fdstr.length()-
offset];
66 memset(tmp,
'\0', fdstr.length()-
offset);
68 for(
int i=0;
i<fdstr.length();
i++)
82 if(fdstr.find(
"ZONE") != string::npos){
87 if(fdstr.find(
"I=") != string::npos){
90 if(i_val.size() == 1){
98 if(fdstr.find(
"J=") != string::npos){
101 if(j_val.size() == 1){
109 if(fdstr.find(
"K=") != string::npos){
112 if(k_val.size() == 1){
120 if(fdstr.find(
"Nodes=") != string::npos){
123 if(node_val.size() == 1){
124 if(atoi(node_val[0].c_str()) >= 0){
125 nodes_elements[0] =
true;
131 if(fdstr.find(
"Elements=") != string::npos){
134 if(elem_val.size() == 1){
135 if(atoi(elem_val[0].c_str()) >= 0){
136 nodes_elements[1] =
true;
144 if(fdstr.find(
"ZONETYPE=Ordered") != string::npos){
145 zonetype_found =
true;
148 else if(fdstr.find(
"ZONETYPE=FEQuadrilateral") != string::npos){
149 zonetype_found =
true;
155 if(fdstr.find(
"DATAPACKING=") != string::npos){
159 sscanf(fdstr.c_str(),
"DATAPACKING=%255s", type);
161 if(
string(type).compare(datapacking) == 0)
162 datapacking_found =
true;
172 if(zone_found && zonetype_found && datapacking_found){
194 cout <<
"\t" <<
"Tecplot ASCII Block Datafile - Ordered Data" << endl;
195 cout <<
"\t" <<
"Tecplot ASCII Block Datafile - FEQuadrilateral" << endl;
static datafile * detectFiletype(ifstream &infile, ofstream &outfile, bool loud, string infile_name, int dim, std::vector< std::vector< int > > rFieldMappings, std::vector< index_order > rIndexOrder, std::vector< adj_map > conv_factor, std::vector< adj_map > norm_val)
Use test functions to determine the filetype and to create a new file object for the input file...
static const int BUFFER_SIZE
Base class for file parsing.
real *8 function offset(vNorm, x2, y2, z2)
bool check_bool_arr(bool test[], int size)
std::vector< string > readCommaExpression(string rStack, string rNeedle)
static bool testTecplot(ifstream &infile, string datapacking)
Test if a file is a tecplot file.
static void printFiletypes()
Print list valid filetypes to stdout.
bool check_non_numeric_str(string test_str)
Base class for tecplot files Implements useful functions for tecplot file parsing.