aboutsummaryrefslogtreecommitdiff
path: root/src/AMRPlus/AMRgridreaderPlus.h
blob: fc6f797a9fd6e14963a20bc6df8dca7b68f03e3a (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
41
#ifndef __AMRGRIDREADERPLUS_HH_
#define __AMRGRIDREADERPLUS_HH_

#include <IO.hh>
#include "AMRgridPlus.h"
#include "IEEEIO.hh"


class AMRgridreaderPlus {
protected:
    IObase &file;
  
public:
    AMRgridreaderPlus(IObase &f) : file(f){};
    ~AMRgridreaderPlus(){};
  
    /* 
     * Low level grid/info fetching routines 
     */
    AMRgridPlus *getGrid(AMRgridPlus &g,int index){
	if(file.seek(index)<index)
	return 0; // don't load past end
	getGridInfo(g,index);
	getGridData(g,index);
	return &g;
    }
    AMRgridPlus *getGrid(int index){
	AMRgridPlus *g=new AMRgridPlus;
	return this->getGrid(*g,index);
    }
  
    AMRgridPlus *getGridInfo(AMRgridPlus &g,int index);
    AMRgridPlus *getGridData(AMRgridPlus &g,int index);


 

};


#endif