gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
CGNSWrite.h
Go to the documentation of this file.
1 // Gmsh - Copyright (C) 1997-2022 C. Geuzaine, J.-F. Remacle
2 //
3 // See the LICENSE.txt file in the Gmsh root directory for license information.
4 // issues on https://gitlab.onelab.info/gmsh/gmsh/issues
5 //
6 // Contributor(s):
7 // Thomas Toulorge
8 
9 #ifndef CGNS_WRITE_H
10 #define CGNS_WRITE_H
11 
12 #include <vector>
13 #include <map>
14 #include <set>
15 #include <string>
16 #include "CGNSCommon.h"
17 
18 #if defined(HAVE_LIBCGNS)
19 
20 class GModel;
21 class GEntity;
22 class MVertex;
23 
24 // Type for global node index -> (partition, local node index) correspondence
25 struct LocalData {
26  LocalData() : partition(0), index(0) {}
27  unsigned int partition;
28  cgsize_t index;
29 };
30 // typedef std::vector<LocalData> Global2LocalData;
31 typedef std::map<MVertex *, std::vector<LocalData> > Vertex2LocalData;
32 
33 void getEntitiesToSave(const std::vector<GEntity *> &allEntities, bool saveAll,
34  std::vector<GEntity *> &entities);
35 
36 void getPeriodicEntities(const std::vector<GEntity *> &allEntities,
37  std::vector<GEntity *> &entitiesPer);
38 
39 void getPartitionInterfaceEntities(const std::vector<GEntity *> &entities,
40  bool saveAll,
41  std::vector<GEntity *> &entitiesInt);
42 
43 void initInterfVertex2LocalData(const std::vector<GEntity *> &entitiesPer,
44  const std::vector<GEntity *> &entitiesInterf,
45  Vertex2LocalData &interfVert2Local);
46 
47 int writeZone(GModel *model, bool saveAll, double scalingFactor, int meshDim,
48  std::size_t numNodesTotal, std::size_t partition,
49  const std::vector<GEntity *> &entities, int cgIndexFile,
50  int cgIndexBase, std::vector<std::string> &zoneName,
51  Vertex2LocalData &interfVert2Local, std::set<int> &eleMshTypes,
52  std::map<GEntity *, std::string> &geomEntities);
53 
54 int writePeriodic(const std::vector<GEntity *> &entitiesPer, int cgIndexFile,
55  int cgIndexBase, const std::vector<std::string> &zoneName,
56  Vertex2LocalData &interfVert2Local);
57 
58 void getEntitiesInPartitions(
59  const std::vector<GEntity *> &entities,
60  std::vector<std::vector<GEntity *> > &entitiesPart);
61 
62 int writeInterfaces(const std::vector<GEntity *> &entitiesInterf,
63  int cgIndexFile, int cgIndexBase,
64  const std::vector<std::string> &zoneName,
65  Vertex2LocalData &interfVert2Local);
66 
67 int writeHOPointInfo(const std::set<int> &eleMshTypes, int cgIndexFile,
68  int cgIndexBase);
69 
70 int writeGeomEntities(std::map<GEntity *, std::string> &geomEntities,
71  int cgIndexFile, int cgIndexBase);
72 
73 #endif // HAVE_LIBCGNS
74 
75 #endif // CGNS_WRITE_H
MVertex
Definition: MVertex.h:24
GEntity
Definition: GEntity.h:31
GModel
Definition: GModel.h:44
getEntitiesToSave
static void getEntitiesToSave(GModel *const model, bool partitioned, int partitionToSave, bool saveAll, std::set< GRegion *, GEntityPtrLessThan > &regions, std::set< GFace *, GEntityPtrLessThan > &faces, std::set< GEdge *, GEntityPtrLessThan > &edges, std::set< GVertex *, GEntityPtrLessThan > &vertices)
Definition: GModelIO_MSH4.cpp:2211
CGNSCommon.h