Commit Graph
85 Commits
Author SHA1 Message Date
Andreas Lauser c1fc5c53c6 fix syntax error in configure shell script
strangly enough, it seems to work like it was in some circumstances...
2013-11-22 18:39:49 +01:00
Andreas Lauser 58122cc2f5 include the latest review comments by Roland Kaufmann 2013-11-15 13:14:50 +01:00
Andreas Lauser 4c1f238fb3 configure script: add a stub implementation for the --config-cache argument
so far, it is only a flag which prevents the cache from being
deleted. To warn the user about a potential infinite loop, a warning
is printed if this flag was specified and some compiler or some compiler
flags were set by the user. This idea was proposed by Roland Kaufmann.
2013-11-13 15:21:39 +01:00
Andreas Lauser 6b037027c3 configure script: also delete the cmake cache
This replicates the autotools behavior and was suggested by Roland
Kaufmann.
2013-11-13 11:46:27 +01:00
Andreas Lauser ff619105eb fixup! spline: avoid bogous "might be used uninitialized" compiler warning on GCC 2013-11-11 18:13:43 +01:00
Andreas Lauser 2f36aa10fa build system: prevent endless loop when using dunecontrol
this seems to be a bug in cmake 2.8.10.2: if the user sets the
CMAKE_CXX_COMPILER variable for a build directory where this variable
has already been set, one gets an endless loop. This stings especially
if using the dunecontrol compatibility layer as the compiler flags are
unconditionally set via the CXX_FLAGS environment variable in the
options file. Running duncontrol on a module twice will thus trigger the
infinite loop if some compiler flags are set by the user.

The solution is relatively simple: Delete the CMakeFiles directory
before calling cmake. for the dunecontrol compatibility mode, we do
this in the configure script. For details about the cmake bug, see
http://www.cmake.org/Bug/view.php?id=14119
2013-11-11 17:04:23 +01:00
Andreas Lauser 434a3a8dd5 spline: avoid bogous "might be used uninitialized" compiler warning on GCC 2013-11-10 17:55:41 +01:00
Andreas Lauser c7703c0949 fix test for HAVE_QUAD on some instances of ubuntu 13.10
I haven't figured out why this happens, but on one of my computers
running kubuntu 13.10 g++ says the following if one tries to use
quadruple precision math:

/home/erne/src/ewoms/ewoms/common/quad.hh: In static member function ‘static quad std::numeric_limits<__float128>::min()’:
/home/erne/src/ewoms/ewoms/common/quad.hh:52:14: error: unable to find numeric literal operator ‘operator"" Q’
     { return FLT128_MIN; }

since this happens only on this machine and only with the c++ (but
not the C) compiler, i suppose that this is either an upgrade issue
with kubuntu or an issue with the ubuntu gcc stack. Strangely enough,
my other kubuntu machine does not have a problem with that...

In any case also testing for assignability of constants and using the
C++ compiler for the quadmath test won't hurt...
2013-11-09 17:04:46 +01:00
Andreas Lauser ae901534c3 spline: fix the monotinic_() method and creation of monotonic splines
also, extend the unit test for it. (*phew* that was much more fun than
appreciated because of all the index shifts. I'm still not 100% sure
that everything works in all corner cases, but at least my confidence
is at 95%.)
2013-11-07 19:53:31 +01:00
Andreas Lauser c9067c4bda spline: some fixes to make Spline::intersect() work correctly
most of these issues are fallout from the conversion of the spline
class from a moments (second derivative) based approach to hermite
base functions:

- the second and third derivatives where incorrect, and the third
  derivative was not available in the public interface.
- The unit test did not check the derivatives
- The coefficients for the monomial basis were off by the factors
  stemming from the derivatives
- The intersectIntervall_() method used std::max() instead of
  std::min() at one place and still added the base offset for the x
  values as indicated by Stoer
