Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
Input/Output

AMReX I/O interfaces. More...

Classes

class  amrex::PlotFileData
 
class  amrex::VisMF
 File I/O for FabArray<FArrayBox>. Wrapper class for reading/writing FabArray<FArrayBox> objects to disk in various "smart" ways. More...
 
struct  amrex::AsyncOut::WriteInfo
 Slot assignment metadata for ranks sharing an output file. More...
 

Functions

virtual void amrex::Amr::writePlotFile ()
 Write a full-resolution plot file to disk using the current hierarchy state.
 
virtual void amrex::Amr::checkPoint ()
 Write current state into a chk* checkpoint directory.
 
void amrex::AsyncOut::Initialize ()
 Initialize the asynchronous output infrastructure.
 
void amrex::AsyncOut::Finalize ()
 Tear down resources owned by the asynchronous output subsystem.
 
bool amrex::AsyncOut::UseAsyncOut ()
 Query whether asynchronous output is enabled at runtime.
 
WriteInfo amrex::AsyncOut::GetWriteInfo (int rank)
 Compute this rank's write slot information for multi-file output.
 
void amrex::AsyncOut::Submit (std::function< void()> &&a_f)
 Submit a job functor to the asynchronous writer thread.
 
void amrex::AsyncOut::Submit (std::function< void()> const &a_f)
 
void amrex::AsyncOut::Finish ()
 Block until all submitted asynchronous jobs have completed.
 
void amrex::AsyncOut::Wait ()
 Called inside a submitted user job function to wait for this rank's turn to access the file.
 
void amrex::AsyncOut::Notify ()
 Called inside a submitted user job function to notify the next rank sharing the file that it may proceed.
 
void amrex::WriteMultiLevelPlotfile (const std::string &plotfilename, int nlevels, const Vector< const MultiFab * > &mf, const Vector< std::string > &varnames, const Vector< Geometry > &geom, Real time, const Vector< int > &level_steps, const Vector< IntVect > &ref_ratio, const std::string &versionName="HyperCLaw-V1.1", const std::string &levelPrefix="Level_", const std::string &mfPrefix="Cell", const Vector< std::string > &extra_dirs=Vector< std::string >())
 
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::Checkpoint (const std::string &dir, const std::string &name, bool is_checkpoint, const Vector< std::string > &real_comp_names=Vector< std::string >(), const Vector< std::string > &int_comp_names=Vector< std::string >()) const
 Writes a particle checkpoint to file, suitable for restarting. This version allows the particle component names to be passed in. This overload exists for backwards compatibility. The is_checkpoint parameter is ignored.
 
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::WritePlotFile (const std::string &dir, const std::string &name) const
 This version of WritePlotFile writes all components and assigns component names.
 
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::WritePlotFile (const std::string &dir, const std::string &name, const Vector< std::string > &real_comp_names, const Vector< std::string > &int_comp_names) const
 This version of WritePlotFile writes all components and allows the user to specify the names of the components.
 
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::WritePlotFile (const std::string &dir, const std::string &name, const Vector< std::string > &real_comp_names) const
 This version of WritePlotFile writes all components and allows the user to specify the names of the components.
 
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::WritePlotFile (const std::string &dir, const std::string &name, const Vector< int > &write_real_comp, const Vector< int > &write_int_comp) const
 This version of WritePlotFile assigns component names, but allows the user to pass in a vector of ints that toggle on / off the writing of specific components.
 
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::WritePlotFile (const std::string &dir, const std::string &name, const Vector< int > &write_real_comp, const Vector< int > &write_int_comp, const Vector< std::string > &real_comp_names, const Vector< std::string > &int_comp_names) const
 This is the most general version of WritePlotFile, which takes component names and flags for whether to write each variable as components. Note that the user should pass in vectors containing names of all the components, whether they are written or not.
 
template<class F >
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::WritePlotFile (const std::string &dir, const std::string &name, F const &f) const
 This version of WritePlotFile writes all components and assigns component names.
 
