]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
taking into account bug corrections provided by the OVAP/OVAP coupling case ref_1007
authorvbd <vbd>
Fri, 4 Jul 2008 10:16:18 +0000 (10:16 +0000)
committervbd <vbd>
Fri, 4 Jul 2008 10:16:18 +0000 (10:16 +0000)
src/ParaMEDMEM/BlockTopology.cxx
src/ParaMEDMEM/ElementLocator.cxx
src/ParaMEDMEM/ICoCoMEDField.cxx
src/ParaMEDMEM/InterpolationMatrix.cxx
src/ParaMEDMEM/IntersectionDEC.cxx
src/ParaMEDMEM/IntersectionDEC.hxx
src/ParaMEDMEM/ParaFIELD.cxx
src/ParaMEDMEM/ParaSUPPORT.cxx
src/ParaMEDMEM/Test/ParaMEDMEMTest_IntersectionDEC.cxx

index 39e394ecdca0e0d9933a145fd47ca580614079e9..ee64e3c2e7bf53a34cc7b69e1720fce7deb2c610 100644 (file)
@@ -98,8 +98,8 @@ BlockTopology::BlockTopology(const ProcessorGroup& group, const GRID& grid):
                _cycle_type=geom_topo._cycle_type;
                _cycle_type.push_back(Block);
                _nb_elems=geom_topo.getNbElements()*comp_topo.nbComponents();
-               cout << " Nb elems "<<_nb_elems<<" topo elems "<<geom_topo.getNbElements()
-                 <<" comp_topo "<<comp_topo.nbComponents()<<endl;
+               //cout << " Nb elems "<<_nb_elems<<" topo elems "<<geom_topo.getNbElements()
+               //  <<" comp_topo "<<comp_topo.nbComponents()<<endl;
        }       
 }
 
index ddcdda268bdd5b7cafc5dd7e3f1990c85a36cbb1..b0d32fece0e147ceacdaedbacb6bf31a9fdacf14 100644 (file)
 
 #include <set>
 using namespace std;
