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 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 
19 #ifndef GEOS_FILEIO_OUTPUTS_CHOMBOIO_HPP_
20 #define GEOS_FILEIO_OUTPUTS_CHOMBOIO_HPP_
21 
22 #include "OutputBase.hpp"
23 #include "fileIO/coupling/ChomboCoupler.hpp"
24 
25 namespace geos
26 {
27 
33 class ChomboIO final : public OutputBase
34 {
35 public:
37  ChomboIO( string const & name, Group * const parent );
38 
40  virtual ~ChomboIO() override;
41 
46  static string catalogName()
47  { return "ChomboIO"; }
48 
53  virtual bool execute( real64 const time_n,
54  real64 const dt,
55  integer const cycleNumber,
56  integer const eventCounter,
57  real64 const eventProgress,
58  DomainPartition & domain ) override;
59 
64  virtual void cleanup( real64 const time_n,
65  integer const cycleNumber,
66  integer const eventCounter,
67  real64 const eventProgress,
68  DomainPartition & 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 char const * outputPathString() { return "outputPath"; }
78  static constexpr char const * beginCycleString() { return "beginCycle"; }
79  static constexpr char const * inputPathString() { return "inputPath"; }
80  static constexpr char const * waitForInputString() { return "waitForInput"; }
81  static constexpr char const * useChomboPressuresString() { return "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  string m_outputPath;
94  double m_beginCycle;
95  string m_inputPath;
96  integer m_waitForInput;
97  integer m_useChomboPressures;
98 };
99 
100 
101 } /* namespace geos */
102 
103 #endif /* GEOS_FILEIO_OUTPUTS_CHOMBOIO_HPP_ */
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.
virtual ~ChomboIO() override
Destructor.
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, DomainPartition &domain) override
Writes out a Chombo plot file at the end of the simulation.
Definition: ChomboIO.hpp:64
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:1625
double real64
64-bit floating point type.
Definition: DataTypes.hpp:139
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:122