X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FINTERP_KERNEL%2FPolyhedronIntersectorP0P1.txx;h=6fa6002da54a7683872b6f0b292403586de7cf30;hb=d426837c21eca9b56b9b8a7a7434aaf3969c8977;hp=8786b3f769f4890574de1003b35b8f2aa86f90e6;hpb=10f37bf6f33a762626d7f1093b2f5450c1688667;p=tools%2Fmedcoupling.git diff --git a/src/INTERP_KERNEL/PolyhedronIntersectorP0P1.txx b/src/INTERP_KERNEL/PolyhedronIntersectorP0P1.txx index 8786b3f76..6fa6002da 100644 --- a/src/INTERP_KERNEL/PolyhedronIntersectorP0P1.txx +++ b/src/INTERP_KERNEL/PolyhedronIntersectorP0P1.txx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2012 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. +// 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 @@ -16,6 +16,7 @@ // // 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));