X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FINTERP_KERNEL%2FSplitterTetra.txx;h=02e7c7b8f7bfe7eba2816ccdf3cc8bc78c1c1c7e;hb=19a5d11f2c31745a83bd6993357263641c0babe5;hp=4bc794ae6d45e58c16be404d3f68759c9c2e597f;hpb=e215e6f76f706ca097b9fdca5665ec3f06237e69;p=tools%2Fmedcoupling.git diff --git a/src/INTERP_KERNEL/SplitterTetra.txx b/src/INTERP_KERNEL/SplitterTetra.txx index 4bc794ae6..02e7c7b8f 100644 --- a/src/INTERP_KERNEL/SplitterTetra.txx +++ b/src/INTERP_KERNEL/SplitterTetra.txx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2013 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 @@ -99,9 +99,12 @@ namespace INTERP_KERNEL * \param [in] tetraCorners array 4*3 doubles containing corners of input tetrahedron (P0X,P0Y,P0Y,P1X,P1Y,P1Z,P2X,P2Y,P2Z,P3X,P3Y,P3Z). */ template - SplitterTetra::SplitterTetra(const MyMeshType& srcMesh, const double tetraCorners[12]): _t(0),_src_mesh(srcMesh) + SplitterTetra::SplitterTetra(const MyMeshType& srcMesh, const double tetraCorners[12], const int *conn): _t(0),_src_mesh(srcMesh) { - _conn[0]=0; _conn[1]=1; _conn[2]=2; _conn[3]=3; + if(!conn) + { _conn[0]=0; _conn[1]=1; _conn[2]=2; _conn[3]=3; } + else + { _conn[0]=conn[0]; _conn[1]=conn[1]; _conn[2]=conn[2]; _conn[3]=conn[3]; } _coords[0]=tetraCorners[0]; _coords[1]=tetraCorners[1]; _coords[2]=tetraCorners[2]; _coords[3]=tetraCorners[3]; _coords[4]=tetraCorners[4]; _coords[5]=tetraCorners[5]; _coords[6]=tetraCorners[6]; _coords[7]=tetraCorners[7]; _coords[8]=tetraCorners[8]; _coords[9]=tetraCorners[9]; _coords[10]=tetraCorners[10]; _coords[11]=tetraCorners[11]; // create the affine transform @@ -207,8 +210,7 @@ namespace INTERP_KERNEL //std::cout << std::endl << "*** " << globalNodeNum << std::endl; calculateNode(globalNodeNum); } - - checkIsOutside(_nodes[globalNodeNum], isOutside); + CheckIsOutside(_nodes[globalNodeNum], isOutside); } // halfspace filtering check @@ -250,7 +252,8 @@ namespace INTERP_KERNEL faceType = cellModelCell.getSonType(ii); const CellModel& faceModel=CellModel::GetCellModel(faceType); assert(faceModel.getDimension() == 2); - faceNodes=new int[faceModel.getNumberOfNodes()]; + nbFaceNodes = cellModelCell.getNumberOfNodesConstituentTheSon(ii); + faceNodes = new int[nbFaceNodes]; cellModelCell.fillSonCellNodalConnectivity(ii,cellNodes,faceNodes); } // intersect a son with the unit tetra @@ -391,7 +394,6 @@ namespace INTERP_KERNEL { typedef typename MyMeshType::MyConnType ConnType; typedef double Vect2[2]; - typedef double Vect3[3]; typedef double Triangle2[3][2]; const double *const tri0[3] = {p1, p2, p3}; @@ -595,8 +597,6 @@ namespace INTERP_KERNEL std::multiset& listOfTetraFacesTreated, std::set& listOfTetraFacesColinear) { - typedef typename MyMeshType::MyConnType ConnType; - double totalSurface = 0.0; // check if we have planar tetra element @@ -622,8 +622,8 @@ namespace INTERP_KERNEL calculateNode2(globalNodeNum, polyCoords[i]); } - checkIsStrictlyOutside(_nodes[globalNodeNum], isStrictlyOutside, precision); - checkIsOutside(_nodes[globalNodeNum], isOutside, precision); + CheckIsStrictlyOutside(_nodes[globalNodeNum], isStrictlyOutside, precision); + CheckIsOutside(_nodes[globalNodeNum], isOutside, precision); } // halfspace filtering check @@ -848,7 +848,7 @@ namespace INTERP_KERNEL for(int i = 0;i<(int)nbOfNodes4Type;++i) { _t->apply(nodes[i], tetraCorners[i]); - checkIsOutside(nodes[i], isOutside); + CheckIsOutside(nodes[i], isOutside); } // halfspace filtering check @@ -938,11 +938,13 @@ namespace INTERP_KERNEL SplitIntoTetras(_splitting_pol,gt,cellConn,refConn+_target_mesh.getConnectivityIndexPtr()[targetCell+1],coords,tetrasNodalConn,addCoords); std::size_t nbTetras(tetrasNodalConn.size()/4); tetra.resize(nbTetras); double tmp[12]; + int tmp2[4]; for(std::size_t i=0;i=0) { tmp[j*3+0]=coords[3*cellId+0]; @@ -956,7 +958,7 @@ namespace INTERP_KERNEL tmp[j*3+2]=addCoords[3*(-cellId-1)+2]; } } - tetra[i]=new SplitterTetra(_src_mesh,tmp); + tetra[i]=new SplitterTetra(_src_mesh,tmp,tmp2); } } @@ -1208,6 +1210,8 @@ namespace INTERP_KERNEL while ( allNodeIndices.size() < nbOfCellNodes ) allNodeIndices.push_back( allNodeIndices.size() ); std::vector classicFaceNodes(4); + if(cellModelCell.isQuadratic()) + throw INTERP_KERNEL::Exception("SplitterTetra2::splitConvex : quadratic 3D cells are not implemented yet !"); int* faceNodes = cellModelCell.isDynamic() ? &allNodeIndices[0] : &classicFaceNodes[0]; // nodes of tetrahedron