1 #ifndef DRIVERTOOLS_HXX
2 #define DRIVERTOOLS_HXX
5 #include "MEDMEM_define.hxx"
6 #include "MEDMEM_Exception.hxx"
22 std::vector<double> coord;
27 typedef std::map<int,_noeud>::iterator iter;
28 MED_EN::medGeometryElement geometricType;
29 std::vector< iter > sommets;
30 mutable unsigned ordre; // l'ordre est fixé après insertion dans le set, et ne change ni l'état, ni l'ordre -> mutable
32 _maille() : geometricType(MED_EN::MED_NONE),ordre(0)
35 _maille(MED_EN::medGeometryElement _geometricType, size_t nelem) : geometricType(_geometricType),ordre(0)
37 sommets.reserve(nelem);
39 int dimension() const // retourne la dimension de la maille
41 return geometricType/100;
43 bool operator < (const _maille& ma) const;
44 MED_EN::medEntityMesh getEntity(const int meshDimension) const throw (MEDEXCEPTION);
47 struct _mailleIteratorCompare // pour ordonner le set d'iterateurs sur mailles
49 bool operator () (std::set<_maille>::iterator i1, std::set<_maille>::iterator i2)
57 typedef std::set< std::set<_maille>::iterator>::const_iterator mailleIter;
59 std::set< std::set<_maille>::iterator, _mailleIteratorCompare > mailles; // iterateurs sur les mailles composant le groupe
60 std::vector<int> groupes; // indices des sous-groupes composant le groupe
65 * Intermediate structure used by drivers to store data read from the other format file.
66 * The structure provides functions that transform the stored data to the MED format :
67 * getCoordinate(), getConnectivity(), getGroups().
68 * The elements inserted in maillage and points are automaticaly ordered.
69 * Renumbering are performed by getConnectivity & getGroups before writing the MED structures.
70 * Read the conception ducumentation for more details.
73 struct _intermediateMED
75 std::set<_maille> maillage;
76 std::vector<_groupe> groupes;
77 std::map< int, _noeud > points;
79 CONNECTIVITY * getConnectivity(); // set MED connectivity from the intermediate structure
80 COORDINATE * getCoordinate(const string & coordinateSystem="CARTESIAN"); // set MED coordinate from the
81 // intermediate structure
82 void getGroups(std::vector<GROUP *> & _groupCell, std::vector<GROUP *> & _groupFace,
83 std::vector<GROUP *> & _groupEdge, std::vector<GROUP *> & _groupNode, MESH * _ptrMesh);
85 // used by previous functions to renumber points & mesh.
86 void numerotationMaillage();
87 void numerotationPoints();
91 std::ostream& operator << (std::ostream& , const _maille& );
92 std::ostream& operator << (std::ostream& , const _groupe& );
93 std::ostream& operator << (std::ostream& , const _noeud& );
94 std::ostream& operator << (std::ostream& , const _intermediateMED& );
97 #endif /* DRIVERTOOLS_HXX */