- 
                Notifications
    You must be signed in to change notification settings 
- Fork 15
Enhancement: Field data export #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            21 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      f428374
              
                evtk: reformat with black
              
              
                MuellerSeb d59bc12
              
                evtk-subpackage: reformat with black
              
              
                MuellerSeb ce2224e
              
                xml: add doc; reformat with black
              
              
                MuellerSeb 5388d60
              
                vtk: update doc; reformat with black; remove largefile attribute; rem…
              
              
                MuellerSeb 3b3fcf0
              
                hl: add field_data export option; update doc; reformat with black
              
              
                MuellerSeb e10458b
              
                examples: reformat wit black; add field data example
              
              
                MuellerSeb dcd0fc1
              
                vtk: reset appended encoding to raw
              
              
                MuellerSeb 71a9fab
              
                minor doc corrections
              
              
                MuellerSeb e4d7287
              
                setup.py: reformat with black
              
              
                MuellerSeb fcfc346
              
                [ci] update travis setup
              
              
                renefritze 5150345
              
                evtk: reformat with black
              
              
                MuellerSeb 666c780
              
                evtk-subpackage: reformat with black
              
              
                MuellerSeb 6da811f
              
                xml: add doc; reformat with black
              
              
                MuellerSeb ab0b3af
              
                vtk: update doc; reformat with black; remove largefile attribute; rem…
              
              
                MuellerSeb 4d0cdf2
              
                hl: add field_data export option; update doc; reformat with black
              
              
                MuellerSeb 1f124ae
              
                examples: reformat wit black; add field data example
              
              
                MuellerSeb b61c10e
              
                vtk: reset appended encoding to raw
              
              
                MuellerSeb d1f1e33
              
                minor doc corrections
              
              
                MuellerSeb 6e058a4
              
                setup.py: reformat with black
              
              
                MuellerSeb db63f75
              
                add some missing descriptions
              
              
                MuellerSeb 2dcbedc
              
                solve conflicts; remove accidentally created .vtu
              
              
                MuellerSeb File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,4 +1,8 @@ | ||
| from pyevtk import * | ||
|  | ||
| import warnings | ||
| warnings.warn('the "evtk" package is deprecated, use "pyevtk" instead', DeprecationWarning) | ||
|  | ||
| warnings.warn( | ||
| 'the "evtk" package is deprecated, use "pyevtk" instead', | ||
| DeprecationWarning, | ||
| ) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -48,11 +48,14 @@ | |
| x[4], y[4], z[4] = 1.0, 1.0, 0.0 | ||
| x[5], y[5], z[5] = 2.0, 1.0, 0.0 | ||
|  | ||
| point_data = {"test_pd": np.array([1, 2, 3, 4, 5, 6])} | ||
| cell_data = {"test_cd": np.array([1, 2, 3])} | ||
| field_data = {"test_fd": np.array([1.0, 2.0])} | ||
| # Define connectivity or vertices that belongs to each element | ||
| conn = np.zeros(10) | ||
|  | ||
| conn[0], conn[1], conn[2] = 0, 1, 3 # first triangle | ||
| conn[3], conn[4], conn[5] = 1, 4, 3 # second triangle | ||
| conn[0], conn[1], conn[2] = 0, 1, 3 # first triangle | ||
| conn[3], conn[4], conn[5] = 1, 4, 3 # second triangle | ||
| conn[6], conn[7], conn[8], conn[9] = 1, 2, 5, 4 # rectangle | ||
|  | ||
| # Define offset of last vertex of each element | ||
|  | @@ -67,4 +70,15 @@ | |
| ctype[0], ctype[1] = VtkTriangle.tid, VtkTriangle.tid | ||
| ctype[2] = VtkQuad.tid | ||
|  | ||
| unstructuredGridToVTK("unstructured", x, y, z, connectivity = conn, offsets = offset, cell_types = ctype, cellData = None, pointData = None) | ||
| unstructuredGridToVTK( | ||
| "unstructured", | ||
| x, | ||
| y, | ||
| z, | ||
| connectivity=conn, | ||
| offsets=offset, | ||
| cell_types=ctype, | ||
| cellData=cell_data, | ||
| pointData=point_data, | ||
| fieldData=field_data, | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This field data can now simply be added to the call of the export functions. | ||
| ) | ||
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I added field data to the grid.