#1035 Replaced auto in the example/test code to understand what is going on.

This commit is contained in:
Jacob Støren 2016-12-14 09:38:51 +01:00
parent c555f77a71
commit cd6ee6466b
2 changed files with 13 additions and 10 deletions

View File

@ -62,7 +62,7 @@ namespace example {
Opm::ECLGraph::PhaseIndex::Liquid ,
Opm::ECLGraph::PhaseIndex::Vapour })
{
const auto pflux = G.flux(p);
const std::vector<double> pflux = G.flux(p);
if (! pflux.empty()) {
assert (pflux.size() == nconn.total);
@ -125,19 +125,22 @@ namespace example {
inline Opm::FlowDiagnostics::Toolbox
initialiseFlowDiagnostics(const Opm::ECLGraph& G)
{
const auto connGraph = Opm::FlowDiagnostics::
ConnectivityGraph{ static_cast<int>(G.numCells()),
G.neighbours() };
const Opm::FlowDiagnostics::ConnectivityGraph connGraph =
Opm::FlowDiagnostics::ConnectivityGraph{ static_cast<int>(G.numCells()),
G.neighbours() };
// Create the Toolbox.
auto tool = Opm::FlowDiagnostics::Toolbox{ connGraph };
Opm::FlowDiagnostics::Toolbox tool = Opm::FlowDiagnostics::Toolbox{ connGraph };
tool.assignPoreVolume(G.poreVolume());
tool.assignConnectionFlux(Hack::convert_flux_to_SI(extractFluxField(G)));
auto wsol = Opm::ECLWellSolution{};
Opm::FlowDiagnostics::ConnectionValues connectionsVals = Hack::convert_flux_to_SI(extractFluxField(G));
tool.assignConnectionFlux(connectionsVals);
const auto well_fluxes =
Opm::ECLWellSolution wsol = Opm::ECLWellSolution{};
const std::vector<Opm::ECLWellSolution::WellData> well_fluxes =
wsol.solution(G.rawResultData(), G.numGrids());
tool.assignInflowFlux(extractWellFlows(G, well_fluxes));

View File

@ -29,8 +29,8 @@ TEST(opm_flowdiagnostics_test, basic_construction)
// Solve for time of flight.
std::vector<Opm::FlowDiagnostics::CellSet> start;
auto sol = fdTool.computeInjectionDiagnostics(start);
const auto& tof = sol.fd.timeOfFlight();
Opm::FlowDiagnostics::Toolbox::Forward sol = fdTool.computeInjectionDiagnostics(start);
const std::vector<double>& tof = sol.fd.timeOfFlight();
// Write it to standard out.
std::cout.precision(16);