Commit Graph

11613 Commits

Author SHA1 Message Date
Joakim Hove
82d748386c Remove superfluos 'from' 2022-02-10 07:25:12 +01:00
Joakim Hove
3731230049 Add UDQ and ACTIONX documentation for technical manual 2022-02-10 07:25:12 +01:00
Markus Blatt
3bd13c9e85
Merge pull request #2955 from bska/general-reg-iregflow
Recognize Non-Default FIP Arrays for Inter-Region Flow Summary Keywords
2022-02-09 16:23:42 +01:00
Bård Skaflestad
55a7d0af19 Retrieve FIP Arrays of Inter-Region Flows
This commit adds a new query

    SummaryConfig::fip_regions_interreg_flow

that retrieves the set of FIP array names (e.g., FIPNUM and FIPXYZ)
that are associated to any inter-region flow summary keywords.  This
query method returns an empty set if there are no inter-region flow
summary keywords.
2022-02-04 20:38:10 +01:00
Bård Skaflestad
0d6c43f431 Recognize Non-Default FIP Array for Inter-Region Flows
This commit extends the 'SummaryConfig' support for inter-region
flows to be aware of user-provided FIP arrays.  In other words, we
now recognize, e.g., that

    ROFT_XYZ

is the cumulative inter-region oil flow volume corresponding to
regions defined by the 'FIPXYZ' region definition.
2022-02-04 20:38:10 +01:00
Markus Blatt
9b53068e8b
Merge pull request #2954 from blattms/python-use-correct-cxx-to-link
[python] Use correct C++ compiler for linking.
2022-02-04 15:59:21 +01:00
Markus Blatt
06618244e7 Use C++ everywhere and skip using a custom build_ext subclass.
Somehow using a custom build_ext subclass always triggered a failing
rebuild when testing:

/usr/lib/ccache/g++-10 -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,-z,relro -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-RNBry6/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.9/cxx/builtin_pybind11.o build/temp.linux-x86_64-3.9/cxx/connection.o build/temp.linux-x86_64-3.9/cxx/converters.o build/temp.linux-x86_64-3.9/cxx/deck.o build/temp.linux-x86_64-3.9/cxx/deck_keyword.o build/temp.linux-x86_64-3.9/cxx/eclipse_config.o build/temp.linux-x86_64-3.9/cxx/eclipse_grid.o build/temp.linux-x86_64-3.9/cxx/eclipse_io.o build/temp.linux-x86_64-3.9/cxx/eclipse_state.o build/temp.linux-x86_64-3.9/cxx/emodel_util.o build/temp.linux-x86_64-3.9/cxx/export.o build/temp.linux-x86_64-3.9/cxx/field_props.o build/temp.linux-x86_64-3.9/cxx/group.o build/temp.linux-x86_64-3.9/cxx/log.o build/temp.linux-x86_64-3.9/cxx/parsecontext.o build/temp.linux-x86_64-3.9/cxx/parser.o build/temp.linux-x86_64-3.9/cxx/schedule.o build/temp.linux-x86_64-3.9/cxx/summary_state.o build/temp.linux-x86_64-3.9/cxx/table_manager.o build/temp.linux-x86_64-3.9/cxx/unit_system.o build/temp.linux-x86_64-3.9/cxx/well.o -lopmcommon -lboost_system -lstdc++fs -o build/lib.linux-x86_64-3.9/opm/libopmcommon_python.cpython-39-x86_64-linux-gnu.so -fopenmp /usr/lib/x86_64-linux-gnu/libfmt.so.7.1.3
error: can't copy 'build/lib.linux-x86_64-3.9/opm/libopmcommon_python.cpython-39-x86_64-linux-gnu.so': doesn't exist or not a regular file

Therefore we resort to only setting the CC and CXX variables to the
C++ compiler. Note that one cannot use "ccache c++" for CXX.

With the default build_ext the problem vanishes.
2022-02-04 10:07:05 +01:00
Bård Skaflestad
7b3e6ea534
Merge pull request #2953 from totto82/nlinears
Add NLINEARS
2022-02-03 17:09:20 +01:00
Markus Blatt
b67091183b [python] Use correct C++ compiler for linking.
CC is the C compiler. CXX is the C++ compiler. Setuptools will
use the C++ compiler for C++ code. Hence it is vital to set that
correctly. If not set the default C++ compiler will be used.

