46#ifndef Foam_vtk_vtuAdaptor_H
47#define Foam_vtk_vtuAdaptor_H
55#include "vtkUnstructuredGrid.h"
56#include "vtkMultiBlockDataSet.h"
87 inline vtkSmartPointer<vtkPoints>
NewPoints
93 inline vtkSmartPointer<vtkPoints>
points
100 inline vtkSmartPointer<vtkPoints>
points
108 inline vtkSmartPointer<vtkUnstructuredGrid>
internal
112 const bool decompPoly =
false
119 template<
class Type,
class DataArrayType = vtkFloatArray>
120 vtkSmartPointer<DataArrayType>
127 template<
class Type,
class DataArrayType = vtkFloatArray>
128 vtkSmartPointer<DataArrayType>
148 #include "foamVtkVtuAdaptor.txx"
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
foamVtkMeshMaps()=default
Default construct: zero-sized, no reserved sizes.
const labelList & pointMap() const noexcept
Point labels for subsetted meshes.
Mesh data needed to do the Finite Volume discretisation.
Mesh consisting of general polyhedral cells.
Bookkeeping for vtkUnstructuredGrid.
vtkSmartPointer< vtkPoints > NewPoints(vtkIdType count) const
Allocate vtkPoints.
vtkSmartPointer< DataArrayType > convertField(const GeometricField< Type, fvPatchField, volMesh > &fld) const
Convert internal volume field (CellData).
vtkSmartPointer< DataArrayType > convertField(const DimensionedField< Type, volMesh > &fld) const
Convert internal volume field (CellData).
vtkSmartPointer< vtkUnstructuredGrid > internal(const fvMesh &mesh, const bool decompPoly=false)
Internal mesh as vtkUnstructuredGrid.
Namespace for handling VTK output. Contains classes and functions for writing VTK file content.
UList< label > labelUList
A UList of labels.
Bookkeeping for internal caching.
Forwards and collection of common volume field types.