recovering the compilation after updating opm-parser.

This commit is contained in:
Kai Bao
2015-11-12 13:15:27 +01:00
parent c8fbb0b80d
commit c3b4088448
3 changed files with 55 additions and 14 deletions

View File

@@ -80,6 +80,7 @@
#include <opm/autodiff/SimulatorFullyImplicitBlackoilMultiSegment.hpp>
#include <opm/autodiff/BlackoilPropsAdFromDeck.hpp>
#include <opm/autodiff/RedistributeDataHandles.hpp>
#include <opm/autodiff/moduleVersion.hpp>
#include <opm/core/utility/share_obj.hpp>
@@ -95,6 +96,9 @@
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
#ifdef _OPENMP
#include <omp.h>
#endif
#include <memory>
#include <algorithm>
#include <cstdlib>
@@ -139,9 +143,11 @@ try
if(output_cout)
{
std::string version = moduleVersionName();
std::cout << "**********************************************************************\n";
std::cout << "* *\n";
std::cout << "* This is Flow (version 2015.04) *\n";
std::cout << "* This is Flow (version " << version << ")"
<< std::string(26 - version.size(), ' ') << "*\n";
std::cout << "* *\n";
std::cout << "* Flow is a simulator for fully implicit three-phase black-oil flow, *\n";
std::cout << "* and is part of OPM. For more information see: *\n";
@@ -150,6 +156,21 @@ try
std::cout << "**********************************************************************\n\n";
}
#ifdef _OPENMP
if (!getenv("OMP_NUM_THREADS")) {
//Default to at most 4 threads, regardless of
//number of cores (unless ENV(OMP_NUM_THREADS) is defined)
int num_cores = omp_get_num_procs();
int num_threads = std::min(4, num_cores);
omp_set_num_threads(num_threads);
}
#pragma omp parallel
if (omp_get_thread_num() == 0){
//opm_get_num_threads() only works as expected within a parallel region.
std::cout << "OpenMP using " << omp_get_num_threads() << " threads." << std::endl;
}
#endif
// Read parameters, see if a deck was specified on the command line.
if ( output_cout )
{
@@ -342,7 +363,7 @@ try
// and initilialize new properties and states for it.
if( mpi_size > 1 )
{
Opm::distributeGridAndData( grid, eclipseState, state, new_props, geoprops, parallel_information, use_local_perm );
Opm::distributeGridAndData( grid, deck, eclipseState, state, new_props, geoprops, materialLawManager, parallel_information, use_local_perm );
}
// create output writer after grid is distributed, otherwise the parallel output
@@ -352,12 +373,33 @@ try
// Solver for Newton iterations.
std::unique_ptr<NewtonIterationBlackoilInterface> fis_solver;
if (param.getDefault("use_interleaved", true)) {
fis_solver.reset(new NewtonIterationBlackoilInterleaved(param, parallel_information));
} else if (param.getDefault("use_cpr", true)) {
fis_solver.reset(new NewtonIterationBlackoilCPR(param, parallel_information));
} else {
fis_solver.reset(new NewtonIterationBlackoilSimple(param, parallel_information));
{
const std::string cprSolver = "cpr";
const std::string interleavedSolver = "interleaved";
const std::string directSolver = "direct";
const std::string flowDefaultSolver = interleavedSolver;
std::shared_ptr<const Opm::SimulationConfig> simCfg = eclipseState->getSimulationConfig();
std::string solver_approach = flowDefaultSolver;
if (param.has("solver_approach")) {
solver_approach = param.get<std::string>("solver_approach");
} else {
if (simCfg->useCPR()) {
solver_approach = cprSolver;
}
}
if (solver_approach == cprSolver) {
fis_solver.reset(new NewtonIterationBlackoilCPR(param, parallel_information));
} else if (solver_approach == interleavedSolver) {
fis_solver.reset(new NewtonIterationBlackoilInterleaved(param, parallel_information));
} else if (solver_approach == directSolver) {
fis_solver.reset(new NewtonIterationBlackoilSimple(param, parallel_information));
} else {
OPM_THROW( std::runtime_error , "Internal error - solver approach " << solver_approach << " not recognized.");
}
}
Opm::ScheduleConstPtr schedule = eclipseState->getSchedule();

View File

@@ -19,7 +19,6 @@
*/
#include <opm/autodiff/WellMultiSegment.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/SegmentSet.hpp>
namespace Opm
@@ -35,7 +34,7 @@ namespace Opm
m_well_name_ = well->name();
CompletionSetConstPtr completion_set = well->getCompletions(time_step);
if (well->isMultiSegment()) {
if (well->isMultiSegment(time_step)) {
m_is_multi_segment_ = true;
SegmentSetConstPtr segment_set = well->getSegmentSet(time_step);
m_number_of_segments_ = segment_set->numberSegment();
@@ -62,7 +61,7 @@ namespace Opm
// now the segment for top segment is 0, then its outlet segment will be -1
// it is also the flag to indicate the top segment
m_outlet_segment_[i] = segment_set->numberToLocation((*segment_set)[i]->outletSegment());
m_segment_length_[i] = (*segment_set)[i]->length();
m_segment_length_[i] = (*segment_set)[i]->totalLength();
m_segment_depth_[i] = (*segment_set)[i]->depth();
m_segment_internal_diameter_[i] = (*segment_set)[i]->internalDiameter();
m_segment_roughness_[i] = (*segment_set)[i]->roughness();
@@ -384,7 +383,7 @@ namespace Opm
}
std::string WellMultiSegment::compPressureDrop() const {
return WellSegment::CompPresureDropEnumToString(m_comp_pressure_drop_);
return WellSegment::CompPressureDropEnumToString(m_comp_pressure_drop_);
}
const std::vector<double>& WellMultiSegment::compFrac() const {

View File

@@ -31,7 +31,7 @@
#include <opm/core/simulator/WellState.hpp>
#include <opm/common/ErrorMacros.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/SegmentSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/SegmentSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
#include <vector>
#include <cassert>
@@ -121,7 +121,7 @@ namespace Opm
// changing it when figuring out how to using it
struct WellControls *m_well_controls_;
// components of the pressure drop to be included
WellSegment::CompPresureDropEnum m_comp_pressure_drop_;
WellSegment::CompPressureDropEnum m_comp_pressure_drop_;
// multi-phase flow model
WellSegment::MultiPhaseModelEnum m_multiphase_model_;
// number of perforation for this well