diff --git a/examples/flow_polymer.cpp b/examples/flow_polymer.cpp index 7973fe934..3dfc26b09 100644 --- a/examples/flow_polymer.cpp +++ b/examples/flow_polymer.cpp @@ -91,16 +91,37 @@ try { using namespace Opm; - std::cout << "\n================ Test program for fully implicit three-phase black-oil-polymer flow ===============\n\n"; - parameter::ParameterGroup param(argc, argv, false); - std::cout << "--------------- Reading parameters ---------------" << std::endl; + std::cout << "*********************************************************************************************\n"; + std::cout << "* *\n"; + std::cout << "* This is Flow-Polymer (version 2015.04) *\n"; + std::cout << "* *\n"; + std::cout << "* Flow-Polymer is a simulator for three-phase black-oil-polymer flow that is a part of OPM. *\n"; + std::cout << "* For more information see: *\n"; + std::cout << "* http://opm-project.org *\n"; + std::cout << "* *\n"; + std::cout << "*********************************************************************************************\n\n"; - // If we have a "deck_filename", grid and props will be read from that. - bool use_deck = param.has("deck_filename"); - if (!use_deck) { - OPM_THROW(std::runtime_error, "This program must be run with an input deck. " - "Specify the deck with deck_filename=deckname.data (for example)."); + // Read parameters, see if a deck was specified on the command line. + std::cout << "--------------- Reading parameters ---------------" << std::endl; + parameter::ParameterGroup param(argc, argv, false); + if (!param.unhandledArguments().empty()) { + if (param.unhandledArguments().size() != 1) { + OPM_THROW(std::runtime_error, "You can only specify a single input deck on the command line."); + } else { + param.insertParameter("deck_filename", param.unhandledArguments()[0]); + } } + + // We must have an input deck. Grid and props will be read from that. + if (!param.has("deck_filename")) { + std::cerr << "This program must be run with an input deck.\n" + "Specify the deck filename either\n" + " a) as a command line argument by itself\n" + " b) as a command line parameter with the syntax deck_filename=, or\n" + " c) as a parameter in a parameter file (.param or .xml) passed to the program.\n"; + OPM_THROW(std::runtime_error, "Input deck required."); + } + std::shared_ptr grid; std::shared_ptr props; std::shared_ptr new_props; @@ -239,7 +260,7 @@ try if (use_wpolymer) { OPM_MESSAGE("Warning: use WPOLYMER in a non-polymer scenario."); } - } + } bool use_local_perm = param.getDefault("use_local_perm", true); Opm::DerivedGeology geology(*grid->c_grid(), *new_props, eclipseState, use_local_perm, grav); diff --git a/m4/.ignore b/m4/.ignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/m4/opm.m4 b/m4/opm.m4 deleted file mode 100644 index caad8bc1a..000000000 --- a/m4/opm.m4 +++ /dev/null @@ -1,50 +0,0 @@ -dnl -*- autoconf -*- - -dnl OPM_PKG_CONFIG_MODULE (name, version, description) -dnl -dnl Common routine to include configuration module for an OPM project -AC_DEFUN([OPM_CHECK_PKG_MODULE],[ - dnl local variables representing parameters - m4_pushdef([_opm_name], [$1]) - m4_pushdef([_opm_version], [$2]) - m4_pushdef([_opm_description], [$3]) - - dnl macro-friendly version of the name; uppercase and with dashes - dnl replaced with underscores - m4_pushdef([_opm_module], [m4_translit(_opm_name,[-],[_])]) - m4_pushdef([_OPM_MODULE], [m4_toupper(_opm_module)]) - - dnl if we are given the location as a parameter, look there first - AC_ARG_WITH(_opm_name, - AS_HELP_STRING([--with-_opm_name=PATH],[_opm_description directory])) - - AS_IF([test -n "$with_[]_opm_module"],[ - export PKG_CONFIG_PATH=$with_[]_opm_module:$PKG_CONFIG_PATH - ]) - - dnl let pkg-config do the heavy lifting of finding the .pc file - PKG_CHECK_MODULES(_OPM_MODULE,[_opm_name = _opm_version],[ - AC_DEFINE(HAVE_[]_OPM_MODULE,[1],[_opm_description available]) - ]) - - dnl TODO: here we could call PKG_CONFIG --variable if we need more - - dnl make flag available for Makefiles too - AM_CONDITIONAL(HAVE_[]_OPM_MODULE, test x$HAVE_[]_OPM_MODULE = x1) - - dnl add our libraries to the global list of compiler and linker options - DUNE_CPPFLAGS="$DUNE_CPPFLAGS $_OPM_MODULE[]_CFLAGS" - DUNE_LIBS="$DUNE_LIBS $_OPM_MODULE[]_LIBS" - - # add this module to summary (if we are used with dunecontrol) - ifdef([DUNE_MODULE_ADD_SUMMARY_ENTRY],[ - DUNE_MODULE_ADD_SUMMARY_ENTRY(_opm_name) - ]) - - dnl cleanup - m4_popdef([_OPM_MODULE]) - m4_popdef([_opm_module]) - m4_popdef([_opm_description]) - m4_popdef([_opm_version]) - m4_popdef([_opm_name]) -]) diff --git a/m4/opm_polymer.m4 b/m4/opm_polymer.m4 deleted file mode 100644 index 873ae86f5..000000000 --- a/m4/opm_polymer.m4 +++ /dev/null @@ -1,12 +0,0 @@ -dnl -*- autoconf -*- - -dnl locate opm-polymer library itself; this macro is called by every module -dnl that depends on opm-polymer. -AC_DEFUN([OPM_POLYMER_CHECK_MODULE], -[ - OPM_CHECK_PKG_MODULE([opm-polymer],[1.0],[OPM module for polymer simulations]) -]) - -dnl find all prerequisites of opm-polymer; nothing to do here since this -dnl is done by the CMake module and then stored in the -config file. -AC_DEFUN([OPM_POLYMER_CHECKS],[])