Merge remote-tracking branch 'upstream/ert' into ert

Bring in upstream changes.
This commit is contained in:
Bård Skaflestad 2012-06-28 13:30:28 +02:00
commit f57ba7dd0b
10 changed files with 389 additions and 263 deletions

View File

@ -44,6 +44,8 @@ AX_BOOST_UNIT_TEST_FRAMEWORK
AX_DUNE_ISTL
OPM_AGMG
OPM_DYNLINK_BOOST_TEST
# Checks for header files.
AC_CHECK_HEADERS([float.h limits.h stddef.h stdlib.h string.h])

View File

@ -0,0 +1,80 @@
# _OPM_DYNLINK_BOOST_TEST_SRC(Symbol)
# Generate source text for use in AC_LINK_IFELSE when determining
# how to link the Boost.Test library.
#
# Note:
# We use AC_LANG_SOURCE rather than AC_LANG_PROGRAM to avoid
# multiple definitions of "main()" (defined by both the UTF
# *and* the AC_LANG_PROGRAM macro).
AC_DEFUN([_OPM_DYNLINK_BOOST_TEST_SRC],
[AC_LANG_SOURCE(
[[$1
#define BOOST_TEST_MODULE OPM_DYNLINK_TEST
#include <boost/test/unit_test.hpp>
int f(int x) { return 2 * x; }
BOOST_AUTO_TEST_CASE(DynlinkConfigureTest) {
BOOST_CHECK_MESSAGE(f(2) == 4,
"Apparently, multiplication doesn't "
"work: f(2) = " << f(2));
}
]]dnl
)[]dnl
])
dnl -------------------------------------------------------------------
# OPM_DYNLINK_BOOST_TEST
# Determine how to link (or compile+link) tests based on the UTF.
#
# If the system uses dynamic linking, then all tests need to
#
# #define BOOST_TEST_DYN_LINK
#
# Otherwise, this symbol must *not* be #define'd.
#
# Macro defines the symbol HAVE_DYNAMIC_BOOST_TEST (to 1) if the
# system uses dynamic linking of Boost.Test .
AC_DEFUN([OPM_DYNLINK_BOOST_TEST],
[
AC_REQUIRE([AX_BOOST_BASE])
AC_REQUIRE([AX_BOOST_UNIT_TEST_FRAMEWORK])
_opm_LIBS_SAVE="$LIBS"
_opm_CPPFLAGS_SAVE="$CPPFLAGS"
LIBS="${BOOST_LDFLAGS} ${BOOST_UNIT_TEST_FRAMEWORK_LIB} ${LIBS}"
CPPFLAGS="${BOOST_CPPFLAGS} ${CPPFLAGS}"
AC_LANG_PUSH([C++])
AC_CACHE_CHECK([if the Boost.Test library can be linked statically],dnl
[opm_cv_boost_link_static],dnl
[AC_LINK_IFELSE([_OPM_DYNLINK_BOOST_TEST_SRC([])],
[opm_cv_boost_link_static=yes],dnl
[opm_cv_boost_link_static=no])[]dnl
])[]dnl
AC_CACHE_CHECK([if the Boost.Test library can be linked dynamically],dnl
[opm_cv_boost_link_dynamic],dnl
[AC_LINK_IFELSE([_OPM_DYNLINK_BOOST_TEST_SRC(dnl
[#define BOOST_TEST_DYN_LINK])],
[opm_cv_boost_link_dynamic=yes],dnl
[opm_cv_boost_link_dynamic=no])[]dnl
])[]dnl
AC_LANG_POP([C++])
LIBS="$_opm_LIBS_SAVE"
CPPFLAGS="$_opm_CPPFLAGS_SAVE"
AS_IF([test x"$opm_cv_boost_link_static" = x"yes" -o \
x"$opm_cv_boost_link_dynamic" = x"yes"],
[AS_IF([test x"$opm_cv_boost_link_dynamic" = x"yes"],
[AC_DEFINE([HAVE_DYNAMIC_BOOST_TEST], [1],
[Define to `1' if Boost.Test should use BOOST_TEST_DYN_LINK])]
[:])[]dnl
],dnl
[AC_MSG_NOTICE([Boost.Test is not supported on this system])])
])[]dnl

View File

@ -627,7 +627,7 @@ ind2sub(const size_t nx,
{
assert (c < (nx * ny * nz));
#if !defined(NDEBUG)
#if defined(NDEBUG)
(void) nz;
#endif

View File

@ -0,0 +1,32 @@
/*
Copyright 2012 SINTEF ICT, Applied Mathematics.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_DATAMAP_HEADER_INCLUDED
#define OPM_DATAMAP_HEADER_INCLUDED
#include <string>
#include <map>
namespace Opm
{
/// Intended to map strings (giving the output field names) to data.
typedef std::map<std::string, const std::vector<double>*> DataMap;
}
#endif

View File

@ -18,6 +18,7 @@
*/
#include <opm/core/utility/writeVtkData.hpp>
#include <opm/core/utility/DataMap.hpp>
#include <opm/core/grid.h>
#include <opm/core/utility/ErrorMacros.hpp>
#include <boost/lexical_cast.hpp>

View File

@ -26,15 +26,13 @@
#include <vector>
#include <tr1/array>
#include <iosfwd>
#include <opm/core/utility/DataMap.hpp>
struct UnstructuredGrid;
namespace Opm
{
/// Intended to map strings (giving the output field names) to data.
typedef std::map<std::string, const std::vector<double>*> DataMap;
/// Vtk output for cartesian grids.
void writeVtkData(const std::tr1::array<int, 3>& dims,
const std::tr1::array<double, 3>& cell_size,

View File

@ -5,7 +5,7 @@
// Created: Sun Dec 13 20:08:36 2009
//
// Author(s): Atgeirr F Rasmussen <atgeirr@sintef.no>
// Bård Skaflestad <bard.skaflestad@sintef.no>
// Bård Skaflestad <bard.skaflestad@sintef.no>
//
// $Date$
//
@ -34,7 +34,11 @@
*/
#include <config.h>
#if HAVE_DYNAMIC_BOOST_TEST
#define BOOST_TEST_DYN_LINK
#endif
#define NVERBOSE // to suppress our messages when throwing
#define BOOST_TEST_MODULE ParameterTest

View File

@ -5,7 +5,7 @@
// Created: Thu May 28 10:01:46 2009
//
// Author(s): Atgeirr F Rasmussen <atgeirr@sintef.no>
// Bård Skaflestad <bard.skaflestad@sintef.no>
// Bård Skaflestad <bard.skaflestad@sintef.no>
//
// $Date$
//
@ -33,7 +33,11 @@
along with OpenRS. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#if HAVE_DYNAMIC_BOOST_TEST
#define BOOST_TEST_DYN_LINK
#endif
#define NVERBOSE // to suppress our messages when throwing
#define BOOST_TEST_MODULE SparseTableTest

View File

@ -5,7 +5,7 @@
// Created: Mon Jun 29 21:00:53 2009
//
// Author(s): Atgeirr F Rasmussen <atgeirr@sintef.no>
// Bård Skaflestad <bard.skaflestad@sintef.no>
// Bård Skaflestad <bard.skaflestad@sintef.no>
//
// $Date$
//
@ -33,8 +33,11 @@
along with OpenRS. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#if HAVE_DYNAMIC_BOOST_TEST
#define BOOST_TEST_DYN_LINK
#endif
#define NVERBOSE // to suppress our messages when throwing
#define BOOST_TEST_MODULE SparseVectorTest

View File

@ -1,7 +1,9 @@
#include <config.h>
#if HAVE_DYNAMIC_BOOST_TEST
#define BOOST_TEST_DYN_LINK
#endif
#define NVERBOSE // to suppress our messages when throwing
#define BOOST_TEST_MODULE ColumnExtractTest