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>
45class MultisegmentWellContribution
50 unsigned int dim_wells;
60 unsigned int DnumBlocks;
61 std::vector<Scalar> Cvals;
62 std::vector<Scalar> Dvals;
63 std::vector<Scalar> Bvals;
64 std::vector<int> Dcols;
65 std::vector<unsigned int> Bcols;
66 std::vector<int> Drows;
67 std::vector<unsigned int> Brows;
68 std::vector<Scalar> z1;
69 std::vector<Scalar> z2;
70 void *UMFPACK_Symbolic, *UMFPACK_Numeric;
74 unsigned int getColIdx(
unsigned int idx);
77 using UMFPackIndex = SuiteSparse_long;
82 void setCudaStream(cudaStream_t stream);
101 std::vector<Scalar>& Bvalues,
102 std::vector<unsigned int>& BcolIndices,
103 std::vector<unsigned int>& BrowPointers,
104 unsigned int DnumBlocks,
106 UMFPackIndex* DcolPointers,
107 UMFPackIndex* DrowIndices,
108 std::vector<Scalar>& Cvalues);
117 void apply(Scalar* h_x, Scalar* h_y);
MultisegmentWellContribution(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)
Create a new MultisegmentWellContribution Matrices C and B are passed in Blocked CSR,...
Definition MultisegmentWellContribution.cpp:34
~MultisegmentWellContribution()
Destroy a MultisegmentWellContribution, and free memory.
Definition MultisegmentWellContribution.cpp:71
void apply(Scalar *h_x, Scalar *h_y)
Apply the MultisegmentWellContribution on CPU performs y -= (C^T * (D^-1 * (B*x))) for MultisegmentWe...
Definition MultisegmentWellContribution.cpp:83
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37