Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ add_library(four_c_all_enabled_external_dependencies INTERFACE)
# Required dependencies
four_c_configure_dependency(HDF5 REQUIRED)
four_c_configure_dependency(MPI REQUIRED)
four_c_configure_dependency(Qhull REQUIRED)
four_c_configure_dependency(Trilinos REQUIRED)
four_c_configure_dependency(Boost REQUIRED)
four_c_configure_dependency(CLN REQUIRED)
Expand All @@ -146,6 +145,7 @@ four_c_configure_dependency(magic_enum REQUIRED)
four_c_configure_dependency(ZLIB REQUIRED)

# Optional dependencies
four_c_configure_dependency(Qhull DEFAULT OFF)
four_c_configure_dependency(VTK DEFAULT OFF)
four_c_configure_dependency(gmsh DEFAULT OFF)
four_c_configure_dependency(deal.II DEFAULT OFF)
Expand Down
26 changes: 19 additions & 7 deletions cmake/configure/configure_Qhull.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,25 @@
#
# SPDX-License-Identifier: LGPL-3.0-or-later

find_package(Qhull REQUIRED)
message(STATUS "Fetch content for Qhull")

if(QHULL_FOUND)
message(STATUS "QHULL include directory: ${QHULL_INCLUDE_DIR}")
message(STATUS "QHULL library directory: ${QHULL_LIBRARY}")
cmake_policy(SET CMP0077 NEW)

target_link_libraries(four_c_all_enabled_external_dependencies INTERFACE qhull::qhull)
set(QHULL_ENABLE_TESTING "OFF")
set(BUILD_APPLICATIONS "OFF")
set(BUILD_STATIC_LIBS "OFF")
set(LINK_APPS_SHARED "OFF")
set(BUILD_SHARED_LIBS "ON")

four_c_remember_variable_for_install(QHULL_INCLUDE_DIR QHULL_LIBRARY)
endif()
fetchcontent_declare(
libqhull
GIT_REPOSITORY https://github.com/qhull/qhull.git
GIT_TAG a22c735d6a8d1b5eac5773790aeae28f3b088655 #v8.1-alpha1
)

fetchcontent_makeavailable(libqhull)
set(FOUR_C_QHULL_ROOT "${CMAKE_INSTALL_PREFIX}")

four_c_add_external_dependency(four_c_all_enabled_external_dependencies qhull_r)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
four_c_add_external_dependency(four_c_all_enabled_external_dependencies qhull_r)
four_c_add_external_dependency(four_c_all_enabled_external_dependencies QHull::qhull_r)

Does this work? I am looking at https://github.com/qhull/qhull/blob/master/CMakeLists.txt#L744, which gives an export namespace but unfortunately they do not alias the qhull_r target as QHull::qhull_r. Maybe we need to do this ourselves here.

Also, QHull is still installed in the image, right? I think the wrong one is picked up during the install test: https://github.com/4C-multiphysics/4C/actions/runs/20850200696/job/59903586127?pr=1649#step:9:46
which would give you a pretty random result. I would drop the QHull from the image. Afterwards, you probably need to fix the install process here.


four_c_remember_variable_for_install(FOUR_C_QHULL_ROOT)
26 changes: 0 additions & 26 deletions cmake/modules/FindQhull.cmake

This file was deleted.

