Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef SUPPORT_HXX
00028 #define SUPPORT_HXX
00029
00030 #include <MEDMEM.hxx>
00031
00032 #include <list>
00033 #include <vector>
00034 #include <string>
00035 #include <list>
00036
00037 #include "MEDMEM_Utilities.hxx"
00038 #include "MEDMEM_STRING.hxx"
00039 #include "MEDMEM_Exception.hxx"
00040 #include "MEDMEM_define.hxx"
00041 #include "MEDMEM_SkyLineArray.hxx"
00042 #include "MEDMEM_RCBase.hxx"
00043
00044
00045 namespace MEDMEM {
00046
00047 class GMESH;
00048 class MESH;
00049
00058 class MEDMEM_EXPORT SUPPORT : public RCBASE
00059 {
00060 protected:
00066 std::string _name;
00067
00074 mutable std::string _meshName;
00075
00081 std::string _description;
00082
00088 mutable const GMESH * _mesh;
00089
00096 MED_EN::medEntityMesh _entity ;
00097
00103 int _numberOfGeometricType;
00104
00110 PointerOf<MED_EN::medGeometryElement> _geometricType;
00111
00118 bool _isOnAllElts;
00119
00126 PointerOf<int> _numberOfElements;
00127
00133 int _totalNumberOfElements;
00134
00135
00136
00144 mutable MEDSKYLINEARRAY * _number;
00145
00153 mutable MEDSKYLINEARRAY * _number_fromfile;
00154
00166 std::vector< std::string > _profilNames;
00167 public:
00168 SUPPORT();
00169
00170 SUPPORT(const SUPPORT & m);
00171 public:
00172 friend MEDMEM_EXPORT ostream & operator<<(ostream &os,const SUPPORT &my);
00173
00174 SUPPORT& operator=(const SUPPORT &support);
00175 bool operator == (const SUPPORT &support) const;
00176 bool deepCompare(const SUPPORT &support) const;
00177 void update();
00178
00179 inline void setName(const std::string& Name);
00180 inline void setDescription(const std::string& Description);
00181 void setMesh(const GMESH *Mesh) const;
00182 void setMeshName(const string & meshName);
00183 inline void setAll(bool All);
00184 void setEntity(MED_EN::medEntityMesh Entity);
00185 void setNumberOfGeometricType(int NumberOfGeometricType);
00186 void setGeometricType(const MED_EN::medGeometryElement *GeometricType);
00187 void setNumberOfElements(const int *NumberOfElements);
00188 void setNumber(MEDSKYLINEARRAY * Number);
00189 void setNumber(const int * index, const int* value, bool shallowCopy=false);
00190
00191 inline const std::string& getName() const;
00192 inline const std::string& getDescription() const;
00193 virtual inline const GMESH * getMesh() const;
00194 std::string getMeshName() const;
00195 inline MED_EN::medEntityMesh getEntity() const;
00196
00197 inline bool isOnAllElements() const;
00198 inline int getNumberOfTypes() const;
00199 inline const MED_EN::medGeometryElement* getTypes() const ;
00200 int getNumberOfElements(MED_EN::medGeometryElement GeometricType) const throw (MEDEXCEPTION);
00201 const int * getNumberOfElements() const throw (MEDEXCEPTION);
00202 virtual MEDSKYLINEARRAY * getnumber() const throw (MEDEXCEPTION);
00203 virtual MEDSKYLINEARRAY * getnumberFromFile() const throw (MEDEXCEPTION);
00204 virtual const int * getNumber(MED_EN::medGeometryElement GeometricType) const throw (MEDEXCEPTION);
00205 virtual const int * getNumberFromFile(MED_EN::medGeometryElement GeometricType) const throw (MEDEXCEPTION);
00206 virtual const int * getNumberIndex() const throw (MEDEXCEPTION);
00207 virtual int getValIndFromGlobalNumber(const int number) const throw (MEDEXCEPTION);
00208
00209 void blending(const SUPPORT * mySupport) throw (MEDEXCEPTION) ;
00210
00211
00212
00213 void setpartial(const std::string& Description, int NumberOfGeometricType,
00214 int TotalNumberOfEntity, const MED_EN::medGeometryElement *GeometricType,
00215 const int *NumberOfEntity, const int *NumberValue);
00216
00217 void setpartial(MEDSKYLINEARRAY * number, bool shallowCopy=false) throw (MEDEXCEPTION);
00218
00219
00220 void setpartial_fromfile(MEDSKYLINEARRAY * number, bool shallowCopy=false) throw (MEDEXCEPTION);
00221
00222
00223
00224 void setProfilNames(const std::vector<std::string>& profilNames) throw (MEDEXCEPTION);
00225
00226 std::vector<std::string> getProfilNames() const throw (MEDEXCEPTION);
00227
00228 void getBoundaryElements() throw (MEDEXCEPTION);
00229 void changeElementsNbs(MED_EN::medEntityMesh entity, const int *renumberingFromOldToNew);
00230 void intersecting(const SUPPORT * mySupport) throw (MEDEXCEPTION) ;
00231 bool belongsTo(const SUPPORT& other, bool deepCompare=false) const;
00232 SUPPORT *getComplement() const;
00233 SUPPORT *substract(const SUPPORT& other) const throw (MEDEXCEPTION) ;
00234 SUPPORT *getBoundaryElements(MED_EN::medEntityMesh Entity) const throw (MEDEXCEPTION);
00235 SUPPORT* buildSupportOnNode() const throw (MEDEXCEPTION);
00236 void fillFromNodeList(const std::list<int>& listOfNode) throw (MEDEXCEPTION);
00237 void fillFromElementList(const std::list<int>& listOfElt) throw (MEDEXCEPTION);
00238 void clearDataOnNumbers();
00239 MESH* makeMesh() const;
00240 protected:
00241 virtual ~SUPPORT();
00242 protected:
00243 static std::list<int> *sub(int start,int end,const int *idsToSuppress,int lgthIdsToSuppress);
00244 static std::list<int> *sub(const int *ids,int lgthIds,const int *idsToSuppress,int lgthIdsToSuppress);
00245 };
00246
00247
00248
00249
00250
00252
00253 inline void SUPPORT::setName(const std::string& Name)
00254
00255 {
00256 _name=Name;
00257 }
00258
00260
00261 inline void SUPPORT::setDescription(const std::string& Description)
00262
00263 {
00264 _description=Description;
00265 }
00266
00281
00282 inline void SUPPORT::setAll(bool All)
00283
00284 {
00285 _isOnAllElts=All;
00286 }
00290
00291 inline const std::string& SUPPORT::getName() const
00292
00293 {
00294 return _name;
00295 }
00296
00298
00299 inline const std::string& SUPPORT::getDescription() const
00300
00301 {
00302 return _description;
00303 }
00304
00306
00307 inline const GMESH * SUPPORT::getMesh() const
00308
00309 {
00310 return _mesh;
00311 }
00312
00318
00319 inline bool SUPPORT::isOnAllElements() const
00320
00321 {
00322 return _isOnAllElts;
00323 }
00324
00329
00330 inline int SUPPORT::getNumberOfTypes() const
00331
00332 {
00333
00334
00335
00336 return _numberOfGeometricType ;
00337 }
00338
00344
00345 inline MED_EN::medEntityMesh SUPPORT::getEntity() const
00346
00347 {
00348 return _entity;
00349 }
00350
00355
00356 inline const MED_EN::medGeometryElement * SUPPORT::getTypes() const
00357
00358 {
00359 return _geometricType;
00360 }
00361
00362 }
00363
00364
00365 #endif