diff --git a/PINNs_NavierStokes_HFM.ipynb b/PINNs_NavierStokes_HFM.ipynb index 67b9663..6362cca 100644 --- a/PINNs_NavierStokes_HFM.ipynb +++ b/PINNs_NavierStokes_HFM.ipynb @@ -224,6 +224,9 @@ "outputs": [], "source": [ "import sys\n", + "import os\n", + "import requests\n", + "import zipfile\n", "sys.path.insert(0, 'PINNs/Utilities/')\n", "import tensorflow as tf\n", "import numpy as np\n", @@ -665,6 +668,41 @@ "fi" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "16acb23e-60d5-4fe7-83e6-5330ce71fd45", + "metadata": {}, + "outputs": [], + "source": [ + "# Check if the file 'Data/Stenosis2D.mat' exists\n", + "if not os.path.exists('Data/Stenosis2D.mat'):\n", + " print(\"Grabbing additional data...\")\n", + " \n", + " # Download the ZIP file\n", + " url = \"https://gitlab.com/CEMACHELEN1/lifd_ml_large_file_store/-/archive/main/lifd_ml_large_file_store-main.zip\"\n", + " response = requests.get(url)\n", + " \n", + " # Save the ZIP file\n", + " with open(\"lifd_ml_large_file_store-main.zip\", \"wb\") as zip_file:\n", + " zip_file.write(response.content)\n", + " \n", + " # Extract the contents\n", + " with zipfile.ZipFile(\"lifd_ml_large_file_store-main.zip\", \"r\") as zip_ref:\n", + " zip_ref.extractall(\"Data\")\n", + " \n", + " # Clean up\n", + " os.remove(\"lifd_ml_large_file_store-main.zip\")\n", + " \n", + " # Move the required file\n", + " os.rename(\"Data/lifd_ml_large_file_store-main/Physics_Informed_Neural_Networks/Data/Stenosis2D.mat\", \"Data/Stenosis2D.mat\")\n", + " \n", + " # List the contents of the 'Data' directory\n", + " print(\"Contents of 'Data':\")\n", + " for item in os.listdir(\"Data\"):\n", + " print(item)" + ] + }, { "cell_type": "code", "execution_count": null,