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...
 

Functions

virtual void amrex::Amr::writePlotFile ()
 
virtual void amrex::Amr::checkPoint ()
 
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 , std::enable_if_t<!std::is_same_v< std::decay_t< F >, Vector< std::string > > > * = nullptr>
void amrex::ParticleContainer_impl< T_ParticleType, T_NArrayReal, T_NArrayInt, Allocator, T_CellAssignor >::WritePlotFile (const std::string &dir, const std::string &name, F &&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 &&f) const
 This version of WritePlotFile writes all components and allows the user to specify the names of the components.
 
template<class F , std::enable_if_t<!std::is_same_v< std::decay_t< F >, Vector< std::string > > > * = nullptr>
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 &&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 &&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 &&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* file.

◆ 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.

◆ 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 the plot file to be used for visualization.

◆ 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 &&  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 &&  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 &&  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 , std::enable_if_t<!std::is_same_v< std::decay_t< F >, Vector< std::string > > > * >
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 &&  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 , std::enable_if_t<!std::is_same_v< std::decay_t< F >, Vector< std::string > > > * >
void amrex::ParticleContainer_impl< ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor >::WritePlotFile ( const std::string &  dir,
const std::string &  name,
F &&  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