29 #ifndef NEMOSYS_CGNSANALYZER_H_ 30 #define NEMOSYS_CGNSANALYZER_H_ 33 #include "nemosys_export.h" 37 #include <vtkDataSet.h> 38 #include <vtkSmartPointer.h> 71 : dataName(
std::move(sName)), nDim(0), nData(0), dataType(inDataType) {}
76 void getData(
vecSlnType &inBuff,
int &outNData,
int &outNDim)
const;
77 void getData(
vecSlnType &inBuff,
int &outNData,
int &outNDim,
78 const std::vector<bool> &mask)
const;
79 void rmvDataIdx(
const std::vector<int> &rmvIdx);
108 : cgFileName(
std::move(fname)),
109 isUnstructured(false),
110 zoneType(CGNS_ENUMV(ZoneTypeNull)),
121 solutionDataPopulated(false),
131 cgRindCellIds.clear();
132 cgRindNodeIds.clear();
138 if (indexFile > 0) cg_close(indexFile);
141 if (vrtxCrd) annDeallocPts(vrtxCrd);
142 if (vrtxIdx) annDeallocPts(vrtxIdx);
143 clearAllSolutionData();
147 void loadGrid(
const std::string &fname,
int verb = 0) {
161 void loadGrid(
int verb = 0);
162 void loadZone(
int zIdx,
int verb = 0);
168 std::string getFileName();
169 std::string getBaseName();
170 std::string getZoneName();
171 std::string getZoneName(
int nCgFile);
172 std::string getSectionName();
173 std::string getBaseItrName();
176 double getTimeStep();
177 std::string getZoneItrName();
178 std::string getGridCrdPntr();
179 std::string getSolutionPntr();
183 int getElementType();
188 CGNS_ENUMT(TemperatureUnits_t) getTemperatureUnit();
192 std::vector<double> getVertexCoords();
193 std::vector<double> getVertexCoords(
int vrtxId);
194 double getVrtXCrd(
int vrtxId);
195 std::vector<double> getVrtXCrd();
196 double getVrtYCrd(
int vrtxId);
197 std::vector<double> getVrtYCrd();
198 double getVrtZCrd(
int vrtxId);
199 std::vector<double> getVrtZCrd();
200 std::vector<cgsize_t> getElementConnectivity(
int elemId);
203 void getSectionNames(std::vector<std::string> &secNames);
204 void getSectionConn(std::string secName, std::vector<cgsize_t> &conn,
206 vtkSmartPointer<vtkDataSet> getSectionMesh(std::string secName);
209 void clearAllSolutionData();
210 void getSolutionDataNames(std::vector<std::string> &list);
212 std::vector<double> &slnData);
214 int getNVertexSolution();
215 int getNCellSolution();
217 std::vector<double> &slnData,
218 int &outNData,
int &outNDim);
221 void appendSolutionData(std::string sName, std::vector<double> &slnData,
223 void appendSolutionData(std::string sName,
double slnData,
solution_type_t dt,
224 int inNData,
int inNDim);
225 bool delAppSlnData(std::string sName);
226 void getAppendedSolutionDataName(std::vector<std::string> &appSName);
229 std::vector<std::string> getSolutionNodeNames();
230 std::vector<CGNS_ENUMT(GridLocation_t)> getSolutionGridLocations();
231 std::map<int, std::pair<int, keyValueList>> getSolutionMap();
232 std::map<std::string, CGNS_ENUMT(GridLocation_t)> getSolutionNameLocMap();
235 void exportToMAdMesh(MAd::pMesh MAdMesh);
236 virtual void stitchMesh(
cgnsAnalyzer *inCg,
bool withFields =
false);
237 void classifyMAdMeshOpt(MAd::pMesh MAdMesh);
238 void classifyMAdMeshBnd(MAd::pMesh MAdMesh);
239 void unclassifyMAdMeshBnd(MAd::pMesh MAdMesh);
241 bool checkElmConn(
int nSharedNde);
242 std::vector<double> getElmCntCoords(MAd::pMesh msh);
246 void exportToVTKMesh();
247 vtkSmartPointer<vtkDataSet> getVTKMesh();
251 void overwriteSolData(
meshBase *mbObj);
252 void overwriteSolData(
const std::string &fname,
const std::string &ndeName,
256 void writeSampleStructured();
257 void writeSampleUnstructured();
261 bool isCgRindNode(
int cgNdeId);
262 bool isCgRindCell(
int cgCellId);
266 void populateSolutionDataNames();
267 void buildVertexKDTree();
268 void buildElementKDTree();
269 void loadSolutionDataContainer(
int verb = 0);
271 CGNS_ENUMT(ElementType_t) getSectionType(std::string secName);
287 cgsize_t rmin[3], rmax[3];
288 cgsize_t cgCoreSize[9];
306 std::vector<double> xCrd, yCrd,
zCrd;
314 std::map<int, std::pair<int, keyValueList>>
343 #endif // NEMOSYS_CGNSANALYZER_H_
std::vector< double > vecSlnType
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).
solutionData(std::string sName, solution_type_t inDataType)
std::vector< bool > elmDataMask
std::vector< std::string > appendedSolutionName
std::vector< std::string > solutionName
A brief description of meshBase.
std::vector< int > cgRindNodeIds
std::vector< double > zCrd
std::map< int, std::pair< int, keyValueList > > solutionMap
std::vector< std::string > multZoneNames
std::map< int, int > MAdToCgnsIds
std::map< std::string, CGNS_ENUMT(GridLocation_t)> solutionNameLocMap
vtkSmartPointer< vtkDataSet > vtkMesh
std::vector< std::string > zoneNames
std::vector< int > cgRindCellIds
std::vector< bool > vrtDataMask
bool solutionDataPopulated
void loadGrid(const std::string &fname, int verb=0)
std::vector< cgsize_t > elemConn
std::string getDataName() const
std::vector< solutionData * > slnDataCont
std::vector< CGNS_ENUMT(GridLocation_t)> solutionGridLocation
std::map< int, std::string > keyValueList
solution_type_t getDataType() const
cgnsAnalyzer(std::string fname, int verb=0)
std::map< int, int > cgnsToMAdIds