parallel running for flow_mutlisegment

SPE9 can be run in parallel now.
This commit is contained in:
Kai Bao 2015-11-25 12:17:44 +01:00
parent 4c73f3c01c
commit 38a9dbd9ff
3 changed files with 17 additions and 1 deletions

View File

@ -78,6 +78,7 @@ list (APPEND TEST_DATA_FILES
list (APPEND EXAMPLE_SOURCE_FILES
examples/find_zero.cpp
examples/flow.cpp
examples/flow_multisegment_mpi.cpp
examples/flow_multisegment.cpp
examples/flow_solvent.cpp
examples/sim_2p_incomp_ad.cpp

View File

@ -0,0 +1,2 @@
#define WANT_DUNE_CORNERPOINTGRID 1
#include "flow_multisegment.cpp"

View File

@ -119,7 +119,20 @@ namespace Opm
if (wells_ecl[i]->getStatus(timer.currentStepNum()) == WellCommon::SHUT) {
continue;
}
wells_multisegment.push_back(std::make_shared<WellMultiSegment>(wells_ecl[i], timer.currentStepNum(), wells));
// checking if the well can be found in the wells
const std::string& well_name = wells_ecl[i]->name();
// number of wells in wells
const int nw_wells = wells->number_of_wells;
int index_well;
for (index_well = 0; index_well < nw_wells; ++index_well) {
if (well_name == std::string(wells->name[index_well])) {
break;
}
}
if (index_well != nw_wells) { // found in the wells
wells_multisegment.push_back(std::make_shared<WellMultiSegment>(wells_ecl[i], timer.currentStepNum(), wells));
}
}
well_state.init(wells_multisegment, state, prev_well_state);