PISM, A Parallel Ice Sheet Model  stable v2.1.1 committed by Constantine Khrulev on 2024-12-04 13:36:58 -0900
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
pism::DefaultConfig Class Reference

Default PISM configuration database: uses NetCDF files; can be initialized from a file specified using a command-line option. More...

#include <Config.hh>

+ Inheritance diagram for pism::DefaultConfig:

Public Types

typedef std::shared_ptr< DefaultConfigPtr
 
typedef std::shared_ptr< const DefaultConfigConstPtr
 
- Public Types inherited from pism::Config
enum  UseFlag { REMEMBER_THIS_USE = 0 , FORGET_THIS_USE = 1 }
 Flag used by get_...() methods. More...
 
typedef std::shared_ptr< ConfigPtr
 
typedef std::shared_ptr< const ConfigConstPtr
 
typedef std::map< std::string, std::vector< double > > Doubles
 
typedef std::map< std::string, std::string > Strings
 
typedef std::map< std::string, bool > Flags
 

Public Member Functions

 DefaultConfig (MPI_Comm com, const std::string &variable_name, const std::string &option, units::System::Ptr unit_system)
 Config that respects command-line options and stores data in a NetCDF variable. More...
 
 ~DefaultConfig ()=default
 
void init_with_default (const Logger &log)
 Initialize (use default path if no option was set). More...
 
void init (const Logger &log)
 Initialize (leave empty if no option was set). More...
 
- Public Member Functions inherited from pism::NetCDFConfig
 NetCDFConfig (MPI_Comm com, const std::string &name, units::System::Ptr unit_system)
 
 ~NetCDFConfig ()
 
- Public Member Functions inherited from pism::Config
 Config (units::System::Ptr unit_system)
 
virtual ~Config ()
 
void import_from (const Config &other)
 
void resolve_filenames ()
 
const std::set< std::string > & parameters_set_by_user () const
 
const std::set< std::string > & parameters_used () const
 
void read (MPI_Comm com, const std::string &filename)
 
void write (MPI_Comm com, const std::string &filename, bool append=true) const
 
std::string filename () const
 Returns the name of the file used to initialize the database. More...
 
void read (const File &file)
 
void write (const File &file) const
 
bool is_set (const std::string &name) const
 
Doubles all_doubles () const
 
double get_number (const std::string &name, UseFlag flag=REMEMBER_THIS_USE) const
 
double get_number (const std::string &name, const std::string &units, UseFlag flag=REMEMBER_THIS_USE) const
 
std::vector< double > get_numbers (const std::string &name, UseFlag flag=REMEMBER_THIS_USE) const
 
std::vector< double > get_numbers (const std::string &name, const std::string &units, UseFlag flag=REMEMBER_THIS_USE) const
 
void set_number (const std::string &name, double value, ConfigSettingFlag flag=CONFIG_FORCE)
 
void set_numbers (const std::string &name, const std::vector< double > &values, ConfigSettingFlag flag=CONFIG_FORCE)
 
Strings all_strings () const
 
std::string get_string (const std::string &name, UseFlag flag=REMEMBER_THIS_USE) const
 
void set_string (const std::string &name, const std::string &value, ConfigSettingFlag flag=CONFIG_FORCE)
 
Flags all_flags () const
 
std::set< std::string > keys () const
 
bool get_flag (const std::string &name, UseFlag flag=REMEMBER_THIS_USE) const
 
void set_flag (const std::string &name, bool value, ConfigSettingFlag flag=CONFIG_FORCE)
 
std::string doc (const std::string &parameter) const
 
std::string units (const std::string &parameter) const
 
std::string type (const std::string &parameter) const
 
std::string option (const std::string &parameter) const
 
std::string choices (const std::string &parameter) const
 

Private Member Functions

void init (const Logger &log, bool use_default_path)
 

Private Attributes

std::string m_option
 

Additional Inherited Members

- Protected Member Functions inherited from pism::NetCDFConfig
void read_impl (const File &nc)
 Read flag flags and double parameters from a NetCDF file. More...
 
void write_impl (const File &nc) const
 Write a config variable to a file (with all its attributes). More...
 
bool is_set_impl (const std::string &name) const
 
Doubles all_doubles_impl () const
 
double get_number_impl (const std::string &name) const
 
std::vector< double > get_numbers_impl (const std::string &name) const
 
void set_number_impl (const std::string &name, double value)
 
void set_numbers_impl (const std::string &name, const std::vector< double > &values)
 
Strings all_strings_impl () const
 
std::string get_string_impl (const std::string &name) const
 
void set_string_impl (const std::string &name, const std::string &value)
 
Flags all_flags_impl () const
 
bool get_flag_impl (const std::string &name) const
 
void set_flag_impl (const std::string &name, bool value)
 Set a value of a flag flag. More...
 
- Protected Attributes inherited from pism::NetCDFConfig
MPI_Comm m_com
 
VariableMetadata m_data
 

Detailed Description

Default PISM configuration database: uses NetCDF files; can be initialized from a file specified using a command-line option.

Definition at line 72 of file Config.hh.


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