30 #ifndef vtkIOSSUtilities_h
31 #define vtkIOSSUtilities_h
39 #include "vtkTypeInt32Array.h"
40 #include "vtkTypeInt64Array.h"
46 #include VTK_IOSS(Ioss_Region.h)
47 #include VTK_IOSS(Ioss_Transform.h)
48 #include VTK_IOSS(Ioss_StructuredBlock.h)
49 #include VTK_IOSS(Ioss_SideSet.h)
50 #include VTK_IOSS(Ioss_SideBlock.h)
100 void operator=(
const Cache&) =
delete;
102 class CacheInternals;
103 CacheInternals* Internals;
122 std::ostringstream Stream;
123 std::ostream* DebugStream;
124 std::ostream* WarningStream;
142 std::vector<std::pair<int, double>>
GetTime(
const Ioss::Region* region);
158 template <
typename EntityType>
160 std::set<EntityNameType>& entity_names, std::set<std::string>& field_names)
162 for (
const auto& entity : entities)
164 const int64_t
id = entity->property_exists(
"id") ? entity->get_property(
"id").get_int() : 0;
168 Ioss::NameList attributeNames;
169 entity->field_describe(Ioss::Field::TRANSIENT, &attributeNames);
170 entity->field_describe(Ioss::Field::ATTRIBUTE, &attributeNames);
172 attributeNames.begin(), attributeNames.end(), std::inserter(field_names, field_names.end()));
179 void GetEntityAndFieldNames<Ioss::SideSet>(
const Ioss::Region* region,
180 const std::vector<Ioss::SideSet*>& entities, std::set<EntityNameType>& entity_names,
181 std::set<std::string>& field_names);
218 int GetCellType(
const Ioss::ElementTopology* topology);
240 Ioss::GroupingEntity* group_entity,
int& vtk_topology_type,
Cache* cache =
nullptr);
248 const Ioss::GroupingEntity* group_entity,
Cache* cache =
nullptr);
292 Ioss::Region* region,
const std::string& blockname);
std::string GetSanitizedBlockName(const Ioss::Region *region, const std::string &name)
This is primarily intended for CGNS.
abstract base class for most VTK objects
Remove all duplicate types from TypeList TList, storing the new list in Result.
Ioss::EntityType GetIOSSEntityType(vtkIOSSReader::EntityType vtk_type)
For the given vtkIOSSReader::EntityType return the corresponding Ioss::EntityType.
abstract class to specify dataset behavior
~CaptureNonErrorMessages()
std::vector< Ioss::StructuredBlock * > GetMatchingStructuredBlocks(Ioss::Region *region, const std::string &blockname)
Returns collection of StructuredBlock's matching the selected blockname.
void Insert(const Ioss::GroupingEntity *entity, const std::string &cachekey, vtkObject *array)
DatabaseFormatType GetFormat(const Ioss::GroupingEntity *entity)
Given any GroupingEntity pointer, returns the format that the associated database is in...
typename vtkTypeList::detail::CreateImpl< Ts... >::type Create
vtkObject * Find(const Ioss::GroupingEntity *entity, const std::string &cachekey) const
bool IsFieldTransient(Ioss::GroupingEntity *entity, const std::string &fieldname)
Returns true if the field is transient.
std::string GetDisplacementFieldName(Ioss::GroupingEntity *nodeblock)
Finds a displacement field name.
CaptureNonErrorMessages()
const Ioss::ElementTopology * GetElementTopology(int vtk_cell_type)
Returns an Ioss topology element, if possible, given a VTK cell type.
void Clear()
Clears the cache.
vtkSmartPointer< vtkDataArray > 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.
int GetCellType(const Ioss::ElementTopology *topology)
Returns VTK celltype for a Ioss topology element.
vtkSmartPointer< vtkCellArray > GetConnectivity(Ioss::GroupingEntity *group_entity, int &vtk_topology_type, Cache *cache=nullptr)
Read connectivity information from the group_entity.
std::string GetMessages() const
Provides access to the accumulated messages.
object to represent cell connectivity
vtkSmartPointer< vtkPoints > GetMeshModelCoordinates(const Ioss::GroupingEntity *group_entity, Cache *cache=nullptr)
Read points from the group_entity.
std::vector< std::pair< int, double > > GetTime(const Ioss::Region *region)
Reads time / timestep information from a region.
void GetEntityAndFieldNames(const Ioss::Region *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 wit...
void ResetAccessCounts()
Call this to clear internal count for hits.
internal utilities for vtkIOSSReader
A helper to instantiate on stack to temporarily redirect non-critical messsages emanating from IOSS...
vtkSmartPointer< vtkDataArray > CreateArray(const Ioss::Field &field)
Create an array for the given field.
void InitializeEnvironmentForIOSS()
Must be called before using any Ioss library functions.
DatabaseFormatType DetectType(const std::string &dbaseName)
Given a filename determines and returns the database type.
std::pair< vtkTypeUInt64, std::string > EntityNameType
void ClearUnused()
Removes all cached entries not accessed since most recent call to ResetAccessCounts.