20 #ifndef MULTISEGMENTWELLCONTRIBUTION_HEADER_INCLUDED
21 #define MULTISEGMENTWELLCONTRIBUTION_HEADER_INCLUDED
26 #include <cuda_runtime.h>
29 #if HAVE_SUITESPARSE_UMFPACK
32 #include <dune/common/version.hh>
49 unsigned int dim_wells;
59 unsigned int DnumBlocks;
60 std::vector<double> Cvals;
61 std::vector<double> Dvals;
62 std::vector<double> Bvals;
63 std::vector<int> Dcols;
64 std::vector<unsigned int> Bcols;
65 std::vector<int> Drows;
66 std::vector<unsigned int> Brows;
67 std::vector<double> z1;
68 std::vector<double> z2;
69 void *UMFPACK_Symbolic, *UMFPACK_Numeric;
71 int *toOrder =
nullptr;
76 unsigned int getColIdx(
unsigned int idx);
80 #if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 7)
81 using UMFPackIndex = SuiteSparse_long;
83 using UMFPackIndex = int;
89 void setCudaStream(cudaStream_t stream);
108 std::vector<double> &Bvalues, std::vector<unsigned int> &BcolIndices, std::vector<unsigned int> &BrowPointers,
109 unsigned int DnumBlocks,
double *Dvalues, UMFPackIndex *DcolPointers,
110 UMFPackIndex *DrowIndices, std::vector<double> &Cvalues);
119 void apply(
double *h_x,
double *h_y);
This class serves to duplicate the functionality of the MultisegmentWell A MultisegmentWell uses C,...
Definition: MultisegmentWellContribution.hpp:45
~MultisegmentWellContribution()
Destroy a MultisegmentWellContribution, and free memory.
Definition: MultisegmentWellContribution.cpp:60
void apply(double *h_x, double *h_y)
Apply the MultisegmentWellContribution on CPU performs y -= (C^T * (D^-1 * (B*x))) for MultisegmentWe...
Definition: MultisegmentWellContribution.cpp:70
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,...
Definition: MultisegmentWellContribution.cpp:32
void setReordering(int *toOrder, bool reorder)
Since the rows of the matrix are reordered, the columnindices of the matrixdata is incorrect Those in...
Definition: MultisegmentWellContribution.cpp:128
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: BlackoilPhases.hpp:27