My Project
Opm::MultisegmentWellContribution Class Reference

This class serves to duplicate the functionality of the MultisegmentWell A MultisegmentWell uses C, D and B and performs y -= (C^T * (D^-1 * (B*x))) B and C are matrices, with M rows and N columns, where N is the size of the matrix. More...

#include <MultisegmentWellContribution.hpp>

Public Types

using UMFPackIndex = int
 

Public Member Functions

 MultisegmentWellContribution (unsigned int dim, unsigned int dim_wells, unsigned int Mb, std::vector< double > &Bvalues, std::vector< unsigned int > &BcolIndices, std::vector< unsigned int > &BrowPointers, unsigned int DnumBlocks, double *Dvalues, UMFPackIndex *DcolPointers, UMFPackIndex *DrowIndices, std::vector< double > &Cvalues)
 Create a new MultisegmentWellContribution Matrices C and B are passed in Blocked CSR, matrix D in CSC The variables representing C, B and D will go out of scope when MultisegmentWell::addWellContribution() ends. More...
 
 ~MultisegmentWellContribution ()
 Destroy a MultisegmentWellContribution, and free memory.
 
void apply (double *h_x, double *h_y)
 Apply the MultisegmentWellContribution on CPU performs y -= (C^T * (D^-1 * (B*x))) for MultisegmentWell. More...
 
void setReordering (int *toOrder, bool reorder)
 Since the rows of the matrix are reordered, the columnindices of the matrixdata is incorrect Those indices need to be mapped via toOrder. More...
 

Detailed Description

This class serves to duplicate the functionality of the MultisegmentWell A MultisegmentWell uses C, D and B and performs y -= (C^T * (D^-1 * (B*x))) B and C are matrices, with M rows and N columns, where N is the size of the matrix.

They contain blocks of MultisegmentWell::numEq by MultisegmentWell::numWellEq. D is a MxM matrix, the square blocks have size MultisegmentWell::numWellEq. B*x and D*B*x are a vector with M*numWellEq doubles C*D*B*x is a vector with N*numEq doubles.

Constructor & Destructor Documentation

◆ MultisegmentWellContribution()

Opm::MultisegmentWellContribution::MultisegmentWellContribution ( unsigned int  dim,
unsigned int  dim_wells,
unsigned int  Mb,
std::vector< double > &  Bvalues,
std::vector< unsigned int > &  BcolIndices,
std::vector< unsigned int > &  BrowPointers,
unsigned int  DnumBlocks,
double *  Dvalues,
UMFPackIndex *  DcolPointers,
UMFPackIndex *  DrowIndices,
std::vector< double > &  Cvalues 
)

Create a new MultisegmentWellContribution Matrices C and B are passed in Blocked CSR, matrix D in CSC The variables representing C, B and D will go out of scope when MultisegmentWell::addWellContribution() ends.

Parameters
[in]dimsize of blocks in blockvectors x and y, equal to MultisegmentWell::numEq
[in]dim_wellssize of blocks of C, B and D, equal to MultisegmentWell::numWellEq
[in]Mbnumber of blockrows in C, B and D
[in]Bvaluesnonzero values of matrix B
[in]BcolIndicescolumnindices of blocks of matrix B
[in]BrowPointersrowpointers of matrix B
[in]DnumBlocksnumber of blocks in D
[in]Dvaluesnonzero values of matrix D
[in]DcolPointerscolumnpointers of matrix D
[in]DrowIndicesrowindices of matrix D
[in]Cvaluesnonzero values of matrix C

Member Function Documentation

◆ apply()

void Opm::MultisegmentWellContribution::apply ( double *  h_x,
double *  h_y 
)

Apply the MultisegmentWellContribution on CPU performs y -= (C^T * (D^-1 * (B*x))) for MultisegmentWell.

Parameters
[in]h_xvector x, must be on CPU
[in,out]h_yvector y, must be on CPU

◆ setReordering()

void Opm::MultisegmentWellContribution::setReordering ( int *  toOrder,
bool  reorder 
)

Since the rows of the matrix are reordered, the columnindices of the matrixdata is incorrect Those indices need to be mapped via toOrder.

Parameters
[in]toOrderarray with mappings
[in]reorderwhether reordering is actually used or not

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