mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Fixed seg fault when there are only mswells
This commit is contained in:
parent
7aad035bcf
commit
89cefd8d95
@ -75,9 +75,9 @@ namespace bda
|
||||
}
|
||||
|
||||
void WellContributionsOCLContainer::copy_to_gpu(Opm::WellContributions &wellContribs, int *toOrder_){
|
||||
if(num_std_wells > 0){
|
||||
toOrder.insert(toOrder.end(), toOrder_, toOrder_ + Nb);
|
||||
toOrder.insert(toOrder.end(), toOrder_, toOrder_ + Nb);
|
||||
|
||||
if(num_std_wells > 0){
|
||||
cl::Event event;
|
||||
std::vector<cl::Event> events(7);
|
||||
queue->enqueueWriteBuffer(s.Cnnzs, CL_FALSE, 0, sizeof(double) * wellContribs.h_Cnnzs_ocl.size(), wellContribs.h_Cnnzs_ocl.data(), nullptr, &events[0]);
|
||||
@ -159,10 +159,11 @@ namespace bda
|
||||
|
||||
// actually apply MultisegmentWells
|
||||
for(auto well: *multisegments){
|
||||
well->setReordering(toOrder.data(), true);
|
||||
well->setReordering(toOrder.data(), reorder);
|
||||
well->apply(x_msw.data(), y_msw.data());
|
||||
}
|
||||
|
||||
|
||||
// copy vector y from CPU to GPU
|
||||
queue->enqueueWriteBuffer(y, CL_FALSE, 0, sizeof(double) * N, y_msw.data(), nullptr, &event);
|
||||
event.wait();
|
||||
|
@ -31,11 +31,13 @@ namespace bda
|
||||
private:
|
||||
typedef std::vector<Opm::MultisegmentWellContribution*> mswVecT;
|
||||
|
||||
int N, Nb;
|
||||
unsigned int dim, dim_wells;
|
||||
unsigned int num_blocks = 0;
|
||||
unsigned int num_std_wells = 0;
|
||||
unsigned int num_ms_wells = 0; // number of MultisegmentWells in this object, must equal multisegments.size()
|
||||
int N, Nb;
|
||||
|
||||
bool reorder = true;
|
||||
std::vector<int> toOrder;
|
||||
std::vector<double> x_msw, y_msw;
|
||||
std::unique_ptr<mswVecT> multisegments;
|
||||
|
Loading…
Reference in New Issue
Block a user