8 changes: 5 additions & 3 deletions presets/docker/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"FOUR_C_WITH_VTK": "ON",
"FOUR_C_WITH_GMSH": "ON",
"FOUR_C_GMSH_ROOT": "/opt/4C-dependencies",
"FOUR_C_WITH_FFTW": "ON"
"FOUR_C_WITH_FFTW": "ON",
"FOUR_C_WITH_QHULL": "ON"
}
},
{
Expand Down Expand Up @@ -140,8 +141,9 @@
"FOUR_C_ENABLE_DOCUMENTATION": "OFF",
"FOUR_C_WITH_VTK": "OFF",
"FOUR_C_WITH_GMSH": "OFF",
"FOUR_C_WITH_FFTW": "OFF"
"FOUR_C_WITH_FFTW": "OFF",
"FOUR_C_WITH_QHULL": "OFF"
}
}
]
}
}
40 changes: 20 additions & 20 deletions src/cut/4C_cut_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ void Cut::Mesh::cut(Side& side)
catch (Core::Exception& err)
{
debug_dump(&e, __FILE__, __LINE__);
throw;
throw std::runtime_error(err.what());
}
}
for (std::map<int, std::shared_ptr<Element>>::iterator i = shadow_elements_.begin();
Expand All @@ -837,7 +837,7 @@ void Cut::Mesh::cut(Side& side)
catch (Core::Exception& err)
{
debug_dump(&e, __FILE__, __LINE__);
throw;
throw std::runtime_error(err.what());
}
}
}
Expand Down Expand Up @@ -915,7 +915,7 @@ void Cut::Mesh::find_cut_points()
catch (Core::Exception& err)
{
debug_dump(&e, __FILE__, __LINE__);
throw;
throw std::runtime_error(err.what());
}
}
for (std::map<int, std::shared_ptr<Element>>::iterator i = shadow_elements_.begin();
Expand All @@ -929,7 +929,7 @@ void Cut::Mesh::find_cut_points()
catch (Core::Exception& err)
{
debug_dump(&e, __FILE__, __LINE__);
throw;
throw std::runtime_error(err.what());
}
}
}
Expand All @@ -956,7 +956,7 @@ void Cut::Mesh::make_cut_lines()
catch (Core::Exception& err)
{
debug_dump(&e, __FILE__, __LINE__);
throw;
throw std::runtime_error(err.what());
}
}
for (std::map<int, std::shared_ptr<Element>>::iterator i = shadow_elements_.begin();
Expand All @@ -974,7 +974,7 @@ void Cut::Mesh::make_cut_lines()
catch (Core::Exception& err)
{
debug_dump(&e, __FILE__, __LINE__);
throw;
throw std::runtime_error(err.what());
}
}
}
Expand All @@ -998,7 +998,7 @@ void Cut::Mesh::make_facets()
catch (Core::Exception& err)
{
debug_dump(&e, __FILE__, __LINE__);
throw;
throw std::runtime_error(err.what());
}
}
for (std::map<int, std::shared_ptr<Element>>::iterator i = shadow_elements_.begin();
Expand All @@ -1012,7 +1012,7 @@ void Cut::Mesh::make_facets()
catch (Core::Exception& err)
{
debug_dump(&e, __FILE__, __LINE__);
throw;
throw std::runtime_error(err.what());
}
}
}
Expand All @@ -1036,7 +1036,7 @@ void Cut::Mesh::make_volume_cells()
catch (Core::Exception& err)
{
debug_dump(&e, __FILE__, __LINE__);
throw;
throw std::runtime_error(err.what());
}
}
for (std::map<int, std::shared_ptr<Element>>::iterator i = shadow_elements_.begin();
Expand All @@ -1050,7 +1050,7 @@ void Cut::Mesh::make_volume_cells()
catch (Core::Exception& err)
{
debug_dump(&e, __FILE__, __LINE__);
throw;
throw std::runtime_error(err.what());
}
}
}
Expand Down Expand Up @@ -1080,7 +1080,7 @@ void Cut::Mesh::find_node_positions()
catch (Core::Exception& err)
{
debug_dump(&e, __FILE__, __LINE__);
throw;
throw std::runtime_error(err.what());
}
}
for (std::map<int, std::shared_ptr<Element>>::iterator i = shadow_elements_.begin();
Expand All @@ -1094,7 +1094,7 @@ void Cut::Mesh::find_node_positions()
catch (Core::Exception& err)
{
debug_dump(&e, __FILE__, __LINE__);
throw;
throw std::runtime_error(err.what());
}
}
// find undecided nodes
Expand Down Expand Up @@ -1434,7 +1434,7 @@ void Cut::Mesh::create_integration_cells(int count, bool tetcellsonly)
"[i.e. if count > 0 in a call from TetMeshIntersection]:";

debug_dump(&e, __FILE__, __LINE__);
throw;
throw std::runtime_error(err.what());
}
}
for (std::map<int, std::shared_ptr<Element>>::iterator i = shadow_elements_.begin();
Expand All @@ -1452,7 +1452,7 @@ void Cut::Mesh::create_integration_cells(int count, bool tetcellsonly)
<< std::endl;

debug_dump(&e, __FILE__, __LINE__);
throw;
throw std::runtime_error(err.what());
}
}
}
Expand All @@ -1474,7 +1474,7 @@ void Cut::Mesh::moment_fit_gauss_weights(bool include_inner, Cut::BCellGaussPts
catch (Core::Exception& err)
{
debug_dump(&e, __FILE__, __LINE__);
throw;
throw std::runtime_error(err.what());
}
}
for (std::map<int, std::shared_ptr<Element>>::iterator i = shadow_elements_.begin();
Expand All @@ -1488,7 +1488,7 @@ void Cut::Mesh::moment_fit_gauss_weights(bool include_inner, Cut::BCellGaussPts
catch (Core::Exception& err)
{
debug_dump(&e, __FILE__, __LINE__);
throw;
throw std::runtime_error(err.what());
}
}
}
Expand All @@ -1510,7 +1510,7 @@ void Cut::Mesh::direct_divergence_gauss_rule(bool include_inner, Cut::BCellGauss
catch (Core::Exception& err)
{
debug_dump(&e, __FILE__, __LINE__);
throw;
throw std::runtime_error(err.what());
}
}
for (std::map<int, std::shared_ptr<Element>>::iterator i = shadow_elements_.begin();
Expand All @@ -1524,7 +1524,7 @@ void Cut::Mesh::direct_divergence_gauss_rule(bool include_inner, Cut::BCellGauss
catch (Core::Exception& err)
{
debug_dump(&e, __FILE__, __LINE__);
throw;
throw std::runtime_error(err.what());
}
}
}
Expand All @@ -1546,7 +1546,7 @@ void Cut::Mesh::remove_empty_volume_cells()
catch (Core::Exception& err)
{
debug_dump(&e, __FILE__, __LINE__);
throw;
throw std::runtime_error(err.what());
}
}
for (std::map<int, std::shared_ptr<Element>>::iterator i = shadow_elements_.begin();
Expand All @@ -1560,7 +1560,7 @@ void Cut::Mesh::remove_empty_volume_cells()
catch (Core::Exception& err)
{
debug_dump(&e, __FILE__, __LINE__);
throw;
throw std::runtime_error(err.what());
}
}
}
Expand Down
Loading
Loading