VTK  9.0.20200930
Classes | Typedefs | Functions
vtkIossUtilities Namespace Reference

internal utilities for vtkIossReader More...

Classes

class  Cache
 Cache. More...
 

Typedefs

using EntityNameType = std::pair< vtkTypeUInt64, std::string >
 
using ArrayList = typename vtkTypeList::Unique< vtkTypeList::Create< vtkDoubleArray, vtkTypeInt32Array, vtkTypeInt64Array > >::Result
 List of possible ArrayTypes that are produced by vtkIossUtilities. More...
 

Functions

std::set< double > GetTimeValues (const Ioss::Region *region)
 Reads time / timestep information from a region. More...
 
template<typename EntityType >
void GetEntityAndFieldNames (const Ioss::Region *, const std::vector< EntityType * > &entities, std::set< EntityNameType > &entity_names, std::set< std::string > &field_names)
 Populates entitySelection with available entity block (or set) names and populates fieldSelection with transient and attribute fields on the chosen entity block (or set). More...
 
Ioss::EntityType GetIossEntityType (vtkIossReader::EntityType vtk_type)
 For the given vtkIossReader::EntityType return the corresponding Ioss::EntityType. More...
 
vtkSmartPointer< vtkDataArrayCreateArray (const Ioss::Field &field)
 Create an array for the given field. More...
 
vtkSmartPointer< vtkDataArrayGetData (const Ioss::GroupingEntity *entity, const std::string &fieldname, Ioss::Transform *transform=nullptr, Cache *cache=nullptr, const std::string &cachekey=std::string())
 Returns a VTK array for a given field (fieldname) on the chosen block (or set) entity. More...
 
int GetCellType (const Ioss::ElementTopology *topology)
 Returns VTK celltype for a Ioss topology element. More...
 
vtkSmartPointer< vtkCellArrayGetConnectivity (Ioss::GroupingEntity *group_entity, int &vtk_topology_type, Cache *cache=nullptr)
 Read connectivity information from the group_entity. More...
 
vtkSmartPointer< vtkPointsGetMeshModelCoordinates (Ioss::GroupingEntity *group_entity, Cache *cache=nullptr)
 Read points from the group_entity. More...
 
bool IsFieldTransient (Ioss::GroupingEntity *entity, const std::string &fieldname)
 Returns true if the field is transient. More...
 
std::string GetDisplacementFieldName (Ioss::GroupingEntity *nodeblock)
 Finds a displacement field name. More...
 

Detailed Description

internal utilities for vtkIossReader

vtkIossReader provides some helper functions to go between VTK and Ioss. Not intended for public consumption. API likely to change without notice.

Developer Notes

We limit this namespace for utility functions that go between Ioss and VTK or vice-versa. Thus, methods that are not straddling that fence should be not be added here.

Typedef Documentation

◆ EntityNameType

using vtkIossUtilities::EntityNameType = typedef std::pair<vtkTypeUInt64, std::string>

Definition at line 92 of file vtkIossUtilities.h.

◆ ArrayList

using vtkIossUtilities::ArrayList = typedef typename vtkTypeList::Unique< vtkTypeList::Create<vtkDoubleArray, vtkTypeInt32Array, vtkTypeInt64Array> >::Result

List of possible ArrayTypes that are produced by vtkIossUtilities.

This can be used with vtkArrayDispatch::DispatchByArray, etc. when dealing with arrays read from Ioss.

Definition at line 101 of file vtkIossUtilities.h.

Function Documentation

◆ GetTimeValues()

std::set<double> vtkIossUtilities::GetTimeValues ( const Ioss::Region *  region)

Reads time / timestep information from a region.

Returns an empty vector if no time information in available in the Ioss::Region.

◆ GetEntityAndFieldNames()

template<typename EntityType >
void vtkIossUtilities::GetEntityAndFieldNames ( const Ioss::Region *  ,
const std::vector< EntityType * > &  entities,
std::set< EntityNameType > &  entity_names,
std::set< std::string > &  field_names 
)

Populates entitySelection with available entity block (or set) names and populates fieldSelection with transient and attribute fields on the chosen entity block (or set).

Definition at line 115 of file vtkIossUtilities.h.

◆ GetIossEntityType()

Ioss::EntityType vtkIossUtilities::GetIossEntityType ( vtkIossReader::EntityType  vtk_type)

For the given vtkIossReader::EntityType return the corresponding Ioss::EntityType.

Throws std::runtime_error for invalid values.

◆ CreateArray()

vtkSmartPointer<vtkDataArray> vtkIossUtilities::CreateArray ( const Ioss::Field &  field)

Create an array for the given field.

Uses type information from the field to create the correct type of array. Also resizes the array using count and component information from the field.

Throws std::runtime_error for unsupported types.

◆ GetData()

vtkSmartPointer<vtkDataArray> vtkIossUtilities::GetData ( const Ioss::GroupingEntity *  entity,
const std::string &  fieldname,
Ioss::Transform *  transform = nullptr,
Cache cache = nullptr,
const std::string &  cachekey = std::string() 
)

Returns a VTK array for a given field (fieldname) on the chosen block (or set) entity.

Throws std::runtime_error on error or field not present.

◆ GetCellType()

int vtkIossUtilities::GetCellType ( const Ioss::ElementTopology *  topology)

Returns VTK celltype for a Ioss topology element.

Throws std::runtime_error for unknown and unsupported element types.

Note that the returned VTK cell type may have fewer points than the corresponding Ioss element type.

◆ GetConnectivity()

vtkSmartPointer<vtkCellArray> vtkIossUtilities::GetConnectivity ( Ioss::GroupingEntity *  group_entity,
int &  vtk_topology_type,
Cache cache = nullptr 
)

Read connectivity information from the group_entity.

Returns the vtkCellArray and the element type for all elements in this group_entity.

NOTE: this does not support entity groups with mixed topological elements.

Throws std::runtime_error on error.

◆ GetMeshModelCoordinates()

vtkSmartPointer<vtkPoints> vtkIossUtilities::GetMeshModelCoordinates ( Ioss::GroupingEntity *  group_entity,
Cache cache = nullptr 
)

Read points from the group_entity.

Throws std::runtime_error on error or coordinates not present.

◆ IsFieldTransient()

bool vtkIossUtilities::IsFieldTransient ( Ioss::GroupingEntity *  entity,
const std::string &  fieldname 
)

Returns true if the field is transient.

This method supports SIDESETs. It iterates into the nest SIDEBLOCK elements to check for the field.

◆ GetDisplacementFieldName()

std::string vtkIossUtilities::GetDisplacementFieldName ( Ioss::GroupingEntity *  nodeblock)

Finds a displacement field name.

Returns empty string if none can be found.