Commit Graph

314 Commits

Author SHA1 Message Date
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
Bård Skaflestad
3fd6a41de5 Merge pull request #394 from andlaus/fix_spline_monotonic
Spline: fix a few issues with the monotonic() methods
2013-09-26 04:52:16 -07: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
Roland Kaufmann
afdb330d54 Provide stream that ignores everything written to it
Use this stream when you want a straight code path, but also be able
to disable output at will.
2013-09-26 12:37:02 +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
Atgeirr Flø Rasmussen
d5dd74aa9f Further improved WellReport and Watercut docs. 2013-09-24 14:39:41 +02:00
Atgeirr Flø Rasmussen
754ee7aa82 Documented WellReport and Watercut classes. 2013-09-24 14:14:54 +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
Atgeirr Flø Rasmussen
d086ee5c63 Merge pull request #344 from andlaus/import_propertysystem
Import propertysystem
2013-09-23 04:18:02 -07: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
Roland Kaufmann
8faf68dabb Replace int with size_t to avoid possible size mismatch 2013-09-20 10:53:47 +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
Atgeirr Flø Rasmussen
86d09115b9 Merge pull request #345 from andlaus/import_splines
Import splines
2013-09-19 10:26:02 -07:00
Andreas Lauser
0d0ab3bd5a refactor the spline code: merge everything into one class 2013-09-19 18:48:54 +02:00
Atgeirr Flø Rasmussen
3ef57842a9 Merge pull request #376 from rolk/376_warn
Quelch needless warnings (found by Clang)
2013-09-19 05:05:00 -07:00
Roland Kaufmann
82cf04d9f1 Convert functions in anonymous namespace into statics
These functions are referred to from templates which may not be
instantiated. Since they were in an anonymous namespace they were
not reachable otherwise, and a warning is emitted. This only applies
to Clang; GCC consider them used.

If we make them static helper functions instead, the warning
disappears.
2013-09-19 13:10:16 +02:00
Andreas Lauser
c106385d9e move the new stuff to opm/core/utility 2013-09-18 23:02:16 +02:00
Atgeirr Flø Rasmussen
1b78495769 Merge pull request #364 from andlaus/fix_headers
fix headers
2013-09-18 03:54:47 -07: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
Bård Skaflestad
6d84217836 Reduce likelihood of shadowing symbols in OPM_THROW
The OPM_THROW macro uses an internal symbol, 'oss', which is, strictly
speaking, in the client's namespace.  Moreover, as the
"EclipseGridParseHelpers.hpp" header uses the same symbol, and for
similar purposes, this produces warnings at "-Wshadow" in GCC when
compiling that header.

Rename the macro's symbol to 'oss__' (double trailing underscore) to
reduce the likelihood of shadowing a previous definition.
2013-09-11 01:03:25 +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
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
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
Roland Kaufmann
ccf4fcae12 Change from pass-by-value to pass-by-const-ref
The object is copied when put into the list, so there should be no
danger of dangling references.
2013-08-26 14:33:23 +02:00
Roland Kaufmann
3156d0749a Add classes for event-handling
The new classes Event and EventSource can be used as a simple mechanism
for implementing event-based callbacks in the simulators.
2013-08-26 12:52:03 +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
Júlio Hoffimann
8385a9bcbb Remove trailing whitespaces 2013-07-28 08:34:13 -03:00
Markus Blatt
68eb3fbcb1 Changed std::tr1 occurences to boost.
std::tr1 might not be supported by all compilers and will eventually
be dropped by others. Using boost instead makes this more
portable.
2013-07-04 16:04:35 +02:00
Roland Kaufmann
0fb4f14b28 Provide DTD schema to describe parameter file format
Notice that this definition specifies a superset of the actual format
as the ParameterGroup tag is context-dependent (which cannot be captured
by DTD schemata).
2013-05-13 10:50:22 +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
Atgeirr Flø Rasmussen
f7d7deeb03 Simplified class NonuniformTableLinear.
Removed the policy control for what to do beyond the domain.
Old behaviour was constant extrapolation, current behaviour
is linear extrapolation. The possibility to choose was never
needed and has beem removed.
2013-03-22 16:22:29 +01:00
Atgeirr Flø Rasmussen
c1657b427a Finished unification of linear interpolation.
The functions of linInt.hpp are now used everywhere, but:
 - linInt.hpp -> linearInterpolation.hpp (better name)
 - linearInterpolationExtrap() -> linearInterpolation() (extrapolate by default)
2013-03-22 15:33:07 +01:00
Atgeirr Flø Rasmussen
a8097317a5 Make all codes use the same linear interpolation routines. 2013-03-22 15:28:16 +01:00