My Project
|
Class encapsulating some information about parallel wells. More...
#include <ParallelWellInfo.hpp>
Public Member Functions | |
ParallelWellInfo (const std::string &name={""}, bool hasLocalCells=true) | |
Constructs object using MPI_COMM_SELF. | |
ParallelWellInfo (const std::pair< std::string, bool > &well_info, Parallel::Communication allComm) | |
Constructs object with communication between all rank sharing a well. | |
const Parallel::Communication & | communication () const |
void | communicateFirstPerforation (bool hasFirst) |
Collectively decide which rank has first perforation. | |
int | globalToLocal (const int globalIndex) const |
int | localToGlobal (std::size_t localIndex) const |
template<class T > | |
T | broadcastFirstPerforationValue (const T &t) const |
If the well does not have any open connections the member rankWithFirstPerf is not initialized, and no broadcast is performed. | |
std::vector< Scalar > | communicateAboveValues (Scalar first_value, const Scalar *current, std::size_t size) const |
Creates an array of values for the perforation above. | |
std::vector< Scalar > | communicateAboveValues (Scalar first_value, const std::vector< Scalar > ¤t) const |
Creates an array of values for the perforation above. | |
std::vector< Scalar > | communicateBelowValues (Scalar last_value, const Scalar *current, std::size_t size) const |
Creates an array of values for the perforation below. | |
std::vector< Scalar > | communicateBelowValues (Scalar last_value, const std::vector< Scalar > ¤t) const |
Creates an array of values for the perforation above. | |
void | pushBackEclIndex (int above, int current) |
Adds information about the ecl indices of the perforations. | |
const std::string & | name () const |
Name of the well. | |
bool | hasLocalCells () const |
Whether local cells are perforated somewhen. | |
bool | isOwner () const |
void | beginReset () |
Inidicate that we will reset the ecl index information. | |
void | endReset () |
Inidicate completion of reset of the ecl index information. | |
template<typename It > | |
It::value_type | sumPerfValues (It begin, It end) const |
Sum all the values of the perforations. | |
template<class RAIterator > | |
void | partialSumPerfValues (RAIterator begin, RAIterator end) const |
Do a (in place) partial sum on values attached to all perforations. | |
void | clear () |
Free data of communication data structures. | |
const GlobalPerfContainerFactory< Scalar > & | getGlobalPerfContainerFactory () const |
Get a factor to create a global representation of peforation data. | |
Static Public Attributes | |
static constexpr int | INVALID_ECL_INDEX = -1 |
Class encapsulating some information about parallel wells.
e.g. It provides a communicator for well information
Opm::ParallelWellInfo< Scalar >::ParallelWellInfo | ( | const std::pair< std::string, bool > & | well_info, |
Parallel::Communication | allComm | ||
) |
Constructs object with communication between all rank sharing a well.
well_info | Pair of well name and whether local cells might be perforated on this rank |
allComm | The communication object with all MPI ranks active in the simulation. Default is the one with all ranks available. |
void Opm::ParallelWellInfo< Scalar >::beginReset | ( | ) |
Inidicate that we will reset the ecl index information.
T Opm::ParallelWellInfo< Scalar >::broadcastFirstPerforationValue | ( | const T & | t | ) | const |
If the well does not have any open connections the member rankWithFirstPerf is not initialized, and no broadcast is performed.
In this case the argument is returned unmodified.
std::vector< Scalar > Opm::ParallelWellInfo< Scalar >::communicateAboveValues | ( | Scalar | first_value, |
const Scalar * | current, | ||
std::size_t | size | ||
) | const |
Creates an array of values for the perforation above.
first_value | Value to use for above of the first perforation |
current | C-array of the values at the perforations |
size | The size of the C-array and the returned vector |
std::vector< Scalar > Opm::ParallelWellInfo< Scalar >::communicateAboveValues | ( | Scalar | first_value, |
const std::vector< Scalar > & | current | ||
) | const |
Creates an array of values for the perforation above.
first_value | Value to use for above of the first perforation |
current | vector of current values |
std::vector< Scalar > Opm::ParallelWellInfo< Scalar >::communicateBelowValues | ( | Scalar | last_value, |
const Scalar * | current, | ||
std::size_t | size | ||
) | const |
Creates an array of values for the perforation below.
last_value | Value to use for below of the last perforation |
current | C-array of the values at the perforations |
size | The size of the C-array and the returned vector |
std::vector< Scalar > Opm::ParallelWellInfo< Scalar >::communicateBelowValues | ( | Scalar | last_value, |
const std::vector< Scalar > & | current | ||
) | const |
Creates an array of values for the perforation above.
last_value | Value to use for below of the last perforation |
current | vector of current values |
const GlobalPerfContainerFactory< Scalar > & Opm::ParallelWellInfo< Scalar >::getGlobalPerfContainerFactory | ( | ) | const |
Get a factor to create a global representation of peforation data.
That is a container that holds data for every perforation no matter where it is stored. Container is ordered via ascendings index of the perforations in the ECL schedule.
|
inline |
Do a (in place) partial sum on values attached to all perforations.
For distributed wells this may include perforations stored elsewhere. The result is stored in ther range given as the parameters
begin | The start of the range |
ebd | The end of the range |
RAIterator | The type og random access iterator |
void Opm::ParallelWellInfo< Scalar >::pushBackEclIndex | ( | int | above, |
int | current | ||
) |
Adds information about the ecl indices of the perforations.
above | The ECL index of the next open perforation above. |
current | The ECL index of the current open perforation. |
It::value_type Opm::ParallelWellInfo< Scalar >::sumPerfValues | ( | It | begin, |
It | end | ||
) | const |
Sum all the values of the perforations.