Commit Graph
176 Commits
Author SHA1 Message Date
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
Kristian Flikka ed8efaefe1 Replaced include math.h with cmath, and changed from fabs to abs. Fixed an error in the testfile, a filename was wrong 2013-11-04 13:51:32 +01:00
Joakim Hove e7e2f6588b Added test with accompanying data for Blackoilstate::equals() 2013-10-28 17:43:29 +01:00
Roland Kaufmann f3877facb0 Only use Clang-specific pragma if compiler is Clang
Otherwise the compiler will probably give us a warning that these
pragmas are unknown. By default that warning is disabled with our
own build system, but we also want to be able to link to our library
without incorporating the entire build system too.
2013-09-24 11:15:26 +02:00
Atgeirr Flø Rasmussen d086ee5c63 Merge pull request #344 from andlaus/import_propertysystem
Import propertysystem
2013-09-23 04:18:02 -07:00
Roland Kaufmann cbe232e880 Add missing header include 2013-09-20 10:51:18 +02:00
Andreas Lauser 9733d9c995 add a test for the property system 2013-09-19 20:09:07 +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
Roland Kaufmann 244c867505 Don't warn about functions not emitted
If a function is used by a template but this template is not
instantiated, the function will still be defined in the header
of a module but it won't be callable because it is in an anonymous
namespace and thus we get a warning.

This only happens in Clang; GCC consider functions referenced from
templates as used.

fixup! Don't warn about functions not emitted
2013-09-19 13:09:44 +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 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 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 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
Roland Kaufmann fa5344ec3e Move old files into the attic
The attic are the place where files which we don't use right now, but
which we acknowledge some amount of valuable time has been spent on and
which may be usable some day in the future, so we don't have the
conscience to right out delete them.

These files are not expected to compile, and certainly not to run and
produce sensible results, anymore. However, with some work they can
possibly be converted into proper unit tests or examples.
2013-08-02 20:31:06 +02:00
Roland Kaufmann 348da6ba32 Indent consistently with whitespace instead of tab 2013-08-01 12:16:20 +02:00
Roland Kaufmann d400b2e7fd Rename test itself to not conflict with local variable 2013-08-01 12:14:23 +02:00
Roland Kaufmann 5d1931cb7d Add warning that this directory is not actively maintained. 2013-08-01 10:46:01 +02:00
Roland Kaufmann 5180f9faf0 Graduate testing of metric unit to a proper unit test
Notice the confusing naming.
2013-08-01 10:40:55 +02:00
Roland Kaufmann cc84b584ff Convert testing of metric units to use Boost::UnitTest 2013-08-01 10:40:55 +02:00
Roland Kaufmann 3bd2f07d9c Convert cubic interpolator to use Boost::UnitTest 2013-08-01 10:40:55 +02:00
Roland Kaufmann 67baa6b8e2 Cartesian grid test is now a proper unit test 2013-08-01 10:40:55 +02:00
Roland Kaufmann 6fc2ff197a Convert Cartesian grid test to use Boost::UnitTest 2013-08-01 10:40:55 +02:00
Roland Kaufmann 47f0b97fcc Graduate these tests to unit tests
Although they don't use Boost::UnitTest, they can at least pass, so we
can use them to detect simple compilation and runtime errors, although
we miss the semantic check.

(If you have time, please make them proper unit tests)
2013-08-01 10:40:55 +02:00
Roland Kaufmann f6bfb58d45 Fix non-unit tests so that they compile again
Account for header, namespace and API changes.
2013-08-01 10:40:55 +02:00
Bård Skaflestad 1967631b83 Merge pull request #285 from rolk/285_shadow
Provide way of shadowing only some properties
2013-07-31 04:05:13 -07: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
Roland Kaufmann 26b2d2794c Provide way of shadowing only some properties
The current implementations of IncompPropertiesInterface are very
all-or-nothing. In some situations, you want to read rock and fluid
properties from an Eclipse file, but use analytical functions for
the unsaturated properties. Or you want to update properties based
on a marching filter.

This patch provides a way to mix various property objects, or to
"shadow" the properties with a raw array of data, so you don't have
to reimplement the entire interface just to make a small change.
2013-07-30 13:11:52 +02:00
Júlio Hoffimann 8385a9bcbb Remove trailing whitespaces 2013-07-28 08:34:13 -03:00
Bård Skaflestad d332129676 Merge pull request #274 from blattms/non-tr1
Changed std::tr1 occurences to boost.
2013-07-04 12:01:51 -07: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
Bård Skaflestad 33320270fc Disable build kluge that is no longer pertinent
The <have_boost_redef.hpp> header was introduced (commit 82369f9) as
a work-around for a particular interaction in the Autotools-based
setup of OPM-Core and the Dune core modules.  Notably, Dune's
"Enable" trick for Boost failed on some older Autoconf systems.  Now
that we're using CMake, however, that kluge is no longer needed
because we (OPM-Core) always

  #define HAVE_BOOST 1

i.e., as an explict true/false value.

Therefore, we need no longer include <have_boost_redef.hpp> .  The
header will be removed at a later time.
2013-06-20 23:14:39 +02:00
Bård Skaflestad f5d67fafc8 Favour std::vector<> over variably-sized arrays.
Variably-sized arrays of the form

   int n = 6;
   double a[n];

are an extension to the language that will illicit a suitably
persnickety diagnostic from GCC when invoked with "-pedantic".
2013-06-05 17:14:33 +02:00
Bård Skaflestad f16b9f10e7 Mark deck as FIELD units.
The numbers in the deck are more indicative of FIELD unit conventions
than METRIC unit conventions, so allow the input parser to interpret
the data in that manner.
2013-06-05 12:24:23 +02:00
Tor Harald Sandve a89b081ac0 A test that compares the blackoil fluid based on the [p,r] interface
with the blackoil fluid based on the [p,z] interface
2013-06-05 11:21:47 +02:00
Tor Harald Sandve 01bb02f4cd Adds the new interface to SinglePvtLivGas 2013-05-27 11:14:39 +02:00
totto82 1c904aa451 Add new fluid interface
- in progress
2013-05-22 12:57:18 +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 ee29f32ee8 Whitespace cleanup. 2013-03-23 23:46:05 +01:00
Atgeirr Flø Rasmussen 83c93a1e3b Added test for class UniformTableLinear.
Moved from opm-porsol.
2013-03-22 21:39:32 +01:00
Atgeirr Flø Rasmussen c26b40702f Added test for class NonuniformTableLinear.
Formerly lived in opm-porsol.
2013-03-22 16:24:52 +01:00
Atgeirr Flø Rasmussen b32674f3ea Moved ColumnExtract and initState.
ColumnExtract -> opm/core/grid/ and initState -> opm/core/simulator/.
2013-03-18 12:47:23 +01:00
Atgeirr Flø Rasmussen d7353145c1 Update to follow previous moves and deletes. 2013-03-18 12:40:34 +01:00
Atgeirr Flø Rasmussen 2405758e2d Renamed newwells.h -> wells.h.
Also moved implementation file to subdir.
2013-03-18 10:33:34 +01:00
Atgeirr Flø Rasmussen 0a935774d2 Move GridManager to grid subdir.
Also remove GridAdapter (moved to dune-cornerpoint), and
moved grid.c implementation file to grid subdir.
2013-03-18 10:16:46 +01:00
Atgeirr Flø Rasmussen 6e48999ede Removed unused SimpleFluid and SimpleFluid2pWrapper classes. 2013-03-14 13:33:26 +01:00
Atgeirr Flø Rasmussen 34f523339d Adapt include statements to moved headers. 2013-03-14 10:29:42 +01:00