Commit Graph

617 Commits

Author SHA1 Message Date
Andreas Lauser
43cf644c78 add a simple unit test for the ConditionalStorage class 2017-11-30 11:40:08 +01:00
Andreas Lauser
0b097b60f4 add a simple helper class that allows to store data members conditionally
the class takes a boolean parameter as its first template parameter
and a type name as the second. if the boolean parameter is false,
nothing is stored, else an object of the type of the second template
parameter gets created. this mechanism allows to disable member
attributes based on compile time conditions.

The usage semantics of that class are that of a smart pointer class, i.e.,
the equivalent of

```
Foo foo;
foo.bar()
```

is

```
Opm::ConditionalStorage<true, Foo> foo;
foo->bar();
```

If the condition argument for the ConditionalStorage is false, that
code will still compile but an exception is thrown at runtime.
2017-11-30 11:36:57 +01:00
Atgeirr Flø Rasmussen
a346cf5e16 Merge pull request #285 from akva2/add_ndebug_option
added: option to not define NDEBUG for release builds
2017-11-28 07:30:42 +01:00
Atgeirr Flø Rasmussen
2204a160cf Merge pull request #291 from akva2/fix_core_test_program
fixed: do not use ParameterGroup code in opm-core test program
2017-11-27 13:21:38 +01:00
Atgeirr Flø Rasmussen
78173581ee Merge pull request #290 from andlaus/remove_configure
remove the configure wrapper script
2017-11-24 13:10:58 +01:00
Arne Morten Kvarving
af503d2c48 fixed: do not use ParameterGroup code in opm-core test program
it now sits in opm-common. yields confusing output as test
program compilation will succeed even if opm-common but not opm-core
is available
2017-11-24 12:44:03 +01:00
Andreas Lauser
2c6db2a109 remove the configure wrapper script
this used to provide autotools compatibility, but it has not been working for a while. Thus it is IMO better to remove it in order not to mislead people.
2017-11-24 10:37:40 +01:00
Atgeirr Flø Rasmussen
c55885633c Merge pull request #286 from akva2/import_param_group
Import ParameterGroup code from opm-core
2017-11-18 09:14:07 +01:00
Arne Morten Kvarving
933b28ab7b add ParameterGroup code to build system 2017-11-17 13:10:06 +01:00
Arne Morten Kvarving
8f637064c4 changed: remove embedded 'parameters' namespace in ParamGroup
inconsistent and unnecessary.

this is purely a cosmetic change, the only exception was a function with
the generic name 'split', which was renamed to splitParam to avoid confusion.
2017-11-17 13:10:06 +01:00
Arne Morten Kvarving
3a54a224cf changed: remove XML support for ParameterGroup 2017-11-17 13:10:06 +01:00
Liu Ming
18533e990d paramemters output should go in Debug mode. 2017-11-17 13:10:06 +01:00
Liu Ming
95d91b0f05 fix strange indentation. 2017-11-17 13:10:06 +01:00
Liu Ming
a66ebf5fcb fix indentation and messages. 2017-11-17 13:10:06 +01:00
Liu Ming
d1768a8c1c write well related information into OpmLog. 2017-11-17 13:10:06 +01:00
Liu Ming
61b0d2e22e write the parameters information into OpmLog. 2017-11-17 13:10:06 +01:00
Andreas Lauser
57fc9d0179 use the error macros from opm-common 2017-11-17 13:10:06 +01:00
Markus Blatt
6cd2560cd6 Allow to prevent ParameterGroup from printing to std::cout.
This commit adds a verbose flag to the constructor of
ParameterGroup to allow for deactivating any
output to std:cout. This is handy for parallel runs where we only
want to print statistics on one process.
2017-11-17 13:10:06 +01:00
Atgeirr Flø Rasmussen
0cee419b89 Make test argc/argv data mimic POSIX correct data. 2017-11-17 13:10:06 +01:00
Atgeirr Flø Rasmussen
c4e9b06569 Update test to work correctly with new behaviour.
Also add a test to verify that we throw when we are supposed to.
2017-11-17 13:10:06 +01:00
Atgeirr Flø Rasmussen
3dd2d565fc Modified behaviour for unhandled arguments.
Use constructor argument verify_syntax to decide course of action: if false,
store unhandled arguments, if true, write a message and throw.
2017-11-17 13:10:06 +01:00
Atgeirr Flø Rasmussen
9d6489f68d Return const reference from unhandledArguments(). 2017-11-17 13:10:06 +01:00
Atgeirr Flø Rasmussen
2ed7955f81 Add test for ParameterGroup::unhandledArgument(). 2017-11-17 13:10:06 +01:00
Atgeirr Flø Rasmussen
a1784d9f1f Store unhandled command-line arguments.
A new method ParameterGroup::unhandledArguments() is available to
access the list of unhandled arguments. Before, when such arguments
were encountered they were ignored and a warning was printed to
standard out.

