//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
using namespace MED_RENUMBER;
int main(int argc, char** argv)
{
double t_begin,t_read_st,t_compute_graph,t_family,t_field;
using namespace MED_RENUMBER;
int main(int argc, char** argv)
{
double t_begin,t_read_st,t_compute_graph,t_family,t_field;
MEDFileMesh *m=fd->getMeshes()->getMeshWithName(meshname);
MEDFileUMesh *mc=dynamic_cast<MEDFileUMesh *>(m);
if(!mc)
MEDFileMesh *m=fd->getMeshes()->getMeshWithName(meshname);
MEDFileUMesh *mc=dynamic_cast<MEDFileUMesh *>(m);
if(!mc)
std::ostringstream oss; oss << "In file \"" << filename_in << "\" the mesh name \"" << meshname<< "\" exists but is not unstructured !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
std::ostringstream oss; oss << "In file \"" << filename_in << "\" the mesh name \"" << meshname<< "\" exists but is not unstructured !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> workMesh=mc->getMeshAtLevel(0);
- std::vector<int> code=workMesh->getDistributionOfTypes();
+ MCAuto<MEDCouplingUMesh> workMesh=mc->getMeshAtLevel(0);
+ //std::vector<mcIdType> code=workMesh->getDistributionOfTypes();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> neighbSafe(neighb),neighbISafe(neighbI),ipermSafe,permSafe;
- const int *graph=neighbSafe->begin();
- const int *graph_index=neighbISafe->begin();
+ MCAuto<DataArrayIdType> neighbSafe(neighb),neighbISafe(neighbI),ipermSafe,permSafe;
+ const mcIdType *graph=neighbSafe->begin();
+ const mcIdType *graph_index=neighbISafe->begin();
Renumbering *renumb=RenumberingFactory(type_renum);
renumb->renumber(graph,graph_index,workMesh->getNumberOfCells(),iperm,perm);
ipermSafe=iperm; permSafe=perm;
delete renumb;
ipermSafe=0;//erase new2old, we are using only old 2 new
Renumbering *renumb=RenumberingFactory(type_renum);
renumb->renumber(graph,graph_index,workMesh->getNumberOfCells(),iperm,perm);
ipermSafe=iperm; permSafe=perm;
delete renumb;
ipermSafe=0;//erase new2old, we are using only old 2 new
cout << " : " << (t_compute_graph-t_read_st)/(double) CLOCKS_PER_SEC << "s" << endl;
cout.flush();
// Connectivity
cout << "Reordering connectivity & families and writing : " << flush;
workMesh->renumberCells(perm->begin(),false);
mc->setMeshAtLevel(0,workMesh);
cout << " : " << (t_compute_graph-t_read_st)/(double) CLOCKS_PER_SEC << "s" << endl;
cout.flush();
// Connectivity
cout << "Reordering connectivity & families and writing : " << flush;
workMesh->renumberCells(perm->begin(),false);
mc->setMeshAtLevel(0,workMesh);
mc->setFamilyFieldArr(0,famField2);
}
mc->write(filename_out,2);
mc->setFamilyFieldArr(0,famField2);
}
mc->write(filename_out,2);
cout << " : " << (t_family-t_compute_graph)/(double) CLOCKS_PER_SEC << "s" << endl << flush;
// Fields
cout << "Reordering fields and writing : " << flush;
cout << " : " << (t_family-t_compute_graph)/(double) CLOCKS_PER_SEC << "s" << endl << flush;
// Fields
cout << "Reordering fields and writing : " << flush;
fs->write(filename_out,0);
//fs->renumberEntitiesLyingOnMesh(meshname,code,code,o2n); bugged
}
fs->write(filename_out,0);
//fs->renumberEntitiesLyingOnMesh(meshname,code,code,o2n); bugged
}