Salome HOME
MEDCoupling1SGTUMesh::sortHexa8EachOther
[tools/medcoupling.git] / src / ParaMEDMEM / StructuredCoincidentDEC.cxx
index 6beb34df6dbfded511bf3ada0283a84239f2e763..3ce8b008bd00256888a9320a670e3ba5ab01ca35 100644 (file)
@@ -1,21 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2013  CEA/DEN, EDF R&D
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include <mpi.h>
 #include "CommInterface.hxx"
 #include "Topology.hxx"
@@ -42,22 +43,22 @@ namespace ParaMEDMEM
     the computation is much faster than the other. It can also be used 
     to couple together codes that share an interface that was generated
     in the same manner (with identical global ids). 
-    Also, this DEC can be used for fields that have component topologies, 
+    Also, this \ref dec can be used for fields that have component topologies, 
     i.e., components that are scattered over several processors.
 
     The remapping between the two supports is based on identity of global
     ids, instead of geometrical considerations as it is the case for
-    NonCoincidentDEC and IntersectionDEC. Therefore, this DEC must not be used 
+    \ref NonCoincidentDEC and \ref InterpKernelDEC. Therefore, this \ref dec must not be used 
     for coincident meshes that do not have the same numbering.
 
     As all the other DECs, its use is made of two phases :
-    - a setup phase during whih the topologies are exchanged so that
+    - a setup phase during which the topologies are exchanged so that
     the target side knows from which processors it should expect 
     the data.
     - a send/recv phase during which the field data is actually transferred.
 
     This example illustrates the sending of a field with 
-    the DEC : 
+    the \c StructuredCoincidentDEC : 
     \code
     ...
     StructuredCoincidentDEC dec(groupA, groupB);
@@ -79,21 +80,21 @@ namespace ParaMEDMEM
 
 
   StructuredCoincidentDEC::StructuredCoincidentDEC():_topo_source(0),_topo_target(0),
-                                                     _recv_buffer(0),_send_buffer(0),
-                                                     _recv_counts(0),_send_counts(0),
-                                                     _recv_displs(0),_send_displs(0)
+                                                     _send_counts(0),_recv_counts(0),
+                                                     _send_displs(0),_recv_displs(0),
+                                                     _recv_buffer(0),_send_buffer(0)
   {  
   }
 
 
   StructuredCoincidentDEC::~StructuredCoincidentDEC()
   {
-    delete[] _send_buffer;
-    delete[] _recv_buffer;
-    delete[]_send_displs;
-    delete[] _recv_displs;
-    delete[] _send_counts;
-    delete[] _recv_counts;
+    delete [] _send_buffer;
+    delete [] _recv_buffer;
+    delete []_send_displs;
+    delete [] _recv_displs;
+    delete [] _send_counts;
+    delete [] _recv_counts;
     if (! _source_group->containsMyRank())
       delete _topo_source;
     if(!_target_group->containsMyRank())
@@ -104,7 +105,11 @@ namespace ParaMEDMEM
     \addtogroup structuredcoincidentdec
     @{
   */
-  StructuredCoincidentDEC::StructuredCoincidentDEC(ProcessorGroup& local_group, ProcessorGroup& distant_group):DEC(local_group,distant_group),_topo_source(0),_topo_target(0),_recv_buffer(0),_send_buffer(0)
+  StructuredCoincidentDEC::StructuredCoincidentDEC(ProcessorGroup& local_group, ProcessorGroup& distant_group):DisjointDEC(local_group,distant_group),
+                                                                                                               _topo_source(0),_topo_target(0),
+                                                                                                               _send_counts(0),_recv_counts(0),
+                                                                                                               _send_displs(0),_recv_displs(0),
+                                                                                                               _recv_buffer(0),_send_buffer(0)
   {
   }
 
@@ -209,7 +214,7 @@ namespace ParaMEDMEM
   }
 
   /*!
-   *  Creates the _buffers for receiving the fields on the target side
+   *  Creates the buffers for receiving the fields on the target side
    */
   void StructuredCoincidentDEC::prepareTargetDE()
   {