29 #ifndef NEMOSYS_CGNSWRITER_H_ 30 #define NEMOSYS_CGNSWRITER_H_ 33 #include "nemosys_export.h" 50 using vect2d = std::vector<std::vector<T>>;
59 cgnsWriter(std::string fname, std::string baseName,
int cellDim,
60 int physDim,
int mode) :
61 myCgFileName(
std::move(fname)), baseName(
std::move(baseName)),
62 cellDim(cellDim), physDim(physDim), nBase(1), nZone(0),
63 nVrtx(0), nCell(0), nSection(0), gnSection(0),
64 coordRind(0), virtElmRind(0),
65 nSlnFld(0), nVrtxSln(0), nCellSln(0), nVrtxFld(0), nCellFld(0)
68 if (cg_open(myCgFileName.c_str(), CG_MODE_WRITE,
71 }
else if (mode == 1) {
72 if (cg_open(myCgFileName.c_str(), CG_MODE_MODIFY,
77 cg_get_file_type(indexFile, &file_type);
86 void setBaseItrData(std::string bsitrname,
int ntstp,
double tval);
87 void setZoneItrData(std::string zitrname, std::string grdptr,
89 void setIntData(std::string intname,
int intval);
90 void setZone(std::string zName,
CGNS_ENUMT(ZoneType_t) zt);
93 void setNVrtx(
int nVt);
94 void setNCell(
int nCl);
95 void setGlobalNCell(
int gnCl);
98 void setCoordRind(
int rind);
99 void setVirtElmRind(
int rind);
102 void setPatchNo(
int patchNo);
103 void setBcflag(
int bcflag);
104 void setCnstrtype(
int cnstr_type);
105 void setVolCellFacesNumber(
int nVolCellFaces);
106 void setPconnGhostDescriptor(
int ghostDescriptor);
109 void setGlobalSection(std::string sName,
CGNS_ENUMT(ElementType_t) st,
111 void setGlobalSection(std::string gsName,
CGNS_ENUMT(ElementType_t) gst);
112 void resetSections();
113 void resetGlobalSections();
114 void setSolutionNode(std::string ndeName,
CGNS_ENUMT(GridLocation_t) slnLoc);
115 void writeSolutionNode(std::string ndeName,
CGNS_ENUMT(GridLocation_t) slnLoc,
116 int emptyFlag,
int virtFlag);
118 writeSolutionField(std::string fname, std::string ndeName,
CGNS_ENUMT(DataType_t) dt,
120 void writeGridToFile();
121 void writeZoneToFile();
122 void writeWinToFile();
123 void setFluidUnitsMap();
124 void setFluidDimMap();
125 void setFluidMagMap();
126 void setiFluidUnitsMap();
127 void setiFluidDimMap();
128 void setiFluidMagMap();
129 void setBurnUnitsMap();
130 void setBurnDimMap();
131 void setBurnMagMap();
132 void setTypeFlag(
int typeFlag);
133 void writeVolCellFacesNumber();
140 int rmin[3], rmax[3];
141 cgsize_t cgCoreSize[9];
142 std::string baseName,
zoneName, sectionName, gsectionName;
219 #endif // NEMOSYS_CGNSWRITER_H_ vect1d< std::string > zoneNames
vect1d< CGNS_ENUMT(ElementType_t)> gsectionTypes
vect1d< std::string > gsectionNames
data_type data
Edge/face with sorted point ids (a, b, c, ...) is located at some index i in data[b], with data[b][i].first == [a, c] (for edges, third point id treated as -1).
std::vector< std::vector< T > > vect2d
std::map< std::string, int > ifluidMagMap
std::map< int, std::pair< int, keyValueList > > solutionMap
vect1d< std::string > solutionName
std::string trimmed_base_t
std::map< std::string, std::vector< float > > burnDimMap
std::map< std::string, std::string > burnUnitsMap
std::map< std::string, std::vector< float > > ifluidDimMap
std::map< std::string, std::vector< float > > fluidDimMap
std::map< std::string, std::string > fluidUnitsMap
vect1d< CGNS_ENUMT(ElementType_t)> sectionTypes
std::map< std::string, int > burnMagMap
vect1d< CGNS_ENUMT(GridLocation_t)> solutionGridLocation
cgnsWriter(std::string fname, std::string baseName, int cellDim, int physDim, int mode)
std::map< std::string, int > fluidMagMap
std::string trimmed_base_t
std::map< std::string, int > solutionNameSolIdxMap
std::map< std::string, std::string > ifluidUnitsMap
std::map< std::string, CGNS_ENUMT(GridLocation_t)> solutionNameLocMap
vect1d< int > solutionIdx
vect2d< cgsize_t > elmConns
std::map< std::string, int > slnNameNFld
vect1d< std::string > sectionNames
std::map< int, int > pconnProcMin
std::map< int, std::string > keyValueList
vect1d< CGNS_ENUMT(ZoneType_t)> zoneTypes
std::map< int, int > pconnProcMax