Commit Graph

94 Commits

Author SHA1 Message Date
Joakim Hove
36662b2734 Use internal string trim functions instead of boost algorithm 2020-02-13 18:25:37 +01:00
Joakim Hove
28d77dacd8 Add templated method create trimmed copy of string with c_str() 2020-01-19 23:18:49 +01:00
Joakim Hove
659fb45d04 Changed string_view::substr() to take(from, len) arguments 2019-08-16 09:04:49 +02:00
Joakim Hove
cf6161ecfe Add method string_view::find( char ) 2019-08-16 09:04:49 +02:00
Joakim Hove
9d9099a8fc Add string_view::starts_with() and string_view::find() methods 2019-08-10 18:05:22 +02:00
Joakim Hove
b148769cc6 Internalize UDA values in the deck 2019-04-28 16:08:02 +02:00
Arne Morten Kvarving
aa21cd8b13 quell cppcheck warnings for non-explicit constructor
- the implicit casts from std::string/char* is part of the design for
the view class so we do not want to disable those.
- intializer list constructors should be implicitly called
2017-06-09 17:38:42 +02:00
Arne Morten Kvarving
18f15e7432 mark constructors as explicit 2017-06-09 17:38:42 +02:00
Jørgen Kvalsvik
e884b0664c Redesign cmake
Tune the makefile according to new principles, which adds a few bells
and whistles and for clarity.

Synopsis:

* The dependency on opm-common is completely gone. This is reflected in
  travis and appveyor as well. No non-kitware cmake modules are used.
* Directories are flattened, quite a bit - source code is located in the
  lib/ directory if it belongs to opm-parser, and external/ if third
  party.
* The sibling build feature is implemented through cmake's
  export(PACKAGE) rather than implicitly looking through source files.
* Targets explicitly set required public and private include
  directories, compile options and definitions, which cmake will handle
  and propagate
* opm-parser-config.cmake for downstream users is now provided.
* Dependencies are set up using targets. In the future, when cmake 3.x+
  can be used, these should be either targets from newer Find modules,
  or interface libraries.
* Fewer system specific assumptions are coded in, instead we assume
  cmake or users set up system specific details.
* All module wide configuration and looking up libraries is handled in
  the root makefile - all sub directories only set up libraries and
  compile options for the module in question.
* Targets are defined and links handled transitively because cmake now
  is told about them. ${module_LIBRARIES} variables are gone.

This is largely guided by the principles outlined in
https://rix0r.nl/blog/2015/08/13/cmake-guide/

Most source files are just moved - if they have some content change then
it's nothing more than include fixes or similar in order to make them
compile.
2017-06-01 15:29:23 +02:00
Jørgen Kvalsvik
083b834cd1 Return uppercase() by value, don't force move 2017-01-03 15:42:30 +01:00
Jørgen Kvalsvik
9511d8252b Add Utility/Typetools
An enum and some utilities to build what's essentially sum types.
2016-10-23 15:47:20 +02:00
Jørgen Kvalsvik
508be3ecd5 Fix warnings in Stringview 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
02785741a6 Fix warnings in Functional 2016-07-13 23:40:09 +02:00
Jørgen Kvalsvik
3696b750cd Remove opm-common dependency
Severs the code dependency on opm-commmon. There was no actual
functional dependency here, with the exception of some enable/disable
warning headers. To properly make opm-parser a stand-alone module the
usage of these headers have been removed and the dependency on
opm-common is gone.
2016-07-08 15:53:40 +02:00
Jørgen Kvalsvik
2b10bba815 String.hpp/uppercase
A tiny utility file for shared string-related functions.
2016-06-14 17:01:50 +02:00
Joakim Hove
0986d49c05 Small test of fun::map and fun::concat. 2016-05-27 09:18:39 +02:00
Jørgen Kvalsvik
a105f3a193 string_view char* constructor 2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
6b64796d49 Add char* constructor to string_view
Mostly relevant for testing, this enables string_view to work as
expected with string literals.
2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
b648719513 Base string_view on char*, not string::iterator
By representing string_view as char* instead of
std::string::const_iterator the string_view class bring possibly
slightly lower overhead, but mostly enables some optimisations.
2016-05-03 09:16:27 +02:00
Jørgen Kvalsvik
bda128ee23 front/back support in string_view 2016-05-03 09:16:27 +02:00
Jørgen Kvalsvik
a93507087d string_view operator< and operator== support
In order for string_view to be useful as container member and sorting,
it has to support operator< and operator==
2016-05-03 09:16:27 +02:00
Jørgen Kvalsvik
2d1075efcb Check argument length in string_view == char*
Not doing this opens up for undefined behaviour when char* is shorter
than view.
2016-04-25 15:20:27 +02:00
Jørgen Kvalsvik
23f01511bd Add string_view::empty() 2016-03-15 16:42:02 +01:00
Atgeirr Flø Rasmussen
32439fa87d Remove unused boost-specific helpers. 2016-03-14 14:54:00 +01:00
Atgeirr Flø Rasmussen
2e1940e5c3 Move string_view ops to Opm namespace. 2016-03-14 13:28:51 +01:00
Jørgen Kvalsvik
8d4863ff86 Introducing string_view
A simple non-mutating view into a string. Implements a shallow reference
to a std::string, replicating its operations to be drop-in replaceable.

