Loading...
Searching...
No Matches
overlaptypes.hh
Go to the documentation of this file.
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
*/
#ifndef EWOMS_OVERLAP_TYPES_HH
#define EWOMS_OVERLAP_TYPES_HH
#include <cstddef>
#include <list>
#include <map>
#include <set>
#include <vector>
namespace Opm {
namespace Linear {
using Index = int;
using ProcessRank = unsigned;
using BorderDistance = unsigned;
struct IndexRank
{
Index index;
ProcessRank rank;
};
struct PeerIndexGlobalIndex
{
Index peerIdx;
Index globalIdx;
};
struct IndexRankDist
{
Index index;
ProcessRank peerRank;
BorderDistance borderDistance;
};
struct IndexDistanceNpeers
{
Index index;
BorderDistance borderDistance;
unsigned numPeers;
};
struct BorderIndex
{
Index localIdx;
Index peerIdx;
ProcessRank peerRank;
BorderDistance borderDistance;
};
using BorderList = std::list<BorderIndex>;
class SeedList : public std::list<IndexRankDist>
{
public:
void update(const BorderList& borderList)
{
this->clear();
auto it = borderList.begin();
const auto& endIt = borderList.end();
for (; it != endIt; ++it) {
IndexRankDist ird;
ird.index = it->localIdx;
ird.peerRank = it->peerRank;
ird.borderDistance = it->borderDistance;
this->push_back(ird);
}
}
};
class PeerSet : public std::set<ProcessRank>
{
public:
void update(const BorderList& borderList)
{
this->clear();
auto it = borderList.begin();
const auto& endIt = borderList.end();
for (; it != endIt; ++it)
this->insert(it->peerRank);
}
};
using OverlapWithPeer = std::vector<IndexDistanceNpeers>;
using OverlapByRank = std::map<ProcessRank, OverlapWithPeer>;
using OverlapByIndex = std::vector<std::map<ProcessRank, BorderDistance> >;
using DomesticOverlapWithPeer = std::vector<Index>;
using DomesticOverlapByRank = std::map<ProcessRank, DomesticOverlapWithPeer>;
} // namespace Linear
} // namespace Opm
#endif
Opm::Linear::PeerSet
A set of process ranks.
Definition overlaptypes.hh:149
Opm::Linear::SeedList
The list of indices which are on the process boundary.
Definition overlaptypes.hh:126
Opm
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43
Opm::Linear::OverlapByIndex
std::vector< std::map< ProcessRank, BorderDistance > > OverlapByIndex
Maps each index to a list of processes .
Definition overlaptypes.hh:176
Opm::Linear::OverlapWithPeer
std::vector< IndexDistanceNpeers > OverlapWithPeer
The list of indices which overlap with a peer rank.
Definition overlaptypes.hh:165
Opm::Linear::ProcessRank
unsigned ProcessRank
The type of the rank of a process.
Definition overlaptypes.hh:49
Opm::Linear::BorderDistance
unsigned BorderDistance
The type representing the distance of an index to the border.
Definition overlaptypes.hh:54
Opm::Linear::Index
int Index
The type of an index of a degree of freedom.
Definition overlaptypes.hh:44
Opm::Linear::OverlapByRank
std::map< ProcessRank, OverlapWithPeer > OverlapByRank
A type mapping the process rank to the list of indices shared with this peer.
Definition overlaptypes.hh:171
Opm::Linear::BorderList
std::list< BorderIndex > BorderList
This class managages a list of indices which are on the border of a process' partition of the grid.
Definition overlaptypes.hh:120
Opm::Linear::DomesticOverlapWithPeer
std::vector< Index > DomesticOverlapWithPeer
The list of domestic indices are owned by peer rank.
Definition overlaptypes.hh:181
Opm::Linear::DomesticOverlapByRank
std::map< ProcessRank, DomesticOverlapWithPeer > DomesticOverlapByRank
A type mapping the process rank to the list of domestic indices which are owned by the peer.
Definition overlaptypes.hh:187
Opm::Linear::BorderIndex
A single index intersecting with the process boundary.
Definition overlaptypes.hh:102
Opm::Linear::BorderIndex::localIdx
Index localIdx
Index of the entity for the local process.
Definition overlaptypes.hh:104
Opm::Linear::BorderIndex::borderDistance
BorderDistance borderDistance
Distance to the process border for the peer (in hops).
Definition overlaptypes.hh:113
Opm::Linear::BorderIndex::peerRank
ProcessRank peerRank
Rank of the peer process.
Definition overlaptypes.hh:110
Opm::Linear::BorderIndex::peerIdx
Index peerIdx
Index of the entity for the peer process.
Definition overlaptypes.hh:107
Opm::Linear::IndexDistanceNpeers
This structure stores an index, a process rank, and the number of processes which "see" the degree of...
Definition overlaptypes.hh:92
Opm::Linear::IndexRankDist
This structure stores an index, a process rank, and the distance of the degree of freedom to the proc...
Definition overlaptypes.hh:80
Opm::Linear::IndexRank
This structure stores an index and a process rank.
Definition overlaptypes.hh:60
Opm::Linear::PeerIndexGlobalIndex
This structure stores a local index on a peer process and a global index.
Definition overlaptypes.hh:70