From 524b9cee47b0be57a9c160a9ad61ff83f1baf56e Mon Sep 17 00:00:00 2001 From: NDJINGA Michael Date: Mon, 17 Jan 2022 14:13:31 +0100 Subject: [PATCH] Corrected missing data in copy constructor --- CDMATH/mesh/inc/Mesh.hxx | 16 ++++++++++++++-- CDMATH/mesh/src/Mesh.cxx | 31 ++++++++++++++++++++++++------- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/CDMATH/mesh/inc/Mesh.hxx b/CDMATH/mesh/inc/Mesh.hxx index 23eb46e..7d580eb 100644 --- a/CDMATH/mesh/inc/Mesh.hxx +++ b/CDMATH/mesh/inc/Mesh.hxx @@ -259,17 +259,29 @@ public: //---------------------------------------------------------------- */ std::vector getNameOfNodeGroups( void ) const ; + /** + * \brief return the list of face groups ids + * @return _faceGroupsIds + */ + std::vector< std::vector > getFaceGroups( void ) const ; + + /** + * \brief return the list of node groups Ids + * @return _nodeGroupsIds + */ + std::vector< std::vector > getNodeGroups( void ) const ; + /** * \brief return the list of face groups * @return _faceGroups */ - std::vector getFaceGroups( void ) const ; + std::vector getMEDCouplingFaceGroups( void ) const ; /** * \brief return the list of node groups * @return _nodeGroups */ - std::vector getNodeGroups( void ) const ; + std::vector getMEDCouplingNodeGroups( void ) const ; /** * \brief Functions to extract boundary nodes and faces Ids diff --git a/CDMATH/mesh/src/Mesh.cxx b/CDMATH/mesh/src/Mesh.cxx index 8976721..b81302a 100644 --- a/CDMATH/mesh/src/Mesh.cxx +++ b/CDMATH/mesh/src/Mesh.cxx @@ -124,9 +124,11 @@ Mesh::Mesh( const Mesh& mesh ) _numberOfEdges = mesh.getNumberOfEdges(); _faceGroupNames = mesh.getNameOfFaceGroups() ; - _faceGroups = mesh.getFaceGroups() ; + _faceGroups = mesh.getMEDCouplingFaceGroups() ; + _faceGroupsIds = mesh.getFaceGroups() ; _nodeGroupNames = mesh.getNameOfNodeGroups() ; - _nodeGroups = mesh.getNodeGroups() ; + _nodeGroups = mesh.getMEDCouplingNodeGroups() ; + _nodeGroupsIds = mesh.getNodeGroups() ; _nodes = mesh.getNodes() ; _faces = mesh.getFaces() ; @@ -1107,7 +1109,7 @@ Mesh::setGroupAtPlan(double value, int direction, double eps, std::string groupN _faceGroups.insert( _faceGroups.end(), NULL);//No mesh created. Create one ? } else - {cout<<"_faceGroupNames.size()="<<_faceGroupNames.size()<<", _faceGroupsIds.size()="<<_faceGroupsIds.size()< faceGroupIds = _faceGroupsIds[it-_faceGroupNames.begin()]; faceGroupIds.insert( faceGroupIds.end(), faceIds.begin(), faceIds.end()); /* Detect and erase duplicates face ids */ @@ -1694,8 +1696,14 @@ Mesh::getNameOfFaceGroups( void ) const return _faceGroupNames; } -vector +vector< std::vector > Mesh::getFaceGroups( void ) const +{ + return _faceGroupsIds; +} + +vector +Mesh::getMEDCouplingFaceGroups( void ) const { return _faceGroups; } @@ -1706,8 +1714,15 @@ Mesh::getNameOfNodeGroups( void ) const return _nodeGroupNames; } -vector +vector< std::vector > Mesh::getNodeGroups( void ) const +{ + return _nodeGroupsIds; +} + + +vector +Mesh::getMEDCouplingNodeGroups( void ) const { return _nodeGroups; } @@ -1733,9 +1748,11 @@ Mesh::operator= ( const Mesh& mesh ) _nxyz = mesh.getCellGridStructure() ; _faceGroupNames = mesh.getNameOfFaceGroups() ; - _faceGroups = mesh.getFaceGroups() ; + _faceGroupsIds = mesh.getFaceGroups() ; + _faceGroups = mesh.getMEDCouplingFaceGroups() ; _nodeGroupNames = mesh.getNameOfNodeGroups() ; - _nodeGroups = mesh.getNodeGroups() ; + _nodeGroupsIds = mesh.getNodeGroups() ; + _nodeGroups = mesh.getMEDCouplingNodeGroups() ; _nodes = mesh.getNodes() ; _faces = mesh.getFaces() ; -- 2.30.2