Skip to content

Commit

Permalink
Merge pull request #4627 from akva2/import_opm_models
Browse files Browse the repository at this point in the history
Import opm-models
  • Loading branch information
bska authored Sep 3, 2024
2 parents d90d711 + a26b981 commit f3db660
Show file tree
Hide file tree
Showing 376 changed files with 121,879 additions and 17 deletions.
59 changes: 53 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ macro (config_hook)
if(dune-fem_FOUND)
opm_need_version_of ("dune-fem")
endif()
opm_need_version_of ("opm-models")

if(NOT fmt_FOUND)
include(DownloadFmt)
Expand All @@ -293,6 +292,21 @@ macro (config_hook)
if(BUILD_FLOW_FLOAT_VARIANTS)
set(FLOW_INSTANTIATE_FLOAT 1)
endif()

# The parameter system can leverage std::from_chars() for
# floating-point types if available. Detect support for this
# feature.
try_compile(
have_float_from_chars
${CMAKE_BINARY_DIR}
${PROJECT_SOURCE_DIR}/cmake/test/testFloatFromChars.cpp
CXX_STANDARD 17
)

set(HAVE_FLOATING_POINT_FROM_CHARS 0)
if(have_float_from_chars)
set(HAVE_FLOATING_POINT_FROM_CHARS 1)
endif()
endmacro (config_hook)

macro (prereqs_hook)
Expand Down Expand Up @@ -371,6 +385,44 @@ opm_add_test(test_tuning_tsinit_nextstep
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} opmcommon
ONLY_COMPILE)

# this test is identical to the simulation of the lens problem that
# uses the element centered finite volume discretization in
# conjunction with automatic differentiation
# (lens_immiscible_ecfv_ad). The only difference is that it uses
# multiple compile units in order to ensure that eWoms code can be
# used within libraries that use the same type tag within multiple
# compile units.
opm_add_test(lens_immiscible_ecfv_ad_mcu
SOURCES
examples/lens_immiscible_ecfv_ad_cu1.cpp
examples/lens_immiscible_ecfv_ad_cu2.cpp
examples/lens_immiscible_ecfv_ad_main.cpp
LIBRARIES
opmsimulators opmcommon
ONLY_COMPILE)

if(QuadMath_FOUND)
foreach(tapp co2injection_flash_ni_ecfv
co2injection_flash_ni_vcfv
co2injection_flash_ecfv
co2injection_flash_vcfv)
opm_add_test(${tapp}_quad
EXE_NAME ${tapp}_quad
SOURCES
examples/${tapp}.cpp
ONLY_COMPILE)
target_link_libraries(${tapp}_quad QuadMath::QuadMath)
target_compile_definitions(${tapp}_quad PRIVATE HAVE_QUAD=1)
endforeach()
endif()

target_sources(test_outputdir PRIVATE $<TARGET_OBJECTS:moduleVersion>)
target_sources(test_equil PRIVATE $<TARGET_OBJECTS:moduleVersion>)
target_sources(test_RestartSerialization PRIVATE $<TARGET_OBJECTS:moduleVersion>)
target_sources(test_glift1 PRIVATE $<TARGET_OBJECTS:moduleVersion>)

include (${CMAKE_CURRENT_SOURCE_DIR}/modelTests.cmake)

if (HAVE_OPM_TESTS)
include (${CMAKE_CURRENT_SOURCE_DIR}/compareECLFiles.cmake)
endif()
Expand All @@ -379,11 +431,6 @@ if(MPI_FOUND)
include (${CMAKE_CURRENT_SOURCE_DIR}/parallelUnitTests.cmake)
endif()

target_sources(test_outputdir PRIVATE $<TARGET_OBJECTS:moduleVersion>)
target_sources(test_equil PRIVATE $<TARGET_OBJECTS:moduleVersion>)
target_sources(test_RestartSerialization PRIVATE $<TARGET_OBJECTS:moduleVersion>)
target_sources(test_glift1 PRIVATE $<TARGET_OBJECTS:moduleVersion>)

include(OpmBashCompletion)

if (NOT BUILD_FLOW)
Expand Down
Loading

0 comments on commit f3db660

Please sign in to comment.