GEOS
ChomboCoupler.hpp
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 Total, S.A
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 
16 #ifndef GEOS_FILEIO_COUPLING_CHOMBOCOUPLER_HPP_
17 #define GEOS_FILEIO_COUPLING_CHOMBOCOUPLER_HPP_
18 
19 #include "common/DataTypes.hpp"
20 #include "mesh/MeshLevel.hpp"
21 
22 
23 
24 namespace geos
25 {
26 
33 {
34 public:
35 
43  ChomboCoupler( MPI_Comm const comm, const string & outputPath, const string & inputPath, MeshLevel & mesh );
44 
49  void write( double dt );
50 
55  void read( bool usePressures );
56 
57 private:
64  void copyNodalData();
65 
67  MPI_Comm const m_comm;
69  string const m_outputPath;
71  string const m_inputPath;
73  std::int64_t m_face_offset;
75  std::int64_t m_n_faces_written;
77  std::int64_t m_node_offset;
79  std::int64_t m_n_nodes_written;
81  MeshLevel & m_mesh;
83  int m_counter;
85  array2d< real64 > m_referencePositionCopy;
87  array2d< real64 > m_displacementCopy;
89  array2d< real64 > m_velocityCopy;
90 };
91 
92 } /* namespace geos */
93 
94 #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:42
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
Definition: DataTypes.hpp:192