Apart from the lack of a (potentially misleading) warning, this
should not change the behaviour of existing clients of the class.
2017-11-17 13:10:06 +01:00
Roland Kaufmann
a82e866050 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.
2017-11-17 13:10:06 +01:00
Andreas Lauser
e86c12dcf4 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.
2017-11-17 13:10:06 +01:00
Andreas Lauser
02cc08dd37 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.
2017-11-17 13:10:06 +01:00
Júlio Hoffimann
73139aecc2 Remove trailing whitespaces 2017-11-17 13:10:06 +01:00
Markus Blatt
6a10f17496 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.
2017-11-17 13:10:06 +01:00
Roland Kaufmann
8b4578b9d8 Restructure tests directory to unit tests
Every program that relies on manual inspection has been moved to a new
(hopefully short-lived) directory called not-unit/; every remaining
file has been given the prefix test_ to indicate that this is the
executable test to be run.
2017-11-17 13:10:06 +01:00
Atgeirr Flø Rasmussen
9712bad814 Changed OpenRS->OPM in copyright notices and #include guards. 2017-11-17 13:10:06 +01:00
Bård Skaflestad
5b29859362 Remove a derelict statement inherited from original implementation.
Disabled by default, this statement attempted to pass a std::istream to
function std::fclose() which is meaningless and should not be enabled at
any time--even for a MATLAB-related build.
2017-11-17 13:10:06 +01:00
Xavier Raynaud
77da35fef1 Corrected typo in comments. 2017-11-17 13:10:06 +01:00
Atgeirr Flø Rasmussen
9b7529a265 Suppressed multiple warnings. 2017-11-17 13:10:06 +01:00
Xavier Raynaud
785a7308a5 Added possibility to parse comments in readparam. 2017-11-17 13:10:06 +01:00
Xavier Raynaud
9c79ab9794 merge 2017-11-17 13:10:06 +01:00
Bjørn Spjelkavik
98bfb48081 Changed namespace Dune -> namespace Opm. 2017-11-17 13:10:06 +01:00
Bård Skaflestad
da2e458f01 Support switching off syntax check in constructor.
This is useful if a set of parameters can all be defaulted in which
case launching the executable *should* be a simple as

    ./a.out

but the constructor requirement leads to using

    ./a.out a=b

or something similar.
2017-11-17 13:10:06 +01:00
Atgeirr Flø Rasmussen
9ebc0e5745 Now library contents build. Headers and tests not done yet. 2017-11-17 13:10:06 +01:00
Arne Morten Kvarving
439aae72d2 added: option to not define NDEBUG for release builds 2017-11-13 12:16:23 +01:00
Atgeirr Flø Rasmussen
4f6a398db1 Merge pull request #284 from blattms/only-set-existent-library-dirs-2
Only set the library directories if module builds a library.
2017-11-08 20:53:09 +01:00
Markus Blatt
4a46e4a4cd Only set the library directories if module builds a library. 2017-11-08 14:58:38 +01:00
Arne Morten Kvarving
d0c1eb28e3 Merge pull request #281 from andlaus/opm-simulators_no_umfpack_required
don't mark UMFpack as required for opm-simulators
2017-10-30 11:05:32 +01:00
Andreas Lauser
b6aa59aa66 Merge pull request #282 from atgeirr/minor-buildsys-fixes
Minor buildsystem fixes
2017-10-27 17:44:25 +02:00
Atgeirr Flø Rasmussen
1709398e25 Remove RT lib dependency. 2017-10-27 10:09:25 +02:00
Atgeirr Flø Rasmussen
de70cdcb52 Library not needed nor found on macOS. 2017-10-26 11:08:10 +02:00
Atgeirr Flø Rasmussen
5519643aa4 Always set include-related CMake variables. 2017-10-26 10:51:18 +02:00
Andreas Lauser
fe7938d82a don't mark UMFpack as required for opm-simulators
before OPM/opm-simulators#1309 it was required, but this was not
enforced by the build system because the SuiteSparse tests are run by
the opm-core build system first and UMFpack is optional there.

thanks to [at]akva2 and [at]blattms for the heads-up.
2017-10-25 16:48:33 +02:00
Atgeirr Flø Rasmussen
1554574728 Merge pull request #280 from akva2/update_rh_packaging
update redhat packaging
2017-10-25 13:06:13 +02:00
Arne Morten Kvarving
5667a4877a update redhat packaging 2017-10-25 09:37:22 +02:00