// test_read_ucd.cc #include #include #include #define MAIN 1 #include "read_ucd.h" using namespace std; int main(int argc, char *argv[]) { char file_default[] = "ucd1.inp"; char file_name[100]; ifstream file_in; if(argc<2) strcpy(file_name,file_default); else strcpy(file_name, argv[1]); cout << "test_read_ucd.cc running on " << file_name << endl; file_in.open(file_name); if(!file_in) { cout << "can not open for reading " << file_name << endl; return 1; } read_ucd(file_in); // all data global in read_ucd.h cout << endl << endl << "read_ucd returned:" << endl; cout << "n_vertices = " << n_vertices << endl; cout << "n_cells = " << n_cells << endl; cout << "n_ndata = " << n_ndata << endl; cout << "n_cdata = " << n_cdata << endl; cout << "n_mdata = " << n_mdata << endl; cout << endl << "vertices" << endl; for(int i=0; i0) // have node data { cout << "node components " << nodecomp << " " << noden1; if(nodecomp>1) cout << " " << noden2; if(nodecomp>2) cout << " " << noden3; cout << endl; cout << nodes1 << endl; if(nodecomp>1) cout << nodes2 << endl; if(nodecomp>2) cout << nodes3 << endl; for(int i=0; i0) // have cell data { cout << "cell components " << cellcomp << " " << celln1; if(cellcomp>1) cout << " " << celln2; if(cellcomp>2) cout << " " << celln3; cout << endl; cout << cells1 << endl; if(cellcomp>1) cout << cells2 << endl; if(cellcomp>2) cout << cells3 << endl; for(int i=0; i0) // have model data { int numcomp; cout << "model components " << modelcomp << " " << modeln1; numcomp = modeln1; if(modelcomp>1) {numcomp += modeln2; cout << " " << modeln2;} if(modelcomp>2) {numcomp += modeln3; cout << " " << modeln3;} cout << endl; cout << models1 << endl; if(modelcomp>1) cout << models2 << endl; if(modelcomp>2) cout << models3 << endl; for(int i=0; i