Loading...
Searching...
No Matches
Opm::ParallelWellInfo< Scalar > Class Template Reference

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.
void | setActivePerfToLocalPerfMap (const std::unordered_map< int, int > active_to_local_map) const
int | activePerfToLocalPerf (const int activeIndex) const
int | localPerfToActivePerf (std::size_t localIndex) const
int | globalPerfToLocalPerf (const int globalIndex) const
int | localPerfToGlobalPerf (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 > &current) 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 > &current) 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

## Detailed Description

template<class Scalar>
class Opm::ParallelWellInfo< Scalar >

Class encapsulating some information about parallel wells.

e.g. It provides a communicator for well information

## Constructor & Destructor Documentation

## ParallelWellInfo()

template<class Scalar>

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.

Parameters

  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.

## Member Function Documentation

## beginReset()

template<class Scalar>

void Opm::ParallelWellInfo< Scalar >::beginReset | ( |  | ) |

Inidicate that we will reset the ecl index information.

See also
  pushBackEclIndex;

## broadcastFirstPerforationValue()

template<class Scalar>
template<class T>

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.

## communicateAboveValues() [1/2]

template<class Scalar>

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.

Parameters

  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

Returns
  a vector containing the values for the perforation above.

## communicateAboveValues() [2/2]

template<class Scalar>

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.

Parameters

  first_value | Value to use for above of the first perforation
  current | vector of current values

## communicateBelowValues() [1/2]

template<class Scalar>

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.

Parameters

  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

Returns
  a vector containing the values for the perforation above.

## communicateBelowValues() [2/2]

template<class Scalar>

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.

Parameters

  last_value | Value to use for below of the last perforation
  current | vector of current values

## getGlobalPerfContainerFactory()

template<class Scalar>

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.

## partialSumPerfValues()

template<class Scalar>
template<class RAIterator>

void Opm::ParallelWellInfo< Scalar >::partialSumPerfValues | ( | RAIterator | begin,
|  | RAIterator | end ) const

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

Parameters

  begin | The start of the range
  end | The end of the range

Template Parameters

  RAIterator | The type og random access iterator

## pushBackEclIndex()

template<class Scalar>

void Opm::ParallelWellInfo< Scalar >::pushBackEclIndex | ( | int | above,
|  | int | current )

Adds information about the ecl indices of the perforations.

Warning
  Theses indices need to be push in the same order as they appear in the ECL well specifiation. Use -1 if there is no perforation above.

Parameters

  above | The ECL index of the next open perforation above.
  current | The ECL index of the current open perforation.

## sumPerfValues()

template<class Scalar>
template<typename It>

It::value_type Opm::ParallelWellInfo< Scalar >::sumPerfValues | ( | It | begin,
|  | It | end ) const

Sum all the values of the perforations.

Todo
  cater for overlap later. Currently only owner

The documentation for this class was generated from the following files:

- opm/simulators/wells/MSWellHelpers.hpp
- opm/simulators/wells/ParallelWellInfo.hpp
- opm/simulators/wells/ParallelWellInfo.cpp