From 19126a960052c9b5cb72b36ae409bf727bc9f476 Mon Sep 17 00:00:00 2001 From: vbd Date: Fri, 4 Jul 2008 10:16:18 +0000 Subject: [PATCH] taking into account bug corrections provided by the OVAP/OVAP coupling case --- src/ParaMEDMEM/BlockTopology.cxx | 4 +-- src/ParaMEDMEM/ElementLocator.cxx | 3 +-- src/ParaMEDMEM/ICoCoMEDField.cxx | 2 ++ src/ParaMEDMEM/InterpolationMatrix.cxx | 25 ++++++++++--------- src/ParaMEDMEM/IntersectionDEC.cxx | 2 +- src/ParaMEDMEM/IntersectionDEC.hxx | 2 +- src/ParaMEDMEM/ParaFIELD.cxx | 10 +++++++- src/ParaMEDMEM/ParaSUPPORT.cxx | 10 ++++++-- .../Test/ParaMEDMEMTest_IntersectionDEC.cxx | 6 ++--- 9 files changed, 40 insertions(+), 24 deletions(-) diff --git a/src/ParaMEDMEM/BlockTopology.cxx b/src/ParaMEDMEM/BlockTopology.cxx index 39e394ecd..ee64e3c2e 100644 --- a/src/ParaMEDMEM/BlockTopology.cxx +++ b/src/ParaMEDMEM/BlockTopology.cxx @@ -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 "< 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()), diff --git a/src/ParaMEDMEM/ICoCoMEDField.cxx b/src/ParaMEDMEM/ICoCoMEDField.cxx index 9bf265300..ba312811b 100644 --- a/src/ParaMEDMEM/ICoCoMEDField.cxx +++ b/src/ParaMEDMEM/ICoCoMEDField.cxx @@ -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; diff --git a/src/ParaMEDMEM/InterpolationMatrix.cxx b/src/ParaMEDMEM/InterpolationMatrix.cxx index 693ac59f6..6a55b6abc 100644 --- a/src/ParaMEDMEM/InterpolationMatrix.cxx +++ b/src/ParaMEDMEM/InterpolationMatrix.cxx @@ -259,31 +259,32 @@ On the idle side, no computation is done, but the field is sent. */ void InterpolationMatrix::transposeMultiply(MEDMEM::FIELD& field) const { - vector source_value(_col_offsets.size()* field.getNumberOfComponents(),0.0); + int nbcomp = field.getNumberOfComponents(); + vector 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 target_value(nbrows,0.0); + vector target_value(nbrows*nbcomp,0.0); //performing WT.T //WT is W transpose //T is the target vector for (int irow=0; irowgetSupport()->getMesh(); - cout <<"size of Interpolation Matrix"<setAllToAllMethod(_allToAllMethod); _interpolation_matrix->getAccessDEC()->Asynchronous( _asynchronous ) ; diff --git a/src/ParaMEDMEM/IntersectionDEC.hxx b/src/ParaMEDMEM/IntersectionDEC.hxx index f40d47e40..5133c9e94 100644 --- a/src/ParaMEDMEM/IntersectionDEC.hxx +++ b/src/ParaMEDMEM/IntersectionDEC.hxx @@ -3,7 +3,7 @@ #include "MEDMEM_OptionManager.hxx" #include "MPI_AccessDEC.hxx" - +#include "MxN_Mapping.hxx" namespace ParaMEDMEM { class DEC; diff --git a/src/ParaMEDMEM/ParaFIELD.cxx b/src/ParaMEDMEM/ParaFIELD.cxx index 3ed0d3a75..6f38cc433 100644 --- a/src/ParaMEDMEM/ParaFIELD.cxx +++ b/src/ParaMEDMEM/ParaFIELD.cxx @@ -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; + } } diff --git a/src/ParaMEDMEM/ParaSUPPORT.cxx b/src/ParaMEDMEM/ParaSUPPORT.cxx index d7b4b0c7b..f2e94f0fa 100644 --- a/src/ParaMEDMEM/ParaSUPPORT.cxx +++ b/src/ParaMEDMEM/ParaSUPPORT.cxx @@ -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 diff --git a/src/ParaMEDMEM/Test/ParaMEDMEMTest_IntersectionDEC.cxx b/src/ParaMEDMEM/Test/ParaMEDMEMTest_IntersectionDEC.cxx index 77364428e..e74e1a90b 100644 --- a/src/ParaMEDMEM/Test/ParaMEDMEMTest_IntersectionDEC.cxx +++ b/src/ParaMEDMEM/Test/ParaMEDMEMTest_IntersectionDEC.cxx @@ -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"<