46#ifndef Foam_vtk_vtkTools_H
47#define Foam_vtk_vtkTools_H
55#include "vtkCellArray.h"
56#include "vtkFloatArray.h"
57#include "vtkDoubleArray.h"
58#include "vtkIdTypeArray.h"
59#include "vtkSmartPointer.h"
60#include "vtkUnsignedCharArray.h"
62#include "vtkPolyData.h"
86template<
class DataType>
113 auto copy = vtkSmartPointer<dataType>::New();
124 dataset = vtkSmartPointer<dataType>::New();
132 void set(vtkSmartPointer<dataType> geom)
144 vtkgeom->PrintSelf(std::cout, vtkIndent(2));
155 dataset->PrintSelf(std::cout, vtkIndent(2));
175 vtkUnsignedCharArray* array,
182 vtkIdTypeArray* array,
187 inline vtkSmartPointer<vtkPoints>
Points
193 inline vtkSmartPointer<vtkPoints>
Points
204 inline vtkSmartPointer<vtkPolyData>
Vertices
210 inline vtkSmartPointer<vtkPolyData>
Vertices
224 template<
class PatchType>
225 static vtkSmartPointer<vtkPoints>
points(
const PatchType&
p);
228 template<
class PatchType>
229 static vtkSmartPointer<vtkCellArray>
faces(
const PatchType&
p);
232 template<
class PatchType>
233 static vtkSmartPointer<vtkPolyData>
mesh(
const PatchType&
p);
236 template<
class PatchType>
237 static vtkSmartPointer<vtkFloatArray>
faceNormals(
const PatchType&
p);
240 template<
class PatchType>
241 static vtkSmartPointer<vtkPoints>
faceCentres(
const PatchType&
p);
245 static vtkSmartPointer<vtkPolyData>
mesh
299 vtkFloatArray* array,
340void Foam::vtk::Tools::remapTuple<Foam::symmTensor>(
float data[])
342 std::swap(data[1], data[3]);
343 std::swap(data[2], data[5]);
349void Foam::vtk::Tools::remapTuple<Foam::symmTensor>(
double data[])
351 std::swap(data[1], data[3]);
352 std::swap(data[2], data[5]);
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Database for solution data, solver performance and other reduced data.
A class for handling words, derived from Foam::string.
A class representing the concept of a field of 0 used to avoid unnecessary manipulations for objects ...
OBJstream os(runTime.globalPath()/outputName)
static Istream & input(Istream &is, IntRange< T > &range)
static Ostream & output(Ostream &os, const IntRange< T > &range)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
constexpr char nl
The newline '\n' character (0x0a)
Bookkeeping for internal caching.
void set(vtkSmartPointer< dataType > geom)
Set the geometry and make a shallow copy to dataset.
void PrintSelf(std::ostream &os) const
Report basic information to output.
void clearGeom()
Clear geometry and dataset.
vtkSmartPointer< dataType > vtkgeom
The geometry, without any cell/point data.
void reuse()
Make a shallow copy of vtkgeom into dataset.
vtkSmartPointer< dataType > dataset
The shallow-copy of geometry, plus additional data.
uint64_t nPoints() const
Number of points associated with the geometry.
vtkSmartPointer< dataType > getCopy() const
Return a shallow copy of vtkgeom for manipulation.