+ std::cout << "proc " << MyGlobals::_Rank << " : nbCells in new domain " << idomain << " : " << _nb_cells[idomain] << std::endl;
+
+ // JOINTs
+
+ if ( MyGlobals::_Create_Joints && nb_domain > 1 )
+ {
+ std::vector< std::vector< std::vector< int > > > cellCorresp( nb_domain );
+ for ( int idomain = 0; idomain < nb_domain; ++idomain )
+ {
+ cellCorresp[ idomain ].resize( nb_domain );
+ }
+ const MEDCoupling::MEDCouplingSkyLineArray* skylinegraph = graph->getGraph();
+ const int* index = skylinegraph->getIndex();
+ const int* value = skylinegraph->getValue();
+ const int nbCells = skylinegraph->getNumberOf();
+
+ for ( int iGlob = 0; iGlob < nbCells; ++iGlob )
+ {
+ int iGlobDom = part[ iGlob ];
+ for ( int i = index[ iGlob ]; i < index[ iGlob+1 ]; i++ )
+ {
+ int iGlobNear = value[ i ];
+ if ( iGlob > iGlobNear )
+ continue; // treat ( iGlob, iGlobNear ) pair once
+ int iGlobNearDom = part[ iGlobNear ];
+ if ( iGlobDom != iGlobNearDom )
+ {
+ int iLoc = convertGlobalCell( iGlob ).second - 1; // to MEDCoupling fmt
+ int iLocNear = convertGlobalCell( iGlobNear ).second - 1;
+ cellCorresp[ iGlobDom ][ iGlobNearDom ].push_back( iLoc );
+ cellCorresp[ iGlobDom ][ iGlobNearDom ].push_back( iLocNear );
+ cellCorresp[ iGlobNearDom ][ iGlobDom ].push_back( iLocNear );
+ cellCorresp[ iGlobNearDom ][ iGlobDom ].push_back( iLoc );
+ }
+ }
+ }
+ for ( int idomain = 0; idomain < nb_domain; ++idomain )
+ {
+ for ( int idomainNear = 0; idomainNear < nb_domain; ++idomainNear )
+ {
+ std::vector< int > & corresp = cellCorresp[ idomain ][ idomainNear ];
+ if ( corresp.empty() )
+ continue;
+ MEDPARTITIONER::ConnectZone* cz = new MEDPARTITIONER::ConnectZone();
+ cz->setName( "Connect Zone defined by MEDPARTITIONER" );
+ cz->setDistantDomainNumber( idomainNear );
+ cz->setLocalDomainNumber ( idomain );
+ cz->setEntityCorresp( 0,0, &corresp[0], corresp.size()/2 );
+ _connect_zones.push_back( cz );
+ }
+ }
+ }