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
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,18 @@ if(SEASTACK_ENABLE_CHRONO)
" (or /usr/local/opt/libomp on Intel Homebrew).")
endif()

# If Chrono set HDF5_DIR, retry the find
# If Chrono set HDF5_DIR to NOTFOUND (common when Chrono itself found HDF5
# via module mode, not hdf5-config.cmake), clear it so later FindHDF5
# module-mode discovery (e.g. Ubuntu libhdf5-dev) can succeed.
if(NOT HDF5_FOUND AND DEFINED CACHE{HDF5_DIR})
if("${HDF5_DIR}" MATCHES "NOTFOUND")
unset(HDF5_DIR CACHE)
find_package(HDF5 CONFIG QUIET)
endif()
endif()
if(SEASTACK_ENABLE_HYDRO_IO AND NOT HDF5_FOUND)
find_package(HDF5 QUIET COMPONENTS CXX)
endif()

# Use same C++ standard as Chrono for ABI compatibility
if(DEFINED CHRONO_CXX_STANDARD)
Expand Down
9 changes: 1 addition & 8 deletions apps/seastack/gui/vsg_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,7 @@ inline constexpr int kColorVariationCycle = 8;
inline constexpr float kWaterR = 0.01f;
inline constexpr float kWaterG = 0.20f;
inline constexpr float kWaterB = 0.35f;
// NOTE: Material opacity must stay at 1.0 on Linux.
// With opacity < 1.0, Chrono's wrapIfTransparent() wraps the runtime-added
// water node in vsg::DepthSorted (bin 10), which crashes the VSG renderer
// at vsg::Bin::add during the first record traversal. The animated water
// surface is added to the scene after pVis->Initialize(), bypassing the
// BindAll() compile path that built-in Chrono demos rely on.
// TODO: enable proper translucency via a runtime compile traversal.
inline constexpr float kWaterOpacity = 1.0f;
inline constexpr float kWaterOpacity = 0.55f;
inline constexpr float kWaterSpecular = 0.6f;
inline constexpr float kWaterRoughness = 0.05f;
inline constexpr float kWaterMetallic = 0.0f;
Expand Down
2 changes: 1 addition & 1 deletion apps/seastack/gui/vsg_water_surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ void AnimatedWaterSurface::InitializeWireframe() {
// Faint blue-gray material.
auto wire_material = ::chrono_types::make_shared<::chrono::ChVisualMaterial>();
wire_material->SetDiffuseColor(::chrono::ChColor(0.1f, 0.2f, 0.3f));
wire_material->SetOpacity(1.0f);
wire_material->SetOpacity(0.35f);
wire_material->SetRoughness(0.9f);
wire_material->SetMetallic(0.0f);

Expand Down
2 changes: 1 addition & 1 deletion apps/seastack/single_run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ namespace {
class HCParser : public ::chrono::parsers::ChParserMbsYAML {
public:
HCParser() : ChParserMbsYAML() {}
void SetScriptDir(const std::string& dir) { m_file_handler.SetReferenceDirectory(dir); }
void SetScriptDir(const std::string& dir) { m_script_directory = dir; }
};

static std::shared_ptr<::chrono::ChBody> FindBodyByName(::chrono::ChSystem& system,
Expand Down
15 changes: 8 additions & 7 deletions scripts/unix/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,15 @@ else
USE_VSG=0
fi

# HydroIO / HDF5:
# Do not force HydroIO OFF merely because build-config.json leaves HDF5Dir empty.
# On Ubuntu/Debian, libhdf5-dev is discovered by CMake FindHDF5 (module mode)
# without a config-mode HDF5_DIR. Passing -DHDF5_DIR is optional; Chrono's
# ChronoConfig may even set HDF5_DIR to NOTFOUND when it used module-mode HDF5.
# Only --no-hydro-io disables HydroIO here. If CMake cannot find HDF5, configure
# fails with a clear FindHDF5 error instead of a later missing-header failure.
if [[ -z "${SEASTACK_HDF5_DIR:-}" && "${NO_HYDRO_IO}" -eq 0 ]]; then
echo " [WARN] HDF5 not found; HydroIO will be disabled." >&2
if [[ "${USE_CHRONO}" -eq 1 ]]; then
echo " If Chrono was built without HDF5, set HDF5Dir in build-config.json." >&2
else
echo " For Chrono-free builds, set HDF5Dir or use --no-hydro-io." >&2
fi
NO_HYDRO_IO=1
echo " [INFO] HDF5Dir unset; HydroIO left ON for CMake HDF5 discovery (module/config)." >&2
fi

if [[ "${MOORDYN}" -eq 1 && ! -f "${REPO_ROOT}/extern/MoorDyn/CMakeLists.txt" ]]; then
Expand Down