IOManager Class Reference

AMR-Wind API: amr_wind::IOManager Class Reference
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches

#include <IOManager.H>

Collaboration diagram for amr_wind::IOManager:
[legend]

Public Member Functions

 IOManager (CFDSim &)
 
 ~IOManager ()
 
 IOManager (const IOManager &)=delete
 
IOManageroperator= (const IOManager &)=delete
 
void initialize_io ()
 Process user inputs and perform one-time initialization tasks.
 
void write_plot_file ()
 Write all user-requested fields to disk.
 
void write_checkpoint_file (const int start_level=0, const int end_level=-1)
 Write all necessary fields for restart.
 
void read_checkpoint_fields (const std::string &restart_file, const amrex::Vector< amrex::BoxArray > &ba_chk, const amrex::Vector< amrex::DistributionMapping > &dm_chk, const amrex::IntVect &rep)
 Read all necessary fields for a restart.
 
void register_output_var (const std::string &fname)
 Register a variable for output.
 
void register_output_int_var (const std::string &fname)
 
void register_restart_var (const std::string &fname)
 Register a variable for restart file.
 
void register_io_var (const std::string &fname)
 Convenience function to register a variable for both output and restart.
 
const std::string & restart_file ()
 Name of the checkpoint file to be read during a restart.
 
bool is_restart () const
 
const amrex::Vector< Field * > & plot_fields () const
 
const amrex::Vector< Field * > & checkpoint_fields () const
 
const std::string & post_processing_directory ()
 Name of the post processing directory.
 

Private Member Functions

void write_header (const std::string &, const int start_level, const int end_level)
 
void write_info_file (const std::string &)
 

Private Attributes

CFDSimm_sim
 
std::unique_ptr< DerivedQtyMgrm_derived_mgr
 
std::set< std::string > m_pltvars_default
 Default output variables registered automatically in the code.
 
std::set< std::string > m_int_pltvars_default
 Default output integer variables registered automatically in the code.
 
std::set< std::string > m_chkvars
 Variables for output in checkpoint/restart files.
 
amrex::Vector< Field * > m_plt_fields
 Final list of fields to be output.
 
amrex::Vector< IntField * > m_int_plt_fields
 Final list of integer fields to be output.
 
amrex::Vector< Field * > m_chk_fields
 Final list of fields for restart.
 
amrex::Vector< std::string > m_plt_var_names
 Variable names (including components) for output.
 
std::string m_plt_prefix {"plt"}
 Prefix used for the plot file directories.
 
std::string m_chk_prefix {"chk"}
 Prefix used for the restart file directories.
 
std::string m_post_dir {"post_processing"}
 Name for the post_processing directory.
 
std::string m_restart_file
 Restart file name.
 
int m_plt_num_comp {0}
 Total number of variables (including components) output to plot file.
 
bool m_output_default_vars {true}
 Flag indicating whether default fields should be output.
 
bool m_allow_missing_restart_fields {true}
 Flag indicating whether we should allow missing restart fields.
 
int m_nfiles {256}
 Number of plot and checkpoint data files per write.
 

Detailed Description

Input/Output manager

This class contains infrastructure to output solution fields during the simulation as well as code that reads a checkpoint file during a restarted simulation. By default the Equation Systems register the necessary fields during initialization and these fields are output into plot-file and checkpoint file formats based on output frequencies managed by SimTime. The user can request additional fields be output by setting appropriate parameters in the input file. The class also provides the ability to override output of the default fields and output a subset of those fields.

Constructor & Destructor Documentation

◆ IOManager() [1/2]

amr_wind::IOManager::IOManager ( CFDSim & sim)
explicit

◆ ~IOManager()

amr_wind::IOManager::~IOManager ( )
default

◆ IOManager() [2/2]

amr_wind::IOManager::IOManager ( const IOManager & )
delete

Member Function Documentation

◆ checkpoint_fields()

const amrex::Vector< Field * > & amr_wind::IOManager::checkpoint_fields ( ) const
inline

◆ initialize_io()

void amr_wind::IOManager::initialize_io ( )

Process user inputs and perform one-time initialization tasks.

◆ is_restart()

bool amr_wind::IOManager::is_restart ( ) const
inline

◆ operator=()

IOManager & amr_wind::IOManager::operator= ( const IOManager & )
delete

