Opm::ParallelWellInfo Class 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. More...
 
 ParallelWellInfo (const std::pair< std::string, bool > &well_info, Parallel::Communication allComm)
 Constructs object with communication between all rank sharing a well. More...
 
const Parallel::Communicationcommunication () const
 
void communicateFirstPerforation (bool hasFirst)
 Collectively decide which rank has first perforation. More...
 
template<class T >
broadcastFirstPerforationValue (const T &t) const
 
std::vector< double > communicateAboveValues (double first_value, const double *current, std::size_t size) const
 Creates an array of values for the perforation above. More...
 
std::vector< double > communicateAboveValues (double first_value, const std::vector< double > &current) const
 Creates an array of values for the perforation above. More...
 
std::vector< double > communicateBelowValues (double last_value, const double *current, std::size_t size) const
 Creates an array of values for the perforation below. More...
 
std::vector< double > communicateBelowValues (double last_value, const std::vector< double > &current) const
 Creates an array of values for the perforation above. More...
 
void pushBackEclIndex (int above, int current)
 Adds information about the ecl indices of the perforations. More...
 
const std::string & name () const
 Name of the well. More...
 
bool hasLocalCells () const
 Whether local cells are perforated somewhen. More...
 
bool isOwner () const
 
void beginReset ()
 Inidicate that we will reset the ecl index information. More...
 
void endReset ()
 Inidicate completion of reset of the ecl index information. More...
 
template<typename It >
It::value_type sumPerfValues (It begin, It end) const
 Sum all the values of the perforations. More...
 
template<class RAIterator >
void partialSumPerfValues (RAIterator begin, RAIterator end) const
 Do a (in place) partial sum on values attached to all perforations. More...
 
void clear ()
 Free data of communication data structures. More...
 
const GlobalPerfContainerFactorygetGlobalPerfContainerFactory () const
 Get a factor to create a global representation of peforation data. More...
 

Static Public Attributes

static constexpr int INVALID_ECL_INDEX = -1
 

Detailed Description

Class encapsulating some information about parallel wells.

e.g. It provides a communicator for well information

Constructor & Destructor Documentation

◆ ParallelWellInfo() [1/2]

Opm::ParallelWellInfo::ParallelWellInfo ( const std::string &  name = {""},
bool  hasLocalCells = true 
)

Constructs object using MPI_COMM_SELF.

◆ ParallelWellInfo() [2/2]

Opm::ParallelWellInfo::ParallelWellInfo ( const std::pair< std::string, bool > &  well_info,
Parallel::Communication  allComm 
)

Constructs object with communication between all rank sharing a well.

Parameters
well_infoPair of well name and whether local cells might be perforated on this rank
allCommThe communication object with all MPI ranks active in the simulation. Default is the one with all ranks available.

Member Function Documentation

◆ beginReset()

void Opm::ParallelWellInfo::beginReset ( )

Inidicate that we will reset the ecl index information.

See also
pushBackEclIndex;

◆ broadcastFirstPerforationValue()

template<class T >
T Opm::ParallelWellInfo::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.

◆ clear()

void Opm::ParallelWellInfo::clear ( )

Free data of communication data structures.

◆ communicateAboveValues() [1/2]

std::vector< double > Opm::ParallelWellInfo::communicateAboveValues ( double  first_value,
const double *  current,
std::size_t  size 
) const

Creates an array of values for the perforation above.

Parameters
first_valueValue to use for above of the first perforation
currentC-array of the values at the perforations
sizeThe size of the C-array and the returned vector
Returns
a vector containing the values for the perforation above.

◆ communicateAboveValues() [2/2]

std::vector< double > Opm::ParallelWellInfo::communicateAboveValues ( double  first_value,
const std::vector< double > &  current 
) const

Creates an array of values for the perforation above.

Parameters
first_valueValue to use for above of the first perforation
currentvector of current values

◆ communicateBelowValues() [1/2]

std::vector< double > Opm::ParallelWellInfo::communicateBelowValues ( double  last_value,
const double *  current,
std::size_t  size 
) const

Creates an array of values for the perforation below.

Parameters
last_valueValue to use for below of the last perforation
currentC-array of the values at the perforations
sizeThe size of the C-array and the returned vector
Returns
a vector containing the values for the perforation above.

◆ communicateBelowValues() [2/2]

std::vector< double > Opm::ParallelWellInfo::communicateBelowValues ( double  last_value,
const std::vector< double > &  current 
) const

Creates an array of values for the perforation above.

Parameters
last_valueValue to use for below of the last perforation
currentvector of current values

◆ communicateFirstPerforation()

void Opm::ParallelWellInfo::communicateFirstPerforation ( bool  hasFirst)

Collectively decide which rank has first perforation.

◆ communication()

const Parallel::Communication & Opm::ParallelWellInfo::communication ( ) const
inline

◆ endReset()

void Opm::ParallelWellInfo::endReset ( )

Inidicate completion of reset of the ecl index information.

◆ getGlobalPerfContainerFactory()

const GlobalPerfContainerFactory & Opm::ParallelWellInfo::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.

◆ hasLocalCells()

bool Opm::ParallelWellInfo::hasLocalCells ( ) const
inline

Whether local cells are perforated somewhen.

◆ isOwner()

bool Opm::ParallelWellInfo::isOwner ( ) const
inline

◆ name()

const std::string & Opm::ParallelWellInfo::name ( ) const
inline

Name of the well.

◆ partialSumPerfValues()

template<class RAIterator >
void Opm::ParallelWellInfo::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
beginThe start of the range
ebdThe end of the range
Template Parameters
RAIteratorThe type og random access iterator

◆ pushBackEclIndex()

void Opm::ParallelWellInfo::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
aboveThe ECL index of the next open perforation above.
currentThe ECL index of the current open perforation.

◆ sumPerfValues()

template<typename It >
It::value_type Opm::ParallelWellInfo::sumPerfValues ( It  begin,
It  end 
) const

Sum all the values of the perforations.

Member Data Documentation

◆ INVALID_ECL_INDEX

constexpr int Opm::ParallelWellInfo::INVALID_ECL_INDEX = -1
staticconstexpr

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