GEOSX
OutputBase.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 TotalEnergies
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
18 #ifndef GEOS_FILEIO_OUTPUTS_OUTPUTBASE_HPP_
19 #define GEOS_FILEIO_OUTPUTS_OUTPUTBASE_HPP_
20 
21 #include "dataRepository/Group.hpp"
23 
24 
25 namespace geos
26 {
27 
34 {
35 public:
37  explicit OutputBase( string const & name, Group * const parent );
38 
40  virtual ~OutputBase() override;
41 
46  static void setOutputDirectory( string const & outputDir );
47 
52  static string getOutputDirectory() {return m_outputDirectory;}
53 
58  static void setFileNameRoot( string const & root );
59 
64  static string getFileNameRoot() { return m_fileNameRoot; }
65 
67  virtual void setupDirectoryStructure();
68 
69  // Catalog interface
73 
74  // Catalog view keys
75  struct viewKeysStruct
76  {
77  static constexpr auto childDirectoryString = "childDirectory";
78  static constexpr auto parallelThreadsString = "parallelThreads";
79  } outputBaseViewKeys;
81 
86  string childDirectory() const { return m_childDirectory; }
87 
92  integer parallelThreads() const { return m_parallelThreads; }
93 
94 protected:
100  virtual void initializePreSubGroups() override;
101 
102 private:
103  string m_childDirectory;
104  integer m_parallelThreads;
105 
106  static string m_outputDirectory;
107  static string m_fileNameRoot;
108 
109 };
110 
111 
112 } /* namespace geos */
113 
114 #endif /* GEOS_FILEIO_OUTPUTS_OUTPUTBASE_HPP_ */
string childDirectory() const
Get the path of the child directory where output will be written.
Definition: OutputBase.hpp:86
virtual void setupDirectoryStructure()
Method for setting up output directories.
static string getOutputDirectory()
Getter for the output directory.
Definition: OutputBase.hpp:52
integer parallelThreads() const
Get the number of parallel threads to use to write plotfiles.
Definition: OutputBase.hpp:92
virtual ~OutputBase() override
Destructor.
virtual void initializePreSubGroups() override
Do initialization prior to calling initialization operations on the subgroups.
OutputBase(string const &name, Group *const parent)
Constructor.
static void setOutputDirectory(string const &outputDir)
Setter for the output directory.
static string getFileNameRoot()
Getter for the file name root.
Definition: OutputBase.hpp:64
static void setFileNameRoot(string const &root)
Setter for the file name root.
This class provides the base class/interface for the catalog value objects.
std::unordered_map< std::string, std::unique_ptr< CatalogInterface< BASETYPE, ARGS... > > > CatalogType
This is the type that will be used for the catalog. The catalog is actually instantiated in the BASET...
static CatalogInterface::CatalogType & getCatalog()
Get the singleton catalog for this class.
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:122
struct containing the view access keys to be bound with class data member