From 6f922c8c3fba81804757cf555b5b208ab16490a2 Mon Sep 17 00:00:00 2001 From: cvw Date: Fri, 16 Mar 2012 15:11:49 +0000 Subject: [PATCH] *** empty log message *** --- .../MEDPARTITIONER_JointFinder.cxx | 18 ++++++++++++------ .../Test/MEDPARTITIONERTestPara.cxx | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/MEDPartitioner/MEDPARTITIONER_JointFinder.cxx b/src/MEDPartitioner/MEDPARTITIONER_JointFinder.cxx index 252a7ec80..6a6309972 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_JointFinder.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_JointFinder.cxx @@ -48,7 +48,8 @@ void MEDPARTITIONER::JointFinder::findCommonDistantNodes() _node_node[i].resize(nbdomain); } int nbproc=_domain_selector->nbProcs(); - std::vector* > bbtree(nbdomain,(BBTree<3>*) 0); + std::vector* > bbtree(nbdomain,(BBTree<3>*) 0); + std::vector bbxi(nbdomain,(double*) 0); std::vector rev(nbdomain,(ParaMEDMEM::DataArrayInt*) 0); std::vector revIndx(nbdomain,(ParaMEDMEM::DataArrayInt*) 0); int meshDim; @@ -60,7 +61,7 @@ void MEDPARTITIONER::JointFinder::findCommonDistantNodes() if(!_domain_selector->isMyDomain(mydomain)) continue; const ParaMEDMEM::MEDCouplingUMesh* myMesh=_mesh_collection.getMesh(mydomain); - meshDim=myMesh->getMeshDimension(); + meshDim = myMesh->getMeshDimension(); spaceDim= myMesh->getSpaceDimension(); rev[mydomain] = ParaMEDMEM::DataArrayInt::New(); revIndx[mydomain] = ParaMEDMEM::DataArrayInt::New(); @@ -73,9 +74,11 @@ void MEDPARTITIONER::JointFinder::findCommonDistantNodes() bbx[2*i+1]=bbx[2*i]+2e-12; } bbtree[mydomain]=new BBTree<3> (bbx,0,0,myMesh->getNumberOfNodes(),-1e-12); - delete [] bbx; + //keep bbx because need it in getIntersectingElems + //no delete [] bbx yet + bbxi[mydomain]=bbx; } - + //send my domains to other proc an receive other domains from other proc for (int isource=0; isource recvVec; RecvDoubleVec(recvVec,sourceProc); std::map commonNodes; // (local nodes, distant nodes) list - for (int inode=0; inode<(recvVec.size()/meshDim); inode++) + for (int inode=0; inode<(recvVec.size()/spaceDim); inode++) { double* bbox=new double[2*spaceDim]; for (int i=0; idecrRef(); if (bbtree[i]!=0) delete bbtree[i]; + if (bbxi[i]!=0) + delete [] bbxi[i]; } if (MyGlobals::_Verbose>100) diff --git a/src/MEDPartitioner/Test/MEDPARTITIONERTestPara.cxx b/src/MEDPartitioner/Test/MEDPARTITIONERTestPara.cxx index 28c171c42..e5332e2e7 100644 --- a/src/MEDPartitioner/Test/MEDPARTITIONERTestPara.cxx +++ b/src/MEDPartitioner/Test/MEDPARTITIONERTestPara.cxx @@ -76,7 +76,7 @@ void MEDPARTITIONERTest::verifyMedpartitionerOnSmallSizeForMesh() MPI_Comm_rank(MPI_COMM_WORLD, &MyGlobals::_Rank); MEDPARTITIONER::ParaDomainSelector parallelizer(false); - MEDPARTITIONER::MeshCollection collection(input,parallelizer); //cvwat01 + MEDPARTITIONER::MeshCollection collection(input,parallelizer); CPPUNIT_ASSERT_EQUAL(3, collection.getMeshDimension()); std::vectorcellMeshes=collection.getMesh(); CPPUNIT_ASSERT_EQUAL(5, (int) cellMeshes.size()); -- 2.39.2