]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
check of the CPPUNIT test suite
authorvbd <vbd>
Thu, 31 Jan 2008 08:43:06 +0000 (08:43 +0000)
committervbd <vbd>
Thu, 31 Jan 2008 08:43:06 +0000 (08:43 +0000)
valgrind = 0

13 files changed:
src/ParaMEDMEM/ComponentTopology.cxx
src/ParaMEDMEM/InterpolationMatrix.cxx
src/ParaMEDMEM/IntersectionDEC.cxx
src/ParaMEDMEM/IntersectionDEC.hxx
src/ParaMEDMEM/MPIProcessorGroup.cxx
src/ParaMEDMEM/NonCoincidentDEC.cxx
src/ParaMEDMEM/ParaFIELD.cxx
src/ParaMEDMEM/ProcessorGroup.hxx
src/ParaMEDMEM/StructuredCoincidentDEC.cxx
src/ParaMEDMEM/Test/Makefile.in
src/ParaMEDMEM/Test/ParaMEDMEMTest.hxx
src/ParaMEDMEM/Test/ParaMEDMEMTest_NonCoincidentDEC.cxx
src/ParaMEDMEM/test_INTERPOL_2D.cxx

index c95b6e9e455ee220c405f4b3422cf22126c8723d..3e8faada1ceff7123128b7befd93079fa4aa9e15 100644 (file)
@@ -72,7 +72,7 @@ int ComponentTopology::nbLocalComponents() const{
        
        int nbcomp;
        int myrank = _proc_group->myRank();
-       cout << "nbLocalComp "<<myrank<<" "<< component_array[myrank+1]<< " " <<component_array[myrank]<<endl;
+       //cout << "nbLocalComp "<<myrank<<" "<< component_array[myrank+1]<< " " <<component_array[myrank]<<endl;
        if (myrank!=-1)
                nbcomp = component_array[myrank+1]-component_array[myrank];
        else 
index af0785ef46a68d155dc7fd2ae83d3938ba0551e4..ad5c1bae3e5fd120fda1cf2da12a7861cd88526a 100644 (file)
@@ -5,8 +5,11 @@
 #include "TranslationRotationMatrix.hxx"
 #include "Interpolation.hxx"
 #include "Interpolation2D.hxx"
+#include "Interpolation2D.txx"
 #include "Interpolation3DSurf.hxx"
+#include "Interpolation3DSurf.txx"
 #include "Interpolation3D.hxx"
+#include "Interpolation3D.txx"
 
 /*! \class InterpolationMatrix
 
@@ -69,28 +72,40 @@ The number of elements per row is stored in the row_offsets array.
  */
 void InterpolationMatrix::addContribution(MEDMEM::MESH& distant_support, int iproc_distant, int* distant_elems)
 {
-
        if (distant_support.getMeshDimension() != _source_support.getMeshDimension() ||
                        distant_support.getMeshDimension() != _source_support.getMeshDimension() )
                throw MEDMEM::MEDEXCEPTION("local and distant meshes do not have the same space and mesh dimensions");
        
        //creating the interpolator structure
-       MEDMEM::Interpolation* interpolator;
-  if (distant_support.getMeshDimension()==2 && distant_support.getSpaceDimension()==3)
-    interpolator=new MEDMEM::Interpolation3DSurf();
-  else if (distant_support.getMeshDimension()==2 && distant_support.getSpaceDimension()==2)
-               interpolator=new MEDMEM::Interpolation2D();
+       vector<map<int,double> > surfaces;
+       //computation of the intersection volumes between source and target elements
+       int source_size=  _source_support.getNumberOfElements(MED_EN::MED_CELL,MED_EN::MED_ALL_ELEMENTS);  
+        
+       if (distant_support.getMeshDimension()==2 && distant_support.getSpaceDimension()==3)
+       {
+               MEDMEM::Interpolation3DSurf interpolator;
+               interpolator.interpolateMeshes(distant_support,_source_support,surfaces);
+       }
+       else if (distant_support.getMeshDimension()==2 && distant_support.getSpaceDimension()==2)
+       {
+               MEDMEM::Interpolation2D interpolator;
+               interpolator.interpolateMeshes(distant_support,_source_support,surfaces);
+       }
        else if (distant_support.getMeshDimension()==3 && distant_support.getSpaceDimension()==3)
-    interpolator=new MEDMEM::Interpolation3D();
+       {
+               MEDMEM::Interpolation3D interpolator;
+               interpolator.interpolateMeshes(distant_support,_source_support,surfaces);
+       }
        else
+       {
                throw MEDMEM::MEDEXCEPTION("no interpolator exists for these mesh and space dimensions ");
+       }
   
-       //computation of the intersection volumes between source and target elements
-  int source_size=  _source_support.getNumberOfElements(MED_EN::MED_CELL,MED_EN::MED_ALL_ELEMENTS);  
-  vector<map<int,double> > surfaces = interpolator->interpolateMeshes(distant_support,_source_support);
-  delete interpolator;  
-  if (surfaces.size() != source_size)
-    throw MEDEXCEPTION("uncoherent number of rows in interpolation matrix");
+       if (surfaces.size() != source_size)
+       {
+               cout<<"surfaces.size()="<<surfaces.size()<<" source_size="<<source_size<<endl;  
+               throw MEDEXCEPTION("uncoherent number of rows in interpolation matrix");
+       }
   
        //computing the vectors containing the source and target element volumes
        MEDMEM::SUPPORT target_support(&distant_support,"all cells", MED_EN::MED_CELL);
@@ -145,10 +160,10 @@ void InterpolationMatrix::addContribution(MEDMEM::MESH& distant_support, int ipr
 
                                }
     }
-  delete source_triangle_surf;
-       delete target_triangle_surf;
-}
-
+       delete source_triangle_surf;
+       delete target_triangle_surf;
+}      
+       
 /*! The call to this method updates the arrays on the target side
 so that they know which amount of data from which processor they 
 should expect. 
@@ -158,12 +173,12 @@ available.
 
 void InterpolationMatrix::prepare()
 {
-  int nbelems = _source_support.getNumberOfElements(MED_EN::MED_CELL,MED_EN::MED_ALL_ELEMENTS);
-  for (int ielem=0; ielem < nbelems; ielem++)
-  {
-    _row_offsets[ielem+1]+=_row_offsets[ielem];
-  }  
-  _mapping.prepareSendRecv();
+       int nbelems = _source_support.getNumberOfElements(MED_EN::MED_CELL,MED_EN::MED_ALL_ELEMENTS);
+       for (int ielem=0; ielem < nbelems; ielem++)
+       {
+               _row_offsets[ielem+1]+=_row_offsets[ielem];
+       }  
+       _mapping.prepareSendRecv();
 }
 
 /*!
index ab3791b162d9197ad27f74aafa6a3b43fa5e7d91..a148966d8b5b60ac29de0970c36f6330c179d2a4 100644 (file)
@@ -200,7 +200,7 @@ Receives the data whether the processor is on the working side or on the lazy si
 void IntersectionDEC::recvData()
 {
 
-//  _interpolation_matrix->setAllToAllMethod(_allToAllMethod);
+
        if (_source_group->containsMyRank())
                _interpolation_matrix->transposeMultiply(*_local_field->getField());
        else if (_target_group->containsMyRank())
@@ -208,49 +208,32 @@ void IntersectionDEC::recvData()
                        _interpolation_matrix->multiply(*_local_field->getField());
                        if (_forced_renormalization_flag)
                                renormalizeTargetField();
-                       
-//                             for (int icomp=0; icomp<_local_field->getField()->getNumberOfComponents(); icomp++)
-//                                     {
-//                                             double total_norm = _local_field->getVolumeIntegral(icomp+1);
-//                                             double source_norm=total_norm;
-//                                             _comm_interface->broadcast(&source_norm, 1, MPI_DOUBLE, 0,* dynamic_cast<MPIProcessorGroup*>(_union_group)->getComm());
-                                               
-//                                             if (_target_group->containsMyRank() && abs(total_norm)>1e-100)
-//                                                     _local_field->getField()->applyLin(source_norm/total_norm,0.0,icomp+1);
-//                                     }
                }
        
        
 }
 
+
 void IntersectionDEC::recvData( double time )
 {
   _interpolation_matrix->getAccessDEC()->SetTime(time);
   recvData() ;
 }
 
+
 /*!
 Sends the data whether the processor is on the working side or on the lazy side.
 It must match a recvData() call on the other side.
  */
 void IntersectionDEC::sendData()
 {
-//  _interpolation_matrix->setAllToAllMethod(_allToAllMethod);
        if (_source_group->containsMyRank())
                {
     
                        _interpolation_matrix->multiply(*_local_field->getField());
                        if (_forced_renormalization_flag)
                                renormalizeTargetField();
-                       //      for (int icomp=0; icomp<_local_field->getField()->getNumberOfComponents(); icomp++)
-//                                     {
-//                                             double total_norm = _local_field->getVolumeIntegral(icomp+1);
-//                                             double source_norm = total_norm;
-//                                             _comm_interface->broadcast(&source_norm, 1, MPI_DOUBLE, 0,* dynamic_cast<MPIProcessorGroup*>(_union_group)->getComm());
-                                               
-//                                             if (_target_group->containsMyRank() && abs(total_norm)>1e-100)
-//                                                     _local_field->getField()->applyLin(source_norm/total_norm,0.0,icomp+1);
-//                                     }
+               
                }
        else if (_target_group->containsMyRank())
                _interpolation_matrix->transposeMultiply(*_local_field->getField());
index 90817549d01e153206dd05212d1581eb4aab4bdf..f40d47e40c221f7f9d8691ddc83272bbb8b2ebd6 100644 (file)
@@ -23,8 +23,9 @@ namespace ParaMEDMEM
     void recvData( double time );
 
     void sendData();
+
     void sendData( double time , double deltatime );
-    
+
     void prepareSourceDE(){};
     void prepareTargetDE(){};
     
index f7e72e1ab4c624581085e7405b7af2da9a30b368..41f4fbf6932081559b2fd5be5383acb493705f42 100644 (file)
@@ -132,9 +132,10 @@ ProcessorGroup(proc_group.getCommInterface())
 
 MPIProcessorGroup::~MPIProcessorGroup()
 {
+       _comm_interface.groupFree(&_group);
        if (_comm!=MPI_COMM_WORLD && _comm !=MPI_COMM_NULL)
                _comm_interface.commFree(&_comm);
-       _comm_interface.groupFree(&_group);
+       
 }
 
        /*! Translation of the rank id between two processor groups. This method translates rank \a rank
index abc455fbcc2e6d090a95b2a49e312218fbf998de..2d165409dd0adec54d69e1f224d0f9bd79455622 100644 (file)
@@ -303,13 +303,15 @@ void NonCoincidentDEC::synchronize()
                           start_rank);
       int nbcells = mesh->getNumberOfElements(MED_EN::MED_CELL,MED_EN::MED_ALL_ELEMENTS);
       const MEDMEM::SUPPORT* support=_local_field->getField()->getSupport();
-      const double* coords = (mesh->getBarycenter(support))->getValue();
+      MEDMEM::FIELD<double>* barycenter_coords = mesh->getBarycenter(support);
+      const double* coords = barycenter_coords->getValue();
       fvm_locator_set_nodal(_locator,
                            target_nodal,
                            mesh->getSpaceDimension(),
                            nbcells,
                            NULL,
                            coords);    
+      delete barycenter_coords;
     }
 }
 
@@ -334,6 +336,7 @@ void NonCoincidentDEC::recvData()
        _local_field->getField()->setValue(values);
        if (_forced_renormalization_flag)
                renormalizeTargetField();
+       delete[]values;
 }
 
 /*! This method is called on the source group in order to 
index cd81617a1c38ab1702a27a5aaddd4fdfe4038d81..3ed0d3a754ca2fbcf76b0b113704bdbd7c894efd 100644 (file)
@@ -57,20 +57,22 @@ ParaFIELD::ParaFIELD(const ParaSUPPORT* para_support, const ComponentTopology& c
  _has_field_ownership(true),
  _has_support_ownership(false)
 {
-       if (dynamic_cast<const StructuredParaSUPPORT*>(para_support)!=0)
+       if (dynamic_cast<const StructuredParaSUPPORT*>(para_support)!=0
+                       || (para_support->getTopology()->getProcGroup()->size()==1 && component_topology.nbBlocks()!=1))
        {const BlockTopology* source_topo = dynamic_cast<const BlockTopology*>(para_support->getTopology());
                _topology=new BlockTopology(*source_topo,component_topology);
        }
        else
        {
-         if (component_topology.nbBlocks()!=1)
+         if (component_topology.nbBlocks()!=1 &&  para_support->getTopology()->getProcGroup()->size()!=1)
            throw MEDEXCEPTION(LOCALIZED(
                "ParaFIELD constructor : Unstructured Support not taken into account with component topology yet"));
          else 
            {
              const BlockTopology* source_topo=
                dynamic_cast<const BlockTopology*> (para_support->getTopology());
-             _topology=new BlockTopology(*source_topo,component_topology.nbLocalComponents());
+               int nb_local_comp=component_topology.nbLocalComponents();
+             _topology=new BlockTopology(*source_topo,nb_local_comp);
                                             
            }
        }
index 4a5938f944a2ce41832396e482cbc4b4e68176d4..4b55a61acd8e7901ffa1f00e1a7859b78ab0a2f1 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef PROCESSORGROUP_HXX_
 #define PROCESSORGROUP_HXX_
 #include <set>
-
+#include "CommInterface.hxx"
 
 
 namespace ParaMEDMEM
@@ -31,7 +31,7 @@ public:
   virtual ProcessorGroup* createProcGroup() const=0;
   virtual const std::set<int>& getProcIDs()const  {return _proc_ids;} 
 protected:
-  const CommInterface& _comm_interface;
+  const CommInterface _comm_interface;
   std::set<int> _proc_ids;
 };
   
index 77f2c6aa27e142dba46505add84f81ee933e0d30..76649855bf115443010fef7776739a7492eecc2b 100644 (file)
@@ -54,16 +54,29 @@ requires some more effort. See \ref parafield section for more details.
 namespace ParaMEDMEM
 {
 
-StructuredCoincidentDEC::StructuredCoincidentDEC():_toposource(0),_topotarget(0)
+StructuredCoincidentDEC::StructuredCoincidentDEC():_toposource(0),_topotarget(0),
+                                                                                                  _recvbuffer(0),_sendbuffer(0),
+                                                                                                  _recvcounts(0),_sendcounts(0),
+                                                                                                  _recvdispls(0),_senddispls(0)
 {      
 }
 
 
 StructuredCoincidentDEC::~StructuredCoincidentDEC()
 {
+       delete[] _sendbuffer;
+       delete[] _recvbuffer;
+       delete[]_senddispls;
+       delete[] _recvdispls;
+       delete[] _sendcounts;
+       delete[] _recvcounts;
+       if (! _source_group->containsMyRank())
+               delete _toposource;
+       if(!_target_group->containsMyRank())
+               delete _topotarget;
 }
 
-StructuredCoincidentDEC::StructuredCoincidentDEC(ProcessorGroup& local_group, ProcessorGroup& distant_group):DEC(local_group,distant_group),_toposource(0),_topotarget(0)
+StructuredCoincidentDEC::StructuredCoincidentDEC(ProcessorGroup& local_group, ProcessorGroup& distant_group):DEC(local_group,distant_group),_toposource(0),_topotarget(0),_recvbuffer(0),_sendbuffer(0)
 {
 }
 
@@ -164,6 +177,7 @@ void StructuredCoincidentDEC::prepareSourceDE()
        }
        delete[] target_arrays;
        delete[] counter;
+       delete group;
 }
 
 /*!
@@ -210,6 +224,7 @@ void StructuredCoincidentDEC::prepareTargetDE()
                _recvdispls[i]=_recvdispls[i-1]+_recvcounts[i-1];
        _recvbuffer=new double[nb_local];
                
+       delete group;
 }
 
  
@@ -276,6 +291,7 @@ void StructuredCoincidentDEC::broadcastTopology(BlockTopology*& topo, int tag)
        if (serializer!=0)
                delete[] serializer;
        MESSAGE (" rank "<<group->myRank()<< " unserialize is over");
+       delete group;
 }
 
 
@@ -299,7 +315,9 @@ void StructuredCoincidentDEC::recvData()
        cout<<"end AllToAll"<<endl;
 
        int nb_local = _topotarget->getNbLocalElements();
-       double* value=new double[nb_local];
+       //double* value=new double[nb_local];
+       double* value=const_cast<double*>(_local_field->getField()->getValue());
+       
        int myranktarget=_topotarget->getProcGroup()->myRank();
        vector<int> counters(_toposource->getProcGroup()->size());
        counters[0]=0;
@@ -308,6 +326,7 @@ void StructuredCoincidentDEC::recvData()
                        MPIProcessorGroup* group=new MPIProcessorGroup(*_comm_interface);
                        int worldrank=group->translateRank(_toposource->getProcGroup(),i);
                        counters[i+1]=counters[i]+_recvcounts[worldrank];
+                       delete group;
                }
        
        for (int ielem=0; ielem<nb_local ; ielem++)
@@ -318,7 +337,7 @@ void StructuredCoincidentDEC::recvData()
        }
        
        
-       _local_field->getField()->setValue(value);
+       //_local_field->getField()->setValue(value);
 }
 
 void StructuredCoincidentDEC::sendData()
index 690bea5522aea14c7a78908c7e97e9405a062c63..09d09e9b163458dd805ce879f731991dcc9f1105 100644 (file)
@@ -49,28 +49,29 @@ LIB_SRC = TestParaMEDMEM.cxx \
          ParaMEDMEMTest_MPIProcessorGroup.cxx \
          ParaMEDMEMTest_BlockTopology.cxx \
          ParaMEDMEMTest_IntersectionDEC.cxx \
-          MPIAccessDECTest.cxx \
-          test_AllToAllDEC.cxx \
-          test_AllToAllvDEC.cxx \
-          test_AllToAllTimeDEC.cxx \
-          test_AllToAllvTimeDEC.cxx \
-          test_AllToAllvTimeDoubleDEC.cxx \
-          MPIAccessTest.cxx \
-          test_MPI_Access_Send_Recv.cxx \
-          test_MPI_Access_Cyclic_Send_Recv.cxx \
-          test_MPI_Access_SendRecv.cxx \
-          test_MPI_Access_ISend_IRecv.cxx \
-          test_MPI_Access_Cyclic_ISend_IRecv.cxx \
-          test_MPI_Access_ISendRecv.cxx \
-          test_MPI_Access_Probe.cxx \
-          test_MPI_Access_IProbe.cxx \
-          test_MPI_Access_Cancel.cxx \
-          test_MPI_Access_Send_Recv_Length.cxx \
-          test_MPI_Access_ISend_IRecv_Length.cxx \
-          test_MPI_Access_ISend_IRecv_Length_1.cxx \
-          test_MPI_Access_Time.cxx \
-          test_MPI_Access_Time_0.cxx \
-          test_MPI_Access_ISend_IRecv_BottleNeck.cxx
+         ParaMEDMEMTest_StructuredCoincidentDEC.cxx \
+    MPIAccessDECTest.cxx \
+    test_AllToAllDEC.cxx \
+    test_AllToAllvDEC.cxx \
+    test_AllToAllTimeDEC.cxx \
+    test_AllToAllvTimeDEC.cxx \
+    test_AllToAllvTimeDoubleDEC.cxx \
+    MPIAccessTest.cxx \
+    test_MPI_Access_Send_Recv.cxx \
+    test_MPI_Access_Cyclic_Send_Recv.cxx \
+    test_MPI_Access_SendRecv.cxx \
+    test_MPI_Access_ISend_IRecv.cxx \
+    test_MPI_Access_Cyclic_ISend_IRecv.cxx \
+    test_MPI_Access_ISendRecv.cxx \
+    test_MPI_Access_Probe.cxx \
+    test_MPI_Access_IProbe.cxx \
+    test_MPI_Access_Cancel.cxx \
+    test_MPI_Access_Send_Recv_Length.cxx \
+    test_MPI_Access_ISend_IRecv_Length.cxx \
+    test_MPI_Access_ISend_IRecv_Length_1.cxx \
+    test_MPI_Access_Time.cxx \
+    test_MPI_Access_Time_0.cxx \
+    test_MPI_Access_ISend_IRecv_BottleNeck.cxx
 
 
 
index 9c156335c47f4d333a2502922b47e8a8b4954a07..1299cd96557a84b25bc819dd4522b9270122740a 100644 (file)
@@ -53,6 +53,7 @@ class ParaMEDMEMTest : public CppUnit::TestFixture
        //can be added again after FVM correction for 2D
        //  CPPUNIT_TEST(testNonCoincidentDEC_2D);
   CPPUNIT_TEST(testNonCoincidentDEC_3D); 
+  CPPUNIT_TEST(testStructuredCoincidentDEC);
   CPPUNIT_TEST_SUITE_END();
   
 
@@ -70,6 +71,7 @@ public:
   void testIntersectionDEC_2D();
   void testNonCoincidentDEC_2D();
   void testNonCoincidentDEC_3D();
+  void testStructuredCoincidentDEC();
   void testSynchronousEqualIntersectionWithoutInterpNativeDEC_2D();
   void testSynchronousEqualIntersectionWithoutInterpDEC_2D();
   void testSynchronousEqualIntersectionDEC_2D();
@@ -77,6 +79,7 @@ public:
   void testSynchronousSlowerSourceIntersectionDEC_2D();
   void testSynchronousSlowSourceIntersectionDEC_2D();
   void testSynchronousFastSourceIntersectionDEC_2D();
+
   void testAsynchronousEqualIntersectionDEC_2D();
   void testAsynchronousFasterSourceIntersectionDEC_2D();
   void testAsynchronousSlowerSourceIntersectionDEC_2D();
@@ -89,7 +92,7 @@ private:
                           const std::string& meshname1, 
                           const std::string& filename2, 
                           const std::string& meshname2,
-                           int nbprocsource);
+                           int nbprocsource, double epsilon);
   void testAsynchronousIntersectionDEC_2D(double dtA, double tmaxA, 
                                                                          double dtB, double tmaxB,
                       bool WithPointToPoint, bool Asynchronous, bool WithInterp );
index 33b139ae73baca911422408db09bc5ec26d4fb37..4c55ea704661e7cec160c31088c5ecd1907d2ecf 100644 (file)
@@ -69,7 +69,8 @@ void ParaMEDMEMTest::testNonCoincidentDEC_2D()
                        "Mesh_2",
                        "/share/salome/resources/med/square2_split",
                        "Mesh_3",
-                       3);
+                       3,
+                       1e-6);
 } 
 
 void ParaMEDMEMTest::testNonCoincidentDEC_3D()
@@ -78,20 +79,22 @@ void ParaMEDMEMTest::testNonCoincidentDEC_3D()
   MPI_Comm_size(MPI_COMM_WORLD,&size);
   
   //the test is meant to run on five processors
-  if (size !=5) return ;
+  if (size !=4) return ;
   
   testNonCoincidentDEC( "/share/salome/resources/med/blade_12000_split2",
                        "Mesh_1",
                        "/share/salome/resources/med/blade_3000_split2",
                        "Mesh_1",
-                       2);
+                       2,
+                       1e4);
 } 
 
 void ParaMEDMEMTest::testNonCoincidentDEC(const string& filename1,
                                       const string& meshname1,
                                       const string& filename2,
                                       const string& meshname2,
-                                         int nproc_source)
+                                         int nproc_source,
+                                         double epsilon)
 {
   int size;
   int rank;
@@ -116,7 +119,7 @@ void ParaMEDMEMTest::testNonCoincidentDEC(const string& filename1,
   
   ParaMEDMEM::ParaMESH* source_mesh=0;
   ParaMEDMEM::ParaMESH* target_mesh=0;
-  
+  ParaMEDMEM::ParaSUPPORT* parasupport=0;
   //loading the geometry for the source group
 
   ParaMEDMEM::NonCoincidentDEC dec (*source_group,*target_group);
@@ -156,7 +159,7 @@ void ParaMEDMEMTest::testNonCoincidentDEC(const string& filename1,
     
       paramesh=new ParaMESH (*mesh,*source_group,"source mesh");
     
-      ParaMEDMEM::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT( support,*source_group);
+      parasupport=new UnstructuredParaSUPPORT( support,*source_group);
       ParaMEDMEM::ComponentTopology comptopo;
       parafield = new ParaFIELD(parasupport, comptopo);
 
@@ -170,6 +173,7 @@ void ParaMEDMEMTest::testNonCoincidentDEC(const string& filename1,
       icocofield=new ICoCo::MEDField(paramesh,parafield);
      
       dec.attachLocalField(icocofield);
+      delete [] value;
     }
   
   //loading the geometry for the target group
@@ -185,7 +189,7 @@ void ParaMEDMEMTest::testNonCoincidentDEC(const string& filename1,
       support=new MEDMEM::SUPPORT(mesh,"all elements",MED_EN::MED_CELL);
       
       paramesh=new ParaMESH (*mesh,*target_group,"target mesh");
-      ParaMEDMEM::ParaSUPPORT* parasupport=new UnstructuredParaSUPPORT(support,*target_group);
+     parasupport=new UnstructuredParaSUPPORT(support,*target_group);
       ParaMEDMEM::ComponentTopology comptopo;
       parafield = new ParaFIELD(parasupport, comptopo);
 
@@ -198,6 +202,7 @@ void ParaMEDMEMTest::testNonCoincidentDEC(const string& filename1,
       icocofield=new ICoCo::MEDField(paramesh,parafield);
       
       dec.attachLocalField(icocofield);
+      delete [] value;
     }
     
   
@@ -233,14 +238,20 @@ void ParaMEDMEMTest::testNonCoincidentDEC(const string& filename1,
       field_after_int = parafield->getVolumeIntegral(1);
       
     }
-    MPI_Bcast(&field_after_int, 1,MPI_DOUBLE, 4,MPI_COMM_WORLD);
+       MPI_Bcast(&field_before_int,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
+    MPI_Bcast(&field_after_int, 1,MPI_DOUBLE, size-1,MPI_COMM_WORLD);
      
-   CPPUNIT_ASSERT_DOUBLES_EQUAL(field_before_int, field_after_int, 1e-6);
+   CPPUNIT_ASSERT_DOUBLES_EQUAL(field_before_int, field_after_int, epsilon);
     
    delete source_group;
   delete target_group;
   delete self_group;
        delete icocofield;
+       delete paramesh;
+       delete parafield;
+       delete support;
+       delete parasupport;
+       delete mesh;
   MPI_Barrier(MPI_COMM_WORLD);
   
 }
index 64bb22afd40787ef19172f45ac869c802dee2211..964ada25eba39d75b23461316d9ab8db6039b7c7 100644 (file)
@@ -1,6 +1,9 @@
 #include "Interpolation2D.hxx"
+#include "Interpolation2D.txx"
 #include "MEDMEM_Mesh.hxx"
-
+#include <vector>
+#include <map>
+using namespace std;
 int main()
 {
   MEDMEM::MESH source(MEDMEM::MED_DRIVER,"/home/vb144235/resources/square128000.med","Mesh_1");
@@ -8,5 +11,6 @@ int main()
 
    MEDMEM::Interpolation2D interp;
         //   interp.setOptions(1e-6,1,2);
-  interp.interpolateMeshes(source,target);
+  vector<map<int,double> > surf;
+  interp.interpolateMeshes(source,target,surf);
 }