Skip to content

Commit

Permalink
Merge pull request #99 from isteinbrecher/vtk-point-datatype
Browse files Browse the repository at this point in the history
Make the data type for vtk point output double
  • Loading branch information
isteinbrecher authored Sep 5, 2024
2 parents 0bc128e + 2a7dc8c commit cd874b8
Show file tree
Hide file tree
Showing 9 changed files with 1,123 additions and 1,122 deletions.
1 change: 1 addition & 0 deletions meshpy/vtk_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class VTKWriter:
def __init__(self):
# Initialize VTK objects.
self.points = vtk.vtkPoints()
self.points.SetDataTypeToDouble()
self.grid = vtk.vtkUnstructuredGrid()

# Link points to grid.
Expand Down
582 changes: 291 additions & 291 deletions tests/reference-files/test_meshpy_vtk_beam_reference.vtu

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions tests/reference-files/test_meshpy_vtk_curve_cell_data_reference.vtu
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
1 0 0 1 0 0
1 0 0 1 0 0
1 0 0 1 0 0
1 0 0 0.9238795325112867 -0.3826834323650897 0
0.7071067811865475 -0.7071067811865476 0 0.7071067811865475 -0.7071067811865476 0
0.38268343236508984 -0.9238795325112866 0 0 -1 0
1 0 0 0.9238795325112867 -0.3826834323650897 4.686520405326298e-17
0.7071067811865475 -0.7071067811865476 8.659560562354933e-17 0.7071067811865475 -0.7071067811865476 8.659560562354933e-17
0.38268343236508984 -0.9238795325112866 1.1314261122877003e-16 2.220446049250313e-16 -1 1.2246467991473532e-16
<InformationKey name="L2_NORM_RANGE" location="vtkDataArray" length="2">
<Value index="0">
1
Expand All @@ -34,9 +34,9 @@
0 1 0 0 1 0
0 1 0 0 1 0
0 1 0 0 1 0
0 -1 0 -0.3826834323650897 -0.9238795325112867 0
-0.7071067811865476 -0.7071067811865475 0 -0.7071067811865476 -0.7071067811865475 0
-0.9238795325112866 -0.38268343236508984 0 -1 0 0
0 -1 1.2246467991473532e-16 -0.3826834323650897 -0.9238795325112867 1.1314261122877003e-16
-0.7071067811865476 -0.7071067811865475 8.659560562354932e-17 -0.7071067811865476 -0.7071067811865475 8.659560562354932e-17
-0.9238795325112866 -0.38268343236508984 4.686520405326299e-17 -1 -2.220446049250313e-16 2.465190328815662e-32
<InformationKey name="L2_NORM_RANGE" location="vtkDataArray" length="2">
<Value index="0">
1
Expand All @@ -53,9 +53,9 @@
0 0 1 0 0 1
0 0 1 0 0 1
0 0 1 0 0 1
0 0 -1 0 0 -1
0 0 -1 0 0 -1
0 0 -1 0 0 -1
0 -1.2246467991473532e-16 -1 -3.0814879110195774e-33 -1.2246467991473532e-16 -1
6.162975822039155e-33 -1.224646799147353e-16 -1 6.162975822039155e-33 -1.224646799147353e-16 -1
0 -1.2246467991473532e-16 -1 0 -1.2246467991473532e-16 -1
<InformationKey name="L2_NORM_RANGE" location="vtkDataArray" length="2">
<Value index="0">
1
Expand All @@ -78,16 +78,16 @@
</DataArray>
</CellData>
<Points>
<DataArray type="Float32" Name="Points" NumberOfComponents="3" format="ascii" RangeMin="0" RangeMax="3.5">
<DataArray type="Float64" Name="Points" NumberOfComponents="3" format="ascii" RangeMin="0" RangeMax="3.5">
0 0 0 0.5 0 0
1 0 0 1 0 0
1.5 0 0 2 0 0
0 1 0 0.5 1 0
1 1 0 1 1 0
1.5 1 0 2 1 0
0 3.5 -1.8369701465288538e-16 0.5740251541137695 3.38581919670105 -1.6971391682692557e-16
1.0606601238250732 3.0606601238250732 -1.2989340243395341e-16 1.0606601238250732 3.0606601238250732 -1.2989340243395341e-16
1.3858193159103394 2.5740251541137695 -7.029780539147615e-17 1.5 2 -3.697785493223493e-32
0 3.5 -1.8369701987210297e-16 0.5740251485476346 3.38581929876693 -1.6971391684315505e-16
1.0606601717798214 3.060660171779821 -1.2989340843532398e-16 1.0606601717798214 3.060660171779821 -1.2989340843532398e-16
1.38581929876693 2.574025148547635 -7.029780607989448e-17 1.5 2.0000000000000004 -2.465190328815662e-32
<InformationKey name="L2_NORM_RANGE" location="vtkDataArray" length="2">
<Value index="0">
0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,18 @@
</DataArray>
</CellData>
<Points>
<DataArray type="Float32" Name="Points" NumberOfComponents="3" format="ascii" RangeMin="6.954433290200489" RangeMax="7.5617058188188775">
4.482364177703857 3.79614520072937 -3.7231485843658447 4.227210521697998 4.224977970123291 -3.7547576427459717
3.972057342529297 4.653810977935791 -3.7863667011260986 3.972057342529297 4.653810977935791 -3.7863667011260986
3.7169039249420166 5.082643985748291 -3.8179757595062256 3.4617507457733154 5.511476516723633 -3.8495848178863525
4.482364177703857 3.79614520072937 -3.7231485843658447 4.227210521697998 4.224977970123291 -3.7547576427459717
3.972057342529297 4.653810977935791 -3.7863667011260986
<DataArray type="Float64" Name="Points" NumberOfComponents="3" format="ascii" RangeMin="6.954433228267965" RangeMax="7.561705972366411">
4.482364101462218 3.7961452550003125 -3.723148505136347 4.227210746313947 4.224978125508751 -3.7547575944632037
3.972057391165677 4.6538109960171905 -3.7863666837900594 3.972057391165677 4.6538109960171905 -3.7863666837900594
3.7169040360174064 5.082643866525629 -3.817975773116916 3.461750680869136 5.511476737034068 -3.8495848624437716
4.482364101462218 3.7961452550003125 -3.723148505136347 4.227210746313947 4.224978125508751 -3.7547575944632037
3.972057391165677 4.6538109960171905 -3.7863666837900594
<InformationKey name="L2_NORM_RANGE" location="vtkDataArray" length="2">
<Value index="0">
6.9544332902
6.9544332283
</Value>
<Value index="1">
7.5617058188
7.5617059724
</Value>
</InformationKey>
</DataArray>
Expand Down
Loading

0 comments on commit cd874b8

Please sign in to comment.