Merge pull request #859 from atgeirr/compile-fixes

Compile fixes
This commit is contained in:
Atgeirr Flø Rasmussen 2016-10-14 13:31:12 +02:00 committed by GitHub
commit d007cd8e6e
3 changed files with 6 additions and 4 deletions

View File

@ -828,7 +828,6 @@ namespace Opm
if( msWells().empty() ) return ;
std::string modestring[4] = { "BHP", "THP", "RESERVOIR_RATE", "SURFACE_RATE" };
// Find, for each well, if any constraints are broken. If so,
// switch control to first broken constraint.
const int np = numPhases();

View File

@ -23,6 +23,7 @@
#endif // HAVE_CONFIG_H
#include <opm/simulators/WellSwitchingLogger.hpp>
#include <numeric>
namespace Opm
{
@ -115,18 +116,19 @@ void WellSwitchingLogger::unpackDataAndLog(std::vector<char>& recv_buffer,
well_name_lengths.data(), well_name_lengths.size(),
MPI_INT, MPI_COMM_WORLD);
std::vector<char> well_name;
for ( int i = 0; i < no_switches; ++i )
{
char well_name[well_name_lengths[i]] = {};
well_name.resize(well_name_lengths[i]);
MPI_Unpack(recv_buffer.data(), recv_buffer.size(), &offset,
well_name, well_name_lengths[i], MPI_CHAR,
well_name.data(), well_name_lengths[i], MPI_CHAR,
MPI_COMM_WORLD);
std::array<char,2> fromto{{}};
MPI_Unpack(recv_buffer.data(), recv_buffer.size(), &offset,
fromto.data(), 2, MPI_CHAR, MPI_COMM_WORLD);
logSwitch(well_name, fromto, p);
logSwitch(well_name.data(), fromto, p);
}
}
}

View File

@ -21,6 +21,7 @@
#ifndef OPM_WELLSWITCHINGLOGGER_HEADER_INCLUDED
#define OPM_WELLSWITCHINGLOGGER_HEADER_INCLUDED
#include <array>
#include <map>
#include <string>
#include <vector>