opm-common
LgrCollection.hpp
1 /*
2  Copyright (C) 2023 Equinor
3  This file is part of the Open Porous Media project (OPM).
4  OPM is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8  OPM is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12  You should have received a copy of the GNU General Public License
13  along with OPM. If not, see <http://www.gnu.org/licenses/>.
14  */
15 
16 #ifndef OPM_PARSER_LGR_COLLECTION_HPP
17 #define OPM_PARSER_LGR_COLLECTION_HPP
18 
19 #include <opm/input/eclipse/EclipseState/Util/OrderedMap.hpp>
20 
21 #include <opm/input/eclipse/EclipseState/Grid/Carfin.hpp>
22 #include <opm/input/eclipse/EclipseState/Grid/CarfinManager.hpp>
23 #include <opm/input/eclipse/EclipseState/Grid/EclipseGrid.hpp>
24 
25 #include <cstddef>
26 #include <string>
27 
28 namespace Opm {
29 
30  class DeckRecord;
31  class GridDims;
32  class GRIDSection;
33 
35 public:
36  LgrCollection();
37  LgrCollection(const GRIDSection& gridSection, const EclipseGrid& grid);
38 
39  static LgrCollection serializationTestObject();
40 
41  explicit LgrCollection(const Deck& deck);
42 
43  std::size_t size() const;
44  bool hasLgr(const std::string& lgrName) const;
45  Carfin& getLgr(const std::string& lgrName);
46  const Carfin& getLgr(const std::string& lgrName) const;
47  Carfin& getLgr(std::size_t lgrIndex);
48  const Carfin& getLgr(std::size_t lgrIndex) const;
49 
50  void addLgr(const EclipseGrid& grid, const DeckRecord& lgrRecord);
51 
52  bool operator==(const LgrCollection& data) const;
53 
54  template<class Serializer>
55  void serializeOp(Serializer& serializer)
56  {
57  serializer(m_lgrs);
58  }
59 
60 private:
61  OrderedMap<Carfin, 8> m_lgrs;
62 
63 };
64 }
65 
66 #endif // OPM_PARSER_LGR_COLLECTION_HPP
Definition: Carfin.hpp:33
About cell information and dimension: The actual grid information is held in a pointer to an ERT ecl_...
Definition: EclipseGrid.hpp:63
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
A map with iteration in the order of insertion.
Definition: OrderedMap.hpp:118
Definition: LgrCollection.hpp:34
Definition: DeckSection.hpp:115
Definition: Deck.hpp:46
Definition: DeckRecord.hpp:33
Class for (de-)serializing.
Definition: Serializer.hpp:95