diff --git a/CMakeLists.txt b/CMakeLists.txt index e2fd3d38..f5b0fb54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ option(Idefix_WERROR "Treat compiler warnings as errors" OFF) set(Idefix_CXX_FLAGS "" CACHE STRING "Additional compiler/linker flag") set(Idefix_DEFS "definitions.hpp" CACHE FILEPATH "Problem definition header file") set(Idefix_RECONSTRUCTION "Linear" CACHE STRING "Type of cell reconstruction scheme") +option(Idefix_HDF5 "Enable HDF5 I/O (requires HDF5 library)" OFF) if(Idefix_MHD) option(Idefix_EVOLVE_VECTOR_POTENTIAL "Evolve the vector potential instead of the field (helps reducing div(B) in long runs)" OFF) endif() @@ -80,6 +81,10 @@ if(Idefix_MPI) add_compile_definitions("WITH_MPI") find_package(MPI REQUIRED) target_link_libraries(idefix MPI::MPI_CXX) + target_sources(idefix + PUBLIC src/mpi.cpp + PUBLIC src/mpi.hpp + ) endif() if(Idefix_HDF5) @@ -87,6 +92,10 @@ if(Idefix_HDF5) if(Idefix_MPI) set(HDF5_PREFER_PARALLEL TRUE) endif() + target_sources(idefix + PUBLIC src/output/xdmf.cpp + PUBLIC src/output/xdmf.hpp + ) find_package(HDF5 REQUIRED) target_link_libraries(idefix "${HDF5_LIBRARIES}") target_include_directories(idefix PUBLIC "${HDF5_INCLUDE_DIRS}") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4e7265fd..5ab15369 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -31,12 +31,7 @@ target_sources(idefix PUBLIC ${CMAKE_CURRENT_LIST_DIR}/timeIntegrator.hpp PUBLIC ${CMAKE_CURRENT_LIST_DIR}/timeIntegrator.cpp ) +# NOTE: mpi file are added by the root CMakeLists along with dependencies to the MPI library -if(Idefix_MPI) - target_sources(idefix - PUBLIC ${CMAKE_CURRENT_LIST_DIR}/mpi.cpp - PUBLIC ${CMAKE_CURRENT_LIST_DIR}/mpi.hpp - ) -endif() #add_subdirectory("${PROJECT_BINARY_DIR}" "${PROJECT_BINARY_DIR}/local") diff --git a/src/output/CMakeLists.txt b/src/output/CMakeLists.txt index 5aff2ed5..af581ec8 100644 --- a/src/output/CMakeLists.txt +++ b/src/output/CMakeLists.txt @@ -6,9 +6,3 @@ target_sources(idefix PUBLIC ${CMAKE_CURRENT_LIST_DIR}/vtk.cpp PUBLIC ${CMAKE_CURRENT_LIST_DIR}/vtk.hpp ) -if(Idefix_HDF5) -target_sources(idefix - PUBLIC ${CMAKE_CURRENT_LIST_DIR}/xdmf.cpp - PUBLIC ${CMAKE_CURRENT_LIST_DIR}/xdmf.hpp - ) -endif() diff --git a/test/HD/KHI/idefix.ini b/test/HD/KHI/idefix.ini index 7aada60f..3441a921 100644 --- a/test/HD/KHI/idefix.ini +++ b/test/HD/KHI/idefix.ini @@ -22,5 +22,4 @@ X3-beg outflow X3-end outflow [Output] -vtk 0.01 -xdmf 0.01 +vtk 0.01 diff --git a/test/HD/SedovBlastWave/CMakeLists.txt b/test/HD/SedovBlastWave/CMakeLists.txt new file mode 100644 index 00000000..c4ae088b --- /dev/null +++ b/test/HD/SedovBlastWave/CMakeLists.txt @@ -0,0 +1 @@ +enable_idefix_property(Idefix_HDF5) diff --git a/test/HD/SedovBlastWave/idefix-unequal.ini b/test/HD/SedovBlastWave/idefix-unequal.ini index 9fcd2850..0deb9fcc 100644 --- a/test/HD/SedovBlastWave/idefix-unequal.ini +++ b/test/HD/SedovBlastWave/idefix-unequal.ini @@ -25,5 +25,5 @@ X3-beg periodic X3-end periodic [Output] -vtk 0.05 -xdmf 0.05 +vtk 0.1 +xdmf 0.1 diff --git a/test/HD/SedovBlastWave/idefix.ini b/test/HD/SedovBlastWave/idefix.ini index baa09b9b..26f463d2 100644 --- a/test/HD/SedovBlastWave/idefix.ini +++ b/test/HD/SedovBlastWave/idefix.ini @@ -25,5 +25,5 @@ X3-beg periodic X3-end periodic [Output] -vtk 0.05 -xdmf 0.05 +vtk 0.1 +xdmf 0.1