Skip to content

Commit

Permalink
updated homogenization and bulk forming solvers to handle new .pvtu o…
Browse files Browse the repository at this point in the history
…utput files
  • Loading branch information
shankinsMechEng committed Dec 19, 2024
1 parent ecb586d commit 2fa85d8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
8 changes: 5 additions & 3 deletions python/FIERRO-GUI/fierro_gui/Bulk_Forming.py
Original file line number Diff line number Diff line change
Expand Up @@ -1218,9 +1218,11 @@ def preview_results_click_2():
self.display.SetScalarBarVisibility(self.render_view, False)

# Display .xdmf data
file_name = "micro_state_timestep_" + str(self.INBFloadsteps.text()) + ".xdmf"
self.output_directory = os.path.join(self.working_directory, file_name)
self.results_reader = paraview.simple.XDMFReader(FileNames=self.output_directory)
# file_name = "micro_state_timestep_" + str(self.INBFloadsteps.text()) + ".xdmf"
file_name = f"MicroState_{int(self.INBFloadsteps.text()):05}.pvtu"
# self.output_directory = os.path.join(self.working_directory, file_name)
self.output_directory = os.path.join(self.working_directory, "pvtu", file_name)
self.results_reader = paraview.simple.XMLPartitionedUnstructuredGridReader(FileName=self.output_directory)
paraview.simple.SetDisplayProperties(Representation="Surface")
self.display = Show(self.results_reader, self.render_view)

Expand Down
12 changes: 6 additions & 6 deletions python/FIERRO-GUI/fierro_gui/FIERRO_GUI.ui
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<x>0</x>
<y>0</y>
<width>1355</width>
<height>1184</height>
<height>1208</height>
</rect>
</property>
<property name="sizePolicy">
Expand Down Expand Up @@ -352,7 +352,7 @@
<number>1</number>
</property>
<property name="currentIndex">
<number>6</number>
<number>2</number>
</property>
<widget class="QWidget" name="TitleTool">
<layout class="QVBoxLayout" name="verticalLayout_2">
Expand Down Expand Up @@ -1059,7 +1059,7 @@
<x>0</x>
<y>0</y>
<width>376</width>
<height>541</height>
<height>548</height>
</rect>
</property>
<property name="sizePolicy">
Expand Down Expand Up @@ -1120,7 +1120,7 @@
<bool>false</bool>
</property>
<property name="currentIndex">
<number>5</number>
<number>3</number>
</property>
<widget class="QWidget" name="page_14"/>
<widget class="QWidget" name="ImportPartTool">
Expand Down Expand Up @@ -10324,7 +10324,7 @@ li.checked::marker { content: &quot;\2612&quot;; }
<item>
<widget class="QStackedWidget" name="RunOptions">
<property name="currentIndex">
<number>2</number>
<number>1</number>
</property>
<widget class="QWidget" name="page_20">
<layout class="QVBoxLayout" name="verticalLayout_12">
Expand Down Expand Up @@ -11634,7 +11634,7 @@ li.checked::marker { content: &quot;\2612&quot;; }
<x>0</x>
<y>0</y>
<width>1355</width>
<height>24</height>
<height>37</height>
</rect>
</property>
<widget class="QMenu" name="menuHelp">
Expand Down
10 changes: 7 additions & 3 deletions python/FIERRO-GUI/fierro_gui/Homogenization.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import numpy as np
import subprocess
import os
import vtk
#import paraview.simple as paraview.simple
from paraview.simple import *
from Homogenization_WInput import *
Expand Down Expand Up @@ -894,9 +895,12 @@ def preview_results_click():
# Display .xdmf data
output_name = str(self.INBCFile.currentText())
output_parts = output_name.split()
file_name = "micro_state_timestep_" + str(self.INNumberOfSteps.text()) + ".xdmf"
self.output_directory = os.path.join(self.working_directory, output_parts[0], output_parts[1], file_name)
self.results_reader = paraview.simple.XDMFReader(FileNames=self.output_directory)
# file_name = "micro_state_timestep_" + str(self.INNumberOfSteps.text()) + ".xdmf"
file_name = f"MicroState_{int(self.INNumberOfSteps.text()):05}.pvtu"
self.output_directory = os.path.join(self.working_directory, output_parts[0], output_parts[1], "pvtu", file_name)
# self.output_directory = os.path.join(self.working_directory, output_parts[0], output_parts[1], file_name)
# self.results_reader = paraview.simple.XDMFReader(FileNames=self.output_directory)
self.results_reader = paraview.simple.XMLPartitionedUnstructuredGridReader(FileName=self.output_directory)

# Apply threshold to view certain phase id's
in_file_path = self.TParts.item(0,10).text()
Expand Down
2 changes: 1 addition & 1 deletion python/FIERRO-GUI/fierro_gui/ImageToVTK.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ def ImageToVTK(imageDir, out, outDir, file_type):
VTK_File.write(TenthLine+'\n')

for i in range(rows*columns*NumFiles):
csv.writer(VTK_File,delimiter='\n').writerow([img_arr[i]])
csv.writer(VTK_File).writerow([img_arr[i]])

VTK_File.close()

0 comments on commit 2fa85d8

Please sign in to comment.