From abf5443f334ed4eae8e22f939a129dfec9fb33a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Wed, 9 Dec 2015 09:56:09 +0100 Subject: [PATCH] Replace flowMain() function with FlowMain class. --- examples/flow.cpp | 3 ++- examples/flow_mpi.cpp | 3 ++- examples/flow_multisegment.cpp | 3 ++- examples/flow_multisegment_mpi.cpp | 3 ++- opm/autodiff/flowMain.hpp | 7 ++++++- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/examples/flow.cpp b/examples/flow.cpp index 9e601ff66..f47bee9f0 100644 --- a/examples/flow.cpp +++ b/examples/flow.cpp @@ -37,5 +37,6 @@ main(int argc, char** argv) typedef UnstructuredGrid Grid; typedef Opm::SimulatorFullyImplicitBlackoil Simulator; - return Opm::flowMain(argc, argv); + Opm::FlowMain mainfunc; + return mainfunc.execute(argc, argv); } diff --git a/examples/flow_mpi.cpp b/examples/flow_mpi.cpp index c68e850d4..3ae0b57ab 100644 --- a/examples/flow_mpi.cpp +++ b/examples/flow_mpi.cpp @@ -37,5 +37,6 @@ main(int argc, char** argv) typedef Dune::CpGrid Grid; typedef Opm::SimulatorFullyImplicitBlackoil Simulator; - return Opm::flowMain(argc, argv); + Opm::FlowMain mainfunc; + return mainfunc.execute(argc, argv); } diff --git a/examples/flow_multisegment.cpp b/examples/flow_multisegment.cpp index feec4346d..447a963c7 100644 --- a/examples/flow_multisegment.cpp +++ b/examples/flow_multisegment.cpp @@ -37,5 +37,6 @@ main(int argc, char** argv) typedef UnstructuredGrid Grid; typedef Opm::SimulatorFullyImplicitBlackoilMultiSegment Simulator; - return Opm::flowMain(argc, argv); + Opm::FlowMain mainfunc; + return mainfunc.execute(argc, argv); } diff --git a/examples/flow_multisegment_mpi.cpp b/examples/flow_multisegment_mpi.cpp index 5525e0658..64b6fdc85 100644 --- a/examples/flow_multisegment_mpi.cpp +++ b/examples/flow_multisegment_mpi.cpp @@ -37,5 +37,6 @@ main(int argc, char** argv) typedef Dune::CpGrid Grid; typedef Opm::SimulatorFullyImplicitBlackoilMultiSegment Simulator; - return Opm::flowMain(argc, argv); + Opm::FlowMain mainfunc; + return mainfunc.execute(argc, argv); } diff --git a/opm/autodiff/flowMain.hpp b/opm/autodiff/flowMain.hpp index 76647abd4..8b3b08cfa 100644 --- a/opm/autodiff/flowMain.hpp +++ b/opm/autodiff/flowMain.hpp @@ -119,7 +119,10 @@ namespace Opm /// content of this function used to be in the main() function of /// flow.cpp. template - inline int flowMain(int argc, char** argv) + class FlowMain + { + public: + int execute(int argc, char** argv) try { using namespace Opm; @@ -443,6 +446,8 @@ namespace Opm return EXIT_FAILURE; } + }; // class FlowMain + } // namespace Opm