GEOSX
ChomboCoupler.hpp
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 
15 #ifndef GEOS_FILEIO_COUPLING_CHOMBOCOUPLER_HPP_
16 #define GEOS_FILEIO_COUPLING_CHOMBOCOUPLER_HPP_
17 
18 #include "common/DataTypes.hpp"
19 #include "mesh/MeshLevel.hpp"
20 
21 
22 
23 namespace geos
24 {
25 
32 {
33 public:
34 
42  ChomboCoupler( MPI_Comm const comm, const string & outputPath, const string & inputPath, MeshLevel & mesh );
43 
48  void write( double dt );
49 
54  void read( bool usePressures );
55 
56 private:
63  void copyNodalData();
64 
66  MPI_Comm const m_comm;
68  string const m_outputPath;
70  string const m_inputPath;
72  std::int64_t m_face_offset;
74  std::int64_t m_n_faces_written;
76  std::int64_t m_node_offset;
78  std::int64_t m_n_nodes_written;
80  MeshLevel & m_mesh;
82  int m_counter;
84  array2d< real64 > m_referencePositionCopy;
86  array2d< real64 > m_displacementCopy;
88  array2d< real64 > m_velocityCopy;
89 };
90 
91 } /* namespace geos */
92 
93 #endif /* GEOS_FILEIO_COUPLING_CHOMBOCOUPLER_HPP_ */
A class managing data exchange with CHOMBO.
void write(double dt)
Write data to file.
void read(bool usePressures)
Read data from file.
ChomboCoupler(MPI_Comm const comm, const string &outputPath, const string &inputPath, MeshLevel &mesh)
Construct a new ChomboCoupler.
Class facilitating the representation of a multi-level discretization of a MeshBody.
Definition: MeshLevel.hpp:41
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
Definition: DataTypes.hpp:232