checkphasta.cpp (bafa09fe4fc9bd65c1207eb53dff688d524ebdb8) checkphasta.cpp (0acf31340f71df8bc009a2ed35a7afafe8e00a89)
1#include <cstdio>
2#include <cstdlib>
3#include <cassert>
4#include <cstring>
5#include <cmath>
6#include <string>
7#include <vector>
8#include <algorithm>

--- 120 unchanged lines hidden (view full) ---

129 const char* iformat = "binary";
130 int ithree=3;
131 int igeombc;
132 char* fn;
133 int nshg;
134 int ndof;
135 double* solution;
136 const char* rname = getRestartName(nSyncFiles);
1#include <cstdio>
2#include <cstdlib>
3#include <cassert>
4#include <cstring>
5#include <cmath>
6#include <string>
7#include <vector>
8#include <algorithm>

--- 120 unchanged lines hidden (view full) ---

129 const char* iformat = "binary";
130 int ithree=3;
131 int igeombc;
132 char* fn;
133 int nshg;
134 int ndof;
135 double* solution;
136 const char* rname = getRestartName(nSyncFiles);
137 asprintf(&fn,"%s/%s.%d",casedir,rname,timestep);
137 asprintf(&fn,"%s/%s.%d.",casedir,rname,timestep);
138 phio_fp fp;
139 phio_openfile_read(fn,&nSyncFiles,&fp);
140 phio_readheader(fp, "solution", (void*) iarray, &ithree, "integer", iformat);
141 nshg = iarray[0];
142 ndof = iarray[1];
143 if(size != NULL)
144 *size = nshg*ndof;
145 solution = (double*) malloc(sizeof(double)*nshg*ndof);

--- 22 unchanged lines hidden (view full) ---

168 if(!dir)
169 {
170 perror("Error opening case: ");
171 MPI_Abort(MPI_COMM_WORLD,1);
172 }
173 const char* rname = getRestartName(nSyncFiles);
174 char* fmt;
175 asprintf(&fmt, "%s.%%d.%%d", rname);
138 phio_fp fp;
139 phio_openfile_read(fn,&nSyncFiles,&fp);
140 phio_readheader(fp, "solution", (void*) iarray, &ithree, "integer", iformat);
141 nshg = iarray[0];
142 ndof = iarray[1];
143 if(size != NULL)
144 *size = nshg*ndof;
145 solution = (double*) malloc(sizeof(double)*nshg*ndof);

--- 22 unchanged lines hidden (view full) ---

168 if(!dir)
169 {
170 perror("Error opening case: ");
171 MPI_Abort(MPI_COMM_WORLD,1);
172 }
173 const char* rname = getRestartName(nSyncFiles);
174 char* fmt;
175 asprintf(&fmt, "%s.%%d.%%d", rname);
176 fprintf(stderr, "fmt %s\n", fmt);
177 while((d=readdir(dir)))
178 {
176 while((d=readdir(dir)))
177 {
179 if(sscanf(d->d_name, "restart.%d.%d", &ts, &part)==2)
178 if(sscanf(d->d_name, fmt, &ts, &part)==2)
180 {
181 step_list->insert(ts);
182 }
183 }
184 free(fmt);
185 free(path);
186 return(step_list);
187}

--- 14 unchanged lines hidden ---
179 {
180 step_list->insert(ts);
181 }
182 }
183 free(fmt);
184 free(path);
185 return(step_list);
186}

--- 14 unchanged lines hidden ---