From 1621d85d8b560b51fc3f29cad5b0d3ea7834c20b Mon Sep 17 00:00:00 2001 From: satkarra <23319613+satkarra@users.noreply.github.com> Date: Sat, 11 Dec 2021 06:14:32 -0700 Subject: [PATCH 01/10] Update fdata.py CREATE_NEW_CONSOLE not used and causes issues on mac. --- fdata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fdata.py b/fdata.py index 6715567..2dfca13 100644 --- a/fdata.py +++ b/fdata.py @@ -24,7 +24,7 @@ import numpy as np from copy import copy, deepcopy import os,time,platform,shutil,sys -from subprocess import Popen, PIPE, CREATE_NEW_CONSOLE +from subprocess import Popen, PIPE from time import sleep from collections import Counter from matplotlib.patches import Rectangle From 019e86a86b440c984439e70a219da64e60e17faa Mon Sep 17 00:00:00 2001 From: satkarra <23319613+satkarra@users.noreply.github.com> Date: Sat, 11 Dec 2021 06:24:08 -0700 Subject: [PATCH 02/10] updating grid.make in tutorial1.py Updating grid.make in tutorial.py to get it to run. --- tutorials/tutorial1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/tutorial1.py b/tutorials/tutorial1.py index 7b8f894..b9c154c 100644 --- a/tutorials/tutorial1.py +++ b/tutorials/tutorial1.py @@ -13,7 +13,7 @@ # 7.1.2 Grid generation x = np.linspace(0,10,11) -dat.grid.make(root+'_GRID.inp',x=x,y=x,z=x) +dat.grid.make(gridfilename=root+'_GRID.inp',x=x,y=x,z=x) #dat.grid.plot(root+'_GRID.png',color='r',angle=[45,45]) # 7.1.3 Zone creation From 65591ac8df6d824503a838eb1b6221dae63f9deb Mon Sep 17 00:00:00 2001 From: satkarra <23319613+satkarra@users.noreply.github.com> Date: Sat, 11 Dec 2021 06:58:22 -0700 Subject: [PATCH 03/10] Update tutorial1.py removed diagnostic variable from run() --- tutorials/tutorial1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/tutorial1.py b/tutorials/tutorial1.py index 7b8f894..5bde38b 100644 --- a/tutorials/tutorial1.py +++ b/tutorials/tutorial1.py @@ -67,7 +67,7 @@ #dat.iter['machine_tolerance_TMCH'] = -0.5e-5 dat.files.root = root -dat.run(root+'_INPUT.dat', verbose=True, diagnostic = True) # note, because no executable path is specified, PyFEHM retrieves the executable specified in the default path +dat.run(root+'_INPUT.dat', verbose=True) # note, because no executable path is specified, PyFEHM retrieves the executable specified in the default path asdf # 7.1.7 Visualisation From a13019fe7c422aa96793118920c243519355670a Mon Sep 17 00:00:00 2001 From: satkarra <23319613+satkarra@users.noreply.github.com> Date: Sat, 11 Dec 2021 07:07:27 -0700 Subject: [PATCH 04/10] 'equal' to 'auto' in axes3d Axes3d no longer supports 'equal'. Only option is 'auto'. --- fdata.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fdata.py b/fdata.py index 6715567..f6acf60 100644 --- a/fdata.py +++ b/fdata.py @@ -544,7 +544,7 @@ def plot(self,save='',angle=[45,45],color='k',connections=False,equal_axes=True, plt.clf() fig = plt.figure(figsize=[8.275,11.7]) ax = plt.axes(projection='3d') - ax.set_aspect('equal', 'datalim') + ax.set_aspect('auto', 'datalim') ax.set_xlabel(xlabel,size=font_size) ax.set_ylabel(ylabel,size=font_size) @@ -707,7 +707,7 @@ def topo(self,save='',cbar=True,equal_axes=True, method = 'nearest', divisions=[ ax = plt.axes([0.15,0.15,0.7,0.7]) if xlims: ax.set_xlim(xlims) if ylims: ax.set_ylim(ylims) - if equal_axes: ax.set_aspect('equal', 'datalim') + if equal_axes: ax.set_aspect('auto', 'datalim') CS = plt.contourf(X,Y,vals,levels) if clims: CS.vmin=clims[0]; CS.vmax=clims[1] if xlabel: plt.xlabel(xlabel,size=font_size) @@ -718,11 +718,11 @@ def topo(self,save='',cbar=True,equal_axes=True, method = 'nearest', divisions=[ for t in cbar.ax.get_yticklabels(): t.set_fontsize(font_size) for t in ax.get_xticklabels(): - t.set_fontsize(font_size) + t.set_fontsize(font_size)uto for t in ax.get_yticklabels(): t.set_fontsize(font_size) - ax.set_aspect('equal', 'datalim') + ax.set_aspect('auto', 'datalim') extension, save_fname, pdf = save_name(save,variable='zone_topo'+str(self.index),time=1) plt.savefig(save_fname, dpi=200, facecolor='w', edgecolor='w',orientation='portrait', format=extension,transparent=True, bbox_inches=None, pad_inches=0.1) From 2b899aac63eb0e1a0bfb5c18610337dcf6f1a218 Mon Sep 17 00:00:00 2001 From: satkarra <23319613+satkarra@users.noreply.github.com> Date: Sat, 11 Dec 2021 07:20:54 -0700 Subject: [PATCH 05/10] Update fdata.py --- fdata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fdata.py b/fdata.py index 650775a..c92ea8f 100644 --- a/fdata.py +++ b/fdata.py @@ -718,7 +718,7 @@ def topo(self,save='',cbar=True,equal_axes=True, method = 'nearest', divisions=[ for t in cbar.ax.get_yticklabels(): t.set_fontsize(font_size) for t in ax.get_xticklabels(): - t.set_fontsize(font_size)uto + t.set_fontsize(font_size) for t in ax.get_yticklabels(): t.set_fontsize(font_size) From ef0ccfc6f1a541e60e2cd8b35752fe42498060c6 Mon Sep 17 00:00:00 2001 From: satkarra <23319613+satkarra@users.noreply.github.com> Date: Sat, 11 Dec 2021 07:27:25 -0700 Subject: [PATCH 06/10] Update tutorial2.py --- tutorials/tutorial2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/tutorial2.py b/tutorials/tutorial2.py index fea1bd2..43620b3 100644 --- a/tutorials/tutorial2.py +++ b/tutorials/tutorial2.py @@ -25,7 +25,7 @@ Z = list(np.linspace(Z0,Za_base,5)) + list(np.linspace(Za_base,Za_top,11))[1:] + list(np.linspace(Za_top,Z1,5))[1:] -dat.grid.make('quarterGrid.inp', x= X, y = X, z = Z) +dat.grid.make(gridfilename='quarterGrid.inp', x= X, y = X, z = Z) dat.grid.plot('quarterGrid.png', angle = [45,45], color = 'b', cutaway = [proX,proY,-1000]) From d53c0ad50a8ee3203142fb4382b014c587f3cc45 Mon Sep 17 00:00:00 2001 From: satkarra <23319613+satkarra@users.noreply.github.com> Date: Sat, 11 Dec 2021 07:27:47 -0700 Subject: [PATCH 07/10] Update tutorial3.py --- tutorials/tutorial3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/tutorial3.py b/tutorials/tutorial3.py index debbda8..4aad19c 100644 --- a/tutorials/tutorial3.py +++ b/tutorials/tutorial3.py @@ -43,7 +43,7 @@ def simulation(j,param): # 7.1.2 Grid generation x = np.linspace(0,10,11) - dat.grid.make(root+'_GRID.inp',x=x,y=x,z=x) + dat.grid.make(gridfilename=root+'_GRID.inp',x=x,y=x,z=x) dat.grid.plot(root+'_GRID.png',color='r',angle=[45,45]) # 7.1.3 Zone creation From b162a548dbee9b2847f9407afa4beca5df420d8a Mon Sep 17 00:00:00 2001 From: satkarra <23319613+satkarra@users.noreply.github.com> Date: Sat, 11 Dec 2021 07:28:10 -0700 Subject: [PATCH 08/10] Update tutorial4.py --- tutorials/tutorial4.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/tutorial4.py b/tutorials/tutorial4.py index 874a951..8bf8f6c 100644 --- a/tutorials/tutorial4.py +++ b/tutorials/tutorial4.py @@ -10,7 +10,7 @@ # 7.1.2 Grid generation x = np.linspace(0,10,11) -dat.grid.make(root+'_GRID.inp',x=x,y=x,z=x) +dat.grid.make(gridfilename=root+'_GRID.inp',x=x,y=x,z=x) dat.grid.plot(root+'_GRID.png',color='r',angle=[45,45]) # 7.1.3 Zone creation From 513c01c19e0df5a99cde22cff672c07393674295 Mon Sep 17 00:00:00 2001 From: Satish Karra Date: Sat, 11 Dec 2021 08:59:03 -0700 Subject: [PATCH 09/10] fixed filename passes in fdata read. Unstructured seems to be working now. --- fdata.py | 4 ++-- fgrid.py | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/fdata.py b/fdata.py index c92ea8f..ea32b98 100644 --- a/fdata.py +++ b/fdata.py @@ -2949,8 +2949,8 @@ def read(self,filename='',gridfilename='',inconfilename='',full_connectivity=dfl # set up paths if filename: self._path.filename = filename - if gridfilename: self.grid._path.filename = filename - if inconfilename: self.incon._path.filename = filename + if gridfilename: self.grid._path.filename = gridfilename + if inconfilename: self.incon._path.filename = inconfilename # THERE WILL ALWAYS BE A GRID PATH TO READ - INPUT FILES CANNOT BE READ WITHOUT A GRID self.grid.read(self.grid._path.full_path,full_connectivity=full_connectivity) diff --git a/fgrid.py b/fgrid.py index 52c4c7c..d3fce90 100644 --- a/fgrid.py +++ b/fgrid.py @@ -523,7 +523,7 @@ def read(self,gridfilename,full_connectivity=False,octree=False): elif isAvs: self._read_avs() newgridfilename = self._path.full_path.split('.')[:-1] - newgridfilename = string.join(newgridfilename,'.')+'.inp' + newgridfilename = ".".join(newgridfilename)+'.inp' if os.path.isfile(newgridfilename): newgridfilename = newgridfilename[:-4] + '_new' + newgridfilename[-4:] self.write(newgridfilename, 'fehm') # write out equivalent fehm grid @@ -548,7 +548,6 @@ def _read_fehm(self): #Read in fehm meshfile for node,element data . nd = infile.readline().strip().split() new_node = fnode(index=int(nd[0]),position=np.array([float(nd[1]),float(nd[2]),float(nd[3])])) self.add_node(new_node) - infile.readline() infile.readline() N = infile.readline() @@ -612,7 +611,6 @@ def _read_avs(self): #Read in avs meshfile for node, element data. nd = infile.readline().strip().split() # read line new_node = fnode(index=int(nd[0]),position=np.array([float(nd[1]),float(nd[2]),float(nd[3])])) self.add_node(new_node) # add node object - N = N_el connectivity = None for i in range(N): # FOR each element From db8487d21e126c1ac0ffc4c2a16a9c25195343c1 Mon Sep 17 00:00:00 2001 From: Satish Karra Date: Sat, 11 Dec 2021 09:30:49 -0700 Subject: [PATCH 10/10] changed comment in fdata read to clarify that filename has to be input file and cannot be fehmn.files --- fdata.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fdata.py b/fdata.py index ea32b98..e60d67e 100644 --- a/fdata.py +++ b/fdata.py @@ -2936,7 +2936,7 @@ def __setstate__(self, data_dict): def read(self,filename='',gridfilename='',inconfilename='',full_connectivity=dflt.full_connectivity,skip=[]): #Reads data from file. '''Read FEHM input file and construct fdata object. - :param filename: Name of FEHM input file. Alternatively, supplying 'fehmn.files' will cause PyFEHM to query this file for input, grid and restart file names if they are available. + :param filename: Name of FEHM input *.dat file. :type filename: str :param gridfilename: Name of FEHM grid file. :type gridfilename: str @@ -2976,7 +2976,7 @@ def read(self,filename='',gridfilename='',inconfilename='',full_connectivity=dfl [self._read_cont,self._read_macro,self._read_zonn,self._read_zonn,self._read_macro, self._read_time,self._read_ctrl,self._read_iter,self._read_macro,self._read_macro, self._read_boun,self._read_macro,self._read_strs,self._read_text,self._read_sol, - self._read_nfinv,self._read_hist,self._read_histnode,self._read_carb,self._read_model, + self._read_nfinv,self._read_hist,self._read_histnode,self._read_carb,self._read_model, self._read_macro,self._read_nobr,self._read_flxz,self._read_rlpm,self._read_macro, self._read_trac,self._read_model,self._read_model,self._read_vapl,self._read_adif, self._read_ngas,self._read_flxo,self._read_head,self._read_flxn, self._read_air, self._read_air])))