template<class F >
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::WritePlotFile (const std::string &dir, const std::string &name, const Vector< std::string > &real_comp_names, const Vector< std::string > &int_comp_names, F const &f) const
 This version of WritePlotFile writes all components and allows the user to specify the names of the components.
 
template<class F >
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::WritePlotFile (const std::string &dir, const std::string &name, const Vector< std::string > &real_comp_names, F const &f) const
 This version of WritePlotFile writes all components and allows the user to specify the names of the components.
 
template<class F >
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::WritePlotFile (const std::string &dir, const std::string &name, const Vector< int > &write_real_comp, const Vector< int > &write_int_comp, F const &f) const
 This version of WritePlotFile assigns component names, but allows the user to pass in a vector of ints that toggle on / off the writing of specific components.
 
template<class F >
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::WritePlotFile (const std::string &dir, const std::string &name, const Vector< int > &write_real_comp, const Vector< int > &write_int_comp, const Vector< std::string > &real_comp_names, const Vector< std::string > &int_comp_names, F const &f) const
 This is the most general version of WritePlotFile, which takes component names and flags for whether to write each variable as components. Note that the user should pass in vectors containing names of all the components, whether they are written or not.
 

Detailed Description

AMReX I/O interfaces.

This covers I/O related topics.

Central utility functions and classes include:

Function Documentation

◆ checkPoint()

void amrex::Amr::checkPoint ( )
virtual

Write current state into a chk* checkpoint directory.

◆ Checkpoint()

template<typename ParticleType , int NArrayReal, int NArrayInt, template< class > class Allocator, class CellAssignor >
void amrex::ParticleContainer_impl< ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor >::Checkpoint ( const std::string &  dir,
const std::string &  name,
bool  is_checkpoint,
const Vector< std::string > &  real_comp_names = Vector<std::string>(),
const Vector< std::string > &  int_comp_names = Vector<std::string>() 
) const

Writes a particle checkpoint to file, suitable for restarting. This version allows the particle component names to be passed in. This overload exists for backwards compatibility. The is_checkpoint parameter is ignored.

◆ Finalize()

void amrex::AsyncOut::Finalize ( )

Tear down resources owned by the asynchronous output subsystem.

◆ Finish()

void amrex::AsyncOut::Finish ( )

Block until all submitted asynchronous jobs have completed.

◆ GetWriteInfo()

WriteInfo amrex::AsyncOut::GetWriteInfo ( int  rank)

Compute this rank's write slot information for multi-file output.

Parameters
rankMPI rank requesting metadata.
Returns
WriteInfo describing file index, slot, and slots per file.

◆ Initialize()

void amrex::AsyncOut::Initialize ( )

Initialize the asynchronous output infrastructure.

◆ Notify()

void amrex::AsyncOut::Notify ( )

Called inside a submitted user job function to notify the next rank sharing the file that it may proceed.

◆ Submit() [1/2]

void amrex::AsyncOut::Submit ( std::function< void()> &&  a_f)

Submit a job functor to the asynchronous writer thread.

Parameters
a_fFunctor that performs the output operations.

◆ Submit() [2/2]

void amrex::AsyncOut::Submit ( std::function< void()> const &  a_f)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ UseAsyncOut()

bool amrex::AsyncOut::UseAsyncOut ( )

Query whether asynchronous output is enabled at runtime.

◆ Wait()

void amrex::AsyncOut::Wait ( )

Called inside a submitted user job function to wait for this rank's turn to access the file.

This is not for waiting for the job to finish; use Finish() for that.

◆ WriteMultiLevelPlotfile()

void amrex::WriteMultiLevelPlotfile ( const std::string &  plotfilename,
int  nlevels,
const Vector< const MultiFab * > &  mf,
const Vector< std::string > &  varnames,
const Vector< Geometry > &  geom,
Real  time,
const Vector< int > &  level_steps,
const Vector< IntVect > &  ref_ratio,
const std::string &  versionName,
const std::string &  levelPrefix,
const std::string &  mfPrefix,
const Vector< std::string > &  extra_dirs 
)

◆ writePlotFile()

