WarpX
Public Member Functions | Private Member Functions | Private Attributes | List of all members
BTDMultiFabHeaderImpl Class Reference

Class to read, modify, and write MultiFab header in Level_0/Cell_H when back-transformed diag format is selected as plotfile. This class enables multiple fabs to be interweaved and stitched into a single plotfile with a single Header, Cell_H. More...

#include <BTD_Plotfile_Header_Impl.H>

Public Member Functions

 BTDMultiFabHeaderImpl (std::string const &Headerfile_path)
 
void ReadMultiFabHeader ()
 
void WriteMultiFabHeader ()
 
int ba_size () const
 
amrex::Box ba_box (int ibox) const
 
std::string fodPrefix (int ifab)
 
std::string FabName (int ifab)
 
int FabHead (int ifab)
 
amrex::Vector< amrex::Real > minval (int ifab)
 
amrex::Vector< amrex::Real > maxval (int ifab)
 
void ResizeFabData ()
 
void IncreaseMultiFabSize (int add_mf_size)
 
void SetBox (int ibox, amrex::Box ba_box)
 
void SetFabName (int ifab, const std::string &fodPrefix, const std::string &FabName, int FabHead)
 
void SetMinVal (int ifab, const amrex::Vector< amrex::Real > &minval)
 
void SetMaxVal (int ifab, const amrex::Vector< amrex::Real > &maxval)
 

Private Member Functions

void CopyVec (amrex::Vector< amrex::Real > &dst, amrex::Vector< amrex::Real > src)
 

Private Attributes

std::string m_Header_path
 
int m_vers
 
int m_how
 
int m_ncomp
 
int m_ngrow
 
int m_ba_size
 
amrex::BoxArray m_ba
 
amrex::Vector< std::string > m_FabOnDiskPrefix
 
amrex::Vector< std::string > m_fabname
 
amrex::Vector< intm_fabhead
 
amrex::Vector< amrex::Vector< amrex::Real > > m_minval
 
amrex::Vector< amrex::Vector< amrex::Real > > m_maxval
 

Detailed Description

Class to read, modify, and write MultiFab header in Level_0/Cell_H when back-transformed diag format is selected as plotfile. This class enables multiple fabs to be interweaved and stitched into a single plotfile with a single Header, Cell_H.

Constructor & Destructor Documentation

◆ BTDMultiFabHeaderImpl()

BTDMultiFabHeaderImpl::BTDMultiFabHeaderImpl ( std::string const &  Headerfile_path)

Constructor.

Parameters
[in]Headerfile_pathstring containing path of Headerfile

Member Function Documentation

◆ ba_box()

amrex::Box BTDMultiFabHeaderImpl::ba_box ( int  ibox) const
inline

Returns box corresponding to the ith box in the BoxArray, m_ba.

Parameters
[in]iboxindex of the box in the BoxArray.

◆ ba_size()

int BTDMultiFabHeaderImpl::ba_size ( ) const
inline

Returns size, m_ba_size, of the Box Array, m_ba.

◆ CopyVec()

void BTDMultiFabHeaderImpl::CopyVec ( amrex::Vector< amrex::Real > &  dst,
amrex::Vector< amrex::Real >  src 
)
private

Copy values of the vector from the src vector, src, to dst vector.

◆ FabHead()

int BTDMultiFabHeaderImpl::FabHead ( int  ifab)
inline

Returns the starting byte of the ith fab data

◆ FabName()

std::string BTDMultiFabHeaderImpl::FabName ( int  ifab)
inline

Returns name of the ith fab stored in the MultiFab.

◆ fodPrefix()

std::string BTDMultiFabHeaderImpl::fodPrefix ( int  ifab)
inline

Returns prefix of the ith-fab on disk, i.e., ith fab of the MultiFab data.

Parameters
[in]ifabindex of the ith fab in the MultiFab data.

◆ IncreaseMultiFabSize()

