4#include <deal.II/base/function.h>
5#include <deal.II/base/point.h>
6#include <deal.II/dofs/dof_handler.h>
7#include <deal.II/lac/vector.h>
9#include <vtkSmartPointer.h>
10#include <vtkUnstructuredGrid.h>
11#include <vtkPointData.h>
12#include <vtkCellData.h>
13#include <vtkPointLocator.h>
14#include <vtkCellLocator.h>
15#include <vtkDoubleArray.h>
20using namespace dealii;
32template <
int dim,
int spacedim = dim>
70 const unsigned int component = 0);
81 virtual double value(
const Point<spacedim>& p,
82 const unsigned int component = 0)
const override;
A handler class for reading and interpolating data from VTK files.
int get_num_components() const
Returns the number of components in the selected field data.
DataLocation data_location
vtkSmartPointer< vtkDataArray > field_data
virtual double value(const Point< spacedim > &p, const unsigned int component=0) const override
Interpolates the value of the selected field at a given point.
vtkSmartPointer< vtkUnstructuredGrid > vtk_grid
void read_file()
Reads the VTK file and initializes the internal data structures.
unsigned int selected_component
vtkSmartPointer< vtkUnstructuredGrid > get_grid() const
Returns the underlying VTK unstructured grid.
void setup_field(const std::string &field_name, const DataLocation data_location=DataLocation::PointData, const unsigned int component=0)
Sets up the field to be used for interpolation.
vtkSmartPointer< vtkPointLocator > point_locator
DataLocation
Enum to specify whether the data is associated with points or cells.
@ CellData
Data is associated with the cells of the grid.
@ PointData
Data is associated with the vertices of the grid.
vtkSmartPointer< vtkDataArray > get_field_data() const
Returns the data array for the selected field.
vtkSmartPointer< vtkCellLocator > cell_locator