From: ageay Date: Tue, 13 Mar 2012 15:12:34 +0000 (+0000) Subject: CLEAN-UP 1 X-Git-Tag: V6_main_FINAL~795 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=31a2176575871978d65987ced2c37457b7b236d3;p=tools%2Fmedcoupling.git CLEAN-UP 1 --- diff --git a/src/MEDPartitioner/MEDPARTITIONER_ConnectZone.cxx b/src/MEDPartitioner/MEDPARTITIONER_ConnectZone.cxx index aafa7bfe1..3a1e99aff 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_ConnectZone.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_ConnectZone.cxx @@ -21,76 +21,71 @@ #include -using namespace MEDPARTITIONER; - -ConnectZone::ConnectZone(): +MEDPARTITIONER::ConnectZone::ConnectZone(): _name("") ,_description("") - ,_distantDomainNumber(0) - ,_localDomainNumber(0) - ,_nodeCorresp(0) - ,_faceCorresp(0) + ,_distant_domain_number(0) + ,_local_domain_number(0) + ,_node_corresp(0) + ,_face_corresp(0) { - _entityCorresp.clear(); } -ConnectZone::~ConnectZone(){ - if (_nodeCorresp !=0) delete _nodeCorresp; - if (_faceCorresp !=0) delete _faceCorresp; - for (std::map < std::pair ,MEDPARTITIONER::SkyLineArray * >::iterator - iter = _entityCorresp.begin(); iter != _entityCorresp.end(); iter++) +MEDPARTITIONER::ConnectZone::~ConnectZone() +{ + delete _node_corresp; + delete _face_corresp; + for(std::map < std::pair ,SkyLineArray * >::iterator iter=_entity_corresp.begin(); iter!=_entity_corresp.end();iter++) { delete iter->second; } } -ConnectZone::ConnectZone(const ConnectZone & myConnectZone): +MEDPARTITIONER::ConnectZone::ConnectZone(const ConnectZone & myConnectZone): _name(myConnectZone._name) ,_description(myConnectZone._description) - ,_distantDomainNumber(myConnectZone._distantDomainNumber) - ,_localDomainNumber(myConnectZone._localDomainNumber) - ,_nodeCorresp(myConnectZone._nodeCorresp) - ,_faceCorresp(myConnectZone._faceCorresp) - ,_entityCorresp(myConnectZone._entityCorresp) + ,_distant_domain_number(myConnectZone._distant_domain_number) + ,_local_domain_number(myConnectZone._local_domain_number) + ,_node_corresp(myConnectZone._node_corresp) + ,_face_corresp(myConnectZone._face_corresp) + ,_entity_corresp(myConnectZone._entity_corresp) { } -std::string ConnectZone::getName() const +std::string MEDPARTITIONER::ConnectZone::getName() const { return _name; } -std::string ConnectZone::getDescription() const +std::string MEDPARTITIONER::ConnectZone::getDescription() const { return _description; } -int ConnectZone::getDistantDomainNumber() const +int MEDPARTITIONER::ConnectZone::getDistantDomainNumber() const { - return _distantDomainNumber; + return _distant_domain_number; } -int ConnectZone::getLocalDomainNumber() const +int MEDPARTITIONER::ConnectZone::getLocalDomainNumber() const { - return _localDomainNumber; + return _local_domain_number; } -ParaMEDMEM::MEDCouplingUMesh* ConnectZone::getLocalMesh() const +ParaMEDMEM::MEDCouplingUMesh *MEDPARTITIONER::ConnectZone::getLocalMesh() const { - return _localMesh; + return _local_mesh; } -ParaMEDMEM::MEDCouplingUMesh * ConnectZone::getDistantMesh() const +ParaMEDMEM::MEDCouplingUMesh *MEDPARTITIONER::ConnectZone::getDistantMesh() const { - return _distantMesh; + return _distant_mesh; } -bool ConnectZone::isEntityCorrespPresent(int localEntity, - int distantEntity) const +bool MEDPARTITIONER::ConnectZone::isEntityCorrespPresent(int localEntity, int distantEntity) const { - typedef std::map, MEDPARTITIONER::SkyLineArray*>::const_iterator map_iter; - - for (map_iter iter=_entityCorresp.begin(); iter != _entityCorresp.end(); iter++) + typedef std::map, SkyLineArray*>::const_iterator map_iter; + for(map_iter iter=_entity_corresp.begin(); iter != _entity_corresp.end(); iter++) { if ((iter->first).first==localEntity && (iter->first).second==distantEntity) return true; @@ -98,42 +93,42 @@ bool ConnectZone::isEntityCorrespPresent(int localEntity, return false; } -const int * ConnectZone::getNodeCorrespIndex() const +const int *MEDPARTITIONER::ConnectZone::getNodeCorrespIndex() const { - return _nodeCorresp->getIndex(); + return _node_corresp->getIndex(); } -const int * ConnectZone::getNodeCorrespValue() const +const int *MEDPARTITIONER::ConnectZone::getNodeCorrespValue() const { - return _nodeCorresp->getValue(); + return _node_corresp->getValue(); } -int ConnectZone::getNodeNumber() const +int MEDPARTITIONER::ConnectZone::getNodeNumber() const { - return _nodeCorresp->getNumberOf(); + return _node_corresp->getNumberOf(); } -const int * ConnectZone::getFaceCorrespIndex() const +const int *MEDPARTITIONER::ConnectZone::getFaceCorrespIndex() const { - return _faceCorresp->getIndex(); + return _face_corresp->getIndex(); } -const int * ConnectZone::getFaceCorrespValue() const +const int *MEDPARTITIONER::ConnectZone::getFaceCorrespValue() const { - return _faceCorresp->getValue(); + return _face_corresp->getValue(); } -int ConnectZone::getFaceNumber() const +int MEDPARTITIONER::ConnectZone::getFaceNumber() const { - return _faceCorresp->getNumberOf(); + return _face_corresp->getNumberOf(); } -const int * ConnectZone::getEntityCorrespIndex(int localEntity, +const int *MEDPARTITIONER::ConnectZone::getEntityCorrespIndex(int localEntity, int distantEntity) const { - typedef std::map, MEDPARTITIONER::SkyLineArray*>::const_iterator map_iter; + typedef std::map, SkyLineArray*>::const_iterator map_iter; - for (map_iter iter=_entityCorresp.begin(); iter != _entityCorresp.end(); iter++) + for(map_iter iter=_entity_corresp.begin();iter!=_entity_corresp.end();iter++) { if ((iter->first).first==localEntity && (iter->first).second==distantEntity) return iter->second->getIndex(); @@ -141,12 +136,12 @@ const int * ConnectZone::getEntityCorrespIndex(int localEntity, return 0; } -const int * ConnectZone::getEntityCorrespValue(int localEntity, +const int *MEDPARTITIONER::ConnectZone::getEntityCorrespValue(int localEntity, int distantEntity) const { - typedef std::map, MEDPARTITIONER::SkyLineArray*>::const_iterator map_iter; + typedef std::map, SkyLineArray*>::const_iterator map_iter; - for (map_iter iter=_entityCorresp.begin(); iter != _entityCorresp.end(); iter++) + for (map_iter iter=_entity_corresp.begin();iter!=_entity_corresp.end();iter++) { if ((iter->first).first==localEntity && (iter->first).second==distantEntity) return iter->second->getValue(); @@ -154,25 +149,25 @@ const int * ConnectZone::getEntityCorrespValue(int localEntity, return 0; } -int ConnectZone::getEntityCorrespNumber(int localEntity, +int MEDPARTITIONER::ConnectZone::getEntityCorrespNumber(int localEntity, int distantEntity) const { - typedef std::map, MEDPARTITIONER::SkyLineArray*>::const_iterator map_iter; + typedef std::map, SkyLineArray*>::const_iterator map_iter; - for (map_iter iter=_entityCorresp.begin(); iter != _entityCorresp.end(); iter++) + for(map_iter iter=_entity_corresp.begin();iter!=_entity_corresp.end();iter++) { - if ((iter->first).first==localEntity && (iter->first).second==distantEntity) + if((iter->first).first==localEntity && (iter->first).second==distantEntity) return iter->second->getNumberOf(); } return 0; } -int ConnectZone::getEntityCorrespLength(int localEntity, +int MEDPARTITIONER::ConnectZone::getEntityCorrespLength(int localEntity, int distantEntity) const { - typedef std::map, MEDPARTITIONER::SkyLineArray*>::const_iterator map_iter; + typedef std::map, SkyLineArray*>::const_iterator map_iter; - for (map_iter iter=_entityCorresp.begin(); iter != _entityCorresp.end(); iter++) + for (map_iter iter=_entity_corresp.begin(); iter != _entity_corresp.end(); iter++) { if ((iter->first).first==localEntity && (iter->first).second==distantEntity) return iter->second->getLength(); @@ -180,41 +175,41 @@ int ConnectZone::getEntityCorrespLength(int localEntity, return 0; } -void ConnectZone::setName(std::string name) +void MEDPARTITIONER::ConnectZone::setName(const std::string& name) { _name=name; } -void ConnectZone::setDescription(std::string description) +void MEDPARTITIONER::ConnectZone::setDescription(const std::string& description) { _description=description; } -void ConnectZone::setDistantDomainNumber(int distantDomainNumber) +void MEDPARTITIONER::ConnectZone::setDistantDomainNumber(int distantDomainNumber) { - _distantDomainNumber=distantDomainNumber; + _distant_domain_number=distantDomainNumber; } -void ConnectZone::setLocalDomainNumber(int localDomainNumber) +void MEDPARTITIONER::ConnectZone::setLocalDomainNumber(int localDomainNumber) { - _localDomainNumber=localDomainNumber; + _local_domain_number=localDomainNumber; } -void ConnectZone::setLocalMesh(ParaMEDMEM::MEDCouplingUMesh * localMesh) +void MEDPARTITIONER::ConnectZone::setLocalMesh(ParaMEDMEM::MEDCouplingUMesh * localMesh) { - _localMesh=localMesh; + _local_mesh=localMesh; } -void ConnectZone::setDistantMesh(ParaMEDMEM::MEDCouplingUMesh * distantMesh) +void MEDPARTITIONER::ConnectZone::setDistantMesh(ParaMEDMEM::MEDCouplingUMesh * distantMesh) { - _distantMesh=distantMesh; + _distant_mesh=distantMesh; } /*! transforms an int array containing * the node-node connections * to a SkyLineArray */ -void ConnectZone::setNodeCorresp(int * nodeCorresp, int nbnode) +void MEDPARTITIONER::ConnectZone::setNodeCorresp(int * nodeCorresp, int nbnode) { std::vector index(nbnode+1),value(2*nbnode); for (int i=0; i index(nbface+1),value(2*nbface); for (int i=0; i index(nbentity+1),value(2*nbentity); for (int i=0; i, MEDPARTITIONER::SkyLineArray * > _entityCorresp; - public : ConnectZone(); ~ConnectZone(); @@ -54,26 +40,26 @@ namespace MEDPARTITIONER std::string getDescription() const ; int getDistantDomainNumber() const ; int getLocalDomainNumber() const ; - ParaMEDMEM::MEDCouplingUMesh * getLocalMesh() const ; - ParaMEDMEM::MEDCouplingUMesh * getDistantMesh() const ; + ParaMEDMEM::MEDCouplingUMesh *getLocalMesh() const ; + ParaMEDMEM::MEDCouplingUMesh *getDistantMesh() const ; bool isEntityCorrespPresent(int localEntity,int distantEntity) const; - const int * getNodeCorrespIndex() const; - const int * getNodeCorrespValue() const; + const int *getNodeCorrespIndex() const; + const int *getNodeCorrespValue() const; int getNodeNumber() const; - const int * getFaceCorrespIndex() const; - const int * getFaceCorrespValue() const; + const int *getFaceCorrespIndex() const; + const int *getFaceCorrespValue() const; int getFaceNumber() const; - const int * getEntityCorrespIndex(int localEntity, - int distantEntity) const; - const int * getEntityCorrespValue(int localEntity, - int distantEntity) const; + const int *getEntityCorrespIndex(int localEntity, + int distantEntity) const; + const int *getEntityCorrespValue(int localEntity, + int distantEntity) const; int getEntityCorrespNumber(int localEntity, int distantEntity) const; int getEntityCorrespLength(int localEntity, int distantEntity) const; - void setName(std::string name) ; - void setDescription(std::string description) ; + void setName(const std::string& name) ; + void setDescription(const std::string& description) ; void setDistantDomainNumber(int distantDomainNumber) ; void setLocalDomainNumber(int distantDomainNumber) ; void setLocalMesh(ParaMEDMEM::MEDCouplingUMesh * localMesh) ; @@ -83,12 +69,23 @@ namespace MEDPARTITIONER void setNodeCorresp(MEDPARTITIONER::SkyLineArray* array); void setFaceCorresp(int * faceCorresp, int nbface); void setFaceCorresp(MEDPARTITIONER::SkyLineArray* array); - void setEntityCorresp(int localEntity, - int distantEntity, + void setEntityCorresp(int localEntity, int distantEntity, int * entityCorresp, int nbentity); - void setEntityCorresp(int localEntity, - int distantEntity, - MEDPARTITIONER::SkyLineArray* array); + void setEntityCorresp(int localEntity, int distantEntity, + MEDPARTITIONER::SkyLineArray *array); + private : + std::string _name; + std::string _description; + int _local_domain_number; + int _distant_domain_number; + + ParaMEDMEM::MEDCouplingUMesh * _local_mesh; + ParaMEDMEM::MEDCouplingUMesh * _distant_mesh; + + SkyLineArray * _node_corresp; + SkyLineArray * _face_corresp; + + std::map < std::pair , SkyLineArray * > _entity_corresp; }; } # endif