From ed125fc43961be78d790df510c31d4a5f1aade3a Mon Sep 17 00:00:00 2001 From: IvBu <st116086@stud.uni-stuttgart.de> Date: Mon, 18 Sep 2023 10:46:19 +0200 Subject: [PATCH] [groundwater] delete unnecessary stream closing --- lecture/mhs/groundwater/contourplots.py | 4 ++-- lecture/mhs/groundwater/groundwaterproblem.hh | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lecture/mhs/groundwater/contourplots.py b/lecture/mhs/groundwater/contourplots.py index 63438a53..b0d227dd 100644 --- a/lecture/mhs/groundwater/contourplots.py +++ b/lecture/mhs/groundwater/contourplots.py @@ -2,7 +2,7 @@ import matplotlib.pyplot as plt import numpy as np import pandas as pd -#Instructions: First execute the `groundwater` test, a file called "contourFile.txt" will be written to the respective build-cmake folder. Within the build-cmake/.../groundwater folder you can then run the python script via e.g. `python3 contourPlots.py` to plot the contour and streamlines of the given problem. +#Instructions: First execute the `groundwater` test, a file called "contourfile.txt" will be written to the respective build-cmake folder. Within the build-cmake/.../groundwater folder you can then run the python script via e.g. `python3 contourPlots.py` to plot the contour and streamlines of the given problem. plt.rcParams.update({'font.size': 10}) @@ -27,7 +27,7 @@ cells = parameters.get("Cells").split() nx = int(cells[0]) ny = int(cells[1]) #read in the data which should be plotted -myData = pd.read_csv('contourFile.txt') #choose the correct name of the data file +myData = pd.read_csv('contourfile.txt') #choose the correct name of the data file #-------PREPARING DATA FOR CONTOUR PLOT------- xArray = myData['x'].values #read in a pandas data column and immediately convert it to a numpy array diff --git a/lecture/mhs/groundwater/groundwaterproblem.hh b/lecture/mhs/groundwater/groundwaterproblem.hh index 7396bb8d..0e05b99d 100644 --- a/lecture/mhs/groundwater/groundwaterproblem.hh +++ b/lecture/mhs/groundwater/groundwaterproblem.hh @@ -416,7 +416,7 @@ public: std::cout << "------------------------------------------------------------"<<std::endl; std::ofstream contourFile; - contourFile.open("contourFile.txt"); + contourFile.open("contourfile.txt"); contourFile << "x,y,h,v_x,v_y" << std::endl; for (const auto& element : elements(this->gridView())) @@ -439,8 +439,6 @@ public: contourFile << std::setprecision(15) << x << "," << y << "," << piezo << "," << v_x << "," << v_y << std::endl; } - - contourFile.close(); } private: -- GitLab