void amrex::Amr::writePlotFile ( )
virtual

Write a full-resolution plot file to disk using the current hierarchy state.

◆ WritePlotFile() [1/10]

template<typename ParticleType , int NArrayReal, int NArrayInt, template< class > class Allocator, class CellAssignor >
void amrex::ParticleContainer_impl< ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor >::WritePlotFile ( const std::string &  dir,
const std::string &  name 
) const

This version of WritePlotFile writes all components and assigns component names.

Parameters
dirThe base directory into which to write (i.e. "plt00000")
nameThe name of the sub-directory for this particle type (i.e. "Tracer")

◆ WritePlotFile() [2/10]

template<typename ParticleType , int NArrayReal, int NArrayInt, template< class > class Allocator, class CellAssignor >
void amrex::ParticleContainer_impl< ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor >::WritePlotFile ( const std::string &  dir,
const std::string &  name,
const Vector< int > &  write_real_comp,
const Vector< int > &  write_int_comp 
) const

This version of WritePlotFile assigns component names, but allows the user to pass in a vector of ints that toggle on / off the writing of specific components.

Parameters
dirThe base directory into which to write (i.e. "plt00000")
nameThe name of the sub-directory for this particle type (i.e. "Tracer")
write_real_compfor each real component, whether to include that comp in the file
write_int_compfor each integer component, whether to include that comp in the file

◆ WritePlotFile() [3/10]

template<typename ParticleType , int NArrayReal, int NArrayInt, template< class > class Allocator, class CellAssignor >
void amrex::ParticleContainer_impl< ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor >::WritePlotFile ( const std::string &  dir,
const std::string &  name,
const Vector< int > &  write_real_comp,
const Vector< int > &  write_int_comp,
const Vector< std::string > &  real_comp_names,
const Vector< std::string > &  int_comp_names 
) const

This is the most general version of WritePlotFile, which takes component names and flags for whether to write each variable as components. Note that the user should pass in vectors containing names of all the components, whether they are written or not.

Parameters
dirThe base directory into which to write (i.e. "plt00000")
nameThe name of the sub-directory for this particle type (i.e. "Tracer")
write_real_compfor each real component, whether to include that comp in the file
write_int_compfor each integer component, whether to include that comp in the file
real_comp_namesfor each real component, a name to label the data with
int_comp_namesfor each integer component, a name to label the data with

◆ WritePlotFile() [4/10]

template<typename ParticleType , int NArrayReal, int NArrayInt, template< class > class Allocator, class CellAssignor >
template<class F >
void amrex::ParticleContainer_impl< ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor >::WritePlotFile ( const std::string &  dir,
const std::string &  name,
const Vector< int > &  write_real_comp,
const Vector< int > &  write_int_comp,
const Vector< std::string > &  real_comp_names,
const Vector< std::string > &  int_comp_names,
F const &  f 
) const

This is the most general version of WritePlotFile, which takes component names and flags for whether to write each variable as components. Note that the user should pass in vectors containing names of all the components, whether they are written or not.

This version also lets you pass in a functor to toggle whether each particle gets output.

Template Parameters
Ffunction type
Parameters
dirThe base directory into which to write (i.e. "plt00000")
nameThe name of the sub-directory for this particle type (i.e. "Tracer")
write_real_compfor each real component, whether to include that comp in the file
write_int_compfor each integer component, whether to include that comp in the file
real_comp_namesfor each real component, a name to label the data with
int_comp_namesfor each integer component, a name to label the data with
fcallable that returns whether or not to write each particle

◆ WritePlotFile() [5/10]

template<typename ParticleType , int NArrayReal, int NArrayInt, template< class > class Allocator, class CellAssignor >
template<class F >
void amrex::ParticleContainer_impl< ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor >::WritePlotFile ( const std::string &  dir,
const std::string &  name,
const Vector< int > &  write_real_comp,
const Vector< int > &  write_int_comp,
F const &  f 
) const

This version of WritePlotFile assigns component names, but allows the user to pass in a vector of ints that toggle on / off the writing of specific components.

