1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // File : MEDSPLITTER_JointExchangeData.hxx
20 // Created : Wed Jul 22 15:29:44 2009
21 // Author : Edward AGAPOV (eap)
24 #ifndef __MEDSPLITTER_JointExchangeData_HXX__
25 #define __MEDSPLITTER_JointExchangeData_HXX__
27 #include "MEDSPLITTER_Topology.hxx"
36 class MEDSKYLINEARRAY;
42 * \brief Class storing data of the joint between domains residing different procs.
43 * It also provides services to pack/unpack data to be exchanged between proc and
44 * it creates MEDMEM::CONNECTZONE after data exchange.
46 class JointExchangeData
52 // Store cell/cell pair of joint between domains (residing different procs by default)
53 void addCellCorrespondence(const MEDMEM::MESH* mesh_here,
54 int domain_dist, int domain_here,
55 int glob_dist, int glob_here,
56 int loc_here, int loc_dist = -1 );
58 // Return nb of cell pairs
59 int nbCellPairs() const { return _glob_to_locs_here_and_dist.size(); }
61 // Stores meshes and corresponding domain ids
62 void setMeshes( int domain_dist, const MEDMEM::MESH* mesh_dist,
63 int domain_here, const MEDMEM::MESH* mesh_here);
65 // Stores local and global connectivity of joint cells on this proc
66 void setConnectivity( const int* glob_fused_nodes);
68 int distantDomain() const { return _dist_domain; }
69 int localDomain() const { return _loc_domain; }
72 int serialize (std::vector<int> & out_data) const;
73 void deserialize(const std::vector<int> & in_data);
75 //!< Set starting global id for sub-entitis of joint to create
76 void setFisrtGlobalIdOfSubentity(int id) { _first_glob_sub_id = id; }
78 // Create MEDSKYLINEARRAY describing cell/cell correspondencies of the joint
79 MEDMEM::MEDSKYLINEARRAY* makeCellCorrespArray() const;
81 // Creates CONNECTZONE
82 MEDMEM::CONNECTZONE* makeConnectZone(TGeom2FacesByDomian& face_map);
86 // map global cell id on of procs to pair of local cell ids: here and distant
87 typedef std::multimap<int, std::pair< int, int > > TGlob2LocsHD;
88 TGlob2LocsHD _glob_to_locs_here_and_dist;
90 int _dist_domain, _loc_domain, _conn_here_size, _nb_cell_pairs, _first_glob_sub_id;
92 const MEDMEM::MESH* _dist_mesh;
93 const MEDMEM::MESH* _loc_mesh;
95 std::vector<int> _global_conn_here, _global_conn_dist;
96 std::vector<int> _local_conn_here, _local_conn_dist;