Block-Structured AMR Software Framework
amrex::DataServices Class Reference

#include <AMReX_DataServices.H>

Public Types

enum  DSRequestType {
  InvalidRequestType = 0 , ExitRequest , NewRequest , DeleteRequest ,
  FillVarOneFab , FillVarArrayOfFabs , FillVarMultiFab , WriteFabOneVar ,
  WriteFabAllVars , DumpSlicePlaneOneVar , DumpSlicePlaneAllVars , DumpSliceBoxOneVar ,
  DumpSliceBoxAllVars , MinMaxRequest , PointValueRequest , LineValuesRequest
}
 

Public Member Functions

 DataServices (const std::string &filename, const Amrvis::FileType &filetype)
 
 DataServices ()
 
 ~DataServices ()
 
void Init (const std::string &filename, const Amrvis::FileType &filetype)
 
void InitRegionTimeRanges ()
 
const std::string & GetFileName () const
 
Amrvis::FileType GetFileType () const
 
bool CanDerive (const std::string &name) const
 
bool CanDerive (const Vector< std::string > &names) const
 
int NumDeriveFunc () const
 
void ListDeriveFunc (std::ostream &os) const
 
const Vector< std::string > & PlotVarNames () const
 
AmrDataAmrDataRef ()
 
bool AmrDataOk ()
 
void SetWriteToLevel (const int iwtlev)
 
int GetNumberOfUsers () const
 
void IncrementNumberOfUsers ()
 
void DecrementNumberOfUsers ()
 

Static Public Member Functions

static void SetBatchMode ()
 
static void Dispatch (DSRequestType requestType, DataServices *ds,...)
 
static void SetFabOutSize (int iSize)
 

Private Member Functions

bool FillVar (FArrayBox *destFab, const Box &destBox, int finestFillLevel, const std::string &varname, int procWithFab)
 FillVarOneFab. More...
 
bool FillVar (MultiFab &destMultiFab, int finestFillLevel, const std::string &varname)
 FillVarMultiFab. More...
 
bool WriteFab (const std::string &fabfilename, const Box &region, int lev, const std::string &varname)
 WriteFabOneVar: write a single variable to one fab. More...
 
bool WriteFab (const std::string &fabfilename, const Box &region, int lev)
 WriteFabAllVars: write all vars in one fab. More...
 
bool DumpSlice (int slicedir, int slicenum, const std::string &varname)
 DumpSlicePlaneOneVar. More...
 
bool DumpSlice (int slicedir, int slicenum)
 DumpSlicePlaneAllVars. More...
 
bool DumpSlice (const Box &slicebox, const std::string &varname)
 DumpSliceBoxOneVar. More...
 
bool DumpSlice (const Box &slicebox)
 DumpSliceBoxAllVars. More...
 
bool MinMax (const Box &onBox, const std::string &derived, int level, Real &dataMin, Real &dataMax, bool &minMaxValid)
 MinMaxRequest. More...
 
void PointValue (int pointBoxArraySize, Box *pointBoxArray, const std::string &currentDerived, int coarsestLevelToSearch, int finestLevelToSearch, int &intersectedLevel, Box &intersectedGrid, Real &dataPointValue, bool &bPointIsValid)
 PointValueRequest. More...
 
void LineValues (int lineBoxArraySize, Box *lineBoxArray, int whichDir, const std::string &currentDerived, int coarsestLevelToSearch, int finestLevelToSearch, XYPlotDataList *dataList, bool &lineIsValid)
 LineValuesRequest. More...
 

Private Attributes

std::string fileName
 
Amrvis::FileType fileType
 
AmrData amrData
 
bool bAmrDataOk
 
int dsArrayIndex
 
int numberOfUsers
 
int iWriteToLevel
 

Static Private Attributes

static Vector< DataServices * > dsArray
 
static int dsArrayIndexCounter = 0
 
static int dsFabOutSize = 0
 
static bool dsBatchMode = false
 
static bool profiler = false
 

Member Enumeration Documentation

◆ DSRequestType

Enumerator
InvalidRequestType 
ExitRequest 
NewRequest 
DeleteRequest 
FillVarOneFab 
FillVarArrayOfFabs 
FillVarMultiFab 
WriteFabOneVar 
WriteFabAllVars 
DumpSlicePlaneOneVar 
DumpSlicePlaneAllVars 
DumpSliceBoxOneVar 
DumpSliceBoxAllVars 
MinMaxRequest 
PointValueRequest 
LineValuesRequest 

Constructor & Destructor Documentation

◆ DataServices() [1/2]

amrex::DataServices::DataServices ( const std::string &  filename,
const Amrvis::FileType filetype 
)

◆ DataServices() [2/2]

amrex::DataServices::DataServices ( )

◆ ~DataServices()

amrex::DataServices::~DataServices ( )

Member Function Documentation

◆ AmrDataOk()

bool amrex::DataServices::AmrDataOk ( )
inline

◆ AmrDataRef()

AmrData& amrex::DataServices::AmrDataRef ( )
inline

◆ CanDerive() [1/2]

bool amrex::DataServices::CanDerive ( const std::string &  name) const

◆ CanDerive() [2/2]

bool amrex::DataServices::CanDerive ( const Vector< std::string > &  names) const

