You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AppFlow/FITK_Component/FITKCGNSIO/FITKCGNSReader.h

99 lines
3.0 KiB
C

/**********************************************************************
* @file FITKCGNSReader.h
* @brief CGNS
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-09-19
*********************************************************************/
#include "FITKCGNSIOAPI.h"
#include "FITK_Interface/FITKInterfaceIO/FITKAbstractIO.h"
#include <QVector>
#include <QMap>
#include <cgnslib.h>
namespace Interface {
class FITKUnstructuredFluidMeshVTK;
class FITKBoundaryMeshVTK;
}
namespace IO
{
/**
* @brief
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-09-19
*/
struct VertexDataInfo
{
double x = 0;
double y = 0;
double z = 0;
};
/**
* @brief CGNS
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-09-19
*/
class FITKCGNSIOAPI FITKCGNSReader : public Interface::FITKAbstractIO
{
public:
/**
* @brief
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-07-29
*/
FITKCGNSReader() = default;
/**
* @brief
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-07-29
*/
~FITKCGNSReader() = default;
/**
* @brief run
* @author fulipeng (fulipengqd@yeah.net)
* @date 2024-03-11
*/
void run() override;
/**
* @brief
* @param[i] level 1 normal 2 warning 3error
* @param[i] str
* @author fulipeng (fulipengqd@yeah.net)
* @date 2024-04-07
*/
void consoleMessage(int level, const QString& str) override;
private:
bool read();
bool readZone();
bool readCoordinate(int vertext_num, /*int*/cgsize_t range_from[3], /*int*/cgsize_t range_to[3]);
bool readBC(int zonei, int zonej, int zonek);
bool readZoneFlowSolution(int pointLen, int cellLen, cgsize_t* rmax_pt, cgsize_t* rmax_cell);
bool readBoundaryCond(int index_bc);
bool readZoneBCs(int index_bc, int cellCount);
bool readUnstructZoneBCs(int index_bc);
bool readStructZoneBCs(int index_bc);
bool readSections();
void readCells(int start_index, int end_index, int type, cgsize_t* elements /*int* elements*/, int element_data_size);
private:
/**
* @brief
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-09-19
*/
Interface::FITKUnstructuredFluidMeshVTK* m_Mesh{};
int m_index_file{ -1 };
int m_index_base{ -1 };
int m_index_zone{ -1 };
QVector<VertexDataInfo> m_verlist{};
Interface::FITKBoundaryMeshVTK* m_boundaryMesh{};
QMap<QString, QVector<double>> m_pointScalars;
QMap<QString, QVector<double>> m_cellScalars;
};
}