diff --git a/Applications/ApplicationsLib/ProjectData.cpp b/Applications/ApplicationsLib/ProjectData.cpp index 9fe6549e7d8..95eece38395 100644 --- a/Applications/ApplicationsLib/ProjectData.cpp +++ b/Applications/ApplicationsLib/ProjectData.cpp @@ -94,10 +94,12 @@ #ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION #include "ProcessLib/LargeDeformation/CreateLargeDeformationProcess.h" #endif -#ifdef OGS_BUILD_PROCESS_LIE -#include "ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.h" +#ifdef OGS_BUILD_PROCESS_LIE_M #include "ProcessLib/LIE/SmallDeformation/CreateSmallDeformationProcess.h" #endif +#ifdef OGS_BUILD_PROCESS_LIE_HM +#include "ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.h" +#endif #ifdef OGS_BUILD_PROCESS_LIQUIDFLOW #include "ProcessLib/LiquidFlow/CreateLiquidFlowProcess.h" #endif @@ -897,7 +899,7 @@ void ProjectData::parseProcesses( } else #endif -#ifdef OGS_BUILD_PROCESS_LIE +#ifdef OGS_BUILD_PROCESS_LIE_HM if (type == "HYDRO_MECHANICS_WITH_LIE") { if ( //! \ogs_file_param{prj__processes__process__HYDRO_MECHANICS_WITH_LIE__dimension} @@ -1058,7 +1060,7 @@ void ProjectData::parseProcesses( } else #endif -#ifdef OGS_BUILD_PROCESS_LIE +#ifdef OGS_BUILD_PROCESS_LIE_M if (type == "SMALL_DEFORMATION_WITH_LIE") { if ( //! \ogs_file_param{prj__processes__process__SMALL_DEFORMATION_WITH_LIE__dimension} diff --git a/Applications/Utils/PostProcessing/CMakeLists.txt b/Applications/Utils/PostProcessing/CMakeLists.txt index dd7f5165c1a..5d0474842a0 100644 --- a/Applications/Utils/PostProcessing/CMakeLists.txt +++ b/Applications/Utils/PostProcessing/CMakeLists.txt @@ -1,4 +1,4 @@ -if(OGS_BUILD_PROCESS_LIE) +if(OGS_BUILD_PROCESS_LIE_M OR OGS_BUILD_PROCESS_LIE_HM) ogs_add_executable(postLIE postLIE.cpp) target_link_libraries(postLIE GitInfoLib LIECommon MeshToolsLib tclap) install(TARGETS postLIE RUNTIME DESTINATION bin) diff --git a/Applications/Utils/Tests.cmake b/Applications/Utils/Tests.cmake index 40f982958d2..dba8d3eb0e7 100644 --- a/Applications/Utils/Tests.cmake +++ b/Applications/Utils/Tests.cmake @@ -57,7 +57,7 @@ AddTest( WORKING_DIRECTORY ${Data_SOURCE_DIR}/LIE/PostProcessing EXECUTABLE postLIE EXECUTABLE_ARGS -i single_joint.pvd -o ${Data_BINARY_DIR}/LIE/PostProcessing/post_single_joint.pvd - REQUIREMENTS OGS_BUILD_PROCESS_LIE + REQUIREMENTS OGS_BUILD_PROCESS_LIE_M OR OGS_BUILD_PROCESS_LIE_HM TESTER vtkdiff DIFF_DATA expected_post_single_joint_ts_1_t_1.000000.vtu post_single_joint_ts_1_t_1.000000.vtu u u 1e-14 1e-14 @@ -69,7 +69,7 @@ AddTest( WORKING_DIRECTORY ${Data_SOURCE_DIR}/LIE/PostProcessing EXECUTABLE postLIE EXECUTABLE_ARGS -i single_joint_3D.pvd -o ${Data_BINARY_DIR}/LIE/PostProcessing/post_single_joint_3D.pvd - REQUIREMENTS OGS_BUILD_PROCESS_LIE + REQUIREMENTS OGS_BUILD_PROCESS_LIE_M OR OGS_BUILD_PROCESS_LIE_HM TESTER vtkdiff DIFF_DATA post_single_joint_3D_ts_1_t_1.000000.vtu post_single_joint_3D_ts_1_t_1.000000.vtu u u 1e-14 1e-14 diff --git a/ProcessLib/CMakeLists.txt b/ProcessLib/CMakeLists.txt index 0ba3ad42c8a..014271adde7 100644 --- a/ProcessLib/CMakeLists.txt +++ b/ProcessLib/CMakeLists.txt @@ -1,8 +1,22 @@ # Collect the process libraries in interface library add_library(Processes INTERFACE) +# Check whether LIE processes are enabled foreach(process ${_enabled_processes}) - add_subdirectory(${process}) + if(process STREQUAL "LIE_M" OR process STREQUAL "LIE_HM") + add_subdirectory(LIE/Common) + break() + endif() +endforeach() + +foreach(process ${_enabled_processes}) + if(process STREQUAL "LIE_HM") + add_subdirectory(LIE/HydroMechanics) + elseif(process STREQUAL "LIE_M") + add_subdirectory(LIE/SmallDeformation) + else() + add_subdirectory(${process}) + endif() target_link_libraries(Processes INTERFACE ${process}) set_target_properties(${process} PROPERTIES JOB_POOL_COMPILE heavy_tasks) endforeach() @@ -19,27 +33,18 @@ append_source_files(SOURCES Utils) append_source_files(SOURCES Reflection) append_source_files(SOURCES Graph) # For processes that contains both hydraulical process and mechanical process -# Define a function to check if enabled_processes contains LIE, HydroMechanics, -# ThermoHydroMechanics, RichardsMechanics, or ThermoRichardsMechanics -function(check_enabled_processes contains_hm_process) - set(${contains_hm_process} FALSE PARENT_SCOPE) - foreach(process ${_enabled_processes}) - if(process STREQUAL "LIE" - OR process STREQUAL "HydroMechanics" - OR process STREQUAL "ThermoHydroMechanics" - OR process STREQUAL "RichardsMechanics" - OR process STREQUAL "TH2M" - OR process STREQUAL "ThermoRichardsMechanics" - ) - set(${contains_hm_process} TRUE PARENT_SCOPE) - return() - endif() - endforeach() -endfunction() -check_enabled_processes(contains_hm_process) -if(contains_hm_process) - append_source_files(SOURCES Common/HydroMechanics) -endif() +foreach(process ${_enabled_processes}) + if(process STREQUAL "LIE_HM" + OR process STREQUAL "HydroMechanics" + OR process STREQUAL "ThermoHydroMechanics" + OR process STREQUAL "RichardsMechanics" + OR process STREQUAL "TH2M" + OR process STREQUAL "ThermoRichardsMechanics" + ) + append_source_files(SOURCES Common/HydroMechanics) + break() + endif() +endforeach() ogs_add_library(ProcessLib GENERATE_EXPORT_HEADER ${SOURCES}) diff --git a/ProcessLib/LIE/CMakeLists.txt b/ProcessLib/LIE/CMakeLists.txt deleted file mode 100644 index 0f4f73ee021..00000000000 --- a/ProcessLib/LIE/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -add_subdirectory(Common) -get_source_files(SOURCES HydroMechanics) -append_source_files(SOURCES HydroMechanics/LocalAssembler) -append_source_files(SOURCES SmallDeformation) -append_source_files(SOURCES SmallDeformation/LocalAssembler) - -ogs_add_library(LIE ${SOURCES}) -target_link_libraries(LIE PUBLIC ProcessLib LIECommon PRIVATE ParameterLib) - -target_precompile_headers(LIE PRIVATE [["BaseLib/Error.h"]] - [["BaseLib/ConfigTree.h"]] [["BaseLib/Logging.h"]] - [["ProcessLib/Process.h"]] [["MaterialLib/MPL/Medium.h"]] - [["MaterialLib/MPL/Property.h"]] ) - -if(OGS_BUILD_TESTING) - include(HydroMechanics/Tests.cmake) - include(SmallDeformation/Tests.cmake) -endif() diff --git a/ProcessLib/LIE/HydroMechanics/CMakeLists.txt b/ProcessLib/LIE/HydroMechanics/CMakeLists.txt new file mode 100644 index 00000000000..5b5f08991dd --- /dev/null +++ b/ProcessLib/LIE/HydroMechanics/CMakeLists.txt @@ -0,0 +1,14 @@ +get_source_files(SOURCES) +append_source_files(SOURCES LocalAssembler) + +ogs_add_library(LIE_HM ${SOURCES}) +target_link_libraries(LIE_HM PUBLIC ProcessLib LIECommon PRIVATE ParameterLib) + +target_precompile_headers(LIE_HM PRIVATE [["BaseLib/Error.h"]] + [["BaseLib/ConfigTree.h"]] [["BaseLib/Logging.h"]] + [["ProcessLib/Process.h"]] [["MaterialLib/MPL/Medium.h"]] + [["MaterialLib/MPL/Property.h"]] ) + +if(OGS_BUILD_TESTING) + include(Tests.cmake) +endif() diff --git a/ProcessLib/LIE/SmallDeformation/CMakeLists.txt b/ProcessLib/LIE/SmallDeformation/CMakeLists.txt new file mode 100644 index 00000000000..239308c7898 --- /dev/null +++ b/ProcessLib/LIE/SmallDeformation/CMakeLists.txt @@ -0,0 +1,14 @@ +get_source_files(SOURCES) +append_source_files(SOURCES LocalAssembler) + +ogs_add_library(LIE_M ${SOURCES}) +target_link_libraries(LIE_M PUBLIC ProcessLib LIECommon PRIVATE ParameterLib) + +target_precompile_headers(LIE_M PRIVATE [["BaseLib/Error.h"]] + [["BaseLib/ConfigTree.h"]] [["BaseLib/Logging.h"]] + [["ProcessLib/Process.h"]] [["MaterialLib/MPL/Medium.h"]] + [["MaterialLib/MPL/Property.h"]] ) + +if(OGS_BUILD_TESTING) + include(Tests.cmake) +endif() diff --git a/scripts/cmake/ProcessesSetup.cmake b/scripts/cmake/ProcessesSetup.cmake index 9acebf1b6f3..e29191542f1 100644 --- a/scripts/cmake/ProcessesSetup.cmake +++ b/scripts/cmake/ProcessesSetup.cmake @@ -7,7 +7,8 @@ set(_processes_list HeatTransportBHE HydroMechanics LiquidFlow - LIE + LIE_M + LIE_HM ThermoRichardsMechanics RichardsComponentTransport RichardsFlow