diff --git a/opm/core/io/eclipse/BlackoilEclipseOutputWriter.cpp b/opm/core/io/eclipse/BlackoilEclipseOutputWriter.cpp index 075d8673..ed01cc34 100644 --- a/opm/core/io/eclipse/BlackoilEclipseOutputWriter.cpp +++ b/opm/core/io/eclipse/BlackoilEclipseOutputWriter.cpp @@ -86,8 +86,9 @@ struct EclipseKeyword : public EclipseHandle { const int stride) /// distance between each // allocate handle and put in smart pointer base class - : EclipseHandle (ecl_kw_alloc (name.c_str(), data.size (), type ()), - ecl_kw_free) { + : EclipseHandle ( + ecl_kw_alloc (name.c_str(), data.size (), type ()), + ecl_kw_free) { // number of elements we can possibly take from the vector const int num = data.size (); @@ -121,7 +122,7 @@ struct EclipseKeyword : public EclipseHandle { /// Constructor for optional fields EclipseKeyword (const std::string& name) - : EclipseHandle (0, ecl_kw_free) { + : EclipseHandle (0, ecl_kw_free) { static_cast (name); } @@ -155,12 +156,13 @@ struct EclipseFileName : public EclipseHandle { // filename formatting function returns a pointer to allocated // memory that must be released with the free() function - : EclipseHandle (ecl_util_alloc_filename (outputDir.c_str(), - baseName.c_str(), - type, - false, // formatted? - timer.currentStepNum ()), - EclipseFileName::freestr) { } + : EclipseHandle ( + ecl_util_alloc_filename (outputDir.c_str(), + baseName.c_str(), + type, + false, // formatted? + timer.currentStepNum ()), + freestr) { } private: /// Facade which allows us to free a const char* static void freestr (const char* ptr) { @@ -173,13 +175,14 @@ struct EclipseRestart : public EclipseHandle { const std::string& baseName, const SimulatorTimer& timer) // notice the poor man's polymorphism of the allocation function - : EclipseHandle ((timer.currentStepNum () > 0 ? ecl_rst_file_open_append - : ecl_rst_file_open_write)( - EclipseFileName (outputDir, - baseName, - ECL_UNIFIED_RESTART_FILE, - timer)), - ecl_rst_file_close) { } + : EclipseHandle ( + (timer.currentStepNum () > 0 ? ecl_rst_file_open_append + : ecl_rst_file_open_write)( + EclipseFileName (outputDir, + baseName, + ECL_UNIFIED_RESTART_FILE, + timer)), + ecl_rst_file_close) { } void writeHeader (const SimulatorTimer& timer, const int phases, @@ -206,8 +209,8 @@ struct EclipseRestart : public EclipseHandle { */ struct EclipseSolution : public EclipseHandle { EclipseSolution (EclipseRestart& rst_file) - : EclipseHandle (start_solution (rst_file), - ecl_rst_file_end_solution) { } + : EclipseHandle (start_solution (rst_file), + ecl_rst_file_end_solution) { } template void add (const EclipseKeyword& kw) { @@ -282,14 +285,15 @@ private: EclipseGrid (const std::vector& dxv, const std::vector& dyv, const std::vector& dzv) - : EclipseHandle (ecl_grid_alloc_dxv_dyv_dzv (dxv.size (), - dyv.size (), - dzv.size (), - &dxv[0], - &dyv[0], - &dzv[0], - NULL), - ecl_grid_free) { } + : EclipseHandle ( + ecl_grid_alloc_dxv_dyv_dzv (dxv.size (), + dyv.size (), + dzv.size (), + &dxv[0], + &dyv[0], + &dzv[0], + NULL), + ecl_grid_free) { } // setup smart pointer for cornerpoint grid EclipseGrid (const int dims[], @@ -297,14 +301,15 @@ private: const EclipseKeyword& coord, const EclipseKeyword& actnum, const EclipseKeyword& mapaxes) - : EclipseHandle (ecl_grid_alloc_GRDECL_kw(dims[0], - dims[1], - dims[2], - zcorn, - coord, - actnum, - mapaxes), - ecl_grid_free) { } + : EclipseHandle ( + ecl_grid_alloc_GRDECL_kw(dims[0], + dims[1], + dims[2], + zcorn, + coord, + actnum, + mapaxes), + ecl_grid_free) { } }; /** @@ -352,8 +357,9 @@ struct EclipseInit : public EclipseHandle { private: EclipseInit (const EclipseFileName& fname, const bool formatted) - : EclipseHandle (fortio_open_writer (fname, formatted, ECL_ENDIAN_FLIP), - fortio_fclose) { } + : EclipseHandle ( + fortio_open_writer (fname, formatted, ECL_ENDIAN_FLIP), + fortio_fclose) { } }; // forward decl. of mutually dependent type @@ -364,8 +370,9 @@ struct EclipseSummary : public EclipseHandle { const std::string& baseName, const SimulatorTimer& timer, const EclipseGridParser parser) - : EclipseHandle (alloc_writer (outputDir, baseName, timer, parser), - ecl_sum_free) { } + : EclipseHandle ( + alloc_writer (outputDir, baseName, timer, parser), + ecl_sum_free) { } typedef std::unique_ptr var_t; typedef std::vector vars_t; @@ -387,13 +394,13 @@ private: struct EclipseTimeStep : public EclipseHandle { EclipseTimeStep (const EclipseSummary& sum, const SimulatorTimer& timer) - : EclipseHandle (ecl_sum_add_tstep ( - sum, - timer.currentStepNum () + 1, - // currentTime is always relative to start - Opm::unit::convert::to (timer.currentTime (), - Opm::unit::day)), - ecl_sum_tstep_free) + : EclipseHandle ( + ecl_sum_add_tstep (sum, + timer.currentStepNum () + 1, + // currentTime is always relative to start + Opm::unit::convert::to (timer.currentTime (), + Opm::unit::day)), + ecl_sum_tstep_free) , sum_ (sum) { } ~EclipseTimeStep () { @@ -437,15 +444,16 @@ protected: WellType type, /* prod. or inj. */ char aggregation, /* rate or total */ std::string unit) - : EclipseHandle (ecl_sum_add_var (summary, - varName (phase, - type, - aggregation).c_str (), - wellName (parser, whichWell).c_str (), - /* num = */ 0, - unit.c_str(), - /* defaultValue = */ 0.), - smspec_node_free) + : EclipseHandle ( + ecl_sum_add_var (summary, + varName (phase, + type, + aggregation).c_str (), + wellName (parser, whichWell).c_str (), + /* num = */ 0, + unit.c_str(), + /* defaultValue = */ 0.), + smspec_node_free) // save these for when we update the value in a timestep , index_ (whichWell * BlackoilPhases::MaxNumPhases + phase)