aboutsummaryrefslogtreecommitdiff
path: root/src/AMRPlus/gridreadtest.C
blob: 8321d2d464afe03727233fd85b8992bb7bd27b75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// generated by Fast Light User Interface Designer (fluid) version 1.00

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <iostream.h>
#include "IEEEIO.hh"
#include "AMRgridreaderPlus.h"



int main(int argc, char** argv) {
    IObase *ifile, *ofile;
    AMRgridreaderPlus *reader;
   
    if (argc!=2){
	cerr<<"Usage:  <filename>"<<endl;
	exit(0);
    }
   char *fname=strdup(argv[1]);
   ifile=new IEEEIO(fname, IObase::Read);
   if (!ifile->isValid()){
	cerr<<fname<<" is not a valid IEEEIO file."<<endl;
	exit(0);
    }
    
    reader=new AMRgridreaderPlus(*ifile);
    int ii=0;
    AMRgridPlus grid, *tgrid;
    while ((tgrid=reader->getGridInfo(grid, ii))!=NULL){
	cout<<"ScalarRange: "<<grid.scalarmin<<" to "<<grid.scalarmax<<endl;
	ii++;
    }
   
    delete ifile;
 
    
    
}