This version also lets you pass in a functor to toggle whether each particle gets output.

Template Parameters
Ffunction type
Parameters
dirThe base directory into which to write (i.e. "plt00000")
nameThe name of the sub-directory for this particle type (i.e. "Tracer")
write_real_compfor each real component, whether to include that comp in the file
write_int_compfor each integer component, whether to include that comp in the file
fcallable that returns whether or not to write each particle

◆ WritePlotFile() [6/10]

template<typename ParticleType , int NArrayReal, int NArrayInt, template< class > class Allocator, class CellAssignor >
void amrex::ParticleContainer_impl< ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor >::WritePlotFile ( const std::string &  dir,
const std::string &  name,
const Vector< std::string > &  real_comp_names 
) const

This version of WritePlotFile writes all components and allows the user to specify the names of the components.

Parameters
dirThe base directory into which to write (i.e. "plt00000")
nameThe name of the sub-directory for this particle type (i.e. "Tracer")
real_comp_namesfor each real component, a name to label the data with

◆ WritePlotFile() [7/10]

template<typename ParticleType , int NArrayReal, int NArrayInt, template< class > class Allocator, class CellAssignor >
void amrex::ParticleContainer_impl< ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor >::WritePlotFile ( const std::string &  dir,
const std::string &  name,
const Vector< std::string > &  real_comp_names,
const Vector< std::string > &  int_comp_names 
) const

This version of WritePlotFile writes all components and allows the user to specify the names of the components.

Parameters
dirThe base directory into which to write (i.e. "plt00000")
nameThe name of the sub-directory for this particle type (i.e. "Tracer")
real_comp_namesfor each real component, a name to label the data with
int_comp_namesfor each integer component, a name to label the data with

◆ WritePlotFile() [8/10]

template<typename ParticleType , int NArrayReal, int NArrayInt, template< class > class Allocator, class CellAssignor >
template<class F >
void amrex::ParticleContainer_impl< ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor >::WritePlotFile ( const std::string &  dir,
const std::string &  name,
const Vector< std::string > &  real_comp_names,
const Vector< std::string > &  int_comp_names,
F const &  f 
) const

This version of WritePlotFile writes all components and allows the user to specify the names of the components.

This version also lets you pass in a functor to toggle whether each particle gets output.

Template Parameters
Ffunction type
Parameters
dirThe base directory into which to write (i.e. "plt00000")
nameThe name of the sub-directory for this particle type (i.e. "Tracer")
real_comp_namesfor each real component, a name to label the data with
int_comp_namesfor each integer component, a name to label the data with
fcallable that returns whether or not to write each particle

◆ WritePlotFile() [9/10]

template<typename ParticleType , int NArrayReal, int NArrayInt, template< class > class Allocator, class CellAssignor >
template<class F >
void amrex::ParticleContainer_impl< ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor >::WritePlotFile ( const std::string &  dir,
const std::string &  name,
const Vector< std::string > &  real_comp_names,
F const &  f 
) const

This version of WritePlotFile writes all components and allows the user to specify the names of the components.

This version also lets you pass in a functor to toggle whether each particle gets output.

Template Parameters
Ffunction type
Parameters
dirThe base directory into which to write (i.e. "plt00000")
nameThe name of the sub-directory for this particle type (i.e. "Tracer")
real_comp_namesfor each real component, a name to label the data with
fcallable that returns whether or not to write each particle

◆ WritePlotFile() [10/10]

template<typename ParticleType , int NArrayReal, int NArrayInt, template< class > class Allocator, class CellAssignor >
template<class F >
void amrex::ParticleContainer_impl< ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor >::WritePlotFile ( const std::string &  dir,
const std::string &  name,
F const &  f 
) const

This version of WritePlotFile writes all components and assigns component names.

This version also lets you pass in a functor to toggle whether each particle gets output.

Template Parameters
Ffunction type
Parameters
dirThe base directory into which to write (i.e. "plt00000")
nameThe name of the sub-directory for this particle type (i.e. "Tracer")
fcallable that returns whether or not to write each particle