9 #ifndef CGNS_ZONE_STRUCT_H
10 #define CGNS_ZONE_STRUCT_H
14 #if defined(HAVE_LIBCGNS)
16 template <
int DIM>
class CGNSZoneStruct :
public CGNSZone {
18 CGNSZoneStruct(
int fileIndex,
int baseIndex,
int zoneIndex,
int meshDim,
20 const Family2EltNodeTransfo &allEltNodeTransfo,
int &err);
22 cgsize_t nbNodeIJK(
int d)
const {
return size_[d]; }
23 cgsize_t nbEltIJK(
int d)
const {
return size_[DIM + d]; }
24 const cgsize_t *nbNodeIJK()
const {
return size_; }
25 const cgsize_t *nbEltIJK()
const {
return size_ + DIM; }
26 cgsize_t nbNodeInRange(
const cgsize_t *range)
const;
27 cgsize_t nbEltInRange(
const cgsize_t *range)
const;
29 virtual cgsize_t indexDataSize(cgsize_t nbVal) {
return DIM * nbVal; }
31 virtual void eltFromRange(
const cgsize_t *range,
32 std::vector<cgsize_t> &elt)
const;
33 virtual void eltFromList(
const std::vector<cgsize_t> &list,
34 std::vector<cgsize_t> &elt)
const;
35 virtual void nodeFromRange(
const cgsize_t *range,
36 std::vector<cgsize_t> &node)
const;
37 virtual void nodeFromList(
const std::vector<cgsize_t> &range,
38 std::vector<cgsize_t> &node)
const;
40 virtual int readElements(std::vector<MVertex *> &allVert,
41 std::map<
int, std::vector<MElement *> > *allElt,
42 std::vector<MElement *> &zoneElt,
43 std::vector<std::string> &allGeomName);
45 virtual int readConnectivities(
const std::map<std::string, int> &name2Zone,
46 std::vector<CGNSZone *> &allZones);
49 int readOneInterface(
int iConnect,
50 const std::map<std::string, int> &name2Zone,
51 std::vector<CGNSZone *> &allZones);
52 MElement *makeBndElement(
const cgsize_t *ijk,
const int *dir,
int order,
53 int defaultEntity, std::vector<MVertex *> &allVert,
54 std::map<
int, std::vector<MElement *> > *allElt);
58 inline cgsize_t CGNSZoneStruct<DIM>::nbNodeInRange(
const cgsize_t *range)
const
60 return StructuredIndexing<DIM>::nbEntInRange(range);
64 inline cgsize_t CGNSZoneStruct<DIM>::nbEltInRange(
const cgsize_t *range)
const
66 return StructuredIndexing<DIM>::nbEntInRange(range);
70 inline void CGNSZoneStruct<DIM>::eltFromRange(
const cgsize_t *range,
71 std::vector<cgsize_t> &elt)
const
73 StructuredIndexing<DIM>::entFromRange(range, nbEltIJK(), elt);
77 inline void CGNSZoneStruct<DIM>::eltFromList(
const std::vector<cgsize_t> &list,
78 std::vector<cgsize_t> &elt)
const
80 StructuredIndexing<DIM>::entFromList(list, nbEltIJK(), elt);
85 CGNSZoneStruct<DIM>::nodeFromRange(
const cgsize_t *range,
86 std::vector<cgsize_t> &node)
const
88 StructuredIndexing<DIM>::entFromRange(range, nbNodeIJK(), node);
92 inline void CGNSZoneStruct<DIM>::nodeFromList(
const std::vector<cgsize_t> &list,
93 std::vector<cgsize_t> &node)
const
95 StructuredIndexing<DIM>::entFromList(list, nbNodeIJK(), node);
98 #endif // HAVE_LIBCGNS
100 #endif // CGNS_ZONE_STRUCT_H