Unfortunately it will use the first string as the CXX compiler and
hence we need to strip ccache. Fortunately it used CC for the
compilation and that works with gcc as well.
2022-02-03 17:02:09 +01:00
Tor Harald Sandve
646fa507f6 Add NLINEARS 2022-02-03 14:35:07 +01:00
Markus Blatt
94a095a2b6
Merge pull request #2931 from plgbrts/expli-salt
allow for explicit initial condition for SALT and SALTP
2022-02-03 11:19:02 +01:00
Markus Blatt
c5691477e5
Merge pull request #2948 from blattms/fix-setup.py-mult-lib
[bugfix] Make opm-common_PYTHON_LINKAGE a comma separated list.
2022-02-02 09:44:34 +01:00
Markus Blatt
64bd13231d
Merge pull request #2949 from blattms/fix-no-python-but-embedded
[cmake][bugfix] Test python/embedded python flags before source_hook.
2022-02-02 09:43:46 +01:00
Bård Skaflestad
7b9fa31894
Merge pull request #2951 from joakim-hove/empty-actionx
Empty actionx
2022-01-31 15:40:32 +01:00
Joakim Hove
d55f5fa5f5 Allow ACTIONX with empty condition
Allow ACTIONX keywords with empty conditions, these ACTIONX keywords will always
evaluate to false. Main motivation is to facilitate dummy keywords for PYACTION.
2022-01-31 15:10:40 +01:00
Joakim Hove
23f02023a3 Add method Action::ASTNode::empty() 2022-01-31 11:39:52 +01:00
Joakim Hove
0b27fd8e18 Remove unused function 2022-01-31 10:18:00 +01:00
Bård Skaflestad
4be0eea139
Merge pull request #2950 from joakim-hove/pyaction-handle-return
Pyaction handle return
2022-01-28 12:25:17 +01:00
Joakim Hove
343f14dacf Record and act on return value from PYACTION 2022-01-28 12:05:17 +01:00
Joakim Hove
c37c2b2d49 Make SummaryState::set() available as __setitem__ in Python 2022-01-28 12:05:17 +01:00
Joakim Hove
c660b2e4b4 Make SummaryState public member in msim class 2022-01-28 12:05:17 +01:00
Joakim Hove
4928782cf4 Add Schedule member to the msim class 2022-01-28 12:05:17 +01:00
Markus Blatt
325e559229 [cmake][bugfix] Test python/embedded python flags before source_hook.
If cmake is run with `-DOPM_ENABLE_EMBEDDED_PYTHON=ON -DOPM_ENABLE_PYTHON=OFF`
a cmake error was produced because the library would depend on
python/cxx/builtin_pybind11.cpp which would not be generated.

We fix this by doing the Python sanity check (deactivate embedded
python if python is disabled) before running source_hook that adds the
dependency.

Closes #2940
2022-01-27 15:21:33 +01:00
Markus Blatt
ba2065853a
Merge pull request #2943 from joakim-hove/setup-linker
Make sure env variable CC is set also if no ccache
2022-01-27 11:37:59 +01:00
Markus Blatt
1daa7d1df4 [bugfix] Make library list used for setup.py a comma separated list.
It is used verbatim in setup.py in the list that specifies the linker
flage. Hence it needs to comma separted instead of using a semicolon
as separator.

We also rename it to SETUP_PY_LINKAGE to indicate where it is used.

