From 9cc66d7837d9127ad28d27b48d93760e40f045e5 Mon Sep 17 00:00:00 2001
From: Boris Martin <boris.martin@uliege.be>
Date: Tue, 5 Mar 2024 11:52:01 +0100
Subject: [PATCH] added warning for unextracted file

---
 examples/helmholtz/crossPoints/ddm3D.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/examples/helmholtz/crossPoints/ddm3D.cpp b/examples/helmholtz/crossPoints/ddm3D.cpp
index 93818b90..47460893 100755
--- a/examples/helmholtz/crossPoints/ddm3D.cpp
+++ b/examples/helmholtz/crossPoints/ddm3D.cpp
@@ -493,6 +493,9 @@ namespace D3 {
     else if (benchmark == "salt") {
       // Read the velocity map
       std::ifstream file("../salt.dat", std::ios::binary);
+      if (!file) {
+        throw gmshfem::common::Exception("File not found: ../salt.dat. Maybe you forgot extracting salt.tar.gz?");
+      }
 
       unsigned int Nx = 0, Ny = 0, Nz = 0;
       file.read((char *) &Nx, sizeof(unsigned int));
-- 
GitLab