2013-11-07 15:06:59 +01:00
Andreas Lauser bbf5a9767a spline: actually return something in evalDerivative() in the extrapolate case
once more, thanks to @bska to catching this!
2013-09-26 13:32:20 +02:00
Andreas Lauser fc6503d2e7 spline: use evalDerivative_() instead of evalDerivative() if the segment index is known
thanks to @bska for catching this!
2013-09-26 13:28:13 +02:00
Andreas Lauser d1bd0f24e4 Spline: fix a few issues with the monotonic() methods
This should fix the common case where the curve is non-constant within
an intervall. I'm not really sure whether it's correct in all corner
cases, though.

this fixes the eWoms test case for the blackoil model which failed in
debug mode due to some asserts incorrectly triggering...
2013-09-25 15:02:33 +02:00
Andreas Lauser 3ac996debe fix the averages wrt negative values and divisions by zero
it could be discussed whether it's better to throw a
std::runtime_error instead...
2013-09-25 11:04:23 +02:00
Andreas Lauser e256a233f0 Findewoms.cmake: fix typo
it's 'start.hh', not 'start.h'...
2013-09-24 15:49:50 +02:00
Andreas Lauser 0af1d9322f remove the dune-istl from the list of opm-material prerequisites
the only reason dune-istl was required was that the spline class used
ISTL's tridiagonal matrix. Since the spline class moved into the core
(along with a more capable tridiagonal matrix), ISTL is no longer
required by opm-material.
2013-09-24 11:49:30 +02:00
Andreas Lauser 06f0b302ca add opm-core to the ewoms prerequisites 2013-09-24 11:46:55 +02:00
Andreas Lauser a0c41819f7 include <tuple> in Spline.hpp
it seems like this is implicitly included by some other header, but
only in debug mode. *grr* thanks to @bska for catching this...
2013-09-23 15:21:39 +02:00
Andreas Lauser c971e7c590 remove 'constexpr' from the property system
it is not really needed and unneccessarily breaks the build on gcc-4.4
2013-09-23 13:45:41 +02:00
Andreas Lauser 71e6638f04 className(): minor comment and guard macro name fixes 2013-09-20 12:45:10 +02:00
Andreas Lauser 1b3217ec4b className(): get rid of the ugly ClassNameHelper_ class
since full specialization of function templates is okay in C++ (only
partial specialization is not allowed for them).
2013-09-20 12:36:40 +02:00
Andreas Lauser c3cc059860 className(): remove unused argument object for the className(foo) variant
some compilers may warn about this under some circumstances.
2013-09-20 12:18:10 +02:00
Andreas Lauser d416ed279b add Exceptions.hpp to the list of public header files 2013-09-19 20:09:16 +02:00
Andreas Lauser 783950060d make sure the header files related to the property system are installed 2013-09-19 20:09:16 +02:00
Andreas Lauser 9733d9c995 add a test for the property system 2013-09-19 20:09:07 +02:00
Andreas Lauser e15a28de68 add authors to the files according to git logs 2013-09-19 20:09:07 +02:00
Andreas Lauser d5770b92ea Import the property system from eWoms 2013-09-19 20:08:59 +02:00
Andreas Lauser 9284edb16b import Dune's class name code 2013-09-19 20:00:14 +02:00
Andreas Lauser 0d0ab3bd5a refactor the spline code: merge everything into one class 2013-09-19 18:48:54 +02:00
Andreas Lauser 16e7b7ac33 fix headers
make all non-implementation headers includable without
preconditions. Also, this removes the GravityColumnSolver.hpp file,
because it tried to include a non-existing file and it was thus unused.
2013-09-11 13:11:47 +02:00
Andreas Lauser 8399cff98f require opm-core from the opm-material module
this is required to use the exception code of opm-core in
opm-material. Also, the Dune prerequisites of opm-material can be
removed once PR #345 is merged into opm-core...
2013-09-10 13:34:47 +02:00
Andreas Lauser 8ef3b6e6c7 introduce classes for monotonic, full, periodic and natural cubic splines 2013-09-09 13:29:50 +02:00
Andreas Lauser 2302fc6ce5 add functions to analytically invert polynomials up to degree three 2013-09-09 13:29:37 +02:00
Andreas Lauser 575855f896 add tridiagonal matrix
this class can do both, more and less than dune-istl's BTDMatrix. more
because it supports entries on the lower left and upper right, less
because it does not support a block structure. The primary motivation
for this class were the spline classes which for which the former
feature is required to implement periodic splines and the latter is
not necessary...
2013-09-09 13:17:47 +02:00
Andreas Lauser d42178c203 Introduce OPM_UNUSED as a portable wrapper to __attribute__((unused))
This works pretty much the same way as DUNE_DEPRECATED (without message).

