cz->setName( "Nodal Connect Zone defined by MEDPARTITIONER" );
cz->setLocalDomainNumber ( idomain );
cz->setDistantDomainNumber( idomainNear );
+ czVec.push_back(cz);
}
cz->setNodeCorresp( &corresp[0], corresp.size()/2 );
return _topology;
}
-void MEDPARTITIONER::MeshCollection::setTopology(Topology* topo)
+void MEDPARTITIONER::MeshCollection::setTopology(Topology* topo, bool takeOwneship)
{
if (_topology!=0)
{
throw INTERP_KERNEL::Exception("topology is already set");
}
else
- _topology = topo;
+ {
+ _topology = topo;
+ _owns_topology = takeOwneship;
+ }
}
-/*! Method creating the cell graph in serial mode
- *
- * \param array returns the pointer to the structure that contains the graph
+/*! Method creating the cell graph in serial mode
+ *
+ * \param array returns the pointer to the structure that contains the graph
* \param edgeweight returns the pointer to the table that contains the edgeweights
* (only used if indivisible regions are required)
*/
ParaDomainSelector* getParaDomainSelector() const { return _domain_selector; }
void setParaDomainSelector(ParaDomainSelector* pds) { _domain_selector = pds; }
//setting a new topology
- void setTopology(Topology* topology);
+ void setTopology(Topology* topology, bool takeOwneship);
//getting/setting the name of the global mesh (as opposed
//to the name of a subdomain \a nn, which is name_nn)
(_collection->getCZ()).clear();
ParallelTopology* aPT = new ParallelTopology((_collection->getMesh()));
- _collection->setTopology(aPT);
+ _collection->setTopology(aPT, true);
_collection->setName(meshname);
_collection->setDomainNames(meshname);
return 0;
}
ParallelTopology* aPT = new ParallelTopology(_collection->getMesh());
- _collection->setTopology(aPT);
+ _collection->setTopology(aPT, true);
if ( nbDomains > 0 )
{
_collection->setName( filedata->getMeshes()->getMeshAtPos(0)->getName() );
localInformation.push_back(str+"meshName="+meshname);
MyGlobals::_General_Informations.push_back(SerializeFromVectorOfString(localInformation));
std::vector<std::string> localFields=BrowseAllFieldsOnMesh(file, meshname, idomain);
- if (localFields.size()>0)
+ if (localFields.size()>0)
MyGlobals::_Field_Descriptions.push_back(SerializeFromVectorOfString(localFields));
}
for ( size_t i = 0; i < _collection->getCZ().size(); ++i )
{
ConnectZone* cz = _collection->getCZ()[i];
- if ( !cz ) continue;
+ if ( !cz ||
+ cz->getLocalDomainNumber() != idomain )
+ continue;
+ {
+ std::ostringstream oss;
+ oss << "joint_" << cz->getDistantDomainNumber();
+ cz->setName( oss.str() );
+ }
+ {
+ std::ostringstream oss;
+ oss << "connect_zone_" << i;
+ cz->setDescription( oss.str() );
+ }
MEDCouplingAutoRefCountObjectPtr< MEDFileJoint>
joint = MEDFileJoint::New( cz->getName(), finalMeshName,
if ( nodeCorr )
{
MEDCouplingAutoRefCountObjectPtr< MEDFileJointCorrespondence >
- corr = MEDFileJointCorrespondence::New( nodeCorr->getValueArray() );
+ corr = MEDFileJointCorrespondence::New( nodeCorr->getValueArray() );
j1st->pushCorrespondence( corr );
}
{
const MEDCouplingSkyLineArray * cellCorr =
cz->getEntityCorresp( types[it].first, types[it].second );
- if ( cellCorr )
+ if ( cellCorr && cellCorr->getNumberOf() > 0 )
{
t1 = INTERP_KERNEL::NormalizedCellType( types[it].first );
t2 = INTERP_KERNEL::NormalizedCellType( types[it].second );
if ( (_collection->getMesh())[idomain] && (_collection->getMesh())[idomain]->getNumberOfNodes() > 0 )
_collection->setNonEmptyMesh(idomain);
}
- ParallelTopology* aPT = new ParallelTopology((_collection->getMesh()), cz, cellglobal, nodeglobal, faceglobal);
- _collection->setTopology(aPT);
//creation of topology from mesh and connect zones
+ ParallelTopology* aPT = new ParallelTopology((_collection->getMesh()), cz, cellglobal, nodeglobal, faceglobal);
+ _collection->setTopology(aPT,true);
return 0;
}
//creation of topology from mesh and connect zones
ParallelTopology* aPT = new ParallelTopology((_collection->getMesh()), (_collection->getCZ()), cellglobal, nodeglobal, faceglobal);
- _collection->setTopology(aPT);
+ _collection->setTopology(aPT, true);
for (int i=0; i<nbdomain; i++)
{
//to know nb of cells on each proc to compute global cell ids from locally global
domainSelector->gatherNbOf(_collection->getMesh());
}
- _collection->setTopology(aPT);
+ _collection->setTopology(aPT, true);
_collection->setDomainNames(_collection->getName());
return 0;
}