43inline int readNodeData(
int cgioNum,
double nodeId, std::vector<T>& data)
49 constexpr const char* dtName = CGNSRead::detail::cgns_type_name<T>();
51 if (cgio_get_dimensions(cgioNum, nodeId, &ndim, dimVals) != CG_OK)
53 cgio_error_exit(
"cgio_get_dimensions");
58 for (n = 0; n < ndim; n++)
69 if (cgio_read_all_data_type(cgioNum, nodeId, dtName, &data[0]) != CG_OK)
86 char dtype[CGIO_MAX_DATATYPE_LENGTH + 1];
87 if (cgio_get_data_type(cgioNum, nodeId, dtype) != CG_OK)
89 cgio_error_exit(
"cgio_get_data_type");
93 if (strcmp(dtype,
"I4") == 0)
95 std::vector<vtkTypeInt32> i32vector;
96 readNodeData<vtkTypeInt32>(cgioNum, nodeId, i32vector);
97 data.resize(i32vector.size());
98 std::copy(i32vector.begin(), i32vector.end(), data.begin());
100 else if (strcmp(dtype,
"I8") == 0)
102 std::vector<vtkTypeInt64> i64vector;
103 readNodeData<vtkTypeInt64>(cgioNum, nodeId, i64vector);
104 data.resize(i64vector.size());
105 std::copy(i64vector.begin(), i64vector.end(), data.begin());
107 else if (strcmp(dtype,
"R4") == 0)
109 std::vector<float> fvector;
110 readNodeData<float>(cgioNum, nodeId, fvector);
111 data.resize(fvector.size());
112 std::copy(fvector.begin(), fvector.end(), data.begin());
114 else if (strcmp(dtype,
"R8") == 0)
116 std::vector<double> dvector;
117 readNodeData<double>(cgioNum, nodeId, dvector);
118 data.resize(dvector.size());
119 std::copy(dvector.begin(), dvector.end(), data.begin());
140int readBaseIds(
int cgioNum,
double rootId, std::vector<double>& baseIds);
156 const std::string& parentPath =
"");
int readBaseReferenceState(int cgioNum, double nodeId, CGNSRead::BaseInformation &baseInfo)
int readNodeStringData(int cgioNum, double nodeId, std::string &data)
int getNodeChildrenId(int cgioNum, double fatherId, std::vector< double > &childrenIds)
int readBaseCoreInfo(int cgioNum, double baseId, CGNSRead::BaseInformation &baseInfo)
int readNodeDataAs(int cgioNum, double nodeId, std::vector< T > &data)
int readBaseFamily(int cgioNum, double nodeId, CGNSRead::BaseInformation &baseInfo, const std::string &parentPath="")
void releaseIds(int cgioNum, const std::vector< double > &ids)
release all ids in the vector.
int readSolInfo(int cgioNum, double nodeId, CGNSRead::BaseInformation &baseInfo)
int readNodeData< char >(int cgioNum, double nodeId, std::vector< char > &data)
int readNodeData(int cgioNum, double nodeId, std::vector< T > &data)
int readBaseIteration(int cgioNum, double nodeId, CGNSRead::BaseInformation &baseInfo)
int readBaseIds(int cgioNum, double rootId, std::vector< double > &baseIds)
int readZoneIterInfo(int cgioNum, double nodeId, CGNSRead::BaseInformation &baseInfo)
int readZoneInfo(int cgioNum, double nodeId, CGNSRead::BaseInformation &baseInfo)