Thanks to Elias Pipping for implementing this.

dune-common SVN revision: r6556
2013-09-09 13:16:21 +02:00
Andreas Lauser 4db6760b9d fix the SparseVector and SparseTable unit tests
also, throw std::logic_error in the OPM_ERROR_IF macro
2013-09-06 13:27:14 +02:00
Andreas Lauser 5d435d396c catch all exceptions in all tutorials and examples 2013-09-05 13:04:38 +02:00
Andreas Lauser c4c771e39b ErrorMacros: remove compatibility macros 2013-09-05 13:04:38 +02:00
Andreas Lauser 23f215bec4 convert users of MESSAGE to OPM_MESSAGE 2013-09-05 13:04:38 +02:00
Andreas Lauser c25ec5999e convert users of the ASSERT and the ASSERT2 macros to standard assert() 2013-09-05 13:04:37 +02:00
Andreas Lauser 19e5d5cea2 convert THROW to OPM_THROW 2013-09-05 13:04:37 +02:00
Andreas Lauser 0eaf62c7e3 Add a file with OPM specific exceptions 2013-09-05 13:04:37 +02:00
Andreas Lauser 47bb5cde46 refactor the exception throwing code 2013-09-05 13:04:37 +02:00
Andreas Lauser 7a5a725f25 Replace boost::is_integral by std::is_integral 2013-09-05 13:04:37 +02:00
Andreas Lauser 3c9baded80 replace BOOST_STATIC_ASSERT by C++-2011's static_assert 2013-09-05 13:04:37 +02:00
Andreas Lauser d11db08084 include iostream in the files which use std::cerr or std::cout
for some of these files this is needed to make to keep it compiling
after the next patch because the new ErrorMacros.hpp file will no
longer implicitly includes <iostream>. for the remaining files it is
just good style.

While at it, the includes for most of these files have been ordered in
order of decreasing abstraction level.
2013-09-05 13:04:37 +02:00
Andreas Lauser f983af5a0b C++-11 Features: add test for std::is_integral 2013-09-03 17:49:18 +02:00
Andreas Lauser 980a1b6eb9 add opm-material to the eWoms prerequisites
this is needed by the imminent switch of eWoms to the OPM build
system.
2013-08-26 13:06:34 +02:00
Andreas Lauser 3abbe0ef52 cmake: fix the SuperLU test
for me, it was completely broken. (it worked fine if you did not want
to use it, though.) Now it (hopefully) follows the standard OPM
variable naming conventions, allows to use the internal SuperLU BLAS
library, and works fine if superLU is not installed on a system-wide
basis.

v2: cache the POST_2005 variable to make writing it to config.h more
    reliable (on my kubuntu 13.04 system it did not work without it)
