Compare commits
404 Commits
release/20
...
release/20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a3326a7d8 | ||
|
|
7f2bdb9d65 | ||
|
|
8738f78a10 | ||
|
|
45f01eb2ab | ||
|
|
5babdb413c | ||
|
|
ebc0f30b94 | ||
|
|
5ae44d0d4c | ||
|
|
aed0063b61 | ||
|
|
ba067e4132 | ||
|
|
81c8021cdd | ||
|
|
325da26722 | ||
|
|
87b501f7b0 | ||
|
|
1ab30d9182 | ||
|
|
330ef3c26a | ||
|
|
0c1ae46f01 | ||
|
|
81160c55e9 | ||
|
|
a52f8bf782 | ||
|
|
43eb1bac37 | ||
|
|
2f0e782dfd | ||
|
|
5f77a71b8f | ||
|
|
e281a1e661 | ||
|
|
d894ef99d3 | ||
|
|
cc81743dad | ||
|
|
a4995686f3 | ||
|
|
bd3aa76268 | ||
|
|
6c740656bb | ||
|
|
69839e8766 | ||
|
|
f414cdd30e | ||
|
|
3f8f4d0362 | ||
|
|
cba282bd34 | ||
|
|
2a2a9748a3 | ||
|
|
20e3202067 | ||
|
|
6c8120abe6 | ||
|
|
499663f048 | ||
|
|
64964c3afe | ||
|
|
6c735230ba | ||
|
|
3f8195a839 | ||
|
|
2b87eecd68 | ||
|
|
991ea3cf0d | ||
|
|
c1d916f66e | ||
|
|
67dbe5c9e7 | ||
|
|
9f02b613e8 | ||
|
|
121a062abe | ||
|
|
00eda12fa0 | ||
|
|
0e341ef6e1 | ||
|
|
8601805d62 | ||
|
|
d410f38e11 | ||
|
|
57bc9a8f02 | ||
|
|
ca0246c548 | ||
|
|
4326b8c78e | ||
|
|
77676000f7 | ||
|
|
fb0f3c451e | ||
|
|
1010c81b3d | ||
|
|
cc6769c1a2 | ||
|
|
16af572080 | ||
|
|
cea1dea368 | ||
|
|
51ecf87682 | ||
|
|
a61747eb74 | ||
|
|
ec7145e817 | ||
|
|
e10faa139c | ||
|
|
99affa9043 | ||
|
|
f54c3d7480 | ||
|
|
6af6676d5f | ||
|
|
eecb713e00 | ||
|
|
6b05ee2210 | ||
|
|
03a94a7288 | ||
|
|
c5158a1c24 | ||
|
|
1a3166d913 | ||
|
|
328ee9b591 | ||
|
|
39c1a68f37 | ||
|
|
26a566ef94 | ||
|
|
39c91be4ee | ||
|
|
7a60c4c239 | ||
|
|
c664a0dfd2 | ||
|
|
7e34f86f42 | ||
|
|
d609d942db | ||
|
|
c67bdf8aeb | ||
|
|
34ea7f3662 | ||
|
|
351a5d7292 | ||
|
|
c042c22546 | ||
|
|
5086d5d74e | ||
|
|
1850e45ed5 | ||
|
|
939b943911 | ||
|
|
b33d04ebf7 | ||
|
|
34ab8d73b0 | ||
|
|
cff70712ca | ||
|
|
d731cd3775 | ||
|
|
95e78f64ad | ||
|
|
9e143482cf | ||
|
|
63f5dbdb81 | ||
|
|
14f9c41613 | ||
|
|
25daf13909 | ||
|
|
6576370c19 | ||
|
|
35cf4761df | ||
|
|
f55bbefd18 | ||
|
|
ff3da8cc79 | ||
|
|
d10ed6c953 | ||
|
|
6546b780f8 | ||
|
|
1f5b60d651 | ||
|
|
43c66042da | ||
|
|
8e2445b4cc | ||
|
|
b936fe6c0b | ||
|
|
964fdfde12 | ||
|
|
b38da649e0 | ||
|
|
07b506fc1c | ||
|
|
d91608eff3 | ||
|
|
8395ffd904 | ||
|
|
6b94c5091a | ||
|
|
d21926a837 | ||
|
|
418173bbcc | ||
|
|
1670c217ee | ||
|
|
de13002f2f | ||
|
|
541fba174a | ||
|
|
d42481b747 | ||
|
|
ada6853a61 | ||
|
|
1573ffb8da | ||
|
|
0b1280ceec | ||
|
|
5eb496c79c | ||
|
|
08830154b6 | ||
|
|
7b903660a0 | ||
|
|
f018c2e0d9 | ||
|
|
0c4492500b | ||
|
|
1a9713278c | ||
|
|
8a67f6606c | ||
|
|
9690397cc1 | ||
|
|
a2bade84a4 | ||
|
|
b1e3774aeb | ||
|
|
14c67cdbe6 | ||
|
|
a8c0e19424 | ||
|
|
de7f5a8f69 | ||
|
|
e8b9e258b1 | ||
|
|
ae90a27ca1 | ||
|
|
64aee42bf1 | ||
|
|
c7329aa527 | ||
|
|
f6fa3e9fa5 | ||
|
|
016b899ad6 | ||
|
|
9da5bbb463 | ||
|
|
8d6dbd9a7e | ||
|
|
6738269487 | ||
|
|
6112a6018b | ||
|
|
1c967f6d70 | ||
|
|
1a9e6b3810 | ||
|
|
bc6d5e38ce | ||
|
|
231b71a29c | ||
|
|
645b3b3eaa | ||
|
|
d68e254811 | ||
|
|
fbff174cd8 | ||
|
|
cb5475d178 | ||
|
|
b05cba5315 | ||
|
|
3d36bbcb9c | ||
|
|
a90b202b87 | ||
|
|
0c1186346a | ||
|
|
f4af5fd947 | ||
|
|
ea8f64cb87 | ||
|
|
524752da63 | ||
|
|
6ac5c8127d | ||
|
|
848942317e | ||
|
|
87a736ef84 | ||
|
|
88d3d86dd6 | ||
|
|
4faa9634a0 | ||
|
|
efe759676b | ||
|
|
a7ecd2aaac | ||
|
|
e3a961df2b | ||
|
|
3abfddd088 | ||
|
|
7670a0c248 | ||
|
|
feb695e1fd | ||
|
|
c95cae5c63 | ||
|
|
883e701a13 | ||
|
|
2a4f62844d | ||
|
|
7f50f7e95d | ||
|
|
3dcc3e35b9 | ||
|
|
d5830c0aa0 | ||
|
|
3c48148d8b | ||
|
|
d09c275fe4 | ||
|
|
99ea0ee497 | ||
|
|
e9e70c6eac | ||
|
|
93dbf570d6 | ||
|
|
a21680cc96 | ||
|
|
0de1c488d2 | ||
|
|
fd3f444c80 | ||
|
|
17c8b01d4b | ||
|
|
072b8be064 | ||
|
|
a3a9413ab0 | ||
|
|
1522ee4f4d | ||
|
|
632f1457b1 | ||
|
|
6479f77340 | ||
|
|
3ffc61e221 | ||
|
|
9658257960 | ||
|
|
7ee1fd9ed1 | ||
|
|
da6802e787 | ||
|
|
f1986689b5 | ||
|
|
b9ed81fe2a | ||
|
|
ba120652b5 | ||
|
|
6c5e2541bc | ||
|
|
2f7f360563 | ||
|
|
8754a59d38 | ||
|
|
70d45e74dc | ||
|
|
61e68dccb6 | ||
|
|
e4346da3ea | ||
|
|
49262ae96d | ||
|
|
cbab4e50c0 | ||
|
|
94150f1a0c | ||
|
|
ff13f8c091 | ||
|
|
0dadf54a23 | ||
|
|
17a08ddcd9 | ||
|
|
8e636f22a1 | ||
|
|
e5fdfb16df | ||
|
|
cc48ad4632 | ||
|
|
dacd635c38 | ||
|
|
9660189290 | ||
|
|
5df933460b | ||
|
|
e4129cf826 | ||
|
|
189a043c6d | ||
|
|
7e8a91b81f | ||
|
|
eb7476e0cf | ||
|
|
f96290e1df | ||
|
|
9af8c785b2 | ||
|
|
e82ec7a274 | ||
|
|
6561138236 | ||
|
|
26886bf4fa | ||
|
|
9ec5680915 | ||
|
|
0b0f9cab33 | ||
|
|
90f27b58cd | ||
|
|
1012e15711 | ||
|
|
ec57a4d10b | ||
|
|
92ebef3bc9 | ||
|
|
5532176af4 | ||
|
|
c5b0cd6f61 | ||
|
|
068bff1ebc | ||
|
|
5e7191c79e | ||
|
|
ef6d448077 | ||
|
|
10dcb8945f | ||
|
|
cf0eb66009 | ||
|
|
247547355c | ||
|
|
1ea89ab140 | ||
|
|
5cca4b0be0 | ||
|
|
a8a1d140d5 | ||
|
|
4fe559ba3c | ||
|
|
a5cfafe4de | ||
|
|
bad915fdf5 | ||
|
|
96ab0e036d | ||
|
|
a79ee15082 | ||
|
|
7dd56d2bde | ||
|
|
b87867d144 | ||
|
|
5377ff3442 | ||
|
|
336f7a4159 | ||
|
|
c740b3705d | ||
|
|
c951d7ff6e | ||
|
|
99702cdf49 | ||
|
|
ffa12e5d09 | ||
|
|
3f025070fe | ||
|
|
1516b63a39 | ||
|
|
fdc0ea3436 | ||
|
|
114753c459 | ||
|
|
e2c99a28e7 | ||
|
|
80545120b6 | ||
|
|
35029e0313 | ||
|
|
19c58e33c4 | ||
|
|
d4cd92ee40 | ||
|
|
013b279682 | ||
|
|
f18ee95574 | ||
|
|
254b2e2862 | ||
|
|
b4eb8fbd4f | ||
|
|
d35abfddb6 | ||
|
|
54ba23d71b | ||
|
|
a066d2b95f | ||
|
|
433cc4d649 | ||
|
|
00ace58e6c | ||
|
|
042830e860 | ||
|
|
5495266115 | ||
|
|
4d9387ee23 | ||
|
|
531803eb0a | ||
|
|
c07357cdc3 | ||
|
|
0a287ca914 | ||
|
|
7b31522fdd | ||
|
|
41d0b21463 | ||
|
|
9e1aaca9e9 | ||
|
|
04736dcbd0 | ||
|
|
6caebad329 | ||
|
|
a4576d253d | ||
|
|
8611f664cb | ||
|
|
d0a1101bc8 | ||
|
|
4d76351111 | ||
|
|
a97df7c889 | ||
|
|
0d6dc717d3 | ||
|
|
02c06e9ae3 | ||
|
|
90d0b6479a | ||
|
|
0dab2aaf2b | ||
|
|
f9bbf34b9a | ||
|
|
e568d14a87 | ||
|
|
86fe7bbc3f | ||
|
|
bc966fa32a | ||
|
|
eca8583358 | ||
|
|
f5a2f6de74 | ||
|
|
29954fd91f | ||
|
|
194a599303 | ||
|
|
7867bcb5fd | ||
|
|
412a11d92f | ||
|
|
fae7b5ccfc | ||
|
|
dd528b74dd | ||
|
|
a058253ece | ||
|
|
d42d437e17 | ||
|
|
f5b49a19fe | ||
|
|
0d1075daee | ||
|
|
43dafbc995 | ||
|
|
e3f97e45d9 | ||
|
|
050540525f | ||
|
|
4a51cfb707 | ||
|
|
3af1d464eb | ||
|
|
964f028413 | ||
|
|
d032078634 | ||
|
|
b3eddb7061 | ||
|
|
e778960932 | ||
|
|
046736e45d | ||
|
|
02167f2c2f | ||
|
|
819a28a94d | ||
|
|
dbec8e4466 | ||
|
|
5a61625768 | ||
|
|
3a5b17a070 | ||
|
|
f6ca3ccaff | ||
|
|
e6d8d59525 | ||
|
|
32c3d9bcb0 | ||
|
|
9a97d5c998 | ||
|
|
1433bc7a55 | ||
|
|
ab81083e02 | ||
|
|
d34910c27d | ||
|
|
e1e0edba7d | ||
|
|
4333a69cd4 | ||
|
|
89b790d72f | ||
|
|
d278880091 | ||
|
|
8ff84920ed | ||
|
|
378bd03eef | ||
|
|
607b8e7ebf | ||
|
|
4f181ec439 | ||
|
|
b4cebad6a9 | ||
|
|
188d7802a3 | ||
|
|
adb84c15cc | ||
|
|
b36f415a96 | ||
|
|
67b7fe58b3 | ||
|
|
6049b6e254 | ||
|
|
2aff28dd57 | ||
|
|
c5b9c8ea18 | ||
|
|
82a5e7192e | ||
|
|
fa740678e0 | ||
|
|
acd90212d7 | ||
|
|
a036273540 | ||
|
|
678114116f | ||
|
|
180b7cb664 | ||
|
|
d11d7d6ca0 | ||
|
|
462457fb39 | ||
|
|
f7ea7674c0 | ||
|
|
c91bde8182 | ||
|
|
0e2623d6dd | ||
|
|
b9e9112c6b | ||
|
|
b9eaa3a6aa | ||
|
|
f751c46f10 | ||
|
|
14a6a5a4c3 | ||
|
|
25ede43bf7 | ||
|
|
f4fde15e67 | ||
|
|
f467ed7251 | ||
|
|
d9ca1fe86f | ||
|
|
9a07a5d419 | ||
|
|
7e9e3e26eb | ||
|
|
84ef4f6aa3 | ||
|
|
cec7cffe7a | ||
|
|
9a51b6ec7c | ||
|
|
d345098471 | ||
|
|
d2c778739b | ||
|
|
68438e3f79 | ||
|
|
d2cf59380e | ||
|
|
dd19213998 | ||
|
|
267f642794 | ||
|
|
db929b509e | ||
|
|
2b53a25ff6 | ||
|
|
90a451c37d | ||
|
|
4f46615caa | ||
|
|
1d3cb8b2bb | ||
|
|
5107d8c401 | ||
|
|
51b73c1997 | ||
|
|
aeb9ae8e1e | ||
|
|
b8ab89591a | ||
|
|
612c156013 | ||
|
|
ec7aadd511 | ||
|
|
410f2ecc34 | ||
|
|
7d66ff7c12 | ||
|
|
deffadd92e | ||
|
|
4871f618bf | ||
|
|
dff5144d6a | ||
|
|
2eb49a451c | ||
|
|
bf259a5444 | ||
|
|
3f34913fb0 | ||
|
|
3349bac28f | ||
|
|
635aafa6f8 | ||
|
|
9f332b87a4 | ||
|
|
5dc5cd10b6 | ||
|
|
ecde5ebc8c | ||
|
|
85837a71a5 | ||
|
|
2f726690e7 | ||
|
|
fff89abd6b | ||
|
|
740beea44a | ||
|
|
7496599d41 | ||
|
|
a5d19c4cf0 | ||
|
|
09f80a3da1 | ||
|
|
7956c2d7da |
@@ -9,7 +9,7 @@ option(ENABLE_ECL_INPUT "Enable eclipse input support?" ON)
|
||||
option(ENABLE_ECL_OUTPUT "Enable eclipse output support?" ON)
|
||||
option(ENABLE_MOCKSIM "Build the mock simulator for io testing" ON)
|
||||
option(OPM_ENABLE_PYTHON "Enable python bindings?" OFF)
|
||||
option(OPM_INSTALL_PYTHON "Enable python bindings?" OFF)
|
||||
option(OPM_INSTALL_PYTHON "Install python bindings?" ON)
|
||||
option(OPM_ENABLE_EMBEDDED_PYTHON "Enable embedded python?" OFF)
|
||||
|
||||
# Output implies input
|
||||
@@ -32,13 +32,13 @@ set(OPM_PROJECT_EXTRA_CODE_INSTALLED "#ENABLE_ECL_INPUT is needed by opm-common
|
||||
set(ENABLE_ECL_INPUT ${ENABLE_ECL_INPUT})
|
||||
set(OPM_MACROS_ROOT ${CMAKE_INSTALL_PREFIX}/share/opm)
|
||||
list(APPEND CMAKE_MODULE_PATH \${OPM_MACROS_ROOT}/cmake/Modules)
|
||||
include(OpmPackage) #Make macros availabe after find_package(opm-common)")
|
||||
include(OpmPackage) #Make macros available after find_package(opm-common)")
|
||||
|
||||
set(OPM_PROJECT_EXTRA_CODE_INTREE "#ENABLE_ECL_INPUT is needed by opm-common-prereq.cmake
|
||||
set(ENABLE_ECL_INPUT ${ENABLE_ECL_INPUT})
|
||||
set(OPM_MACROS_ROOT ${OPM_MACROS_ROOT})
|
||||
list(APPEND CMAKE_MODULE_PATH \${OPM_MACROS_ROOT}/cmake/Modules)
|
||||
include(OpmPackage) #Make macros availabe after find_package(opm-common)")
|
||||
include(OpmPackage) #Make macros available after find_package(opm-common)")
|
||||
if(ENABLE_ECL_OUTPUT)
|
||||
set(OPM_PROJECT_EXTRA_CODE_INSTALLED "${OPM_PROJECT_EXTRA_CODE_INSTALLED}
|
||||
set(COMPARE_ECL_COMMAND ${CMAKE_INSTALL_PREFIX}/bin${${name}_VER_DIR}/compareECL)
|
||||
@@ -136,6 +136,7 @@ macro (sources_hook)
|
||||
list(INSERT opm-common_SOURCES 0 ${PROJECT_BINARY_DIR}/ParserInit.cpp)
|
||||
foreach (name A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
|
||||
list(INSERT opm-common_SOURCES 0 ${PROJECT_BINARY_DIR}/ParserKeywords/${name}.cpp)
|
||||
list(INSERT opm-common_HEADERS 0 ${PROJECT_BINARY_DIR}/include/opm/input/eclipse/Parser/ParserKeywords/${name}.hpp)
|
||||
endforeach()
|
||||
if (OPM_ENABLE_EMBEDDED_PYTHON)
|
||||
list(INSERT opm-common_SOURCES 0 ${PROJECT_BINARY_DIR}/python/cxx/builtin_pybind11.cpp)
|
||||
@@ -163,6 +164,14 @@ macro (install_hook)
|
||||
PATTERN *.hpp)
|
||||
endmacro (install_hook)
|
||||
|
||||
# Used to append entries from one list to another.
|
||||
# The output list is suitable for use in setup.py subtitution
|
||||
macro(append_quoted OUT IN)
|
||||
foreach(ENTRY ${${IN}})
|
||||
list(APPEND ${OUT} "'${ARGN}${ENTRY}'")
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
# If opm-common is configured to embed the python interpreter we must make sure
|
||||
# that all downstream modules link libpython transitively. Due to the required
|
||||
# integration with Python+cmake machinery provided by pybind11 this is done by
|
||||
@@ -184,6 +193,8 @@ if (OPM_ENABLE_PYTHON)
|
||||
endif()
|
||||
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||
set(Python3_LIBRARIES ${PYTHON_LIBRARIES})
|
||||
set(Python3_VERSION "${PYTHON_VERSION_STRING}")
|
||||
set(Python3_VERSION_MINOR ${PYTHON_VERSION_MINOR})
|
||||
else()
|
||||
# Be backwards compatible.
|
||||
if(PYTHON_EXECUTABLE AND NOT Python3_EXECUTABLE)
|
||||
@@ -210,10 +221,21 @@ if (OPM_ENABLE_PYTHON)
|
||||
"Either use \"apt-get install python3-setuptools\" (on Debian/Ubuntu) "
|
||||
"or \"pip install setuptools\"")
|
||||
endif()
|
||||
if(Python3_VERSION_MINOR LESS 3)
|
||||
# Python native namespace packages requires python >= 3.3
|
||||
message(SEND_ERROR "OPM requires python >= 3.3 but only version ${Python3_VERSION} was found")
|
||||
endif()
|
||||
|
||||
# Compatibility settings for PythonInterp and PythonLibs
|
||||
# used e.g. in FindCwrap, pybind11
|
||||
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
|
||||
# Directory to install common (for opm modules) python scripts
|
||||
include (GNUInstallDirs)
|
||||
set(OPM_PYTHON_COMMON_DIR "${CMAKE_INSTALL_DATAROOTDIR}/opm/python")
|
||||
set(OPM_PROJECT_EXTRA_CODE_INTREE "${OPM_PROJECT_EXTRA_CODE_INTREE}
|
||||
set(opm-common_PYTHON_COMMON_DIR ${PROJECT_SOURCE_DIR}/python)")
|
||||
set(OPM_PROJECT_EXTRA_CODE_INSTALLED "${OPM_PROJECT_EXTRA_CODE_INSTALLED}
|
||||
set(opm-common_PYTHON_COMMON_DIR ${CMAKE_INSTALL_PREFIX}/${OPM_PYTHON_COMMON_DIR})")
|
||||
endif()
|
||||
# We always need the PYTHON_INCLUDE_DIR. Unfortunately
|
||||
# When we build pypi packages CMake will fail to determine
|
||||
@@ -334,34 +356,7 @@ install(FILES cmake/OPM-CMake.md
|
||||
install(FILES etc/opm_bash_completion.sh.in DESTINATION share/opm/etc)
|
||||
|
||||
if (OPM_ENABLE_PYTHON)
|
||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "
|
||||
import site, sys
|
||||
try:
|
||||
sys.stdout.write(site.getsitepackages()[-1])
|
||||
except e:
|
||||
sys.stdout.write('')" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES_PATH)
|
||||
# -------------------------------------------------------------------------
|
||||
# 1: Wrap C++ functionality in Python
|
||||
if (PYTHON_SITE_PACKAGES_PATH MATCHES ".*/dist-packages/?" AND
|
||||
CMAKE_INSTALL_PREFIX MATCHES "^/usr.*")
|
||||
# dist-packages is only used if we install below /usr and python's site packages
|
||||
# path matches dist-packages
|
||||
set(PYTHON_PACKAGE_PATH "dist-packages")
|
||||
else()
|
||||
set(PYTHON_PACKAGE_PATH "site-packages")
|
||||
endif()
|
||||
if(PYTHON_VERSION_MAJOR)
|
||||
set(PY_MAJOR ${PYTHON_VERSION_MAJOR})
|
||||
else()
|
||||
set(PY_MAJOR ${Python3_VERSION_MAJOR})
|
||||
endif()
|
||||
if(PYTHON_VERSION_MINOR)
|
||||
set(PY_MINOR ${PYTHON_VERSION_MINOR})
|
||||
else()
|
||||
set(PY_MINOR ${Python3_VERSION_MINOR})
|
||||
endif()
|
||||
set(PYTHON_INSTALL_PREFIX "lib/python${PY_MAJOR}.${PY_MINOR}/${PYTHON_PACKAGE_PATH}" CACHE STRING "Subdirectory to install Python modules in")
|
||||
|
||||
include(PyInstallPrefix)
|
||||
make_directory(${PROJECT_BINARY_DIR}/python)
|
||||
get_target_property(_opmcommon_include_dirs opmcommon INCLUDE_DIRECTORIES)
|
||||
list(APPEND _opmcommon_include_dirs ${_ecl_include_dirs})
|
||||
@@ -403,34 +398,38 @@ except e:
|
||||
endif()
|
||||
|
||||
set(opm-common_PYTHON_PACKAGE_VERSION ${OPM_PYTHON_PACKAGE_VERSION_TAG})
|
||||
set(SETUP_PY_FLAGS "'-std=c++17'")
|
||||
|
||||
# Generate versioned setup.py
|
||||
if (pybind11_INCLUDE_DIRS)
|
||||
string(REGEX REPLACE ";" "', '" _tmp "${pybind11_INCLUDE_DIRS}")
|
||||
set(SETUP_PY_PYBIND_INCLUDE_DIR "'${_tmp}'")
|
||||
append_quoted(SETUP_PY_INCLUDE_DIRS pybind11_INCLUDE_DIRS)
|
||||
endif()
|
||||
|
||||
if (TARGET fmt::fmt)
|
||||
get_target_property(SETUP_PY_FMT_LIBS fmt::fmt LOCATION)
|
||||
get_target_property(FMT_FLAGS fmt::fmt INTERFACE_COMPILE_DEFINITIONS)
|
||||
foreach(flag ${FMT_FLAGS})
|
||||
set(SETUP_PY_FMT_FLAGS "${SETUP_PY_FMT_FLAGS} '-D${flag}',")
|
||||
endforeach()
|
||||
list(APPEND opm-common_PYTHON_LINKAGE "'${SETUP_PY_FMT_LIBS}'")
|
||||
append_quoted(SETUP_PY_FLAGS FMT_FLAGS "-D")
|
||||
append_quoted(opm-common_PYTHON_LINKAGE SETUP_PY_FMT_LIBS)
|
||||
else()
|
||||
set(SETUP_PY_FMT_FLAGS "'-DFMT_HEADER_ONLY'")
|
||||
list(APPEND SETUP_PY_FLAGS "'-DFMT_HEADER_ONLY'")
|
||||
endif()
|
||||
|
||||
if(cjson_FOUND)
|
||||
list(APPEND opm-common_PYTHON_LINKAGE "'${cjson_LIBRARIES}'")
|
||||
append_quoted(opm-common_PYTHON_LINKAGE cjson_LIBRARIES)
|
||||
append_quoted(SETUP_PY_INCLUDE_DIRS cjson_INCLUDE_DIRS)
|
||||
endif()
|
||||
|
||||
# opm-common_PYTHON_LINKAGE is used verbatim in a listin python.
|
||||
# Hence items need to be comma separated.
|
||||
if (opm-common_PYTHON_LINKAGE)
|
||||
string(REPLACE ";" "," SETUP_PY_LINKAGE "${opm-common_PYTHON_LINKAGE}")
|
||||
if(OpenMP_FOUND)
|
||||
append_quoted(opm-common_PYTHON_LINKAGE OpenMP_CXX_LIBRARIES)
|
||||
append_quoted(SETUP_PY_FLAGS OpenMP_CXX_FLAGS)
|
||||
append_quoted(SETUP_PY_INCLUDE_DIRS OpenMP_CXX_INCLUDE_DIRS)
|
||||
endif()
|
||||
|
||||
# Items need to be comma separated for setup.py generation
|
||||
string(REPLACE ";" "," SETUP_PY_LINKAGE "${opm-common_PYTHON_LINKAGE}")
|
||||
string(REPLACE ";" "," SETUP_PY_FLAGS "${SETUP_PY_FLAGS}")
|
||||
string(REPLACE ";" "," SETUP_PY_INCLUDE_DIRS "${SETUP_PY_INCLUDE_DIRS}")
|
||||
|
||||
configure_file (${PROJECT_SOURCE_DIR}/python/setup.py.in ${PROJECT_BINARY_DIR}/python/setup.py)
|
||||
file(COPY ${PROJECT_SOURCE_DIR}/python/README.md DESTINATION ${PROJECT_BINARY_DIR}/python)
|
||||
execute_process(COMMAND ${Python3_EXECUTABLE} target_name.py
|
||||
@@ -468,6 +467,9 @@ except e:
|
||||
# setup-install.sh - and completely bypass cmake in the installation phase.
|
||||
if (OPM_INSTALL_PYTHON)
|
||||
install( CODE "execute_process(COMMAND ${Python3_EXECUTABLE} ${PROJECT_BINARY_DIR}/python/install.py ${PROJECT_BINARY_DIR}/python/opm ${DEST_PREFIX}${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_PREFIX} 1)")
|
||||
## Need to install this Python script such that it can be used by opm-simulators when building against an installed
|
||||
## opm-common
|
||||
install( PROGRAMS "python/install.py" DESTINATION "${OPM_PYTHON_COMMON_DIR}" )
|
||||
endif()
|
||||
|
||||
# Observe that if the opmcommon library has been built as a shared library the
|
||||
|
||||
@@ -180,6 +180,7 @@ if(ENABLE_ECL_INPUT)
|
||||
src/opm/input/eclipse/EclipseState/Tables/Aqudims.cpp
|
||||
src/opm/input/eclipse/EclipseState/Tables/ColumnSchema.cpp
|
||||
src/opm/input/eclipse/EclipseState/Tables/DenT.cpp
|
||||
src/opm/input/eclipse/EclipseState/Tables/JouleThomson.cpp
|
||||
src/opm/input/eclipse/EclipseState/Tables/Eqldims.cpp
|
||||
src/opm/input/eclipse/EclipseState/Tables/JFunc.cpp
|
||||
src/opm/input/eclipse/EclipseState/Tables/PvtxTable.cpp
|
||||
@@ -301,6 +302,7 @@ if(ENABLE_ECL_OUTPUT)
|
||||
src/opm/io/eclipse/rst/connection.cpp
|
||||
src/opm/io/eclipse/rst/group.cpp
|
||||
src/opm/io/eclipse/rst/header.cpp
|
||||
src/opm/io/eclipse/rst/netbalan.cpp
|
||||
src/opm/io/eclipse/rst/network.cpp
|
||||
src/opm/io/eclipse/rst/udq.cpp
|
||||
src/opm/io/eclipse/rst/segment.cpp
|
||||
@@ -363,6 +365,7 @@ list (APPEND TEST_SOURCE_FILES
|
||||
if(ENABLE_ECL_INPUT)
|
||||
list(APPEND TEST_SOURCE_FILES
|
||||
tests/rst_test.cpp
|
||||
tests/test_CopyablePtr.cpp
|
||||
tests/test_ERsm.cpp
|
||||
tests/test_GuideRate.cpp
|
||||
tests/test_RestartFileView.cpp
|
||||
@@ -373,6 +376,7 @@ if(ENABLE_ECL_INPUT)
|
||||
tests/test_ESmry.cpp
|
||||
tests/test_EInit.cpp
|
||||
tests/test_ExtESmry.cpp
|
||||
tests/test_Serialization.cpp
|
||||
tests/parser/ACTIONX.cpp
|
||||
tests/parser/ADDREGTests.cpp
|
||||
tests/parser/AquiferTests.cpp
|
||||
@@ -473,8 +477,8 @@ if(ENABLE_ECL_OUTPUT)
|
||||
tests/test_Restart.cpp
|
||||
tests/test_RFT.cpp
|
||||
tests/test_rst.cpp
|
||||
tests/test_rst_netbalan.cpp
|
||||
tests/test_Solution.cpp
|
||||
tests/test_Serializer.cpp
|
||||
tests/test_Inplace.cpp
|
||||
tests/test_Summary.cpp
|
||||
tests/test_Summary_Group.cpp
|
||||
@@ -630,10 +634,10 @@ list( APPEND PUBLIC_HEADER_FILES
|
||||
opm/common/OpmLog/OpmLog.hpp
|
||||
opm/common/OpmLog/StreamLog.hpp
|
||||
opm/common/OpmLog/TimerLog.hpp
|
||||
opm/common/utility/Serializer.hpp
|
||||
opm/common/utility/ActiveGridCells.hpp
|
||||
opm/common/utility/FileSystem.hpp
|
||||
opm/common/utility/OpmInputError.hpp
|
||||
opm/common/utility/Serializer.hpp
|
||||
opm/common/utility/numeric/cmp.hpp
|
||||
opm/common/utility/platform_dependent/disable_warnings.h
|
||||
opm/common/utility/platform_dependent/reenable_warnings.h
|
||||
@@ -694,6 +698,7 @@ if(ENABLE_ECL_INPUT)
|
||||
opm/input/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.hpp
|
||||
opm/input/eclipse/EclipseState/Grid/Fault.hpp
|
||||
opm/input/eclipse/EclipseState/Grid/Box.hpp
|
||||
opm/input/eclipse/EclipseState/Grid/FieldProps.hpp
|
||||
opm/input/eclipse/EclipseState/Grid/FieldPropsManager.hpp
|
||||
opm/input/eclipse/EclipseState/Grid/FaultFace.hpp
|
||||
opm/input/eclipse/EclipseState/Grid/NNC.hpp
|
||||
@@ -706,6 +711,7 @@ if(ENABLE_ECL_INPUT)
|
||||
opm/input/eclipse/EclipseState/TracerConfig.hpp
|
||||
opm/input/eclipse/EclipseState/MICPpara.hpp
|
||||
opm/input/eclipse/EclipseState/Tables/DenT.hpp
|
||||
opm/input/eclipse/EclipseState/Tables/JouleThomson.hpp
|
||||
opm/input/eclipse/EclipseState/Tables/SimpleTable.hpp
|
||||
opm/input/eclipse/EclipseState/Tables/StandardCond.hpp
|
||||
opm/input/eclipse/EclipseState/Tables/PolyInjTable.hpp
|
||||
@@ -755,6 +761,7 @@ if(ENABLE_ECL_INPUT)
|
||||
opm/input/eclipse/EclipseState/Tables/WatvisctTable.hpp
|
||||
opm/input/eclipse/EclipseState/Tables/TableEnums.hpp
|
||||
opm/input/eclipse/EclipseState/Tables/RvvdTable.hpp
|
||||
opm/input/eclipse/EclipseState/Tables/RvwvdTable.hpp
|
||||
opm/input/eclipse/EclipseState/Tables/TableContainer.hpp
|
||||
opm/input/eclipse/EclipseState/Tables/AqutabTable.hpp
|
||||
opm/input/eclipse/EclipseState/Tables/PlyadsTable.hpp
|
||||
@@ -833,10 +840,8 @@ if(ENABLE_ECL_INPUT)
|
||||
opm/input/eclipse/Schedule/Well/WellEconProductionLimits.hpp
|
||||
opm/input/eclipse/Schedule/Well/WellFoamProperties.hpp
|
||||
opm/input/eclipse/Schedule/Well/WellBrineProperties.hpp
|
||||
opm/input/eclipse/Schedule/Well/WellInjectionProperties.hpp
|
||||
opm/input/eclipse/Schedule/Well/WellMICPProperties.hpp
|
||||
opm/input/eclipse/Schedule/Well/WellPolymerProperties.hpp
|
||||
opm/input/eclipse/Schedule/Well/WellProductionProperties.hpp
|
||||
opm/input/eclipse/Schedule/Well/WellTracerProperties.hpp
|
||||
opm/input/eclipse/Schedule/Well/WVFPEXP.hpp
|
||||
opm/input/eclipse/Schedule/Well/WellTestConfig.hpp
|
||||
@@ -931,6 +936,7 @@ if(ENABLE_ECL_OUTPUT)
|
||||
opm/io/eclipse/rst/connection.hpp
|
||||
opm/io/eclipse/rst/group.hpp
|
||||
opm/io/eclipse/rst/header.hpp
|
||||
opm/io/eclipse/rst/netbalan.hpp
|
||||
opm/io/eclipse/rst/network.hpp
|
||||
opm/io/eclipse/rst/segment.hpp
|
||||
opm/io/eclipse/rst/state.hpp
|
||||
@@ -985,6 +991,7 @@ if(ENABLE_ECL_OUTPUT)
|
||||
opm/output/eclipse/WriteRPT.hpp
|
||||
opm/output/eclipse/WriteRestartHelpers.hpp
|
||||
opm/output/OutputWriter.hpp
|
||||
opm/utility/CopyablePtr.hpp
|
||||
opm/utility/EModel.hpp
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -59,16 +59,6 @@ foreach (test BoxTest
|
||||
list(APPEND EXTRA_TESTS ${test})
|
||||
endforeach ()
|
||||
|
||||
opm_add_test( rst_spe1
|
||||
SOURCES tests/rst_test.cpp
|
||||
LIBRARIES ${TEST_LIBS}
|
||||
TEST_ARGS tests/SPE1CASE2.DATA tests/SPE1CASE2_RESTART.DATA )
|
||||
|
||||
opm_add_test( rst_msw
|
||||
SOURCES tests/rst_test.cpp
|
||||
LIBRARIES ${TEST_LIBS}
|
||||
TEST_ARGS tests/MSW.DATA tests/MSW_RESTART.DATA )
|
||||
|
||||
add_test( NAME rst_deck_test
|
||||
COMMAND ${PROJECT_SOURCE_DIR}/tests/rst_test_driver.sh ${PROJECT_BINARY_DIR}/bin/rst_deck ${PROJECT_BINARY_DIR}/bin/opmhash
|
||||
${PROJECT_SOURCE_DIR}/tests/SPE1CASE2_INCLUDE.DATA)
|
||||
@@ -104,8 +94,6 @@ if(HAVE_OPM_TESTS)
|
||||
${OPM_TESTS_ROOT}/spe9/SPE9_CP_GROUP.DATA
|
||||
${OPM_TESTS_ROOT}/spe9/SPE9_CP_SHORT.DATA
|
||||
${OPM_TESTS_ROOT}/spe9/SPE9.DATA
|
||||
${OPM_TESTS_ROOT}/spe10model1/SPE10_MODEL1.DATA
|
||||
${OPM_TESTS_ROOT}/spe10model2/SPE10_MODEL2.DATA
|
||||
${OPM_TESTS_ROOT}/msw_2d_h/2D_H__.DATA
|
||||
${OPM_TESTS_ROOT}/model2/0_BASE_MODEL2.DATA
|
||||
${OPM_TESTS_ROOT}/model2/1_MULTREGT_MODEL2.DATA
|
||||
|
||||
@@ -11,6 +11,7 @@ set(genkw_SOURCES src/opm/json/JsonObject.cpp
|
||||
src/opm/input/eclipse/Deck/DeckOutput.cpp
|
||||
src/opm/input/eclipse/Generator/KeywordGenerator.cpp
|
||||
src/opm/input/eclipse/Generator/KeywordLoader.cpp
|
||||
src/opm/input/eclipse/Schedule/UDQ/UDQEnums.cpp
|
||||
src/opm/input/eclipse/Parser/ErrorGuard.cpp
|
||||
src/opm/input/eclipse/Parser/ParseContext.cpp
|
||||
src/opm/input/eclipse/Parser/ParserEnums.cpp
|
||||
@@ -51,67 +52,20 @@ set( genkw_argv keyword_list.argv
|
||||
opm/input/eclipse/Parser/ParserKeywords
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/TestKeywords.cpp)
|
||||
|
||||
set( _tmp_output
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/A.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/B.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/C.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/D.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/E.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/F.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/G.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/H.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/I.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/J.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/K.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/L.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/M.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/N.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/O.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/P.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/Q.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/R.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/S.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/T.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/U.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/V.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/W.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/X.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/Y.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/Z.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserInit.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/TestKeywords.cpp)
|
||||
foreach (name A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
|
||||
list(APPEND _tmp_output ${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/${name}.cpp
|
||||
${PROJECT_BINARY_DIR}/tmp_gen/include/opm/input/eclipse/Parser/ParserKeywords/${name}.hpp)
|
||||
list(APPEND _target_output ${PROJECT_BINARY_DIR}/ParserKeywords/${name}.cpp
|
||||
${PROJECT_BINARY_DIR}/include/opm/input/eclipse/Parser/ParserKeywords/${name}.hpp)
|
||||
endforeach()
|
||||
|
||||
foreach(name TestKeywords.cpp ParserInit.cpp)
|
||||
list(APPEND _target_output ${PROJECT_BINARY_DIR}/${name})
|
||||
list(APPEND _tmp_output ${PROJECT_BINARY_DIR}/tmp_gen/${name})
|
||||
endforeach()
|
||||
|
||||
set( _target_output
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/A.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/B.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/C.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/D.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/E.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/F.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/G.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/H.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/I.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/J.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/K.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/L.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/M.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/N.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/O.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/P.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/Q.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/R.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/S.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/T.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/U.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/V.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/W.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/X.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/Y.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserKeywords/Z.cpp
|
||||
${PROJECT_BINARY_DIR}/TestKeywords.cpp
|
||||
${PROJECT_BINARY_DIR}/ParserInit.cpp)
|
||||
|
||||
list(APPEND _target_output ${PROJECT_BINARY_DIR}/include/opm/input/eclipse/Parser/ParserKeywords/Builtin.hpp)
|
||||
list(APPEND _tmp_output ${PROJECT_BINARY_DIR}/tmp_gen/include/opm/input/eclipse/Parser/ParserKeywords/Builtin.hpp)
|
||||
|
||||
if (OPM_ENABLE_PYTHON)
|
||||
list(APPEND genkw_argv ${PROJECT_BINARY_DIR}/tmp_gen/builtin_pybind11.cpp)
|
||||
@@ -119,8 +73,6 @@ if (OPM_ENABLE_PYTHON)
|
||||
list(APPEND _target_output ${PROJECT_BINARY_DIR}/python/cxx/builtin_pybind11.cpp)
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
add_custom_command( OUTPUT
|
||||
${_tmp_output}
|
||||
COMMAND genkw ${genkw_argv}
|
||||
@@ -129,5 +81,5 @@ add_custom_command( OUTPUT
|
||||
# To avoid some rebuilds
|
||||
add_custom_command(OUTPUT
|
||||
${_target_output}
|
||||
DEPENDS ${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/A.cpp
|
||||
DEPENDS ${_tmp_output}
|
||||
COMMAND ${CMAKE_COMMAND} -DBASE_DIR=${PROJECT_BINARY_DIR} -P ${PROJECT_SOURCE_DIR}/CopyHeaders.cmake)
|
||||
|
||||
@@ -55,11 +55,13 @@ if (METIS_INCLUDE_DIRS OR METIS_LIBRARIES)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_library(METIS::METIS UNKNOWN IMPORTED)
|
||||
set_target_properties(METIS::METIS PROPERTIES
|
||||
IMPORTED_LOCATION ${METIS_LIBRARIES}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${METIS_INCLUDE_DIRS}
|
||||
INTERFACE_COMPILE_DEFINITIONS METIS_API_VERSION=${METIS_API_VERSION})
|
||||
if (NOT TARGET METIS::METIS)
|
||||
add_library(METIS::METIS UNKNOWN IMPORTED)
|
||||
set_target_properties(METIS::METIS PROPERTIES
|
||||
IMPORTED_LOCATION ${METIS_LIBRARIES}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${METIS_INCLUDE_DIRS}
|
||||
INTERFACE_COMPILE_DEFINITIONS METIS_API_VERSION=${METIS_API_VERSION})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# print a message to indicate status of this package
|
||||
|
||||
@@ -34,16 +34,18 @@ int main(void){
|
||||
if (QUADMATH_FOUND)
|
||||
set(QUADMATH_LIBRARIES "quadmath")
|
||||
set(HAVE_QUAD "${QUADMATH_FOUND}")
|
||||
add_library(QuadMath::QuadMath INTERFACE IMPORTED)
|
||||
set_target_properties(QuadMath::QuadMath PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES quadmath
|
||||
INTERFACE_COMPILE_DEFINITIONS _GLIBCXX_USE_FLOAT128
|
||||
INTERFACE_COMPILE_OPTIONS $<$<CXX_COMPILER_ID:GNU>:-fext-numeric-literals>)
|
||||
if (NOT TARGET QuadMath::QuadMath)
|
||||
add_library(QuadMath::QuadMath INTERFACE IMPORTED)
|
||||
set_target_properties(QuadMath::QuadMath PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES quadmath
|
||||
INTERFACE_COMPILE_DEFINITIONS _GLIBCXX_USE_FLOAT128
|
||||
INTERFACE_COMPILE_OPTIONS $<$<CXX_COMPILER_ID:GNU>:-fext-numeric-literals>)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (USE_QUADMATH AND NOT QUADMATH_FOUND)
|
||||
message(FATAL_ERROR "Quadruple precision math support was explicitly requested but is unavailable!")
|
||||
message(STATUS "Quadruple precision math support is unavailable! Skipping it.")
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
@@ -3,13 +3,10 @@
|
||||
# This module defines:
|
||||
# VALGRIND_INCLUDE_DIR, where to find valgrind/memcheck.h, etc.
|
||||
# VALGRIND_PROGRAM, the valgrind executable.
|
||||
# VALGRIND_FOUND, If false, do not try to use valgrind.
|
||||
# Valgrind_FOUND, If false, do not try to use valgrind.
|
||||
#
|
||||
# If you have valgrind installed in a non-standard place, you can define
|
||||
# VALGRIND_ROOT to tell cmake where it is.
|
||||
if (VALGRIND_FOUND)
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_path(VALGRIND_INCLUDE_DIR valgrind/memcheck.h
|
||||
/usr/include /usr/local/include ${VALGRIND_ROOT}/include)
|
||||
@@ -18,7 +15,7 @@ find_path(VALGRIND_INCLUDE_DIR valgrind/memcheck.h
|
||||
# path, but this does not hurt...
|
||||
find_program(VALGRIND_PROGRAM NAMES valgrind PATH ${VALGRIND_ROOT}/bin)
|
||||
|
||||
find_package_handle_standard_args(VALGRIND DEFAULT_MSG
|
||||
find_package_handle_standard_args(Valgrind DEFAULT_MSG
|
||||
VALGRIND_INCLUDE_DIR
|
||||
VALGRIND_PROGRAM)
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ find_package(PTScotch)
|
||||
#find_package(ParMETIS)
|
||||
|
||||
# search for files which implements this module
|
||||
find_path (ZOLTAN_INCLUDE_DIRS
|
||||
find_path (ZOLTAN_INCLUDE_DIR
|
||||
NAMES "zoltan.h"
|
||||
PATHS ${ZOLTAN_SEARCH_PATH}
|
||||
PATH_SUFFIXES include trilinos
|
||||
@@ -35,7 +35,7 @@ if (CMAKE_SIZEOF_VOID_P)
|
||||
math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
|
||||
endif (CMAKE_SIZEOF_VOID_P)
|
||||
|
||||
find_library(ZOLTAN_LIBRARIES
|
||||
find_library(ZOLTAN_LIBRARY
|
||||
NAMES zoltan trilinos_zoltan
|
||||
PATHS ${ZOLTAN_SEARCH_PATH}
|
||||
PATH_SUFFIXES "lib/.libs" "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||
@@ -50,15 +50,20 @@ include (FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(ZOLTAN
|
||||
DEFAULT_MSG
|
||||
ZOLTAN_LIBRARIES
|
||||
ZOLTAN_INCLUDE_DIRS
|
||||
ZOLTAN_LIBRARY
|
||||
ZOLTAN_INCLUDE_DIR
|
||||
MPI_FOUND
|
||||
)
|
||||
|
||||
if (ZOLTAN_FOUND)
|
||||
set(HAVE_ZOLTAN 1)
|
||||
set(ZOLTAN_LIBRARIES ${ZOLTAN_LIBRARIES} ${PARMETIS_LIBRARIES} ${PTSCOTCH_LIBRARIES})
|
||||
set(ZOLTAN_INCLUDE_DIRS ${ZOLTAN_INCLUDE_DIRS} ${PARMETIS_INCLUDE_DIRS}
|
||||
set(ZOLTAN_LIBRARIES ${ZOLTAN_LIBRARY} ${PARMETIS_LIBRARIES} ${PTSCOTCH_LIBRARIES})
|
||||
set(ZOLTAN_INCLUDE_DIRS ${ZOLTAN_INCLUDE_DIR} ${PARMETIS_INCLUDE_DIRS}
|
||||
${PTSCOTCH_INCLUDE_DIRS})
|
||||
# log result
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determing location of ZOLTAN succeeded:\n"
|
||||
" Include directory: ${ZOLTAN_INCLUDE_DIRS}\n"
|
||||
" Library directory: ${ZOLTAN_LIBRARIES}\n\n")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ find_opm_package (
|
||||
"dune-common REQUIRED;
|
||||
ParMETIS;
|
||||
SuperLU;
|
||||
SuiteSparse COMPONENTS umfpack
|
||||
SuiteSparse COMPONENTS umfpack REQUIRED
|
||||
"
|
||||
# header to search for
|
||||
"dune/istl/bcrsmatrix.hh"
|
||||
|
||||
@@ -38,7 +38,7 @@ macro (opm_compile opm)
|
||||
endif()
|
||||
set (${opm}_VERSION "${${opm}_VERSION_MAJOR}.${${opm}_VERSION_MINOR}")
|
||||
if (${opm}_SOURCES)
|
||||
add_library (${${opm}_TARGET} ${${opm}_LIBRARY_TYPE} ${${opm}_SOURCES})
|
||||
add_library (${${opm}_TARGET} ${${opm}_LIBRARY_TYPE} ${${opm}_SOURCES} ${${opm}_HEADERS})
|
||||
set_target_properties (${${opm}_TARGET} PROPERTIES
|
||||
SOVERSION ${${opm}_VERSION}
|
||||
VERSION ${${opm}_VERSION}
|
||||
|
||||
@@ -128,35 +128,41 @@ macro (find_and_append_package_to prefix name)
|
||||
# We even need to repeat the search for opm-common once as this is done
|
||||
# in the top most CMakeLists.txt without querying defines, setting dependencies
|
||||
# and the likes which is only done via opm_find_package
|
||||
if ( (NOT DEFINED ${name}_FOUND AND NOT DEFINED ${NAME}_FOUND )
|
||||
OR _search_components GREATER -1)
|
||||
string(REGEX MATCH "(opm)-.*" _is_opm ${name})
|
||||
if(NOT _is_opm)
|
||||
# When using Boost >= 1.70 and e.g. CMake 3.18 we need to make sure that
|
||||
# subsequent searches are using config mode too. Otherwise the library
|
||||
# list will be completely messed up. We use a set Boost_Dir to detect that
|
||||
# previous searches were done using config mode.
|
||||
if("${name}" STREQUAL "Boost" AND Boost_DIR)
|
||||
set(_CONFIG_MODE CONFIG)
|
||||
else()
|
||||
set(_CONFIG_MODE "")
|
||||
endif()
|
||||
find_package (${name} ${ARGN} ${_CONFIG_MODE})
|
||||
string(REGEX MATCH "(opm)-.*" _is_opm ${name})
|
||||
if(NOT _is_opm)
|
||||
# When using Boost >= 1.70 and e.g. CMake 3.18 we need to make sure that
|
||||
# subsequent searches are using config mode too. Otherwise the library
|
||||
# list will be completely messed up. We use a set Boost_Dir to detect that
|
||||
# previous searches were done using config mode.
|
||||
if("${name}" STREQUAL "Boost" AND Boost_DIR)
|
||||
set(_CONFIG_MODE CONFIG)
|
||||
else()
|
||||
if(${name}_DIR)
|
||||
find_package (${name} ${${prefix}_VERSION_MAJOR}.${${prefix}_VERSION_MINOR} ${ARGN} NO_MODULE PATHS ${${name}_DIR} NO_DEFAULT_PATH)
|
||||
else()
|
||||
find_package (${name} ${${prefix}_VERSION_MAJOR}.${${prefix}_VERSION_MINOR} ${ARGN} NO_MODULE)
|
||||
endif()
|
||||
include(FindPackageHandleStandardArgs)
|
||||
if(${name}_FOUND AND ${name}_LIBRARY STREQUAL "")
|
||||
find_package_handle_standard_args(${name}
|
||||
REQUIRED_VARS ${name}_INCLUDE_DIRS)
|
||||
else()
|
||||
find_package_handle_standard_args(${name}
|
||||
REQUIRED_VARS ${name}_LIBRARY)
|
||||
endif()
|
||||
endif ()
|
||||
set(_CONFIG_MODE "")
|
||||
endif()
|
||||
find_package (${name} ${ARGN} ${_CONFIG_MODE})
|
||||
else()
|
||||
if(${name}_DIR)
|
||||
find_package (${name} ${${prefix}_VERSION_MAJOR}.${${prefix}_VERSION_MINOR} ${ARGN} NO_MODULE PATHS ${${name}_DIR} NO_DEFAULT_PATH)
|
||||
else()
|
||||
find_package (${name} ${${prefix}_VERSION_MAJOR}.${${prefix}_VERSION_MINOR} ${ARGN} NO_MODULE)
|
||||
endif()
|
||||
include(FindPackageHandleStandardArgs)
|
||||
if( CMAKE_VERSION VERSION_GREATER_EQUAL "3.17")
|
||||
# For some reason we will e.g. call
|
||||
# find_package_handle_standard_args(opm-common)
|
||||
# in a find_package(opm-material) call and this will
|
||||
# usuallly print an annoying warnig. Prevent this at least
|
||||
# for cmake >=3.17
|
||||
# \todo Check why/whether these calls are even needed.
|
||||
set(_NAME_MISMATCHED "NAME_MISMATCHED")
|
||||
endif()
|
||||
if(${name}_FOUND AND ${name}_LIBRARY STREQUAL "")
|
||||
find_package_handle_standard_args(${name}
|
||||
REQUIRED_VARS ${name}_INCLUDE_DIRS ${_NAME_MISMATCHED})
|
||||
else()
|
||||
find_package_handle_standard_args(${name}
|
||||
REQUIRED_VARS ${name}_LIBRARY ${_NAME_MISMATCHED})
|
||||
endif()
|
||||
endif ()
|
||||
if (NOT DEFINED ${name}_FOUND)
|
||||
set (${name}_FOUND "${${NAME}_FOUND}")
|
||||
|
||||
@@ -130,7 +130,7 @@ endif ()
|
||||
|
||||
# parallel computing must be explicitly enabled
|
||||
# This needs to be in OpmInit as prereqs is called before OpmLibMain is included.
|
||||
option (USE_MPI "Use Message Passing Interface for parallel computing" OFF)
|
||||
option (USE_MPI "Use Message Passing Interface for parallel computing" ON)
|
||||
if (NOT USE_MPI)
|
||||
set (CMAKE_DISABLE_FIND_PACKAGE_MPI TRUE)
|
||||
endif ()
|
||||
@@ -144,7 +144,12 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
# quadmath must be explicitly enabled
|
||||
# This needs to be in OpmInit as prereqs is called before OpmLibMain is included.
|
||||
option (USE_QUADMATH "Use high precision floating point library (slow)" OFF)
|
||||
option (USE_QUADMATH "Search for high precision floating point library (normally not used)" ON)
|
||||
if (NOT USE_QUADMATH)
|
||||
set (CMAKE_DISABLE_FIND_PACKAGE_QuadMath TRUE)
|
||||
endif ()
|
||||
|
||||
option (USE_SUPERLU "Use SuperLU direct solvers for AMG (if umfpack is not found)" ON)
|
||||
if (NOT USE_SUPERLU)
|
||||
set (CMAKE_DISABLE_FIND_PACKAGE_SuperLU TRUE)
|
||||
endif ()
|
||||
|
||||
@@ -63,9 +63,6 @@ find_openmp (${project})
|
||||
include (UseThreads)
|
||||
find_threads (${project})
|
||||
|
||||
# SuperLU is optional
|
||||
option (USE_SUPERLU "Use SuperLU direct solvers" OFF)
|
||||
|
||||
# PETSc is optional
|
||||
option (USE_PETSC "Use PETSc iterative solvers" OFF)
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ macro (find_opm_package module deps header lib defs prog conf)
|
||||
# without config.h
|
||||
config_cmd_line (${module}_CMD_CONFIG ${module}_CONFIG_VARS)
|
||||
|
||||
if(prog)
|
||||
if(prog) # always evaluates to false, but makes tests with DUNE 2.6-2.7 work
|
||||
# check that we can compile a small test-program
|
||||
include (CMakePushCheckState)
|
||||
cmake_push_check_state ()
|
||||
@@ -138,13 +138,16 @@ macro (find_opm_package module deps header lib defs prog conf)
|
||||
list (APPEND CMAKE_REQUIRED_DEFINITIONS ${${module}_CMD_CONFIG})
|
||||
check_cxx_source_compiles ("${prog}" HAVE_${MODULE})
|
||||
cmake_pop_check_state ()
|
||||
else(prog)
|
||||
else()
|
||||
if(${module}_FOUND)
|
||||
# No test code provided, mark compilation as successful
|
||||
# if module was founf
|
||||
set(HAVE_${MODULE} 1)
|
||||
# if module was found
|
||||
# Has to be cached because of scope. Otherwise it is not accessible
|
||||
# where it is used.
|
||||
set(HAVE_${MODULE} 1 CACHE BOOL "${module} found")
|
||||
mark_as_advanced(HAVE_${MODULE})
|
||||
endif(${module}_FOUND)
|
||||
endif(prog)
|
||||
endif()
|
||||
|
||||
# write status message in the same manner as everyone else
|
||||
include (FindPackageHandleStandardArgs)
|
||||
|
||||
@@ -54,6 +54,12 @@ function (configure_cmake_file name variant version)
|
||||
foreach (suffix IN LISTS variable_suffices)
|
||||
set (opm-project_${suffix} "${${name}_${suffix}}")
|
||||
endforeach (suffix)
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
# No need to list shared libraries as the linker information is alread
|
||||
# in the shared lib
|
||||
string(REGEX REPLACE ";?[^;]*.so" "" opm-project_LIBRARIES "${opm-project_LIBRARIES}")
|
||||
endif()
|
||||
set (opm-project_NAME "${${name}_NAME}")
|
||||
set (opm-project_NAME_UC "${${name}_NAME}")
|
||||
string(TOUPPER "${opm-project_NAME}" opm-project_NAME_UC)
|
||||
|
||||
28
cmake/Modules/PyInstallPrefix.cmake
Normal file
28
cmake/Modules/PyInstallPrefix.cmake
Normal file
@@ -0,0 +1,28 @@
|
||||
# We make this a cmake module so it can be used from opm-simulators' CMakeLists.txt also
|
||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "
|
||||
import site, sys
|
||||
try:
|
||||
sys.stdout.write(site.getsitepackages()[-1])
|
||||
except e:
|
||||
sys.stdout.write('')" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES_PATH)
|
||||
# -------------------------------------------------------------------------
|
||||
# 1: Wrap C++ functionality in Python
|
||||
if (PYTHON_SITE_PACKAGES_PATH MATCHES ".*/dist-packages/?" AND
|
||||
CMAKE_INSTALL_PREFIX MATCHES "^/usr.*")
|
||||
# dist-packages is only used if we install below /usr and python's site packages
|
||||
# path matches dist-packages
|
||||
set(PYTHON_PACKAGE_PATH "dist-packages")
|
||||
else()
|
||||
set(PYTHON_PACKAGE_PATH "site-packages")
|
||||
endif()
|
||||
if(PYTHON_VERSION_MAJOR)
|
||||
set(PY_MAJOR ${PYTHON_VERSION_MAJOR})
|
||||
else()
|
||||
set(PY_MAJOR ${Python3_VERSION_MAJOR})
|
||||
endif()
|
||||
if(PYTHON_VERSION_MINOR)
|
||||
set(PY_MINOR ${PYTHON_VERSION_MINOR})
|
||||
else()
|
||||
set(PY_MINOR ${Python3_VERSION_MINOR})
|
||||
endif()
|
||||
set(PYTHON_INSTALL_PREFIX "lib/python${PY_MAJOR}.${PY_MINOR}/${PYTHON_PACKAGE_PATH}" CACHE STRING "Subdirectory to install Python modules in")
|
||||
27
cmake/Modules/UseDamaris.cmake
Normal file
27
cmake/Modules/UseDamaris.cmake
Normal file
@@ -0,0 +1,27 @@
|
||||
if(USE_DAMARIS_LIB AND MPI_FOUND)
|
||||
if (Damaris_FOUND)
|
||||
set(HAVE_DAMARIS 1)
|
||||
message(STATUS "The Damaris library was found: ${Damaris_VERSION} ${Damaris_DIR}")
|
||||
if (Damaris_HAS_HDF5)
|
||||
message(STATUS "The Damaris library has HDF5 support: ${HDF5_VERSION}")
|
||||
else()
|
||||
message(STATUS "The Damaris library does NOT have HDF5 support")
|
||||
endif()
|
||||
if (Damaris_HAS_VISIT)
|
||||
message(STATUS "The Damaris library has VisIt support: ${VisIt_VERSION}")
|
||||
else()
|
||||
message(STATUS "The Damaris library does NOT have VisIt support")
|
||||
endif()
|
||||
if (Damaris_HAS_CATALYST)
|
||||
message(STATUS "The Damaris library has Catalyst support: ${Catalyst_VERSION} ${Paraview_VERSION}")
|
||||
else()
|
||||
message(STATUS "The Damaris library does NOT have Catalyst support")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "The Damaris library was requested but NOT found")
|
||||
endif()
|
||||
else() # User did not request Damaris support
|
||||
unset(HAVE_DAMARIS)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(HAVE_DAMARIS)
|
||||
@@ -58,6 +58,7 @@ if(NOT @opm-project_NAME@_FOUND)
|
||||
string(REPLACE ${@opm-project_NAME@_PREFIX} ${DEST_PREFIX} @opm-project_NAME@_INCLUDE_DIRS "${@opm-project_NAME@_INCLUDE_DIRS}")
|
||||
string(REPLACE ${@opm-project_NAME@_PREFIX} ${DEST_PREFIX} @opm-project_NAME@_LIBRARY_DIRS "${@opm-project_NAME@_LIBRARY_DIRS}")
|
||||
string(REPLACE ${@opm-project_NAME@_PREFIX} ${DEST_PREFIX} @opm-project_NAME@_LIBRARY "${@opm-project_NAME@_LIBRARY}")
|
||||
string(REPLACE ${@opm-project_NAME@_PREFIX} ${DEST_PREFIX} @opm-project_NAME@_PYTHON_COMMON_DIR "${@opm-project_NAME@_PYTHON_COMMON_DIR}")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -107,7 +108,18 @@ if(NOT @opm-project_NAME@_FOUND)
|
||||
# The settings in this block do not mix well with the DEST_PREFIX
|
||||
# setting.
|
||||
if (NOT DEST_PREFIX)
|
||||
# This is required to include OpmPackage
|
||||
# if this file is not processed using the OPM CMake system but
|
||||
# simply by a call to find_package(module) then the CMAKE_MODULE_PATH
|
||||
# might not include the location of the OPM cmake module yet.
|
||||
# Hence we search for opm-common using config mode to set it up.
|
||||
# The check for opm-common_PREFIX is there to not do this in
|
||||
# opm-common-config.cmake
|
||||
if(NOT opm-common_PREFIX
|
||||
AND NOT opm-common_FOUND)
|
||||
# This needed to find the path to the CMake modules
|
||||
find_package(opm-common CONFIG)
|
||||
endif()
|
||||
# This is required to include OpmPackage /opm-common-prereq.cmake
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" @PREREQ_LOCATION@)
|
||||
|
||||
# extra code from variable OPM_PROJECT_EXTRA_CODE
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Userspesific CSS for doxygen */
|
||||
/* Userspecific CSS for doxygen */
|
||||
body, table, div, p, dl {
|
||||
font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
|
||||
font-size: 16px;
|
||||
|
||||
11
docs/man1/arraylist.1
Normal file
11
docs/man1/arraylist.1
Normal file
@@ -0,0 +1,11 @@
|
||||
.TH SUMMARY "1" "October 2022" "arraylist 2022.10" "User Commands"
|
||||
.SH NAME
|
||||
summary \- Printer for list of arrays in Eclipse summary files
|
||||
.SH DESCRIPTION
|
||||
List all arrays found in an EclFile specified on the command line.
|
||||
.PP
|
||||
.SH OPTIONS
|
||||
\fB\-h\fR Print help and exit.
|
||||
.TP
|
||||
\fB\-r\fR List array for a specific report time step number. Option only valid for a unified restart file.
|
||||
.PP
|
||||
@@ -1,5 +1,4 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8.
|
||||
.TH COMPAREECL "1" "April 2021" "compareECL 2020.04" "User Commands"
|
||||
.TH COMPAREECL "1" "October 2022" "compareECL 2022.10" "User Commands"
|
||||
.SH NAME
|
||||
compareECL \- Comparator for Eclipse files
|
||||
.SH DESCRIPTION
|
||||
@@ -11,55 +10,57 @@ The program takes four arguments:
|
||||
3. Absolute tolerance
|
||||
4. Relative tolerance (between 0 and 1)
|
||||
.PP
|
||||
.SH OPTIONS
|
||||
.HP
|
||||
In addition, the program takes these options (which must be given before the arguments):
|
||||
.PP
|
||||
\fB\-a\fR Run a full analysis of errors.
|
||||
.TP
|
||||
\fB\-h\fR Print help and exit.
|
||||
.TP
|
||||
\fB\-d\fR Use report steps only when comparing results from summary files.
|
||||
.TP
|
||||
\fB\-i\fR Execute integration test (regression test is default).
|
||||
.IP
|
||||
The integration test compares SGAS, SWAT and PRESSURE in unified restart files, and WOPR, WGPR, WWPR and WBHP (all wells) in summary file.
|
||||
.PP
|
||||
\fB\-k\fR Specify specific keyword to compare (capitalized), for examples \fB\-k\fR PRESSURE or \fB\-k\fR WOPR:A\-1H
|
||||
\fB\-l\fR Only do comparison for the last Report Step. This option is only valid for restart files.
|
||||
\fB\-n\fR Do not throw on errors.
|
||||
\fB\-p\fR Print keywords in both cases and exit.
|
||||
\fB\-r\fR compare a spesific report time step number in a restart file.
|
||||
\fB\-t\fR Specify ECLIPSE filetype to compare, (default behaviour is that all files are compared if found). Different possible arguments are:
|
||||
.TP
|
||||
\fB\-l\fR Only do comparison for the last Report Step. This option is only valid for restart files.
|
||||
.TP
|
||||
\fB\-n\fR Do not throw on errors.
|
||||
.TP
|
||||
\fB\-p\fR Print keywords in both cases and exit.
|
||||
.TP
|
||||
\fB\-r\fR compare a specific report time step number in a restart file.
|
||||
.TP
|
||||
\fB\-t\fR Specify ECLIPSE filetype to compare, (default behaviour is that all files are compared if found). Different possible arguments are:
|
||||
.IP
|
||||
\fB\-t\fR UNRST
|
||||
Compare two unified restart files (.UNRST). This the default value, so it is the same as not passing option \fB\-t\fR.
|
||||
.TP
|
||||
.IP
|
||||
\fB\-t\fR EGRID
|
||||
Compare two EGrid files (.EGRID).
|
||||
.TP
|
||||
.IP
|
||||
\fB\-t\fR INIT
|
||||
Compare two initial files (.INIT).
|
||||
.TP
|
||||
.IP
|
||||
\fB\-t\fR RFT
|
||||
Compare two RFT files (.RFT).
|
||||
.TP
|
||||
.IP
|
||||
\fB\-t\fR SMRY
|
||||
Compare two cases consistent of (unified) summary files.
|
||||
.IP
|
||||
\fB\-t\fR RSM
|
||||
Compare RSM file against a summary file.
|
||||
.PP
|
||||
\fB\-x\fR Allow extra keywords in case number 2. These additional keywords (not found in case number1) will be ignored in the comparison.
|
||||
.PP
|
||||
Example usage of the program:
|
||||
.SH Example usage of the program:
|
||||
.PP
|
||||
compareECL \fB\-k\fR PRESSURE <path to first casefile> <path to second casefile> 1e\-3 1e\-5
|
||||
compareECL \fB\-t\fR INIT \fB\-k\fR PORO <path to first casefile> <path to second casefile> 1e\-3 1e\-5
|
||||
compareECL \fB\-i\fR <path to first casefile> <path to second casefile> 0.01 1e\-6
|
||||
.PP
|
||||
Exceptions are thrown (and hence program exits) when deviations are larger than the specified tolerances, or when the number of cells does not match \fB\-\-\fR either in the grid file or for a specific keyword. Information about the keyword, keyword occurrence (zero based) and cell coordinate is printed when an exception is thrown. For more information about how the cases are compared, see the documentation of the EclFilesComparator class.
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B compareECL
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B compareECL
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info compareECL
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8.
|
||||
.TH CONVERTECL "1" "April 2021" "convertECL 2020.04" "User Commands"
|
||||
.TH CONVERTECL "1" "October 2022" "convertECL 2022.10" "User Commands"
|
||||
.SH NAME
|
||||
convertECL \- Converter for Eclipse files (binary <-> formatted format)
|
||||
.SH DESCRIPTION
|
||||
@@ -7,18 +6,13 @@ convertECL needs one argument which is the input file to be converted. If this i
|
||||
.PP
|
||||
In addition, the program takes these options (which must be given before the arguments):
|
||||
.PP
|
||||
.SH OPTIONS
|
||||
.HP
|
||||
\fB\-h\fR Print help and exit.
|
||||
.TP
|
||||
\fB\-l\fR list report step numbers in the selected restart file.
|
||||
\fB\-r\fR extract and convert a spesific report time step number from a unified restart file.
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B convertECL
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B convertECL
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info convertECL
|
||||
.TP
|
||||
\fB\-i\fR Enforce IX standard on output file.
|
||||
.TP
|
||||
\fB\-r\fR extract and convert a specific report time step number from a unified restart file.
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8.
|
||||
.TH OPMHASH "1" "April 2021" "opmhash 2020.04" "User Commands"
|
||||
.TH OPMHASH "1" "October 2022" "opmhash 2022.10" "User Commands"
|
||||
.SH NAME
|
||||
opmhash \- Hasher for summary keywords in Eclipse files
|
||||
.SH DESCRIPTION
|
||||
@@ -40,15 +39,11 @@ depends on the keyword order.
|
||||
\fB\-l\fR : Add filename and linenumber information to each keyword.
|
||||
.HP
|
||||
\fB\-s\fR : Short form \- only print the hash of the complete deck.
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B opmhash
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B opmhash
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info opmhash
|
||||
.HP
|
||||
\fB\-S\fR : Silent form \- will not print any deck output.
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
It is possible to add multiple deck arguments, they are then scanned repeatedly,
|
||||
and the decks are compared. In the case of multiple deck arguments the exit
|
||||
status of the program will be zero if all are equal and nonzero in case of
|
||||
differences.
|
||||
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8.
|
||||
.TH OPMPACK "1" "April 2021" "opmpack 2020.04" "User Commands"
|
||||
.TH OPMPACK "1" "October 2022" "opmpack 2022.10" "User Commands"
|
||||
.SH NAME
|
||||
opmpack \- Validator and printer of deck in Eclipse files without comments
|
||||
.SH DESCRIPTION
|
||||
opmpack: invalid option \fB\-\-\fR 'h'
|
||||
.PP
|
||||
The opmpack program will load a deck, resolve all include
|
||||
files and then print it out again on stdout. All comments
|
||||
will be stripped and the value types will be validated.
|
||||
@@ -28,15 +25,4 @@ opmpack \fB\-o\fR NEW_CASE.DATA path/to/MY_CASE.DATA
|
||||
As an alternative to the \fB\-o\fR option you can use \fB\-c\fR; that is equivalent to \fB\-o\fR \-
|
||||
but restart and import files referred to in the deck are also copied. The \fB\-o\fR and
|
||||
\fB\-c\fR options are mutually exclusive.
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B opmpack
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B opmpack
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info opmpack
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
|
||||
|
||||
@@ -1,7 +1,88 @@
|
||||
.TH RST_DECK
|
||||
.TH RST_DECK: "1" "October 2022" "rst_deck 2022.10" "User Commands"
|
||||
.SH NAME
|
||||
rst_deck \- Create a version of deck ready for restart
|
||||
|
||||
|
||||
|
||||
|
||||
rst_deck \- Convert simulation deck to a deck ready for restart
|
||||
.SH DESCRIPTION
|
||||
The rst_deck program will load a simulation deck and parameters for a restart
|
||||
and reformat the deck to become a restart deck. Before the updated deck is
|
||||
output the program will update the SOLUTION and SCHEDULE sections. All keywords
|
||||
from the SOLUTION section will be cleared out(1) and a RESTART keyword will be
|
||||
inserted. In the SCHEDULE section the program can either remove all keywords up
|
||||
until the restart date, or alternatively insert SKIPREST immediately following
|
||||
the SCHEDULE keyword.
|
||||
.PP
|
||||
When creating the updated restart deck the program can either link to unmodified
|
||||
include files with INCLUDE statements, create a copy of deck structure in an
|
||||
alternative location or create one large file with all keywords in the same
|
||||
file. Apart from the alterations to support restart the output deck will be
|
||||
equivalent to the input deck, but formatting is not retained and comments have
|
||||
been stripped away.
|
||||
.PP
|
||||
Arguments:
|
||||
.PP
|
||||
1. The data file we are starting with.
|
||||
.PP
|
||||
2. The restart source; this can either be a basename with an optional path
|
||||
.IP
|
||||
prefix and a :N to restart from step N; alternatively you can point to an
|
||||
existing restart file. If you point to an existing restart file the input
|
||||
will be validated in several ways:
|
||||
.IP
|
||||
a) Unified/multiple files will be checked against the UNIFIN setting of
|
||||
.IP
|
||||
the deck.
|
||||
.IP
|
||||
b) Formatted/unformatted will be checked against the FMTIn setting of the
|
||||
.IP
|
||||
deck.
|
||||
.IP
|
||||
c) If a single file like \fI\,/path/to/case/HISTORY.X0067\/\fP is given as argument the
|
||||
.IP
|
||||
:N notation to denote report step should not be used.
|
||||
.IP
|
||||
If the restart argument is given as the path to an existing file the content
|
||||
of the RESTART keyword will be updated to contain the correct path from the
|
||||
location of the restart deck to the location of the restart file. This path
|
||||
awareness will be fooled if the restart deck is redirected from stdout to a
|
||||
path different from cwd. If the restart argument is given as an absolute
|
||||
filename the RESTART keyword will have an absolute path, if the restart
|
||||
argument is a relative path the RESTART keyword will get a relative path \-
|
||||
although an absolute path will be used if the restart file and the output
|
||||
deck have different roots. If the restart argument is given as a string not
|
||||
pointing to an existing file it will be inserted verbatim in the restart
|
||||
deck.
|
||||
.IP
|
||||
A restart step value of 0 is interpreted as a dry run \- a deck which has not
|
||||
been set up for restart will be written out.
|
||||
.PP
|
||||
3. Basename of the restart deck we create, can optionally contain a path prefix;
|
||||
.IP
|
||||
the path will be created if it does not already exist. This argument is
|
||||
optional, if it is not provided the program will dump a restart deck on
|
||||
stdout. If the argument corresponds to an existing directory the restart case
|
||||
will get the same name as the base case.
|
||||
.SH OPTIONS
|
||||
\fB\-s\fR: Manipulate the SCHEDULE section by inserting a SKIPREST keyword immediately
|
||||
.IP
|
||||
following the SCHEDULE keyword. If the \fB\-s\fR option is not used the SCHEDULE
|
||||
section will be modified by removing all keywords until we reach the restart
|
||||
date.
|
||||
.PP
|
||||
\fB\-m\fR: [share|inline|copy] The restart deck can reuse the unmodified include files
|
||||
.IP
|
||||
from the base case, this is mode 'share' and is the default. With mode
|
||||
\&'inline' the restart deck will be one long file and with mode 'copy' the
|
||||
file structure of the base case will be retained. The default if no \fB\-m\fR
|
||||
option is given is the 'share' mode.
|
||||
.IP
|
||||
In the case of 'share' and 'copy' the correct path to include files will be
|
||||
negotiated based on the path given to the output case in the third argument.
|
||||
If the restart deck is passed to stdout the include files will be resolved
|
||||
based on output in cwd.
|
||||
.PP
|
||||
Example:
|
||||
.IP
|
||||
rst_deck \fI\,/path/to/history/HISTORY.DATA\/\fP rst/HISTORY:30 \fI\,/path/to/rst/RESTART\/\fP \fB\-s\fR
|
||||
.PP
|
||||
1: The program has a compiled list of keywords which will be retained in the
|
||||
.IP
|
||||
SOLUTION section. The current value of that list is: RPTRST
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8.
|
||||
.TH SUMMARY "1" "April 2021" "summary 2020.04" "User Commands"
|
||||
.TH SUMMARY "1" "October 2022" "summary 2022.10" "User Commands"
|
||||
.SH NAME
|
||||
summary \- Printer for summary keys in Eclipse summary files
|
||||
.SH DESCRIPTION
|
||||
@@ -7,18 +6,10 @@ summary needs a minimum of two arguments. First is smspec filename and then list
|
||||
.PP
|
||||
In addition, the program takes these options (which must be given before the arguments):
|
||||
.PP
|
||||
.SH OPTIONS
|
||||
\fB\-h\fR Print help and exit.
|
||||
.TP
|
||||
\fB\-l\fR list all summary vectors.
|
||||
.TP
|
||||
\fB\-r\fR extract data only for report steps.
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B summary
|
||||
is maintained as a Texinfo manual. If the
|
||||
.B info
|
||||
and
|
||||
.B summary
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info summary
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
Module: opm-common
|
||||
Description: Open Porous Media Initiative shared infrastructure
|
||||
Version: 2022.04-pre
|
||||
Label: 2022.04-pre
|
||||
Version: 2022.10
|
||||
Label: 2022.10
|
||||
Maintainer: opm@opm-project.org
|
||||
MaintainerName: OPM community
|
||||
Url: http://opm-project.org
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
#include <opm/output/eclipse/EclipseIO.hpp>
|
||||
|
||||
#include <opm/input/eclipse/Deck/Deck.hpp>
|
||||
|
||||
#include <opm/input/eclipse/Parser/Parser.hpp>
|
||||
#include <opm/input/eclipse/Parser/ParseContext.hpp>
|
||||
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
|
||||
|
||||
@@ -28,10 +28,6 @@
|
||||
#include <opm/input/eclipse/Parser/ParseContext.hpp>
|
||||
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
|
||||
#include <opm/input/eclipse/Deck/Deck.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
|
||||
#include <opm/input/eclipse/Schedule/Schedule.hpp>
|
||||
|
||||
|
||||
struct keyword {
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
#include <iostream>
|
||||
#include <getopt.h>
|
||||
|
||||
#include <opm/input/eclipse/Deck/Deck.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/InitConfig/InitConfig.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/IOConfig/IOConfig.hpp>
|
||||
#include <opm/input/eclipse/Parser/ParserKeywords/I.hpp>
|
||||
#include <opm/input/eclipse/Parser/ParserKeywords/P.hpp>
|
||||
#include <opm/input/eclipse/Parser/ParserKeywords/G.hpp>
|
||||
@@ -29,7 +32,6 @@
|
||||
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
|
||||
#include <opm/input/eclipse/Parser/ParseContext.hpp>
|
||||
#include <opm/input/eclipse/Parser/InputErrorAction.hpp>
|
||||
#include <opm/input/eclipse/Deck/Deck.hpp>
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
#include <sstream>
|
||||
|
||||
@@ -28,7 +29,6 @@
|
||||
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
|
||||
#include <opm/input/eclipse/Deck/Deck.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/input/eclipse/Schedule/Schedule.hpp>
|
||||
#include <opm/input/eclipse/Python/Python.hpp>
|
||||
|
||||
|
||||
@@ -16,7 +16,12 @@ function parseRevisions {
|
||||
do
|
||||
if grep -qi "$upstream=" <<< $ghprbCommentBody
|
||||
then
|
||||
upstreamRev[$upstream]=pull/`echo $ghprbCommentBody | sed -r "s/.*${upstream,,}=([0-9]+).*/\1/g"`/merge
|
||||
if test -n "$absolute_revisions"
|
||||
then
|
||||
upstreamRev[$upstream]=`echo $ghprbCommentBody | sed -r "s/.*${upstream,,}=([^ ]+).*/\1/g"`
|
||||
else
|
||||
upstreamRev[$upstream]=pull/`echo $ghprbCommentBody | sed -r "s/.*${upstream,,}=([0-9]+).*/\1/g"`/merge
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if grep -q "with downstreams" <<< $ghprbCommentBody
|
||||
@@ -25,8 +30,13 @@ function parseRevisions {
|
||||
do
|
||||
if grep -qi "$downstream=" <<< $ghprbCommentBody
|
||||
then
|
||||
downstreamRev[$downstream]=pull/`echo $ghprbCommentBody | sed -r "s/.*${downstream,,}=([0-9]+).*/\1/g"`/merge
|
||||
fi
|
||||
if test -n "$absolute_revisions"
|
||||
then
|
||||
downstreamRev[$downstream]=`echo $ghprbCommentBody | sed -r "s/.*${downstream,,}=([^ ]+).*/\1/g"`
|
||||
else
|
||||
downstreamRev[$downstream]=pull/`echo $ghprbCommentBody | sed -r "s/.*${downstream,,}=([0-9]+).*/\1/g"`/merge
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
@@ -6,12 +6,8 @@
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
|
||||
#include <opm/input/eclipse/Deck/Deck.hpp>
|
||||
#include <opm/input/eclipse/Schedule/SummaryState.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
|
||||
#include <opm/input/eclipse/Schedule/Schedule.hpp>
|
||||
#include <opm/input/eclipse/Schedule/Action/State.hpp>
|
||||
|
||||
@@ -27,7 +23,6 @@ class EclipseIO;
|
||||
class ParseContext;
|
||||
class Parser;
|
||||
class Python;
|
||||
class SummaryState;
|
||||
class UDQState;
|
||||
class WellTestState;
|
||||
|
||||
|
||||
@@ -49,22 +49,22 @@
|
||||
// std::runtime_error.
|
||||
//
|
||||
// Usage: OPM_THROW(ExceptionClass, "Error message " << value);
|
||||
#define OPM_THROW(Exception, message) \
|
||||
do { \
|
||||
std::ostringstream oss__; \
|
||||
oss__ << "[" << __FILE__ << ":" << __LINE__ << "] " << message; \
|
||||
::Opm::OpmLog::error(oss__.str()); \
|
||||
throw Exception(oss__.str()); \
|
||||
#define OPM_THROW(Exception, message) \
|
||||
do { \
|
||||
std::ostringstream opmErrorMacroOStringStream; \
|
||||
opmErrorMacroOStringStream << "[" << __FILE__ << ":" << __LINE__ << "] " << message; \
|
||||
::Opm::OpmLog::error(opmErrorMacroOStringStream.str()); \
|
||||
throw Exception(opmErrorMacroOStringStream.str()); \
|
||||
} while (false)
|
||||
|
||||
// Same as OPM_THROW, except for not making an OpmLog::error() call.
|
||||
//
|
||||
// Usage: OPM_THROW_NOLOG(ExceptionClass, "Error message " << value);
|
||||
#define OPM_THROW_NOLOG(Exception, message) \
|
||||
do { \
|
||||
std::ostringstream oss__; \
|
||||
oss__ << "[" << __FILE__ << ":" << __LINE__ << "] " << message; \
|
||||
throw Exception(oss__.str()); \
|
||||
#define OPM_THROW_NOLOG(Exception, message) \
|
||||
do { \
|
||||
std::ostringstream opmErrorMacroOStringStream; \
|
||||
opmErrorMacroOStringStream << "[" << __FILE__ << ":" << __LINE__ << "] " << message; \
|
||||
throw Exception(opmErrorMacroOStringStream.str()); \
|
||||
} while (false)
|
||||
|
||||
// throw an exception if a condition is true
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
|
||||
std::string format(const std::string& msg_fmt) const;
|
||||
|
||||
static KeywordLocation serializeObject()
|
||||
static KeywordLocation serializationTestObject()
|
||||
{
|
||||
KeywordLocation result;
|
||||
result.keyword = "KW";
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#define STREAMLOG_H
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <cstdint>
|
||||
|
||||
#include <opm/common/OpmLog/LogBackend.hpp>
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <opm/input/eclipse/EclipseState/Grid/GridDims.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
@@ -69,6 +70,7 @@ public:
|
||||
/// \param k The index in the k direction
|
||||
/// \return The local index or -1 if the cell is inactive
|
||||
int localCell(std::size_t i, std::size_t j, std::size_t k) const;
|
||||
|
||||
protected:
|
||||
/// \brief Maps the cartesian index to a compressed local index.
|
||||
///
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
/*
|
||||
Copyright 2020 Equinor ASA.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
@@ -15,122 +13,513 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Consult the COPYING file in the top-level source directory of this
|
||||
module for the precise wording of the license and the list of
|
||||
copyright holders.
|
||||
*/
|
||||
#ifndef SERIALIZER_HPP
|
||||
#define SERIALIZER_HPP
|
||||
|
||||
#ifndef OPM_SERIALIZER_HPP
|
||||
#define OPM_SERIALIZER_HPP
|
||||
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm {
|
||||
/*
|
||||
This is a very basic serialization class used to support serialization of
|
||||
small state objects from opm common. The main serialization code used in
|
||||
opm/flow is initiated and controlled from the restart code, and therefor
|
||||
slightly cumbersome to use for objects which should be serialized not as part
|
||||
of the restart code.
|
||||
*/
|
||||
namespace detail {
|
||||
|
||||
template<typename ...Ts>
|
||||
struct MakeVariantImpl
|
||||
{
|
||||
|
||||
class Serializer {
|
||||
public:
|
||||
Serializer() = default;
|
||||
explicit Serializer(const std::vector<char>& buffer_arg) :
|
||||
buffer(buffer_arg)
|
||||
{}
|
||||
template<std::size_t Index, typename, typename ...Rest>
|
||||
static decltype(auto) make_variant(std::size_t index)
|
||||
{
|
||||
if(Index == index)
|
||||
return std::variant<Ts...>{std::in_place_index_t<Index>{}};
|
||||
|
||||
if constexpr(sizeof...(Rest) != 0)
|
||||
return make_variant<Index + 1, Rest...>(index);
|
||||
else
|
||||
throw std::runtime_error("Invalid variant index");
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void put(const T& value) {
|
||||
this->pack(std::addressof(value), sizeof(T));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void put(const T* ) {
|
||||
throw std::logic_error("Serializer can not pack pointers");
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T get() {
|
||||
T value;
|
||||
std::memcpy(&value, &this->buffer[this->read_pos], sizeof(T));
|
||||
this->read_pos += sizeof(T);
|
||||
return value;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void put_vector(const std::vector<T>& values) {
|
||||
this->put(values.size());
|
||||
this->pack(values.data(), values.size() * sizeof(T));
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename T>
|
||||
std::vector<T> get_vector() {
|
||||
std::size_t size = this->get<std::size_t>();
|
||||
std::vector<T> values(size);
|
||||
for (std::size_t index=0; index < size; index++)
|
||||
values[index] = this->get<T>();
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
template<typename K, typename T>
|
||||
void put_map(const std::unordered_map<K,T>& values) {
|
||||
this->put(values.size());
|
||||
for (const auto& value_pair : values) {
|
||||
this->put(value_pair.first);
|
||||
this->put(value_pair.second);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename K, typename T>
|
||||
std::unordered_map<K,T> get_map() {
|
||||
std::unordered_map<K,T> values;
|
||||
auto size = this->get<std::size_t>();
|
||||
for (std::size_t index = 0; index < size; index++) {
|
||||
auto key = this->get<K>();
|
||||
auto value = this->get<T>();
|
||||
values.insert( std::make_pair(key,value) );
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
|
||||
std::vector<char> buffer;
|
||||
private:
|
||||
void pack(const void * ptr, std::size_t value_size) {
|
||||
std::size_t write_pos = this->buffer.size();
|
||||
std::size_t new_size = write_pos + value_size;
|
||||
this->buffer.resize( new_size );
|
||||
std::memcpy(&this->buffer[write_pos], ptr, value_size);
|
||||
}
|
||||
|
||||
std::size_t read_pos = 0;
|
||||
};
|
||||
|
||||
template <>
|
||||
void inline Serializer::put(const std::string& value) {
|
||||
this->put(value.size());
|
||||
if (value.empty())
|
||||
return;
|
||||
|
||||
this->pack(value.c_str(), value.size());
|
||||
template<typename ...Ts>
|
||||
decltype(auto) make_variant(std::size_t index)
|
||||
{
|
||||
return detail::MakeVariantImpl<Ts...>::template make_variant<0, Ts...>(index);
|
||||
}
|
||||
|
||||
template<>
|
||||
std::string inline Serializer::get<std::string>() {
|
||||
std::string::size_type length = this->get<std::string::size_type>();
|
||||
if (length == 0)
|
||||
return std::string{};
|
||||
template<class T>
|
||||
using remove_cvr_t = std::remove_cv_t<std::remove_reference_t<T>>;
|
||||
|
||||
this->read_pos += length;
|
||||
return {std::addressof(this->buffer[this->read_pos - length]), length};
|
||||
}
|
||||
} // namespace detail
|
||||
|
||||
/*! \brief Class for (de-)serializing.
|
||||
*! \details If the class has a serializeOp member this is used,
|
||||
* if not it is passed on to the underlying packer.
|
||||
*/
|
||||
|
||||
template<class Packer>
|
||||
class Serializer {
|
||||
public:
|
||||
//! \brief Constructor.
|
||||
//! \param packer Packer to use
|
||||
explicit Serializer(const Packer& packer) :
|
||||
m_packer(packer)
|
||||
{}
|
||||
|
||||
//! \brief Applies current serialization op to the passed data.
|
||||
template<class T>
|
||||
void operator()(const T& data)
|
||||
{
|
||||
if constexpr (is_ptr<T>::value) {
|
||||
ptr(data);
|
||||
} else if constexpr (is_pair_or_tuple<T>::value) {
|
||||
tuple(data);
|
||||
} else if constexpr (is_variant<T>::value) {
|
||||
variant(data);
|
||||
} else if constexpr (is_optional<T>::value) {
|
||||
optional(data);
|
||||
} else if constexpr (is_vector<T>::value) {
|
||||
vector(data);
|
||||
} else if constexpr (is_map<T>::value) {
|
||||
map(data);
|
||||
} else if constexpr (is_array<T>::value) {
|
||||
array(data);
|
||||
} else if constexpr (is_set<T>::value) {
|
||||
set(data);
|
||||
} else if constexpr (has_serializeOp<detail::remove_cvr_t<T>>::value) {
|
||||
const_cast<T&>(data).serializeOp(*this);
|
||||
} else {
|
||||
if (m_op == Operation::PACKSIZE)
|
||||
m_packSize += m_packer.packSize(data);
|
||||
else if (m_op == Operation::PACK)
|
||||
m_packer.pack(data, m_buffer, m_position);
|
||||
else if (m_op == Operation::UNPACK)
|
||||
m_packer.unpack(const_cast<T&>(data), m_buffer, m_position);
|
||||
}
|
||||
}
|
||||
|
||||
//! \brief Call this to serialize data.
|
||||
//! \tparam T Type of class to serialize
|
||||
//! \param data Class to serialize
|
||||
template<class T>
|
||||
void pack(const T& data)
|
||||
{
|
||||
m_op = Operation::PACKSIZE;
|
||||
m_packSize = 0;
|
||||
(*this)(data);
|
||||
m_position = 0;
|
||||
m_buffer.resize(m_packSize);
|
||||
m_op = Operation::PACK;
|
||||
(*this)(data);
|
||||
}
|
||||
|
||||
//! \brief Call this to serialize data.
|
||||
//! \tparam T Type of class to serialize
|
||||
//! \param data Class to serialize
|
||||
template<class... Args>
|
||||
void pack(const Args&... data)
|
||||
{
|
||||
m_op = Operation::PACKSIZE;
|
||||
m_packSize = 0;
|
||||
variadic_call(data...);
|
||||
m_position = 0;
|
||||
m_buffer.resize(m_packSize);
|
||||
m_op = Operation::PACK;
|
||||
variadic_call(data...);
|
||||
}
|
||||
|
||||
//! \brief Call this to de-serialize data.
|
||||
//! \tparam T Type of class to de-serialize
|
||||
//! \param data Class to de-serialize
|
||||
template<class T>
|
||||
void unpack(T& data)
|
||||
{
|
||||
m_position = 0;
|
||||
m_op = Operation::UNPACK;
|
||||
(*this)(data);
|
||||
}
|
||||
|
||||
//! \brief Call this to de-serialize data.
|
||||
//! \tparam T Type of class to de-serialize
|
||||
//! \param data Class to de-serialize
|
||||
template<class... Args>
|
||||
void unpack(Args&... data)
|
||||
{
|
||||
m_position = 0;
|
||||
m_op = Operation::UNPACK;
|
||||
variadic_call(data...);
|
||||
}
|
||||
|
||||
//! \brief Returns current position in buffer.
|
||||
size_t position() const
|
||||
{
|
||||
return m_position;
|
||||
}
|
||||
|
||||
//! \brief Returns true if we are currently doing a serialization operation.
|
||||
bool isSerializing() const
|
||||
{
|
||||
return m_op != Operation::UNPACK;
|
||||
}
|
||||
|
||||
protected:
|
||||
//! \brief Handler for vectors.
|
||||
//! \tparam T Type for vector elements
|
||||
//! \param data The vector to (de-)serialize
|
||||
template <typename T>
|
||||
void vector(const std::vector<T>& data)
|
||||
{
|
||||
if constexpr (std::is_pod_v<T>) {
|
||||
if (m_op == Operation::PACKSIZE) {
|
||||
(*this)(data.size());
|
||||
m_packSize += m_packer.packSize(data.data(), data.size());
|
||||
} else if (m_op == Operation::PACK) {
|
||||
(*this)(data.size());
|
||||
m_packer.pack(data.data(), data.size(), m_buffer, m_position);
|
||||
} else if (m_op == Operation::UNPACK) {
|
||||
std::size_t size = 0;
|
||||
(*this)(size);
|
||||
auto& data_mut = const_cast<std::vector<T>&>(data);
|
||||
data_mut.resize(size);
|
||||
m_packer.unpack(data_mut.data(), size, m_buffer, m_position);
|
||||
}
|
||||
} else {
|
||||
if (m_op == Operation::UNPACK) {
|
||||
std::size_t size = 0;
|
||||
(*this)(size);
|
||||
auto& data_mut = const_cast<std::vector<T>&>(data);
|
||||
data_mut.resize(size);
|
||||
std::for_each(data_mut.begin(), data_mut.end(), std::ref(*this));
|
||||
} else {
|
||||
(*this)(data.size());
|
||||
std::for_each(data.begin(), data.end(), std::ref(*this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//! \brief Handler for bool vectors.
|
||||
//! \param data The vector to (de-)serialize
|
||||
void vector(const std::vector<bool>& data)
|
||||
{
|
||||
if (m_op == Operation::UNPACK) {
|
||||
std::size_t size = 0;
|
||||
(*this)(size);
|
||||
auto& data_mut = const_cast<std::vector<bool>&>(data);
|
||||
data_mut.clear();
|
||||
data_mut.reserve(size);
|
||||
for (size_t i = 0; i < size; ++i) {
|
||||
bool entry = false;
|
||||
(*this)(entry);
|
||||
data_mut.push_back(entry);
|
||||
}
|
||||
} else {
|
||||
(*this)(data.size());
|
||||
for (const auto entry : data) { // Not a reference: vector<bool> range
|
||||
bool b = entry;
|
||||
(*this)(b);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//! \brief Handler for arrays.
|
||||
//! \param data The array to (de-)serialize
|
||||
template <class Array>
|
||||
void array(const Array& data)
|
||||
{
|
||||
using T = typename Array::value_type;
|
||||
|
||||
if constexpr (std::is_pod_v<T>) {
|
||||
if (m_op == Operation::PACKSIZE)
|
||||
m_packSize += m_packer.packSize(data.data(), data.size());
|
||||
else if (m_op == Operation::PACK)
|
||||
m_packer.pack(data.data(), data.size(), m_buffer, m_position);
|
||||
else if (m_op == Operation::UNPACK) {
|
||||
auto& data_mut = const_cast<Array&>(data);
|
||||
m_packer.unpack(data_mut.data(), data_mut.size(), m_buffer, m_position);
|
||||
}
|
||||
} else {
|
||||
std::for_each(data.begin(), data.end(), std::ref(*this));
|
||||
}
|
||||
}
|
||||
|
||||
//! \brief Handler for std::variant.
|
||||
//! \param data The variant to (de-)serialize
|
||||
template<class... Args>
|
||||
void variant(const std::variant<Args...>& data)
|
||||
{
|
||||
if (m_op == Operation::UNPACK) {
|
||||
std::size_t index = 0;
|
||||
(*this)(index);
|
||||
auto& data_mut = const_cast<std::variant<Args...>&>(data);
|
||||
data_mut = detail::make_variant<Args...>(index);
|
||||
std::visit(std::ref(*this), data_mut);
|
||||
} else {
|
||||
(*this)(data.index());
|
||||
std::visit(std::ref(*this), data);
|
||||
}
|
||||
}
|
||||
|
||||
//! \brief Handler for std::optional.
|
||||
//! \tparam T Type for data
|
||||
//! \param data The optional to (de-)serialize
|
||||
template<class T>
|
||||
void optional(const std::optional<T>& data)
|
||||
{
|
||||
if (m_op == Operation::UNPACK) {
|
||||
bool has = false;
|
||||
(*this)(has);
|
||||
if (has) {
|
||||
T res;
|
||||
(*this)(res);
|
||||
const_cast<std::optional<T>&>(data) = res;
|
||||
}
|
||||
} else {
|
||||
(*this)(data.has_value());
|
||||
if (data.has_value()) {
|
||||
(*this)(*data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//! \brief Handler for std::tuple.
|
||||
//! \param data The tuple to (de-)serialize
|
||||
template<class Tuple>
|
||||
void tuple(const Tuple& data)
|
||||
{
|
||||
tuple_call(data);
|
||||
}
|
||||
|
||||
//! \brief Handler for maps.
|
||||
//! \tparam Map map type
|
||||
//! \param map The map to (de-)serialize
|
||||
template<class Map>
|
||||
void map(const Map& data)
|
||||
{
|
||||
if (m_op == Operation::UNPACK) {
|
||||
std::size_t size = 0;
|
||||
(*this)(size);
|
||||
auto& data_mut = const_cast<Map&>(data);
|
||||
for (size_t i = 0; i < size; ++i) {
|
||||
typename Map::value_type entry;
|
||||
(*this)(entry);
|
||||
data_mut.insert(entry);
|
||||
}
|
||||
} else {
|
||||
(*this)(data.size());
|
||||
std::for_each(data.begin(), data.end(), std::ref(*this));
|
||||
}
|
||||
}
|
||||
|
||||
//! \brief Handler for sets.
|
||||
//! \tparam Set set type
|
||||
//! \param data The set to (de-)serialize
|
||||
template<class Set>
|
||||
void set(const Set& data)
|
||||
{
|
||||
if (m_op == Operation::UNPACK) {
|
||||
std::size_t size = 0;
|
||||
(*this)(size);
|
||||
auto& data_mut = const_cast<Set&>(data);
|
||||
for (size_t i = 0; i < size; ++i) {
|
||||
typename Set::value_type entry;
|
||||
(*this)(entry);
|
||||
data_mut.insert(entry);
|
||||
}
|
||||
} else {
|
||||
(*this)(data.size());
|
||||
std::for_each(data.begin(), data.end(), std::ref(*this));
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, typename... Args>
|
||||
void variadic_call(T& first,
|
||||
Args&&... args)
|
||||
{
|
||||
(*this)(first);
|
||||
if constexpr (sizeof...(args) > 0)
|
||||
variadic_call(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template<std::size_t I = 0, typename Tuple>
|
||||
typename std::enable_if<I == std::tuple_size<Tuple>::value, void>::type
|
||||
tuple_call(const Tuple&)
|
||||
{
|
||||
}
|
||||
|
||||
template<std::size_t I = 0, typename Tuple>
|
||||
typename std::enable_if<I != std::tuple_size<Tuple>::value, void>::type
|
||||
tuple_call(const Tuple& tuple)
|
||||
{
|
||||
(*this)(std::get<I>(tuple));
|
||||
tuple_call<I+1>(tuple);
|
||||
}
|
||||
|
||||
//! \brief Enumeration of operations.
|
||||
enum class Operation {
|
||||
PACKSIZE, //!< Calculating serialization buffer size
|
||||
PACK, //!< Performing serialization
|
||||
UNPACK //!< Performing de-serialization
|
||||
};
|
||||
|
||||
//! \brief Predicate for detecting vectors.
|
||||
template<class T>
|
||||
struct is_vector {
|
||||
constexpr static bool value = false;
|
||||
};
|
||||
|
||||
template<class T1, class Allocator>
|
||||
struct is_vector<std::vector<T1,Allocator>> {
|
||||
constexpr static bool value = true;
|
||||
};
|
||||
|
||||
//! \brief Predicate for detecting variants.
|
||||
template<class T>
|
||||
struct is_variant {
|
||||
constexpr static bool value = false;
|
||||
};
|
||||
|
||||
template<class... Ts>
|
||||
struct is_variant<std::variant<Ts...>> {
|
||||
constexpr static bool value = true;
|
||||
};
|
||||
|
||||
//! \brief Predicate for detecting pairs and tuples.
|
||||
template<class T>
|
||||
struct is_pair_or_tuple {
|
||||
constexpr static bool value = false;
|
||||
};
|
||||
|
||||
template<class... Ts>
|
||||
struct is_pair_or_tuple<std::tuple<Ts...>> {
|
||||
constexpr static bool value = true;
|
||||
};
|
||||
|
||||
template<class T1, class T2>
|
||||
struct is_pair_or_tuple<std::pair<T1,T2>> {
|
||||
constexpr static bool value = true;
|
||||
};
|
||||
|
||||
//! \brief Predicate for smart pointers.
|
||||
template<class T>
|
||||
struct is_ptr {
|
||||
constexpr static bool value = false;
|
||||
};
|
||||
|
||||
template<class T1>
|
||||
struct is_ptr<std::shared_ptr<T1>> {
|
||||
constexpr static bool value = true;
|
||||
};
|
||||
|
||||
template<class T1, class Deleter>
|
||||
struct is_ptr<std::unique_ptr<T1, Deleter>> {
|
||||
constexpr static bool value = true;
|
||||
};
|
||||
|
||||
//! \brief Predicate for std::optional.
|
||||
template<class T>
|
||||
struct is_optional {
|
||||
constexpr static bool value = false;
|
||||
};
|
||||
|
||||
template<class T1>
|
||||
struct is_optional<std::optional<T1>> {
|
||||
constexpr static bool value = true;
|
||||
};
|
||||
|
||||
//! \brief Predicate for maps
|
||||
template<class T>
|
||||
struct is_map {
|
||||
constexpr static bool value = false;
|
||||
};
|
||||
|
||||
template<class Key, class T, class Compare, class Allocator>
|
||||
struct is_map<std::map<Key,T,Compare,Allocator>> {
|
||||
constexpr static bool value = true;
|
||||
};
|
||||
|
||||
template<class Key, class T, class Hash, class KeyEqual, class Allocator>
|
||||
struct is_map<std::unordered_map<Key,T,Hash,KeyEqual,Allocator>> {
|
||||
constexpr static bool value = true;
|
||||
};
|
||||
|
||||
//! \brief Predicate for sets
|
||||
template<class T>
|
||||
struct is_set {
|
||||
constexpr static bool value = false;
|
||||
};
|
||||
|
||||
template<class Key, class Compare, class Allocator>
|
||||
struct is_set<std::set<Key,Compare,Allocator>> {
|
||||
constexpr static bool value = true;
|
||||
};
|
||||
|
||||
template<class Key, class Hash, class KeyEqual, class Allocator>
|
||||
struct is_set<std::unordered_set<Key,Hash,KeyEqual,Allocator>> {
|
||||
constexpr static bool value = true;
|
||||
};
|
||||
|
||||
//! \brief Predicate for arrays
|
||||
template<class T>
|
||||
struct is_array {
|
||||
constexpr static bool value = false;
|
||||
};
|
||||
|
||||
template<class T, std::size_t N>
|
||||
struct is_array<std::array<T,N>> {
|
||||
constexpr static bool value = true;
|
||||
};
|
||||
|
||||
//! Detect existence of \c serializeOp member function
|
||||
//!
|
||||
//! Base case (no \c serializeOp member function)
|
||||
template <typename, class = void>
|
||||
struct has_serializeOp : public std::false_type {};
|
||||
|
||||
//! Detect existence of \c serializeOp member function
|
||||
//!
|
||||
//! Non-default, albeit common, case (type has \c serializeOp member
|
||||
//! function)
|
||||
template <typename T>
|
||||
struct has_serializeOp<
|
||||
T, std::void_t<decltype(std::declval<T>().serializeOp(std::declval<Serializer<Packer>&>()))>
|
||||
> : public std::true_type {};
|
||||
|
||||
//! \brief Handler for smart pointers.
|
||||
template<class PtrType>
|
||||
void ptr(const PtrType& data)
|
||||
{
|
||||
using T1 = typename PtrType::element_type;
|
||||
bool value = data ? true : false;
|
||||
(*this)(value);
|
||||
if (m_op == Operation::UNPACK && value) {
|
||||
const_cast<PtrType&>(data).reset(new T1);
|
||||
}
|
||||
if (data) {
|
||||
(*this)(*data);
|
||||
}
|
||||
}
|
||||
|
||||
const Packer& m_packer; //!< Packer to use
|
||||
Operation m_op = Operation::PACKSIZE; //!< Current operation
|
||||
size_t m_packSize = 0; //!< Required buffer size after PACKSIZE has been done
|
||||
int m_position = 0; //!< Current position in buffer
|
||||
std::vector<char> m_buffer; //!< Buffer for serialized data
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -45,6 +45,7 @@ namespace Opm {
|
||||
|
||||
std::time_t mkdatetime(int in_year, int in_month, int in_day, int hour, int minute, int second);
|
||||
std::time_t mkdate(int in_year, int in_month, int in_day);
|
||||
std::time_t portable_timegm(const std::tm* t);
|
||||
std::time_t timeFromEclipse(const DeckRecord &dateRecord);
|
||||
}
|
||||
|
||||
@@ -103,7 +104,7 @@ namespace Opm {
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
ymd_.serializeOp(serializer);
|
||||
serializer(ymd_);
|
||||
serializer(hour_);
|
||||
serializer(minutes_);
|
||||
serializer(seconds_);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <exception>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <iostream>
|
||||
#include <ostream>
|
||||
|
||||
#include <opm/common/ErrorMacros.hpp>
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
#define DECK_HPP
|
||||
|
||||
#include <functional>
|
||||
#include <iosfwd>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <ostream>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
@@ -69,7 +69,7 @@ namespace Opm {
|
||||
Deck( const Deck& );
|
||||
Deck( Deck&& );
|
||||
|
||||
static Deck serializeObject();
|
||||
static Deck serializationTestObject();
|
||||
|
||||
Deck& operator=(const Deck& rhs);
|
||||
bool operator==(const Deck& data) const;
|
||||
@@ -116,8 +116,8 @@ namespace Opm {
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.vector(keywordList);
|
||||
defaultUnits.serializeOp(serializer);
|
||||
serializer(keywordList);
|
||||
serializer(defaultUnits);
|
||||
serializer(activeUnits);
|
||||
serializer(m_dataFile);
|
||||
serializer(input_path);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <ostream>
|
||||
#include <iosfwd>
|
||||
|
||||
#include <opm/input/eclipse/Units/Dimension.hpp>
|
||||
#include <opm/input/eclipse/Utility/Typetools.hpp>
|
||||
@@ -46,7 +46,7 @@ namespace Opm {
|
||||
DeckItem( const std::string&, UDAValue, const std::vector<Dimension>& active_dim, const std::vector<Dimension>& default_dim);
|
||||
DeckItem( const std::string&, double, const std::vector<Dimension>& active_dim, const std::vector<Dimension>& default_dim);
|
||||
|
||||
static DeckItem serializeObject();
|
||||
static DeckItem serializationTestObject();
|
||||
|
||||
const std::string& name() const;
|
||||
|
||||
@@ -140,14 +140,14 @@ namespace Opm {
|
||||
serializer(dval);
|
||||
serializer(ival);
|
||||
serializer(sval);
|
||||
serializer.vector(rsval);
|
||||
serializer.vector(uval);
|
||||
serializer(rsval);
|
||||
serializer(uval);
|
||||
serializer(type);
|
||||
serializer(item_name);
|
||||
serializer.template vector<value::status, false>(value_status);
|
||||
serializer(value_status);
|
||||
serializer(raw_data);
|
||||
serializer.vector(active_dimensions);
|
||||
serializer.vector(default_dimensions);
|
||||
serializer(active_dimensions);
|
||||
serializer(default_dimensions);
|
||||
}
|
||||
|
||||
void reserve_additionalRawString(std::size_t);
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Opm {
|
||||
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<int>& data);
|
||||
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<double>& data, const UnitSystem& system_active, const UnitSystem& system_default);
|
||||
|
||||
static DeckKeyword serializeObject();
|
||||
static DeckKeyword serializationTestObject();
|
||||
|
||||
const std::string& name() const;
|
||||
void setFixedSize();
|
||||
@@ -97,8 +97,8 @@ namespace Opm {
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_keywordName);
|
||||
m_location.serializeOp(serializer);
|
||||
serializer.vector(m_recordList);
|
||||
serializer(m_location);
|
||||
serializer(m_recordList);
|
||||
serializer(m_isDataKeyword);
|
||||
serializer(m_slashTerminated);
|
||||
serializer(m_isDoubleRecordKeyword);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#ifndef DECK_OUTPUT_HPP
|
||||
#define DECK_OUTPUT_HPP
|
||||
|
||||
#include <ostream>
|
||||
#include <iosfwd>
|
||||
#include <string>
|
||||
#include <cstddef>
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <ostream>
|
||||
#include <iosfwd>
|
||||
|
||||
#include <opm/input/eclipse/Deck/DeckItem.hpp>
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Opm {
|
||||
DeckRecord() = default;
|
||||
DeckRecord( std::vector< DeckItem >&& items, const bool check_for_duplicate_names = true );
|
||||
|
||||
static DeckRecord serializeObject();
|
||||
static DeckRecord serializationTestObject();
|
||||
|
||||
size_t size() const;
|
||||
void addItem( DeckItem deckItem );
|
||||
@@ -75,7 +75,7 @@ namespace Opm {
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.vector(m_items);
|
||||
serializer(m_items);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -22,10 +22,12 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <opm/input/eclipse/Deck/Deck.hpp>
|
||||
#include <opm/input/eclipse/Deck/DeckView.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class Deck;
|
||||
|
||||
enum class Section {
|
||||
RUNSPEC,
|
||||
GRID,
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <unordered_set>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <iosfwd>
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <opm/input/eclipse/Deck/DeckKeyword.hpp>
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
void update(const std::string& s);
|
||||
void update_value(const UDAValue& other);
|
||||
|
||||
static UDAValue serializeObject();
|
||||
static UDAValue serializationTestObject();
|
||||
|
||||
/*
|
||||
The get<double>() and get<std::string>() methods will throw an
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
bool operator==(const UDAValue& other) const;
|
||||
bool operator!=(const UDAValue& other) const;
|
||||
|
||||
bool is_numeric() { return numeric_value; }
|
||||
bool is_numeric() const { return numeric_value; }
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
serializer(numeric_value);
|
||||
serializer(double_value);
|
||||
serializer(string_value);
|
||||
dim.serializeOp(serializer);
|
||||
serializer(dim);
|
||||
}
|
||||
|
||||
void operator*=(double rhs);
|
||||
|
||||
@@ -93,18 +93,19 @@ namespace Opm {
|
||||
void pruneDeactivatedAquiferConnections(const std::vector<std::size_t>& deactivated_cells);
|
||||
void loadFromRestart(const RestartIO::RstAquifer& rst_aquifers);
|
||||
|
||||
static Aquancon serializeObject();
|
||||
static Aquancon serializationTestObject();
|
||||
|
||||
const std::unordered_map<int, std::vector<Aquancon::AquancCell>>& data() const;
|
||||
bool operator==(const Aquancon& other) const;
|
||||
bool active() const;
|
||||
|
||||
const std::vector<Aquancon::AquancCell>& operator[](int aquiferID) const;
|
||||
bool hasAquiferConnections(int aquiferID) const;
|
||||
const std::vector<Aquancon::AquancCell>& getConnections(int aquiferID) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.map(this->cells);
|
||||
serializer(this->cells);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace Opm {
|
||||
std::vector<double> dimensionless_time{};
|
||||
std::vector<double> dimensionless_pressure{};
|
||||
|
||||
static AQUCT_data serializeObject();
|
||||
static AQUCT_data serializationTestObject();
|
||||
|
||||
double timeConstant() const { return this->time_constant_; }
|
||||
double influxConstant() const { return this->influx_constant_; }
|
||||
@@ -129,7 +129,7 @@ namespace Opm {
|
||||
void loadFromRestart(const RestartIO::RstAquifer& rst,
|
||||
const TableManager& tables);
|
||||
|
||||
static AquiferCT serializeObject();
|
||||
static AquiferCT serializationTestObject();
|
||||
|
||||
std::size_t size() const;
|
||||
std::vector<AquiferCT::AQUCT_data>::const_iterator begin() const;
|
||||
@@ -142,7 +142,7 @@ namespace Opm {
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.vector(m_aquct);
|
||||
serializer(m_aquct);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
void loadFromRestart(const RestartIO::RstAquifer& aquifers,
|
||||
const TableManager& tables);
|
||||
|
||||
static AquiferConfig serializeObject();
|
||||
static AquiferConfig serializationTestObject();
|
||||
|
||||
bool active() const;
|
||||
const AquiferCT& ct() const;
|
||||
@@ -61,6 +61,7 @@ public:
|
||||
const Aquancon& connections() const;
|
||||
bool operator==(const AquiferConfig& other) const;
|
||||
bool hasAquifer(const int aquID) const;
|
||||
bool hasAnalyticalAquifer(const int aquID) const;
|
||||
|
||||
bool hasNumericalAquifer() const;
|
||||
bool hasAnalyticalAquifer() const;
|
||||
@@ -70,10 +71,10 @@ public:
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
aquifetp.serializeOp(serializer);
|
||||
aquiferct.serializeOp(serializer);
|
||||
aqconn.serializeOp(serializer);
|
||||
numerical_aquifers.serializeOp(serializer);
|
||||
serializer(aquifetp);
|
||||
serializer(aquiferct);
|
||||
serializer(aqconn);
|
||||
serializer(numerical_aquifers);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -57,7 +57,8 @@ class Aquifetp {
|
||||
const double C_t_,
|
||||
const double V0_,
|
||||
const double d0_,
|
||||
const double p0_);
|
||||
const double p0_,
|
||||
const double t0_);
|
||||
|
||||
int aquiferID{};
|
||||
int pvttableID{};
|
||||
@@ -68,8 +69,9 @@ class Aquifetp {
|
||||
double datum_depth{};
|
||||
|
||||
std::optional<double> initial_pressure{};
|
||||
std::optional<double> initial_temperature{};
|
||||
|
||||
static AQUFETP_data serializeObject();
|
||||
static AQUFETP_data serializationTestObject();
|
||||
|
||||
double timeConstant() const { return this->time_constant_; }
|
||||
double waterDensity() const { return this->water_density_; }
|
||||
@@ -89,6 +91,7 @@ class Aquifetp {
|
||||
serializer(this->initial_watvolume);
|
||||
serializer(this->datum_depth);
|
||||
serializer(this->initial_pressure);
|
||||
serializer(this->initial_temperature);
|
||||
serializer(this->time_constant_);
|
||||
serializer(this->water_density_);
|
||||
serializer(this->water_viscosity_);
|
||||
@@ -107,7 +110,7 @@ class Aquifetp {
|
||||
void loadFromRestart(const RestartIO::RstAquifer& rst,
|
||||
const TableManager& tables);
|
||||
|
||||
static Aquifetp serializeObject();
|
||||
static Aquifetp serializationTestObject();
|
||||
|
||||
const std::vector<Aquifetp::AQUFETP_data>& data() const;
|
||||
|
||||
@@ -121,7 +124,7 @@ class Aquifetp {
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.vector(m_aqufetp);
|
||||
serializer(m_aqufetp);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -57,11 +57,11 @@ namespace Opm {
|
||||
void initConnections(const Deck& deck, const EclipseGrid& grid);
|
||||
void postProcessConnections(const EclipseGrid& grid, const std::vector<int>& actnum);
|
||||
|
||||
static NumericalAquifers serializeObject();
|
||||
static NumericalAquifers serializationTestObject();
|
||||
template <class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.map(this->m_aquifers);
|
||||
serializer(this->m_aquifers);
|
||||
serializer(this->m_num_records);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,8 +69,8 @@ namespace Opm {
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer) {
|
||||
serializer(this->id_);
|
||||
serializer.vector(this->cells_);
|
||||
serializer.vector(this->connections_);
|
||||
serializer(this->cells_);
|
||||
serializer(this->connections_);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Opm {
|
||||
explicit EclipseConfig(const Deck& deck);
|
||||
EclipseConfig(const InitConfig& initConfig, const IOConfig& io_conf);
|
||||
|
||||
static EclipseConfig serializeObject();
|
||||
static EclipseConfig serializationTestObject();
|
||||
|
||||
InitConfig& init();
|
||||
IOConfig& io();
|
||||
@@ -46,8 +46,8 @@ namespace Opm {
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
m_initConfig.serializeOp(serializer);
|
||||
io_config.serializeOp(serializer);
|
||||
serializer(m_initConfig);
|
||||
serializer(io_config);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -116,20 +116,21 @@ namespace Opm {
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
// FieldPropsManager is handled otherwise, do not add
|
||||
m_tables.serializeOp(serializer);
|
||||
m_runspec.serializeOp(serializer);
|
||||
m_eclipseConfig.serializeOp(serializer);
|
||||
m_deckUnitSystem.serializeOp(serializer);
|
||||
m_inputNnc.serializeOp(serializer);
|
||||
m_gridDims.serializeOp(serializer);
|
||||
aquifer_config.serializeOp(serializer);
|
||||
m_simulationConfig.serializeOp(serializer);
|
||||
m_transMult.serializeOp(serializer);
|
||||
m_faults.serializeOp(serializer);
|
||||
// FieldPropsManager is handled through a different mechanism.
|
||||
// Do not add the member (i.e., field_props) to this list.
|
||||
serializer(m_tables);
|
||||
serializer(m_runspec);
|
||||
serializer(m_eclipseConfig);
|
||||
serializer(m_deckUnitSystem);
|
||||
serializer(m_inputNnc);
|
||||
serializer(m_gridDims);
|
||||
serializer(m_simulationConfig);
|
||||
serializer(aquifer_config);
|
||||
serializer(m_transMult);
|
||||
serializer(m_faults);
|
||||
serializer(m_title);
|
||||
tracer_config.serializeOp(serializer);
|
||||
m_micppara.serializeOp(serializer);
|
||||
serializer(tracer_config);
|
||||
serializer(m_micppara);
|
||||
}
|
||||
|
||||
static bool rst_cmp(const EclipseState& full_state, const EclipseState& rst_state);
|
||||
@@ -137,6 +138,9 @@ namespace Opm {
|
||||
|
||||
private:
|
||||
void initIOConfigPostSchedule(const Deck& deck);
|
||||
void assignRunTitle(const Deck& deck);
|
||||
void reportNumberOfActivePhases() const;
|
||||
void conveyNumericalAquiferEffects();
|
||||
void applyMULTXYZ();
|
||||
void initFaults(const Deck& deck);
|
||||
void initPara(const Deck& deck);
|
||||
@@ -155,14 +159,14 @@ namespace Opm {
|
||||
NNC m_inputNnc;
|
||||
GridDims m_gridDims;
|
||||
FieldPropsManager field_props;
|
||||
AquiferConfig aquifer_config;
|
||||
SimulationConfig m_simulationConfig;
|
||||
AquiferConfig aquifer_config;
|
||||
TransMult m_transMult;
|
||||
|
||||
FaultCollection m_faults;
|
||||
std::string m_title;
|
||||
TracerConfig tracer_config;
|
||||
MICPpara m_micppara;
|
||||
|
||||
std::string m_title{};
|
||||
FaultCollection m_faults{};
|
||||
};
|
||||
} // namespace Opm
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class EndpointScaling {
|
||||
EndpointScaling() noexcept = default;
|
||||
explicit EndpointScaling( const Deck& );
|
||||
|
||||
static EndpointScaling serializeObject();
|
||||
static EndpointScaling serializationTestObject();
|
||||
|
||||
/* true if endpoint scaling is enabled, otherwise false */
|
||||
operator bool() const noexcept;
|
||||
|
||||
@@ -17,61 +17,75 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef BOX_HPP_
|
||||
#define BOX_HPP_
|
||||
|
||||
#include <opm/input/eclipse/EclipseState/Grid/GridDims.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <limits>
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm {
|
||||
class DeckRecord;
|
||||
class EclipseGrid;
|
||||
}
|
||||
|
||||
class Box {
|
||||
namespace Opm
|
||||
{
|
||||
class Box
|
||||
{
|
||||
public:
|
||||
using IsActive = std::function<bool(const std::size_t globalIdx)>;
|
||||
using ActiveIdx = std::function<std::size_t(const std::size_t globalIdx)>;
|
||||
|
||||
|
||||
struct cell_index {
|
||||
struct cell_index
|
||||
{
|
||||
std::size_t global_index;
|
||||
std::size_t active_index;
|
||||
std::size_t data_index;
|
||||
|
||||
|
||||
cell_index(std::size_t g,std::size_t a, std::size_t d) :
|
||||
global_index(g),
|
||||
active_index(a),
|
||||
data_index(d)
|
||||
cell_index(std::size_t g,std::size_t a, std::size_t d)
|
||||
: global_index(g)
|
||||
, active_index(a)
|
||||
, data_index(d)
|
||||
{}
|
||||
|
||||
|
||||
/*
|
||||
This constructor should is used by the global_index_list() member
|
||||
which will return a list of *all* the cells in the box. In this
|
||||
case the active_index will be set to the global_index. This is a
|
||||
hack to simplify the treatment of global fields in the FieldProps
|
||||
implementation.
|
||||
*/
|
||||
cell_index(std::size_t g, std::size_t d) :
|
||||
global_index(g),
|
||||
active_index(g),
|
||||
data_index(d)
|
||||
// This constructor should is used by the global_index_list() member
|
||||
// which will return a list of *all* the cells in the box. In this
|
||||
// case the active_index will be set to the global_index. This is a
|
||||
// hack to simplify the treatment of global fields in the FieldProps
|
||||
// implementation.
|
||||
cell_index(std::size_t g, std::size_t d)
|
||||
: global_index(g)
|
||||
, active_index(g)
|
||||
, data_index(d)
|
||||
{}
|
||||
};
|
||||
|
||||
explicit Box(const EclipseGrid& grid);
|
||||
Box(const EclipseGrid& grid , int i1 , int i2 , int j1 , int j2 , int k1 , int k2);
|
||||
explicit Box(const GridDims& gridDims,
|
||||
IsActive isActive,
|
||||
ActiveIdx activeIdx);
|
||||
|
||||
Box(const GridDims& gridDims,
|
||||
IsActive isActive,
|
||||
ActiveIdx activeIdx,
|
||||
int i1, int i2,
|
||||
int j1, int j2,
|
||||
int k1, int k2);
|
||||
|
||||
void update(const DeckRecord& deckRecord);
|
||||
void reset();
|
||||
|
||||
size_t size() const;
|
||||
bool isGlobal() const;
|
||||
size_t getDim(size_t idim) const;
|
||||
const std::vector<cell_index>& index_list() const;
|
||||
const std::vector<Box::cell_index>& global_index_list() const;
|
||||
bool equal(const Box& other) const;
|
||||
bool isGlobal() const;
|
||||
std::size_t size() const;
|
||||
std::size_t getDim(std::size_t idim) const;
|
||||
|
||||
const std::vector<cell_index>& index_list() const;
|
||||
const std::vector<cell_index>& global_index_list() const;
|
||||
|
||||
bool operator==(const Box& other) const;
|
||||
bool equal(const Box& other) const;
|
||||
|
||||
int I1() const;
|
||||
int I2() const;
|
||||
@@ -81,17 +95,18 @@ namespace Opm {
|
||||
int K2() const;
|
||||
|
||||
private:
|
||||
void init(int i1, int i2, int j1, int j2, int k1, int k2);
|
||||
void initIndexList();
|
||||
const EclipseGrid& grid;
|
||||
size_t m_stride[3];
|
||||
size_t m_dims[3] = { 0, 0, 0 };
|
||||
size_t m_offset[3];
|
||||
GridDims m_globalGridDims_{};
|
||||
IsActive m_globalIsActive_{};
|
||||
ActiveIdx m_globalActiveIdx_{};
|
||||
|
||||
std::array<std::size_t, 3> m_dims{};
|
||||
std::array<std::size_t, 3> m_offset{};
|
||||
|
||||
bool m_isGlobal;
|
||||
std::vector<cell_index> m_active_index_list;
|
||||
std::vector<cell_index> m_global_index_list;
|
||||
|
||||
void init(int i1, int i2, int j1, int j2, int k1, int k2);
|
||||
void initIndexList();
|
||||
int lower(int dim) const;
|
||||
int upper(int dim) const;
|
||||
};
|
||||
|
||||
@@ -17,15 +17,14 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef BOXMANAGER_HPP_
|
||||
#define BOXMANAGER_HPP_
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
#include <opm/input/eclipse/EclipseState/Grid/Box.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/Grid/GridDims.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
/*
|
||||
This class implements a simple book keeping system for the current
|
||||
@@ -52,9 +51,12 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class BoxManager {
|
||||
class BoxManager
|
||||
{
|
||||
public:
|
||||
BoxManager(const EclipseGrid& grid);
|
||||
explicit BoxManager(const GridDims& gridDims,
|
||||
Box::IsActive isActive,
|
||||
Box::ActiveIdx activeIdx);
|
||||
|
||||
void setInputBox( int i1,int i2 , int j1 , int j2 , int k1 , int k2);
|
||||
void setKeywordBox( int i1,int i2 , int j1 , int j2 , int k1 , int k2);
|
||||
@@ -67,12 +69,20 @@ namespace Opm {
|
||||
const std::vector<Box::cell_index>& index_list() const;
|
||||
|
||||
private:
|
||||
const EclipseGrid& grid;
|
||||
GridDims gridDims_{};
|
||||
Box::IsActive isActive_{};
|
||||
Box::ActiveIdx activeIdx_{};
|
||||
|
||||
std::unique_ptr<Box> m_globalBox;
|
||||
std::unique_ptr<Box> m_inputBox;
|
||||
std::unique_ptr<Box> m_keywordBox;
|
||||
|
||||
std::unique_ptr<Box>
|
||||
makeBox(const int i1, const int i2,
|
||||
const int j1, const int j2,
|
||||
const int k1, const int k2) const;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
#endif // BOXMANAGER_HPP_
|
||||
|
||||
@@ -60,12 +60,12 @@ namespace Opm {
|
||||
These constructors will make a copy of the src grid, with
|
||||
zcorn and or actnum have been adjustments.
|
||||
*/
|
||||
EclipseGrid(const EclipseGrid& src) = default;
|
||||
EclipseGrid(const EclipseGrid& src, const std::vector<int>& actnum);
|
||||
EclipseGrid(const EclipseGrid& src, const double* zcorn, const std::vector<int>& actnum);
|
||||
|
||||
EclipseGrid(size_t nx, size_t ny, size_t nz,
|
||||
double dx = 1.0, double dy = 1.0, double dz = 1.0);
|
||||
explicit EclipseGrid(const GridDims& gd);
|
||||
|
||||
EclipseGrid(const std::array<int, 3>& dims ,
|
||||
const std::vector<double>& coord ,
|
||||
@@ -208,6 +208,17 @@ namespace Opm {
|
||||
void resetACTNUM( const std::vector<int>& actnum);
|
||||
|
||||
bool equal(const EclipseGrid& other) const;
|
||||
static bool hasDVDEPTHZKeywords(const Deck&);
|
||||
|
||||
/*
|
||||
For ALugrid we can *only* use the keyword <DXV, DXYV, DZV, DEPTHZ> so to
|
||||
initialize a Regular Cartesian Grid; further we need equidistant mesh
|
||||
spacing in each direction to initialize ALuGrid (mandatory for
|
||||
mesh refinement!).
|
||||
*/
|
||||
|
||||
static bool hasEqualDVDEPTHZ(const Deck&);
|
||||
static bool allEqual(const std::vector<double> &v);
|
||||
|
||||
private:
|
||||
std::vector<double> m_minpvVector;
|
||||
@@ -260,11 +271,10 @@ namespace Opm {
|
||||
void initCartesianGrid(const Deck&);
|
||||
void initDTOPSGrid(const Deck&);
|
||||
void initDVDEPTHZGrid(const Deck&);
|
||||
void initGrid(const Deck&);
|
||||
void initGrid(const Deck&, const int* actnum);
|
||||
void initCornerPointGrid(const Deck&);
|
||||
void assertCornerPointKeywords(const Deck&);
|
||||
|
||||
static bool hasDVDEPTHZKeywords(const Deck&);
|
||||
static bool hasDTOPSKeywords(const Deck&);
|
||||
static void assertVectorSize(const std::vector<double>& vector, size_t expectedSize, const std::string& msg);
|
||||
|
||||
|
||||
@@ -28,12 +28,13 @@ namespace Opm {
|
||||
namespace FaceDir {
|
||||
|
||||
enum DirEnum {
|
||||
XPlus = 1,
|
||||
XMinus = 2,
|
||||
YPlus = 4,
|
||||
YMinus = 8,
|
||||
ZPlus = 16,
|
||||
ZMinus = 32
|
||||
Unknown = 0,
|
||||
XPlus = 1,
|
||||
XMinus = 2,
|
||||
YPlus = 4,
|
||||
YMinus = 8,
|
||||
ZPlus = 16,
|
||||
ZMinus = 32
|
||||
};
|
||||
/**
|
||||
The MULTREGTScanner will use these values as bitmaps;
|
||||
@@ -43,6 +44,9 @@ namespace Opm {
|
||||
|
||||
DirEnum FromString(const std::string& stringValue);
|
||||
int FromMULTREGTString(const std::string& stringValue);
|
||||
DirEnum FromIntersectionIndex(int idx);
|
||||
|
||||
const std::string toString(DirEnum dir);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
Fault() = default;
|
||||
explicit Fault(const std::string& faultName);
|
||||
|
||||
static Fault serializeObject();
|
||||
static Fault serializationTestObject();
|
||||
|
||||
const std::string& getName() const;
|
||||
void setTransMult(double transMult);
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
{
|
||||
serializer(m_name);
|
||||
serializer(m_transMult);
|
||||
serializer.vector(m_faceList);
|
||||
serializer(m_faceList);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
FaultCollection();
|
||||
FaultCollection(const GRIDSection& gridSection, const GridDims& grid);
|
||||
|
||||
static FaultCollection serializeObject();
|
||||
static FaultCollection serializationTestObject();
|
||||
|
||||
size_t size() const;
|
||||
bool hasFault(const std::string& faultName) const;
|
||||
@@ -55,14 +55,14 @@ public:
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
m_faults.serializeOp(serializer);
|
||||
serializer(m_faults);
|
||||
}
|
||||
|
||||
private:
|
||||
void addFaultFaces(const GridDims& grid,
|
||||
const DeckRecord& faultRecord,
|
||||
const std::string& faultName);
|
||||
OrderedMap<std::string, Fault> m_faults;
|
||||
OrderedMap<Fault, 8> m_faults;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
size_t K1 , size_t K2,
|
||||
FaceDir::DirEnum faceDir);
|
||||
|
||||
static FaultFace serializeObject();
|
||||
static FaultFace serializationTestObject();
|
||||
|
||||
std::vector<size_t>::const_iterator begin() const;
|
||||
std::vector<size_t>::const_iterator end() const;
|
||||
|
||||
@@ -243,7 +243,11 @@ static const std::unordered_map<std::string, keyword_info<int>> int_keywords = {
|
||||
{"PVTNUM", keyword_info<int>{}.init(1)},
|
||||
{"SATNUM", keyword_info<int>{}.init(1)},
|
||||
{"LWSLTNUM", keyword_info<int>{}},
|
||||
{"ROCKNUM", keyword_info<int>{}}};
|
||||
{"ROCKNUM", keyword_info<int>{}},
|
||||
{"KRNUMX", keyword_info<int>{}},
|
||||
{"KRNUMY", keyword_info<int>{}},
|
||||
{"KRNUMZ", keyword_info<int>{}},
|
||||
};
|
||||
}
|
||||
|
||||
namespace SOLUTION {
|
||||
@@ -377,8 +381,11 @@ public:
|
||||
|
||||
|
||||
|
||||
|
||||
/// Normal constructor for FieldProps.
|
||||
FieldProps(const Deck& deck, const Phases& phases, const EclipseGrid& grid, const TableManager& table_arg);
|
||||
/// Special case constructor used to process ACTNUM only.
|
||||
FieldProps(const Deck& deck, const EclipseGrid& grid);
|
||||
|
||||
void reset_actnum(const std::vector<int>& actnum);
|
||||
|
||||
void apply_numerical_aquifers(const NumericalAquifers& numerical_aquifers);
|
||||
@@ -386,6 +393,7 @@ public:
|
||||
const std::string& default_region() const;
|
||||
|
||||
std::vector<int> actnum();
|
||||
const std::vector<int>& actnumRaw() const;
|
||||
|
||||
template <typename T>
|
||||
static bool supported(const std::string& keyword);
|
||||
@@ -498,12 +506,17 @@ public:
|
||||
void handle_schedule_keywords(const std::vector<DeckKeyword>& keywords);
|
||||
bool tran_active(const std::string& keyword) const;
|
||||
void apply_tran(const std::string& keyword, std::vector<double>& data);
|
||||
std::vector<char> serialize_tran() const;
|
||||
void deserialize_tran(const std::vector<char>& buffer);
|
||||
bool operator==(const FieldProps& other) const;
|
||||
static bool rst_cmp(const FieldProps& full_arg, const FieldProps& rst_arg);
|
||||
|
||||
const Fieldprops::TranMap& getTran() const
|
||||
{
|
||||
return tran;
|
||||
}
|
||||
|
||||
private:
|
||||
void scanGRIDSection(const GRIDSection& grid_section);
|
||||
void scanGRIDSectionOnlyACTNUM(const GRIDSection& grid_section);
|
||||
void scanEDITSection(const EDITSection& edit_section);
|
||||
void scanPROPSSection(const PROPSSection& props_section);
|
||||
void scanREGIONSSection(const REGIONSSection& regions_section);
|
||||
@@ -561,7 +574,7 @@ private:
|
||||
std::unordered_map<std::string, Fieldprops::FieldData<int>> int_data;
|
||||
std::unordered_map<std::string, Fieldprops::FieldData<double>> double_data;
|
||||
|
||||
std::unordered_map<std::string, Fieldprops::TranCalculator> tran;
|
||||
Fieldprops::TranMap tran;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -43,6 +43,8 @@ public:
|
||||
// The default constructed fieldProps object is **NOT** usable
|
||||
FieldPropsManager() = default;
|
||||
FieldPropsManager(const Deck& deck, const Phases& ph, const EclipseGrid& grid, const TableManager& tables);
|
||||
virtual ~FieldPropsManager() = default;
|
||||
|
||||
virtual void reset_actnum(const std::vector<int>& actnum);
|
||||
const std::string& default_region() const;
|
||||
virtual std::vector<int> actnum() const;
|
||||
@@ -228,16 +230,8 @@ public:
|
||||
|
||||
void apply_numerical_aquifers(const NumericalAquifers& aquifers);
|
||||
|
||||
const Fieldprops::TranMap& getTran() const;
|
||||
|
||||
/*
|
||||
When using MPI the FieldPropsManager is typically only assembled on the
|
||||
root node and then distributed to the other nodes afterwards. These
|
||||
methods are support methods for that, the real data used by the
|
||||
transmissibility calculators is in the form of custom 3D fields, they are
|
||||
distributed the same way the rest of the 3D fields are distributed.
|
||||
*/
|
||||
virtual std::vector<char> serialize_tran() const;
|
||||
virtual void deserialize_tran(const std::vector<char>& buffer);
|
||||
private:
|
||||
/*
|
||||
Return the keyword values as a std::vector<>. All elements in the return
|
||||
@@ -274,14 +268,9 @@ private:
|
||||
template <typename T>
|
||||
std::vector<T> get_global(const std::string& keyword) const;
|
||||
|
||||
|
||||
std::shared_ptr<FieldProps> fp;
|
||||
};
|
||||
|
||||
|
||||
void deserialize_tran(std::unordered_map<std::string, Fieldprops::TranCalculator>& tran,
|
||||
const std::vector<char>& buffer);
|
||||
|
||||
template<class MapType>
|
||||
void apply_tran(const std::unordered_map<std::string, Fieldprops::TranCalculator>& tran,
|
||||
const MapType& double_data,
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
#define OPM_PARSER_GRIDDIMS_HPP
|
||||
|
||||
#include <array>
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
#include <cstddef>
|
||||
|
||||
namespace Opm {
|
||||
class Deck;
|
||||
@@ -31,32 +30,30 @@ namespace Opm {
|
||||
class GridDims
|
||||
{
|
||||
public:
|
||||
|
||||
GridDims();
|
||||
explicit GridDims(std::array<int, 3> xyz);
|
||||
GridDims(size_t nx, size_t ny, size_t nz);
|
||||
explicit GridDims(const std::array<int, 3>& xyz);
|
||||
GridDims(std::size_t nx, std::size_t ny, std::size_t nz);
|
||||
|
||||
static GridDims serializeObject();
|
||||
static GridDims serializationTestObject();
|
||||
|
||||
explicit GridDims(const Deck& deck);
|
||||
|
||||
size_t getNX() const;
|
||||
std::size_t getNX() const;
|
||||
std::size_t getNY() const;
|
||||
std::size_t getNZ() const;
|
||||
std::size_t operator[](int dim) const;
|
||||
|
||||
size_t getNY() const;
|
||||
size_t getNZ() const;
|
||||
size_t operator[](int dim) const;
|
||||
std::array<int, 3> getNXYZ() const;
|
||||
|
||||
const std::array<int, 3> getNXYZ() const;
|
||||
std::size_t getGlobalIndex(std::size_t i, std::size_t j, std::size_t k) const;
|
||||
|
||||
size_t getGlobalIndex(size_t i, size_t j, size_t k) const;
|
||||
std::array<int, 3> getIJK(std::size_t globalIndex) const;
|
||||
|
||||
const std::array<int, 3> getIJK(size_t globalIndex) const;
|
||||
std::size_t getCartesianSize() const;
|
||||
|
||||
size_t getCartesianSize() const;
|
||||
void assertGlobalIndex(std::size_t globalIndex) const;
|
||||
|
||||
void assertGlobalIndex(size_t globalIndex) const;
|
||||
|
||||
void assertIJK(size_t i, size_t j, size_t k) const;
|
||||
void assertIJK(std::size_t i, std::size_t j, std::size_t k) const;
|
||||
|
||||
bool operator==(const GridDims& data) const;
|
||||
|
||||
@@ -69,9 +66,9 @@ namespace Opm {
|
||||
}
|
||||
|
||||
protected:
|
||||
size_t m_nx;
|
||||
size_t m_ny;
|
||||
size_t m_nz;
|
||||
std::size_t m_nx;
|
||||
std::size_t m_ny;
|
||||
std::size_t m_nz;
|
||||
|
||||
private:
|
||||
void init(const DeckKeyword& keyword);
|
||||
|
||||
@@ -23,13 +23,12 @@
|
||||
|
||||
#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
|
||||
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class FieldPropsManager;
|
||||
|
||||
class DeckRecord;
|
||||
class DeckKeyword;
|
||||
class FieldPropsManager;
|
||||
class GridDims;
|
||||
|
||||
namespace MULTREGT {
|
||||
|
||||
@@ -93,7 +92,7 @@ namespace Opm {
|
||||
const FieldPropsManager* fp_arg,
|
||||
const std::vector< const DeckKeyword* >& keywords);
|
||||
|
||||
static MULTREGTScanner serializeObject();
|
||||
static MULTREGTScanner serializationTestObject();
|
||||
|
||||
double getRegionMultiplier(size_t globalCellIdx1, size_t globalCellIdx2, FaceDir::DirEnum faceDir) const;
|
||||
|
||||
@@ -106,7 +105,7 @@ namespace Opm {
|
||||
serializer(nx);
|
||||
serializer(ny);
|
||||
serializer(nz);
|
||||
serializer.vector(m_records);
|
||||
serializer(m_records);
|
||||
ExternalSearchMap searchMap = getSearchMap();
|
||||
serializer(searchMap);
|
||||
if (m_searchMap.empty())
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
/// Construct from input deck.
|
||||
NNC(const EclipseGrid& grid, const Deck& deck);
|
||||
|
||||
static NNC serializeObject();
|
||||
static NNC serializationTestObject();
|
||||
|
||||
bool addNNC(const size_t cell1, const size_t cell2, const double trans);
|
||||
const std::vector<NNCdata>& input() const { return m_input; }
|
||||
@@ -120,8 +120,8 @@ public:
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.vector(m_input);
|
||||
serializer.vector(m_edit);
|
||||
serializer(m_input);
|
||||
serializer(m_edit);
|
||||
serializer(m_nnc_location);
|
||||
serializer(m_edit_location);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#define TRAN_CALCULATOR_HPP
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm
|
||||
@@ -50,6 +51,13 @@ public:
|
||||
return this->op == other.op &&
|
||||
this->field == other.field;
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(op);
|
||||
serializer(field);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -57,6 +65,8 @@ public:
|
||||
m_name(name_arg)
|
||||
{}
|
||||
|
||||
TranCalculator() = default;
|
||||
|
||||
std::string next_name() const {
|
||||
return this->m_name + std::to_string( this->actions.size() );
|
||||
}
|
||||
@@ -88,11 +98,27 @@ public:
|
||||
this->actions == other.actions;
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_name);
|
||||
serializer(actions);
|
||||
}
|
||||
|
||||
static TranCalculator serializationTestObject()
|
||||
{
|
||||
TranCalculator tran("test");
|
||||
tran.add_action(ScalarOperation::MIN, "FGOP");
|
||||
return tran;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string m_name;
|
||||
std::vector<TranAction> actions;
|
||||
};
|
||||
|
||||
using TranMap = std::unordered_map<std::string, TranCalculator>;
|
||||
|
||||
} // namespace Fieldprops
|
||||
} // end namespace Opm
|
||||
#endif // TRAN_CALCULATOR_HPP
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace Opm {
|
||||
TransMult() = default;
|
||||
TransMult(const GridDims& dims, const Deck& deck, const FieldPropsManager& fp);
|
||||
|
||||
static TransMult serializeObject();
|
||||
static TransMult serializationTestObject();
|
||||
|
||||
double getMultiplier(size_t globalIndex, FaceDir::DirEnum faceDir) const;
|
||||
double getMultiplier(size_t i , size_t j , size_t k, FaceDir::DirEnum faceDir) const;
|
||||
@@ -67,10 +67,9 @@ namespace Opm {
|
||||
serializer(m_nx);
|
||||
serializer(m_ny);
|
||||
serializer(m_nz);
|
||||
// map used to avoid explicit instances with FaceDir::DirEnum in serializer
|
||||
serializer.template map<decltype(m_trans),false>(m_trans);
|
||||
serializer.template map<decltype(m_names),false>(m_names);
|
||||
m_multregtScanner.serializeOp(serializer);
|
||||
serializer(m_trans);
|
||||
serializer(m_names);
|
||||
serializer(m_multregtScanner);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace Opm {
|
||||
explicit IOConfig( const Deck& );
|
||||
explicit IOConfig( const std::string& input_path );
|
||||
|
||||
static IOConfig serializeObject();
|
||||
static IOConfig serializationTestObject();
|
||||
|
||||
void setEclCompatibleRST(bool ecl_rst);
|
||||
bool getEclCompatibleRST() const;
|
||||
|
||||
@@ -18,10 +18,11 @@ namespace Opm {
|
||||
bool liveOilInitConstantRs() const;
|
||||
bool wetGasInitConstantRv() const;
|
||||
int initializationTargetAccuracy() const;
|
||||
bool humidGasInitConstantRvw() const;
|
||||
|
||||
EquilRecord();
|
||||
|
||||
EquilRecord( double datum_depth_arg, double datum_depth_pc_arg, double woc_depth, double woc_pc, double goc_depth, double goc_pc, bool live_oil_init, bool wet_gas_init, int target_accuracy);
|
||||
EquilRecord( double datum_depth_arg, double datum_depth_pc_arg, double woc_depth, double woc_pc, double goc_depth, double goc_pc, bool live_oil_init, bool wet_gas_init, int target_accuracy, bool humid_gas_init);
|
||||
|
||||
bool operator==(const EquilRecord& data) const;
|
||||
|
||||
@@ -37,6 +38,7 @@ namespace Opm {
|
||||
serializer(live_oil_init_proc);
|
||||
serializer(wet_gas_init_proc);
|
||||
serializer(init_target_accuracy);
|
||||
serializer(humid_gas_init_proc);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -50,6 +52,7 @@ namespace Opm {
|
||||
bool live_oil_init_proc;
|
||||
bool wet_gas_init_proc;
|
||||
int init_target_accuracy;
|
||||
bool humid_gas_init_proc;
|
||||
};
|
||||
|
||||
class Equil {
|
||||
@@ -59,7 +62,7 @@ namespace Opm {
|
||||
Equil() = default;
|
||||
explicit Equil( const DeckKeyword& );
|
||||
|
||||
static Equil serializeObject();
|
||||
static Equil serializationTestObject();
|
||||
|
||||
const EquilRecord& getRecord( size_t id ) const;
|
||||
|
||||
@@ -74,7 +77,7 @@ namespace Opm {
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.vector(m_records);
|
||||
serializer(m_records);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
FoamData(const DeckRecord& FOAMFSC_record, const DeckRecord& FOAMROCK_record);
|
||||
explicit FoamData(const DeckRecord& FOAMROCK_record);
|
||||
|
||||
static FoamData serializeObject();
|
||||
static FoamData serializationTestObject();
|
||||
|
||||
double referenceSurfactantConcentration() const;
|
||||
double exponent() const;
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
FoamConfig() = default;
|
||||
explicit FoamConfig(const Deck&);
|
||||
|
||||
static FoamConfig serializeObject();
|
||||
static FoamConfig serializationTestObject();
|
||||
|
||||
const FoamData& getRecord(std::size_t index) const;
|
||||
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.vector(data_);
|
||||
serializer(data_);
|
||||
serializer(transport_phase_);
|
||||
serializer(mobility_model_);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Opm {
|
||||
InitConfig();
|
||||
explicit InitConfig(const Deck& deck);
|
||||
|
||||
static InitConfig serializeObject();
|
||||
static InitConfig serializationTestObject();
|
||||
|
||||
void setRestart( const std::string& root, int step);
|
||||
bool restartRequested() const;
|
||||
@@ -63,8 +63,8 @@ namespace Opm {
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
equil.serializeOp(serializer);
|
||||
foamconfig.serializeOp(serializer);
|
||||
serializer(equil);
|
||||
serializer(foamconfig);
|
||||
serializer(m_filleps);
|
||||
serializer(m_gravity);
|
||||
serializer(m_restartRequested);
|
||||
|
||||
@@ -31,7 +31,7 @@ class Deck;
|
||||
explicit MICPpara(const Deck& deck);
|
||||
|
||||
|
||||
static MICPpara serializeObject()
|
||||
static MICPpara serializationTestObject()
|
||||
{
|
||||
MICPpara mp;
|
||||
mp.m_density_biofilm = 100;
|
||||
|
||||
@@ -60,7 +60,7 @@ class Phases {
|
||||
Phases( bool oil, bool gas, bool wat, bool solvent = false, bool polymer = false, bool energy = false,
|
||||
bool polymw = false, bool foam = false, bool brine = false, bool zfraction = false ) noexcept;
|
||||
|
||||
static Phases serializeObject();
|
||||
static Phases serializationTestObject();
|
||||
|
||||
bool active( Phase ) const noexcept;
|
||||
size_t size() const noexcept;
|
||||
@@ -70,13 +70,7 @@ class Phases {
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
if (serializer.isSerializing())
|
||||
serializer(bits.to_ulong());
|
||||
else {
|
||||
unsigned long Bits = 0;
|
||||
serializer(Bits);
|
||||
bits = std::bitset<NUM_PHASES_IN_ENUM>(Bits);
|
||||
}
|
||||
serializer(bits);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -89,7 +83,7 @@ public:
|
||||
Welldims() = default;
|
||||
explicit Welldims(const Deck& deck);
|
||||
|
||||
static Welldims serializeObject();
|
||||
static Welldims serializationTestObject();
|
||||
|
||||
int maxConnPerWell() const
|
||||
{
|
||||
@@ -167,7 +161,7 @@ public:
|
||||
WellSegmentDims();
|
||||
explicit WellSegmentDims(const Deck& deck);
|
||||
|
||||
static WellSegmentDims serializeObject();
|
||||
static WellSegmentDims serializationTestObject();
|
||||
|
||||
|
||||
int maxSegmentedWells() const
|
||||
@@ -206,7 +200,7 @@ public:
|
||||
NetworkDims();
|
||||
explicit NetworkDims(const Deck& deck);
|
||||
|
||||
static NetworkDims serializeObject();
|
||||
static NetworkDims serializationTestObject();
|
||||
|
||||
int maxNONodes() const
|
||||
{
|
||||
@@ -246,7 +240,7 @@ public:
|
||||
AquiferDimensions();
|
||||
explicit AquiferDimensions(const Deck& deck);
|
||||
|
||||
static AquiferDimensions serializeObject();
|
||||
static AquiferDimensions serializationTestObject();
|
||||
|
||||
int maxAnalyticAquifers() const
|
||||
{
|
||||
@@ -278,7 +272,7 @@ public:
|
||||
EclHysterConfig() = default;
|
||||
explicit EclHysterConfig(const Deck& deck);
|
||||
|
||||
static EclHysterConfig serializeObject();
|
||||
static EclHysterConfig serializationTestObject();
|
||||
|
||||
/*!
|
||||
* \brief Specify whether hysteresis is enabled or not.
|
||||
@@ -306,6 +300,20 @@ public:
|
||||
*/
|
||||
int krHysteresisModel() const;
|
||||
|
||||
/*!
|
||||
* \brief Regularisation parameter used for Killough model.
|
||||
*
|
||||
* default: 0.1
|
||||
*/
|
||||
double modParamTrapped() const;
|
||||
|
||||
/*!
|
||||
* \brief Curvature parameter used for capillary pressure hysteresis.
|
||||
*
|
||||
* default: 0.1
|
||||
*/
|
||||
double curvatureCapPrs() const;
|
||||
|
||||
bool operator==(const EclHysterConfig& data) const;
|
||||
|
||||
template<class Serializer>
|
||||
@@ -314,6 +322,8 @@ public:
|
||||
serializer(activeHyst);
|
||||
serializer(pcHystMod);
|
||||
serializer(krHystMod);
|
||||
serializer(modParamTrappedValue);
|
||||
serializer(curvatureCapPrsValue);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -321,8 +331,12 @@ private:
|
||||
bool activeHyst { false };
|
||||
|
||||
// the capillary pressure and the relperm hysteresis models to be used
|
||||
int pcHystMod { 0 };
|
||||
int krHystMod { 0 };
|
||||
int pcHystMod { -1 };
|
||||
int krHystMod { -1 };
|
||||
// regularisation parameter used for Killough model
|
||||
double modParamTrappedValue { 0.1 };
|
||||
// curvature parameter for capillary pressure
|
||||
double curvatureCapPrsValue { 0.1 };
|
||||
};
|
||||
|
||||
class SatFuncControls {
|
||||
@@ -345,7 +359,7 @@ public:
|
||||
const ThreePhaseOilKrModel model,
|
||||
const KeywordFamily family);
|
||||
|
||||
static SatFuncControls serializeObject();
|
||||
static SatFuncControls serializationTestObject();
|
||||
|
||||
double minimumRelpermMobilityThreshold() const
|
||||
{
|
||||
@@ -386,7 +400,7 @@ public:
|
||||
void update(int value);
|
||||
int value() const;
|
||||
|
||||
static Nupcol serializeObject();
|
||||
static Nupcol serializationTestObject();
|
||||
bool operator==(const Nupcol& data) const;
|
||||
|
||||
template<class Serializer>
|
||||
@@ -420,7 +434,7 @@ public:
|
||||
serializer(this->min_iter);
|
||||
}
|
||||
|
||||
static Tracers serializeObject();
|
||||
static Tracers serializationTestObject();
|
||||
bool operator==(const Tracers& data) const;
|
||||
|
||||
private:
|
||||
@@ -441,7 +455,7 @@ public:
|
||||
Runspec() = default;
|
||||
explicit Runspec( const Deck& );
|
||||
|
||||
static Runspec serializeObject();
|
||||
static Runspec serializationTestObject();
|
||||
|
||||
std::time_t start_time() const noexcept;
|
||||
const UDQParams& udqParams() const noexcept;
|
||||
@@ -469,19 +483,19 @@ public:
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(this->m_start_time);
|
||||
active_phases.serializeOp(serializer);
|
||||
m_tabdims.serializeOp(serializer);
|
||||
m_regdims.serializeOp(serializer);
|
||||
endscale.serializeOp(serializer);
|
||||
welldims.serializeOp(serializer);
|
||||
wsegdims.serializeOp(serializer);
|
||||
netwrkdims.serializeOp(serializer);
|
||||
aquiferdims.serializeOp(serializer);
|
||||
udq_params.serializeOp(serializer);
|
||||
hystpar.serializeOp(serializer);
|
||||
m_actdims.serializeOp(serializer);
|
||||
m_sfuncctrl.serializeOp(serializer);
|
||||
m_nupcol.serializeOp(serializer);
|
||||
serializer(active_phases);
|
||||
serializer(m_tabdims);
|
||||
serializer(m_regdims);
|
||||
serializer(endscale);
|
||||
serializer(welldims);
|
||||
serializer(wsegdims);
|
||||
serializer(netwrkdims);
|
||||
serializer(aquiferdims);
|
||||
serializer(udq_params);
|
||||
serializer(hystpar);
|
||||
serializer(m_actdims);
|
||||
serializer(m_sfuncctrl);
|
||||
serializer(m_nupcol);
|
||||
serializer(m_co2storage);
|
||||
serializer(m_micp);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <cstddef>
|
||||
|
||||
#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/Grid/GridDims.hpp>
|
||||
|
||||
|
||||
namespace Opm {
|
||||
@@ -59,9 +60,9 @@ public:
|
||||
double rate;
|
||||
|
||||
BCFace() = default;
|
||||
explicit BCFace(const DeckRecord& record);
|
||||
explicit BCFace(const DeckRecord& record, const GridDims& grid);
|
||||
|
||||
static BCFace serializeObject();
|
||||
static BCFace serializationTestObject();
|
||||
|
||||
bool operator==(const BCFace& other) const;
|
||||
|
||||
@@ -85,7 +86,7 @@ public:
|
||||
BCConfig() = default;
|
||||
explicit BCConfig(const Deck& deck);
|
||||
|
||||
static BCConfig serializeObject();
|
||||
static BCConfig serializationTestObject();
|
||||
|
||||
std::size_t size() const;
|
||||
std::vector<BCFace>::const_iterator begin() const;
|
||||
@@ -95,7 +96,7 @@ public:
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.vector(m_faces);
|
||||
serializer(m_faces);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -61,7 +61,7 @@ struct RockComp {
|
||||
RockConfig();
|
||||
RockConfig(const Deck& deck, const FieldPropsManager& fp);
|
||||
|
||||
static RockConfig serializeObject();
|
||||
static RockConfig serializationTestObject();
|
||||
|
||||
bool active() const;
|
||||
const std::vector<RockConfig::RockComp>& comp() const;
|
||||
@@ -76,7 +76,7 @@ struct RockComp {
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_active);
|
||||
serializer.vector(m_comp);
|
||||
serializer(m_comp);
|
||||
serializer(num_property);
|
||||
serializer(num_tables);
|
||||
serializer(m_water_compaction);
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Opm {
|
||||
const Deck& deck,
|
||||
const FieldPropsManager& fp);
|
||||
|
||||
static SimulationConfig serializeObject();
|
||||
static SimulationConfig serializationTestObject();
|
||||
|
||||
const RockConfig& rock_config() const;
|
||||
const ThresholdPressure& getThresholdPressure() const;
|
||||
@@ -58,9 +58,9 @@ namespace Opm {
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
m_ThresholdPressure.serializeOp(serializer);
|
||||
m_bcconfig.serializeOp(serializer);
|
||||
m_rock_config.serializeOp(serializer);
|
||||
serializer(m_ThresholdPressure);
|
||||
serializer(m_bcconfig);
|
||||
serializer(m_rock_config);
|
||||
serializer(m_useCPR);
|
||||
serializer(m_DISGAS);
|
||||
serializer(m_VAPOIL);
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Opm {
|
||||
{}
|
||||
|
||||
//! \brief Returns an instance for serialization tests.
|
||||
static ThresholdPressure serializeObject();
|
||||
static ThresholdPressure serializationTestObject();
|
||||
|
||||
/*
|
||||
The hasRegionBarrier() method checks if a threshold pressure
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Opm {
|
||||
SummaryConfigNode() = default;
|
||||
explicit SummaryConfigNode(std::string keyword, const Category cat, KeywordLocation loc_arg);
|
||||
|
||||
static SummaryConfigNode serializeObject();
|
||||
static SummaryConfigNode serializationTestObject();
|
||||
|
||||
SummaryConfigNode& parameterType(const Type type);
|
||||
SummaryConfigNode& namedEntity(std::string name);
|
||||
@@ -76,7 +76,7 @@ namespace Opm {
|
||||
{
|
||||
serializer(keyword_);
|
||||
serializer(category_);
|
||||
loc.serializeOp(serializer);
|
||||
serializer(loc);
|
||||
serializer(type_);
|
||||
serializer(name_);
|
||||
serializer(number_);
|
||||
@@ -160,7 +160,7 @@ namespace Opm {
|
||||
const std::set<std::string>& shortKwds,
|
||||
const std::set<std::string>& smryKwds);
|
||||
|
||||
static SummaryConfig serializeObject();
|
||||
static SummaryConfig serializationTestObject();
|
||||
|
||||
const_iterator begin() const;
|
||||
const_iterator end() const;
|
||||
@@ -206,7 +206,7 @@ namespace Opm {
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.vector(m_keywords);
|
||||
serializer(m_keywords);
|
||||
serializer(short_keywords);
|
||||
serializer(summary_keywords);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Opm {
|
||||
|
||||
explicit Aqudims(const Deck& deck);
|
||||
|
||||
static Aqudims serializeObject()
|
||||
static Aqudims serializationTestObject()
|
||||
{
|
||||
Aqudims result;
|
||||
result.m_mxnaqn = 1;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Opm {
|
||||
|
||||
class AqutabTable : public SimpleTable {
|
||||
public:
|
||||
AqutabTable( const DeckItem& item );
|
||||
AqutabTable( const DeckItem& item, const int tableID );
|
||||
|
||||
const TableColumn& getTimeColumn() const;
|
||||
const TableColumn& getPressureColumn() const;
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Opm {
|
||||
|
||||
class BrineDensityTable {
|
||||
public:
|
||||
static BrineDensityTable serializeObject();
|
||||
static BrineDensityTable serializationTestObject();
|
||||
|
||||
void init(const Opm::DeckRecord& record);
|
||||
const std::vector<double>& getBrineDensityColumn() const;
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Opm {
|
||||
ColumnSchema(const std::string& name , Table::ColumnOrderEnum order, Table::DefaultAction defaultAction);
|
||||
ColumnSchema(const std::string& name , Table::ColumnOrderEnum order, double defaultValue);
|
||||
|
||||
static ColumnSchema serializeObject();
|
||||
static ColumnSchema serializationTestObject();
|
||||
|
||||
const std::string& name() const;
|
||||
bool validOrder( double value1 , double value2) const;
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Opm {
|
||||
DenT() = default;
|
||||
explicit DenT(const DeckKeyword& keyword);
|
||||
|
||||
static DenT serializeObject();
|
||||
static DenT serializationTestObject();
|
||||
|
||||
const entry& operator[](const std::size_t index) const;
|
||||
bool operator==(const DenT& other) const;
|
||||
@@ -61,7 +61,7 @@ namespace Opm {
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.vector(m_records);
|
||||
serializer(m_records);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Opm {
|
||||
class EnkrvdTable : public SimpleTable {
|
||||
public:
|
||||
|
||||
EnkrvdTable( const DeckItem& item );
|
||||
EnkrvdTable( const DeckItem& item, const int tableID );
|
||||
|
||||
|
||||
// using this method is strongly discouraged but the current endpoint scaling
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Opm {
|
||||
|
||||
class EnptvdTable : public SimpleTable {
|
||||
public:
|
||||
EnptvdTable( const DeckItem& item );
|
||||
EnptvdTable( const DeckItem& item, const int tableID );
|
||||
|
||||
// using this method is strongly discouraged but the current endpoint scaling
|
||||
// code makes it hard to avoid
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Opm {
|
||||
m_nstrvd( nstrvd )
|
||||
{ }
|
||||
|
||||
static Eqldims serializeObject()
|
||||
static Eqldims serializationTestObject()
|
||||
{
|
||||
return Eqldims(1, 2, 3, 4, 5);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
#ifndef OPM_FLAT_TABLE_HPP
|
||||
#define OPM_FLAT_TABLE_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <initializer_list>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class DeckKeyword;
|
||||
@@ -16,7 +21,86 @@ struct FlatTable : public std::vector< T > {
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer.vector(*this);
|
||||
serializer(static_cast<std::vector<T>&>(*this));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename RecordType>
|
||||
class FlatTableWithCopy
|
||||
{
|
||||
public:
|
||||
FlatTableWithCopy() = default;
|
||||
explicit FlatTableWithCopy(const DeckKeyword& kw,
|
||||
std::string_view expect = "");
|
||||
explicit FlatTableWithCopy(std::initializer_list<RecordType> records);
|
||||
|
||||
auto size() const { return this->table_.size(); }
|
||||
bool empty() const { return this->table_.empty(); }
|
||||
auto begin() const { return this->table_.begin(); }
|
||||
auto end() const { return this->table_.end(); }
|
||||
|
||||
const RecordType& operator[](const std::size_t tableID) const
|
||||
{
|
||||
return this->table_[tableID];
|
||||
}
|
||||
|
||||
const RecordType& at(const std::size_t tableID) const
|
||||
{
|
||||
return this->table_.at(tableID);
|
||||
}
|
||||
|
||||
bool operator==(const FlatTableWithCopy& other) const
|
||||
{
|
||||
return this->table_ == other.table_;
|
||||
}
|
||||
|
||||
template <class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(this->table_);
|
||||
}
|
||||
|
||||
protected:
|
||||
std::vector<RecordType> table_{};
|
||||
};
|
||||
|
||||
struct GRAVITYRecord {
|
||||
static constexpr std::size_t size = 3;
|
||||
|
||||
double oil_api;
|
||||
double water_sg;
|
||||
double gas_sg;
|
||||
|
||||
bool operator==(const GRAVITYRecord& data) const {
|
||||
return this->oil_api == data.oil_api &&
|
||||
this->water_sg == data.water_sg &&
|
||||
this->gas_sg == data.gas_sg;
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(this->oil_api);
|
||||
serializer(this->water_sg);
|
||||
serializer(this->gas_sg);
|
||||
}
|
||||
};
|
||||
|
||||
struct GravityTable : public FlatTableWithCopy<GRAVITYRecord>
|
||||
{
|
||||
GravityTable() = default;
|
||||
explicit GravityTable(const DeckKeyword& kw);
|
||||
explicit GravityTable(std::initializer_list<GRAVITYRecord> records);
|
||||
|
||||
static GravityTable serializationTestObject()
|
||||
{
|
||||
return GravityTable({{1.0, 2.0, 3.0}});
|
||||
}
|
||||
|
||||
template <class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
FlatTableWithCopy::serializeOp(serializer);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -42,43 +126,22 @@ struct DENSITYRecord {
|
||||
}
|
||||
};
|
||||
|
||||
struct DensityTable : public FlatTable< DENSITYRecord > {
|
||||
using FlatTable< DENSITYRecord >::FlatTable;
|
||||
struct DensityTable : public FlatTableWithCopy<DENSITYRecord>
|
||||
{
|
||||
DensityTable() = default;
|
||||
explicit DensityTable(const DeckKeyword& kw);
|
||||
explicit DensityTable(const GravityTable& gravity);
|
||||
explicit DensityTable(std::initializer_list<DENSITYRecord> records);
|
||||
|
||||
static DensityTable serializeObject()
|
||||
static DensityTable serializationTestObject()
|
||||
{
|
||||
return DensityTable({{1.0, 2.0, 3.0}});
|
||||
}
|
||||
};
|
||||
|
||||
struct GRAVITYRecord {
|
||||
static constexpr std::size_t size = 3;
|
||||
|
||||
double oil_api;
|
||||
double water_sg;
|
||||
double gas_sg;
|
||||
|
||||
bool operator==(const GRAVITYRecord& data) const {
|
||||
return this->oil_api == data.oil_api &&
|
||||
this->water_sg == data.water_sg &&
|
||||
this->gas_sg == data.gas_sg;
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
template <class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(this->oil_api);
|
||||
serializer(this->water_sg);
|
||||
serializer(this->gas_sg);
|
||||
}
|
||||
};
|
||||
|
||||
struct GravityTable : public FlatTable< GRAVITYRecord > {
|
||||
using FlatTable< GRAVITYRecord >::FlatTable;
|
||||
|
||||
static GravityTable serializeObject()
|
||||
{
|
||||
return GravityTable({{1.0, 2.0, 3.0}});
|
||||
FlatTableWithCopy::serializeOp(serializer);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -122,7 +185,7 @@ struct DiffCoeffRecord {
|
||||
struct DiffCoeffTable : public FlatTable< DiffCoeffRecord > {
|
||||
using FlatTable< DiffCoeffRecord >::FlatTable;
|
||||
|
||||
static DiffCoeffTable serializeObject()
|
||||
static DiffCoeffTable serializationTestObject()
|
||||
{
|
||||
return DiffCoeffTable({{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0}});
|
||||
}
|
||||
@@ -156,13 +219,22 @@ struct PVTWRecord {
|
||||
}
|
||||
};
|
||||
|
||||
struct PvtwTable : public FlatTable< PVTWRecord > {
|
||||
using FlatTable< PVTWRecord >::FlatTable;
|
||||
struct PvtwTable : public FlatTableWithCopy<PVTWRecord>
|
||||
{
|
||||
PvtwTable() = default;
|
||||
explicit PvtwTable(const DeckKeyword& kw);
|
||||
explicit PvtwTable(std::initializer_list<PVTWRecord> records);
|
||||
|
||||
static PvtwTable serializeObject()
|
||||
static PvtwTable serializationTestObject()
|
||||
{
|
||||
return PvtwTable({{1.0, 2.0, 3.0, 4.0, 5.0}});
|
||||
}
|
||||
|
||||
template <class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
FlatTableWithCopy::serializeOp(serializer);
|
||||
}
|
||||
};
|
||||
|
||||
struct ROCKRecord {
|
||||
@@ -187,7 +259,7 @@ struct ROCKRecord {
|
||||
struct RockTable : public FlatTable< ROCKRecord > {
|
||||
using FlatTable< ROCKRecord >::FlatTable;
|
||||
|
||||
static RockTable serializeObject()
|
||||
static RockTable serializationTestObject()
|
||||
{
|
||||
return RockTable({{1.0, 2.0}});
|
||||
}
|
||||
@@ -224,7 +296,7 @@ struct PVCDORecord {
|
||||
struct PvcdoTable : public FlatTable< PVCDORecord > {
|
||||
using FlatTable< PVCDORecord >::FlatTable;
|
||||
|
||||
static PvcdoTable serializeObject()
|
||||
static PvcdoTable serializationTestObject()
|
||||
{
|
||||
return PvcdoTable({{1.0, 2.0, 3.0, 4.0, 5.0}});
|
||||
}
|
||||
@@ -249,7 +321,7 @@ struct PlmixparRecord {
|
||||
struct PlmixparTable : public FlatTable< PlmixparRecord> {
|
||||
using FlatTable< PlmixparRecord >::FlatTable;
|
||||
|
||||
static PlmixparTable serializeObject()
|
||||
static PlmixparTable serializationTestObject()
|
||||
{
|
||||
return PlmixparTable({PlmixparRecord{1.0}});
|
||||
}
|
||||
@@ -283,7 +355,7 @@ struct PlyvmhRecord {
|
||||
struct PlyvmhTable : public FlatTable<PlyvmhRecord> {
|
||||
using FlatTable< PlyvmhRecord >::FlatTable;
|
||||
|
||||
static PlyvmhTable serializeObject()
|
||||
static PlyvmhTable serializationTestObject()
|
||||
{
|
||||
return PlyvmhTable({{1.0, 2.0, 3.0, 4.0}});
|
||||
}
|
||||
@@ -308,7 +380,7 @@ struct ShrateRecord {
|
||||
struct ShrateTable : public FlatTable<ShrateRecord> {
|
||||
using FlatTable< ShrateRecord >::FlatTable;
|
||||
|
||||
static ShrateTable serializeObject()
|
||||
static ShrateTable serializationTestObject()
|
||||
{
|
||||
return ShrateTable({ShrateRecord{1.0}});
|
||||
}
|
||||
@@ -333,7 +405,7 @@ struct Stone1exRecord {
|
||||
struct Stone1exTable : public FlatTable<Stone1exRecord> {
|
||||
using FlatTable< Stone1exRecord >::FlatTable;
|
||||
|
||||
static Stone1exTable serializeObject()
|
||||
static Stone1exTable serializationTestObject()
|
||||
{
|
||||
return Stone1exTable({Stone1exRecord{1.0}});
|
||||
}
|
||||
@@ -361,7 +433,7 @@ struct TlmixparRecord {
|
||||
struct TlmixparTable : public FlatTable< TlmixparRecord> {
|
||||
using FlatTable< TlmixparRecord >::FlatTable;
|
||||
|
||||
static TlmixparTable serializeObject()
|
||||
static TlmixparTable serializationTestObject()
|
||||
{
|
||||
return TlmixparTable({{1.0, 2.0}});
|
||||
}
|
||||
@@ -389,7 +461,7 @@ struct VISCREFRecord {
|
||||
struct ViscrefTable : public FlatTable< VISCREFRecord > {
|
||||
using FlatTable< VISCREFRecord >::FlatTable;
|
||||
|
||||
static ViscrefTable serializeObject()
|
||||
static ViscrefTable serializationTestObject()
|
||||
{
|
||||
return ViscrefTable({{1.0, 2.0}});
|
||||
}
|
||||
@@ -420,12 +492,95 @@ struct WATDENTRecord {
|
||||
struct WatdentTable : public FlatTable< WATDENTRecord > {
|
||||
using FlatTable< WATDENTRecord >::FlatTable;
|
||||
|
||||
static WatdentTable serializeObject()
|
||||
static WatdentTable serializationTestObject()
|
||||
{
|
||||
return WatdentTable({{1.0, 2.0, 3.0}});
|
||||
}
|
||||
};
|
||||
|
||||
struct SatFuncLETRecord {
|
||||
static constexpr std::size_t size = 17;
|
||||
|
||||
double s1_residual;
|
||||
double s1_critical;
|
||||
double l1_relperm;
|
||||
double e1_relperm;
|
||||
double t1_relperm;
|
||||
double krt1_relperm;
|
||||
double s2_residual;
|
||||
double s2_critical;
|
||||
double l2_relperm;
|
||||
double e2_relperm;
|
||||
double t2_relperm;
|
||||
double krt2_relperm;
|
||||
double l_pc;
|
||||
double e_pc;
|
||||
double t_pc;
|
||||
double pcir_pc;
|
||||
double pct_pc;
|
||||
|
||||
bool operator==(const SatFuncLETRecord& data) const {
|
||||
return s1_residual == data.s1_residual &&
|
||||
s1_critical == data.s1_critical &&
|
||||
l1_relperm == data.l1_relperm &&
|
||||
e1_relperm == data.e1_relperm &&
|
||||
t1_relperm == data.t1_relperm &&
|
||||
krt1_relperm == data.krt1_relperm &&
|
||||
s2_residual == data.s2_residual &&
|
||||
s2_critical == data.s2_critical &&
|
||||
l2_relperm == data.l2_relperm &&
|
||||
e2_relperm == data.e2_relperm &&
|
||||
t2_relperm == data.t2_relperm &&
|
||||
krt2_relperm == data.krt2_relperm &&
|
||||
l_pc == data.l_pc &&
|
||||
e_pc == data.e_pc &&
|
||||
t_pc == data.t_pc &&
|
||||
pcir_pc == data.pcir_pc &&
|
||||
pct_pc == data.pct_pc;
|
||||
}
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(s1_residual);
|
||||
serializer(s1_critical);
|
||||
serializer(l1_relperm);
|
||||
serializer(e1_relperm);
|
||||
serializer(t1_relperm);
|
||||
serializer(krt1_relperm);
|
||||
serializer(s2_residual);
|
||||
serializer(s2_critical);
|
||||
serializer(l2_relperm);
|
||||
serializer(e2_relperm);
|
||||
serializer(t2_relperm);
|
||||
serializer(krt2_relperm);
|
||||
serializer(l_pc);
|
||||
serializer(e_pc);
|
||||
serializer(t_pc);
|
||||
serializer(pcir_pc);
|
||||
serializer(pct_pc);
|
||||
}
|
||||
};
|
||||
|
||||
struct SwofletTable : public FlatTable< SatFuncLETRecord > {
|
||||
using FlatTable< SatFuncLETRecord >::FlatTable;
|
||||
|
||||
static SwofletTable serializationTestObject()
|
||||
{
|
||||
return SwofletTable({{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0}});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct SgofletTable : public FlatTable< SatFuncLETRecord > {
|
||||
using FlatTable< SatFuncLETRecord >::FlatTable;
|
||||
|
||||
static SgofletTable serializationTestObject()
|
||||
{
|
||||
return SgofletTable({{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0}});
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //OPM_FLAT_TABLE_HPP
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Opm {
|
||||
|
||||
class FoamadsTable : public SimpleTable {
|
||||
public:
|
||||
FoamadsTable( const DeckItem& item );
|
||||
FoamadsTable( const DeckItem& item, const int tableID );
|
||||
|
||||
const TableColumn& getFoamConcentrationColumn() const;
|
||||
const TableColumn& getAdsorbedFoamColumn() const;
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Opm {
|
||||
|
||||
class FoammobTable : public SimpleTable {
|
||||
public:
|
||||
FoammobTable( const DeckItem& item );
|
||||
FoammobTable( const DeckItem& item, const int tableID );
|
||||
|
||||
const TableColumn& getFoamConcentrationColumn() const;
|
||||
const TableColumn& getMobilityMultiplierColumn() const;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Opm {
|
||||
|
||||
class ImkrvdTable : public SimpleTable {
|
||||
public:
|
||||
ImkrvdTable( const DeckItem& item );
|
||||
ImkrvdTable( const DeckItem& item, const int tableID );
|
||||
|
||||
/*!
|
||||
* \brief The datum depth for the remaining columns
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Opm {
|
||||
class ImptvdTable : public SimpleTable {
|
||||
public:
|
||||
|
||||
ImptvdTable( const DeckItem& item );
|
||||
ImptvdTable( const DeckItem& item, const int tableID );
|
||||
|
||||
const TableColumn& getDepthColumn() const;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
JFunc();
|
||||
explicit JFunc(const Deck& deck);
|
||||
|
||||
static JFunc serializeObject();
|
||||
static JFunc serializationTestObject();
|
||||
|
||||
double alphaFactor() const;
|
||||
double betaFactor() const;
|
||||
|
||||
70
opm/input/eclipse/EclipseState/Tables/JouleThomson.hpp
Normal file
70
opm/input/eclipse/EclipseState/Tables/JouleThomson.hpp
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
Copyright (C) 2020 by Equinor
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef OPM_PARSER_JOULETHOMSON_HPP
|
||||
#define OPM_PARSER_JOULETHOMSON_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class DeckKeyword;
|
||||
class DeckRecord;
|
||||
|
||||
class JouleThomson {
|
||||
public:
|
||||
|
||||
struct entry {
|
||||
double P0;
|
||||
double C1;
|
||||
|
||||
entry() = default;
|
||||
entry(double P0_, double C1_);
|
||||
explicit entry(const DeckRecord& record);
|
||||
bool operator==(const entry& other) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(P0);
|
||||
serializer(C1);
|
||||
}
|
||||
};
|
||||
|
||||
JouleThomson() = default;
|
||||
explicit JouleThomson(const DeckKeyword& keyword);
|
||||
|
||||
static JouleThomson serializationTestObject();
|
||||
|
||||
const entry& operator[](const std::size_t index) const;
|
||||
bool operator==(const JouleThomson& other) const;
|
||||
std::size_t size() const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(m_records);
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<entry> m_records;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -28,7 +28,7 @@ namespace Opm {
|
||||
|
||||
class MiscTable : public SimpleTable {
|
||||
public:
|
||||
explicit MiscTable( const DeckItem& item );
|
||||
MiscTable( const DeckItem& item, const int tableID );
|
||||
|
||||
const TableColumn& getSolventFractionColumn() const;
|
||||
const TableColumn& getMiscibilityColumn() const;
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Opm {
|
||||
|
||||
class MsfnTable : public SimpleTable {
|
||||
public:
|
||||
explicit MsfnTable( const DeckItem& item );
|
||||
MsfnTable( const DeckItem& item, const int tableID );
|
||||
|
||||
const TableColumn& getGasPhaseFractionColumn() const;
|
||||
const TableColumn& getGasSolventRelpermMultiplierColumn() const;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Opm {
|
||||
|
||||
class OilvisctTable : public SimpleTable {
|
||||
public:
|
||||
OilvisctTable( const DeckItem& item );
|
||||
OilvisctTable( const DeckItem& item, const int tableID );
|
||||
|
||||
const TableColumn& getTemperatureColumn() const;
|
||||
const TableColumn& getOilViscosityColumn() const;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user