Primarily designed for inner loop use, where expensive string
allocations become a performance killer.
2016-03-14 08:29:53 +01:00
Jørgen Kvalsvik
d67a44b19d Include guards for Functional 2016-03-07 09:03:52 +01:00
Joakim Hove
99266809b7 Merge pull request #698 from jokva/equil-keyword-lookup
Equil keyword lookup
2016-03-04 18:19:43 +01:00
chflo
0db3abab94 Added copyright header to files that were without it 2016-03-04 14:56:18 +01:00
Atgeirr Flø Rasmussen
9e0c85dce7 Silence warnings from boost. 2016-03-01 10:12:09 +01:00
Atgeirr Flø Rasmussen
a828991bbc Add missing include directive. 2016-03-01 10:11:55 +01:00
Jørgen Kvalsvik
51df3685f3 Remove EquilWrapper.
This file is deprecated.
2016-03-01 08:44:38 +01:00
Jørgen Kvalsvik
ba743e488c Introduce Utility/Functional
Utility/Functional is a lightweight high level functional-oriented sub
library that attempts to abstract some common uses and boilerplate
around the parser code (and later maybe for other modules to use).

This patch introduce only three functions, but they have proven common
enough to warrant some common implementation.
2016-02-29 13:50:32 +01:00
Jørgen Kvalsvik
f0ae5db131 opm-parser adoption of Deck automatic ownership
Since the Deck* family of classes have changed their interfaces to no
longer use shared_ptr, a lot of code broke. This patch fixes all
problems in tests, other signatures and accesses to now use the new Deck
interfaces.
2016-02-18 13:27:24 +01:00
Jørgen Kvalsvik
6f417b0a4d Remove unused Utility/Wrapper.hpp
These wrapper classes are not used within any opm project, and can be
removed to reduce maintenance.
2016-02-17 11:48:40 +01:00
Jørgen Kvalsvik
4b98943665 Replaces unecessary header includes with fwd decls
Every header is self-contained and includes only what it must to
function, relying on users include what they need in source files,
adopting a pay-what-you-use model (in particular for internal
dependencies).
2016-01-26 13:23:22 +01:00
Jørgen Kvalsvik
f404828d63 Cleans up headers to improve build preformance
This is an effort to improve build performance.  Several includes
scattered across the project are either unused or partially used (i.e.
just used to import a type name, not depending on the actual contents of
the header file).

Replaces a lot of these includes with forward declarations.
2016-01-21 09:22:06 +01:00
Andreas Lauser
3b86bfd474 remove dangling file opm/parser/eclipse/Utility/tests/TableTests.cpp
somehow this fell through the cracks when doing the big tables overhaul.
2014-10-13 18:41:52 +02:00
Andreas Lauser
7ad309d3b3 move the table classes from .../Utility to .../EclipseState/Tables 2014-09-19 15:12:21 +02:00
Andreas Lauser
a057280492 tables: remove trailing underscores from the protected and private methods
opm-parser does not follow this convention...
2014-09-19 14:33:35 +02:00
Andreas Lauser
f6b2797e23 tables: make them instantiable exclusively by EclipseState
since tables can be tricky, we now enforce that the compiler bails out
if the user tries to instantiate a table class manually.

Note that a bit of trickery is needed to keep the low-level unit
tests working...
2014-09-19 14:33:35 +02:00
Andreas Lauser
e994d7314e endpoint scaling tables: make the bare-metal getColumn(index) method public
it is _strongly_ encuraged to use the properly named methods to access
the respective columns, but opm-core's current endpoint scaling code
makes it hard to use these...
2014-09-19 12:24:54 +02:00
Andreas Lauser
59d35de3af add table classes for RSVD and RVVD
these keywords are used by opm-core, albeit currently in a
"bare-metal" way.
2014-09-19 12:24:54 +02:00
Andreas Lauser
f544c926df tables: propertly handle defaults and monotonicity of columns
for some kinds of tables this means linear interpolation for some
columns, constant for other columns and some tables do not allow to
specify default. Since there is no clear rule, this patch involved
checking the reference manual for every single f****** table keyword
plus some guess-work if the reference manual is unclear about
monotonicity and/or defaults.
2014-09-19 12:07:06 +02:00
Andreas Lauser
fd6209a34d make it possible to evaluate some tables using linear interpolation
... and constant interpolation at the fringes. this kind of evaluation
in between sampling point only makes sense for tables where the first
column is strictly monotonic, though.
2014-09-19 12:07:06 +02:00
Andreas Lauser
1bbe775831 make all table classes default constructible
this allows to store them in std::vectors, but requires to call the
init() method after construction...
2014-09-19 12:07:06 +02:00
Andreas Lauser
0055703aef remove PvcdoTable
because PVCDO is not a table keyword.
2014-09-19 12:07:06 +02:00
Andreas Lauser
0d423b83f4 remove the PvtwTable
because PVTW is not a table keyword...
2014-09-19 12:07:06 +02:00
Andreas Lauser
f440f34788 remove RockTable
because ROCK is not a table keyword
2014-09-19 12:07:06 +02:00
Andreas Lauser
c5f78788e0 add the IMPTVD and IMKRVD keywords and table classes
basically they are just renamed copies of the EN* variants...
2014-09-19 12:07:05 +02:00