+//const double HUGE=1e200;
 
 namespace ParaMEDMEM 
 { 
-
-const double HUGE = 1e300;
  
 ElementLocator::ElementLocator(const ParaMESH& mesh, const ProcessorGroup& distant_group) 
 :_local_mesh(mesh.getMesh()),
index 9bf26530003e5020e48b1a1f8c22e7f31b1318de..ba312811b6d3efe4320980fbae54bb0d3a9f9db9 100644 (file)
@@ -135,8 +135,10 @@ namespace ICoCo
        {
                delete _local_mesh;
                delete _local_support;
+                  _local_support=0;
                delete _comp_topology;
                delete _support;
+               _support=0;
                if (_has_field_ownership)
                        {
                                delete _field;
index 693ac59f6f017f83bb9d15b2764b5e7e04045765..6a55b6abc6f51a6d14dddb3c6dfb44bbc68baac0 100644 (file)
@@ -259,31 +259,32 @@ On the idle side, no computation is done, but the field is sent.
  */ 
 void InterpolationMatrix::transposeMultiply(MEDMEM::FIELD<double>& field) const
 {
-  vector<double> source_value(_col_offsets.size()* field.getNumberOfComponents(),0.0);
+       int nbcomp = field.getNumberOfComponents();
+  vector<double> source_value(_col_offsets.size()* nbcomp,0.0);
   _mapping.reverseSendRecv(&source_value[0],field);
 
        //treatment of the transpose matrix multiply on the source side
        if (_source_group.containsMyRank())
                {
-                       int nbcomp = field.getNumberOfComponents();
                        int nbrows = _source_support.getNumberOfElements(MED_EN::MED_CELL,MED_EN::MED_ALL_ELEMENTS);
                        
-                       vector<double> target_value(nbrows,0.0);
+                       vector<double> target_value(nbrows*nbcomp,0.0);
 
                        //performing WT.T
                        //WT is W transpose
                        //T is the target vector
                        for (int irow=0; irow<nbrows; irow++)
                                for (int icol=_row_offsets[irow]; icol< _row_offsets[irow+1];icol++)
-                                       for (int icomp=0; icomp<nbcomp; icomp++)
-                                               {
-                                                       int colid= _coeffs[irow][icol-_row_offsets[irow]].first;
-                                                       double value = _coeffs[irow][icol-_row_offsets[irow]].second;
-
-                                                       double coeff_row = source_value[colid-1];
-                                                       target_value[irow*nbcomp+icomp]+=value*coeff_row;
-                                               }
-                               
+                                       {
+                                               int colid= _coeffs[irow][icol-_row_offsets[irow]].first;
+                                               double value = _coeffs[irow][icol-_row_offsets[irow]].second;
+                                               
+                                               for (int icomp=0; icomp<nbcomp; icomp++)
+                                                       {
+                                                               double coeff_row = source_value[(colid-1)*nbcomp+icomp];
+                                                               target_value[irow*nbcomp+icomp]+=value*coeff_row;
+                                                       }
+                                       }
                        //performing VS^(-1).(WT.T)
                        //VS^(-1) is the inverse of the diagonal matrix storing
                        //volumes of the source cells
index 82b03dfb6271213893e51a619cce79cd9297d691..ace1f9f041ad5a5cbaafa556c1f10078434ecdb6 100644 (file)
@@ -126,7 +126,7 @@ the working side during a \a sendData() call.
 void IntersectionDEC::synchronize()
 {
        const ParaMEDMEM::ParaMESH* para_mesh = _local_field->getSupport()->getMesh();
-       cout <<"size of Interpolation Matrix"<<sizeof(InterpolationMatrix)<<endl;
+       //cout <<"size of Interpolation Matrix"<<sizeof(InterpolationMatrix)<<endl;
        _interpolation_matrix = new InterpolationMatrix (*para_mesh, *_source_group,*_target_group,"P0"); 
   _interpolation_matrix->setAllToAllMethod(_allToAllMethod);
   _interpolation_matrix->getAccessDEC()->Asynchronous( _asynchronous ) ;
index f40d47e40c221f7f9d8691ddc83272bbb8b2ebd6..5133c9e94506f47fa642ac292a2c1daf8efdb380 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "MEDMEM_OptionManager.hxx"
 #include "MPI_AccessDEC.hxx"
+#include "MxN_Mapping.hxx" 
 namespace ParaMEDMEM
 {
   class DEC;
index 3ed0d3a754ca2fbcf76b0b113704bdbd7c894efd..6f38cc4336ff311eea31369b0c0ad2cd27b325a6 100644 (file)
@@ -142,8 +142,16 @@ ParaFIELD::~ParaFIELD()
 {
   if (_topology!=0)
     delete _topology;
+       if (_has_support_ownership)
+               {
+                       delete _support;
+                       _support=0;
+               }
+
        if (_has_field_ownership)
-               delete _field;
+               {
+                       delete _field; _field=0;
+               }
                        
 }
 
index d7b4b0c7b8005877b37fa43584534a6dccce4354..f2e94f0facfb4602342d87d45c7161a07ee93764 100644 (file)
@@ -20,9 +20,15 @@ namespace ParaMEDMEM
   ParaSUPPORT::~ParaSUPPORT()
   {
                if (_has_support_ownership)
-                       delete _support;
+                       {
+                               delete _support;
+                               _support=0;
+                       }
     if (_has_mesh_ownership)
-      delete _mesh;
+                       {
+                               delete _mesh;
+                               _mesh=0;
+                       }
   }
 
        const int* ParaSUPPORT::getGlobalNumbering() const
index 77364428e69b5fed4717c4870fe8debe327b3e0b..e74e1a90ba0bcc98d90c4d5db3206b625150b6f6 100644 (file)
@@ -237,13 +237,13 @@ void ParaMEDMEMTest::testIntersectionDEC_2D()
   delete target_group;
   delete self_group;
   delete mesh;
-  delete support;
   delete paramesh;
   delete parafield;
   delete parasupport;
   delete [] value;
   delete icocofield;
+  delete support;
+
   MPI_Barrier(MPI_COMM_WORLD);
   cout << "end of IntersectionDEC_2D test"<<endl;
 }
@@ -500,12 +500,12 @@ void ParaMEDMEMTest::testAsynchronousIntersectionDEC_2D(double dtA, double tmaxA
   delete target_group;
   delete self_group;
   delete mesh ;
-  delete support ;
   delete paramesh ;
   delete parafield ;
   delete parasupport ;
   delete [] value ;
   delete icocofield ;
+  delete support ;
 
   cout << "testAsynchronousIntersectionDEC_2D" << rank << " MPI_Barrier " << endl ;