Commit Graph

120 Commits

Author SHA1 Message Date
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
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
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
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
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
Rohith Nair
579a648ebc edit 2017-06-27 10:32:05 +02:00
Rohith Nair
08b659fe11 Revert to formatting prefix message 2017-06-27 10:27:32 +02:00
Rohith Nair
531fb27ba1 edit 2017-06-26 11:54:53 +02:00
Rohith Nair
0024fd9052 Add line space before problems, messages and warnings 2017-06-26 10:57:38 +02:00
Arne Morten Kvarving
b9dde75a4d remove extra class qualification
may cause portability issues
2017-06-08 16:33:25 +02:00
Arne Morten Kvarving
19ca0e291b initialize members 2017-06-08 16:30:53 +02:00
Arne Morten Kvarving
2c00b418b5 pass by reference 2017-06-08 16:30:46 +02:00
Arne Morten Kvarving
b7302a5ace mark single-parameter constructors as explicit 2017-06-08 16:30:09 +02:00
Rohith Nair
d361bd8766 Adds exception TooManyIterations
Adds 2 new message types to OpmLog

Revert "Adds 2 new message types to OpmLog"

This reverts commit 587cde3c6c78077cd6e5ae008038f72b2b39982d.
2017-06-07 09:58:20 +02:00
Arne Morten Kvarving
f147dd9589 remove namespace qualifier
code is already in the namespace, some compilers consider this an error.
2017-06-02 16:02:24 +02:00
Robert Kloefkorn
d38658858d added two gcc 6.3 related warnings. 2017-04-10 13:44:54 +02:00
Rohith Nair
be3f1ed59b edited formatting 2017-04-04 10:01:13 +02:00
Rohith Nair
2313ab4029 Changed terminal output color for problem messages to magenta from red 2017-04-04 09:55:46 +02:00
Atgeirr Flø Rasmussen
f9311b96f3 Merge pull request #231 from atgeirr/refine-simple-logging
Make setupSimpleDefaultLogging() more flexible.
2017-03-20 08:08:04 +01:00
Atgeirr Flø Rasmussen
26974f28ef Make implementation of stdoutIsTerminal() more robust. 2017-03-17 15:40:02 +01:00
Atgeirr Flø Rasmussen
e0105c6ccf Merge pull request #205 from GitPaean/adding_Wcast_qual_warning_flag
adding -Wcast-qual to disable_warnings.h
2017-03-17 15:35:49 +01:00
Atgeirr Flø Rasmussen
7462cc4b96 Only use color coding for simple log setup if terminal.
Note that isatty() might need to be replaced by isatty_() for Windows.
2017-03-17 08:46:50 +01:00
Atgeirr Flø Rasmussen
726496c0b6 Make setupSimpleDefaultLogging() more flexible.
Also added documentation for the function.
2017-03-16 12:56:34 +01:00
Andreas Lauser
52c05e6525 move the infrastructure for valgrind client requests into the Opm namespace 2017-02-09 18:26:31 +01:00
Andreas Lauser
3d096a54ec move over the code for valgrind client requests from opm-material 2016-12-14 16:47:41 +01:00
Andreas Lauser
f17880579c Provide a free function to reset the localization settings
Under some circumstances, some environments seem to set a locale which
they do not install. In turn this leads to std::runtime_errror being
thrown by some parts of Boost (for some versions) which causes
unsolicited program aborts.

This issue asside, it looks pretty weird if the e.g. the number format
is different than the that of the language used to print stuff by rest
of the simulation.
2016-12-07 14:04:32 +01:00
Andreas Lauser
5100db5694 move the Unused.hpp file from opm-material to here 2016-11-22 15:53:36 +01:00
Kai Bao
2724aae005 adding -Wcast-qual to disable_warnings.h 2016-11-14 18:05:41 +01:00