Skip to content

Commit

Permalink
Merge pull request #45 from porteri/modern_vtk
Browse files Browse the repository at this point in the history
Initial modern VTK for structured grid, unstructured grid and rectilinear grid
  • Loading branch information
porteri authored Jul 31, 2019
2 parents 8001be7 + e14bbcd commit fb3f2b9
Show file tree
Hide file tree
Showing 56 changed files with 4,385 additions and 298 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "documents/wiki"]
path = documents/wiki
url = ../../porteri/vtkmofo.wiki
51 changes: 34 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,39 @@ set(VTKmofo_mod_dir ${CMAKE_CURRENT_BINARY_DIR}/mod)
# put interfaces and submodules in separate libraries
# Specify VTKmofo interfaces
set(VTKmofo_interfaces
Precision.f90
Misc_interface.f90
VTK_io_interface.f90
VTK_datasets_interface.f90
VTK_cells_interface.f90
VTK_attributes_interface.f90
VTK_vars.f90)
utilities/file_utility.f90
utilities/linked_list.f90
utilities/Misc.f90
utilities/Precision.f90
utilities/xml.f90
legacy/VTK_io.f90
legacy/VTK_datasets.f90
legacy/VTK_cells.f90
legacy/VTK_attributes.f90
legacy/VTK_vars.f90
modern/VTK_DataArray.f90
modern/VTK_element.f90
modern/VTK_piece_element.f90
modern/VTK_serial_file.f90
modern/VTK_serial_Grid.f90
)

# Specify VTKmofo implementations
set(VTKmofo_implementations
Misc_implementation.f90
VTK_attributes_implementation.f90
VTK_cells_implementation.f90
VTK_datasets_implementation.f90
VTK_interface.f90
VTK_io_implementation.f90
set(VTKmofo_procedures
utilities/file_utility_procedures.f90
utilities/linked_list_procedures.f90
utilities/Misc_procedures.f90
utilities/xml_procedures.f90
legacy/VTK_attributes_procedures.f90
legacy/VTK_cells_procedures.f90
legacy/VTK_datasets_procedures.f90
legacy/VTK.f90
legacy/VTK_io_procedures.f90
modern/VTK_DataArray_procedures.f90
modern/VTK_element_procedures.f90
modern/VTK_piece_element_procedures.f90
modern/VTK_serial_file_procedures.f90
modern/VTK_serial_Grid_procedures.f90
)

# Compile all the interfaces first
Expand All @@ -124,11 +141,11 @@ if(VTKmofo_USE_OpenCoarrays)
endif()

# Add any object files from the interfaces to the main library build
foreach(item ${VTKmofo_implementations})
list(APPEND VTKmofo_implementation_srcs "${CMAKE_CURRENT_SOURCE_DIR}/src/${item}")
foreach(item ${VTKmofo_procedures})
list(APPEND VTKmofo_procedures_srcs "${CMAKE_CURRENT_SOURCE_DIR}/src/${item}")
endforeach()
add_library(vtkmofo
STATIC ${VTKmofo_implementation_srcs} $<TARGET_OBJECTS:vtkmofo_interfaces>)
STATIC ${VTKmofo_procedures_srcs} $<TARGET_OBJECTS:vtkmofo_interfaces>)
if(VTKmofo_USE_OpenCoarrays)
target_link_libraries(vtkmofo
PRIVATE OpenCoarrays::caf_mpi_static)
Expand Down
40 changes: 28 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,24 @@ VTK legacy format using modern Fortran
[![release downloads][download image]](https://github.com/porteri/vtkmofo/releases)
[![codecov][codecov image]](https://codecov.io/gh/porteri/vtkmofo)

This is a generic modern Fortran interface to write a .vtk file using the legacy .vtk file format, version 3.0.
This is a generic modern Fortran interface to write a VTK formatted file using the specifications outlined in [version 3.0][VTK Format Link].

Format support:
- [X] Legacy Format
* This code fully supports the legacy .vtk file format in ASCII
- [X] XML Format
- [ ] Serial Formats
- [ ] Image Data (.vti)
- [ ] Poly Data (.vtp)
- [X] Rectilinear Grid (.vtr)
- [X] Structured Grid (.vts)
- [X] Unstructured Grid (.vtu) (Currently under development)
- [ ] Parallel Formats
- [ ] Image Data (.pvti)
- [ ] Poly Data (.pvtp)
- [ ] Rectilinear Grid (.pvtr)
- [ ] Structured Grid (.pvts)
- [ ] Unstructured Grid (.pvtu)

This code is built and tested with the following:

Expand All @@ -23,21 +40,20 @@ Build System:
- [CMake][CMake link] 3.12.2 or newer

Examples:
# 2D example
![Cylinder_2d](files/cylinder_image_2d.png?raw=true "Cylinder 2D example")
# 3D example
![Cube_3d](files/cube_image.png?raw=true "Cube example")
# Polygonal example
![Pyramid](files/pyramid_image.png?raw=true "Pyramid example")
# Prism example
![Prism](files/rectangle_image.png?raw=true "Prism example")
# Unstructured Grid example
![T_shape](files/t_shape.png?raw=true "T-shape example")
# Structured Grid (2D)
![Cylinder_2d](documents/files/cylinder_image_2d.png?raw=true "Cylinder 2D example")
# Rectilinear Grid
![Cube_3d](documents/files/cube_image.png?raw=true "Cube example")
# Polygonal Data
![Pyramid](documents/files/pyramid_image.png?raw=true "Pyramid example")
# Structured Points
![Prism](documents/files/rectangle_image.png?raw=true "Prism example")
# Unstructured Grid
![T_shape](documents/files/t_shape.png?raw=true "T-shape example")

[Hyperlinks]:#
[AppVeyor build image]: https://ci.appveyor.com/api/projects/status/omlvmn8xcr9sxuwt?svg=true "AppVeyor build badge"
[Travis CI build image]: https://travis-ci.org/porteri/vtkmofo.svg?branch=master "Travis CI build badge"
[Travis CI build image]: https://img.shields.io/travis-ci/porteri/vtkmofo/master.svg?style=flat-square "Travis CI build badge"
[download image]: https://img.shields.io/github/downloads/porteri/vtkmofo/total.svg?style=flat-square "Download count badge"
[codecov image]: https://codecov.io/gh/porteri/vtkmofo/branch/master/graph/badge.svg
[gcc link]: https://gcc.gnu.org/
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
1 change: 1 addition & 0 deletions documents/wiki
Submodule wiki added at c873c7
89 changes: 0 additions & 89 deletions src/VTK_io_interface.f90

This file was deleted.

2 changes: 1 addition & 1 deletion src/VTK_interface.f90 → src/legacy/VTK.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MODULE vtk
USE vtk_cells
USE vtk_datasets
USE vtk_vars
USE vtk_io, ONLY : vtk_legacy_write
USE vtk_io
IMPLICIT NONE
!! author: Ian Porter
!! date: 12/1/2017
Expand Down
Loading

0 comments on commit fb3f2b9

Please sign in to comment.