GEOS
OutputBase.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 TotalEnergies
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
19 #ifndef GEOS_FILEIO_OUTPUTS_OUTPUTBASE_HPP_
20 #define GEOS_FILEIO_OUTPUTS_OUTPUTBASE_HPP_
21 
22 #include "dataRepository/Group.hpp"
24 #include "common/Timer.hpp"
25 
26 namespace geos
27 {
28 
35 {
36 public:
38  explicit OutputBase( string const & name, Group * const parent );
39 
41  virtual ~OutputBase() override;
42 
47  static void setOutputDirectory( string const & outputDir );
48 
53  static string const & getOutputDirectory();
54 
59  static void setFileNameRoot( string const & root );
60 
65  static string const & getFileNameRoot();
66 
68  virtual void setupDirectoryStructure();
69 
70  // Catalog interface
74 
75  // Catalog view keys
76  struct viewKeysStruct
77  {
78  static constexpr auto childDirectoryString = "childDirectory";
79  } outputBaseViewKeys;
81 
86  string childDirectory() const { return m_childDirectory; }
87 
88 protected:
94  virtual void initializePreSubGroups() override;
95 
97  std::chrono::system_clock::duration m_outputTimer;
98 
100  virtual void cleanup( real64 const time_n,
101  integer const cycleNumber,
102  integer const eventCounter,
103  real64 const eventProgress,
104  DomainPartition & domain ) override;
105 
106 private:
107  string m_childDirectory;
108 
109 };
110 
111 
112 } /* namespace geos */
113 
114 #endif /* GEOS_FILEIO_OUTPUTS_OUTPUTBASE_HPP_ */
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
string childDirectory() const
Get the path of the child directory where output will be written.
Definition: OutputBase.hpp:86
std::chrono::system_clock::duration m_outputTimer
Timer used to track duration of file writing operations for this specific output type.
Definition: OutputBase.hpp:97
virtual void setupDirectoryStructure()
Method for setting up output directories.
virtual void cleanup(real64 const time_n, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, DomainPartition &domain) override
Called as the code exits the main run loop.
static string const & getOutputDirectory()
Getter for the output directory.
static string const & getFileNameRoot()
Getter for the file name root.
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 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 Group.
double real64
64-bit floating point type.
Definition: DataTypes.hpp:98
int integer
Signed integer type.
Definition: DataTypes.hpp:81
struct containing the view access keys to be bound with class data member