GEOS
ChomboIO.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 
20 #ifndef GEOS_FILEIO_OUTPUTS_CHOMBOIO_HPP_
21 #define GEOS_FILEIO_OUTPUTS_CHOMBOIO_HPP_
22 
23 #include "OutputBase.hpp"
24 #include "fileIO/coupling/ChomboCoupler.hpp"
25 
26 namespace geos
27 {
28 
34 class ChomboIO final : public OutputBase
35 {
36 public:
38  ChomboIO( string const & name, Group * const parent );
39 
41  virtual ~ChomboIO() override;
42 
47  static string catalogName()
48  { return "ChomboIO"; }
49 
54  virtual bool execute( real64 const time_n,
55  real64 const dt,
56  integer const cycleNumber,
57  integer const eventCounter,
58  real64 const eventProgress,
59  DomainPartition & domain ) override;
60 
65  virtual void cleanup( real64 const time_n,
66  integer const cycleNumber,
67  integer const eventCounter,
68  real64 const eventProgress,
69  DomainPartition & domain ) override
70  {
71  m_waitForInput = 0;
72  execute( time_n, 0.0, cycleNumber, eventCounter, eventProgress, domain );
73  }
74 
76  struct viewKeyStruct
77  {
78  static constexpr char const * outputPathString() { return "outputPath"; }
79  static constexpr char const * beginCycleString() { return "beginCycle"; }
80  static constexpr char const * inputPathString() { return "inputPath"; }
81  static constexpr char const * waitForInputString() { return "waitForInput"; }
82  static constexpr char const * useChomboPressuresString() { return "useChomboPressures"; }
83 
84  dataRepository::ViewKey outputPath = { outputPathString() };
85  dataRepository::ViewKey beginCycle = { beginCycleString() };
86  dataRepository::ViewKey inputPath = { inputPathString() };
87  dataRepository::ViewKey waitForInput = { waitForInputString() };
88  dataRepository::ViewKey useChomboPressures = { useChomboPressuresString() };
89  } viewKeys;
91 
92 protected:
96  logInfo::OutputTimerBase const & getTimerCategory() const override;
97 
98 private:
99  ChomboCoupler * m_coupler;
100  string m_outputPath;
101  double m_beginCycle;
102  string m_inputPath;
103  integer m_waitForInput;
104  integer m_useChomboPressures;
105 };
106 
107 
108 } /* namespace geos */
109 
110 #endif /* GEOS_FILEIO_OUTPUTS_CHOMBOIO_HPP_ */
A class managing data exchange with CHOMBO.
virtual bool execute(real64 const time_n, real64 const dt, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, DomainPartition &domain) override
Writes out a Chombo plot file.
logInfo::OutputTimerBase const & getTimerCategory() const override
Get the timer category for this output type.
virtual ~ChomboIO() override
Destructor.
static string catalogName()
Catalog name interface.
Definition: ChomboIO.hpp:47
virtual void cleanup(real64 const time_n, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, DomainPartition &domain) override
Writes out a Chombo plot file at the end of the simulation.
Definition: ChomboIO.hpp:65
ChomboIO(string const &name, Group *const parent)
Constructor.
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
Group::wrapperMap::KeyIndex ViewKey
Type alias for KeyIndexT type used for wrapper lookups.
Definition: Group.hpp:1662
double real64
64-bit floating point type.
Definition: DataTypes.hpp:99
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:82
Base interface for specific output type timers.
Definition: OutputBase.hpp:59