15 #include "GmshConfig.h"
19 #if defined(HAVE_LIBCGNS)
27 CGNSZone(
int fileIndex,
int baseIndex,
int zoneIndex,
28 CGNS_ENUMT(ZoneType_t) type,
int meshDim, cgsize_t startNode,
29 const Family2EltNodeTransfo &allEltNodeTransfo,
int &err);
30 virtual ~CGNSZone() {}
32 int index()
const {
return zoneIndex_; }
33 std::string name()
const {
return name_; }
34 CGNS_ENUMT(ZoneType_t) type()
const {
return type_; }
35 cgsize_t startNode()
const {
return startNode_; }
36 cgsize_t nbNode()
const {
return nbNode_; }
37 cgsize_t nbElt()
const {
return nbElt_; }
38 const cgsize_t *size()
const {
return size_; }
40 virtual cgsize_t indexDataSize(cgsize_t nbVal) = 0;
41 virtual void eltFromRange(
const cgsize_t *range,
42 std::vector<cgsize_t> &elt)
const = 0;
43 void eltFromRange(
const std::vector<cgsize_t> &range,
44 std::vector<cgsize_t> &elt)
const
46 eltFromRange(range.data(), elt);
48 virtual void eltFromList(
const std::vector<cgsize_t> &list,
49 std::vector<cgsize_t> &elt)
const = 0;
50 virtual void nodeFromRange(
const cgsize_t *range,
51 std::vector<cgsize_t> &node)
const = 0;
52 void nodeFromRange(
const std::vector<cgsize_t> &range,
53 std::vector<cgsize_t> &node)
const
55 nodeFromRange(range.data(), node);
57 virtual void nodeFromList(
const std::vector<cgsize_t> &range,
58 std::vector<cgsize_t> &node)
const = 0;
60 std::map<cgsize_t, int> &elt2Geom() {
return elt2Geom_; }
61 const ZoneEltNodeTransfo *eltNodeTransfo()
const {
return eltNodeTransfo_; }
62 const std::vector<bool> &interfaceNode()
const {
return interfaceNode_; }
63 int nbPerConnect()
const {
return nbPerConnect_; }
64 int masterZone(
int iPer)
const {
return masterZone_[iPer]; }
65 const std::vector<double> &perTransfo(
int iPer)
const
67 return perTransfo_[iPer];
69 const std::vector<cgsize_t> &masterNode(
int iPer)
const
71 return masterNode_[iPer];
73 const std::vector<cgsize_t> &slaveNode(
int iPer)
const
75 return slaveNode_[iPer];
77 std::vector<MVertex *> &masterVert(
int iPer) {
return masterVert_[iPer]; }
78 std::vector<MVertex *> &slaveVert(
int iPer) {
return slaveVert_[iPer]; }
80 int readBoundaryCondition(
int iZoneBC,
81 const std::vector<CGNSZone *> &allZones,
82 std::vector<std::string> &allGeomName);
84 int readVertices(
int dim,
double scale, std::vector<CGNSZone *> &allZones,
85 std::vector<MVertex *> &zoneVert);
87 virtual int readElements(std::vector<MVertex *> &allVert,
88 std::map<
int, std::vector<MElement *> > *allElt,
89 std::vector<MElement *> &zoneElt,
90 std::vector<std::string> &allGeomName) = 0;
92 virtual int readConnectivities(
const std::map<std::string, int> &name2Zone,
93 std::vector<CGNSZone *> &allZones);
95 int readMesh(
int dim,
double scale, std::vector<CGNSZone *> &allZones,
96 std::vector<MVertex *> &allVert,
97 std::map<
int, std::vector<MElement *> > *allElt,
98 std::vector<MVertex *> &zoneVert,
99 std::vector<MElement *> &zoneElt,
100 std::vector<std::string> &allGeomName);
102 void setPeriodicVertices(
const std::vector<CGNSZone *> &allZones,
103 const std::vector<MVertex *> &allVert);
107 int fileIndex_, baseIndex_, meshDim_, zoneIndex_;
110 CGNS_ENUMT(ZoneType_t) type_;
111 cgsize_t startNode_, nbNode_, nbElt_;
114 std::map<cgsize_t, int> elt2Geom_;
117 const ZoneEltNodeTransfo *eltNodeTransfo_;
120 std::vector<bool> interfaceNode_;
124 std::vector<int> masterZone_;
125 std::vector<std::vector<double> > perTransfo_;
126 std::vector<std::vector<cgsize_t> > masterNode_, slaveNode_;
127 std::vector<std::vector<MVertex *> > masterVert_, slaveVert_;
129 int fileIndex()
const {
return fileIndex_; }
130 int baseIndex()
const {
return baseIndex_; }
131 int meshDim()
const {
return meshDim_; }
133 int readBoundaryConditionList(
int indBC, cgsize_t nbVal,
134 std::vector<cgsize_t> &bcElt);
135 int readBoundaryConditionRange(
int indBC, std::vector<cgsize_t> &bcElt);
138 #endif // HAVE_LIBCGNS
140 #endif // CGNS_ZONE_H