GEOSX
ChomboIO.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 Total, S.A
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 
19 #ifndef GEOSX_MANAGERS_OUTPUTS_CHOMBOIO_HPP_
20 #define GEOSX_MANAGERS_OUTPUTS_CHOMBOIO_HPP_
21 
22 #include "OutputBase.hpp"
23 #include "fileIO/coupling/ChomboCoupler.hpp"
24 
25 namespace geosx
26 {
27 
33 class ChomboIO final : public OutputBase
34 {
35 public:
37  ChomboIO( std::string const & name, Group * const parent );
38 
40  virtual ~ChomboIO() override;
41 
46  static string CatalogName()
47  { return "ChomboIO"; }
48 
53  virtual void Execute( real64 const time_n,
54  real64 const dt,
55  integer const cycleNumber,
56  integer const eventCounter,
57  real64 const eventProgress,
58  dataRepository::Group * const domain ) override;
59 
64  virtual void Cleanup( real64 const time_n,
65  integer const cycleNumber,
66  integer const eventCounter,
67  real64 const eventProgress,
68  dataRepository::Group * const domain ) override
69  {
70  m_waitForInput = 0;
71  Execute( time_n, 0.0, cycleNumber, eventCounter, eventProgress, domain );
72  }
73 
75  struct viewKeyStruct
76  {
77  static constexpr auto outputPathString = "outputPath";
78  static constexpr auto beginCycleString = "beginCycle";
79  static constexpr auto inputPathString = "inputPath";
80  static constexpr auto waitForInputString = "waitForInput";
81  static constexpr auto useChomboPressuresString = "useChomboPressures";
82 
83  dataRepository::ViewKey outputPath = { outputPathString };
84  dataRepository::ViewKey beginCycle = { beginCycleString };
85  dataRepository::ViewKey inputPath = { inputPathString };
86  dataRepository::ViewKey waitForInput = { waitForInputString };
87  dataRepository::ViewKey useChomboPressures = { useChomboPressuresString };
88  } viewKeys;
90 
91 private:
92  ChomboCoupler * m_coupler;
93  std::string m_outputPath;
94  double m_beginCycle;
95  std::string m_inputPath;
96  integer m_waitForInput;
97  integer m_useChomboPressures;
98 };
99 
100 
101 } /* namespace geosx */
102 
103 #endif /* GEOSX_MANAGERS_OUTPUTS_CHOMBOIO_HPP_ */
ChomboIO(std::string const &name, Group *const parent)
Constructor.
virtual void Execute(real64 const time_n, real64 const dt, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, dataRepository::Group *const domain) override
Writes out a Chombo plot file.
double real64
64-bit floating point type.
Definition: DataTypes.hpp:136
Group::wrapperMap::KeyIndex ViewKey
Type alias for KeyIndexT type used for wrapper lookups.
Definition: Group.hpp:1545
A class managing data exchange with CHOMBO.
static string CatalogName()
Catalog name interface.
Definition: ChomboIO.hpp:46
virtual void Cleanup(real64 const time_n, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, dataRepository::Group *const domain) override
Writes out a Chombo plot file at the end of the simulation.
Definition: ChomboIO.hpp:64
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:122
std::string string
String type.
Definition: DataTypes.hpp:131
virtual ~ChomboIO() override
Destructor.