diff options
author | tradke <tradke@21a6bef8-4479-4f54-8f8d-0db94a2919ef> | 2000-09-13 13:49:13 +0000 |
---|---|---|
committer | tradke <tradke@21a6bef8-4479-4f54-8f8d-0db94a2919ef> | 2000-09-13 13:49:13 +0000 |
commit | 8fe367ecf2cbda79960a68a052fdb84916427c0e (patch) | |
tree | 45c017765ab7f0eb6caf97540fc76ffd3bffba59 /src/AMRPlus/AMRfilereaderPlus.h | |
parent | c490022d592551af7c29bc960cbbc09daf45972d (diff) |
Importing latest stuff from development repository
git-svn-id: http://svn.cactuscode.org/arrangements/CactusExternal/FlexIO/trunk@2 21a6bef8-4479-4f54-8f8d-0db94a2919ef
Diffstat (limited to 'src/AMRPlus/AMRfilereaderPlus.h')
-rw-r--r-- | src/AMRPlus/AMRfilereaderPlus.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/src/AMRPlus/AMRfilereaderPlus.h b/src/AMRPlus/AMRfilereaderPlus.h new file mode 100644 index 0000000..a90569d --- /dev/null +++ b/src/AMRPlus/AMRfilereaderPlus.h @@ -0,0 +1,74 @@ +// AmrFileReader +#ifndef __AMRFILEREADERPLUS_HH_ +#define __AMRFILEREADERPLUS_HH_ +#include <stdio.h> +#include <IO.hh> +#include "AMRgridreaderPlus.h" +#include "FlexArrayTmpl.H" + +class AMRfilereaderPlus : public AMRgridreaderPlus { +protected: + int gridloading; + FlexArray<int> activeGrids; + FlexArray<AMRgridPlus> grids; + FlexArray<int> levelmask; + IObase::DataType datatype; + int maxlevel,maxtimeres,mintime,maxtime; + double smax, smin; + double bounds[6]; + int current_time; + // Internal Utility methods + void buildInfoTable(); + void loadGrids(); + void reclaimGrids(); + void purgeGrids(); + void printGridInfo(AMRgridPlus &g); +public: + int debug; + void printGridInfo(); + void printActiveGrids(); + AMRfilereaderPlus(IObase &f); + int getNumLevels(){ return maxlevel+1; } + void getTimeRange(int &min,int &max){ + min=mintime; + max=maxtime; + } + void getScalarRange(double &min, double &max){ + min=smin;max=smax; + } + void getBounds(double *bnds){for (int ii=0;ii<6;ii++){bnds[ii]=bounds[ii];}} + void setTime(int timestep); + // starts out with all selected + void showLevel(int level=-1){ // default is all (-1) + if(level>=levelmask.getSize() || level<0){ + printf("AmrConvert::showLevel(%u) : Level out of range 0:%u\n", + level,levelmask.getSize()-1); + } + else + levelmask[level]=1; + } + void showAllLevels(); + void hideAllLevels(){for (int ii=0;ii<maxlevel+1;ii++)hideLevel(ii);} + void hideLevel(int level=-1){ // default is all (-1) + if(level>=levelmask.getSize() || level<0){ + printf("AmrConvert::showLevel(%u) : Level out of range 0:%u\n", + level,levelmask.getSize()-1); + } + else + levelmask[level]=0; + } + int nLevels(){ return maxlevel+1; } + IObase::DataType getDataType(){return datatype;} + // For C interface + int getNumGrids(){ // number of active grids + return activeGrids.getSize(); + } + int getActiveIndex(int ii){ return activeGrids[ii];} + int getGrids(AMRgridPlus *g); + // For C++ interface + int getGrids(FlexArray<AMRgridPlus> &g); + void setDataLoadingOff(){ gridloading=0; purgeGrids();} + void setDataLoadingOn(){ gridloading=1; loadGrids();} +}; + +#endif |