1 // Copyright (C) 2018 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (EDF R&D)
22 #include "MEDCoupling1GTUMesh.hxx"
26 template<class MAPCLS>
27 void MEDCoupling::MEDCoupling1SGTUMesh::renumberNodesInConnT(const MAPCLS& newNodeNumbersO2N)
29 getNumberOfCells();//only to check that all is well defined.
30 int *begPtr(_conn->getPointer());
31 int nbElt(_conn->getNumberOfTuples());
32 int *endPtr(begPtr+nbElt);
33 for(int *it=begPtr;it!=endPtr;it++)
35 auto it2(newNodeNumbersO2N.find(*it));
36 if(it2!=newNodeNumbersO2N.end())
42 std::ostringstream oss; oss << "MEDCoupling1SGTUMesh::renumberNodesInConn : At pos #" << std::distance(begPtr,it) << " of nodal connectivity value is " << *it << ". Not in map !";
43 throw INTERP_KERNEL::Exception(oss.str().c_str());
49 template<class MAPCLS>
50 void MEDCoupling::MEDCoupling1DGTUMesh::renumberNodesInConnT(const MAPCLS& newNodeNumbersO2N)
52 getNumberOfCells();//only to check that all is well defined.
54 int nbOfTuples(_conn->getNumberOfTuples());
55 int *pt(_conn->getPointer());
56 for(int i=0;i<nbOfTuples;i++,pt++)
61 auto it(newNodeNumbersO2N.find(*pt));
62 if(it!=newNodeNumbersO2N.end())
66 std::ostringstream oss; oss << "MEDCoupling1DGTUMesh::renumberNodesInConn : At pos #" << i << " of connectivity, node id is " << *pt << ". Not in keys of input map !";
67 throw INTERP_KERNEL::Exception(oss.str().c_str());
72 std::ostringstream oss; oss << "MEDCoupling1DGTUMesh::renumberNodesInConn : error on tuple #" << i << " value is " << *pt << " ! Should be >=0 !";
73 throw INTERP_KERNEL::Exception(oss.str().c_str());