Skip to content

Commit f3db660

Browse files
authored
Merge pull request #4627 from akva2/import_opm_models
Import opm-models
2 parents d90d711 + a26b981 commit f3db660

File tree

376 files changed

+121879
-17
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

376 files changed

+121879
-17
lines changed

CMakeLists.txt

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ macro (config_hook)
275275
if(dune-fem_FOUND)
276276
opm_need_version_of ("dune-fem")
277277
endif()
278-
opm_need_version_of ("opm-models")
279278

280279
if(NOT fmt_FOUND)
281280
include(DownloadFmt)
@@ -293,6 +292,21 @@ macro (config_hook)
293292
if(BUILD_FLOW_FLOAT_VARIANTS)
294293
set(FLOW_INSTANTIATE_FLOAT 1)
295294
endif()
295+
296+
# The parameter system can leverage std::from_chars() for
297+
# floating-point types if available. Detect support for this
298+
# feature.
299+
try_compile(
300+
have_float_from_chars
301+
${CMAKE_BINARY_DIR}
302+
${PROJECT_SOURCE_DIR}/cmake/test/testFloatFromChars.cpp
303+
CXX_STANDARD 17
304+
)
305+
306+
set(HAVE_FLOATING_POINT_FROM_CHARS 0)
307+
if(have_float_from_chars)
308+
set(HAVE_FLOATING_POINT_FROM_CHARS 1)
309+
endif()
296310
endmacro (config_hook)
297311

298312
macro (prereqs_hook)
@@ -371,6 +385,44 @@ opm_add_test(test_tuning_tsinit_nextstep
371385
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} opmcommon
372386
ONLY_COMPILE)
373387

388+
# this test is identical to the simulation of the lens problem that
389+
# uses the element centered finite volume discretization in
390+
# conjunction with automatic differentiation
391+
# (lens_immiscible_ecfv_ad). The only difference is that it uses
392+
# multiple compile units in order to ensure that eWoms code can be
393+
# used within libraries that use the same type tag within multiple
394+
# compile units.
395+
opm_add_test(lens_immiscible_ecfv_ad_mcu
396+
SOURCES
397+
examples/lens_immiscible_ecfv_ad_cu1.cpp
398+
examples/lens_immiscible_ecfv_ad_cu2.cpp
399+
examples/lens_immiscible_ecfv_ad_main.cpp
400+
LIBRARIES
401+
opmsimulators opmcommon
402+
ONLY_COMPILE)
403+
404+
if(QuadMath_FOUND)
405+
foreach(tapp co2injection_flash_ni_ecfv
406+
co2injection_flash_ni_vcfv
407+
co2injection_flash_ecfv
408+
co2injection_flash_vcfv)
409+
opm_add_test(${tapp}_quad
410+
EXE_NAME ${tapp}_quad
411+
SOURCES
412+
examples/${tapp}.cpp
413+
ONLY_COMPILE)
414+
target_link_libraries(${tapp}_quad QuadMath::QuadMath)
415+
target_compile_definitions(${tapp}_quad PRIVATE HAVE_QUAD=1)
416+
endforeach()
417+
endif()
418+
419+
target_sources(test_outputdir PRIVATE $<TARGET_OBJECTS:moduleVersion>)
420+
target_sources(test_equil PRIVATE $<TARGET_OBJECTS:moduleVersion>)
421+
target_sources(test_RestartSerialization PRIVATE $<TARGET_OBJECTS:moduleVersion>)
422+
target_sources(test_glift1 PRIVATE $<TARGET_OBJECTS:moduleVersion>)
423+
424+
include (${CMAKE_CURRENT_SOURCE_DIR}/modelTests.cmake)
425+
374426
if (HAVE_OPM_TESTS)
375427
include (${CMAKE_CURRENT_SOURCE_DIR}/compareECLFiles.cmake)
376428
endif()
@@ -379,11 +431,6 @@ if(MPI_FOUND)
379431
include (${CMAKE_CURRENT_SOURCE_DIR}/parallelUnitTests.cmake)
380432
endif()
381433

382-
target_sources(test_outputdir PRIVATE $<TARGET_OBJECTS:moduleVersion>)
383-
target_sources(test_equil PRIVATE $<TARGET_OBJECTS:moduleVersion>)
384-
target_sources(test_RestartSerialization PRIVATE $<TARGET_OBJECTS:moduleVersion>)
385-
target_sources(test_glift1 PRIVATE $<TARGET_OBJECTS:moduleVersion>)
386-
387434
include(OpmBashCompletion)
388435

389436
if (NOT BUILD_FLOW)

0 commit comments

Comments
 (0)