Chi-Tech
chi_grid_vtk_utils.h
Go to the documentation of this file.
1#ifndef CHITECH_CHI_GRID_VTK_UTILS_H
2#define CHITECH_CHI_GRID_VTK_UTILS_H
3
4#include <cstdint>
5#include <string>
6#include <vector>
7#include <map>
8
9template<class T>
10class vtkNew;
11class vtkPoints;
12class vtkUnstructuredGrid;
13template<class T>
15
16namespace chi_mesh
17{
18 class MeshContinuum;
19 class Cell;
20 class CellFace;
21
22 //00
24 const chi_mesh::Cell &cell,
25 int64_t& node_counter,
26 vtkNew<vtkPoints>& points,
29 const std::vector<uint64_t>& vertex_map,
31 void UploadFaceGeometry(const chi_mesh::CellFace& cell_face,
32 const std::vector<uint64_t>& vertex_map,
34
35 //01 Utils for Reading
37 typedef std::pair<vtkUGridPtr, std::string> vtkUGridPtrAndName;
38
39 int FindHighestDimension(std::vector<vtkUGridPtrAndName>& ugrid_blocks);
40
42 ConsolidateGridBlocks(std::vector<vtkUGridPtrAndName>& ugrid_blocks,
43 const std::string& block_id_array_name = "BlockID");
44
45 std::vector<vtkUGridPtrAndName>
46 GetBlocksOfDesiredDimension(std::vector<vtkUGridPtrAndName>& ugrid_blocks,
47 int desired_dimension);
48
49 std::vector<uint64_t>
50 BuildBlockCellExtents(std::vector<vtkUGridPtrAndName>& ugrid_blocks,
51 int desired_dimension);
52
53 void SetBlockIDArrays(std::vector<vtkUGridPtrAndName>& ugrid_blocks);
54
55 std::vector<int>
57 const std::string& field_name,
58 const std::string& file_name);
59
60 //04 Writing VTK files
63 bool discontinuous = true);
64
66 const std::string &file_base_name);
67
68}//namespace chi_mesh
69
70#endif //CHITECH_CHI_GRID_VTK_UTILS_H
vtkNew< vtkUnstructuredGrid > PrepareVtkUnstructuredGrid(const chi_mesh::MeshContinuum &grid, bool discontinuous=true)
std::vector< int > BuildCellMaterialIDsFromField(vtkUGridPtr &ugrid, const std::string &field_name, const std::string &file_name)
std::vector< uint64_t > BuildBlockCellExtents(std::vector< vtkUGridPtrAndName > &ugrid_blocks, int desired_dimension)
void UploadFaceGeometry(const chi_mesh::CellFace &cell_face, const std::vector< uint64_t > &vertex_map, vtkNew< vtkUnstructuredGrid > &ugrid)
void UploadCellGeometryContinuous(const chi_mesh::Cell &cell, const std::vector< uint64_t > &vertex_map, vtkNew< vtkUnstructuredGrid > &ugrid)
void WritePVTUFiles(vtkNew< vtkUnstructuredGrid > &ugrid, const std::string &file_base_name)
vtkSmartPointer< vtkUnstructuredGrid > vtkUGridPtr
std::pair< vtkUGridPtr, std::string > vtkUGridPtrAndName
void UploadCellGeometryDiscontinuous(const chi_mesh::MeshContinuum &grid, const chi_mesh::Cell &cell, int64_t &node_counter, vtkNew< vtkPoints > &points, vtkNew< vtkUnstructuredGrid > &ugrid)
vtkUGridPtr ConsolidateGridBlocks(std::vector< vtkUGridPtrAndName > &ugrid_blocks, const std::string &block_id_array_name="BlockID")
void SetBlockIDArrays(std::vector< vtkUGridPtrAndName > &ugrid_blocks)
int FindHighestDimension(std::vector< vtkUGridPtrAndName > &ugrid_blocks)
std::vector< vtkUGridPtrAndName > GetBlocksOfDesiredDimension(std::vector< vtkUGridPtrAndName > &ugrid_blocks, int desired_dimension)