Closes #2947
2022-01-27 11:26:56 +01:00
Bård Skaflestad
7471cef938
Merge pull request #2944 from bska/chase-api-update-for-non-python
Update Signature for PyAction::run When !EMBEDDED_PYTHON
2022-01-26 21:12:44 +01:00
Bård Skaflestad
15abd2bd49 Update Signature for PyAction::run When !EMBEDDED_PYTHON
Otherwise, we get build errors of the form "no declaration matches"
2022-01-26 20:57:03 +01:00
Joakim Hove
07500d5f09 Set the CC environment variable also for non ccache situation 2022-01-26 12:20:43 +01:00
Joakim Hove
c0be54af92
Merge pull request #2939 from joakim-hove/pyaction-use-actionx
Pyaction use actionx
2022-01-26 08:29:27 +01:00
Joakim Hove
46b663218a Enable running normal ACTIONX keywords from PYACTION
The run() function invoked by PYACTION has got a new fifth argument which is a
callable the script should utilize to apply the keywords from an ACTIONX
keyword. The callable is implemented as C++ lambda which will run the
Schedule::iterateScheduleSection() method and make sure an updated
SimulatorUpdate variable can be passed back to the simulator.
2022-01-25 10:04:43 +01:00
Joakim Hove
4224e26321 Accept empty list of matching_wells when resolving '?' 2022-01-25 09:45:32 +01:00
Joakim Hove
45a6e4fb15 Add method Actions::has( action_name ) 2022-01-25 09:45:32 +01:00
Markus Blatt
5e5dd48cee
Merge pull request #2942 from joakim-hove/use-cmake-cxx-compiler
Use C++ compiler from cmake in setup.py
2022-01-24 21:52:57 +01:00
Joakim Hove
c1905359d9
Merge pull request #2941 from bska/consistent-kw-repr
Fix Several Name Inconsistencies in JSON Keyword Representation
2022-01-24 16:58:35 +01:00
Bård Skaflestad
6bb8855afd Fix RADFIN Keyword Representation
Previous version was a copy of RADFIN4 representation.
2022-01-24 16:42:53 +01:00
Joakim Hove
b3faf8abf2 Use C++ compiler from cmake in setup.py 2022-01-24 16:05:25 +01:00
Bård Skaflestad
1603100f0d Remove Extraneous JSON Input Files
There are no such keywords as 'RSSSPEC' (three 'S'-es) or 'DFLOWR'.
2022-01-24 15:51:50 +01:00
Bård Skaflestad
6dcdcaf08c Fix Keyword Names
Should match the name of the generator JSON input file.
2022-01-24 15:51:50 +01:00
Joakim Hove
8a0e1b21b9
Merge pull request #2932 from joakim-hove/pyaction-applyaction
Pyaction applyaction
2022-01-24 08:20:14 +01:00
Joakim Hove
9a80c00828
Merge pull request #2933 from blattms/rename-workarea.cpp-to-workarea.hpp
Renames header tests/WorkArea.cpp to tests/WorkArea.hpp
2022-01-23 10:54:07 +01:00
Bård Skaflestad
7d9c1b1aaf
Merge pull request #2938 from blattms/support-libfmt8
Cast enum classes to int when used in fmt::format.
2022-01-22 09:09:38 +01:00
Markus Blatt
034ea368b0 Cast enum classes to int when used in fmt::format.
This is needed for libfmt >= 8.1.0 as in that version the
cast to int was removed from inside the fmt::format call and an
assertion will fail:
```
In file included from /usr/include/fmt/format.h:48,
                 from /build/opm-common-2021.10/src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.cpp:22:
/usr/include/fmt/core.h: In instantiation of 'constexpr fmt::v8::detail::value<Context> fmt::v8::detail::make_arg(T&&) [with bool IS_PACKED = true; Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; fmt::v8::detail::type <anonymous> = fmt::v8::detail::type::custom_type; T = Opm::UDQVarType&; typename std::enable_if<IS_PACKED, int>::type <anonymous> = 0]':
/usr/include/fmt/core.h:1855:77:   required from 'constexpr fmt::v8::format_arg_store<Context, Args>::format_arg_store(T&& ...) [with T = {const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int&, Opm::UDQVarType&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int&, Opm::UDQVarType&}; Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; Args = {std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long unsigned int, Opm::UDQVarType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long unsigned int, Opm::UDQVarType}]'
/usr/include/fmt/core.h:1872:38:   required from 'constexpr fmt::v8::format_arg_store<Context, typename std::remove_cv<typename std::remove_reference<Args>::type>::type ...> fmt::v8::make_format_args(Args&& ...) [with Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; Args = {const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int&, Opm::UDQVarType&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int&, Opm::UDQVarType&}]'
/usr/include/fmt/core.h:3119:44:   required from 'std::string fmt::v8::format(fmt::v8::format_string<T ...>, T&& ...) [with T = {const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int, Opm::UDQVarType, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int, Opm::UDQVarType}; std::string = std::__cxx11::basic_string<char>; fmt::v8::format_string<T ...> = fmt::v8::basic_format_string<char, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int, Opm::UDQVarType, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long unsigned int, Opm::UDQVarType>]'
/build/opm-common-2021.10/src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.cpp:523:27:   required from here
/usr/include/fmt/core.h:1728:7: error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt
 1728 |       formattable,
      |       ^~~~~~~~~~~
/usr/include/fmt/core.h:1728:7: note: 'formattable' evaluates to false
```
2022-01-21 22:13:54 +01:00
Joakim Hove
1c3aa651f1
Merge pull request #2937 from blattms/udqenum-fix-spelling
Fixes spelling error in UDQEnums.cpp
2022-01-21 21:00:33 +01:00
Markus Blatt
ad023b57c1 Fixes spelling error in UDQEnums.cpp 2022-01-21 18:33:13 +01:00
Markus Blatt
1b76df42cb
Merge pull request #2936 from bska/fix-keyword-name
Ensure That Keyword Name Matches Filename
2022-01-21 18:27:41 +01:00
Bård Skaflestad
36903d3e9d Ensure That Keyword Name Matches Filename
Otherwise, we get "missing keyword" errors at the parsing stage.
2022-01-21 15:08:02 +01:00
Bård Skaflestad
10bdd92b94
Merge pull request #2934 from bska/fix-uninitialized-member
Ensure Proper Initialisation of All TableManager Member
2022-01-21 15:06:05 +01:00
Bård Skaflestad
6f79a86e66 Ensure Proper Initialisation of All TableManager Member
Otherwise, the equality operators for a default-constructed
TableManager object, mostly used in unit tests, will depend on
uninitialised values.

Thanks to [at]akva2 for the initial clue to the underlying cause.
2022-01-21 13:13:10 +01:00
Markus Blatt
274cee38c7 Renames header tests/WorkArea.cpp to tests/WorkArea.hpp 2022-01-21 10:18:56 +01:00
Joakim Hove
49c10378bb
Merge pull request #2929 from bska/internalise-interreg-smry-nodes
Make SummaryConfig Nodes for Inter-Region Flows
2022-01-20 17:17:20 +01:00