opm-grid
CpGridDataTraits.hpp
1 //===========================================================================
2 //
3 // File: CpGridDataTraits.hpp
4 //
5 // Created: Fri Mar 08 2023
6 //
7 // Author(s): Markus Blatt <markus@dr-blatt.de>
8 //
9 // $Date$
10 //
11 // $Revision$
12 //
13 //===========================================================================
14 
15 /*
16  Copyright 2014-2015 Dr. Blatt - HPC-Simulartion-Software & Services
17  Copyright 2009-2023 Equinor ASA.
18 
19  This file is part of The Open Porous Media project (OPM).
20 
21  OPM is free software: you can redistribute it and/or modify
22  it under the terms of the GNU General Public License as published by
23  the Free Software Foundation, either version 3 of the License, or
24  (at your option) any later version.
25 
26  OPM is distributed in the hope that it will be useful,
27  but WITHOUT ANY WARRANTY; without even the implied warranty of
28  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29  GNU General Public License for more details.
30 
31  You should have received a copy of the GNU General Public License
32  along with OPM. If not, see <http://www.gnu.org/licenses/>.
33 */
34 
35 #ifndef OPM_CPGRIDDATATRAITS_HEADER
36 #define OPM_CPGRIDDATATRAITS_HEADER
37 
38 #include <dune/common/parallel/mpihelper.hh>
39 #ifdef HAVE_DUNE_ISTL
40 #include <dune/istl/owneroverlapcopy.hh>
41 #endif
42 
43 #include <dune/common/parallel/communication.hh>
44 #include <dune/common/parallel/variablesizecommunicator.hh>
45 #include <dune/istl/owneroverlapcopy.hh>
46 
47 #include <list>
48 #include <map>
49 
50 namespace Dune {
51 namespace cpgrid {
52 
54 {
56  using MPICommunicator = MPIHelper::MPICommunicator;
57 
58  using Communication = Dune::Communication<MPICommunicator>;
59  using CollectiveCommunication = Dune::Communication<MPICommunicator>;
60 
61 #ifdef HAVE_DUNE_ISTL
62  using AttributeSet = Dune::OwnerOverlapCopyAttributeSet::AttributeSet;
64 #else
65  enum AttributeSet{owner, overlap, copy};
67 #endif
68 
69 #if HAVE_MPI
70  using Communicator = Dune::VariableSizeCommunicator<>;
72 
74  using InterfaceMap = Communicator::InterfaceMap;
75 
77  using CommunicationType = Dune::OwnerOverlapCopyCommunication<int,int>;
78 
80  using ParallelIndexSet = typename CommunicationType::ParallelIndexSet;
81 
83  using RemoteIndices = Dune::RemoteIndices<ParallelIndexSet>;
84 #else
85  using InterfaceMap = std::map<int, std::list<int> >;
86 #endif // HAVE_MPI
87 };
88 
89 } // end namespace cpgrid
90 } // end space Opm
91 
92 #endif // OPM_CPGRIDDATATRAITS_HEADER
AttributeSet
The type of the set of the attributes.
Definition: CpGridDataTraits.hpp:66
The namespace Dune is the main namespace for all Dune code.
Definition: CartesianIndexMapper.hpp:9
Definition: CpGridDataTraits.hpp:53
MPIHelper::MPICommunicator MPICommunicator
The type of the collective communication.
Definition: CpGridDataTraits.hpp:56