◆ DecrementNumberOfUsers()

void amrex::DataServices::DecrementNumberOfUsers ( )
inline

◆ Dispatch()

void amrex::DataServices::Dispatch ( DSRequestType  requestType,
DataServices ds,
  ... 
)
static

◆ DumpSlice() [1/4]

bool amrex::DataServices::DumpSlice ( const Box slicebox)
private

DumpSliceBoxAllVars.

◆ DumpSlice() [2/4]

bool amrex::DataServices::DumpSlice ( const Box slicebox,
const std::string &  varname 
)
private

DumpSliceBoxOneVar.

◆ DumpSlice() [3/4]

bool amrex::DataServices::DumpSlice ( int  slicedir,
int  slicenum 
)
private

DumpSlicePlaneAllVars.

◆ DumpSlice() [4/4]

bool amrex::DataServices::DumpSlice ( int  slicedir,
int  slicenum,
const std::string &  varname 
)
private

DumpSlicePlaneOneVar.

◆ FillVar() [1/2]

bool amrex::DataServices::FillVar ( FArrayBox destFab,
const Box destBox,
int  finestFillLevel,
const std::string &  varname,
int  procWithFab 
)
private

FillVarOneFab.

◆ FillVar() [2/2]

bool amrex::DataServices::FillVar ( MultiFab destMultiFab,
int  finestFillLevel,
const std::string &  varname 
)
private

FillVarMultiFab.

◆ GetFileName()

const std::string& amrex::DataServices::GetFileName ( ) const
inline

◆ GetFileType()

Amrvis::FileType amrex::DataServices::GetFileType ( ) const
inline

◆ GetNumberOfUsers()

int amrex::DataServices::GetNumberOfUsers ( ) const
inline

◆ IncrementNumberOfUsers()

void amrex::DataServices::IncrementNumberOfUsers ( )
inline

◆ Init()

void amrex::DataServices::Init ( const std::string &  filename,
const Amrvis::FileType filetype 
)

◆ InitRegionTimeRanges()

void amrex::DataServices::InitRegionTimeRanges ( )

◆ LineValues()

void amrex::DataServices::LineValues ( int  lineBoxArraySize,
Box lineBoxArray,
int  whichDir,
const std::string &  currentDerived,
int  coarsestLevelToSearch,
int  finestLevelToSearch,
XYPlotDataList dataList,
bool &  lineIsValid 
)
private

LineValuesRequest.

◆ ListDeriveFunc()

void amrex::DataServices::ListDeriveFunc ( std::ostream &  os) const

◆ MinMax()

bool amrex::DataServices::MinMax ( const Box onBox,
const std::string &  derived,
int  level,
Real &  dataMin,
Real &  dataMax,
bool &  minMaxValid 
)
private

MinMaxRequest.

◆ NumDeriveFunc()

int amrex::DataServices::NumDeriveFunc ( ) const

◆ PlotVarNames()

const Vector<std::string>& amrex::DataServices::PlotVarNames ( ) const
inline

◆ PointValue()

void amrex::DataServices::PointValue ( int  pointBoxArraySize,
Box pointBoxArray,
const std::string &  currentDerived,
int  coarsestLevelToSearch,
int  finestLevelToSearch,
int intersectedLevel,
Box intersectedGrid,
Real &  dataPointValue,
bool &  bPointIsValid 
)
private

PointValueRequest.

◆ SetBatchMode()

void amrex::DataServices::SetBatchMode ( )
static

◆ SetFabOutSize()

void amrex::DataServices::SetFabOutSize ( int  iSize)
static

◆ SetWriteToLevel()

void amrex::DataServices::SetWriteToLevel ( const int  iwtlev)
inline

◆ WriteFab() [1/2]

bool amrex::DataServices::WriteFab ( const std::string &  fabfilename,
const Box region,
int  lev 
)
private

WriteFabAllVars: write all vars in one fab.

◆ WriteFab() [2/2]

bool amrex::DataServices::WriteFab ( const std::string &  fabfilename,
const Box region,
int  lev,
const std::string &  varname 
)
private

WriteFabOneVar: write a single variable to one fab.

Member Data Documentation

◆ amrData

AmrData amrex::DataServices::amrData
private

◆ bAmrDataOk

bool amrex::DataServices::bAmrDataOk
private

◆ dsArray

Vector< DataServices * > amrex::DataServices::dsArray
staticprivate

◆ dsArrayIndex

int amrex::DataServices::dsArrayIndex
private

◆ dsArrayIndexCounter

int amrex::DataServices::dsArrayIndexCounter = 0
staticprivate

◆ dsBatchMode

bool amrex::DataServices::dsBatchMode = false
staticprivate

◆ dsFabOutSize

int amrex::DataServices::dsFabOutSize = 0
staticprivate

◆ fileName

std::string amrex::DataServices::fileName
private

◆ fileType

Amrvis::FileType amrex::DataServices::fileType
private

◆ iWriteToLevel

int amrex::DataServices::iWriteToLevel
private

◆ numberOfUsers

int amrex::DataServices::numberOfUsers
private

◆ profiler

bool amrex::DataServices::profiler = false
staticprivate

The documentation for this class was generated from the following files: