3131#include " cgnslib.h"
3232#endif
3333
34+ /* --- Define data precision of output (float or double). ---*/
35+ typedef float dataPrecision;
36+
3437#include " CFileWriter.hpp"
3538
3639class CCGNSFileWriter final : public CFileWriter {
@@ -46,14 +49,20 @@ class CCGNSFileWriter final : public CFileWriter {
4649 int nZones; /* !< \brief Total number of zones in the CGNS file. */
4750 int nSections; /* !< \brief Total number of sections in the CGNS file. */
4851
49- unsigned short nDim; /* !< \brief Problem dimension. */
50- int nLocalPoints; /* !< \brief Local number of points. */
51- int GlobalPoint; /* !< \brief Total number of points. */
52- int GlobalElem; /* !< \brief Total number of elements. */
52+ unsigned short nDim; /* !< \brief Problem dimension. */
53+ unsigned long nLocalPoints; /* !< \brief Local number of points. */
54+ cgsize_t GlobalPoint; /* !< \brief Total number of points. */
55+ cgsize_t GlobalElem; /* !< \brief Total number of elements. */
56+
57+ vector<cgsize_t > sendBufferConnectivity; /* !< \brief Send buffer for connectivity data. */
58+ vector<cgsize_t > recvBufferConnectivity; /* !< \brief Receive buffer for connectivity data. */
59+ vector<dataPrecision> recvBufferField; /* !< \brief Send buffer for field data. */
60+ vector<dataPrecision> sendBufferField; /* !< \brief Receive buffer for field data. */
5361
5462 cgsize_t cumulative; /* !< \brief Cumulative number of elements written. */
55- #endif
5663
64+ DataType_t dataType; /* !< \brief Datatype of fields can be RealSingle or RealDouble. */
65+ #endif
5766 public:
5867 /* !
5968 * \brief File extension
@@ -68,11 +77,6 @@ class CCGNSFileWriter final : public CFileWriter {
6877 */
6978 CCGNSFileWriter (string valFileName, CParallelDataSorter* valDataSorter, bool isSurf = false );
7079
71- /* !
72- * \brief Destructor
73- */
74- ~CCGNSFileWriter () override ;
75-
7680 /* !
7781 * \brief Write sorted data to file in CGNS file format.
7882 */
@@ -81,14 +85,14 @@ class CCGNSFileWriter final : public CFileWriter {
8185 /* !
8286 * \brief Initialize CGNS mesh file.
8387 */
84- void initializeMeshFile ();
88+ void InitializeMeshFile ();
8589
8690 /* !
8791 * \brief Write i-th coordinate to file in CGNS file format.
88- * \param[in] CoordinateNumber - Coordinate number according to CGNS .
89- * \param[in] CoordinateName - Coordinate name according to CGNS.
92+ * \param[in] iField - the output field ID .
93+ * \param[in] FieldName - Field name in the CGNS.
9094 */
91- void WriteCoordinate (int CoordinateNumber , const string& CoordinateName );
95+ void WriteField (int iField , const string& FieldName );
9296
9397 /* !
9498 * \brief Write connectivity to file for GEO_TYPE in CGNS file format.
@@ -102,13 +106,6 @@ class CCGNSFileWriter final : public CFileWriter {
102106 */
103107 void InitializeFields ();
104108
105- /* !
106- * \brief Write i-th coordinate to file in CGNS file format.
107- * \param[in] iField - the output field ID.
108- * \param[in] FieldName - Field name in the CGNS.
109- */
110- void WriteField (int iField, const string& FieldName);
111-
112109 /* !
113110 * \brief Call a generic CGNS function.
114111 * \param[in] ier - error value.
0 commit comments