Skip to content

Commit

Permalink
Add vtk export material in examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sad-Abd committed Jul 26, 2023
1 parent fab16b4 commit c14f17a
Show file tree
Hide file tree
Showing 4 changed files with 249 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
- Add a method 'vtk_export()' to create an unstructured grid vtk file from mesh.
- Resolved a bug related to adding midpoints to edges.

## [0.1.01] - 2023-7-17

Expand Down
246 changes: 246 additions & 0 deletions examples/4_meshed.vtk
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
# vtk DataFile Version 2.0
Output Data
ASCII
DATASET UNSTRUCTURED_GRID
POINTS 80 float
48.0 0.0 0.0
64.0 0.0 0.0
64.0 16.0 0.0
48.0 16.0 0.0
40.0 0.0 0.0
48.0 8.0 0.0
40.0 8.0 0.0
32.0 0.0 0.0
32.0 8.0 0.0
40.0 16.0 0.0
32.0 16.0 0.0
64.0 32.0 0.0
48.0 32.0 0.0
32.0 32.0 0.0
28.0 0.0 0.0
32.0 4.0 0.0
28.0 4.0 0.0
24.0 0.0 0.0
24.0 4.0 0.0
28.0 8.0 0.0
24.0 8.0 0.0
16.0 0.0 0.0
16.0 8.0 0.0
24.0 16.0 0.0
16.0 16.0 0.0
0.0 0.0 0.0
0.0 16.0 0.0
16.0 32.0 0.0
0.0 32.0 0.0
64.0 48.0 0.0
48.0 48.0 0.0
32.0 48.0 0.0
64.0 64.0 0.0
48.0 64.0 0.0
32.0 64.0 0.0
16.0 48.0 0.0
8.0 32.0 0.0
16.0 40.0 0.0
8.0 40.0 0.0
0.0 40.0 0.0
8.0 48.0 0.0
0.0 48.0 0.0
24.0 48.0 0.0
32.0 56.0 0.0
24.0 56.0 0.0
16.0 56.0 0.0
24.0 64.0 0.0
16.0 64.0 0.0
8.0 56.0 0.0
4.0 48.0 0.0
8.0 52.0 0.0
4.0 52.0 0.0
0.0 52.0 0.0
4.0 56.0 0.0
2.0 52.0 0.0
4.0 54.0 0.0
2.0 54.0 0.0
0.0 54.0 0.0
2.0 56.0 0.0
0.0 56.0 0.0
12.0 56.0 0.0
16.0 60.0 0.0
12.0 60.0 0.0
8.0 60.0 0.0
12.0 64.0 0.0
10.0 60.0 0.0
12.0 62.0 0.0
10.0 62.0 0.0
8.0 62.0 0.0
10.0 64.0 0.0
8.0 64.0 0.0
6.0 56.0 0.0
8.0 58.0 0.0
6.0 58.0 0.0
4.0 58.0 0.0
6.0 60.0 0.0
4.0 60.0 0.0
0.0 60.0 0.0
4.0 64.0 0.0
0.0 64.0 0.0
CELLS 52 285
5 5 3 2 1 0
4 6 5 0 4
5 15 8 6 4 7
4 9 3 5 6
4 10 9 6 8
4 12 11 2 3
5 13 12 3 9 10
4 16 15 7 14
4 18 16 14 17
4 19 8 15 16
4 20 19 16 18
5 22 20 18 17 21
5 23 10 8 19 20
4 24 23 20 22
5 26 24 22 21 25
5 27 13 10 23 24
5 28 36 27 24 26
4 30 29 11 12
4 31 30 12 13
4 33 32 29 30
5 43 34 33 30 31
6 37 35 42 31 13 27
4 38 37 27 36
4 39 38 36 28
4 40 35 37 38
5 41 49 40 38 39
4 44 43 31 42
4 45 44 42 35
4 46 34 43 44
5 61 47 46 44 45
6 50 48 60 45 35 40
4 51 50 40 49
5 52 54 51 49 41
6 55 53 71 48 50 51
4 56 55 51 54
4 57 56 54 52
4 58 53 55 56
4 59 58 56 57
4 62 61 45 60
6 72 63 65 62 60 48
5 66 64 47 61 62
4 67 66 62 65
4 68 67 65 63
4 69 64 66 67
4 70 69 67 68
4 73 72 48 71
4 74 73 71 53
4 75 63 72 73
4 76 75 73 74
6 77 76 74 53 58 59
6 78 70 68 63 75 76
4 79 78 76 77
CELL_TYPES 52
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
CELL_DATA 52
SCALARS Average-Intensity float 1
LOOKUP_TABLE default
81.05859375
78.53125
99.78125
83.015625
69.71875
57.17578125
71.3046875
139.125
131.75
72.1875
68.75
85.5
67.25
61.984375
83.26171875
81.9296875
75.37890625
38.54296875
45.7578125
39.5
57.26953125
49.85546875
68.046875
88.671875
52.5
77.96875
86.03125
70.71875
80.46875
113.96875
63.484375
66.75
88.5
93.9375
113.25
12.0
32.25
6.75
81.4375
102.125
137.5
136.0
28.0
31.75
1.5
132.25
40.75
35.5
3.5
11.625
17.9375
15.8125
Binary file added examples/4_meshed_pv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
quad = QTree(None, imar, 125)
mesh = QTreeMesh(quad)
mesh.create_elements()
mesh.vtk_export(filename = "4_meshed.vtk")
mesh.draw(True, 'orangered')

0 comments on commit c14f17a

Please sign in to comment.