From b91f747a3eb6087fe2286ccc223d1abf11a1fcde Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Wed, 16 Nov 2016 12:15:24 +0100 Subject: [PATCH] Removed second implementation of matlab output. There is already a generic one with the Grid implementation being the template parameter in the header file. The other implementation using UnstructuredGrid does exactly the same. Therefore we remove it with this commit. --- .../SimulatorFullyImplicitBlackoilOutput.cpp | 60 ------------------- .../SimulatorFullyImplicitBlackoilOutput.hpp | 6 -- 2 files changed, 66 deletions(-) diff --git a/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.cpp b/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.cpp index 3c8e010e6..c5edd8562 100644 --- a/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.cpp +++ b/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.cpp @@ -94,66 +94,6 @@ namespace Opm Opm::writeVtkData(grid, dm, vtkfile); } - - void outputStateMatlab(const UnstructuredGrid& grid, - const Opm::SimulationDataContainer& state, - const int step, - const std::string& output_dir) - { - Opm::DataMap dm; - dm["saturation"] = &state.saturation(); - dm["pressure"] = &state.pressure(); - for (const auto& pair : state.cellData()) { - const std::string& name = pair.first; - std::string key; - if( name == "SURFACEVOL" ) { - key = "surfvolume"; - } - else if( name == "RV" ) { - key = "rv"; - } - else if( name == "GASOILRATIO" ) { - key = "rs"; - } - else { // otherwise skip entry - continue; - } - // set data to datmap - dm[ key ] = &pair.second; - } - - std::vector cell_velocity; - Opm::estimateCellVelocity(AutoDiffGrid::numCells(grid), - AutoDiffGrid::numFaces(grid), - AutoDiffGrid::beginFaceCentroids(grid), - UgGridHelpers::faceCells(grid), - AutoDiffGrid::beginCellCentroids(grid), - AutoDiffGrid::beginCellVolumes(grid), - AutoDiffGrid::dimensions(grid), - state.faceflux(), cell_velocity); - dm["velocity"] = &cell_velocity; - - // Write data (not grid) in Matlab format - for (Opm::DataMap::const_iterator it = dm.begin(); it != dm.end(); ++it) { - std::ostringstream fname; - fname << output_dir << "/" << it->first; - boost::filesystem::path fpath = fname.str(); - try { - create_directories(fpath); - } - catch (...) { - OPM_THROW(std::runtime_error, "Creating directories failed: " << fpath); - } - fname << "/" << std::setw(3) << std::setfill('0') << step << ".txt"; - std::ofstream file(fname.str().c_str()); - if (!file) { - OPM_THROW(std::runtime_error, "Failed to open " << fname.str()); - } - file.precision(15); - const std::vector& d = *(it->second); - std::copy(d.begin(), d.end(), std::ostream_iterator(file, "\n")); - } - } void outputWellStateMatlab(const Opm::WellState& well_state, const int step, const std::string& output_dir) diff --git a/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp b/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp index 20489024f..0d97a8749 100644 --- a/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp +++ b/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp @@ -68,12 +68,6 @@ namespace Opm const int step, const std::string& output_dir); - - void outputStateMatlab(const UnstructuredGrid& grid, - const Opm::SimulationDataContainer& state, - const int step, - const std::string& output_dir); - void outputWellStateMatlab(const Opm::WellState& well_state, const int step, const std::string& output_dir);