From 1f2c6e16a49021a97ce23ae5c54080b1d5aa073b Mon Sep 17 00:00:00 2001 From: prascle Date: Tue, 4 Sep 2012 13:58:46 +0000 Subject: [PATCH 1/1] PR: tools for crack meshing --- src/SMDS/SMDS_UnstructuredGrid.cxx | 24 +++++++++++++++++++++--- src/SMDS/SMDS_UnstructuredGrid.hxx | 2 +- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/SMDS/SMDS_UnstructuredGrid.cxx b/src/SMDS/SMDS_UnstructuredGrid.cxx index 0d9b1e6c3..1eb5c445d 100644 --- a/src/SMDS/SMDS_UnstructuredGrid.cxx +++ b/src/SMDS/SMDS_UnstructuredGrid.cxx @@ -763,7 +763,7 @@ void SMDS_UnstructuredGrid::BuildDownwardConnectivity(bool withEdges) * @param vtkId the vtk id of the cell * @return number of neighbors */ -int SMDS_UnstructuredGrid::GetNeighbors(int* neighborsVtkIds, int* downIds, unsigned char* downTypes, int vtkId) +int SMDS_UnstructuredGrid::GetNeighbors(int* neighborsVtkIds, int* downIds, unsigned char* downTypes, int vtkId, bool getSkin) { int vtkType = this->GetCellType(vtkId); int cellDim = SMDS_Downward::getCellDimension(vtkType); @@ -798,9 +798,27 @@ int SMDS_UnstructuredGrid::GetNeighbors(int* neighborsVtkIds, int* downIds, unsi downIds[nb] = downId; downTypes[nb] = cellType; nb++; + if (nb >= NBMAXNEIGHBORS) + { + INFOS("SMDS_UnstructuredGrid::GetNeighbors problem: NBMAXNEIGHBORS=" <getVtkCellId(downId); // OK if skin present + downIds[nb] = downId; + downTypes[nb] = cellType; + nb++; + if (nb >= NBMAXNEIGHBORS) + { + INFOS("SMDS_UnstructuredGrid::GetNeighbors problem: NBMAXNEIGHBORS=" <= NBMAXNEIGHBORS) - assert(0); } return nb; } diff --git a/src/SMDS/SMDS_UnstructuredGrid.hxx b/src/SMDS/SMDS_UnstructuredGrid.hxx index 4c1cc7b80..774c54e27 100644 --- a/src/SMDS/SMDS_UnstructuredGrid.hxx +++ b/src/SMDS/SMDS_UnstructuredGrid.hxx @@ -83,7 +83,7 @@ public: void setCellIdToDownId(int vtkCellId, int downId); void CleanDownwardConnectivity(); void BuildDownwardConnectivity(bool withEdges); - int GetNeighbors(int* neighborsVtkIds, int* downIds, unsigned char* downTypes, int vtkId); + int GetNeighbors(int* neighborsVtkIds, int* downIds, unsigned char* downTypes, int vtkId, bool getSkin=false); int GetParentVolumes(int* volVtkIds, int vtkId); int GetParentVolumes(int* volVtkIds, int downId, unsigned char downType); void GetNodeIds(std::set& nodeSet, int downId, unsigned char downType); -- 2.30.2