MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
mfem::adios2stream Class Reference

#include <adios2stream.hpp>

Public Types

enum class  openmode { out , in , app }
 
enum class  mode { sync , deferred }
 
enum class  data_type { none , point_data , cell_data }
 

Public Member Functions

 adios2stream (const std::string &name, const openmode mode, MPI_Comm comm, const std::string engine_type="BPFile")
 
 adios2stream (const std::string &name, const openmode mode, const std::string engine_type="BPFile")
 
virtual ~adios2stream ()
 
void SetParameters (const std::map< std::string, std::string > &parameters=std::map< std::string, std::string >())
 
void SetParameter (const std::string key, const std::string value) noexcept
 
void BeginStep ()
 
void EndStep ()
 
void SetTime (const double time)
 
void SetCycle (const int cycle)
 
void SetRefinementLevel (const int level) noexcept
 
size_t CurrentStep () const
 
void Close ()
 

Protected Member Functions

void Print (const Mesh &mesh, const adios2stream::mode print_mode=mode::sync)
 
void Save (const GridFunction &grid_function, const std::string &variable_name, const data_type type)
 

Friends

class Vector
 
class GridFunction
 
class Mesh
 
class ADIOS2DataCollection
 

Detailed Description

Definition at line 47 of file adios2stream.hpp.

Member Enumeration Documentation

◆ data_type

enum class mfem::adios2stream::data_type
strong
Enumerator
none 
point_data 
cell_data 

Definition at line 66 of file adios2stream.hpp.

◆ mode

enum class mfem::adios2stream::mode
strong

Print and Save modes, deferred is done at Close or EndStep, sync is immediate

Enumerator
sync 
deferred 

Definition at line 64 of file adios2stream.hpp.

◆ openmode

enum class mfem::adios2stream::openmode
strong

Open modes for adios2stream (from std::fstream) out: write in: read app: append

Enumerator
out 
in 
app 

Definition at line 61 of file adios2stream.hpp.

Constructor & Destructor Documentation

◆ adios2stream() [1/2]

mfem::adios2stream::adios2stream ( const std::string &  name,
const openmode  mode,
MPI_Comm  comm,
const std::string  engine_type = "BPFile" 
)

adios2stream MPI constructor, allows for passing parameters in source code (compile-time) only.

Parameters
namestream name
modeadios2stream::openmode::in (Read), adios2stream::openmode::out (Write)
commMPI communicator establishing domain for fstream
engine_typeavailable adios2 engine, default is BPFile see https://adios2.readthedocs.io/en/latest/engines/engines.html
Exceptions
std::invalid_argument(user input error) or std::runtime_error (system error)

Definition at line 114 of file adios2stream.cpp.

◆ adios2stream() [2/2]

mfem::adios2stream::adios2stream ( const std::string &  name,
const openmode  mode,
const std::string  engine_type = "BPFile" 
)

adios2stream Non-MPI serial constructor, allows for passing parameters in source code (compile-time) only.

Parameters
namestream name
modeadios2stream::openmode::in (Read), adios2stream::openmode::out (Write)
engine_typeavailable adios2 engine, default is BPFile
Exceptions
std::invalid_argument(user input error) or std::runtime_error (system error)

Definition at line 124 of file adios2stream.cpp.

◆ ~adios2stream()

mfem::adios2stream::~adios2stream ( )
virtual

calls Close if stream is valid basically follows C++ RAII

Definition at line 135 of file adios2stream.cpp.

Member Function Documentation

◆ BeginStep()

void mfem::adios2stream::BeginStep ( )

Begins an I/O step

Definition at line 161 of file adios2stream.cpp.

◆ Close()

void mfem::adios2stream::Close ( )

Finished interaction with adios2stream and flushes the data

Definition at line 208 of file adios2stream.cpp.

◆ CurrentStep()

size_t mfem::adios2stream::CurrentStep ( ) const

Return the current step between BeginStep and EndStep

Definition at line 203 of file adios2stream.cpp.

◆ EndStep()

void mfem::adios2stream::EndStep ( )

Ends the current step, by default transports the data

Definition at line 171 of file adios2stream.cpp.

◆ Print()

void mfem::adios2stream::Print ( const Mesh mesh,
const adios2stream::mode  print_mode = mode::sync 
)
protected

Called from friend class Mesh (which is called from ParMesh)

Parameters
meshinput Mesh object to print
print_modesync: one at a time, deferred: collected (pre-fetch)

Definition at line 226 of file adios2stream.cpp.

◆ Save()

void mfem::adios2stream::Save ( const GridFunction grid_function,
const std::string &  variable_name,
const data_type  type 
)
protected

Definition at line 534 of file adios2stream.cpp.

◆ SetCycle()

void mfem::adios2stream::SetCycle ( const int  cycle)

Associates a current time step (cycle) with the current I/O step as CYCLE variable

Parameters
cyclephysical time

Definition at line 192 of file adios2stream.cpp.

◆ SetParameter()

void mfem::adios2stream::SetParameter ( const std::string  key,
const std::string  value 
)
noexcept

Single parameter version of SetParameters passing a key/value pair See https://adios2.readthedocs.io/en/latest/engines/engines.html

Parameters
keyinput parameter key
valueinput parameter value

Definition at line 151 of file adios2stream.cpp.

◆ SetParameters()

void mfem::adios2stream::SetParameters ( const std::map< std::string, std::string > &  parameters = std::map<std::string, std::string>())

Set parameters for a particular adios2stream Engine See https://adios2.readthedocs.io/en/latest/engines/engines.html

Parameters
parametersmap of key/value string elements

Definition at line 144 of file adios2stream.cpp.

◆ SetRefinementLevel()

void mfem::adios2stream::SetRefinementLevel ( const int  level)
noexcept

Input to the Global Geometry Refiner

Parameters
levelinput level

Definition at line 198 of file adios2stream.cpp.

◆ SetTime()

void mfem::adios2stream::SetTime ( const double  time)

Associates a physical time with the current I/O step as TIME variable

Parameters
timeinput physical time

Definition at line 185 of file adios2stream.cpp.

Friends And Related Function Documentation

◆ ADIOS2DataCollection

friend class ADIOS2DataCollection
friend

Definition at line 52 of file adios2stream.hpp.

◆ GridFunction

friend class GridFunction
friend

Definition at line 50 of file adios2stream.hpp.

◆ Mesh

friend class Mesh
friend

Definition at line 51 of file adios2stream.hpp.

◆ Vector

friend class Vector
friend

Definition at line 49 of file adios2stream.hpp.


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