◆ plot_fields()

const amrex::Vector< Field * > & amr_wind::IOManager::plot_fields ( ) const
inline

◆ post_processing_directory()

const std::string & amr_wind::IOManager::post_processing_directory ( )
inline

Name of the post processing directory.

◆ read_checkpoint_fields()

void amr_wind::IOManager::read_checkpoint_fields ( const std::string & restart_file,
const amrex::Vector< amrex::BoxArray > & ba_chk,
const amrex::Vector< amrex::DistributionMapping > & dm_chk,
const amrex::IntVect & rep )

Read all necessary fields for a restart.

◆ register_io_var()

void amr_wind::IOManager::register_io_var ( const std::string & fname)
inline

Convenience function to register a variable for both output and restart.

◆ register_output_int_var()

void amr_wind::IOManager::register_output_int_var ( const std::string & fname)
inline

◆ register_output_var()

void amr_wind::IOManager::register_output_var ( const std::string & fname)
inline

Register a variable for output.

◆ register_restart_var()

void amr_wind::IOManager::register_restart_var ( const std::string & fname)
inline

Register a variable for restart file.

◆ restart_file()

const std::string & amr_wind::IOManager::restart_file ( )
inline

Name of the checkpoint file to be read during a restart.

◆ write_checkpoint_file()

void amr_wind::IOManager::write_checkpoint_file ( const int start_level = 0,
const int end_level = -1 )

Write all necessary fields for restart.

◆ write_header()

void amr_wind::IOManager::write_header ( const std::string & chkname,
const int start_level,
const int end_level )
private

◆ write_info_file()

void amr_wind::IOManager::write_info_file ( const std::string & path)
private

◆ write_plot_file()

void amr_wind::IOManager::write_plot_file ( )

Write all user-requested fields to disk.

Member Data Documentation

◆ m_allow_missing_restart_fields

bool amr_wind::IOManager::m_allow_missing_restart_fields {true}
private

Flag indicating whether we should allow missing restart fields.

◆ m_chk_fields

amrex::Vector<Field*> amr_wind::IOManager::m_chk_fields
private

Final list of fields for restart.

◆ m_chk_prefix

std::string amr_wind::IOManager::m_chk_prefix {"chk"}
private

Prefix used for the restart file directories.

◆ m_chkvars

std::set<std::string> amr_wind::IOManager::m_chkvars
private

Variables for output in checkpoint/restart files.

◆ m_derived_mgr

std::unique_ptr<DerivedQtyMgr> amr_wind::IOManager::m_derived_mgr
private

◆ m_int_plt_fields

amrex::Vector<IntField*> amr_wind::IOManager::m_int_plt_fields
private

Final list of integer fields to be output.

◆ m_int_pltvars_default

std::set<std::string> amr_wind::IOManager::m_int_pltvars_default
private

Default output integer variables registered automatically in the code.

◆ m_nfiles

int amr_wind::IOManager::m_nfiles {256}
private

Number of plot and checkpoint data files per write.

◆ m_output_default_vars

bool amr_wind::IOManager::m_output_default_vars {true}
private

Flag indicating whether default fields should be output.

◆ m_plt_fields

amrex::Vector<Field*> amr_wind::IOManager::m_plt_fields
private

Final list of fields to be output.

◆ m_plt_num_comp

int amr_wind::IOManager::m_plt_num_comp {0}
private

Total number of variables (including components) output to plot file.

◆ m_plt_prefix

std::string amr_wind::IOManager::m_plt_prefix {"plt"}
private

Prefix used for the plot file directories.

◆ m_plt_var_names

amrex::Vector<std::string> amr_wind::IOManager::m_plt_var_names
private

Variable names (including components) for output.

◆ m_pltvars_default

std::set<std::string> amr_wind::IOManager::m_pltvars_default
private

Default output variables registered automatically in the code.

◆ m_post_dir

std::string amr_wind::IOManager::m_post_dir {"post_processing"}
private

Name for the post_processing directory.

◆ m_restart_file

std::string amr_wind::IOManager::m_restart_file
private

Restart file name.

◆ m_sim

CFDSim& amr_wind::IOManager::m_sim
private

The documentation for this class was generated from the following files:
  • /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/IOManager.H
  • /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/IOManager.cpp