20 #ifndef WELLCONTRIBUTIONS_HEADER_INCLUDED 21 #define WELLCONTRIBUTIONS_HEADER_INCLUDED 27 #include <dune/common/version.hh> 31 template<
class Scalar>
class MultisegmentWellContribution;
49 template<
class Scalar>
50 class WellContributions
53 static std::unique_ptr<WellContributions> create(
const std::string& accelerator_mode,
bool useWellConn);
55 using UMFPackIndex = SuiteSparse_long;
64 bool allocated =
false;
68 unsigned int dim_wells;
69 unsigned int num_blocks = 0;
70 unsigned int num_std_wells = 0;
71 unsigned int num_ms_wells = 0;
72 unsigned int num_blocks_so_far = 0;
73 unsigned int num_std_wells_so_far = 0;
74 std::vector<unsigned int> val_pointers;
76 std::vector<std::unique_ptr<MultisegmentWellContribution<Scalar>>> multisegments;
79 unsigned int getNumWells(){
80 return num_std_wells + num_ms_wells;
96 void setBlockSize(
unsigned int dim,
unsigned int dim_wells);
123 unsigned int dim_wells,
125 std::vector<Scalar>& Bvalues,
126 std::vector<unsigned int>& BcolIndices,
127 std::vector<unsigned int>& BrowPointers,
128 unsigned int DnumBlocks,
130 UMFPackIndex* DcolPointers,
131 UMFPackIndex* DrowIndices,
132 std::vector<Scalar>& Cvalues);
void alloc()
Allocate memory for the StandardWells.
Definition: WellContributions.cpp:145
virtual ~WellContributions()
Empty destructor.
virtual void APIalloc()
API specific allocation.
Definition: WellContributions.hpp:135
void addMatrix(MatrixType type, int *colIndices, Scalar *values, unsigned int val_size)
Store a matrix in this object, in blocked csr format, can only be called after alloc() is called...
Definition: WellContributions.cpp:92
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
void setBlockSize(unsigned int dim, unsigned int dim_wells)
Indicate how large the blocks of the StandardWell (C and B) are.
Definition: WellContributions.cpp:114
virtual void APIaddMatrix(MatrixType, int *, Scalar *, unsigned int)
Api specific upload of matrix.
Definition: WellContributions.hpp:138
void addMultisegmentWellContribution(unsigned int dim, unsigned int dim_wells, unsigned int Mb, std::vector< Scalar > &Bvalues, std::vector< unsigned int > &BcolIndices, std::vector< unsigned int > &BrowPointers, unsigned int DnumBlocks, Scalar *Dvalues, UMFPackIndex *DcolPointers, UMFPackIndex *DrowIndices, std::vector< Scalar > &Cvalues)
Add a MultisegmentWellContribution, actually creates an object on heap that is destroyed in the destr...
Definition: WellContributions.cpp:157
void addNumBlocks(unsigned int numBlocks)
Indicate how large the next StandardWell is, this function cannot be called after alloc() is called...
Definition: WellContributions.cpp:135
MatrixType
StandardWell has C, D and B matrices that need to be copied.
Definition: WellContributions.hpp:57
void setVectorSize(unsigned N)
Set size of vector that the wells are applied to.
Definition: WellContributions.cpp:129