Opm::ParallelWellInfo< Scalar > Class Template Reference

Class encapsulating some information about parallel wells. More...

#include <ParallelWellInfo.hpp>

Inheritance diagram for Opm::ParallelWellInfo< Scalar >:
Inheritance graph

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< Scalar > communicateAboveValues (Scalar first_value, const Scalar *current, std::size_t size) const
 Creates an array of values for the perforation above. More...
 
std::vector< Scalar > communicateAboveValues (Scalar first_value, const std::vector< Scalar > &current) const
 Creates an array of values for the perforation above. More...
 
std::vector< Scalar > communicateBelowValues (Scalar last_value, const Scalar *current, std::size_t size) const
 Creates an array of values for the perforation below. More...
 
std::vector< Scalar > communicateBelowValues (Scalar last_value, const std::vector< Scalar > &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 GlobalPerfContainerFactory< Scalar > & getGlobalPerfContainerFactory () 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

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() [1/2]

template<class Scalar >
Opm::ParallelWellInfo< Scalar >::ParallelWellInfo ( const std::string &  name = {""},
bool  hasLocalCells = true 
)

Constructs object using MPI_COMM_SELF.

◆ ParallelWellInfo() [2/2]

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_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()

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.

◆ clear()

template<class Scalar >
void Opm::ParallelWellInfo< Scalar >::clear ( )

Free data of communication data structures.

◆ 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_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]

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_valueValue to use for above of the first perforation
currentvector 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_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]

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_valueValue to use for below of the last perforation
currentvector of current values

◆ communicateFirstPerforation()

template<class Scalar >
void Opm::ParallelWellInfo< Scalar >::communicateFirstPerforation ( bool  hasFirst)

Collectively decide which rank has first perforation.

◆ communication()

template<class Scalar >
const Parallel::Communication & Opm::ParallelWellInfo< Scalar >::communication ( ) const
inline

◆ endReset()

template<class Scalar >
void Opm::ParallelWellInfo< Scalar >::endReset ( )

Inidicate completion of reset of the ecl index information.

◆ 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.

◆ hasLocalCells()

template<class Scalar >
bool Opm::ParallelWellInfo< Scalar >::hasLocalCells ( ) const
inline

Whether local cells are perforated somewhen.

◆ isOwner()

template<class Scalar >
bool Opm::ParallelWellInfo< Scalar >::isOwner ( ) const
inline

◆ name()

template<class Scalar >
const std::string & Opm::ParallelWellInfo< Scalar >::name ( ) const
inline

Name of the well.

◆ 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
beginThe start of the range
ebdThe end of the range
Template Parameters
RAIteratorThe 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
aboveThe ECL index of the next open perforation above.
currentThe 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.

Member Data Documentation

◆ INVALID_ECL_INDEX

template<class Scalar >
constexpr int Opm::ParallelWellInfo< Scalar >::INVALID_ECL_INDEX = -1
staticconstexpr

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