X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FINTERP_KERNEL%2FPolyhedronIntersectorP0P1.txx;h=6fa6002da54a7683872b6f0b292403586de7cf30;hb=19a5d11f2c31745a83bd6993357263641c0babe5;hp=75de8e4c479a52e7ef28bd8d924c5e2f8b4bc621;hpb=48782c06022ca2caa36f849cb5a29ea4fe2aaa83;p=tools%2Fmedcoupling.git diff --git a/src/INTERP_KERNEL/PolyhedronIntersectorP0P1.txx b/src/INTERP_KERNEL/PolyhedronIntersectorP0P1.txx index 75de8e4c4..6fa6002da 100644 --- a/src/INTERP_KERNEL/PolyhedronIntersectorP0P1.txx +++ b/src/INTERP_KERNEL/PolyhedronIntersectorP0P1.txx @@ -1,21 +1,22 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// Author : Anthony Geay (CEA/DEN) #ifndef __POLYHEDRONINTERSECTORP0P1_TXX__ #define __POLYHEDRONINTERSECTORP0P1_TXX__ @@ -77,9 +78,8 @@ namespace INTERP_KERNEL void PolyhedronIntersectorP0P1::intersectCells(ConnType targetCell, const std::vector& srcCells, MyMatrix& res) { SplitterTetra* subTetras[24]; - int nbOfNodesT=Intersector3D::_target_mesh.getNumberOfNodesOfElement(OTT::indFC(targetCell)); releaseArrays(); - _split.splitTargetCell(targetCell,nbOfNodesT,_tetra); + _split.splitTargetCell2(targetCell,_tetra); for(typename std::vector::const_iterator iterCellS=srcCells.begin();iterCellS!=srcCells.end();iterCellS++) { for(typename std::vector*>::iterator iter = _tetra.begin(); iter != _tetra.end(); ++iter) @@ -91,7 +91,13 @@ namespace INTERP_KERNEL double volume = tmp->intersectSourceCell(*iterCellS); if(volume!=0.) { - typename MyMatrix::value_type& resRow=res[tmp->getId(0)]; + int targetNodeId(tmp->getId(0)); + if(targetNodeId<0) + { + std::ostringstream oss; oss << "PolyhedronIntersectorP0P1::intersectCells : On target cell #" << targetCell << " the splitting into tetra4 leads to the creation of an additional point that interacts with source cell Id #" << *iterCellS << " !"; + throw INTERP_KERNEL::Exception(oss.str().c_str()); + } + typename MyMatrix::value_type& resRow=res[targetNodeId]; typename MyMatrix::value_type::const_iterator iterRes=resRow.find(OTT::indFC(*iterCellS)); if(iterRes==resRow.end()) resRow.insert(std::make_pair(OTT::indFC(*iterCellS),volume));