v3: re-add a proper "post 2005" check from newer versions of the dune tests
2013-08-25 22:44:30 +02:00
Andreas Lauser 48ec4f0754 cmake: do not quote variables for config.h anymore
v2: incorporate Roland's nitpicks (I hope)
v3: It was decided that it's better to change the default behavior
v4: make sure the CMake syntax is correct even if the value of the
    variable contains spaces (if it contains double quotes it's a
    different matter, but that's pretty much a corner case, IMHO)
v5: properly escape backslash and double quote characters in the cmake
    syntax
2013-08-23 21:10:02 +02:00
Andreas Lauser 64ff0aebd3 fix the test for the quadmath library
Seems like I forgot to include the "CheckCSourceCompiles" macro before
using it. Since it worked for me before, I'm wondering what made this
happen. Anyway, it should now work correctly in all cases.
2013-08-21 15:47:32 +02:00
Andreas Lauser c928891e8e tweak the configure script
we should recognize the --with-{alugrid,metis} options...
2013-08-14 20:51:36 +02:00
Andreas Lauser 5d1353901e make the FindALUGrid module compatible with the OPM build system 2013-08-14 20:51:22 +02:00
Andreas Lauser 55786cd290 add cmake module to detect ewoms 2013-08-14 20:51:22 +02:00
Andreas Lauser d57f97b78d Add HAVE_CXA_DEMANGE config.h variable to Finddune-common.cmake
This will make Dune::classname usable on Dune master. (the 2.2 release
should be fine even without it.)
2013-08-14 20:51:22 +02:00
Andreas Lauser 8c2d544581 Finddune-grid.cmake: test for ALUGrid and METIS
ALUGrid is needed to avoid unresolved symbols if dune-grid was
compiled with it. METIS is used by the parallel version of
ALUGrid. (Although it is not open source...)
2013-08-14 20:51:22 +02:00
Andreas Lauser 845bac2c7d add cmake modules to find ALUGrid and METIS 2013-08-14 20:51:22 +02:00
Andreas Lauser 982344c1a2 CMake: add module for dune-localfunctions 2013-08-14 20:51:22 +02:00
Andreas Lauser ec202f2ba0 make the build system link to the "quadmath" library if it is supported
Thanks a lot to Roland Kaufmann for the support.
2013-08-13 21:02:52 +02:00
Andreas Lauser 3a94812c62 add a cmake check for the abi::__cxa_demangle() function
this was also forgotten. sorry...
2013-08-13 21:02:52 +02:00
Andreas Lauser 054c353606 add test for <type_traits> to FindCXX11Features.cmake
I fogot this one yesterday...
2013-08-13 21:02:52 +02:00
Andreas Lauser 41b7b316f7 add and use CMake modules for valgrind client requests and quadruple precision math 2013-08-13 21:00:18 +02:00
Andreas Lauser bd094b2e11 replace boost::scoped_ptr by std::unique_ptr
thanks to Bård Skaflestad, Atgeirr Rasmusen and Roland Kaufmann for
the hint.
2013-08-08 15:21:38 +02:00
Andreas Lauser cab7125da3 also test for std::unique_ptr 2013-08-08 15:21:13 +02:00
Andreas Lauser 6722ca33f5 add a few config.h macros useful for dune-common 2013-08-08 13:40:42 +02:00
Andreas Lauser 70949c6edb use std::shared_ptr instead of boost::shared_ptr
our policy is that we only use boost if necessary, i.e., if the oldest
supported compiler does not support a given feature but boost
does. since we recently switched to GCC 4.4 or newer, std::shared_ptr
is available unconditionally.
2013-08-08 13:25:58 +02:00
Andreas Lauser b0349793fa detect the presence of std::shared_ptr
since GCC 4.4 supports it, make it mandatory as well...
2013-08-08 13:25:58 +02:00
Andreas Lauser 0d14d25ef5 Build system: make it work for modules which do not need libraries 2013-08-07 16:06:05 +02:00
Andreas Lauser 667f056a73 Merge pull request #295 from rolk/295_cxxreq
Only fail if C++11 support is noted as REQUIRED
2013-08-01 06:33:05 -07:00
Andreas Lauser b52b2cd555 fix new 'unused variable' warnings on GCC
that one was due to the fact that the constructor arguments were no
longer used to initialize (unused) private member variables. These
warnings did not appear in CLang for some reason. Again, thanks to
Bård Skaflestad for the review.
2013-07-30 19:07:46 +02:00
Andreas Lauser 31e7e7e01d better fix for the alignment warning of the previous patch
'work' is a small, constant size array for temporary data so it can be
allocated on the stack and the 'work' parameter can be eliminated entirely.

Thanks to Bård Skaflestad for the suggestion!
2013-07-30 19:07:30 +02:00
Andreas Lauser 562bcf2e7d replace boost::array by std::array
GCC 4.4 supports std::array, so there is not much point in keeping
compatibility with ancient compilers...
2013-07-30 17:46:32 +02:00
Andreas Lauser 9465560ae4 make the c++-2011 feature set of GCC 4.4 mandatory
we now produce an error even if the module in question does not
actually use some of these features.
2013-07-30 17:43:01 +02:00
Andreas Lauser 5a7992fc56 fix a few CLang warnings
most of them quite insignificant, but still annoying. The only
exception is the warning about the changed alignment for the 'work'
argument of spu_implicit_assemble(). AFAICT, the only reason why it
worked was that the pointer produced by malloc() was passed
directly. (malloc() seems to fulfill all alignment criteria.) To fix
this, I've changed that argument's type from char* to double*.
2013-07-30 16:27:20 +02:00
Andreas Lauser 0faa2bb49c Merge pull request #282 from juliohm/master
Remove trailing whitespaces
2013-07-28 10:08:26 -07:00
Andreas Lauser 7ed3fe69c0 Fix a few doxygen issues with the tutorials 2013-04-15 18:59:55 +02:00
Andreas Lauser 884c5ab027 make config.h the first header to be included in any compile unit
this is required for consistency amongst the compile units which are
linked into the same library and seems to be forgotten quite
frequently.
2013-04-10 12:56:14 +02:00
Andreas Lauser b20cb0f909 remove the include statement for omp.h in geometry.c
this fixes the build on clang
2013-04-10 12:41:28 +02:00
Andreas Lauser 9e418e1779 tutorial: make the copyright notice disappear in the HTML
IMHO it is not useful there.
2013-03-08 12:26:42 +01:00
Andreas Lauser 6e0a566e53 factor out OPM_CORE_CHECK_MODULES into a separate file
thanks to Roland Kaufmann for suggesting this.
2012-07-05 12:42:49 +02:00
Andreas Lauser 789bc5ca71 opm-core: make it a usable in conjunction wit dunecontrol
This allows projects which use the DUNE build system and want to use
OPM-Core to specify a dependency in their dune.module file. (i.e. they
don't have to worry about compiler and linker flags anymore.)

opm-core can still be used without having DUNE installed, though. This
means that for users which do not need/want a dependency on DUNE,
nothing changes.

v2: avoid naming conflict of the AX_BOOST_BASE macro with dune-common
    by renaming it to OPM_BOOST_BASE.
v3: make the library detection work nicely
v4: Use AX_BOOST_BASE M4 macro from opm-core instead from dune-common
    as base for OPM_BOOST_BASE to get rid of a few bugs, reworded
    commit message. Thanks to Bård Skaflestad for the review.
2012-07-05 12:42:49 +02:00
Andreas Lauser 6f69de969a opm-core: make it work nicely with clang 2012-07-05 12:42:49 +02:00
Andreas Lauser 3a25c11544 factor out OPM_CORE_CHECK_MODULES into a separate file
thanks to Roland Kaufmann for suggesting this.
2012-07-03 15:42:01 +02:00
Andreas Lauser 31d0681a66 opm-core: make it a usable in conjunction wit dunecontrol
This allows projects which use the DUNE build system and want to use
OPM-Core to specify a dependency in their dune.module file. (i.e. they
don't have to worry about compiler and linker flags anymore.)

opm-core can still be used without having DUNE installed, though. This
means that for users which do not need/want a dependency on DUNE,
nothing changes.

v2: avoid naming conflict of the AX_BOOST_BASE macro with dune-common
    by renaming it to OPM_BOOST_BASE.
v3: make the library detection work nicely
v4: Use AX_BOOST_BASE M4 macro from opm-core instead from dune-common
    as base for OPM_BOOST_BASE to get rid of a few bugs, reworded
    commit message. Thanks to Bård Skaflestad for the review.
2012-07-02 19:17:25 +02:00
Andreas Lauser 2a79bb2fe2 opm-core: make it work nicely with clang 2012-07-02 18:52:30 +02:00