23#ifndef VTK_IO_ADIOS2_VTX_COMMON_VTXHelper_h
24#define VTK_IO_ADIOS2_VTX_COMMON_VTXHelper_h
40#include <vtk_pugixml.h>
68 const std::string& input,
const bool debugMode,
const std::string& hint);
81pugi::xml_node
XMLNode(
const std::string nodeName,
const pugi::xml_document& xmlDocument,
82 const bool debugMode,
const std::string& hint,
const bool isMandatory =
true,
83 const bool isUnique =
false);
97pugi::xml_node
XMLNode(
const std::string nodeName,
const pugi::xml_node& upperNode,
98 const bool debugMode,
const std::string& hint,
const bool isMandatory =
true,
99 const bool isUnique =
false);
118pugi::xml_attribute
XMLAttribute(
const std::string attributeName,
const pugi::xml_node& node,
119 const bool debugMode,
const std::string& hint,
const bool isMandatory =
true);
126std::string
SetToCSV(
const std::set<std::string>& input)
noexcept;
142std::size_t
TotalElements(
const std::vector<std::size_t>& dimensions)
noexcept;
153 const pugi::xml_node& dataSetNode,
const std::set<std::string>& specialNames);
180template <
class T,
class U>
189void Print(
const std::vector<T>& input,
const std::string& name);
197size_t LinearizePoint(
const adios2::Dims& shape,
const adios2::Dims& point)
noexcept;
219bool EndsWith(
const std::string& input,
const std::string& ends)
noexcept;
224#include "VTXHelper.inl"
Hold a reference to a vtkObjectBase instance.
types::DataSet XMLInitDataSet(const pugi::xml_node &dataSetNode, const std::set< std::string > &specialNames)
Initialize DataSet structure from parsing a pugi::xml_node, loops through DataArray nodes.
adios2::Box< adios2::Dims > PartitionCart1D(const adios2::Dims &shape)
Simple partition to load balance shape across viz processes.
bool EndsWith(const std::string &input, const std::string &ends) noexcept
Check if input ends with a certain (ends) string.
std::string GetEngineType(const std::string &fileName) noexcept
Set the appropriate engine type based on recognized user input.
std::string FileToString(const std::string &fileName)
Translate file contents to string.
std::size_t TotalElements(const std::vector< std::size_t > &dimensions) noexcept
Return product of all dimensions components to get the total number of elements.
size_t LinearizePoint(const adios2::Dims &shape, const adios2::Dims &point) noexcept
Linear index for a point within a box with shape dimensions from zero origin.
pugi::xml_node XMLNode(const std::string nodeName, const pugi::xml_document &xmlDocument, const bool debugMode, const std::string &hint, const bool isMandatory=true, const bool isUnique=false)
Get safely a pugi::xml_document from a pugmi::xml_document.
int MPIGetSize()
Get current MPI size from MPIGetComm.
std::vector< T > MapKeysToVector(const std::map< T, U > &input) noexcept
Map's keys to a vector.
vtkSmartPointer< vtkDataArray > NewDataArray()
Return a derived class of vtkDataArray specialized for supported types.
MPI_Comm MPIGetComm()
Get current MPI global communicator from VTK.
vtkSmartPointer< vtkIdTypeArray > NewDataArrayIdType()
Special type for vtkIdTypeArray.
std::string GetFileName(const std::string &fileName) noexcept
Set the appropriate file name based on recognized user input.
void Print(const std::vector< T > &input, const std::string &name)
Print a vector with an associated name.
std::string SetToCSV(const std::set< std::string > &input) noexcept
Convert a set of strings into a csv "string1,string2,string3" string.
pugi::xml_document XMLDocument(const std::string &input, const bool debugMode, const std::string &hint)
Get safely a pugi::xml_document from XML as a string.
pugi::xml_attribute XMLAttribute(const std::string attributeName, const pugi::xml_node &node, const bool debugMode, const std::string &hint, const bool isMandatory=true)
Get a node attribute identified by its key.
int MPIGetRank()
Get current MPI rank from MPIGetComm.
std::vector< T > StringToVector(const std::string &input) noexcept
Converts a single string "s1 s2 s3" list to a vector vector ={ "s1", "s2", "s3" };.
std::map< std::string, DataArray > DataSet
key: variable name, value: DataArray