Compare commits

..

73 Commits

Author SHA1 Message Date
Markus Blatt
a30fcddfd4 Update release version to final 2019.10 2019-11-18 08:59:20 +01:00
Markus Blatt
edbf93e762 Bump version to 2019.10-rc4 2019-11-11 20:45:19 +01:00
Markus Blatt
f8e6aa595b Merge pull request #1215 from blattms/backport-of-pr-1068
improvements related to Aquifer modeling (Backport of pr #1068)
2019-11-11 20:03:31 +01:00
Kai Bao
78a2aa5c3e addressing reviewing comments from PR #1068 2019-11-11 14:46:00 +01:00
Kai Bao
109c9bb256 an aquifer connection need to between active and inactive cells
unless we specify we want to have aquifer within the inner cell of the
reservoir.
2019-11-11 14:44:53 +01:00
Kai Bao
d9968f6380 correcting the definition of keyword AQUFETP
default_value looks like not working in term of specifying default value
for the item.
2019-11-11 12:52:15 +01:00
Markus Blatt
1ba0a174db Merge pull request #1214 from blattms/backport-of-pr-1113
Apply MULTZ also in the edit section (backport of #1113)
2019-11-11 12:48:31 +01:00
Tor Harald Sandve
5b317b856b Apply MULTZ also in the edit section 2019-11-11 10:01:07 +01:00
Markus Blatt
ef6f42d457 Bump version to 2019.10-rc3 2019-11-04 12:34:46 +01:00
Markus Blatt
69a0a31309 Merge pull request #1183 from blattms/backport-of-pr-1176
Added changelog 2019.10 release (Backport of pr #1176)
2019-10-30 21:58:22 +01:00
Joakim Hove
3be35ec286 Add bullet point about Eclipse restart capabilities 2019-10-30 21:55:45 +01:00
Markus Blatt
0469d28fa2 Skipped python and restart in changelog 2019-10-30 21:55:45 +01:00
Markus Blatt
7cd7c7a158 Added entries to changelog concerning 2019.10 release 2019-10-30 21:55:45 +01:00
Markus Blatt
7bc1fc8362 Merge pull request #1172 from blattms/backport-of-pr-1171
update redhat packaging (backport of PR #1171)
2019-10-28 12:38:13 +01:00
Arne Morten Kvarving
b573c28594 update redhat packaging 2019-10-28 12:36:22 +01:00
Markus Blatt
693c4607c8 Merge pull request #1161 from akva2/2019.10_rc2
bump version to 2019.10-rc2
2019-10-25 14:06:59 +02:00
Arne Morten Kvarving
1c17a5daed bump version to 2019.10-rc2 2019-10-25 08:33:05 +02:00
Markus Blatt
edee59df30 Merge pull request #1160 from blattms/backport-of-pr-1158
Keywords on Q (backport of PR #1158)
2019-10-24 19:51:01 +02:00
Joakim Hove
c5fcbf2084 Keywords on Q 2019-10-24 19:38:43 +02:00
Markus Blatt
8e860c4b7a Merge pull request #1159 from blattms/backport-of-pr-1154
added more keywords beginning with M. (backport of #1154)
2019-10-24 19:37:42 +02:00
Steinar Foss
ad9fbfe4ea added more keywords beginning with M.
added keywords MULTOUTS, MULTREAL, MULTREGD.

added keywords MULTREGH, MULTSIG, MULTSIGV.

added keywords NARROW, NCONSUMP, NEFAC.
2019-10-24 19:22:54 +02:00
Markus Blatt
53fff6bb3f Merge pull request #1155 from blattms/backport-of-pr-1149
fixing severe performance issue with ESmry (backport of PR #1149)
2019-10-24 13:08:01 +02:00
Torbjørn Skille
8e23316eba fixing severe performance issue with ESmry 2019-10-24 12:07:39 +02:00
Markus Blatt
d4e6c9ec44 Merge pull request #1147 from blattms/backport-of-pr-1142
Multiply MULT(XYZ) keywords in the EDIT section (backport of #1142)
2019-10-22 19:58:36 +02:00
Joakim Hove
ae9712232e Multiply MULT(XYZ) keywords in the EDIT section 2019-10-22 19:43:34 +02:00
Markus Blatt
d376ee9ed4 Merge pull request #1140 from blattms/backport-of-pr-1128
Exc warning (Backport of pr #1128)
2019-10-21 08:48:32 +02:00
Joakim Hove
1067b66696 Use const& to avoiw warnings 2019-10-21 08:44:17 +02:00
Joakim Hove
ac43482944 Remove trailing whitespace 2019-10-21 08:44:17 +02:00
Markus Blatt
3ca39f2e62 Merge pull request #1139 from blattms/backport-of-pr-1096
Some janitoring (partial backport of pr #1096)
2019-10-21 08:36:27 +02:00
Arne Morten Kvarving
aaaa22e279 remove noop explicit template instantation after specialization 2019-10-21 08:29:19 +02:00
Arne Morten Kvarving
646d263883 avoid returning uninitialized result if wrong indices are given 2019-10-21 08:29:19 +02:00
Arne Morten Kvarving
f1e0dcea81 remove unused assignment 2019-10-21 08:29:19 +02:00
Arne Morten Kvarving
7b3b26c452 remove unused initialization 2019-10-21 08:29:19 +02:00
Arne Morten Kvarving
5f9d67a6eb remove unused variable 2019-10-21 08:27:35 +02:00
Arne Morten Kvarving
8e44ca1b2c remove unused function 2019-10-21 08:27:35 +02:00
Markus Blatt
89e2ebd5f9 Merge pull request #1137 from blattms/backport-of-pr-1119
Added keywords beginning w/ M. (backport of PR #1119)
2019-10-21 07:55:12 +02:00
Steinar Foss
06287e8631 Added keywords beginning w/ M.
added keywords MINPORV, MLANG, MLANGSLV.
2019-10-20 12:13:36 +02:00
Markus Blatt
4cd26c5f9a Merge pull request #1136 from blattms/backport-of-pr-1101
Add keywords starting with R (backport of #1101)
2019-10-20 12:11:00 +02:00
Joakim Hove
d4ce9fe909 Add keywords starting with R 2019-10-20 11:23:17 +02:00
Markus Blatt
7ee05a9ceb Merge pull request #1135 from blattms/backport-of-pr-1109
added keywords beginning w/ L. (backport of #1099)
2019-10-20 11:20:48 +02:00
Steinar Foss
8a9814ad16 added keywords beginning w/ L.
added keywords LSLTWNUM, LSNUM, LSOGCR.

added keywords LSOWCR, LSWCR, LSWL.

LSWLPC, LSWU, LTOSIGMA.

added keywords LWKRO, LWKRORG, LWKRORW.

added keywords LWKRW, LWKRWR, LWPCW.

LWSLTNUM, LWSNUM, LWSOGCR.

added keywords LWSOWCR, LWSWCR, LWSWL.

added keywords LWSWLPC, LWSWU, LX.

added keywords LY, LZ, MATCORR.

...
2019-10-20 11:17:45 +02:00
Markus Blatt
96b7bb65e2 Merge pull request #1134 from blattms/backport-of-pr-1099
added keywords beginning w/ I, J, K and L. (backport of PR #1099)
2019-10-20 11:09:25 +02:00
Steinar Foss
4761fe724b added keywords beginning w/ I, J, K and L.
added keyword JFUNCR.

added keywords KRNUN, KRNUMMF.

added keywords LANGMPL, LANGMUIR, LANGSOLV.

added keywords LGRCOPY, LGRFREE, LGRLOCK.

added keywords LGROFF, LGRON, LINKPERM.

added keywords LKRO, LKRORG, LKRORW.

added keywords LKRW, LKRWR, LOAD.
2019-10-20 10:53:29 +02:00
Markus Blatt
8488efde1f Merge pull request #1126 from blattms/backport-of-pr-1125
Fix memory error during EclipseGrid creation with Actnum. (backport PR #1125)
2019-10-17 20:29:25 +02:00
Markus Blatt
3a89d05646 Fix memory error during EclipseGrid creation with Actnum.
We pass an int pointer to the function initCornerPointGrid.
With ACTNUM  this pointer was initialized with data pointer
of an int vector that we threw away before the function call
(otherwise it was null). To fix this we move the int-vector up one
scope.
2019-10-17 20:26:55 +02:00
Markus Blatt
0d3037383a Merge pull request #1120 from blattms/backport-of-pr-1116
fixed: build using gcc 5 (ubuntu xenial) (backport of PR #1116
2019-10-17 13:25:35 +02:00
Arne Morten Kvarving
de67ce4083 fixed: build using gcc 5 (ubuntu xenial)
the tuple-from-initializer-list constructor is explicit.
2019-10-17 13:21:25 +02:00
Markus Blatt
0fadb026af Merge pull request #1118 from blattms/backport-of-pr-1107
Decouple OPM Flow From Libecl  (Backport of pr #1107)
2019-10-17 13:08:52 +02:00
Bård Skaflestad
fe275a55fd Drop libecl From Python Setup
Suggested by [at]akva2.
2019-10-17 12:21:53 +02:00
Arne Morten Kvarving
a44febc314 remove libecl from buildsystem, jenkins and packaging 2019-10-17 12:21:53 +02:00
Bård Skaflestad
895c43dff0 Reimplement test_Restart in Terms of TimeStampUTC
Only affects the 'first_sim()' helper function.
2019-10-17 11:53:15 +02:00
Bård Skaflestad
e2ca798005 Reimplement test_EclipseIO in Terms of TimeStampUTC
Mostly just to provide a simple overload of the utility function

    ecl_util_make_date

from libecl.  The rest of the test code remains intact.
2019-10-17 11:53:15 +02:00
Bård Skaflestad
8fa07537fc Reimplement ScheduleTests in Terms of TimeStampUTC
Note that we have to reduce the year-range in the specific test

    createDeckWithDRSDTthenDRVDT

in order not to wrap around for system_clock.  This is a deficency of
the new time-service protocol.
2019-10-17 11:53:15 +02:00
Bård Skaflestad
7f9d250fd3 Reimplement TimeMap in Terms of TimeStampUTC 2019-10-17 11:53:15 +02:00
Bård Skaflestad
5eab9b003f Add Simple Time-Service Protocol
Mostly for converting between std::time_t and broken-down time
stamps.  Uses UTC and std::chrono::system_clock.  May wrap in as
little as 292 years, depending on the period of system_clock.

Intended to replace various timestamping utility functions from
libecl.  A comprehensive time-service protocol for Flow is much more
work than this, and will likely not be easily realized before we
have C++17 and its much expanded time/calendar library.
2019-10-17 11:53:15 +02:00
Bård Skaflestad
14625b3279 Defaulted Table Column: Don't Use 'ssize_t'
Instead, switch to 'int' for the 'before' and 'after' row indices.
The 'ssize_t' Posix type alias is not appropriate for this usage
since its range is only guaranteed to be [ -1 .. (1<<15)-1 ].
2019-10-17 11:53:15 +02:00
Bård Skaflestad
3cb23e6857 Reimplement 'test_EclipseIO' in Terms of Opm-Common Classes
In particular, use EGrid, ERst and EclFile as appropriate.
2019-10-17 11:53:15 +02:00
Markus Blatt
f8f1efc0ac Merge pull request #1111 from blattms/backport-of-pr-1110
Allow building a module with dependencies installed (backport of #1110)
2019-10-16 13:56:12 +02:00
Markus Blatt
6d92c1f5de Allow building a module with dependencies installed but source lying around.
If you set CMAKE_INSTALL_PREFIX, have the dependencies installed there, but
the source of them lying around in the parent directory of the build
directory, then the build will fail starting with opm-models because
we assume that ../opm-material is a build directory and set opm-material_DIR
to it. CMake will complain about not finding opm-material-config.cmake or
Opm-materialConfig.cmake. With this commit we will only set opm-material_DIR
if the directory contains a file CMakeCache.txt (which should be the case in
a configured build directory.

Directory outline of the failing situation is
- ${CMAKE_INSTALL_PREFIX} # where all dependencies are installed
- parent_dir
|____ opm-common #source dir
|____ opm-material #source dir
|____ ...
|____ build #build directory for current module (e.g. opm-modules)

Change is tested with sibling build

- build
|___ opm-common #build dir
|___ opm-material #build dir
|___ ...

and the dune version of it

- parent_dir
|___ opm-common # source dir
    |____ build # build dir opm-common

|___ opm-material # source dir
    |____ build # build dir opm-material
...
2019-10-16 13:52:47 +02:00
Markus Blatt
c68ec9c28b Merge pull request #1108 from blattms/backport-of-pr-1092
Update of ESmry, now supporting non-unified result files. (backport of PR #1092)
2019-10-16 09:47:38 +02:00
Torbjørn Skille
2dd6400d06 Update of ESmry, now supporting non-unified result files. 2019-10-16 09:12:02 +02:00
Markus Blatt
aa10ded01a Merge pull request #1104 from blattms/backport-of-pr-1094
Make RestartKey default contructable. (Backport of #1094)
2019-10-14 22:13:54 +02:00
Markus Blatt
edaa5ae561 Make RestartKey default contructable.
Otherwise we cannot even resize a vector of it and this will be needed
for restart when getting rid off the global grid on all processes.
2019-10-14 21:46:43 +02:00
Markus Blatt
aa56a40e8d Merge pull request #1103 from blattms/backport-pr-1088
Backport of pr #1088
2019-10-14 21:43:00 +02:00
Bård Skaflestad
2d7ba6a3c9 INTEHEAD Test: Initialize Maximum Number of Wells in Field
Fixes a warning about missing initializers.
2019-10-14 21:38:32 +02:00
Bård Skaflestad
6c397ff2a8 Make 'test_Restart' Mostly Independent of libecl
In particular, swith to using class EclIO::ERst to read the files
produced by RestartIO::save().
2019-10-14 21:29:27 +02:00
Bård Skaflestad
c83feddb28 Make 'test_Summary' Independent of LibeECL
This commit switches the 'test_Summary' unit test to use class ESmry
for inspecting the values output to disk by 'out::Summary'.  As a
consequence, we are not able to verify units of measure for the
parameters, at least not for the time being.  Moreover, class ESmry
exclusively uses the "i,j,k" sub-key for block-related parameters so
switch those to reference the IJK identifiers.

Finally, as class ESmry currently does not support reading separate
(multiple) summary files, switch the input decks to generate unified
output.
2019-10-14 21:29:27 +02:00
Bård Skaflestad
6d9deefb29 Make Most Unit Tests Independent of LibECL
This commit switches a set of OPM-Common's unit tests away from
using direct calls to libecl functions and into using base types
from OPM-Common itself (along with Boost.Filesystem).

In particular summary related queries are replaced by calls to ESmry
member functions (wrapped in libecl-like interfaces to minimise code
changes).  We disable checks on unit strings since ESmry currently
does not have a way of associating those with individual variables.
2019-10-14 21:29:27 +02:00
Bård Skaflestad
afaa99d3f4 Decouple Most of OPM-Common From LibECL
This commit takes a pass at the implementation files in opm-common
and removes references to libecl functions where practical.  In
particular we switch to using types from C++'s standard library (and
Boost.Filesystem) to achieve the effects of the interfaces being
replaced.

We also insert direct calls to Posix function fnmatch() to preserve
existing pattern matching behaviour (well lists and well templates).
2019-10-14 21:29:27 +02:00
Bård Skaflestad
c69a111e7a ESmry: Add Way of Retrieving Ministep Index at Start of Report Step
This commit introduces a new member function

    int ESmry::miniStepIdxAtReportStep(rptStep)

which returns the zero-based ministep corresponding to the start of
the given report step (one-based indexing).  This will simplify
decoupling a few unit tests from libecl.
2019-10-14 21:29:27 +02:00
Markus Blatt
112e698d0a Merge pull request #1102 from blattms/backport-pr-1082
Backport PR #1082
2019-10-14 21:12:11 +02:00
Bård Skaflestad
7dffd9f2e7 Replace Writer for Summary/SMSPEC Files
This commit replaces the existing system for writing summary and
specification (SMSPEC) files with a new implementation based on
class EclOutput.  We package the evaluators of individual parameters
in a set of classes determined by the parameter's category which
each implement a virtual 'update()' function.  This update function
ultimately writes new values into a SummaryState object.

Add a factory-like system for instantiating the appropriate class
depending on a SummaryNode's 'category()'.  Also, add a helper class
for managing the parameters that a configured in a simulation
model's SUMMARY section in order to distinguish these from those
parameters that are merely needed for restart purposes.  The summary
class's 'eval()' function then becomes a loop over the evaluators
for parameters in SUMMARY followed by a loop over the evaluators for
restart vectors.

We reimplement the 'internal_store()' function in terms of an
std::vector of a helper structure 'MiniStep' which holds a ministep
ID (contiguous counter started at zero), a report step ID, and all
the evaluated parameters of this ministep.  The final write function
then consists of outputting those ministep structures that have
accumulated since the previous call to write().  If a simulation
does not call write at all, then this will accumulate all parameters
for all ministeps throughout the simulation history.

We create the SMSPEC file at most once, and write to it at most each
report step.  We create the summary file once (if unified) or at
each report step (if separate).
2019-10-14 20:47:36 +02:00
Bård Skaflestad
a3f2c115f1 SMSPEC: Temporarily Restore Unconditional RESTART Vector
Needed to ensure we create the same summary/specification files as
the existing system.  We will revert this change once the new system
is in place and we can afford to update the reference solutions.
2019-10-14 20:47:36 +02:00
1784 changed files with 26171 additions and 153313 deletions

View File

@@ -9,9 +9,9 @@ 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_ENABLE_EMBEDDED_PYTHON "Enable python bindings?" OFF)
# Output implies input
if(ENABLE_ECL_OUTPUT)
set(ENABLE_ECL_INPUT ON)
@@ -53,7 +53,6 @@ endif()
# we cannot generate dune.module since it is read by dunecontrol before
# the build starts, so it makes sense to keep the data there then.
include (OpmInit)
OpmSetPolicies()
# Look for the opm-tests repository; if found the variable
# HAVE_OPM_TESTS will be set to true.
@@ -111,10 +110,7 @@ macro (sources_hook)
include(GenerateKeywords.cmake)
# Append generated sources
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)
endforeach()
list(APPEND opm-common_SOURCES ${PROJECT_BINARY_DIR}/ParserKeywords.cpp)
endif()
set_source_files_properties(src/opm/parser/eclipse/Python/Python.cpp
PROPERTIES COMPILE_FLAGS -Wno-shadow)
@@ -138,21 +134,6 @@ macro (install_hook)
PATTERN *.hpp)
endmacro (install_hook)
# 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
# manually adding to the opm-common_LIBRARIES variable here, and not in the
# OpmnLibMain function. Here only the library dependency is implemented, the
# bulk of the python configuration is further down in the file.
if (OPM_ENABLE_PYTHON)
find_package(PythonInterp REQUIRED)
if (OPM_ENABLE_EMBEDDED_PYTHON)
find_package(PythonLibs REQUIRED)
list(APPEND opm-common_LIBRARIES ${PYTHON_LIBRARY})
endif()
endif()
# all setup common to the OPM library modules is done here
include (OpmLibMain)
@@ -164,17 +145,14 @@ if (ENABLE_MOCKSIM)
add_executable(msim examples/msim.cpp)
target_link_libraries(msim mocksim)
if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
set(_libs mocksim opmcommon
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
set(_libs mocksim opmcommon
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
foreach( test test_msim test_msim_ACTIONX test_msim_EXIT)
opm_add_test(${test} SOURCES tests/msim/${test}.cpp
LIBRARIES ${_libs}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests
CONDITION ${HAVE_ECL_INPUT})
endforeach()
endif()
foreach( test test_msim test_msim_ACTIONX )
opm_add_test(${test} SOURCES tests/msim/${test}.cpp
LIBRARIES ${_libs}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests)
endforeach()
endif()
# Build the compare utilities
@@ -189,15 +167,7 @@ if(ENABLE_ECL_INPUT)
test_util/convertECL.cpp
)
add_executable(summary
test_util/summary.cpp
)
add_executable(test_esmry_lod
test_util/test_esmry_lod.cpp
)
foreach(target compareECL convertECL summary test_esmry_lod)
foreach(target compareECL convertECL)
target_link_libraries(${target} opmcommon)
install(TARGETS ${target} DESTINATION bin)
endforeach()
@@ -208,7 +178,7 @@ if(ENABLE_ECL_INPUT)
opm_add_test(test_EclFilesComparator
CONDITION
ENABLE_ECL_INPUT AND Boost_UNIT_TEST_FRAMEWORK_FOUND
ENABLE_ECL_INPUT
SOURCES
tests/test_EclFilesComparator.cpp
test_util/EclFilesComparator.cpp
@@ -220,7 +190,7 @@ if(ENABLE_ECL_INPUT)
opm_add_test(test_EclRegressionTest
CONDITION
ENABLE_ECL_INPUT AND Boost_UNIT_TEST_FRAMEWORK_FOUND
ENABLE_ECL_INPUT
SOURCES
tests/test_EclRegressionTest.cpp
test_util/EclFilesComparator.cpp
@@ -232,7 +202,7 @@ if(ENABLE_ECL_INPUT)
)
foreach(test test_EclIO test_EGrid test_ERft test_ERst test_ESmry)
opm_add_test(${test} CONDITION ENABLE_ECL_INPUT AND Boost_UNIT_TEST_FRAMEWORK_FOUND
opm_add_test(${test} CONDITION ENABLE_ECL_INPUT
LIBRARIES ${_libs}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests)
endforeach()
@@ -247,98 +217,67 @@ install(FILES etc/opm_bash_completion.sh.in DESTINATION share/opm/etc)
if (OPM_ENABLE_PYTHON)
# -------------------------------------------------------------------------
# 1: Wrap C++ functionality in Python
if (EXISTS "/etc/debian_version")
set(PYTHON_PACKAGE_PATH "dist-packages")
else()
set(PYTHON_PACKAGE_PATH "site-packages")
endif()
find_package(PythonInterp REQUIRED)
include(FindPythonInterp)
make_directory(${CMAKE_BINARY_DIR}/python)
set(PYTHON_PACKAGE_PATH "site-packages")
set(PYTHON_INSTALL_PREFIX "lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/${PYTHON_PACKAGE_PATH}" CACHE STRING "Subdirectory to install Python modules in")
make_directory(${PROJECT_BINARY_DIR}/python)
get_target_property(_opmcommon_include_dirs opmcommon INCLUDE_DIRECTORIES)
list(APPEND _opmcommon_include_dirs ${_ecl_include_dirs})
string(REPLACE ";" ":" _setup_include_dirs "${_opmcommon_include_dirs}")
if (CMAKE_PREFIX_PATH)
set(_opmcommon_lib_dirs ${PROJECT_BINARY_DIR}/lib ${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR})
else()
set(_opmcommon_lib_dirs ${PROJECT_BINARY_DIR}/lib)
endif()
set(_opmcommon_lib_dirs ${CMAKE_BINARY_DIR}/lib ${CMAKE_PREFIX_PATH}/lib)
string(REPLACE ";" ":" _setup_lib_dirs "${_opmcommon_lib_dirs}")
if (USE_RUNPATH)
set (_python_rpath_list)
if (CMAKE_PREFIX_PATH)
foreach(path ${CMAKE_PREFIX_PATH})
list(APPEND _python_rpath_list "${path}/${CMAKE_INSTALL_LIBDIR}")
endforeach()
endif()
if (BUILD_SHARED_LIBS)
list(APPEND _python_rpath_list "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
endif()
if (_python_rpath_list)
string(REPLACE ";" ":" _rpath "${_python_rpath_list}")
set( _rpath_arg "--rpath=${_rpath}")
else()
set(_rpath_arg "")
endif()
else()
set( _rpath_arg "")
endif()
execute_process(COMMAND ${PYTHON_EXECUTABLE} target_name.py
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/python
OUTPUT_VARIABLE python_lib_target)
add_custom_target(copy_python ALL
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/python/install.py ${PROJECT_SOURCE_DIR}/python ${PROJECT_BINARY_DIR} 0)
add_custom_command(OUTPUT python/python/opm/${python_lib_target}
DEPENDS ${PYTHON_CXX_DEPENDS}
DEPENDS copy_python
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/python/setup.py
add_custom_command(OUTPUT python/python/opm/libopmcommon_python.so
DEPENDS
python/cxx/connection.cpp
python/cxx/converters.hpp
python/cxx/deck.cpp
python/cxx/deck_keyword.cpp
python/cxx/eclipse_3d_properties.cpp
python/cxx/eclipse_config.cpp
python/cxx/eclipse_grid.cpp
python/cxx/eclipse_state.cpp
python/cxx/group.cpp
python/cxx/log.cpp
python/cxx/parsecontext.cpp
python/cxx/parser.cpp
python/cxx/schedule.cpp
python/cxx/export.cpp
python/cxx/export.hpp
python/cxx/common_state.cpp
python/cxx/common_state.hpp
python/cxx/table_manager.cpp
python/cxx/well.cpp
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/python/ ${CMAKE_BINARY_DIR}/python
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/python/setup.py
build
build_ext
--build-lib=${PROJECT_BINARY_DIR}/python/python/opm
--build-lib=${CMAKE_BINARY_DIR}/python/python/opm
--library-dirs=${_setup_lib_dirs}
${_rpath_arg}
--include-dirs=${_setup_include_dirs}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/python
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/python
COMMENT "Building python bindings")
add_custom_target(opmcommon_python ALL DEPENDS python/python/opm/${python_lib_target})
add_custom_target(opmcommon_python ALL DEPENDS python/python/opm/libopmcommon_python.so)
add_dependencies(opmcommon_python opmcommon)
# The install target is based on manually copying the python file tree to the
# installation area with a small installation script 'install.py'. Would have
# preferred to use standard setup.py install, but the setup.py based solution
# refuses to install to a location which the current python executable can not
# load from, and the use of eggs in the setup.py based installation makes
# debugging quite difficult.
#
# Since the installation of Python code is nonstandard it is protected by an
# extra cmake switch, OPM_INSTALL_PYTHON. If you prefer you can still invoke
# setup.py install manually - optionally with the generated script
# setup-install.sh - and completely bypass cmake in the installation phase.
if (OPM_INSTALL_PYTHON)
install( CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/python/install.py ${PROJECT_BINARY_DIR}/python/python/opm ${DEST_PREFIX}${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_PREFIX} 1)")
endif()
install( CODE "execute_process(COMMAND mkdir -p ${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_PREFIX} )" )
install( CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} python/setup.py build_ext --dry-run install --prefix=${CMAKE_INSTALL_PREFIX} )" )
# Observe that if the opmcommon library has been built as a shared library the
# python library opmcommon_python will in general not find it runtime while
# testing.
add_test(NAME python_tests
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/python
COMMAND ${CMAKE_COMMAND} -E env LD_LIBRARY_PATH=${PROJECT_BINARY_DIR}/lib ${PYTHON_EXECUTABLE} setup.py build_ext --dry-run --build-lib ${PROJECT_BINARY_DIR}/python/python/opm test
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/python
COMMAND ${PYTHON_EXECUTABLE} setup.py build_ext --dry-run --build-lib ${CMAKE_BINARY_DIR}/python/python/opm test
)
set_target_properties(opmcommon PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${PROJECT_BINARY_DIR}/python/python)
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_BINARY_DIR}/python/python)
# -------------------------------------------------------------------------
# Let cmake configure some small shell scripts which can be used to simplify
# building, testing and installation of the Python extensions.
# building and testing of the Python extensions.
configure_file(python/setup-build.sh.in tmp/setup-build.sh)
file( COPY ${PROJECT_BINARY_DIR}/tmp/setup-build.sh
DESTINATION ${PROJECT_BINARY_DIR}
@@ -349,18 +288,13 @@ if (OPM_ENABLE_PYTHON)
DESTINATION ${PROJECT_BINARY_DIR}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE )
configure_file(python/setup-install.sh.in tmp/setup-install.sh)
file( COPY ${PROJECT_BINARY_DIR}/tmp/setup-install.sh
DESTINATION ${PROJECT_BINARY_DIR}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE )
configure_file(python/enable-python.sh.in enable-python.sh)
# -------------------------------------------------------------------------
# 2: Embed the Python interpreter for keywords like PYACTION and PYINPUT
if (OPM_ENABLE_EMBEDDED_PYTHON)
add_subdirectory(python/pybind11)
target_include_directories(opmcommon SYSTEM PRIVATE "python/pybind11/include;${PYTHON_INCLUDE_DIRS}")
target_include_directories(opmcommon PRIVATE "python/pybind11/include;${PYTHON_INCLUDE_DIRS}")
target_link_libraries(opmcommon PUBLIC ${PYTHON_LIBRARY})
add_definitions(-DEMBEDDED_PYTHON)

View File

@@ -30,8 +30,6 @@ list (APPEND MAIN_SOURCE_FILES
src/opm/common/OpmLog/OpmLog.cpp
src/opm/common/OpmLog/StreamLog.cpp
src/opm/common/OpmLog/TimerLog.cpp
src/opm/common/utility/ActiveGridCells.cpp
src/opm/common/utility/FileSystem.cpp
src/opm/common/utility/numeric/MonotCubicInterpolator.cpp
src/opm/common/utility/parameters/Parameter.cpp
src/opm/common/utility/parameters/ParameterGroup.cpp
@@ -41,7 +39,6 @@ list (APPEND MAIN_SOURCE_FILES
)
if(ENABLE_ECL_INPUT)
list(APPEND MAIN_SOURCE_FILES
src/opm/io/eclipse/SummaryNode.cpp
src/opm/json/JsonObject.cpp
src/opm/parser/eclipse/Deck/Deck.cpp
src/opm/parser/eclipse/Deck/DeckItem.cpp
@@ -49,21 +46,18 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/Deck/DeckKeyword.cpp
src/opm/parser/eclipse/Deck/DeckRecord.cpp
src/opm/parser/eclipse/Deck/DeckOutput.cpp
src/opm/parser/eclipse/Deck/DeckSection.cpp
src/opm/parser/eclipse/Deck/Section.cpp
src/opm/parser/eclipse/Deck/UDAValue.cpp
src/opm/parser/eclipse/Python/Python.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.cpp
src/opm/parser/eclipse/EclipseState/AquiferConfig.cpp
src/opm/parser/eclipse/EclipseState/AquiferCT.cpp
src/opm/parser/eclipse/EclipseState/Aquifetp.cpp
src/opm/parser/eclipse/EclipseState/Aquancon.cpp
src/opm/parser/eclipse/EclipseState/checkDeck.cpp
src/opm/parser/eclipse/EclipseState/Eclipse3DProperties.cpp
src/opm/parser/eclipse/EclipseState/EclipseConfig.cpp
src/opm/parser/eclipse/EclipseState/EclipseState.cpp
src/opm/parser/eclipse/EclipseState/EndpointScaling.cpp
src/opm/parser/eclipse/EclipseState/Edit/EDITNNC.cpp
src/opm/parser/eclipse/EclipseState/Grid/FieldProps.cpp
src/opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.cpp
src/opm/parser/eclipse/EclipseState/Grid/Box.cpp
src/opm/parser/eclipse/EclipseState/Grid/BoxManager.cpp
src/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp
@@ -72,9 +66,10 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/EclipseState/Grid/Fault.cpp
src/opm/parser/eclipse/EclipseState/Grid/FaultFace.cpp
src/opm/parser/eclipse/EclipseState/Grid/GridDims.cpp
src/opm/parser/eclipse/EclipseState/Grid/GridProperties.cpp
src/opm/parser/eclipse/EclipseState/Grid/GridProperty.cpp
src/opm/parser/eclipse/EclipseState/Grid/MULTREGTScanner.cpp
src/opm/parser/eclipse/EclipseState/Grid/NNC.cpp
src/opm/parser/eclipse/EclipseState/Grid/Operate.cpp
src/opm/parser/eclipse/EclipseState/Grid/PinchMode.cpp
src/opm/parser/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.cpp
src/opm/parser/eclipse/EclipseState/Grid/setKeywordBox.cpp
@@ -85,7 +80,6 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/EclipseState/IOConfig/IOConfig.cpp
src/opm/parser/eclipse/EclipseState/IOConfig/RestartConfig.cpp
src/opm/parser/eclipse/EclipseState/Runspec.cpp
src/opm/parser/eclipse/EclipseState/TracerConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionAST.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionContext.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.cpp
@@ -98,32 +92,26 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/EclipseState/Schedule/Action/Condition.cpp
src/opm/parser/eclipse/EclipseState/Schedule/ArrayDimChecker.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Events.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group/Group.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group/Group2.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateModel.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group/GConSale.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group/GConSump.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/injection.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MessageLimits.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/icd.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Compsegs.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/updatingConnectionsWithSegments.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/SpiralICD.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Valve.cpp
src/opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/RFTConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/RPTConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp
src/opm/parser/eclipse/EclipseState/Schedule/ScheduleTypes.cpp
src/opm/parser/eclipse/EclipseState/Schedule/SummaryState.cpp
src/opm/parser/eclipse/EclipseState/Schedule/TimeMap.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Tuning.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/Connection.cpp
src/opm/parser/eclipse/EclipseState/Schedule/eval_uda.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/Well2.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WList.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.cpp
@@ -131,23 +119,18 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellFoamProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellPolymerProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellBrineProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellTracerProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellTestConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellTestState.cpp
src/opm/parser/eclipse/EclipseState/SimulationConfig/BCConfig.cpp
src/opm/parser/eclipse/EclipseState/SimulationConfig/RockConfig.cpp
src/opm/parser/eclipse/EclipseState/SimulationConfig/SimulationConfig.cpp
src/opm/parser/eclipse/EclipseState/SimulationConfig/ThresholdPressure.cpp
src/opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.cpp
src/opm/parser/eclipse/EclipseState/Tables/ColumnSchema.cpp
src/opm/parser/eclipse/EclipseState/Tables/DenT.cpp
src/opm/parser/eclipse/EclipseState/Tables/JFunc.cpp
src/opm/parser/eclipse/EclipseState/Tables/PvtxTable.cpp
src/opm/parser/eclipse/EclipseState/Tables/SimpleTable.cpp
src/opm/parser/eclipse/EclipseState/Tables/PolyInjTables.cpp
src/opm/parser/eclipse/EclipseState/Tables/StandardCond.cpp
src/opm/parser/eclipse/EclipseState/Tables/TableColumn.cpp
src/opm/parser/eclipse/EclipseState/Tables/TableContainer.cpp
src/opm/parser/eclipse/EclipseState/Tables/TableIndex.cpp
@@ -156,9 +139,6 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp
src/opm/parser/eclipse/EclipseState/Tables/Rock2dTable.cpp
src/opm/parser/eclipse/EclipseState/Tables/Rock2dtrTable.cpp
src/opm/parser/eclipse/EclipseState/Tables/PvtwsaltTable.cpp
src/opm/parser/eclipse/EclipseState/Tables/BrineDensityTable.cpp
src/opm/parser/eclipse/EclipseState/Tables/SolventDensityTable.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQASTNode.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParser.cpp
@@ -190,46 +170,31 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/Utility/Stringview.cpp
)
# This list is only used to register a CMake dependency between the the python
# extension and the corresponding C++ wrapper files. The cpp files actually
# listed here are repeated in the actual definition of the extension in the
# setup.py file.
list( APPEND PYTHON_CXX_SOURCE_FILES
if (OPM_ENABLE_EMBEDDED_PYTHON)
list( APPEND PYTHON_SOURCE_FILES
src/opm/parser/eclipse/Python/PythonInterp.cpp
python/cxx/connection.cpp
python/cxx/converters.cpp
python/cxx/deck.cpp
python/cxx/deck_keyword.cpp
python/cxx/eclipse_io.cpp
python/cxx/field_props.cpp
python/cxx/eclipse_3d_properties.cpp
python/cxx/eclipse_config.cpp
python/cxx/eclipse_grid.cpp
python/cxx/eclipse_state.cpp
python/cxx/export.cpp
python/cxx/group.cpp
python/cxx/log.cpp
python/cxx/parsecontext.cpp
python/cxx/parser.cpp
python/cxx/schedule.cpp
python/cxx/summary_state.cpp
python/cxx/export.cpp
python/cxx/common_state.cpp
python/cxx/table_manager.cpp
python/cxx/unit_system.cpp
python/cxx/well.cpp
python/cxx/log.cpp
)
if (OPM_ENABLE_EMBEDDED_PYTHON)
set_source_files_properties(${PYTHON_CXX_SOURCE_FILES} PROPERTIES COMPILE_FLAGS -Wno-shadow)
set_source_files_properties(src/opm/parser/eclipse/Python/PythonInterp.cpp PROPERTIES COMPILE_FLAGS -Wno-shadow)
set_source_files_properties(src/opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.cpp PROPERTIES COMPILE_FLAGS -Wno-shadow)
list( APPEND MAIN_SOURCE_FILES
src/opm/parser/eclipse/Python/PythonInterp.cpp
src/opm/parser/eclipse/Python/PyRunModule.cpp
${PYTHON_CXX_SOURCE_FILES})
set_source_files_properties(${PYTHON_SOURCE_FILES} PROPERTIES COMPILE_FLAGS -Wno-shadow)
list( APPEND MAIN_SOURCE_FILES ${PYTHON_SOURCE_FILES})
endif()
list( APPEND PYTHON_CXX_DEPENDS ${PYTHON_CXX_SOURCE_FILES}
python/cxx/converters.hpp
python/cxx/export.hpp)
if(NOT cjson_FOUND)
list(APPEND MAIN_SOURCE_FILES external/cjson/cJSON.c)
@@ -243,24 +208,13 @@ if(ENABLE_ECL_OUTPUT)
src/opm/io/eclipse/EGrid.cpp
src/opm/io/eclipse/ERft.cpp
src/opm/io/eclipse/ERst.cpp
src/opm/io/eclipse/ERsm.cpp
src/opm/io/eclipse/ESmry.cpp
src/opm/io/eclipse/ESmry_write_rsm.cpp
src/opm/io/eclipse/OutputStream.cpp
src/opm/io/eclipse/SummaryNode.cpp
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/segment.cpp
src/opm/io/eclipse/rst/state.cpp
src/opm/io/eclipse/rst/well.cpp
src/opm/output/eclipse/AggregateActionxData.cpp
src/opm/output/eclipse/AggregateConnectionData.cpp
src/opm/output/eclipse/AggregateGroupData.cpp
src/opm/output/eclipse/AggregateMSWData.cpp
src/opm/output/eclipse/AggregateUDQData.cpp
src/opm/output/eclipse/AggregateWellData.cpp
src/opm/output/eclipse/CreateActionxDims.cpp
src/opm/output/eclipse/CreateDoubHead.cpp
src/opm/output/eclipse/CreateInteHead.cpp
src/opm/output/eclipse/CreateLogiHead.cpp
@@ -279,14 +233,11 @@ if(ENABLE_ECL_OUTPUT)
src/opm/output/eclipse/RestartValue.cpp
src/opm/output/eclipse/WriteInit.cpp
src/opm/output/eclipse/WriteRFT.cpp
src/opm/output/eclipse/WriteRPT.cpp
src/opm/output/eclipse/report/WELSPECS.cpp
src/opm/output/data/Solution.cpp
)
endif()
list (APPEND TEST_SOURCE_FILES
tests/test_ActiveGridCells.cpp
tests/test_calculateCellVol.cpp
tests/test_cmp.cpp
tests/test_cubic.cpp
@@ -294,18 +245,18 @@ list (APPEND TEST_SOURCE_FILES
tests/test_nonuniformtablelinear.cpp
tests/test_OpmLog.cpp
tests/test_param.cpp
tests/test_RootFinders.cpp
tests/test_SimulationDataContainer.cpp
tests/test_sparsevector.cpp
tests/test_uniformtablelinear.cpp
)
if(ENABLE_ECL_INPUT)
list(APPEND TEST_SOURCE_FILES
tests/rst_test.cpp
tests/test_ERsm.cpp
tests/parser/ACTIONX.cpp
tests/parser/ADDREGTests.cpp
tests/parser/AquiferTests.cpp
tests/parser/AquiferCTTests.cpp
tests/parser/AquifetpTests.cpp
tests/parser/AqudimsTests.cpp
tests/parser/AquanconTests.cpp
tests/parser/BoxTests.cpp
tests/parser/ColumnSchemaTests.cpp
tests/parser/ConnectionTests.cpp
@@ -315,16 +266,17 @@ if(ENABLE_ECL_INPUT)
tests/parser/DeckTests.cpp
tests/parser/DynamicStateTests.cpp
tests/parser/DynamicVectorTests.cpp
tests/parser/Eclipse3DPropertiesTests.cpp
tests/parser/EclipseGridTests.cpp
tests/parser/EmbeddedPython.cpp
tests/parser/EqualRegTests.cpp
tests/parser/EventTests.cpp
tests/parser/FaceDirTests.cpp
tests/parser/FaultTests.cpp
tests/parser/FieldPropsTests.cpp
tests/parser/FoamTests.cpp
tests/parser/FunctionalTests.cpp
tests/parser/GeomodifierTests.cpp
tests/parser/GridPropertyTests.cpp
tests/parser/GroupTests.cpp
tests/parser/InitConfigTest.cpp
tests/parser/IOConfigTests.cpp
@@ -337,15 +289,13 @@ if(ENABLE_ECL_INPUT)
tests/parser/ParseContext_EXIT1.cpp
tests/parser/ParseDATAWithDefault.cpp
tests/parser/PYACTION.cpp
tests/parser/PORVTests.cpp
tests/parser/RawKeywordTests.cpp
tests/parser/test_ReportConfig.cpp
tests/parser/ResinsightTest.cpp
tests/parser/RestartConfigTests.cpp
tests/parser/RFTConfigTests.cpp
tests/parser/RockTableTests.cpp
tests/parser/RunspecTests.cpp
tests/parser/SaltTableTests.cpp
tests/parser/ScheduleRestartTests.cpp
tests/parser/SatfuncPropertyInitializersTests.cpp
tests/parser/ScheduleTests.cpp
tests/parser/SectionTests.cpp
tests/parser/SimpleTableTests.cpp
@@ -360,7 +310,6 @@ if(ENABLE_ECL_INPUT)
tests/parser/TableSchemaTests.cpp
tests/parser/ThresholdPressureTest.cpp
tests/parser/TimeMapTest.cpp
tests/parser/TracerTests.cpp
tests/parser/TransMultTests.cpp
tests/parser/TuningTests.cpp
tests/parser/UDQTests.cpp
@@ -374,7 +323,6 @@ if(ENABLE_ECL_INPUT)
endif()
if(ENABLE_ECL_OUTPUT)
list (APPEND TEST_SOURCE_FILES
tests/test_AggregateActionxData.cpp
tests/test_AggregateWellData.cpp
tests/test_AggregateGroupData.cpp
tests/test_AggregateMSWData.cpp
@@ -391,10 +339,8 @@ if(ENABLE_ECL_OUTPUT)
tests/test_PaddedOutputString.cpp
tests/test_Restart.cpp
tests/test_RFT.cpp
tests/test_rst.cpp
tests/test_Solution.cpp
tests/test_Summary.cpp
tests/test_Summary_Group.cpp
tests/test_Tables.cpp
tests/test_Wells.cpp
tests/test_WindowedArray.cpp
@@ -409,9 +355,8 @@ if(ENABLE_ECL_OUTPUT)
list (APPEND TEST_DATA_FILES
tests/expect-wdims.chldg.err.out
tests/expect-wdims.err.out
tests/BASE_SIM.DATA
tests/BASE_SIM_THPRES.DATA
tests/RESTART_SIM.DATA
tests/FIRST_SIM.DATA
tests/FIRST_SIM_THPRES.DATA
tests/summary_deck.DATA
tests/group_group.DATA
tests/testblackoilstate3.DATA
@@ -425,27 +370,6 @@ if(ENABLE_ECL_OUTPUT)
tests/SPE9_CP_PACKED.DATA
tests/SOFR_TEST.DATA
tests/UDQ_TEST_WCONPROD_IUAD-2.DATA
tests/UDQ_ACTIONX_TEST1.DATA
tests/UDQ_ACTIONX_TEST1_U.DATA
tests/include_example_pvt.txt
tests/include_example_summary.txt
tests/include_sgof.txt
tests/include_swof.txt
tests/include_grid_3x5x4.grdecl
tests/SPE1CASE2.DATA
tests/SPE1CASE2_RESTART.DATA
tests/SPE1CASE2.X0060
tests/PYACTION.DATA
tests/act1.py
tests/MSW.DATA
tests/EXIT_TEST.DATA
tests/action_syntax_error.py
tests/action_missing_run.py
tests/EMBEDDED_PYTHON.DATA
tests/wclose.py
tests/msim/MSIM_PYACTION.DATA
tests/msim/action1.py
tests/msim/action2.py
)
endif()
@@ -465,8 +389,6 @@ if(ENABLE_ECL_INPUT)
tests/SPE1CASE1A.UNSMRY
tests/SPE1CASE1_RST60.SMSPEC
tests/SPE1CASE1_RST60.UNSMRY
tests/MODEL2_RESTART.DATA
tests/restart/MODEL2.UNRST
)
list (APPEND EXAMPLE_SOURCE_FILES
examples/opmi.cpp
@@ -498,12 +420,9 @@ list( APPEND PUBLIC_HEADER_FILES
opm/common/OpmLog/LogUtil.hpp
opm/common/OpmLog/MessageFormatter.hpp
opm/common/OpmLog/MessageLimiter.hpp
opm/common/OpmLog/Location.hpp
opm/common/OpmLog/OpmLog.hpp
opm/common/OpmLog/StreamLog.hpp
opm/common/OpmLog/TimerLog.hpp
opm/common/utility/ActiveGridCells.hpp
opm/common/utility/FileSystem.hpp
opm/common/utility/numeric/cmp.hpp
opm/common/utility/platform_dependent/disable_warnings.h
opm/common/utility/platform_dependent/reenable_warnings.h
@@ -523,16 +442,15 @@ list( APPEND PUBLIC_HEADER_FILES
opm/common/utility/parameters/ParameterStrings.hpp
opm/common/utility/parameters/ParameterTools.hpp
opm/common/utility/numeric/calculateCellVol.hpp
opm/common/utility/String.hpp
opm/common/utility/TimeService.hpp
)
if(ENABLE_ECL_INPUT)
list(APPEND PUBLIC_HEADER_FILES
opm/io/eclipse/SummaryNode.hpp
opm/json/JsonObject.hpp
opm/parser/eclipse/Utility/Stringview.hpp
opm/parser/eclipse/Utility/Functional.hpp
opm/parser/eclipse/Utility/Typetools.hpp
opm/parser/eclipse/Utility/String.hpp
opm/parser/eclipse/Generator/KeywordGenerator.hpp
opm/parser/eclipse/Generator/KeywordLoader.hpp
opm/parser/eclipse/Units/UnitSystem.hpp
@@ -557,24 +475,23 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Edit/EDITNNC.hpp
opm/parser/eclipse/EclipseState/Grid/GridDims.hpp
opm/parser/eclipse/EclipseState/Grid/TransMult.hpp
opm/parser/eclipse/EclipseState/Grid/GridProperties.hpp
opm/parser/eclipse/EclipseState/Grid/PinchMode.hpp
opm/parser/eclipse/EclipseState/Grid/MULTREGTScanner.hpp
opm/parser/eclipse/EclipseState/Grid/FaultCollection.hpp
opm/parser/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.hpp
opm/parser/eclipse/EclipseState/Grid/Fault.hpp
opm/parser/eclipse/EclipseState/Grid/Box.hpp
opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.hpp
opm/parser/eclipse/EclipseState/Grid/GridProperty.hpp
opm/parser/eclipse/EclipseState/Grid/FaultFace.hpp
opm/parser/eclipse/EclipseState/Grid/NNC.hpp
opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp
opm/parser/eclipse/EclipseState/Grid/BoxManager.hpp
opm/parser/eclipse/EclipseState/Grid/FaceDir.hpp
opm/parser/eclipse/EclipseState/Grid/MinpvMode.hpp
opm/parser/eclipse/EclipseState/Eclipse3DProperties.hpp
opm/parser/eclipse/EclipseState/EndpointScaling.hpp
opm/parser/eclipse/EclipseState/TracerConfig.hpp
opm/parser/eclipse/EclipseState/Tables/DenT.hpp
opm/parser/eclipse/EclipseState/Tables/SimpleTable.hpp
opm/parser/eclipse/EclipseState/Tables/StandardCond.hpp
opm/parser/eclipse/EclipseState/Tables/PolyInjTable.hpp
opm/parser/eclipse/EclipseState/Tables/PdvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/TlpmixpaTable.hpp
@@ -584,10 +501,6 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Tables/Regdims.hpp
opm/parser/eclipse/EclipseState/Tables/Eqldims.hpp
opm/parser/eclipse/EclipseState/Tables/SpecrockTable.hpp
opm/parser/eclipse/EclipseState/Tables/PvtwsaltTable.hpp
opm/parser/eclipse/EclipseState/Tables/BrineDensityTable.hpp
opm/parser/eclipse/EclipseState/Tables/SolventDensityTable.hpp
opm/parser/eclipse/EclipseState/Tables/SaltvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/PlydhflfTable.hpp
opm/parser/eclipse/EclipseState/Tables/PlymwinjTable.hpp
opm/parser/eclipse/EclipseState/Tables/PlyshlogTable.hpp
@@ -645,23 +558,18 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Tables/ImkrvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/Sof3Table.hpp
opm/parser/eclipse/EclipseState/Tables/SgofTable.hpp
opm/parser/eclipse/EclipseState/Tables/TracerVdTable.hpp
opm/parser/eclipse/EclipseState/EclipseState.hpp
opm/parser/eclipse/EclipseState/EclipseConfig.hpp
opm/parser/eclipse/EclipseState/Aquancon.hpp
opm/parser/eclipse/EclipseState/AquiferConfig.hpp
opm/parser/eclipse/EclipseState/AquiferCT.hpp
opm/parser/eclipse/EclipseState/Aquifetp.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/ActionAST.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/ActionContext.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/ActionValue.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/Actdims.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/Actions.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/ActionX.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/Condition.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/ASTNode.hpp
opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.hpp
opm/parser/eclipse/EclipseState/Schedule/ArrayDimChecker.hpp
opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp
opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.hpp
@@ -669,12 +577,11 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Schedule/Well/Connection.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/ProductionControls.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/InjectionControls.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WList.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellEconProductionLimits.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellFoamProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellBrineProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellPolymerProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp
@@ -685,38 +592,27 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Schedule/DynamicVector.hpp
opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp
opm/parser/eclipse/EclipseState/Schedule/RFTConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/RPTConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp
opm/parser/eclipse/EclipseState/Schedule/ScheduleTypes.hpp
opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/GConSale.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/GConSump.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateModel.hpp
opm/parser/eclipse/EclipseState/Schedule/MessageLimits.hpp
opm/parser/eclipse/EclipseState/Schedule/Events.hpp
opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/icd.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/updatingConnectionsWithSegments.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/SpiralICD.hpp
opm/parser/eclipse/EclipseState/SimulationConfig/ThresholdPressure.hpp
opm/parser/eclipse/EclipseState/SimulationConfig/BCConfig.hpp
opm/parser/eclipse/EclipseState/SimulationConfig/RockConfig.hpp
opm/parser/eclipse/EclipseState/SimulationConfig/SimulationConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/Valve.hpp
opm/parser/eclipse/EclipseState/IOConfig/RestartConfig.hpp
opm/parser/eclipse/EclipseState/IOConfig/IOConfig.hpp
opm/parser/eclipse/EclipseState/checkDeck.hpp
opm/parser/eclipse/EclipseState/Runspec.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQAssign.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQASTNode.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.hpp
@@ -729,13 +625,12 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunctionTable.hpp
opm/parser/eclipse/Deck/DeckItem.hpp
opm/parser/eclipse/Deck/Deck.hpp
opm/parser/eclipse/Deck/DeckSection.hpp
opm/parser/eclipse/Deck/Section.hpp
opm/parser/eclipse/Deck/DeckOutput.hpp
opm/parser/eclipse/Deck/DeckValue.hpp
opm/parser/eclipse/Deck/DeckKeyword.hpp
opm/parser/eclipse/Deck/DeckRecord.hpp
opm/parser/eclipse/Deck/UDAValue.hpp
opm/parser/eclipse/Deck/value_status.hpp
opm/parser/eclipse/Python/Python.hpp)
endif()
if(ENABLE_ECL_OUTPUT)
@@ -747,23 +642,12 @@ if(ENABLE_ECL_OUTPUT)
opm/io/eclipse/EGrid.hpp
opm/io/eclipse/ERft.hpp
opm/io/eclipse/ERst.hpp
opm/io/eclipse/ERsm.hpp
opm/io/eclipse/ESmry.hpp
opm/io/eclipse/PaddedOutputString.hpp
opm/io/eclipse/OutputStream.hpp
opm/io/eclipse/SummaryNode.hpp
opm/io/eclipse/rst/connection.hpp
opm/io/eclipse/rst/group.hpp
opm/io/eclipse/rst/header.hpp
opm/io/eclipse/rst/segment.hpp
opm/io/eclipse/rst/state.hpp
opm/io/eclipse/rst/well.hpp
opm/output/data/Aquifer.hpp
opm/output/data/Cells.hpp
opm/output/data/Solution.hpp
opm/output/data/Wells.hpp
opm/output/data/Groups.hpp
opm/output/eclipse/VectorItems/aquifer.hpp
opm/output/eclipse/VectorItems/connection.hpp
opm/output/eclipse/VectorItems/group.hpp
opm/output/eclipse/VectorItems/intehead.hpp
@@ -771,7 +655,6 @@ if(ENABLE_ECL_OUTPUT)
opm/output/eclipse/VectorItems/msw.hpp
opm/output/eclipse/VectorItems/tabdims.hpp
opm/output/eclipse/VectorItems/well.hpp
opm/output/eclipse/AggregateActionxData.hpp
opm/output/eclipse/AggregateGroupData.hpp
opm/output/eclipse/AggregateConnectionData.hpp
opm/output/eclipse/AggregateMSWData.hpp
@@ -792,14 +675,7 @@ if(ENABLE_ECL_OUTPUT)
opm/output/eclipse/WindowedArray.hpp
opm/output/eclipse/WriteInit.hpp
opm/output/eclipse/WriteRFT.hpp
opm/output/eclipse/WriteRPT.hpp
opm/output/eclipse/WriteRestartHelpers.hpp
opm/output/OutputWriter.hpp
)
endif()
if(ENABLE_ECL_INPUT OR ENABLE_ECL_OUTPUT)
list(APPEND TEST_SOURCE_FILES
tests/test_SummaryNode.cpp
)
endif()

View File

@@ -1,10 +1,14 @@
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
${BASE_DIR}/tmp_gen/ParserInit.cpp
${BASE_DIR}/ParserInit.cpp)
${BASE_DIR}/tmp_gen/ParserKeywords.cpp
${BASE_DIR}/ParserKeywords.cpp)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
${BASE_DIR}/tmp_gen/TestKeywords.cpp
${BASE_DIR}/TestKeywords.cpp)
${BASE_DIR}/tmp_gen/inlinekw.cpp
${BASE_DIR}/inlinekw.cpp)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
${BASE_DIR}/tmp_gen/include/opm/parser/eclipse/Parser/ParserKeywords.hpp
${BASE_DIR}/include/opm/parser/eclipse/Parser/ParserKeywords.hpp)
file(GLOB HDRS ${BASE_DIR}/tmp_gen/include/opm/parser/eclipse/Parser/ParserKeywords/*.hpp)
@@ -14,11 +18,4 @@ foreach(HDR ${HDRS})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
${HDR}
${BASE_DIR}/include/opm/parser/eclipse/Parser/ParserKeywords/${hdr})
endforeach()
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)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
${BASE_DIR}/tmp_gen/ParserKeywords/${name}.cpp
${BASE_DIR}/ParserKeywords/${name}.cpp)
endforeach()

View File

@@ -2,19 +2,24 @@
set(TEST_LIBS opmcommon Boost::unit_test_framework)
set(EXTRA_TESTS)
if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
# Generated source, needs to be here
opm_add_test(InlineKeywordTest
EXE_NAME TestKeywords
SOURCES ${PROJECT_BINARY_DIR}/TestKeywords.cpp
EXE_NAME inlinekw
SOURCES ${PROJECT_BINARY_DIR}/inlinekw.cpp
LIBRARIES ${TEST_LIBS})
list(APPEND EXTRA_TESTS TestKeywords)
list(APPEND EXTRA_TESTS inlinekw)
# Extra compile definitions and extra parameters
include(cmake/Modules/CheckCaseSensitiveFileSystem.cmake)
set(_testdir ${PROJECT_SOURCE_DIR}/tests/parser/data)
opm_add_test(LoaderTest
SOURCES tests/parser/KeywordLoaderTests.cpp
src/opm/parser/eclipse/Generator/KeywordLoader.cpp
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${_testdir}/parser/keyword-generator/)
list(APPEND EXTRA_TESTS LoaderTest)
opm_add_test(ParserTests
SOURCES tests/parser/ParserTests.cpp
LIBRARIES ${TEST_LIBS}
@@ -61,16 +66,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 )
# opm-tests dependent tests
if(HAVE_OPM_TESTS)
opm_add_test(parse_write ONLY_COMPILE
@@ -95,18 +90,7 @@ if(HAVE_OPM_TESTS)
${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
${OPM_TESTS_ROOT}/model2/2_MULTXYZ_MODEL2.DATA
${OPM_TESTS_ROOT}/model2/3_MULTFLT_MODEL2.DATA
${OPM_TESTS_ROOT}/model2/4_MINPVV_MODEL2.DATA
${OPM_TESTS_ROOT}/model2/5_SWATINIT_MODEL2.DATA
${OPM_TESTS_ROOT}/model2/6_ENDSCALE_MODEL2.DATA
${OPM_TESTS_ROOT}/model2/7_HYSTERESIS_MODEL2.DATA
${OPM_TESTS_ROOT}/model2/8_MULTIPLY_TRANXYZ_MODEL2.DATA
${OPM_TESTS_ROOT}/model2/9_EDITNNC_MODEL2.DATA)
${OPM_TESTS_ROOT}/msw_2d_h/2D_H__.DATA )
get_filename_component(test_name ${deck} NAME_WE)
opm_add_test(${test_name} NO_COMPILE
EXE_NAME parse_write
@@ -123,5 +107,3 @@ opm_add_test(jsonTests
LIBRARIES ${TEST_LIBS}
TEST_ARGS ${PROJECT_SOURCE_DIR}/tests/json/example1.json)
list(APPEND EXTRA_TESTS jsonTests)
endif()

View File

@@ -32,7 +32,7 @@ if(NOT cjson_FOUND)
endif()
add_executable(genkw ${genkw_SOURCES})
target_link_libraries(genkw ${opm-common_LIBRARIES})
target_link_libraries(genkw Boost::regex Boost::filesystem Boost::system)
# Generate keyword list
include(src/opm/parser/eclipse/share/keywords/keyword_list.cmake)
@@ -40,74 +40,18 @@ string(REGEX REPLACE "([^;]+)" "${PROJECT_SOURCE_DIR}/src/opm/parser/eclipse/sha
configure_file(src/opm/parser/eclipse/keyword_list.argv.in keyword_list.argv)
# Generate keyword source
add_custom_command( 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/TestKeywords.cpp
COMMAND genkw keyword_list.argv
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords
${PROJECT_BINARY_DIR}/tmp_gen/ParserInit.cpp
add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords.cpp ${PROJECT_BINARY_DIR}/tmp_gen/inlinekw.cpp
COMMAND genkw keyword_list.argv
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords.cpp
${PROJECT_BINARY_DIR}/tmp_gen/include/
opm/parser/eclipse/Parser/ParserKeywords
${PROJECT_BINARY_DIR}/tmp_gen/TestKeywords.cpp
${PROJECT_BINARY_DIR}/tmp_gen/inlinekw.cpp
DEPENDS genkw ${keyword_files} src/opm/parser/eclipse/share/keywords/keyword_list.cmake
)
# To avoid some rebuilds
add_custom_command(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
DEPENDS ${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/A.cpp
add_custom_command(OUTPUT ParserKeywords.cpp inlinekw.cpp
DEPENDS ${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords.cpp
COMMAND ${CMAKE_COMMAND} -DBASE_DIR=${PROJECT_BINARY_DIR}
-P ${PROJECT_SOURCE_DIR}/CopyHeaders.cmake)

View File

@@ -0,0 +1,468 @@
#
# Module that checks for supported C++11 (former C++0x) features.
#
# Sets the follwing variable:
#
# HAVE_FINAL True if the compiler supports the "final" quantifier
# HAVE_TYPE_TRAITS True if the <type_traits> header is available and implements sufficient functionality
# HAVE_SHARED_PTR True if std::shared_ptr is available
# HAVE_UNIQUE_PTR True if std::unique_ptr is available
# HAVE_NULLPTR True if nullptr is available
# HAVE_ARRAY True if header <array> and fill() are available
# HAVE_ATTRIBUTE_ALWAYS_INLINE True if attribute always inline is supported
# HAS_ATTRIBUTE_UNUSED True if attribute unused is supported
# HAS_ATTRIBUTE_DEPRECATED True if attribute deprecated is supported
# HAS_ATTRIBUTE_DEPRECATED_MSG True if attribute deprecated("msg") is supported
# HAVE_CONSTEXPR True if constexpr attribute is available
# HAVE_INTEGRAL_CONSTANT True if compiler supports integral_constant
# HAVE_STATIC_ASSERT True if static_assert is available
# HAVE_AUTO True if the compiler supports the auto keyword
# HAVE_VARIADIC_TEMPLATES True if variadic templates are supported
# HAVE_VARIADIC_CONSTRUCTOR_SFINAE True if variadic constructor sfinae is supported
# HAVE_RVALUE_REFERENCES True if rvalue references are supported
# HAVE_TUPLE True if std::tuple is available
# HAVE_TR1_TUPLE True if std::tr1::tuple is available
include(CheckCXXSourceCompiles)
include(CheckCXXSourceRuns)
# test for C++11 flags
include(TestCXXAcceptsFlag)
include(CheckIncludeFileCXX)
# macro to only add option once
include(AddOptions)
# Force CXX Standard cross platfrom for CMakeVersion >=3.1
set(CMAKE_CXX_EXTENSIONS OFF)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
if(NOT MSVC)
foreach(_flag "14" "11")
set(_FLAG "CXX_FLAG_CXX${_flag}")
string(TOUPPER ${_FLAG} _FLAG)
# try to use compiler flag -std=c++${_flag}
CHECK_CXX_ACCEPTS_FLAG("-std=c++${_flag}" ${_FLAG})
if(${_FLAG})
if(CMAKE_VERSION VERSION_LESS 3.1)
add_options (CXX ALL_BUILDS "-std=c++${_flag}")
endif()
set(CXX_STD0X_FLAGS "-std=c++${_flag}")
#Use vriables for CMake > 3.1 set the standard with no extensions
set(CMAKE_CXX_STANDARD ${_flag})
break()
endif()
endforeach()
endif(NOT MSVC)
endif()
if(CMAKE_VERSION VERSION_LESS 3.1)
# if we are building with an Apple toolchain in MacOS X,
# we cannot use the old GCC 4.2 fork, but must use the
# new runtime library
set (CXX_STDLIB_FLAGS)
string (TOUPPER "${CMAKE_CXX_COMPILER_ID}" _comp_id)
if (APPLE AND (_comp_id MATCHES "CLANG"))
CHECK_CXX_ACCEPTS_FLAG ("-stdlib=libc++" CXX_FLAG_STDLIB_LIBCXX)
if (CXX_FLAG_STDLIB_LIBCXX)
add_options (CXX ALL_BUILDS "-stdlib=libc++")
set (CXX_STDLIB_FLAGS "-stdlib=libc++")
endif (CXX_FLAG_STDLIB_LIBCXX)
endif (APPLE AND (_comp_id MATCHES "CLANG"))
# to format the command-line options pretty, we have an optional space
if (CXX_STD0X_FLAGS AND CXX_STDLIB_FLAGS)
set (CXX_SPACE " ")
else (CXX_STD0X_FLAGS AND CXX_STDLIB_FLAGS)
set (CXX_SPACE)
endif (CXX_STD0X_FLAGS AND CXX_STDLIB_FLAGS)
endif()
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
# Workaround bug in cmake:
# cxx standard flags are not applied in CheckCXXSourceCompiles
if (CMAKE_CXX_STANDARD EQUAL 14)
add_options(CXX ALL_BUILDS ${CMAKE_CXX14_STANDARD_COMPILE_OPTION})
else()
add_options(CXX ALL_BUILDS ${CMAKE_CXX11_STANDARD_COMPILE_OPTION})
endif()
endif()
# perform tests
include(CheckCXXSourceCompiles)
# the "final" method specifier
CHECK_CXX_SOURCE_COMPILES("
struct Base {
virtual void foo() = 0;
};
struct Derived : public Base {
virtual void foo() final {};
};
int main()
{
return 0;
}
" HAVE_FINAL
)
# std::is_convertible, std::is_base_of
CHECK_CXX_SOURCE_COMPILES("
#include <type_traits>
class Base {};
class Derived : public Base {};
int main()
{
bool foo = std::is_convertible<int, double>::value;
bool bar = std::is_base_of<Base, Derived>::value;
bool foobar = std::is_integral<double>::value;
return 0;
}
" HAVE_TYPE_TRAITS
)
# nullptr
CHECK_CXX_SOURCE_COMPILES("
#include <memory>
int main(void)
{
std::shared_ptr<int> foo(new int(123));
return 0;
}
" HAVE_SHARED_PTR
)
# this is required by dune-common to avoid linker errors. "fun"!
if (HAVE_SHARED_PTR)
set(HAVE_MAKE_SHARED 1)
set(SHARED_PTR_HEADER "<memory>")
set(SHARED_PTR_NAMESPACE "std")
endif()
# nullptr
CHECK_CXX_SOURCE_COMPILES("
#include <memory>
int main(void)
{
std::unique_ptr<int> foo(new int(123));
return 0;
}
" HAVE_UNIQUE_PTR
)
# nullptr
CHECK_CXX_SOURCE_COMPILES("
int main(void)
{
char* ch = nullptr;
return 0;
}
" HAVE_NULLPTR
)
# constexpr
CHECK_CXX_SOURCE_COMPILES("
template <class T>
inline constexpr int foo(T bar) { return bar*2; }
int main(void)
{
constexpr int foobar = foo(100);
return 0;
}
" HAVE_CONSTEXPR
)
# array and fill
CHECK_CXX_SOURCE_COMPILES("
#include <array>
int main(void)
{
std::array<int,2> a;
a.fill(9);
return 0;
}
" HAVE_ARRAY
)
# Check whether if std::integral_constant< T, v > is supported and casts into T
CHECK_CXX_SOURCE_COMPILES("
#include <type_traits>
void f( int ){}
int main(void){
f( std::integral_constant< int, 42 >() );
}
" HAVE_INTEGRAL_CONSTANT
)
# Check whether if <tuple> is available
check_include_file_cxx("tuple" HAVE_TUPLE)
# Check whether if <tr1/tuple> is available
check_include_file_cxx("tr1/tuple" HAVE_TR1_TUPLE)
# __attribute__((always_inline))
CHECK_CXX_SOURCE_COMPILES("
void __attribute__((always_inline)) foo(void) {}
int main(void)
{
foo();
return 0;
};
" HAVE_ATTRIBUTE_ALWAYS_INLINE
)
# __attribute__((unused))
CHECK_CXX_SOURCE_COMPILES("
int main(void)
{
int __attribute__((unused)) foo;
return 0;
};
" HAS_ATTRIBUTE_UNUSED
)
# __attribute__((deprecated))
CHECK_CXX_SOURCE_COMPILES("
#define DEP __attribute__((deprecated))
class bar
{
bar() DEP;
};
class peng { } DEP;
template <class T>
class t_bar
{
t_bar() DEP;
};
template <class T>
class t_peng {
t_peng() {};
} DEP;
void foo() DEP;
void foo() {};
int main(void)
{
return 0;
};
" HAS_ATTRIBUTE_DEPRECATED
)
# __attribute__((deprecated("msg")))
CHECK_CXX_SOURCE_COMPILES("
#define DEP __attribute__((deprecated(\"message\")))
class bar {
bar() DEP;
};
class peng { } DEP;
template <class T>
class t_bar
{
t_bar() DEP;
};
template <class T>
class t_peng
{
t_peng() {};
} DEP;
void foo() DEP;
void foo() {};
int main(void)
{
return 0;
};
" HAS_ATTRIBUTE_DEPRECATED_MSG
)
# static assert
CHECK_CXX_SOURCE_COMPILES("
int main(void)
{
static_assert(true,\"MSG\");
return 0;
}
" HAVE_STATIC_ASSERT
)
# auto keyword
CHECK_CXX_SOURCE_COMPILES("
int main(void)
{
auto foo = 1.23;
return 0;
}
" HAVE_AUTO
)
# variadic template support
CHECK_CXX_SOURCE_COMPILES("
#include <cassert>
template<typename... T>
int addints(T... x);
int add_ints()
{
return 0;
}
template<typename T1, typename... T>
int add_ints(T1 t1, T... t)
{
return t1 + add_ints(t...);
}
int main(void)
{
assert( 5 == add_ints(9,3,-5,-2) );
return 0;
}
" HAVE_VARIADIC_TEMPLATES
)
# SFINAE on variadic template constructors within template classes
CHECK_CXX_SOURCE_COMPILES("
#include <functional>
template<typename... U>
struct A
{
template<typename... T,
typename = typename std::enable_if<(sizeof...(T) < 2)>::type
>
A(T... t)
: i(1)
{}
template<typename... T,
typename = typename std::enable_if<(sizeof...(T) >= 2)>::type,
typename = void
>
A(T... t)
: i(-1)
{}
A()
: i(1)
{}
int i;
};
int main(void)
{
return (A<int>().i + A<int>(2).i + A<int>(\"foo\",3.4).i + A<int>(8,'a',A<int>()).i == 0 ? 0 : 1);
}
" HAVE_VARIADIC_CONSTRUCTOR_SFINAE
)
# rvalue references
CHECK_CXX_SOURCE_COMPILES("
#include <cassert>
#include <utility>
int foo(int&& x) { return 1; }
int foo(const int& x) { return -1; }
template<typename T>
int forward(T&& x)
{
return foo(std::forward<T>(x));
}
int main(void)
{
int i = 0;
assert( forward(i) + forward(int(2)) == 0);
return 0;
}
" HAVE_RVALUE_REFERENCES
)
include(CheckIncludeFile)
include(CheckIncludeFileCXX)
# Search for some tr1 headers
foreach(_HEADER tuple tr1/tuple type_traits tr1/type_traits)
string(REPLACE "/" "_" _HEADER_VAR ${_HEADER})
string(TOUPPER ${_HEADER_VAR} _HEADER_VAR )
check_include_file_cxx(${_HEADER} "HAVE_${_HEADER_VAR}")
endforeach(_HEADER tuple tr1/tuple tr1/type_traits)
# make sure that the C++-11 features implemented by the compiler are a
# superset of those provided by GCC 4.4. This makes the test fail on
# all GCC compilers before 4.4.
set(CXX_FEATURES_MISSING "")
if (NOT HAVE_TYPE_TRAITS)
set(CXX_FEATURES_MISSING
"${CXX_FEATURES_MISSING} - Sufficiently conformant type traits (defined by the 'type_traits' header file)\n")
endif()
if (NOT HAVE_SHARED_PTR)
set(CXX_FEATURES_MISSING
"${CXX_FEATURES_MISSING} - Shared pointers (the std::shared_ptr class)\n")
endif()
if (NOT HAVE_UNIQUE_PTR)
set(CXX_FEATURES_MISSING
"${CXX_FEATURES_MISSING} - Unique pointers (the std::unique_ptr class)\n")
endif()
if (NOT HAVE_ARRAY)
set(CXX_FEATURES_MISSING
"${CXX_FEATURES_MISSING} - Statically sized arrays (the std::array class)\n")
endif()
if (NOT HAVE_STATIC_ASSERT)
set(CXX_FEATURES_MISSING
"${CXX_FEATURES_MISSING} - Static assertations (the static_assert() mechanism)\n")
endif()
if (NOT HAVE_AUTO)
set(CXX_FEATURES_MISSING
"${CXX_FEATURES_MISSING} - Automatically typed variables (the 'auto' keyword)\n")
endif()
if (NOT HAVE_VARIADIC_TEMPLATES)
set(CXX_FEATURES_MISSING
"${CXX_FEATURES_MISSING} - Variable number of template arguments\n")
endif()
if (NOT HAVE_VARIADIC_CONSTRUCTOR_SFINAE)
set(CXX_FEATURES_MISSING
"${CXX_FEATURES_MISSING} - Constructors with variable number of template arguments obeying the SFINAE (specialization failure is not an error) rule\n")
endif()
if (NOT HAVE_RVALUE_REFERENCES)
set(CXX_FEATURES_MISSING
"${CXX_FEATURES_MISSING} - References to rvalue objects\n")
endif()
if (NOT HAVE_TUPLE)
set(CXX_FEATURES_MISSING
"${CXX_FEATURES_MISSING} - Tuples (the std::tuple class)\n")
endif()
if(CXX_FEATURES_MISSING)
set (CXX11FEATURES_FOUND FALSE)
if (CXX11Features_FIND_REQUIRED)
message(FATAL_ERROR
"Your C++ compiler does not support the minimum set of C++-2011 features required. "
"Make sure to use a compiler which implements all C++-2011 features provided by GCC 4.4. "
"Your compiler does not seem to implement the following features:\n"
"${CXX_FEATURES_MISSING}")
endif()
else ()
set (CXX11FEATURES_FOUND TRUE)
endif()

View File

@@ -58,7 +58,6 @@ if(PARMETIS_INCLUDE_DIR)
endif()
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${MPI_C_COMPILE_FLAGS}")
include(CheckIncludeFile)
check_include_file(parmetis.h PARMETIS_FOUND)
_search_parmetis_lib(PARMETIS_LIBRARY parmetis "The main ParMETIS library.")

View File

@@ -16,9 +16,6 @@ if(ZOLTAN_ROOT)
set(ZOLTAN_NO_DEFAULT_PATH "NO_DEFAULT_PATH")
endif()
# We only need zoltan with MPI. Otherwise usage of alugrid is broken.
find_package(MPI)
# Make sure we have checked for the underlying partitioners.
find_package(PTScotch)
#find_package(ParMETIS)
@@ -42,23 +39,20 @@ find_library(ZOLTAN_LIBRARIES
${ZOLTAN_NO_DEFAULT_PATH})
set (ZOLTAN_FOUND FALSE)
set (ZOLTAN_CONFIG_VAR HAVE_ZOLTAN)
# print a message to indicate status of this package
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args(ZOLTAN
DEFAULT_MSG
ZOLTAN_LIBRARIES
ZOLTAN_INCLUDE_DIRS
MPI_FOUND
)
if (ZOLTAN_FOUND)
if (ZOLTAN_INCLUDE_DIRS OR ZOLTAN_LIBRARIES)
set(ZOLTAN_FOUND TRUE)
set(HAVE_ZOLTAN 1)
set(ZOLTAN_LIBRARIES ${ZOLTAN_LIBRARIES} ${PARMETIS_LIBRARIES} ${PTSCOTCH_LIBRARIES})
set(ZOLTAN_INCLUDE_DIRS ${ZOLTAN_INCLUDE_DIRS} ${PARMETIS_INCLUDE_DIRS}
${PTSCOTCH_INCLUDE_DIRS})
endif()
set (ZOLTAN_CONFIG_VAR HAVE_ZOLTAN)
# print a message to indicate status of this package
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args(ZOLTAN
DEFAULT_MSG
ZOLTAN_LIBRARIES
ZOLTAN_INCLUDE_DIRS
)

View File

@@ -20,7 +20,8 @@ find_opm_package (
# TODO: we should probe for all the HAVE_* values listed below;
# however, we don't actually use them in our implementation, so
# we just include them to forward here in case anyone else does
"dune-grid REQUIRED;
"CXX11Features REQUIRED;
dune-grid REQUIRED;
ZLIB;
ZOLTAN;
METIS

View File

@@ -16,7 +16,8 @@ find_opm_package (
"dune-common"
# dependencies
"BLAS REQUIRED;
"CXX11Features REQUIRED;
BLAS REQUIRED;
LAPACK REQUIRED;
CxaDemangle;
MPI

View File

@@ -19,7 +19,8 @@ find_opm_package (
# TODO: we should probe for all the HAVE_* values listed below;
# however, we don't actually use them in our implementation, so
# we just include them to forward here in case anyone else does
"dune-common REQUIRED;
"CXX11Features REQUIRED;
dune-common REQUIRED;
dune-grid REQUIRED;
dune-alugrid;
ZLIB;

View File

@@ -19,7 +19,8 @@ find_opm_package (
# TODO: we should probe for all the HAVE_* values listed below;
# however, we don't actually use them in our implementation, so
# we just include them to forward here in case anyone else does
"dune-common REQUIRED
"CXX11Features REQUIRED;
dune-common REQUIRED
"
# header to search for
"dune/geometry/quadraturerules.hh"

View File

@@ -22,7 +22,8 @@ find_opm_package (
# TODO: we should probe for all the HAVE_* values listed below;
# however, we don't actually use them in our implementation, so
# we just include them to forward here in case anyone else does
"dune-common REQUIRED;
"CXX11Features REQUIRED;
dune-common REQUIRED;
dune-geometry REQUIRED;
dune-uggrid;
MPI;

View File

@@ -7,7 +7,8 @@ find_opm_package (
# dependencies
# TODO: we should probe for all the HAVE_* values listed below;
# however, we don't actually use them in our implementation, so
"dune-common REQUIRED
"CXX11Features REQUIRED;
dune-common REQUIRED
"
# header to search for
""

View File

@@ -1,104 +0,0 @@
# Check for various compiler extensions
# HAVE_ATTRIBUTE_ALWAYS_INLINE True if attribute always inline is supported
# HAS_ATTRIBUTE_UNUSED True if attribute unused is supported
# HAS_ATTRIBUTE_DEPRECATED True if attribute deprecated is supported
# HAS_ATTRIBUTE_DEPRECATED_MSG True if attribute deprecated("msg") is supported
include(CheckCXXSourceCompiles)
# __attribute__((always_inline))
CHECK_CXX_SOURCE_COMPILES("
void __attribute__((always_inline)) foo(void) {}
int main(void)
{
foo();
return 0;
};
" HAVE_ATTRIBUTE_ALWAYS_INLINE
)
# __attribute__((unused))
CHECK_CXX_SOURCE_COMPILES("
int main(void)
{
int __attribute__((unused)) foo;
return 0;
};
" HAS_ATTRIBUTE_UNUSED
)
# __attribute__((deprecated))
CHECK_CXX_SOURCE_COMPILES("
#define DEP __attribute__((deprecated))
class bar
{
bar() DEP;
};
class peng { } DEP;
template <class T>
class t_bar
{
t_bar() DEP;
};
template <class T>
class t_peng {
t_peng() {};
} DEP;
void foo() DEP;
void foo() {};
int main(void)
{
return 0;
};
" HAS_ATTRIBUTE_DEPRECATED
)
# __attribute__((deprecated("msg")))
CHECK_CXX_SOURCE_COMPILES("
#define DEP __attribute__((deprecated(\"message\")))
class bar {
bar() DEP;
};
class peng { } DEP;
template <class T>
class t_bar
{
t_bar() DEP;
};
template <class T>
class t_peng
{
t_peng() {};
} DEP;
void foo() DEP;
void foo() {};
int main(void)
{
return 0;
};
" HAS_ATTRIBUTE_DEPRECATED_MSG
)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
list(APPEND ${project}_LIBRARIES stdc++fs)
endif()
endif()
option(OPM_CLANG_WITH_STDC++FS "Using libstdc++ with clang and we want to link to stdc++fs" OFF)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND OPM_CLANG_WITH_STDC++FS)
list(APPEND ${project}_LIBRARIES stdc++fs)
endif()

View File

@@ -5,8 +5,6 @@ is_compiler_gcc_compatible ()
include(TestCXXAcceptsFlag)
macro (opm_defaults opm)
message("Processing opm_defaults ${opm}")
# if we are installing a development version (default when checking out of
# VCS), then remember which directories were used when configuring. package
# distribution should disable this option.

View File

@@ -54,6 +54,17 @@ foreach (name IN LISTS _opm_proj_vars)
endif (NOT DEFINED ${CMAKE_PROJECT_NAME}_${name})
endforeach (name)
# these dependencies needs special treatment
set (_opm_proj_exemptions
dune-common
dune-istl
dune-grid
dune-geometry
dune-uggrid
dune-alugrid
dune-localfunctions
dune-fem
)
# insert this boilerplate whenever we are going to find a new package
macro (find_and_append_package_to prefix name)
@@ -104,6 +115,21 @@ macro (find_and_append_package_to prefix name)
endif (EXISTS ${${NAME}_ROOT}/${name}-config.cmake OR EXISTS ${${NAME}_ROOT}/${name}Config.cmake)
endif (NOT DEFINED ${name}_DIR AND (DEFINED ${name}_ROOT OR DEFINED ${NAME}_ROOT))
# these libraries need special handling which is not provided in
# the -config.cmake file, but which must be provided by this project,
# something which is done in our find module
list (FIND _opm_proj_exemptions "${name}" _${name}_exempted)
if ((NOT (_${name}_exempted EQUAL -1)) AND (DEFINED ${name}_DIR))
set (${name}_ROOT "${${name}_DIR}")
# store this for later, in case we reconfigure
set (${name}_ROOT "${${name}_ROOT}" CACHE LOCATION "Path to ${name}")
# clear this to not use config mode
unset (${name}_DIR)
# variables that are given on the command-line is also put in the cache
# removing the local copy only "unshadows" this one
unset (${name}_DIR CACHE)
endif ((NOT (_${name}_exempted EQUAL -1)) AND (DEFINED ${name}_DIR))
# if we're told not to look for the package, pretend it was never found
if (CMAKE_DISABLE_FIND_PACKAGE_${name})
set (${name}_FOUND FALSE)
@@ -125,8 +151,10 @@ macro (find_and_append_package_to prefix name)
# 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)
string(REGEX MATCH "(dune|opm)-.*" _is_opm ${name})
if(_${name}_exempted LESS 0 AND NOT _is_opm)
find_package (${name} ${ARGN})
elseif(_${name}_exempted GREATER -1)
find_package (${name} ${ARGN})
else()
if(${name}_DIR)

View File

@@ -12,59 +12,6 @@
# This module should be the first to be included in the project,
# because most of the others (OpmXxx.cmake) use these variables.
# for CMake >= 3.0, we need to change a few policies:
#
# - CMP0026 to allow access to the LOCATION target property
# - CMP0048 to indicate that we want to deal with the *VERSION*
# variables ourselves
# - CMP0064 to indicate that we want TEST if conditions to be evaluated
# - CMP0074 to indicate that <PackageName>_ROOT can be used to find package
# config files
macro(OpmSetPolicies)
if (POLICY CMP0026)
# Needed as we query LOCATION in OpmCompile.cmake and OpmSatellites.cmake
cmake_policy(SET CMP0026 OLD)
endif()
if (POLICY CMP0048)
# We do not set version. Hence NEW should work and this can be removed later
cmake_policy(SET CMP0048 NEW)
endif()
if(POLICY CMP0064)
cmake_policy(SET CMP0064 NEW)
endif()
# set the behavior of the policy 0054 to NEW. (i.e. do not implicitly
# expand variables in if statements)
if (POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
# set the behavior of policy 0074 to new as we always used <PackageName>_ROOT as the
# root of the installation
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
# include special
if (CMAKE_VERSION VERSION_LESS "2.8.3")
message (STATUS "Enabling compatibility modules for CMake 2.8.3")
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.3")
endif (CMAKE_VERSION VERSION_LESS "2.8.3")
if (CMAKE_VERSION VERSION_LESS "2.8.5")
message (STATUS "Enabling compatibility modules for CMake 2.8.5")
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.5")
endif (CMAKE_VERSION VERSION_LESS "2.8.5")
if (CMAKE_VERSION VERSION_LESS "2.8.7")
message (STATUS "Enabling compatibility modules for CMake 2.8.7")
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.7")
endif (CMAKE_VERSION VERSION_LESS "2.8.7")
endmacro()
# helper macro to retrieve a single field of a dune.module file
macro(OpmGetDuneModuleDirective field variable contents)
string (REGEX MATCH ".*${field}:[ ]*([^\n]+).*" ${variable} "${contents}")

View File

@@ -40,7 +40,7 @@ macro (opm_install opm)
set (_sys_dbg_def OFF)
endif (CMAKE_INSTALL_PREFIX STREQUAL "/usr")
option (SYSTEM_DEBUG "Put .debug files in GDB debug file directory" ${_sys_dbg_def})
set (DEBUG_FILE_DIRECTORY /usr/lib/debug CACHE PATH "GDB debug file directory")
set (DEBUG_FILE_DIRECTORY /usr/lib/debug CACHE LOCATION "GDB debug file directory")
mark_as_advanced (DEBUG_FILE_DIRECTORY)
if (SYSTEM_DEBUG AND NOT APPLE)
set (_dbg_prefix "${DEBUG_FILE_DIRECTORY}/")

View File

@@ -15,23 +15,54 @@
# tests_hook Do special processing before tests are compiled
# files_hook Do special processing before final targets are added
# for CMake >= 3.0, we need to change a few policies:
#
# - CMP0026 to allow access to the LOCATION target property
# - CMP0048 to indicate that we want to deal with the *VERSION*
# variables ourselves
# - CMP0064 to indicate that we want TEST if conditions to be evaluated
if (POLICY CMP0026)
cmake_policy(SET CMP0026 OLD)
endif()
if (POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()
if(POLICY CMP0064)
cmake_policy(SET CMP0064 NEW)
endif()
# set the behavior of the policy 0054 to NEW. (i.e. do not implicitly
# expand variables in if statements)
if (POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
# include special
if (CMAKE_VERSION VERSION_LESS "2.8.3")
message (STATUS "Enabling compatibility modules for CMake 2.8.3")
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.3")
endif (CMAKE_VERSION VERSION_LESS "2.8.3")
if (CMAKE_VERSION VERSION_LESS "2.8.5")
message (STATUS "Enabling compatibility modules for CMake 2.8.5")
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.5")
endif (CMAKE_VERSION VERSION_LESS "2.8.5")
if (CMAKE_VERSION VERSION_LESS "2.8.7")
message (STATUS "Enabling compatibility modules for CMake 2.8.7")
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.7")
endif (CMAKE_VERSION VERSION_LESS "2.8.7")
# don't write default flags into the cache, preserve that for user set values
include (AddOptions)
no_default_options ()
# Languages and global compiler settings
if(CMAKE_VERSION VERSION_LESS 3.8)
message(WARNING "CMake version does not support c++17, guessing -std=c++17")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
else()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
# Various compiler extension checks
include(OpmCompilerChecks)
# C++ project
project (${${project}_NAME})
enable_language (C)
enable_language (CXX)
# print system information to better pinpoint issues from log alone
include (UseSystemInfo)

View File

@@ -56,9 +56,6 @@ macro (opm_compile_satellites opm satellite excl_all test_regexp)
# compile each of these separately
foreach (_sat_FILE IN LISTS ${satellite}_SOURCES)
if (NOT "${test_regexp}" STREQUAL "" AND NOT Boost_UNIT_TEST_FRAMEWORK_FOUND)
continue()
endif()
get_filename_component (_sat_NAME "${_sat_FILE}" NAME_WE)
add_executable (${_sat_NAME} ${excl_all} ${_sat_FILE})
add_dependencies (${satellite} ${_sat_NAME})
@@ -198,7 +195,6 @@ endmacro (opm_data satellite target dirname files)
# TEST_DEPENDS Other tests which must be run before running this test (optional, default: None)
# LIBRARIES Libraries to link test against (optional)
# WORKING_DIRECTORY Working directory for test (optional, default: ${PROJECT_BINARY_DIR})
# CONFIGURATION Configuration to add test to
#
# Example:
#
@@ -212,7 +208,7 @@ include(CMakeParseArguments)
macro(opm_add_test TestName)
cmake_parse_arguments(CURTEST
"NO_COMPILE;ONLY_COMPILE;ALWAYS_ENABLE" # flags
"EXE_NAME;PROCESSORS;WORKING_DIRECTORY;CONFIGURATION" # one value args
"EXE_NAME;PROCESSORS;WORKING_DIRECTORY" # one value args
"CONDITION;DEFAULT_ENABLE_IF;TEST_DEPENDS;DRIVER;DRIVER_ARGS;DEPENDS;TEST_ARGS;SOURCES;LIBRARIES" # multi-value args
${ARGN})
@@ -348,8 +344,7 @@ macro(opm_add_test TestName)
add_test(NAME ${_FANCY}
WORKING_DIRECTORY "${CURTEST_WORKING_DIRECTORY}"
COMMAND ${CURTEST_COMMAND}
CONFIGURATIONS ${CURTEST_CONFIGURATION})
COMMAND ${CURTEST_COMMAND})
# specify the dependencies between the tests
if (CURTEST_TEST_DEPENDS)

View File

@@ -42,13 +42,7 @@ macro (find_openmp opm)
# enabling OpenMP is supposedly enough to make the compiler link with
# the appropriate libraries
find_package (OpenMP ${${opm}_QUIET})
if(OpenMP_CXX_FOUND)
list (APPEND ${opm}_LIBRARIES OpenMP::OpenMP_CXX)
else()
list (APPEND ${opm}_LIBRARIES ${OpenMP_LIBRARIES})
endif()
list (APPEND ${opm}_LIBRARIES ${OpenMP_LIBRARIES})
if (OPENMP_FOUND)
add_options (C ALL_BUILDS "${OpenMP_C_FLAGS}")
add_options (CXX ALL_BUILDS "${OpenMP_CXX_FLAGS}")

View File

@@ -14,7 +14,6 @@
# makes changes to any of the unit tests.
message("-- Writing version information to local header project-version.h")
string (TIMESTAMP build_timestamp "%Y-%m-%d at %H:%M:%S hrs")
string (TOUPPER "${CMAKE_BUILD_TYPE}" cmake_build_type_upper_)
if (cmake_build_type_upper_ MATCHES DEBUG)
@@ -24,7 +23,6 @@ if (cmake_build_type_upper_ MATCHES DEBUG)
"#define PROJECT_VERSION_NAME \"${${project}_LABEL}\"\n"
"#define PROJECT_VERSION_HASH \"debug\"\n"
"#define PROJECT_VERSION \"${${project}_LABEL} (debug)\"\n"
"#define BUILD_TIMESTAMP \"${build_timestamp}\"\n"
"#endif // OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
)
else ()
@@ -43,7 +41,6 @@ else ()
"#define PROJECT_VERSION_NAME \"${${project}_LABEL}\"\n"
"#define PROJECT_VERSION_HASH \"unknown git version\"\n"
"#define PROJECT_VERSION \"${${project}_LABEL} (unknown git version)\"\n"
"#define BUILD_TIMESTAMP \"${build_timestamp}\"\n"
"#endif // OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
)
else ()

View File

@@ -47,8 +47,6 @@ if (sha1)
endif ()
endif ()
string (TIMESTAMP build_timestamp "%Y-%m-%d at %H:%M:%S hrs")
# write the content to a temporary file in a C compatible format
file (WRITE "${PROJECT_BINARY_DIR}/project-version.tmp"
"#ifndef OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
@@ -56,7 +54,6 @@ file (WRITE "${PROJECT_BINARY_DIR}/project-version.tmp"
"#define PROJECT_VERSION_NAME \"${PROJECT_LABEL}\"\n"
"#define PROJECT_VERSION_HASH \"${sha1}\"\n"
"#define PROJECT_VERSION \"${PROJECT_LABEL} (${sha1})\"\n"
"#define BUILD_TIMESTAMP \"${build_timestamp}\"\n"
"#endif // OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
)

View File

@@ -30,11 +30,6 @@ if(NOT @opm-project_NAME@_FOUND)
set (@opm-project_NAME@_LINKER_FLAGS "@opm-project_LINKER_FLAGS@")
set (@opm-project_NAME@_CONFIG_VARS "@opm-project_CONFIG_VARS@")
# The flag whether embedded Python is supported or not is passed to downstream modules,
# it is only used to enable/disable regression testing with Python enabled input. The
# actual code is self contained - and can be used downstream without awareness of this.
set (@opm-project_NAME@_EMBEDDED_PYTHON @OPM_ENABLE_EMBEDDED_PYTHON@)
# libraries come from the build tree where this file was generated
set (@opm-project_NAME@_LIBRARY "@opm-project_LIBRARY@")
set (@opm-project_NAME@_LIBRARIES ${@opm-project_NAME@_LIBRARY} "@opm-project_LIBRARIES@")
@@ -74,6 +69,12 @@ if(NOT @opm-project_NAME@_FOUND)
endif()
endif (NOT "@opm-project_TARGET@" STREQUAL "")
# ensure that we build with support for C++11 to preserve ABI
string (REPLACE "@CXX_STD0X_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string (REPLACE "@CXX_STDLIB_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string (STRIP "${CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS)
set (CMAKE_CXX_FLAGS "@CXX_STD0X_FLAGS@@CXX_SPACE@@CXX_STDLIB_FLAGS@ ${CMAKE_CXX_FLAGS}")
# same as above, but for C99
string (REPLACE "@C_STD99_FLAGS@" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string (STRIP "${CMAKE_C_FLAGS}" CMAKE_C_FLAGS)

2
debian/changelog vendored
View File

@@ -1,4 +1,4 @@
opm-common (2020.04-1~xenial) xenial; urgency=medium
opm-common (2019.10-rc2-1~xenial) xenial; urgency=medium
* New release

28
debian/control vendored
View File

@@ -2,12 +2,11 @@ Source: opm-common
Priority: extra
Maintainer: Arne Morten Kvarving <arne.morten.kvarving@sintef.no>
Build-Depends: build-essential, debhelper (>= 9),
pkg-config, cmake, git, libtool, doxygen, graphviz,
pkg-config, cmake, git, libtool, doxygen,
texlive-latex-extra, texlive-latex-recommended,
ghostscript, libboost-system-dev, libboost-test-dev,
zlib1g-dev, libpython3-dev, python3-numpy, python3-distutils,
python3-setuptools, python3-setuptools-scm, python3-pytest-runner,
python3-decorator
libboost-regex-dev, libboost-filesystem-dev,
zlib1g-dev
Standards-Version: 3.9.2
Section: libs
Homepage: http://opm-project.org
@@ -16,7 +15,7 @@ Vcs-Browser: https://github.com/OPM/opm-common
Package: libopm-common1
Section: libs
Pre-Depends: ${misc:Pre-Depends}
Pre-Depends: ${misc:Pre-Depends}, multiarch-support
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -24,16 +23,6 @@ Provides: libopm-common
Description: OPM common library
The OPM common library contains generic code shared across all OPM modules.
Package: libopm-common1-bin
Section: libs
Pre-Depends: ${misc:Pre-Depends}
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends}
Provides: libopm-common-bin
Description: OPM common binaries
The OPM common binaries.
Package: libopm-common1-dev
Section: libdevel
Architecture: any
@@ -53,12 +42,3 @@ Provides: libopm-common-doc
Description: OPM common library -- documentation
The OPM common library contains the shared buildsystem
and helpers shared across all OPM modules.
Package: python3-opm-common
Section: libs
Pre-Depends: ${misc:Pre-Depends}
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends}, libopm-common1, python3-numpy, python3-decorator
Description: OPM common python bindings
Python package for opm-common

View File

@@ -1 +0,0 @@
usr/bin/*

View File

@@ -1 +0,0 @@
usr/lib/python*/*

4
debian/rules vendored
View File

@@ -10,7 +10,7 @@
#export DH_VERBOSE=1
%:
dh $@ --parallel
dh $@
override_dh_auto_clean:
dh_auto_clean --buildsystem=cmake
@@ -20,7 +20,7 @@ override_dh_auto_build:
# consider using -DUSE_VERSIONED_DIR=ON if backporting
override_dh_auto_configure:
dh_auto_configure --buildsystem=cmake -- -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSTRIP_DEBUGGING_SYMBOLS=ON -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_DOCDIR=share/doc/libopm-common1 -DWHOLE_PROG_OPTIM=ON -DUSE_RUNPATH=OFF -DWITH_NATIVE=OFF -DOPM_ENABLE_PYTHON=1 -DOPM_INSTALL_PYTHON=1 -DPYTHON_EXECUTABLE=/usr/bin/python3
dh_auto_configure --buildsystem=cmake -- -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSTRIP_DEBUGGING_SYMBOLS=ON -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_DOCDIR=share/doc/libopm-common1 -DWHOLE_PROG_OPTIM=ON -DUSE_RUNPATH=OFF -DWITH_NATIVE=OFF
override_dh_auto_install:
dh_auto_install -- install-html

View File

@@ -184,8 +184,8 @@ the WCONHIST keyword has the the following items specification:
{"name" : "ORAT" , "value_type" : "DOUBLE", "default" : 0.0, "dimension" : "LiquidSurfaceVolume/Time"},
{"name" : "WRAT" , "value_type" : "DOUBLE" , "default" : 0.0, "dimension" : "LiquidSurfaceVolume/Time"},
{"name" : "GRAT" , "value_type" : "DOUBLE" , "default" : 0.0, "dimension" : "GasSurfaceVolume/Time"},
{"name" : "VFP_TABLE" , "value_type" : "INT" , "default" : 0.0 , "comment":"The default is a state variable"},
{"name" : "LIFT" , "value_type" : "DOUBLE" , "default" : 0.0 , "comment":"The default is a state variable"},
{"name" : "VFPTable" , "value_type" : "INT" , "default" : 0.0 , "comment":"The default is a state variable"},
{"name" : "Lift" , "value_type" : "DOUBLE" , "default" : 0.0 , "comment":"The default is a state variable"},
{"name" : "THP" , "value_type" : "DOUBLE" , "default" : 0.0 , "dimension" : "Pressure"},
{"name" : "BHP" , "value_type" : "DOUBLE" , "default" : 0.0 ,"dimension" : "Pressure"},
{"name" : "NGLRAT" , "value_type" : "DOUBLE" , "default" : 0.0 ,"dimension" : "LiquidSurfaceVolume/Time"}]}

View File

@@ -5,8 +5,8 @@
Module: opm-common
Description: Open Porous Media Initiative shared infrastructure
Version: 2020.04
Label: 2020.04
Version: 2019.10
Label: 2019.10
Maintainer: opm@opm-project.org
MaintainerName: OPM community
Url: http://opm-project.org

View File

@@ -23,7 +23,6 @@
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/parser/eclipse/Python/Python.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
@@ -36,11 +35,10 @@ int main(int /* argc */, char** argv) {
Opm::Parser parser;
Opm::ParseContext parse_context;
Opm::ErrorGuard error_guard;
auto python = std::make_shared<Opm::Python>();
Opm::Deck deck = parser.parseFile(deck_file, parse_context, error_guard);
Opm::EclipseState state(deck);
Opm::Schedule schedule(deck, state, parse_context, error_guard, python);
Opm::EclipseState state(deck, parse_context, error_guard);
Opm::Schedule schedule(deck, state.getInputGrid(), state.get3DProperties(), state.runspec(), parse_context, error_guard);
Opm::SummaryConfig summary_config(deck, schedule, state.getTableManager(), parse_context, error_guard);
if (error_guard) {

View File

@@ -64,10 +64,9 @@ std::vector<keyword> load_deck(const char * deck_file) {
auto deck = parser.parseFile(deck_file, parseContext, errors);
for (const auto& kw : deck) {
std::stringstream ss;
const auto& location = kw.location();
ss << kw;
keywords.emplace_back(kw.name(), location.filename, location.lineno, std::hash<std::string>{}(ss.str()));
keywords.emplace_back(kw.name(), kw.getFileName(), kw.getLineNumber(), std::hash<std::string>{}(ss.str()));
}
return keywords;
}

View File

@@ -18,8 +18,6 @@
*/
#include <iostream>
#include <iomanip>
#include <chrono>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
@@ -29,7 +27,6 @@
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/Python/Python.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>
#include <opm/common/OpmLog/StreamLog.hpp>
@@ -45,40 +42,14 @@ inline void loadDeck( const char * deck_file) {
Opm::ParseContext parseContext;
Opm::ErrorGuard errors;
Opm::Parser parser;
auto python = std::make_shared<Opm::Python>();
std::cout << "Loading deck: " << deck_file << " ..... "; std::cout.flush();
std::chrono::system_clock::time_point start;
start = std::chrono::system_clock::now();
auto deck = parser.parseFile(deck_file, parseContext, errors);
auto deck_time = std::chrono::system_clock::now() - start;
std::cout << "parse complete - creating EclipseState .... "; std::cout.flush();
start = std::chrono::system_clock::now();
Opm::EclipseState state( deck );
auto state_time = std::chrono::system_clock::now() - start;
std::cout << "creating Schedule .... "; std::cout.flush();
start = std::chrono::system_clock::now();
Opm::Schedule schedule( deck, state, python);
auto schedule_time = std::chrono::system_clock::now() - start;
std::cout << "creating SummaryConfig .... "; std::cout.flush();
start = std::chrono::system_clock::now();
Opm::EclipseState state( deck, parseContext, errors );
Opm::Schedule schedule( deck, state.getInputGrid(), state.get3DProperties(), state.runspec(), parseContext, errors);
Opm::SummaryConfig summary( deck, schedule, state.getTableManager( ), parseContext, errors );
auto summary_time = std::chrono::system_clock::now() - start;
std::cout << "complete." << std::endl << std::endl;
std::cout << "Time: " << std::endl;
std::cout << " deck.....: " << std::chrono::duration<double>(deck_time).count() << " seconds" << std::endl;
std::cout << " state....: " << std::chrono::duration<double>(state_time).count() << " seconds" << std::endl;
std::cout << " schedule.: " << std::chrono::duration<double>(schedule_time).count() << " seconds" << std::endl;
std::cout << " summary..: " << std::chrono::duration<double>(summary_time).count() << " seconds" << std::endl;
std::cout << "complete." << std::endl;
}

View File

@@ -17,23 +17,18 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <fstream>
#include <iostream>
#include <getopt.h>
#include <boost/filesystem.hpp>
#include <opm/common/utility/FileSystem.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/I.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/P.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/G.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Parser/InputErrorAction.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
namespace fs = Opm::filesystem;
Opm::Deck pack_deck( const char * deck_file, std::ostream& os) {
inline void pack_deck( const char * deck_file, std::ostream& os) {
Opm::ParseContext parseContext(Opm::InputError::WARN);
Opm::ErrorGuard errors;
Opm::Parser parser;
@@ -41,7 +36,6 @@ Opm::Deck pack_deck( const char * deck_file, std::ostream& os) {
auto deck = parser.parseFile(deck_file, parseContext, errors);
os << deck;
return deck;
}
@@ -68,46 +62,21 @@ Print NEW_CASE in cwd:
opmpack -o NEW_CASE.DATA path/to/MY_CASE.DATA
As an alternative to the -o option you can use -c; that is equivalent to -o -
but restart and import files referred to in the deck are also copied. The -o and
-c options are mutually exclusive. )";
)";
std::cerr << help_text << std::endl;
exit(1);
}
void copy_file(const fs::path& source_dir, fs::path fname, const fs::path& target_dir) {
if (fname.is_absolute()) {
// change when moving to gcc8+
// fname = fs::relative(fname, source_dir);
auto prefix_len = fs::canonical(source_dir).string().size();
fname = fs::canonical(fname);
fname = fs::path( fname.string().substr(prefix_len + 1) );
}
auto source_file = source_dir / fname;
auto target_file = target_dir / fname;
{
const auto& parent_path = target_file.parent_path();
if (!parent_path.empty() && !fs::is_directory(parent_path))
fs::create_directories(parent_path);
}
fs::copy_file(source_file, target_file, fs::copy_options::overwrite_existing);
std::cerr << "Copying file " << source_file.string() << " -> " << target_file.string() << std::endl;
}
int main(int argc, char** argv) {
int arg_offset = 1;
bool stdout_output = true;
bool copy_binary = false;
const char * coutput_arg;
while (true) {
int c;
c = getopt(argc, argv, "c:o:");
c = getopt(argc, argv, "o:");
if (c == -1)
break;
@@ -116,11 +85,6 @@ int main(int argc, char** argv) {
stdout_output = false;
coutput_arg = optarg;
break;
case 'c':
stdout_output = false;
copy_binary = true;
coutput_arg = optarg;
break;
}
}
arg_offset = optind;
@@ -131,51 +95,16 @@ int main(int argc, char** argv) {
pack_deck(argv[arg_offset], std::cout);
else {
std::ofstream os;
fs::path input_arg(argv[arg_offset]);
fs::path output_arg(coutput_arg);
fs::path output_dir(coutput_arg);
if (fs::is_directory(output_arg)) {
fs::path output_path = output_arg / input_arg.filename();
using path = boost::filesystem::path;
path input_arg(argv[arg_offset]);
path output_arg(coutput_arg);
if (boost::filesystem::is_directory(output_arg)) {
path output_path = output_arg / input_arg.filename();
os.open(output_path.string());
} else {
} else
os.open(output_arg.string());
output_dir = output_arg.parent_path();
}
const auto& deck = pack_deck(argv[arg_offset], os);
if (copy_binary) {
Opm::InitConfig init_config(deck);
if (init_config.restartRequested()) {
Opm::IOConfig io_config(deck);
fs::path restart_file(io_config.getRestartFileName( init_config.getRestartRootName(), init_config.getRestartStep(), false ));
copy_file(input_arg.parent_path(), restart_file, output_dir);
}
using IMPORT = Opm::ParserKeywords::IMPORT;
for (std::size_t import_index = 0; import_index < deck.count<IMPORT>(); import_index++) {
const auto& import_keyword = deck.getKeyword<IMPORT>(import_index);
const auto& fname = import_keyword.getRecord(0).getItem<IMPORT::FILE>().get<std::string>(0);
copy_file(input_arg.parent_path(), fname, output_dir);
}
using PYACTION = Opm::ParserKeywords::PYACTION;
for (std::size_t pyaction_index = 0; pyaction_index < deck.count<PYACTION>(); pyaction_index++) {
const auto& pyaction_keyword = deck.getKeyword<PYACTION>(pyaction_index);
const auto& fname = pyaction_keyword.getRecord(1).getItem<PYACTION::FILENAME>().get<std::string>(0);
copy_file(input_arg.parent_path(), fname, output_dir);
}
using GDFILE = Opm::ParserKeywords::GDFILE;
if (deck.hasKeyword<GDFILE>()) {
const auto& gdfile_keyword = deck.getKeyword<GDFILE>();
const auto& fname = gdfile_keyword.getRecord(0).getItem<GDFILE::filename>().get<std::string>(0);
copy_file(input_arg.parent_path(), fname, output_dir);
}
}
pack_deck(argv[arg_offset], os);
}
}

View File

@@ -3,8 +3,8 @@
declare -A configurations
declare -A EXTRA_MODULE_FLAGS
EXTRA_MODULE_FLAGS[opm-simulators]="-DBUILD_EBOS_EXTENSIONS=ON -DBUILD_EBOS_DEBUG_EXTENSIONS=ON -DBUILD_FLOW_VARIANTS=ON -DOPM_ENABLE_PYTHON=ON"
EXTRA_MODULE_FLAGS[opm-common]="-DOPM_ENABLE_PYTHON=ON -DOPM_ENABLE_EMBEDDED_PYTHON=ON -DOPM_INSTALL_PYTHON=ON"
EXTRA_MODULE_FLAGS[opm-simulators]="-DBUILD_EBOS_EXTENSIONS=ON -DBUILD_EBOS_DEBUG_EXTENSIONS=ON"
EXTRA_MODULE_FLAGS[opm-common]="-DOPM_ENABLE_PYTHON=ON -DOPM_ENABLE_EMBEDDED_PYTHON=ON"
# Parse revisions from trigger comment and setup arrays
# Depends on: 'upstreams', upstreamRev',

View File

@@ -45,11 +45,6 @@ done
export REASON
export BRANCH_NAME
$WORKSPACE/deps/opm-simulators/tests/update_reference_data.sh $OPM_TESTS_ROOT
if test $? -eq 5
then
echo "No tests failed - no data to update. Exiting"
exit 0
fi
# Finally open the pull request
cd $OPM_TESTS_ROOT
@@ -86,10 +81,6 @@ then
PRNUMBER=${rev//[!0-9]/}
DATA_PR=`curl -X GET https://api.github.com/repos/OPM/opm-tests/pulls?head=jenkins4opm:$BRANCH_NAME | grep '"number":' | awk -F ':' '{print $2}' | sed -e 's/,//' -e 's/ //'`
git push -u jenkins4opm $BRANCH_NAME -f
fi
if [ -n "$DATA_PR" ]
then
curl -d "{ \"body\": \"Existing PR https://github.com/OPM/opm-tests/pull/$DATA_PR was updated\" }" -X POST https://api.github.com/repos/OPM/$MAIN_REPO/issues/$PRNUMBER/comments?access_token=$GH_TOKEN
else
git-open-pull -u jenkins4opm --base-account OPM --base-repo opm-tests -r /tmp/cmsg $BRANCH_NAME

View File

@@ -21,7 +21,6 @@ namespace Opm {
class EclipseIO;
class ParseContext;
class Parser;
class Python;
class SummaryState;
class msim {
@@ -34,7 +33,7 @@ public:
void well_rate(const std::string& well, data::Rates::opt rate, std::function<well_rate_function> func);
void solution(const std::string& field, std::function<solution_function> func);
void run(Schedule& schedule, EclipseIO& io, bool report_only);
void post_step(Schedule& schedule, SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step);
void post_step(Schedule& schedule, const SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step) const;
private:
void run_step(const Schedule& schedule, SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step, EclipseIO& io) const;

View File

@@ -24,8 +24,6 @@
#include <opm/output/eclipse/Summary.hpp>
#include <opm/output/data/Solution.hpp>
#include <opm/output/data/Wells.hpp>
#include <opm/output/data/Groups.hpp>
#include <opm/parser/eclipse/Python/Python.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ActionContext.hpp>
@@ -43,12 +41,11 @@ msim::msim(const EclipseState& state_arg) :
void msim::run(Schedule& schedule, EclipseIO& io, bool report_only) {
const double week = 7 * 86400;
data::Solution sol;
data::Wells well_data;
SummaryState st(std::chrono::system_clock::from_time_t(schedule.getStartTime()));
Python python;
io.writeInitial();
for (size_t report_step = 1; report_step < schedule.size(); report_step++) {
data::Wells well_data;
if (report_only)
run_step(schedule, st, sol, well_data, report_step, io);
else {
@@ -56,14 +53,11 @@ void msim::run(Schedule& schedule, EclipseIO& io, bool report_only) {
run_step(schedule, st, sol, well_data, report_step, time_step, io);
}
post_step(schedule, st, sol, well_data, report_step);
const auto& exit_status = schedule.exitStatus();
if (exit_status.has_value())
return;
}
}
void msim::post_step(Schedule& schedule, SummaryState& st, data::Solution& /* sol */, data::Wells& /* well_data */, size_t report_step) {
void msim::post_step(Schedule& schedule, const SummaryState& st, data::Solution& /* sol */, data::Wells& /* well_data */, size_t report_step) const {
const auto& actions = schedule.actions(report_step);
if (actions.empty())
return;
@@ -76,9 +70,6 @@ void msim::post_step(Schedule& schedule, SummaryState& st, data::Solution& /* so
if (result)
schedule.applyAction(report_step, *action, result);
}
for (const auto& pyaction : actions.pending_python())
pyaction->run(this->state, schedule, report_step, st);
}
@@ -100,8 +91,6 @@ void msim::run_step(const Schedule& schedule, SummaryState& st, data::Solution&
this->simulate(schedule, st, sol, well_data, report_step, seconds_elapsed, time_step);
Opm::data::Group group_data;
seconds_elapsed += time_step;
io.summary().eval(st,
@@ -110,7 +99,6 @@ void msim::run_step(const Schedule& schedule, SummaryState& st, data::Solution&
this->state,
schedule,
well_data,
group_data,
{});
this->output(st,
@@ -125,11 +113,11 @@ void msim::run_step(const Schedule& schedule, SummaryState& st, data::Solution&
void msim::output(SummaryState& st, size_t report_step, bool substep, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, EclipseIO& io) const {
void msim::output(SummaryState& st, size_t report_step, bool /* substep */, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, EclipseIO& io) const {
RestartValue value(sol, well_data);
io.writeTimeStep(st,
report_step,
substep,
false,
seconds_elapsed,
value);
}
@@ -143,10 +131,6 @@ void msim::simulate(const Schedule& schedule, const SummaryState& st, data::Solu
for (const auto& well_pair : this->well_rates) {
const std::string& well_name = well_pair.first;
const auto& sched_well = schedule.getWell(well_name, report_step);
if (sched_well.getStatus() != Well::Status::OPEN)
continue;
data::Well& well = well_data[well_name];
for (const auto& rate_pair : well_pair.second) {
auto rate = rate_pair.first;

View File

@@ -3,19 +3,28 @@
# defines that must be present in config.h for our headers
set (opm-common_CONFIG_VAR
HAVE_OPENMP
)
"HAS_ATTRIBUTE_UNUSED")
# dependencies
set (opm-common_DEPS
# compile with C99 support if available
"C99"
)
list(APPEND opm-common_DEPS
# various runtime library enhancements
"Boost 1.44.0 COMPONENTS system unit_test_framework REQUIRED"
"OpenMP QUIET"
)
# compile with C++0x/11 support if available
"CXX11Features REQUIRED"
)
if(ENABLE_ECL_INPUT)
list(APPEND opm-common_DEPS
# various runtime library enhancements
"Boost 1.44.0
COMPONENTS system filesystem unit_test_framework regex REQUIRED")
else()
list(APPEND opm-common_DEPS
# various runtime library enhancements
"Boost 1.44.0
COMPONENTS system unit_test_framework REQUIRED")
endif()
# We need a defined target for libecl when linking.
# The definition of the target is done implicitly below when
# libecl is searched for.
find_package_deps(opm-common)

View File

@@ -1,60 +0,0 @@
/*
Copyright 2015 Statoil 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
(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 LOCATION_HPP
#define LOCATION_HPP
namespace Opm {
class Location {
public:
std::string filename = "<memory string>";
std::size_t lineno = 0;
Location() = default;
Location(std::string fname, std::size_t lno) :
filename(std::move(fname)),
lineno(lno)
{}
static Location serializeObject()
{
Location result;
result.filename = "test";
result.lineno = 1;
return result;
}
bool operator==(const Location& data) const {
return filename == data.filename &&
lineno == data.lineno;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(filename);
serializer(lineno);
}
};
}
#endif

View File

@@ -23,10 +23,7 @@
#include <cstdint>
#include <string>
#include <opm/common/OpmLog/Location.hpp>
namespace Opm {
namespace Log {
namespace MessageType {
const int64_t Debug = 1; /* Excessive information */
@@ -59,8 +56,8 @@ namespace Log {
bool isPower2(int64_t x);
std::string fileMessage(const Location& location, const std::string& msg);
std::string fileMessage(int64_t messageType , const Location& location , const std::string& msg);
std::string fileMessage(const std::string& path, int line , const std::string& msg);
std::string fileMessage(int64_t messageType , const std::string& path, int line , const std::string& msg);
std::string prefixMessage(int64_t messageType , const std::string& msg);
std::string colorCodeMessage(int64_t messageType , const std::string& msg);

View File

@@ -1,79 +0,0 @@
/*
Copyright 2019 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
(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 ACTIVEGRIDCELLS_HPP
#define ACTIVEGRIDCELLS_HPP
#include <opm/parser/eclipse/EclipseState/Grid/GridDims.hpp>
#include <array>
namespace Opm
{
/**
* \brief Simple class capturing active cells of a grid
*
*/
class ActiveGridCells
: public GridDims
{
public:
/// \brief Constructs mapping of active cells.
/// \param xyz The cartesian dimensions of the grid
/// \param globalCell Pointer to first entry of contiguous
/// array mapping local index to cartesian one.
/// \param nc The number of cells of a grid.
ActiveGridCells(std::array<int, 3> xyz,
const int* globalCell, std::size_t nc);
/// \brief Constructs mapping of active cells.
/// \param nx Number of cells in x
/// \param ny Number of cells in y
/// \param nz Number of cells in z
/// \param globalCell Pointer to first entry of contiguous
/// array mapping local index to cartesian one.
/// \param nc The number of cells of a grid.
ActiveGridCells(std::size_t nx, std::size_t ny, std::size_t nz,
const int* globalCell, std::size_t nc);
bool cellActive(std::size_t i, std::size_t j, std::size_t k) const;
bool cellActive(std::size_t cartesianIndex) const;
std::vector<int> actNum() const;
/// \brief Get the local index of a cell
/// \param cartesianIndex The cartesian index of the cell
/// \return The local index or -1 if the cell is inactive
int localCell(std::size_t cartesianIndex) const;
/// \brief Get the local index of a cell
/// \param i The index in the i direction
/// \param j The index in the j direction
/// \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.
///
/// nonactive cells are marked with -1.
std::vector<int> localCell_;
};
} // end namespace Opm
#endif // ACTIVEGRIDCELLS_HPP

View File

@@ -1,47 +0,0 @@
/*
Copyright 2019 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
(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_FILESYSTEM_HPP
#define OPM_FILESYSTEM_HPP
#if __cplusplus < 201703L || \
(defined(__GNUC__) && __GNUC__ < 8)
#include <experimental/filesystem>
#else
#include <filesystem>
#endif
#include <string>
namespace Opm
{
#if __cplusplus < 201703L || \
(defined(__GNUC__) && __GNUC__ < 8)
namespace filesystem = std::experimental::filesystem;
#else
namespace filesystem = std::filesystem;
#endif
// A poor man's filesystem::unique_path
std::string unique_path(const std::string& input);
} // end namespace Opm
#endif // OPM_FILESYSTEM_HPP

View File

@@ -1,108 +0,0 @@
#ifndef OPM_UTILITY_STRING_HPP
#define OPM_UTILITY_STRING_HPP
#include <algorithm>
#include <cctype>
#include <sstream>
#include <string>
#include <vector>
namespace Opm {
template< typename T, typename U >
U& uppercase( const T& src, U& dst ) {
const auto up = []( char c ) { return std::toupper( c ); };
std::transform( std::begin( src ), std::end( src ), std::begin( dst ), up );
return dst;
}
template< typename T >
typename std::decay< T >::type uppercase( T&& x ) {
typename std::decay< T >::type t( std::forward< T >( x ) );
return uppercase( t, t );
}
template<typename T>
std::string ltrim_copy(const T& s)
{
auto ret = std::string(s.c_str());
const auto start = ret.find_first_not_of(" \t\n\r\f\v");
if (start == std::string::npos)
return "";
return ret.substr(start);
}
template<typename T>
std::string rtrim_copy(const T& s)
{
auto ret = std::string(s.c_str());
const auto end = ret.find_last_not_of(" \t\n\r\f\v");
if (end == std::string::npos)
return "";
return ret.substr(0, end + 1);
}
template<typename T>
std::string trim_copy(const T& s)
{
return ltrim_copy( rtrim_copy(s) );
}
template<typename T>
void replaceAll(T& data, const T& toSearch, const T& replace)
{
// Get the first occurrence
size_t pos = data.find(toSearch);
// Repeat till end is reached
while (pos != std::string::npos)
{
// Replace this occurrence of Sub String
data.replace(pos, toSearch.size(), replace);
// Get the next occurrence from the current position
pos = data.find(toSearch, pos + replace.size());
}
}
inline std::vector<std::string> split_string(const std::string& input,
char delimiter)
{
std::vector<std::string> result;
std::string token;
std::istringstream tokenStream(input);
while (std::getline(tokenStream, token, delimiter))
result.push_back(token);
return result;
}
inline std::vector<std::string> split_string(const std::string& input,
const std::string& delimiters)
{
std::vector<std::string> result;
std::string::size_type start = 0;
while (start < input.size()) {
auto end = input.find_first_of(delimiters, start);
if (end == std::string::npos) {
result.push_back(input.substr(start));
end = input.size() - 1;
} else if (end != start)
result.push_back(input.substr(start, end-start));
start = end + 1;
}
return result;
}
}
#endif //OPM_UTILITY_STRING_HPP

View File

@@ -20,7 +20,6 @@
#ifndef OPM_TIMESERVICE_HEADER_INCLUDED
#define OPM_TIMESERVICE_HEADER_INCLUDED
#include <chrono>
#include <ctime>
namespace Opm {
@@ -32,43 +31,20 @@ namespace Opm {
int year{0};
int month{0};
int day{0};
bool operator==(const YMD& data) const
{
return year == data.year &&
month == data.month &&
day == data.day;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(year);
serializer(month);
serializer(day);
}
};
TimeStampUTC() = default;
explicit TimeStampUTC(const std::time_t tp);
explicit TimeStampUTC(const YMD& ymd);
TimeStampUTC(int year, int month, int day);
TimeStampUTC(const YMD& ymd,
int hour,
int minutes,
int seconds,
int usec);
TimeStampUTC& operator=(const std::time_t tp);
bool operator==(const TimeStampUTC& data) const;
TimeStampUTC& hour(const int h);
TimeStampUTC& minutes(const int m);
TimeStampUTC& seconds(const int s);
TimeStampUTC& microseconds(const int us);
const YMD& ymd() const { return ymd_; }
int year() const { return this->ymd_.year; }
int month() const { return this->ymd_.month; }
int day() const { return this->ymd_.day; }
@@ -77,18 +53,7 @@ namespace Opm {
int seconds() const { return this->seconds_; }
int microseconds() const { return this->usec_; }
template<class Serializer>
void serializeOp(Serializer& serializer)
{
ymd_.serializeOp(serializer);
serializer(hour_);
serializer(minutes_);
serializer(seconds_);
serializer(usec_);
}
private:
YMD ymd_{};
int hour_{0};
int minutes_{0};
@@ -96,9 +61,7 @@ namespace Opm {
int usec_{0};
};
TimeStampUTC operator+(const TimeStampUTC& lhs, std::chrono::duration<double> delta);
std::time_t asTimeT(const TimeStampUTC& tp);
std::time_t asLocalTimeT(const TimeStampUTC& tp);
} // namespace Opm

View File

@@ -1,6 +1,21 @@
//===========================================================================
//
// File: RootFinders.hpp
//
// Created: Thu May 6 19:59:42 2010
//
// Author(s): Atgeirr F Rasmussen <atgeirr@sintef.no>
// Jostein R Natvig <jostein.r.natvig@sintef.no>
//
// $Date$
//
// $Revision$
//
//===========================================================================
/*
Copyright 2010, 2019 SINTEF Digital
Copyright 2010, 2019 Equinor ASA
Copyright 2010 SINTEF ICT, Applied Mathematics.
Copyright 2010 Statoil ASA.
This file is part of the Open Porous Media project (OPM).
@@ -280,126 +295,6 @@ namespace Opm
template <class ErrorPolicy = ThrowOnError>
class RegulaFalsiBisection
{
public:
inline static std::string name()
{
return "RegulaFalsiBisection";
}
/// Implements a modified regula falsi method as described in
/// "Improved algorithms of Illinois-type for the numerical
/// solution of nonlinear equations"
/// by J. A. Ford. Current variant is the 'Pegasus' method.
/// Combines this method with the bisection method, inspired by
/// http://phillipmfeldman.org/Python/roots/find_roots.html
template <class Functor>
inline static double solve(const Functor& f,
const double a,
const double b,
const int max_iter,
const double tolerance,
int& iterations_used)
{
using namespace std;
const double sqrt_half = std::sqrt(0.5);
const double macheps = numeric_limits<double>::epsilon();
const double eps = tolerance + macheps * max(max(fabs(a), fabs(b)), 1.0);
double x0 = a;
double x1 = b;
double f0 = f(x0);
const double epsF = tolerance + macheps * max(fabs(f0), 1.0);
if (fabs(f0) < epsF) {
return x0;
}
double f1 = f(x1);
if (fabs(f1) < epsF) {
return x1;
}
if (f0 * f1 > 0.0) {
return ErrorPolicy::handleBracketingFailure(a, b, f0, f1);
}
iterations_used = 0;
// In every iteraton, x1 is the last point computed,
// and x0 is the last point computed that makes it a bracket.
double width = fabs(x1 - x0);
double contraction = 1.0;
while (width >= 1e-9 * eps) {
// If we are contracting sufficiently to at least halve
// the interval width in two iterations we use regula
// falsi. Otherwise, we take a bisection step to avoid
// slow convergence.
const double xnew = (contraction < sqrt_half)
? regulaFalsiStep(x0, x1, f0, f1)
: bisectionStep(x0, x1, f0, f1);
const double fnew = f(xnew);
++iterations_used;
if (iterations_used > max_iter) {
return ErrorPolicy::handleTooManyIterations(x0, x1, max_iter);
}
if (fabs(fnew) < epsF) {
return xnew;
}
// Now we must check which point we must replace.
if ((fnew > 0.0) == (f0 > 0.0)) {
// We must replace x0.
x0 = x1;
f0 = f1;
} else {
// We must replace x1, this is the case where
// the modification to regula falsi kicks in,
// by modifying f0.
// 1. The classic Illinois method
// const double gamma = 0.5;
// @afr: The next two methods do not work??!!?
// 2. The method called 'Method 3' in the paper.
// const double phi0 = f1/f0;
// const double phi1 = fnew/f1;
// const double gamma = 1.0 - phi1/(1.0 - phi0);
// 3. The method called 'Method 4' in the paper.
// const double phi0 = f1/f0;
// const double phi1 = fnew/f1;
// const double gamma = 1.0 - phi0 - phi1;
// cout << "phi0 = " << phi0 <<" phi1 = " << phi1 <<
// " gamma = " << gamma << endl;
// 4. The 'Pegasus' method
const double gamma = f1 / (f1 + fnew);
// 5. Straight unmodified Regula Falsi
// const double gamma = 1.0;
f0 *= gamma;
}
x1 = xnew;
f1 = fnew;
const double widthnew = fabs(x1 - x0);
contraction = widthnew/width;
width = widthnew;
}
return 0.5 * (x0 + x1);
}
private:
inline static double regulaFalsiStep(const double a, const double b, const double fa, const double fb)
{
assert(fa * fb < 0.0);
return (b * fa - a * fb) / (fa - fb);
}
inline static double bisectionStep(const double a, const double b, const double fa, const double fb)
{
static_cast<void>(fa);
static_cast<void>(fb);
assert(fa * fb < 0.0);
return 0.5*(a + b);
}
};
/// Attempts to find an interval bracketing a zero by successive
/// enlargement of search interval.
template <class Functor>

View File

@@ -69,11 +69,13 @@
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunneeded-internal-declaration"
#pragma GCC diagnostic ignored "-Wunused-private-field"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wcast-align"
#pragma GCC diagnostic ignored "-Wcast-qual"
#pragma GCC diagnostic ignored "-Wignored-attributes"
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
#endif // COMPATIBLE_COMPILER
#endif // SILENCE_EXTERNAL_WARNINGS

View File

@@ -44,20 +44,16 @@ public:
template <typename T>
const std::vector<T>& getRft(const std::string& name, const std::string& wellName,
int year, int month, int day) const;
template <typename T>
const std::vector<T>& getRft(const std::string& name, int reportIndex) const;
std::vector<std::string> listOfWells() const;
std::vector<RftDate> listOfdates() const;
using RftReportList = std::vector<std::tuple<std::string, RftDate, float>>;
using RftReportList = std::vector<std::pair<std::string, RftDate>>;
const RftReportList& listOfRftReports() const { return rftReportList; }
bool hasRft(const std::string& wellName, const RftDate& date) const;
bool hasRft(const std::string& wellName, int year, int month, int day) const;
std::vector<EclEntry> listOfRftArrays(int reportIndex ) const;
std::vector<EclEntry> listOfRftArrays(const std::string& wellName,
const RftDate& date) const;
@@ -67,12 +63,8 @@ public:
bool hasArray(const std::string& arrayName, const std::string& wellName,
const RftDate& date) const;
bool hasArray(const std::string& arrayName, int reportInd) const;
int numberOfReports() { return numReports; }
private:
std::map<int, std::tuple<int,int>> arrIndexRange;
std::map<int, std::pair<int,int>> arrIndexRange;
int numReports;
std::vector<float> timeList;
@@ -80,11 +72,9 @@ private:
std::set<RftDate> dateList;
RftReportList rftReportList;
std::map<std::tuple<std::string,RftDate>,int> reportIndices; // mapping report index to wellName and date (tupe)
std::map<std::pair<std::string,RftDate>,int> reportIndex; // mapping report index to wellName and date (tupe)
int getReportIndex(const std::string& wellName, const RftDate& date) const;
int getArrayIndex(const std::string& name, int reportIndex) const;
int getArrayIndex(const std::string& name, const std::string& wellName,
const RftDate& date) const;
};

View File

@@ -1,79 +0,0 @@
/*
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
(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_IO_ERSM_HPP
#define OPM_IO_ERSM_HPP
#include <deque>
#include <string>
#include <unordered_map>
#include <variant>
#include <vector>
#include <opm/io/eclipse/SummaryNode.hpp>
#include <opm/common/utility/TimeService.hpp>
namespace Opm { namespace EclIO {
/*
Small class to load RSM files. The RSM file is a text based version of the
information found in the summary file. The format seems quite fragile - with
significant whitespace all over the place.The ambition of this ERsm clas is to
be able to do regression testing of the RSM files we export from the ESmry
class - it is not meant to be a rock-solid-works-in-every-lunar phase RSM
loader.
*/
class ESmry;
class ERsm
{
struct Vector{
SummaryNode header;
std::vector<double> data;
Vector(SummaryNode header_, std::size_t size_advice) :
header(std::move(header_))
{
this->data.reserve(size_advice);
}
};
public:
ERsm(const std::string& fname);
const std::vector<TimeStampUTC>& dates() const;
const std::vector<double>& days() const;
bool has_dates() const;
const std::vector<double>& get(const std::string& key) const;
bool has(const std::string& key) const;
private:
void load_block(std::deque<std::string>& lines , std::size_t& vector_length);
std::unordered_map<std::string, Vector> vectors;
std::variant<std::vector<double>, std::vector<TimeStampUTC>> time;
};
bool cmp(const ESmry& esmr, const ERsm& ersm);
}
}
#endif

View File

@@ -42,19 +42,10 @@ public:
void loadReportStepNumber(int number);
template <typename T>
const std::vector<T>& getRst(const std::string& name, int reportStepNumber, int occurrence);
template <typename T>
const std::vector<T>& getRst(int index, int reportStepNumber){
auto indRange = this->getIndexRange(reportStepNumber);
return this->get<T>(index + std::get<0>(indRange));
}
int count(const std::string& name, int reportStepNumber) const;
size_t numberOfReportSteps() const { return seqnum.size(); };
const std::vector<T>& getRst(const std::string& name, int reportStepNumber);
const std::vector<int>& listOfReportStepNumbers() const { return seqnum; }
std::vector<EclEntry> listOfRstArrays(int reportStepNumber);
friend class OutputStream::Restart;
@@ -68,12 +59,10 @@ private:
void initUnified();
void initSeparate(const int number);
int getArrayIndex(const std::string& name, int seqnum, int occurrence) const;
std::tuple<int,int> getIndexRange(int reportStepNumber) const;
int getArrayIndex(const std::string& name, int seqnum) const;
std::streampos
restartStepWritePosition(const int seqnumValue) const;
};
}} // namespace Opm::EclIO

View File

@@ -19,124 +19,52 @@
#ifndef OPM_IO_ESMRY_HPP
#define OPM_IO_ESMRY_HPP
#include <chrono>
#include <ostream>
#include <string>
#include <unordered_map>
#include <vector>
#include <map>
#include <stdint.h>
#include <opm/common/utility/FileSystem.hpp>
#include <opm/io/eclipse/SummaryNode.hpp>
#include <boost/filesystem.hpp>
namespace Opm { namespace EclIO {
using ArrSourceEntry = std::tuple<std::string, std::string, int, uint64_t>;
using TimeStepEntry = std::tuple<int, int, uint64_t>;
class ESmry
{
public:
// input is smspec (or fsmspec file)
// input is smspec (or fsmspec file)
explicit ESmry(const std::string& filename, bool loadBaseRunData=false);
int numberOfVectors() const { return nVect; }
bool hasKey(const std::string& key) const;
const std::vector<float>& get(const std::string& name) const;
const std::vector<float>& get(const SummaryNode& node) const;
std::vector<std::chrono::system_clock::time_point> dates() const;
std::vector<float> get_at_rstep(const std::string& name) const;
std::vector<float> get_at_rstep(const SummaryNode& node) const;
std::vector<std::chrono::system_clock::time_point> dates_at_rstep() const;
void LoadData(const std::vector<std::string>& vectList) const;
void LoadData() const;
std::chrono::system_clock::time_point startdate() const { return startdat; }
const std::vector<std::string>& keywordList() const;
std::vector<std::string> keywordList(const std::string& pattern) const;
const std::vector<SummaryNode>& summaryNodeList() const;
const std::vector<std::string>& keywordList() const { return keyword; }
int timestepIdxAtReportstepStart(const int reportStep) const;
size_t numberOfTimeSteps() const { return timeStepList.size(); }
const std::string& get_unit(const std::string& name) const;
const std::string& get_unit(const SummaryNode& node) const;
void write_rsm(std::ostream&) const;
void write_rsm_file(std::optional<Opm::filesystem::path> = std::nullopt) const;
private:
Opm::filesystem::path inputFileName;
int nI, nJ, nK, nSpecFiles;
size_t nVect;
std::vector<bool> formattedFiles;
std::vector<std::string> dataFileList;
mutable std::vector<std::vector<float>> vectorData;
mutable std::vector<bool> vectorLoaded;
std::vector<TimeStepEntry> timeStepList;
std::vector<std::map<int, int>> arrayPos;
std::vector<std::string> keyword;
std::map<std::string, int> keyword_index;
std::vector<int> nParamsSpecFile;
std::vector<std::vector<std::string>> keywordListSpecFile;
std::vector<int> seqIndex;
int nVect, nI, nJ, nK;
void ijk_from_global_index(int glob, int &i, int &j, int &k) const;
std::vector<std::vector<float>> param;
std::vector<std::string> keyword;
std::vector<SummaryNode> summaryNodes;
std::unordered_map<std::string, std::string> kwunits;
std::vector<int> seqIndex;
std::vector<float> seqTime;
std::vector<std::string> checkForMultipleResultFiles(const boost::filesystem::path& rootN, bool formatted) const;
void getRstString(const std::vector<std::string>& restartArray,
boost::filesystem::path& pathRst,
boost::filesystem::path& rootN) const;
std::chrono::system_clock::time_point startdat;
std::vector<std::string> checkForMultipleResultFiles(const Opm::filesystem::path& rootN, bool formatted) const;
void getRstString(const std::vector<std::string>& restartArray,
Opm::filesystem::path& pathRst,
Opm::filesystem::path& rootN) const;
void updatePathAndRootName(Opm::filesystem::path& dir, Opm::filesystem::path& rootN) const;
void updatePathAndRootName(boost::filesystem::path& dir, boost::filesystem::path& rootN) const;
std::string makeKeyString(const std::string& keyword, const std::string& wgname, int num) const;
std::string unpackNumber(const SummaryNode&) const;
std::string lookupKey(const SummaryNode&) const;
void write_block(std::ostream &, bool write_dates, const std::vector<std::string>& time_column, const std::vector<SummaryNode>&) const;
template <typename T>
std::vector<T> rstep_vector(const std::vector<T>& full_vector) const {
std::vector<T> result;
result.reserve(seqIndex.size());
for (const auto& ind : seqIndex){
result.push_back(full_vector[ind]);
}
return result;
}
std::vector<std::tuple <std::string, uint64_t>> getListOfArrays(std::string filename, bool formatted);
std::vector<int> makeKeywPosVector(int speInd) const;
};
}} // namespace Opm::EclIO
inline std::ostream& operator<<(std::ostream& os, const Opm::EclIO::ESmry& smry) {
smry.write_rsm(os);
return os;
}
#endif // OPM_IO_ESMRY_HPP

View File

@@ -35,7 +35,7 @@ namespace Opm { namespace EclIO {
class EclFile
{
public:
explicit EclFile(const std::string& filename, bool preload = false);
explicit EclFile(const std::string& filename);
bool formattedInput() { return formatted; }
void loadData(); // load all data
@@ -52,7 +52,7 @@ public:
char_array.clear();
}
using EclEntry = std::tuple<std::string, eclArrType, int64_t>;
using EclEntry = std::tuple<std::string, eclArrType, int>;
std::vector<EclEntry> getList() const;
template <typename T>
@@ -62,10 +62,8 @@ public:
const std::vector<T>& get(const std::string& name);
bool hasKey(const std::string &name) const;
std::size_t count(const std::string& name) const;
const std::vector<std::string>& arrayNames() const { return array_name; }
std::size_t size() const;
protected:
bool formatted;
@@ -79,9 +77,9 @@ protected:
std::vector<std::string> array_name;
std::vector<eclArrType> array_type;
std::vector<int64_t> array_size;
std::vector<int> array_size;
std::vector<uint64_t> ifStreamPos;
std::vector<unsigned long int> ifStreamPos;
std::map<std::string, int> array_index;
@@ -109,7 +107,7 @@ private:
std::vector<bool> arrayLoaded;
void loadBinaryArray(std::fstream& fileH, std::size_t arrIndex);
void loadFormattedArray(const std::string& fileStr, std::size_t arrIndex, int64_t fromPos);
void loadFormattedArray(const std::string& fileStr, std::size_t arrIndex, long int fromPos);
};

View File

@@ -26,7 +26,6 @@
#include <opm/io/eclipse/EclIOdata.hpp>
#include <opm/io/eclipse/PaddedOutputString.hpp>
#include <iostream>
namespace Opm { namespace EclIO { namespace OutputStream {
class Restart;
@@ -79,7 +78,7 @@ public:
friend class OutputStream::SummarySpecification;
private:
void writeBinaryHeader(const std::string& arrName, int64_t size, eclArrType arrType);
void writeBinaryHeader(const std::string& arrName, int size, eclArrType arrType);
template <typename T>
void writeBinaryArray(const std::vector<T>& data);
@@ -95,7 +94,6 @@ private:
void writeFormattedCharArray(const std::vector<std::string>& data);
void writeFormattedCharArray(const std::vector<PaddedOutputString<8>>& data);
void writeArrayType(const eclArrType arrType);
std::string make_real_string(float value) const;
std::string make_doub_string(double value) const;

View File

@@ -27,29 +27,14 @@
namespace Opm { namespace EclIO {
int flipEndianInt(int num);
int64_t flipEndianLongInt(int64_t num);
float flipEndianFloat(float num);
double flipEndianDouble(double num);
bool isEOF(std::fstream* fileH);
std::tuple<int, int> block_size_data_binary(eclArrType arrType);
std::tuple<int, int, int> block_size_data_formatted(eclArrType arrType);
std::string trimr(const std::string &str1);
uint64_t sizeOnDiskBinary(int64_t num, Opm::EclIO::eclArrType arrType);
uint64_t sizeOnDiskFormatted(const int64_t num, Opm::EclIO::eclArrType arrType);
void readBinaryHeader(std::fstream& fileH, std::string& tmpStrName,
int& tmpSize, std::string& tmpStrType);
void readBinaryHeader(std::fstream& fileH, std::string& arrName,
int64_t& size, Opm::EclIO::eclArrType &arrType);
void readFormattedHeader(std::fstream& fileH, std::string& arrName,
int64_t &num, Opm::EclIO::eclArrType &arrType);
}} // namespace Opm::EclIO
#endif // OPM_IO_ECLUTIL_HPP

View File

@@ -1,77 +0,0 @@
/*
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
(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_IO_SUMMARYNODE_HPP
#define OPM_IO_SUMMARYNODE_HPP
#include <functional>
#include <optional>
#include <string>
#include <unordered_set>
namespace Opm::EclIO {
struct SummaryNode {
enum class Category {
Aquifer,
Well,
Group,
Field,
Region,
Block,
Connection,
Segment,
Miscellaneous,
};
enum class Type {
Rate,
Total,
Ratio,
Pressure,
Count,
Mode,
Undefined,
};
std::string keyword;
Category category;
Type type;
std::string wgname;
int number;
constexpr static int default_number { std::numeric_limits<int>::min() };
std::string unique_key() const;
using number_renderer = std::function<std::string(const SummaryNode&)>;
std::string unique_key(number_renderer) const;
bool is_user_defined() const;
static Category category_from_keyword(const std::string&, const std::unordered_set<std::string> &miscellaneous_keywords = {});
std::optional<std::string> display_name() const;
std::optional<std::string> display_number() const;
std::optional<std::string> display_number(number_renderer) const;
};
} // namespace Opm::EclIO
#endif // OPM_IO_SUMMARYNODE_HPP

View File

@@ -1,70 +0,0 @@
/*
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
(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 RST_CONNECTION
#define RST_CONNECTION
#include <array>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Connection.hpp>
namespace Opm {
class UnitSystem;
namespace RestartIO {
class Header;
struct RstConnection {
RstConnection(const ::Opm::UnitSystem& unit_system, std::size_t rst_index, int nsconz, const int* icon, const float* scon, const double *xcon);
static double inverse_peaceman(double cf, double kh, double rw, double skin);
std::size_t rst_index;
std::array<int,3> ijk;
Connection::State state;
int drain_sat_table;
int imb_sat_table;
int completion;
Connection::Direction dir;
int segment;
Connection::CTFKind cf_kind;
float skin_factor;
float cf;
float depth;
float diameter;
float kh;
float segdist_end;
float segdist_start;
double oil_rate;
double water_rate;
double gas_rate;
double pressure;
double resv_rate;
double r0;
};
}
}
#endif

View File

@@ -1,85 +0,0 @@
/*
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
(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 RST_GROUP
#define RST_GROUP
#include <array>
#include <vector>
#include <string>
namespace Opm {
class UnitSystem;
namespace RestartIO {
struct RstHeader;
struct RstGroup {
RstGroup(const UnitSystem& unit_system,
const std::string* zwel,
const int * igrp,
const float * sgrp,
const double * xgrp);
std::string name;
float oil_rate_limit;
float water_rate_limit;
float gas_rate_limit;
float liquid_rate_limit;
float water_surface_limit;
float water_reservoir_limit;
float water_reinject_limit;
float water_voidage_limit;
float gas_surface_limit;
float gas_reservoir_limit;
float gas_reinject_limit;
float gas_voidage_limit;
double oil_production_rate;
double water_production_rate;
double gas_production_rate;
double liquid_production_rate;
double water_injection_rate;
double gas_injection_rate;
double wct;
double gor;
double oil_production_total;
double water_production_total;
double gas_production_total;
double voidage_production_total;
double water_injection_total;
double gas_injection_total;
double voidage_injection_total;
double oil_production_potential;
double water_production_potential;
double history_total_oil_production;
double history_total_water_production;
double history_total_water_injection;
double history_total_gas_production;
double history_total_gas_injection;
};
}
}
#endif

View File

@@ -1,127 +0,0 @@
/*
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
(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 RST_HEADER
#define RST_HEADER
#include <vector>
#include <ctime>
#include <cstddef>
namespace Opm {
namespace RestartIO {
struct RstHeader {
RstHeader(const std::vector<int>& intehead, const std::vector<bool>& logihead, const std::vector<double>& doubhead);
int nx;
int ny;
int nz;
int nactive;
int num_wells;
int ncwmax;
int max_wells_in_group;
int max_groups_in_field;
int max_wells_in_field;
int year;
int month;
int mday;
int hour;
int minute;
int microsecond;
int phase_sum;
int niwelz;
int nswelz;
int nxwelz;
int nzwelz;
int niconz;
int nsconz;
int nxconz;
int nigrpz;
int nsgrpz;
int nxgrpz;
int nzgrpz;
int ncamax;
int niaaqz;
int nsaaqz;
int nxaaqz;
int nicaqz;
int nscaqz;
int nacaqz;
int tstep;
int report_step;
int newtmx;
int newtmn;
int litmax;
int litmin;
int mxwsit;
int mxwpit;
int version;
int iprog;
int nsegwl;
int nswlmx;
int nsegmx;
int nlbrmx;
int nisegz;
int nrsegz;
int nilbrz;
int ntfip ;
int nmfipr;
int nrfreg;
int ntfreg;
int nplmix;
int ngroup;
bool e300_radial;
bool e100_radial;
bool enable_hysteris;
bool enable_msw;
bool is_live_oil;
bool is_wet_gas;
bool const_comp_oil;
bool dir_relperm;
bool reversible_relperm;
bool endscale;
bool dir_eps;
bool reversible_eps;
bool alt_eps;
double next_timestep1;
double next_timestep2;
double max_timestep;
double guide_rate_a;
double guide_rate_b;
double guide_rate_c;
double guide_rate_d;
double guide_rate_e;
double guide_rate_f;
double udq_range;
double udq_undefined;
double udq_eps;
std::pair<std::time_t, std::size_t> restart_info() const;
};
}
}
#endif

View File

@@ -1,78 +0,0 @@
/*
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
(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 RST_SEGMENT
#define RST_SEGMENT
#include <vector>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/icd.hpp>
namespace Opm {
class UnitSystem;
namespace RestartIO {
struct RstSegment {
RstSegment(const ::Opm::UnitSystem& unit_system, int segment_number, const int* iseg, const double * rseg);
int segment;
int outlet_segment;
int branch;
Segment::SegmentType segment_type;
int icd_scaling_mode;
ICDStatus icd_status;
double dist_outlet;
double outlet_dz;
double diameter;
double roughness;
double area;
double volume;
double dist_bhp_ref;
double bhp_ref_dz;
double total_flow;
double water_flow_fraction;
double gas_flow_fraction;
double pressure;
double valve_length;
double valve_area;
double valve_flow_coeff;
double valve_max_area;
double base_strength;
double fluid_density;
double fluid_viscosity;
double critical_water_fraction;
double transition_region_width;
double max_emulsion_ratio;
double max_valid_flow_rate;
double icd_length;
double valve_area_fraction;
std::vector<int> inflow_segments;
};
}
}
#endif

View File

@@ -1,98 +0,0 @@
/*
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
(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 RST_STATE
#define RST_STATE
#include <vector>
#include <string>
#include <opm/io/eclipse/ERst.hpp>
#include <opm/io/eclipse/rst/header.hpp>
#include <opm/io/eclipse/rst/group.hpp>
#include <opm/io/eclipse/rst/well.hpp>
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp>
namespace Opm {
namespace RestartIO {
struct RstState {
RstState(const ::Opm::UnitSystem& unit_system,
const std::vector<int>& intehead,
const std::vector<bool>& logihead,
const std::vector<double>& doubhead,
const std::vector<std::string>& zgrp,
const std::vector<int>& igrp,
const std::vector<float>& sgrp,
const std::vector<double>& xgrp,
const std::vector<std::string>& zwel,
const std::vector<int>& iwel,
const std::vector<float>& swel,
const std::vector<double>& xwel,
const std::vector<int>& icon,
const std::vector<float>& scon,
const std::vector<double>& xcon);
RstState(const ::Opm::UnitSystem& unit_system,
const std::vector<int>& intehead,
const std::vector<bool>& logihead,
const std::vector<double>& doubhead,
const std::vector<std::string>& zgrp,
const std::vector<int>& igrp,
const std::vector<float>& sgrp,
const std::vector<double>& xgrp,
const std::vector<std::string>& zwel,
const std::vector<int>& iwel,
const std::vector<float>& swel,
const std::vector<double>& xwel,
const std::vector<int>& icon,
const std::vector<float>& scon,
const std::vector<double>& xcon,
const std::vector<int>& iseg,
const std::vector<double>& rseg);
static RstState load(EclIO::ERst& rst_file, int report_step);
const RstWell& get_well(const std::string& wname) const;
const ::Opm::UnitSystem unit_system;
RstHeader header;
std::vector<RstWell> wells;
std::vector<RstGroup> groups;
Tuning tuning;
private:
void load_tuning(const std::vector<int>& intehead,
const std::vector<double>& doubhead);
void add_groups(const std::vector<std::string>& zgrp,
const std::vector<int>& igrp,
const std::vector<float>& sgrp,
const std::vector<double>& xgrp);
};
}
}
#endif

View File

@@ -1,129 +0,0 @@
/*
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
(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 RST_WELL
#define RST_WELL
#include <array>
#include <vector>
#include <string>
#include <unordered_map>
#include <opm/io/eclipse/rst/connection.hpp>
#include <opm/io/eclipse/rst/segment.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleTypes.hpp>
namespace Opm {
class UnitSystem;
namespace RestartIO {
struct RstHeader;
struct RstWell {
RstWell(const ::Opm::UnitSystem& unit_system,
const RstHeader& header,
const std::string& group_arg,
const std::string* zwel,
const int * iwel,
const float * swel,
const double * xwel,
const int * icon,
const float * scon,
const double * xcon);
RstWell(const ::Opm::UnitSystem& unit_system,
const RstHeader& header,
const std::string& group_arg,
const std::string* zwel,
const int * iwel,
const float * swel,
const double * xwel,
const int * icon,
const float * scon,
const double * xcon,
const std::vector<int>& iseg,
const std::vector<double>& rseg);
std::string name;
std::string group;
std::array<int, 2> ij;
std::pair<int,int> k1k2;
WellType wtype;
int active_control;
int vfp_table;
int pred_requested_control;
bool allow_xflow;
int hist_requested_control;
int msw_index;
int completion_ordering;
int pvt_table;
float orat_target;
float wrat_target;
float grat_target;
float lrat_target;
float resv_target;
float thp_target;
float bhp_target_float;
float hist_lrat_target;
float hist_grat_target;
float hist_bhp_target;
float datum_depth;
float drainage_radius;
float efficiency_factor;
double oil_rate;
double water_rate;
double gas_rate;
double liquid_rate;
double void_rate;
double flow_bhp;
double wct;
double gor;
double oil_total;
double water_total;
double gas_total;
double void_total;
double water_inj_total;
double gas_inj_total;
double void_inj_total;
double gas_fvf;
double bhp_target_double;
double hist_oil_total;
double hist_wat_total;
double hist_gas_total;
double hist_water_inj_total;
double hist_gas_inj_total;
double water_void_rate;
double gas_void_rate;
const RstSegment segment(int segment_number) const;
std::vector<RstConnection> connections;
std::vector<RstSegment> segments;
};
}
}
#endif

View File

@@ -22,7 +22,7 @@
#include <string>
#include <opm/common/utility/FileSystem.hpp>
#include <boost/filesystem/path.hpp>
struct cJSON;
@@ -30,7 +30,7 @@ namespace Json {
class JsonObject {
public:
explicit JsonObject(const Opm::filesystem::path& jsonFile );
explicit JsonObject(const boost::filesystem::path& jsonFile );
explicit JsonObject(const std::string& inline_json);
explicit JsonObject(const char * inline_json);
explicit JsonObject(cJSON * root);

View File

@@ -1,59 +0,0 @@
/*
Copyright 2019 Statoil 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
(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_OUTPUT_AQUIFER_HPP
#define OPM_OUTPUT_AQUIFER_HPP
#include <map>
#include <memory>
#include <vector>
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
namespace Opm { namespace data {
/**
* Small struct that keeps track of data for output to restart/summary
* files.
*/
enum class AquiferType
{
Fetkovich, CarterTracey,
};
struct FetkovichData {
double initVolume;
double prodIndex;
double timeConstant;
};
struct AquiferData {
int aquiferID; //< One-based ID, range 1..NANAQ
double pressure; //< Aquifer pressure
double volume; //< Produced liquid volume
double initPressure; //< Aquifer's initial pressure
double datumDepth; //< Aquifer's pressure reference depth
AquiferType type;
std::shared_ptr<FetkovichData> aquFet;
};
}} // Opm::data
#endif // OPM_OUTPUT_AQUIFER_HPP

View File

@@ -69,13 +69,6 @@ namespace data {
UnitSystem::measure dim; //< Dimension of the data to write
std::vector<double> data; //< The actual data itself
TargetType target;
bool operator==(const CellData& cell2) const
{
return dim == cell2.dim &&
data == cell2.data &&
target == cell2.target;
}
};
}

View File

@@ -1,112 +0,0 @@
/*
Copyright 2016 Statoil 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
(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_OUTPUT_GROUPS_HPP
#define OPM_OUTPUT_GROUPS_HPP
#include <algorithm>
#include <cstddef>
#include <initializer_list>
#include <map>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <vector>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
namespace Opm {
namespace data {
struct currentGroupConstraints {
Opm::Group::ProductionCMode currentProdConstraint;
Opm::Group::InjectionCMode currentGasInjectionConstraint;
Opm::Group::InjectionCMode currentWaterInjectionConstraint;
template <class MessageBufferType>
void write(MessageBufferType& buffer) const;
template <class MessageBufferType>
void read(MessageBufferType& buffer);
inline currentGroupConstraints& set( Opm::Group::ProductionCMode cpc,
Opm::Group::InjectionCMode cgic,
Opm::Group::InjectionCMode cwic);
};
class Group : public std::map<std::string, Opm::data::currentGroupConstraints> {
public:
template <class MessageBufferType>
void write(MessageBufferType& buffer) const {
unsigned int size = this->size();
buffer.write(size);
for (const auto& witr : *this) {
const std::string& name = witr.first;
buffer.write(name);
const auto& pi_constr = witr.second;
pi_constr.write(buffer);
}
}
template <class MessageBufferType>
void read(MessageBufferType& buffer) {
unsigned int size;
buffer.read(size);
for (size_t i = 0; i < size; ++i) {
std::string name;
buffer.read(name);
currentGroupConstraints cgc;
cgc.read(buffer);
this->emplace(name, cgc);
}
}
};
/* IMPLEMENTATIONS */
template <class MessageBufferType>
void currentGroupConstraints::write(MessageBufferType& buffer) const {
buffer.write(this->currentProdConstraint);
buffer.write(this->currentGasInjectionConstraint);
buffer.write(this->currentWaterInjectionConstraint);
}
template <class MessageBufferType>
void currentGroupConstraints::read(MessageBufferType& buffer) {
buffer.read(this->currentProdConstraint);
buffer.read(this->currentGasInjectionConstraint);
buffer.read(this->currentWaterInjectionConstraint);
}
inline currentGroupConstraints& currentGroupConstraints::set( Opm::Group::ProductionCMode cpc,
Opm::Group::InjectionCMode cgic,
Opm::Group::InjectionCMode cwic) {
this->currentGasInjectionConstraint = cgic;
this->currentWaterInjectionConstraint = cwic;
this->currentProdConstraint = cpc;
return *this;
}
}} // Opm::data
#endif //OPM_OUTPUT_GROUPS_HPP

View File

@@ -30,8 +30,6 @@
#include <unordered_map>
#include <vector>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
namespace Opm {
namespace data {
@@ -84,16 +82,14 @@ namespace Opm {
/// chaining.
inline Rates& set( opt m, double value );
/// Returns true if any of the rates oil, gas, water is nonzero
inline bool flowing() const;
/// true if any option is set; false otherwise
inline bool any() const noexcept;
template <class MessageBufferType>
void write(MessageBufferType& buffer) const;
template <class MessageBufferType>
void read(MessageBufferType& buffer);
bool operator==(const Rates& rat2) const;
private:
double& get_ref( opt );
const double& get_ref( opt ) const;
@@ -121,7 +117,7 @@ namespace Opm {
struct Connection {
using global_index = size_t;
static const constexpr int restart_size = 6;
static const constexpr int restart_size = 2;
global_index index;
Rates rates;
@@ -132,109 +128,17 @@ namespace Opm {
double cell_saturation_gas;
double effective_Kh;
bool operator==(const Connection& conn2) const
{
return index == conn2.index &&
rates == conn2.rates &&
pressure == conn2.pressure &&
reservoir_rate == conn2.reservoir_rate &&
cell_pressure == conn2.cell_pressure &&
cell_saturation_water == conn2.cell_saturation_water &&
cell_saturation_gas == conn2.cell_saturation_gas &&
effective_Kh == conn2.effective_Kh;
}
template <class MessageBufferType>
void write(MessageBufferType& buffer) const;
template <class MessageBufferType>
void read(MessageBufferType& buffer);
};
class SegmentPressures {
public:
enum class Value : std::size_t {
Pressure, PDrop, PDropHydrostatic, PDropAccel, PDropFriction,
};
double& operator[](const Value i)
{
return this->values_[this->index(i)];
}
double operator[](const Value i) const
{
return this->values_[this->index(i)];
}
bool operator==(const SegmentPressures& segpres2) const
{
return this->values_ == segpres2.values_;
}
template <class MessageBufferType>
void write(MessageBufferType& buffer) const
{
for (const auto& value : this->values_) {
buffer.write(value);
}
}
template <class MessageBufferType>
void read(MessageBufferType& buffer)
{
for (auto& value : this->values_) {
buffer.read(value);
}
}
private:
constexpr static std::size_t numvals = 5;
std::array<double, numvals> values_;
std::size_t index(const Value ix) const
{
return static_cast<std::size_t>(ix);
}
};
struct Segment {
Rates rates;
SegmentPressures pressures;
double pressure;
std::size_t segNumber;
bool operator==(const Segment& seg2) const
{
return rates == seg2.rates &&
pressures == seg2.pressures &&
segNumber == seg2.segNumber;
}
template <class MessageBufferType>
void write(MessageBufferType& buffer) const;
template <class MessageBufferType>
void read(MessageBufferType& buffer);
};
struct CurrentControl {
bool isProducer{true};
::Opm::Well::ProducerCMode prod {
::Opm::Well::ProducerCMode::CMODE_UNDEFINED
};
::Opm::Well::InjectorCMode inj {
::Opm::Well::InjectorCMode::CMODE_UNDEFINED
};
bool operator==(const CurrentControl& rhs) const
{
return (this->isProducer == rhs.isProducer)
&& ((this->isProducer && (this->prod == rhs.prod)) ||
(!this->isProducer && (this->inj == rhs.inj)));
}
template <class MessageBufferType>
void write(MessageBufferType& buffer) const;
@@ -250,49 +154,11 @@ namespace Opm {
int control;
std::vector< Connection > connections;
std::unordered_map<std::size_t, Segment> segments;
CurrentControl current_control;
inline bool flowing() const noexcept;
template <class MessageBufferType>
void write(MessageBufferType& buffer) const;
template <class MessageBufferType>
void read(MessageBufferType& buffer);
const Connection* find_connection(Connection::global_index connection_grid_index) const {
const auto connection = std::find_if( this->connections.begin() ,
this->connections.end() ,
[=]( const Connection& c ) {
return c.index == connection_grid_index; });
if( connection == this->connections.end() )
return nullptr;
return &*connection;
}
Connection* find_connection(Connection::global_index connection_grid_index) {
auto connection = std::find_if( this->connections.begin() ,
this->connections.end() ,
[=]( const Connection& c ) {
return c.index == connection_grid_index; });
if( connection == this->connections.end() )
return nullptr;
return &*connection;
}
bool operator==(const Well& well2) const
{
return rates == well2.rates &&
bhp == well2.bhp &&
thp == well2.thp &&
temperature == well2.temperature &&
control == well2.control &&
connections == well2.connections &&
segments == well2.segments &&
current_control == well2.current_control;
}
};
@@ -347,9 +213,10 @@ namespace Opm {
this->emplace(name, well);
}
}
};
using Wells = WellRates;
using Wells = WellRates;
/* IMPLEMENTATIONS */
@@ -385,28 +252,6 @@ namespace Opm {
return *this;
}
inline bool Rates::operator==(const Rates& rate) const
{
return mask == rate.mask &&
wat == rate.wat &&
oil == rate.oil &&
gas == rate.gas &&
polymer == rate.polymer &&
solvent == rate.solvent &&
energy == rate.energy &&
dissolved_gas == rate.dissolved_gas &&
vaporized_oil == rate.vaporized_oil &&
reservoir_water == rate.reservoir_water &&
reservoir_oil == rate.reservoir_oil &&
reservoir_gas == rate.reservoir_gas &&
productivity_index_water == rate.productivity_index_water &&
productivity_index_gas == rate.productivity_index_gas &&
productivity_index_oil == rate.productivity_index_oil &&
well_potential_water == rate.well_potential_water &&
well_potential_oil == rate.well_potential_oil &&
well_potential_gas == rate.well_potential_gas;
}
/*
* To avoid error-prone and repetitve work when extending rates with new
@@ -451,15 +296,12 @@ namespace Opm {
);
}
bool inline Rates::flowing() const {
return ((this->wat != 0) ||
(this->oil != 0) ||
(this->gas != 0));
inline bool Rates::any() const noexcept {
return static_cast< enum_size >( this->mask ) != 0;
}
inline bool Well::flowing() const noexcept {
return this->rates.flowing();
return this->rates.any();
}
template <class MessageBufferType>
@@ -500,19 +342,7 @@ namespace Opm {
void Segment::write(MessageBufferType& buffer) const {
buffer.write(this->segNumber);
this->rates.write(buffer);
this->pressures.write(buffer);
}
template <class MessageBufferType>
void CurrentControl::write(MessageBufferType& buffer) const
{
buffer.write(this->isProducer);
if (this->isProducer) {
buffer.write(this->prod);
}
else {
buffer.write(this->inj);
}
buffer.write(this->pressure);
}
template <class MessageBufferType>
@@ -536,8 +366,6 @@ namespace Opm {
seg.second.write(buffer);
}
}
this->current_control.write(buffer);
}
template <class MessageBufferType>
@@ -578,19 +406,7 @@ namespace Opm {
void Segment::read(MessageBufferType& buffer) {
buffer.read(this->segNumber);
this->rates.read(buffer);
this->pressures.read(buffer);
}
template <class MessageBufferType>
void CurrentControl::read(MessageBufferType& buffer)
{
buffer.read(this->isProducer);
if (this->isProducer) {
buffer.read(this->prod);
}
else {
buffer.read(this->inj);
}
buffer.read(this->pressure);
}
template <class MessageBufferType>
@@ -627,8 +443,6 @@ namespace Opm {
const auto segNumber = seg.segNumber;
this->segments.emplace(segNumber, std::move(seg));
}
this->current_control.read(buffer);
}
}} // Opm::data

View File

@@ -1,122 +0,0 @@
/*
Copyright (c) 2018 Statoil 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
(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_AGGREGATE_Actionx_DATA_HPP
#define OPM_AGGREGATE_Actionx_DATA_HPP
#include <opm/output/eclipse/WindowedArray.hpp>
#include <opm/io/eclipse/PaddedOutputString.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQActive.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQAssign.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQEnums.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunctionTable.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <cstddef>
#include <string>
#include <vector>
#include <map>
namespace Opm {
class Schedule;
class UDQInput;
class UDQActive;
} // Opm
namespace Opm { namespace RestartIO { namespace Helpers {
class AggregateActionxData
{
public:
explicit AggregateActionxData(const std::vector<int>& actDims);
void captureDeclaredActionxData( const Opm::Schedule& sched,
const Opm::SummaryState& st,
const std::vector<int>& actDims,
const std::size_t simStep);
const std::vector<int>& getIACT() const
{
return this->iACT_.data();
}
const std::vector<float>& getSACT() const
{
return this->sACT_.data();
}
const std::vector<EclIO::PaddedOutputString<8>>& getZACT() const
{
return this->zACT_.data();
}
const std::vector<EclIO::PaddedOutputString<8>>& getZLACT() const
{
return this->zLACT_.data();
}
const std::vector<EclIO::PaddedOutputString<8>>& getZACN() const
{
return this->zACN_.data();
}
const std::vector<int>& getIACN() const
{
return this->iACN_.data();
}
const std::vector<double>& getSACN() const
{
return this->sACN_.data();
}
private:
/// Aggregate 'IACT' array (Integer) for all ACTIONX data (9 integers pr UDQ)
WindowedArray<int> iACT_;
/// Aggregate 'SACT' array (Integer) for all ACTIONX data (5 integers pr ACTIONX - currently all zero - meaning unknown)
WindowedArray<float> sACT_;
/// Aggregate 'ZACT' array (Character) for all ACTIONX data. (4 * 8 chars pr ACIONX keyword - name of Action)
WindowedArray<EclIO::PaddedOutputString<8>> zACT_;
/// Aggregate 'ZLACT' array (Character) for all Actionx data. (max 16 * 8 characters pr line (default 80 chars pr line)
WindowedArray<EclIO::PaddedOutputString<8>> zLACT_;
/// Aggregate 'ZACN' array (Character) for all Actionx data (length equal to max no of conditions pr Actionx * the number of Actiox kwords)
WindowedArray<EclIO::PaddedOutputString<8>> zACN_;
/// Aggregate 'IACN' array (Integer) for all Actionx data (length 26* the max number of conditoins pr Actionx * the number of Actionx kwords)
WindowedArray<int> iACN_;
/// Aggregate 'SACN' array (Integer) for all Actionx data (16 * max number of Actionx conditions)
WindowedArray<double> sACN_;
};
}}} // Opm::RestartIO::Helpers
#endif //OPM_AGGREGATE_WELL_DATA_HPP

View File

@@ -23,7 +23,7 @@
#include <opm/output/eclipse/WindowedArray.hpp>
#include <opm/io/eclipse/PaddedOutputString.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
#include <cstddef>
#include <string>
#include <vector>
@@ -32,8 +32,7 @@
namespace Opm {
class Schedule;
class SummaryState;
//class Group;
class UnitSystem;
class Group2;
} // Opm
namespace Opm { namespace RestartIO { namespace Helpers {
@@ -43,11 +42,10 @@ class AggregateGroupData
public:
explicit AggregateGroupData(const std::vector<int>& inteHead);
void captureDeclaredGroupData(const Opm::Schedule& sched,
const Opm::UnitSystem& units,
const std::size_t simStep,
const Opm::SummaryState& sumState,
const std::vector<int>& inteHead);
void captureDeclaredGroupData(const Opm::Schedule& sched,
const std::size_t simStep,
const Opm::SummaryState& sumState,
const std::vector<int>& inteHead);
const std::vector<int>& getIGroup() const
{
@@ -72,14 +70,14 @@ public:
const std::vector<std::string> restart_group_keys = {"GOPP", "GWPP", "GOPR", "GWPR", "GGPR",
"GVPR", "GWIR", "GGIR", "GWCT", "GGOR",
"GOPT", "GWPT", "GGPT", "GVPT", "GWIT",
"GGIT", "GVIT",
"GGIT",
"GOPTH", "GWPTH", "GGPTH",
"GWITH", "GGITH"};
const std::vector<std::string> restart_field_keys = {"FOPP", "FWPP", "FOPR", "FWPR", "FGPR",
"FVPR", "FWIR", "FGIR", "FWCT", "FGOR",
"FOPT", "FWPT", "FGPT", "FVPT", "FWIT",
"FGIT", "FVIT",
"FGIT",
"FOPTH", "FWPTH", "FGPTH",
"FWITH", "FGITH"};
@@ -98,7 +96,6 @@ public:
{"GVPT", 13},
{"GWIT", 15},
{"GGIT", 16},
{"GVIT", 17},
{"GOPP", 22},
{"GWPP", 23},
{"GOPTH", 135},
@@ -107,19 +104,6 @@ public:
{"GGPTH", 143},
{"GGITH", 144},
};
using inj_cmode_enum = Opm::Group::InjectionCMode;
const std::map<inj_cmode_enum, int> cmodeToNum = {
{inj_cmode_enum::NONE, 0},
{inj_cmode_enum::RATE, 1},
{inj_cmode_enum::RESV, 2},
{inj_cmode_enum::REIN, 3},
{inj_cmode_enum::VREP, 4},
{inj_cmode_enum::FLD, 0},
{inj_cmode_enum::SALE, 0},
};
const std::map<std::string, size_t> fieldKeyToIndex = {
{"FOPR", 0},
@@ -136,7 +120,6 @@ public:
{"FVPT", 13},
{"FWIT", 15},
{"FGIT", 16},
{"FVIT", 17},
{"FOPP", 22},
{"FWPP", 23},
{"FOPTH", 135},

View File

@@ -23,7 +23,6 @@
#include <opm/output/eclipse/WindowedArray.hpp>
#include <opm/io/eclipse/PaddedOutputString.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.hpp>
#include <cstddef>
#include <string>
@@ -40,11 +39,6 @@ namespace Opm { namespace data {
}} // Opm::data
namespace Opm { namespace RestartIO { namespace Helpers {
struct ActionResStatus {
std::vector<Opm::Action::Result> result;
std::vector<std::string> name;
};
class AggregateWellData
{

View File

@@ -25,7 +25,7 @@
#include <vector>
namespace Opm {
struct Tuning;
class Tuning;
class Schedule;
class UDQParams;
}
@@ -39,18 +39,7 @@ namespace Opm { namespace RestartIO {
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::duration<double, std::chrono::seconds::period> elapsed;
};
struct guideRate {
double A;
double B;
double C;
double D;
double E;
double F;
double delay;
double damping_fact;
};
DoubHEAD();
~DoubHEAD() = default;
@@ -61,6 +50,7 @@ namespace Opm { namespace RestartIO {
DoubHEAD& operator=(DoubHEAD&& rhs) = default;
DoubHEAD& tuningParameters(const Tuning& tuning,
const std::size_t lookup_step,
const double cnvT);
DoubHEAD& timeStamp(const TimeStamp& ts);
@@ -69,9 +59,8 @@ namespace Opm { namespace RestartIO {
DoubHEAD& drsdt(const Schedule& sched,
const std::size_t lookup_step,
const double cnvT);
DoubHEAD& udq_param(const UDQParams& udqPar);
DoubHEAD& guide_rate_param(const guideRate& guide_rp);
const std::vector<double>& data() const
{

View File

@@ -25,16 +25,15 @@
#include <memory>
#include <vector>
namespace Opm {
class UnitSystem;
namespace RestartIO {
namespace Opm { namespace RestartIO {
class InteHEAD
{
public:
enum class UnitSystem {
Metric, Field, Lab, PVT_M
};
struct WellTableDim {
int numWells;
int maxPerf;
@@ -94,24 +93,8 @@ namespace RestartIO {
struct UdqParam {
int udqParam_1;
int no_wudqs;
int no_gudqs;
int no_fudqs;
int no_iuads;
int no_iuaps;
};
struct ActionParam {
int no_actions;
int max_no_sched_lines_per_action;
int max_no_conditions_per_action;
int max_no_characters_per_line;
};
struct GuideRateNominatedPhase {
int nominated_phase;
};
InteHEAD();
~InteHEAD() = default;
@@ -132,19 +115,14 @@ namespace RestartIO {
InteHEAD& params_NWELZ(const int niwelz, const int nswelz, const int nxwelz, const int nzwelz);
InteHEAD& params_NCON(const int niconz, const int nsconz, const int nxconz);
InteHEAD& params_GRPZ(const std::array<int, 4>& grpz);
InteHEAD& params_NGCTRL(const int gct);
InteHEAD& params_NAAQZ(const int ncamax, const int niaaqz, const int nsaaqz, const int nxaaqz, const int nicaqz, const int nscaqz, const int nacaqz);
InteHEAD& stepParam(const int tstep, const int report_step);
InteHEAD& tuningParam(const TuningPar& tunpar);
InteHEAD& variousParam(const int version, const int iprog);
InteHEAD& wellSegDimensions(const WellSegDims& wsdim);
InteHEAD& regionDimensions(const RegDims& rdim);
InteHEAD& ngroups(const Group& gr);
InteHEAD& ngroups(const Group& gr);
InteHEAD& udqParam_1(const UdqParam& udqpar);
InteHEAD& actionParam(const ActionParam& act_par);
InteHEAD& variousUDQ_ACTIONXParam();
InteHEAD& nominatedPhaseGuideRate(GuideRateNominatedPhase nphase);
InteHEAD& whistControlMode(int mode);
const std::vector<int>& data() const
{

View File

@@ -23,6 +23,7 @@
#include <vector>
namespace Opm {
class Eclipse3DProperties;
class Schedule;
class EclipseGrid;
@@ -30,7 +31,7 @@ namespace out {
class RegionCache {
public:
RegionCache() = default;
RegionCache(const std::vector<int>& fipnum, const EclipseGrid& grid, const Schedule& schedule);
RegionCache(const Eclipse3DProperties& properties, const EclipseGrid& grid, const Schedule& schedule);
const std::vector<std::pair<std::string,size_t>>& connections( int region_id ) const;
private:

View File

@@ -18,19 +18,17 @@
#ifndef RESTART_VALUE_HPP
#define RESTART_VALUE_HPP
#include <map>
#include <string>
#include <utility>
#include <map>
#include <vector>
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
#include <opm/output/data/Aquifer.hpp>
#include <opm/output/data/Solution.hpp>
#include <opm/output/data/Wells.hpp>
namespace Opm {
class RestartKey {
public:
@@ -53,30 +51,24 @@ namespace Opm {
required(_required)
{}
bool operator==(const RestartKey& key2) const
{
return key == key2.key &&
dim == key2.dim &&
required == key2.required;
}
};
/*
A simple class used to communicate values between the simulator and
the RestartIO functions.
A simple class used to communicate values between the simulator and the
RestartIO function.
*/
class RestartValue {
public:
using ExtraVector = std::vector<std::pair<RestartKey, std::vector<double>>>;
data::Solution solution;
data::Wells wells;
ExtraVector extra;
std::vector<data::AquiferData> aquifer;
RestartValue(data::Solution sol, data::Wells wells_arg);
RestartValue() {}
bool hasExtra(const std::string& key) const;
void addExtra(const std::string& key, UnitSystem::measure dimension, std::vector<double> data);
void addExtra(const std::string& key, std::vector<double> data);
@@ -84,15 +76,9 @@ namespace Opm {
void convertFromSI(const UnitSystem& units);
void convertToSI(const UnitSystem& units);
bool operator==(const RestartValue& val2) const
{
return solution == val2.solution &&
wells == val2.wells &&
extra == val2.extra;
}
};
}
#endif // RESTART_VALUE_HPP
#endif

View File

@@ -20,8 +20,6 @@
#ifndef OPM_OUTPUT_SUMMARY_HPP
#define OPM_OUTPUT_SUMMARY_HPP
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
#include <map>
#include <memory>
#include <string>
@@ -38,7 +36,6 @@ namespace Opm {
namespace Opm { namespace data {
class WellRates;
class Group;
}} // namespace Opm::data
namespace Opm { namespace out {
@@ -65,14 +62,12 @@ public:
const EclipseState& es,
const Schedule& schedule,
const data::WellRates& well_solution,
const data::Group& group_solution,
const GlobalProcessParameters& single_values,
const RegionParameters& region_values = {},
const BlockValues& block_values = {}) const;
void write() const;
private:
class SummaryImplementation;
std::unique_ptr<SummaryImplementation> pImpl_;

View File

@@ -1,70 +0,0 @@
/*
Copyright (c) 2019 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
(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_OUTPUT_ECLIPSE_VECTOR_AQUIFER_HPP
#define OPM_OUTPUT_ECLIPSE_VECTOR_AQUIFER_HPP
#include <vector>
namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems {
namespace IAnalyticAquifer {
enum index : std::vector<int>::size_type {
NumAquiferConn = 0,
WatPropTable = 1,
TypeRelated1 = 9,
TypeRelated2 = 10,
};
} // IAnalyticAquifer
namespace SAnalyticAquifer {
enum index : std::vector<float>::size_type {
Compressibility = 0,
FetInitVol = 1,
FetProdIndex = 2,
FetTimeConstant = 3,
CTRadius = 1,
CTPermeability = 2,
CTPorosity = 3,
InitPressure = 4,
DatumDepth = 5,
CTThickness = 6,
CTAngle = 7,
CTWatMassDensity = 8,
CTWatViscosity = 9,
};
} // SAnalyticAquifer
namespace XAnalyticAquifer {
enum index : std::vector<double>::size_type {
FlowRate = 0,
Pressure = 1, // Dynamic aquifer pressure
ProdVolume = 2, // Liquid volume produced from aquifer (into reservoir)
TotalArea = 3,
};
} // XAnalyticAquifer
}}}} // Opm::RestartIO::Helpers::VectorItems
#endif // OPM_OUTPUT_ECLIPSE_VECTOR_AQUIFER_HPP

View File

@@ -49,7 +49,7 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
Diameter = 2, // Connection diameter
EffectiveKH = 3, // Effective Kh product of connection
SkinFactor = 4, // Skinfactor - item 'SKIN' from COMPDAT
item12 = 11, // Connection transmissibility factor
SegDistEnd = 20, // Distance to end of connection in segment
@@ -57,7 +57,6 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
item30 = 29, // Unknown
item31 = 30, // Unknown
CFInDeck = 40, // = 0 for connection factor not defined, = 1 for connection factor defined
};
} // SConn

View File

@@ -27,41 +27,12 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
// This is a subset of the items in src/opm/output/eclipse/DoubHEAD.cpp .
// Promote items from that list to this in order to make them public.
enum doubhead : std::vector<double>::size_type {
TsInit = 1, // Maximum Length of Next Timestep
TsMaxz = 2, // Maximum Length of Timestep After Next
TsMinz = 3, // Minumum Length of All Timesteps
TsMchp = 4,
TsFMax = 5,
TsFMin = 6,
TsFcnv = 7,
TrgTTE = 8,
TrgCNV = 9,
TrgMBE = 10,
TrgLCV = 11,
XxxTTE = 16,
XxxCNV = 17,
XxxMBE = 18,
XxxLCV = 19,
XxxWFL = 20,
TrgDPR = 82,
TfDiff = 83,
DdpLim = 84,
DdsLim = 85,
GRpar_a = 87, // Guiderate parameter A
GRpar_b = 88, // Guiderate parameter B
GRpar_c = 89, // Guiderate parameter C
GRpar_d = 90, // Guiderate parameter D
GRpar_e = 91, // Guiderate parameter E
GRpar_f = 92, // Guiderate parameter F
GRpar_int = 97, // Guiderate parameter delay interval
ThrUPT = 99,
XxxDPR = 100,
TrgFIP = 101,
TrgSFT = 102,
GRpar_damp = 144, // Guiderate parameter damping factor
UdqPar_2 = 212, // UDQPARAM item number 2 (Permitted range (+/-) of user-defined quantities)
UdqPar_3 = 213, // UDQPARAM item number 3 (Value given to undefined elements when outputting data)
UdqPar_4 = 214, // UDQPARAM item number 4 (fractional equality tolerance used in ==, <= etc. functions)
TsInit = 1, // Maximum Length of Next Timestep
TsMaxz = 2, // Maximum Length of Timestep After Next
TsMinz = 3, // Minumum Length of All Timesteps
UdqPar_2 = 212, // UDQPARAM item number 2 (Permitted range (+/-) of user-defined quantities)
UdqPar_3 = 213, // UDQPARAM item number 3 (Value given to undefined elements when outputting data)
UdqPar_4 = 214, // UDQPARAM item number 4 (fractional equality tolerance used in ==, <= etc. functions)
};
}}}} // Opm::RestartIO::Helpers::VectorItems

View File

@@ -24,30 +24,6 @@
namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems {
namespace SGroup {
enum prod_index : std::vector<float>::size_type {
OilRateLimit = 6, // Group's oil production target/limit
WatRateLimit = 7, // Group's water production target/limit
GasRateLimit = 8, // Group's gas production target/limit
LiqRateLimit = 9, // Group's liquid production target/limit
};
enum inj_index : std::vector<float>::size_type {
waterSurfRateLimit = 15, //i Group's water surface volume injection rate target/limit
waterResRateLimit = 16, // Group's water reservoir volume injection rate target/limit
waterReinjectionLimit = 17, // Group's water reinjection fraction target/limit
waterVoidageLimit = 18, // Group's water voidage injection fraction target/limit
gasSurfRateLimit = 20, // Group's gas surface volume injection rate target/limit
gasResRateLimit = 21, // Group's gas reservoir volume injection rate target/limit
gasReinjectionLimit = 22, // Group's gas reinjection fraction target/limit
gasVoidageLimit = 23, // Group's gas voidage injection fraction target/limit
};
} // SGroup
namespace XGroup {
enum index : std::vector<double>::size_type {
OilPrRate = 0, // Group's oil production rate
@@ -67,9 +43,8 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
VoidPrTotal = 13, // Group's total cumulative reservoir
// voidage production
WatInjTotal = 15, // Group's total cumulative water injection
GasInjTotal = 16, // Group's total cumulative gas injection
VoidInjTotal = 17, // Group's total cumulative reservoir volume injection
WatInjTotal = 15, // Group's total cumulative water injection
GasInjTotal = 16, // Group's total cumulative gas injection
OilPrPot = 22, // Group's oil production potential
WatPrPot = 23, // Group's water production potential

View File

@@ -27,110 +27,66 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
// This is a subset of the items in src/opm/output/eclipse/InteHEAD.cpp .
// Promote items from that list to this in order to make them public.
enum intehead : std::vector<int>::size_type {
ISNUM = 0, // An encoded integer corresponding to the
// time the file was created. For files not
// originating from ECLIPSE, this value may
// be set to zero.
ISNUM = 0, // An encoded integer corresponding to the
// time the file was created. For files not
// originating from ECLIPSE, this value may
// be set to zero.
VERSION = 1, // Simulator version
UNIT = 2, // Units convention
// 1: METRIC, 2: FIELD, 3: LAB, 4: PVT-M
VERSION = 1, // Simulator version
UNIT = 2, // Units convention
// 1: METRIC, 2: FIELD, 3: LAB, 4: PVT-M
NX = 8, // #cells in X direction (Cartesian)
NY = 9, // #cells in Y direction (Cartesian)
NZ = 10, // #cells in Z direction (Cartesian)
NACTIV = 11, // Number of active cells
NX = 8, // #cells in X direction (Cartesian)
NY = 9, // #cells in Y direction (Cartesian)
NZ = 10, // #cells in Z direction (Cartesian)
NACTIV = 11, // Number of active cells
PHASE = 14, // Phase indicator:
// 1: oil, 2: water, 3: O/W, 4: gas,
// 5: G/O, 6: G/W, 7: O/G/W
PHASE = 14, // Phase indicator:
// 1: oil, 2: water, 3: O/W, 4: gas,
// 5: G/O, 6: G/W, 7: O/G/W
NWELLS = 16, // Number of wells
NCWMAX = 17, // Maximum number of completions per well
NGRP = 18, // Actual number of groups
NWGMAX = 19, // Maximum number of wells in any well group
NGMAXZ = 20, // Maximum number of groups in field
NWELLS = 16, // Number of wells
NCWMAX = 17, // Maximum number of completions per well
NWGMAX = 19, // Maximum number of wells in any well group
NGMAXZ = 20, // Maximum number of groups in field
NIWELZ = 24, // Number of data elements per well in IWEL array
// (default 97 for ECLIPSE, 94 for ECLIPSE 300).
NSWELZ = 25, // Number of data elements per well in SWEL array
NXWELZ = 26, // Number of delements per well in XWEL array
NZWELZ = 27, // Number of 8-character words per well in ZWEL array
NIWELZ = 24, // Number of data elements per well in IWEL array
// (default 97 for ECLIPSE, 94 for ECLIPSE 300).
NSWELZ = 25, // Number of data elements per well in SWEL array
NXWELZ = 26, // Number of delements per well in XWEL array
NZWELZ = 27, // Number of 8-character words per well in ZWEL array
NICONZ = 32, // Number of data elements per completion
// in ICON array (default 19)
NSCONZ = 33, // Number of data elements per completion in SCON array
NXCONZ = 34, // Number of data elements per completion in XCON array
NICONZ = 32, // Number of data elements per completion
// in ICON array (default 19)
NSCONZ = 33, // Number of data elements per completion in SCON array
NXCONZ = 34, // Number of data elements per completion in XCON array
NIGRPZ = 36, // Number of data elements per group in IGRP array
NSGRPZ = 37, // Number of data elements per group in SGRP array
NXGRPZ = 38, // Number of data elements per group in XGRP array
NZGRPZ = 39, // Number of data elements per group in ZGRP array
NIGRPZ = 36, // Number of data elements per group in IGRP array
NSGRPZ = 37, // Number of data elements per group in SGRP array
NXGRPZ = 38, // Number of data elements per group in XGRP array
NZGRPZ = 39, // Number of data elements per group in ZGRP array
NCAMAX = 41, // Maximum number of analytic aquifer connections
NCAMAX = 41, // Maximum number of analytic aquifer connections
NIAAQZ = 42, // Number of data elements per aquifer in IAAQ array
NSAAQZ = 43, // Number of data elements per aquifer in SAAQ array
NXAAQZ = 44, // Number of data elements per aquifer in XAAQ array
NIAAQZ = 42, // Number of data elements per aquifer in IAAQ array
NSAAQZ = 43, // Number of data elements per aquifer in SAAQ array
NXAAQZ = 44, // Number of data elements per aquifer in XAAQ array
NICAQZ = 45, // Number of data elements per aquifer connection in ICAQ array
NSCAQZ = 46, // Number of data elements per aquifer connection in SCAQ array
NACAQZ = 47, // Number of data elements per aquifer connection in ACAQ array
NICAQZ = 45, // Number of data elements per aquifer connection in ICAQ array
NSCAQZ = 46, // Number of data elements per aquifer connection in SCAQ array
NACAQZ = 47, // Number of data elements per aquifer connection in ACAQ array
NGCTRL = 51, // Index indicating if group control is used or not (1 - if group control, 0 if not)
NWMAXZ = 163, // Maximum number of wells in the model
NSEGWL = 174, // Number of multisegment wells defined with WELSEG
NSWLMX = 175, // Maximum number of segmented wells (item 1 ofWSEGDIMS)
NSEGMX = 176, // Maximum number of segments per well (item 2 of WSEGDIMS)
NLBRMX = 177, // Maximum number of lateral branches (item 3 of WSEGDIMS)
NGRNPH = 58, // Index indicating if group control is used or not (1 - if group control, 0 if not)
DAY = 64, // Calendar day of report step (1..31)
MONTH = 65, // Calendar month of report step (1..12)
YEAR = 66, // Calendar year of report step
NUM_SOLVER_STEPS = 67, //
REPORT_STEP = 68, //
WHISTC = 71, // Calendar year of report step
NEWTMX = 80, // Tuning, Record3, Item1
NEWTMN = 81, // Tuning, Record3, Item2
LITMAX = 82, // Tuning, Record3, Item3
LITMIN = 83, // Tuning, Record3, Item4
MXWSIT = 86, // Tuning, Record3, Item5
MXWPIT = 87, // Tuning, Record3, Item6
NTFIP = 89, // REGDIMS item1, or TABDIMS item 5
IPROG = 94, // IPROG = simulation program identifier: 100 - ECLIPSE 100, 300 - ECLIPSE 300, 500 - ECLIPSE 300
// (thermal option), negative - Other simulator,
NMFIPR = 99, // REGDIMS item2
NOOFACTIONS = 156, // The number of actions in the dataset
MAXNOLINES = 157, // Maximum number of lines of schedule data for ACTION keyword - including ENDACTIO
MAXNOSTRPRLINE = 158, // Maximum number of 8-chars strings pr input line of Action data (rounded up from input)
NWMAXZ = 163, // Maximum number of wells in the model
NSEGWL = 174, // Number of multisegment wells defined with WELSEG
NSWLMX = 175, // Maximum number of segmented wells (item 1 ofWSEGDIMS)
NSEGMX = 176, // Maximum number of segments per well (item 2 of WSEGDIMS)
NLBRMX = 177, // Maximum number of lateral branches (item 3 of WSEGDIMS)
NISEGZ = 178, // Number of entries per segment in ISEG array
NRSEGZ = 179, // Number of entries per segment in RSEG array
NILBRZ = 180, // Number of entries per segment in ILBR array
IHOURZ = 206, // IHOURZ = current simulation time HH:MM:SS number of hours (HH) (0-23).
IMINTS = 207, // IMINTS = current simulation time HH:MM:SS number of minutes (MM) (0-59).
MAX_ACT_COND = 245, // Maximum number of conditions pr action
MAX_AN_AQUIFERS = 252, // Maximum number of analytic aquifers
NO_FIELD_UDQS = 262, // No of Field UDQ data (parameters) /
NO_GROUP_UDQS = 263, // No of Group UDQ data (parameters) /
NO_WELL_UDQS = 266, // No of Well UDQ data (parameters) /
UDQPAR_1 = 267, // Integer seed value for the RAND /
NO_IUADS = 290, // No IUADs
NO_IUAPS = 291, // No IUAPs
RSEED = 296,
ISECND = 410 // ISECND = current simulation time HH:MM:SS - number of seconds (SS), reported in microseconds
// (0-59,999,999)
NISEGZ = 178, // Number of entries per segment in ISEG array
NRSEGZ = 179, // Number of entries per segment in RSEG array
NILBRZ = 180, // Number of entries per segment in ILBR array
UDQPAR_1 = 267, // Integer seed value for the RAND /
};
}}}} // Opm::RestartIO::Helpers::VectorItems

View File

@@ -30,13 +30,7 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
OutSeg = 1, // Outlet segment (one-based)
InSegCurBranch = 2, // Inflow segment current branch (one-based)
BranchNo = 3, // Branch number (one-based)
SegmentType = 11,
ICDScalingMode = 18,
ICDOpenShutFlag = 19,
};
} // ISeg
namespace RSeg {
@@ -56,26 +50,6 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
Pressure = 11, // Segment pressure
item40 = 39, // Unknown
ValveLength = 40, // Length of valve
ValveArea = 41, // Cross-sectional area of valve
ValveFlowCoeff = 42, // Valve's dimensionless flow coefficient
ValveMaxArea = 43, // Maximal cross-sectional valve area
DeviceBaseStrength = 86,
CalibrFluidDensity = 88,
CalibrFluidViscosity = 89,
CriticalWaterFraction = 90,
TransitionRegWidth = 91,
MaxEmulsionRatio = 92,
MaxValidFlowRate = 97,
ICDLength = 102,
ValveAreaFraction = 103,
item106 = 105, // Unknown
item107 = 106, // Unknown
item108 = 107, // Unknown

View File

@@ -62,6 +62,13 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
};
namespace Value {
enum WellType : int {
WTUnk = 0, // Unknown well type (OPM only)
Producer = 1, // Well is producer
OilInj = 2, // Well is oil injector
WatInj = 3, // Well is water injector
GasInj = 4, // Well is gas injector
};
enum WellCtrlMode : int {
WMCtlUnk = -10, // Unknown well control mode (OPM only)
@@ -114,9 +121,6 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
DatumDepth = 9, // Well's reference depth for BHP
DrainageRadius = 17, // Well's drainage radius - item 7 from WELSPECS
EfficiencyFactor1 = 24, // Item2 from WEFAC; this value is repeated at two locations.
EfficiencyFactor2 = 31, //
HistLiqRateTarget = 33, // Well's historical/observed liquid
// rate target/limit
@@ -146,9 +150,8 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
VoidPrTotal = 21, // Well's total cumulative reservoir
// voidage production
WatInjTotal = 23, // Well's total cumulative water injection
GasInjTotal = 24, // Well's total cumulative gas injection
VoidInjTotal = 25, // Well's total cumulative reservoir volume injection
WatInjTotal = 23, // Well's total cumulative water injection
GasInjTotal = 24, // Well's total cumulative gas injection
GasFVF = 34, // Well's producing gas formation volume factor.
@@ -177,7 +180,6 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
namespace ZWell {
enum index : std::vector<const char*>::size_type {
WellName = 0, // Well name
ActionX = 2, // ActionX name
};
} // ZWell
}}}} // Opm::RestartIO::Helpers::VectorItems

View File

@@ -1,46 +0,0 @@
/*
Copyright (c) 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
(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_WRITE_RPT_HPP
#define OPM_WRITE_RPT_HPP
#include <ostream>
namespace Opm {
class Schedule;
class EclipseGrid;
namespace RptIO {
void write_report(
std::ostream&,
const std::string& report,
unsigned value,
const Schedule& schedule,
const EclipseGrid& grid,
std::size_t time_step
);
namespace workers {
void write_WELSPECS(std::ostream&, unsigned, const Schedule&, const EclipseGrid& grid, std::size_t);
} } }
#endif // OPM_WRITE_RPT_HPP

View File

@@ -22,11 +22,15 @@
#include <vector>
// Missing definitions (really belong in ert/ecl_well/well_const.h, but not
// defined there)
#define SCON_KH_INDEX 3
// Forward declarations
namespace Opm {
class Runspec;
class EclipseGrid;
class EclipseState;
class Schedule;
@@ -38,6 +42,8 @@ namespace Opm {
namespace Opm { namespace RestartIO { namespace Helpers {
const double UNIMPLEMENTED_VALUE = 1e-100; // placeholder for values not yet available
std::vector<double>
createDoubHead(const EclipseState& es,
const Schedule& sched,
@@ -45,14 +51,15 @@ namespace Opm { namespace RestartIO { namespace Helpers {
const double simTime,
const double nextTimeStep);
std::vector<int>
createInteHead(const EclipseState& es,
const EclipseGrid& grid,
const Schedule& sched,
const double simTime,
const int num_solver_steps,
const int report_step,
const int lookup_step);
const int lookup_step); // The integer index used to look up dynamic properties, e.g. the number of well.
std::vector<bool>
createLogiHead(const EclipseState& es);
@@ -62,10 +69,6 @@ namespace Opm { namespace RestartIO { namespace Helpers {
const std::size_t lookup_step,
const std::vector<int>& inteHead);
std::vector<int>
createActionxDims( const Runspec& rspec,
const Schedule& sched,
const std::size_t simStep);
}}} // Opm::RestartIO::Helpers

View File

@@ -26,6 +26,8 @@
#include <vector>
#include <string>
#include <boost/filesystem.hpp>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
@@ -77,10 +79,6 @@ namespace Opm {
const DeckKeyword& getKeyword( size_t index ) const {
return getKeyword( Keyword::keywordName, index );
}
template< class Keyword >
std::size_t count() const {
return count( Keyword::keywordName );
}
const std::vector< const DeckKeyword* > getKeywordList( const std::string& keyword ) const;
template< class Keyword >
@@ -102,8 +100,8 @@ namespace Opm {
DeckView( const_iterator first, const_iterator last );
explicit DeckView( std::pair< const_iterator, const_iterator > );
DeckView() = default;
void init( const_iterator, const_iterator );
void reinit( const_iterator, const_iterator );
private:
const_iterator first;
@@ -126,12 +124,11 @@ namespace Opm {
using iterator = std::vector< DeckKeyword >::iterator;
Deck();
Deck( const Deck& );
static Deck serializeObject();
Deck& operator=(const Deck& rhs);
bool operator==(const Deck& data) const;
//! \brief Deleted assignment operator.
Deck& operator=(const Deck& rhs) = delete;
void addKeyword( DeckKeyword&& keyword );
void addKeyword( const DeckKeyword& keyword );
@@ -142,7 +139,6 @@ namespace Opm {
const UnitSystem& getActiveUnitSystem() const;
UnitSystem& getActiveUnitSystem();
UnitSystem& getDefaultUnitSystem();
void selectActiveUnitSystem( UnitSystem::UnitType unit_type );
const std::string& getInputPath() const;
const std::string& getDataFile() const;
@@ -153,30 +149,15 @@ namespace Opm {
iterator end();
void write( DeckOutput& output ) const ;
friend std::ostream& operator<<(std::ostream& os, const Deck& deck);
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(keywordList);
defaultUnits.serializeOp(serializer);
serializer(activeUnits);
serializer(m_dataFile);
serializer(input_path);
serializer(unit_system_access_count);
if (!serializer.isSerializing())
this->init(this->keywordList.begin(), this->keywordList.end());
}
private:
Deck(std::vector<DeckKeyword>&& keywordList);
Deck( std::vector< DeckKeyword >&& );
std::vector< DeckKeyword > keywordList;
UnitSystem defaultUnits;
std::unique_ptr<UnitSystem> activeUnits;
UnitSystem activeUnits;
std::string m_dataFile;
std::string input_path;
mutable std::size_t unit_system_access_count = 0;
};
}
#endif /* DECK_HPP */

View File

@@ -28,25 +28,17 @@
#include <opm/parser/eclipse/Units/Dimension.hpp>
#include <opm/parser/eclipse/Utility/Typetools.hpp>
#include <opm/parser/eclipse/Deck/UDAValue.hpp>
#include <opm/parser/eclipse/Deck/value_status.hpp>
namespace Opm {
class DeckOutput;
class DeckItem {
public:
DeckItem() = default;
DeckItem( const std::string&, int);
DeckItem( const std::string&, RawString);
DeckItem( const std::string&, double);
DeckItem( const std::string&, std::string);
DeckItem( const std::string&, double) = delete;
DeckItem( const std::string&, UDAValue) = delete;
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();
DeckItem( const std::string&, UDAValue);
const std::string& name() const;
@@ -63,25 +55,21 @@ namespace Opm {
// keywords like e.g. SGL), then the remaining values are defaulted. The deck
// creates the defaulted items if all their sizes are fully specified by the
// keyword, though...
size_t size() const;
size_t out_size() const;
size_t data_size() const;
template<typename T>
T get( size_t index ) const;
//template< typename T > T& get( size_t ) ;
template< typename T > T get( size_t ) const;
double getSIDouble( size_t ) const;
std::string getTrimmedString( size_t ) const;
template< typename T > const std::vector< T >& getData() const;
const std::vector< double >& getSIDoubleData() const;
const std::vector<value::status>& getValueStatus() const;
void push_back( UDAValue );
void push_back( int );
void push_back( double );
void push_back( std::string );
void push_back( RawString );
void push_back( UDAValue, size_t );
void push_back( int, size_t );
void push_back( double, size_t );
@@ -90,12 +78,12 @@ namespace Opm {
void push_backDefault( int );
void push_backDefault( double );
void push_backDefault( std::string );
void push_backDefault( RawString );
// trying to access the data of a "dummy default item" will raise an exception
template <typename T>
void push_backDummyDefault();
void push_backDimension( const Dimension& /* activeDimension */,
const Dimension& /* defaultDimension */);
type_tag getType() const;
void write(DeckOutput& writer) const;
@@ -109,6 +97,7 @@ namespace Opm {
account, i.e. two items will compare differently if one is
defaulted and the other has the default value explicitly
set. The default behaviour is cmp_default == false -
i.e. only the actual values in the items will be compared,
itrespective of whether they have been set explicitly or
have been defaulted.
*/
@@ -121,49 +110,23 @@ namespace Opm {
bool operator==(const DeckItem& other) const;
bool operator!=(const DeckItem& other) const;
static bool to_bool(std::string string_value);
bool is_uda() { return (type == get_type< UDAValue >()); };
bool is_double() { return type == get_type< double >(); };
bool is_int() { return type == get_type< int >() ; };
bool is_string() { return type == get_type< std::string >(); };
UDAValue& get_uda() { return uval[0]; };
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(dval);
serializer(ival);
serializer(sval);
serializer.vector(uval);
serializer(type);
serializer(item_name);
serializer.template vector<value::status, false>(value_status);
serializer(raw_data);
serializer.vector(active_dimensions);
serializer.vector(default_dimensions);
}
private:
mutable std::vector< double > dval;
std::vector< int > ival;
std::vector< std::string > sval;
std::vector< RawString > rsval;
std::vector< UDAValue > uval;
type_tag type = type_tag::unknown;
std::string item_name;
std::vector<value::status> value_status;
std::vector< bool > defaulted;
std::vector< Dimension > dimensions;
/*
To save space we mutate the dval object in place when asking for SI
data; the current state of of the dval member is tracked with the
raw_data bool member.
*/
mutable bool raw_data = true;
std::vector< Dimension > active_dimensions;
std::vector< Dimension > default_dimensions;
template< typename T > std::vector< T >& value_ref();
template< typename T > const std::vector< T >& value_ref() const;
template< typename T > void push( T );

View File

@@ -28,8 +28,6 @@
#include <opm/parser/eclipse/Parser/ParserKeyword.hpp>
#include <opm/parser/eclipse/Deck/DeckValue.hpp>
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
#include <opm/parser/eclipse/Deck/value_status.hpp>
#include <opm/common/OpmLog/Location.hpp>
namespace Opm {
class DeckOutput;
@@ -37,22 +35,23 @@ namespace Opm {
class DeckKeyword {
public:
typedef std::vector< DeckRecord >::const_iterator const_iterator;
DeckKeyword();
explicit DeckKeyword(const ParserKeyword& parserKeyword);
DeckKeyword(const Location& location, const std::string& keywordName);
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<std::vector<DeckValue>>& record_list, UnitSystem& system_active, UnitSystem& system_default);
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<int>& data);
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<double>& data, UnitSystem& system_active, UnitSystem& system_default);
static DeckKeyword serializeObject();
DeckKeyword(const ParserKeyword& parserKeyword, const std::string& keywordName);
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<std::vector<DeckValue>>& record_list);
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<int>& data);
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<double>& data);
const std::string& name() const;
void setFixedSize();
const Location& location() const;
void setLocation(const std::pair<const std::string&, std::size_t>& location);
const std::string& getFileName() const;
int getLineNumber() const;
std::pair<std::string, std::size_t> location() const;
size_t size() const;
@@ -61,15 +60,13 @@ namespace Opm {
DeckRecord& getRecord(size_t index);
const DeckRecord& getDataRecord() const;
void setDataKeyword(bool isDataKeyword = true);
void setDoubleRecordKeyword(bool isDoubleRecordKeyword = true);
bool isDataKeyword() const;
bool isDoubleRecordKeyword() const;
const std::vector<int>& getIntData() const;
const std::vector<double>& getRawDoubleData() const;
const std::vector<double>& getSIDoubleData() const;
const std::vector<std::string>& getStringData() const;
const std::vector<value::status>& getValueStatus() const;
const ParserKeyword& parserKeyword() const;
size_t getDataSize() const;
void write( DeckOutput& output ) const;
void write_data( DeckOutput& output ) const;
@@ -91,26 +88,15 @@ namespace Opm {
bool operator!=(const DeckKeyword& other) const;
friend std::ostream& operator<<(std::ostream& os, const DeckKeyword& keyword);
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_keywordName);
m_location.serializeOp(serializer);
serializer.vector(m_recordList);
serializer(m_isDataKeyword);
serializer(m_slashTerminated);
serializer(m_isDoubleRecordKeyword);
}
private:
std::string m_keywordName;
Location m_location;
std::string m_fileName;
int m_lineNumber;
std::vector< DeckRecord > m_recordList;
bool m_isDataKeyword;
bool m_slashTerminated;
bool m_isDoubleRecordKeyword = false;
ParserKeyword parser_keyword;
};
}

View File

@@ -36,8 +36,6 @@ namespace Opm {
DeckRecord() = default;
DeckRecord( std::vector< DeckItem >&& );
static DeckRecord serializeObject();
size_t size() const;
void addItem( DeckItem deckItem );
@@ -72,12 +70,6 @@ namespace Opm {
bool operator==(const DeckRecord& other) const;
bool operator!=(const DeckRecord& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_items);
}
private:
std::vector< DeckItem > m_items;

View File

@@ -26,26 +26,14 @@
namespace Opm {
enum class Section {
RUNSPEC,
GRID,
EDIT,
PROPS,
REGIONS,
SOLUTION,
SUMMARY,
SCHEDULE
};
class UnitSystem;
class Parser;
class DeckSection : public DeckView {
class Section : public DeckView {
public:
using DeckView::const_iterator;
DeckSection( const Deck& deck, const std::string& startKeyword );
Section( const Deck& deck, const std::string& startKeyword );
const std::string& name() const;
const UnitSystem& unitSystem() const;
@@ -70,52 +58,52 @@ class DeckSection : public DeckView {
};
class RUNSPECSection : public DeckSection {
class RUNSPECSection : public Section {
public:
using DeckSection::const_iterator;
explicit RUNSPECSection(const Deck& deck) : DeckSection(deck, "RUNSPEC") {}
using Section::const_iterator;
explicit RUNSPECSection(const Deck& deck) : Section(deck, "RUNSPEC") {}
};
class GRIDSection : public DeckSection {
class GRIDSection : public Section {
public:
using DeckSection::const_iterator;
explicit GRIDSection(const Deck& deck) : DeckSection(deck, "GRID") {}
using Section::const_iterator;
explicit GRIDSection(const Deck& deck) : Section(deck, "GRID") {}
};
class EDITSection : public DeckSection {
class EDITSection : public Section {
public:
using DeckSection::const_iterator;
explicit EDITSection(const Deck& deck) : DeckSection(deck, "EDIT") {}
using Section::const_iterator;
explicit EDITSection(const Deck& deck) : Section(deck, "EDIT") {}
};
class PROPSSection : public DeckSection {
class PROPSSection : public Section {
public:
using DeckSection::const_iterator;
explicit PROPSSection(const Deck& deck) : DeckSection(deck, "PROPS") {}
using Section::const_iterator;
explicit PROPSSection(const Deck& deck) : Section(deck, "PROPS") {}
};
class REGIONSSection : public DeckSection {
class REGIONSSection : public Section {
public:
using DeckSection::const_iterator;
explicit REGIONSSection(const Deck& deck) : DeckSection(deck, "REGIONS") {}
using Section::const_iterator;
explicit REGIONSSection(const Deck& deck) : Section(deck, "REGIONS") {}
};
class SOLUTIONSection : public DeckSection {
class SOLUTIONSection : public Section {
public:
using DeckSection::const_iterator;
explicit SOLUTIONSection(const Deck& deck) : DeckSection(deck, "SOLUTION") {}
using Section::const_iterator;
explicit SOLUTIONSection(const Deck& deck) : Section(deck, "SOLUTION") {}
};
class SUMMARYSection : public DeckSection {
class SUMMARYSection : public Section {
public:
using DeckSection::const_iterator;
explicit SUMMARYSection(const Deck& deck) : DeckSection(deck, "SUMMARY") {}
using Section::const_iterator;
explicit SUMMARYSection(const Deck& deck) : Section(deck, "SUMMARY") {}
};
class SCHEDULESection : public DeckSection {
class SCHEDULESection : public Section {
public:
using DeckSection::const_iterator;
explicit SCHEDULESection(const Deck& deck) : DeckSection(deck, "SCHEDULE") {}
using Section::const_iterator;
explicit SCHEDULESection(const Deck& deck) : Section(deck, "SCHEDULE") {}
};
}

View File

@@ -34,55 +34,31 @@ public:
UDAValue();
explicit UDAValue(double);
explicit UDAValue(const std::string&);
explicit UDAValue(const Dimension& dim);
UDAValue(double data, const Dimension& dim);
UDAValue(const std::string& data, const Dimension& dim);
static UDAValue serializeObject();
/*
The get<double>() and get<std::string>() methods will throw an
exception if the internal type and the template parameter disagree.
*/
template<typename T>
T get() const;
/*
The getSI() can only be called for numerical values.
*/
double getSI() const;
bool zero() const;
template<typename T>
bool is() const;
void reset(double value);
void reset(const std::string& value);
void assert_numeric() const;
void assert_numeric(const std::string& error_msg) const;
void set_dim(const Dimension& dim) const;
const Dimension& get_dim() const;
bool operator==(const UDAValue& other) const;
bool operator!=(const UDAValue& other) const;
UDAValue& operator=(double value);
UDAValue& operator=(const std::string& value);
bool is_numeric() { return numeric_value; }
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(numeric_value);
serializer(double_value);
serializer(string_value);
dim.serializeOp(serializer);
}
private:
bool numeric_value;
double double_value;
std::string string_value;
Dimension dim;
/* This 'mutable' modifier is a hack to avoid tampering with the overall
const-ness of the data in a deck item. */
mutable Dimension dim;
};
std::ostream& operator<<( std::ostream& stream, const UDAValue& uda_value );

View File

@@ -1,56 +0,0 @@
/*
Copyright 2019 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
(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 VALUE_STATUS
#define VALUE_STATUS
namespace Opm {
namespace value {
enum class status : unsigned char { uninitialized = 0,
deck_value = 1,
empty_default = 2,
valid_default = 3 };
inline bool defaulted(status st) {
if (st == status::empty_default)
return true;
if (st == status::valid_default)
return true;
return false;
}
inline bool has_value(status st) {
if (st == status::deck_value)
return true;
if (st == status::valid_default)
return true;
return false;
}
}
}
#endif

View File

@@ -26,10 +26,7 @@
implement the analytical aquifer models in OPM Flow.
*/
#include <unordered_map>
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/FaceDir.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/A.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/Deck/DeckItem.hpp>
@@ -37,71 +34,44 @@
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
namespace Opm {
namespace{
struct AquanconRecord;
}
class Aquancon {
public:
struct AquancCell {
int aquiferID;
std::size_t global_index;
std::pair<bool, double> influx_coeff;
double influx_mult;
FaceDir::DirEnum face_dir;
struct AquanconOutput{
int aquiferID;
std::vector<size_t> global_index;
std::vector<std::shared_ptr<double>> influx_coeff; // Size = size(global_index)
std::vector<double> influx_multiplier; // Size = size(global_index)
std::vector<int> reservoir_face_dir; // Size = size(global_index)
std::vector<int> record_index;
};
AquancCell(int aquiferID_arg, std::size_t gi, const std::pair<bool, double>& ic, double im, FaceDir::DirEnum fd) :
aquiferID(aquiferID_arg),
global_index(gi),
influx_coeff(ic),
influx_mult(im),
face_dir(fd)
{}
AquancCell() = default;
bool operator==(const AquancCell& other) const {
return this->aquiferID == other.aquiferID &&
this->global_index == other.global_index &&
this->influx_coeff == other.influx_coeff &&
this->influx_mult == other.influx_mult &&
this->face_dir == other.face_dir;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(aquiferID);
serializer(global_index);
serializer(influx_coeff);
serializer(influx_mult);
serializer(face_dir);
}
};
Aquancon() = default;
Aquancon(const EclipseGrid& grid, const Deck& deck);
Aquancon(const std::unordered_map<int, std::vector<Aquancon::AquancCell>>& data);
static Aquancon serializeObject();
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;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.map(cells);
}
const std::vector<Aquancon::AquanconOutput>& getAquOutput() const;
private:
static std::vector<Aquancon::AquanconOutput> logic_application(const std::vector<Aquancon::AquanconOutput>& original_vector);
static void collate_function(std::vector<Aquancon::AquanconOutput>& output_vector,
std::vector<Opm::AquanconRecord>& m_aqurecord,
const std::vector<int>& m_aquiferID_per_record, int m_maxAquID);
static void convert_record_id_to_aquifer_id(std::vector<int>& record_indices_matching_id, int i,
const std::vector<int>& m_aquiferID_per_record);
// for a cell to be inside reservoir, its indices need to be within the reservoir grid dimension range,
// and it needs to be active
static bool cellInsideReservoirAndActive(const EclipseGrid& grid, int i, int j, int k);
static bool neighborCellInsideReservoirAndActive(const EclipseGrid& grid, int i, int j, int k, FaceDir::DirEnum faceDir);
std::unordered_map<int, std::vector<Aquancon::AquancCell>> cells;
std::vector<Aquancon::AquanconOutput> m_aquoutput;
};
}

View File

@@ -39,93 +39,61 @@
namespace Opm {
class TableManager;
class EclipseState;
class AquiferCT {
public:
struct AQUCT_data{
struct AQUCT_data{
AQUCT_data(const DeckRecord& record, const TableManager& tables);
AQUCT_data() = default;
AQUCT_data(int aqID,
int infID,
int pvtID,
double phi_aq_,
double d0_,
double C_t_,
double r_o_,
double k_a_,
double c1_,
double h_,
double theta_,
double c2_,
const std::pair<bool, double>& p0_,
const std::vector<double>& td_,
const std::vector<double>& pi_,
const std::vector<int>& cell_id_);
// Aquifer ID
int aquiferID;
// Table IDs
int inftableID, pvttableID;
std::vector<int> cell_id;
// Variables constants
double phi_aq , //aquifer porosity
d0, //aquifer datum depth
C_t , //total compressibility
r_o , //aquifer inner radius
k_a , //aquifer permeability
c1, // 0.008527 (METRIC, PVT-M); 0.006328 (FIELD); 3.6 (LAB)
h , //aquifer thickness
theta , //angle subtended by the aquifer boundary
c2 ; //6.283 (METRIC, PVT-M); 1.1191 (FIELD); 6.283 (LAB).
int aquiferID;
int inftableID, pvttableID;
std::shared_ptr<double> p0; //Initial aquifer pressure at datum depth, d0
std::vector<double> td, pi;
};
double phi_aq , // aquifer porosity
d0, // aquifer datum depth
C_t , // total compressibility
r_o , // aquifer inner radius
k_a , // aquifer permeability
c1, // 0.008527 (METRIC, PVT-M); 0.006328 (FIELD); 3.6 (LAB)
h , // aquifer thickness
theta , // angle subtended by the aquifer boundary
c2 ; // 6.283 (METRIC, PVT-M); 1.1191 (FIELD); 6.283 (LAB).
AquiferCT(const EclipseState& eclState, const Deck& deck);
std::pair<bool, double> p0; //Initial aquifer pressure at datum depth, d0
std::vector<double> td, pi;
std::vector<int> cell_id;
const std::vector<AquiferCT::AQUCT_data>& getAquifers() const;
int getAqInflTabID(size_t aquiferIndex);
int getAqPvtTabID(size_t aquiferIndex);
bool operator==(const AQUCT_data& other) const;
private:
template<class Serializer>
void serializeOp(Serializer& serializer)
std::vector<AquiferCT::AQUCT_data> m_aquct;
//Set the default Pd v/s Td tables (constant terminal rate case for an infinite aquifer) as described in
//Van Everdingen, A. & Hurst, W., December, 1949.The Application of the Laplace Transformation to Flow Problems in Reservoirs.
//Petroleum Transactions, AIME.
inline void set_default_tables(std::vector<double>& td, std::vector<double>& pi)
{
serializer(aquiferID);
serializer(inftableID);
serializer(pvttableID);
serializer(phi_aq);
serializer(d0);
serializer(C_t);
serializer(r_o);
serializer(k_a);
serializer(c1);
serializer(h);
serializer(theta);
serializer(c2);
serializer(p0);
serializer(td);
serializer(pi);
serializer(cell_id);
std::vector<double> default_pressure_ = { 0.112, 0.229, 0.315, 0.376, 0.424, 0.469, 0.503, 0.564, 0.616, 0.659, 0.702, 0.735,
0.772, 0.802, 0.927, 1.02, 1.101, 1.169, 1.275, 1.362, 1.436, 1.5, 1.556, 1.604,
1.651, 1.829, 1.96, 2.067, 2.147, 2.282, 2.388, 2.476, 2.55, 2.615, 2.672, 2.723,
2.921, 3.064, 3.173, 3.263, 3.406, 3.516, 3.608, 3.684, 3.75, 3.809, 3.86 };
std::vector<double> default_time_ = { 0.01, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1,
1.5, 2, 2.5, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 40, 50, 60, 70,
80, 90, 100, 150, 200, 250, 300, 400, 500, 600, 700, 800, 900, 1000 };
td = default_time_;
pi = default_pressure_;
}
};
AquiferCT() = default;
AquiferCT(const TableManager& tables, const Deck& deck);
AquiferCT(const std::vector<AquiferCT::AQUCT_data>& data);
static AquiferCT serializeObject();
std::size_t size() const;
std::vector<AquiferCT::AQUCT_data>::const_iterator begin() const;
std::vector<AquiferCT::AQUCT_data>::const_iterator end() const;
const std::vector<AquiferCT::AQUCT_data>& data() const;
bool operator==(const AquiferCT& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_aquct);
}
private:
std::vector<AquiferCT::AQUCT_data> m_aquct;
};
}

View File

@@ -1,63 +0,0 @@
/*
Copyright (C) 2020 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_AUQIFER_CONFIG_HPP
#define OPM_AUQIFER_CONFIG_HPP
#include <opm/parser/eclipse/EclipseState/Aquancon.hpp>
#include <opm/parser/eclipse/EclipseState/Aquifetp.hpp>
#include <opm/parser/eclipse/EclipseState/AquiferCT.hpp>
namespace Opm {
class TableManager;
class EclipseGrid;
class Deck;
class AquiferConfig {
public:
AquiferConfig() = default;
AquiferConfig(const TableManager& tables, const EclipseGrid& grid, const Deck& deck);
AquiferConfig(const Aquifetp& fetp, const AquiferCT& ct, const Aquancon& conn);
static AquiferConfig serializeObject();
bool active() const;
const AquiferCT& ct() const;
const Aquifetp& fetp() const;
const Aquancon& connections() const;
bool operator==(const AquiferConfig& other);
template<class Serializer>
void serializeOp(Serializer& serializer)
{
aquifetp.serializeOp(serializer);
aquiferct.serializeOp(serializer);
aqconn.serializeOp(serializer);
}
private:
Aquifetp aquifetp;
AquiferCT aquiferct;
Aquancon aqconn;
};
}
#endif

View File

@@ -25,66 +25,49 @@
This includes the logic for parsing as well as the associated tables. It is meant to be used by opm-grid and opm-simulators in order to
implement the Fetkovich analytical aquifer model in OPM Flow.
*/
#include <vector>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/A.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/Deck/DeckItem.hpp>
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/Aqudims.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/TableContainer.hpp>
#include <boost/concept_check.hpp>
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
namespace Opm {
class Deck;
class DeckRecord;
class Aquifetp {
public:
class Aquifetp {
public:
struct AQUFETP_data{
struct AQUFETP_data{
AQUFETP_data(const DeckRecord& record);
AQUFETP_data() = default;
AQUFETP_data(int aquiferID_, int pvttableID_, double J_, double C_t_, double V0_, double d0_, const std::pair<bool, double>& p0_);
bool operator==(const AQUFETP_data& other) const;
// Aquifer ID
int aquiferID;
// Table IDs
int inftableID, pvttableID;
std::vector<int> cell_id;
// Variables constants
double J, // Specified Productivity Index
rho, // water density in the aquifer
C_t, // total rock compressibility
V0, // initial volume of water in aquifer
d0; // aquifer datum depth
std::shared_ptr<double> p0; //Initial aquifer pressure at datum depth d0 - nullptr if the pressure has been defaulted.
};
int aquiferID;
int pvttableID;
double J, // Specified Productivity Index
C_t, // total rock compressibility
V0, // initial volume of water in aquifer
d0; // aquifer datum depth
std::pair<bool, double> p0;
Aquifetp(const Deck& deck);
const std::vector<Aquifetp::AQUFETP_data>& getAquifers() const;
int getAqPvtTabID(size_t aquiferIndex);
private:
std::vector<Aquifetp::AQUFETP_data> m_aqufetp;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(aquiferID);
serializer(pvttableID);
serializer(J);
serializer(C_t);
serializer(V0);
serializer(d0);
serializer(p0);
}
};
Aquifetp() = default;
Aquifetp(const Deck& deck);
Aquifetp(const std::vector<Aquifetp::AQUFETP_data>& data);
static Aquifetp serializeObject();
const std::vector<Aquifetp::AQUFETP_data>& data() const;
std::size_t size() const;
std::vector<Aquifetp::AQUFETP_data>::const_iterator begin() const;
std::vector<Aquifetp::AQUFETP_data>::const_iterator end() const;
bool operator==(const Aquifetp& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_aqufetp);
}
private:
std::vector<Aquifetp::AQUFETP_data> m_aqufetp;
};
}

View File

@@ -0,0 +1,112 @@
/*
Copyright 2016 Statoil 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 (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_ECLIPSE_PROPERTIES_HPP
#define OPM_ECLIPSE_PROPERTIES_HPP
#include <vector>
#include <string>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/Deck/DeckItem.hpp>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/GridProperties.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/GridProperty.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/TableManager.hpp>
namespace Opm {
class Box;
class BoxManager;
class Deck;
class DeckItem;
class DeckKeyword;
class DeckRecord;
class EclipseGrid;
class Section;
class TableManager;
class UnitSystem;
/// Class representing properties on 3D grid for use in EclipseState.
class Eclipse3DProperties
{
public:
Eclipse3DProperties() = default;
Eclipse3DProperties(const Deck& deck,
const TableManager& tableManager,
const EclipseGrid& eclipseGrid);
Eclipse3DProperties( UnitSystem unit_system,
const TableManager& tableManager,
const EclipseGrid& eclipseGrid);
std::vector< int > getRegions( const std::string& keyword ) const;
std::string getDefaultRegionKeyword() const;
const GridProperty<int>& getIntGridProperty ( const std::string& keyword ) const;
const GridProperty<double>& getDoubleGridProperty ( const std::string& keyword ) const;
const GridProperties<int>& getIntProperties() const;
const GridProperties<double>& getDoubleProperties() const;
bool hasDeckIntGridProperty(const std::string& keyword) const;
bool hasDeckDoubleGridProperty(const std::string& keyword) const;
bool supportsGridProperty(const std::string& keyword) const;
private:
const GridProperty<int>& getRegion(const DeckItem& regionItem) const;
void processGridProperties(const Deck& deck,
const EclipseGrid& eclipseGrid);
void scanSection(const Section& section,
const EclipseGrid& eclipseGrid,
bool edit_section);
void handleADDKeyword( const DeckKeyword& deckKeyword, BoxManager& boxManager);
void handleBOXKeyword( const DeckKeyword& deckKeyword, BoxManager& boxManager);
void handleCOPYKeyword( const DeckKeyword& deckKeyword, BoxManager& boxManager);
void handleENDBOXKeyword( BoxManager& boxManager);
void handleEQUALSKeyword( const DeckKeyword& deckKeyword, BoxManager& boxManager);
void handleMAXVALUEKeyword(const DeckKeyword& deckKeyword, BoxManager& boxManager);
void handleMINVALUEKeyword(const DeckKeyword& deckKeyword, BoxManager& boxManager);
void handleMULTIPLYKeyword(const DeckKeyword& deckKeyword, BoxManager& boxManager);
void handleADDREGKeyword( const DeckKeyword& deckKeyword );
void handleCOPYREGKeyword( const DeckKeyword& deckKeyword );
void handleEQUALREGKeyword(const DeckKeyword& deckKeyword );
void handleMULTIREGKeyword(const DeckKeyword& deckKeyword );
void handleOPERATEKeyword( const DeckKeyword& deckKeyword, BoxManager& boxManager);
void handleOPERATERKeyword( const DeckKeyword& deckKeyword);
void loadGridPropertyFromDeckKeyword(const Box& inputBox,
const DeckKeyword& deckKeyword,
bool edity_section);
void adjustSOGCRwithSWL();
std::string m_defaultRegion;
UnitSystem m_deckUnitSystem;
GridProperties<int> m_intGridProperties;
GridProperties<double> m_doubleGridProperties;
};
}
#endif // OPM_ECLIPSE_PROPERTIES_HPP

View File

@@ -24,37 +24,30 @@
#include <opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp>
#include <opm/parser/eclipse/EclipseState/IOConfig/IOConfig.hpp>
#include <opm/parser/eclipse/EclipseState/IOConfig/RestartConfig.hpp>
namespace Opm {
class Deck;
class ParseContext;
class ErrorGuard;
class EclipseConfig
{
public:
EclipseConfig() = default;
EclipseConfig(const Deck& deck);
EclipseConfig(const InitConfig& initConfig, const IOConfig& io_conf);
static EclipseConfig serializeObject();
EclipseConfig(const Deck& deck, const ParseContext& parseContext, ErrorGuard& errors);
const InitConfig& init() const;
IOConfig& io();
const IOConfig& io() const;
IOConfig& io();
const RestartConfig& restart() const;
const InitConfig& getInitConfig() const;
bool operator==(const EclipseConfig& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
m_initConfig.serializeOp(serializer);
io_config.serializeOp(serializer);
}
const RestartConfig& getRestartConfig() const;
private:
InitConfig m_initConfig;
IOConfig io_config;
IOConfig m_ioConfig;
const InitConfig m_initConfig;
RestartConfig m_restartConfig;
};
}

View File

@@ -23,12 +23,11 @@
#include <memory>
#include <vector>
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/EclipseState/AquiferConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Eclipse3DProperties.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseConfig.hpp>
#include <opm/parser/eclipse/EclipseState/TracerConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Edit/EDITNNC.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/FaultCollection.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/NNC.hpp>
@@ -39,8 +38,6 @@
namespace Opm {
bool enable3DPropsTesting();
template< typename > class GridProperty;
template< typename > class GridProperties;
@@ -53,13 +50,13 @@ namespace Opm {
class EclipseGrid;
class InitConfig;
class IOConfig;
class ParseContext;
class RestartConfig;
class DeckSection;
class Section;
class SimulationConfig;
class TableManager;
class UnitSystem;
class EclipseState {
public:
enum EnabledTypes {
@@ -69,16 +66,20 @@ namespace Opm {
AllProperties = IntProperties | DoubleProperties
};
EclipseState() = default;
template<typename T>
EclipseState(const Deck& deck , const ParseContext& parseContext, T&& errors);
EclipseState(const Deck& deck , const ParseContext& parseContext, ErrorGuard& errors);
EclipseState(const Deck& deck);
virtual ~EclipseState() = default;
const IOConfig& getIOConfig() const;
IOConfig& getIOConfig();
const InitConfig& getInitConfig() const;
const SimulationConfig& getSimulationConfig() const;
virtual const EclipseGrid& getInputGrid() const;
const RestartConfig& getRestartConfig() const;
RestartConfig& getRestartConfig();
const EclipseGrid& getInputGrid() const;
const FaultCollection& getFaults() const;
const TransMult& getTransMult() const;
@@ -93,14 +94,10 @@ namespace Opm {
const EDITNNC& getInputEDITNNC() const;
bool hasInputEDITNNC() const;
// The potentially parallelized field properties
virtual const FieldPropsManager& fieldProps() const;
// Always the non-parallel field properties
virtual const FieldPropsManager& globalFieldProps() const;
const Eclipse3DProperties& get3DProperties() const;
const TableManager& getTableManager() const;
const EclipseConfig& getEclipseConfig() const;
const EclipseConfig& cfg() const;
const GridDims& gridDims() const;
// the unit system used by the deck. note that it is rarely needed to convert
// units because internally to opm-parser everything is represented by SI
@@ -113,55 +110,31 @@ namespace Opm {
void applyModifierDeck(const Deck& deck);
const Runspec& runspec() const;
const AquiferConfig& aquifer() const;
const TracerConfig& tracer() const;
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_inputEditNnc.serializeOp(serializer);
m_gridDims.serializeOp(serializer);
m_simulationConfig.serializeOp(serializer);
m_transMult.serializeOp(serializer);
m_faults.serializeOp(serializer);
serializer(m_title);
aquifer_config.serializeOp(serializer);
tracer_config.serializeOp(serializer);
}
private:
void initIOConfigPostSchedule(const Deck& deck);
void initTransMult();
void initFaults(const Deck& deck);
void setMULTFLT(const Opm::DeckSection& section);
void setMULTFLT(const Opm::Section& section);
void complainAboutAmbiguousKeyword(const Deck& deck,
const std::string& keywordName);
protected:
TableManager m_tables;
const TableManager m_tables;
Runspec m_runspec;
EclipseConfig m_eclipseConfig;
UnitSystem m_deckUnitSystem;
NNC m_inputNnc;
EDITNNC m_inputEditNnc;
EclipseGrid m_inputGrid;
GridDims m_gridDims;
FieldPropsManager field_props;
SimulationConfig m_simulationConfig;
Eclipse3DProperties m_eclipseProperties;
const SimulationConfig m_simulationConfig;
TransMult m_transMult;
FaultCollection m_faults;
std::string m_title;
AquiferConfig aquifer_config;
TracerConfig tracer_config;
};
}

View File

@@ -31,10 +31,6 @@ public:
/// Construct from input deck
explicit EDITNNC(const Deck& deck);
/// Returns an instance used for serialization test
static EDITNNC serializeObject();
/// \brief Get an ordered set of EDITNNC
const std::vector<NNCdata>& data() const
{
@@ -45,14 +41,6 @@ public:
/// \brief Whether EDITNNC was empty.
bool empty() const;
bool operator==(const EDITNNC& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer.vector(m_editnnc);
}
private:
std::vector<NNCdata> m_editnnc;
};

Some files were not shown because too many files have changed in this diff Show More