void BTDMultiFabHeaderImpl::IncreaseMultiFabSize ( int  add_mf_size)
inline

Increments MultiFab size, m_ba_size, by add_mf_size.

Parameters
[in]add_mf_sizenumber of new multifabs to be appended to the existing Box Array.

◆ maxval()

amrex::Vector<amrex::Real> BTDMultiFabHeaderImpl::maxval ( int  ifab)
inline

Returns maximum value of all the components stored in the ith fab.

◆ minval()

amrex::Vector<amrex::Real> BTDMultiFabHeaderImpl::minval ( int  ifab)
inline

Returns minimum value of all the components stored in the ith fab.

◆ ReadMultiFabHeader()

void BTDMultiFabHeaderImpl::ReadMultiFabHeader ( )

Reads the Multifab Header file and stores its data.

◆ ResizeFabData()

void BTDMultiFabHeaderImpl::ResizeFabData ( )

◆ SetBox()

void BTDMultiFabHeaderImpl::SetBox ( int  ibox,
amrex::Box  ba_box 
)
inline

Set Box indices of the ith-box in Box Array, m_ba, to the new Box, ba_box.

Parameters
[in]iboxindex of the ith box in BoxArray, m_ba.
[in]ba_boxdimensions corresponding to the ith Fab.

◆ SetFabName()

void BTDMultiFabHeaderImpl::SetFabName ( int  ifab,
const std::string &  fodPrefix,
const std::string &  FabName,
int  FabHead 
)

Set Fab name of the ith fab to be written in the multifab Header file.

◆ SetMaxVal()

void BTDMultiFabHeaderImpl::SetMaxVal ( int  ifab,
const amrex::Vector< amrex::Real > &  maxval 
)

Set maximum value of all the components for the ith fab.

◆ SetMinVal()

void BTDMultiFabHeaderImpl::SetMinVal ( int  ifab,
const amrex::Vector< amrex::Real > &  minval 
)

Set minimum value of all the components for the ith fab.

◆ WriteMultiFabHeader()

void BTDMultiFabHeaderImpl::WriteMultiFabHeader ( )

Writes the meta-data of the Multifab in a header file, with path, m_Header_path.

Member Data Documentation

◆ m_ba

amrex::BoxArray BTDMultiFabHeaderImpl::m_ba
private

BoxArray corresponding to the multifab stored in the plotfile.

◆ m_ba_size

int BTDMultiFabHeaderImpl::m_ba_size
private

Size of the BoxArray, m_ba.

◆ m_fabhead

amrex::Vector<int> BTDMultiFabHeaderImpl::m_fabhead
private

◆ m_fabname

amrex::Vector<std::string> BTDMultiFabHeaderImpl::m_fabname
private

◆ m_FabOnDiskPrefix

amrex::Vector<std::string> BTDMultiFabHeaderImpl::m_FabOnDiskPrefix
private

◆ m_Header_path

std::string BTDMultiFabHeaderImpl::m_Header_path
private

Header file path

◆ m_how

int BTDMultiFabHeaderImpl::m_how
private

◆ m_maxval

amrex::Vector<amrex::Vector< amrex::Real> > BTDMultiFabHeaderImpl::m_maxval
private

The max of each component of each FAB in the BoxArray, m_ba. To access the max value of the ith fab and jth component [ifab][jcomp]

◆ m_minval

amrex::Vector<amrex::Vector< amrex::Real> > BTDMultiFabHeaderImpl::m_minval
private

The min of each component of each FAB in the BoxArray, m_ba. To access the min value of the ith fab and jth component [ifab][jcomp]

◆ m_ncomp

int BTDMultiFabHeaderImpl::m_ncomp
private

number of components stored in the multifab.

◆ m_ngrow

int BTDMultiFabHeaderImpl::m_ngrow
private

number of guard cells in the multifab.

◆ m_vers

int BTDMultiFabHeaderImpl::m_vers
private

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