mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-18 10:00:33 +05:00
0021208: Performance issue when loading SMESH with an hdf file containing a big mesh
Fix reading nodes from a new HDF file (attempt #2)
This commit is contained in:
parent
c080bab83c
commit
c668696b87
@ -342,23 +342,24 @@ void SMESH_PreMeshInfo::hdf2meshInfo( const std::string& name,
|
||||
HDFdataset* dataset = new HDFdataset( name.c_str(), hdfGroup );
|
||||
dataset->OpenOnDisk();
|
||||
|
||||
// hdf_size datasetSize[ 1 ];
|
||||
// HDFarray *array = new HDFarray(dataset);
|
||||
// array->GetDim( datasetSize );
|
||||
int size = dataset->GetSize();
|
||||
// // hdf_size datasetSize[ 1 ];
|
||||
// // HDFarray *array = new HDFarray(dataset);
|
||||
// // array->GetDim( datasetSize );
|
||||
// int size = dataset->GetSize();
|
||||
|
||||
int info[ SMDSEntity_Last * 2 ];
|
||||
dataset->ReadFromDisk( info );
|
||||
vector<int> info( SMDSEntity_Last * 2, 0 );
|
||||
dataset->ReadFromDisk( &info[0] );
|
||||
dataset->CloseOnDisk();
|
||||
|
||||
const Tmed2smeshElemTypeMap& med2smesh = med2smeshElemTypeMap();
|
||||
Tmed2smeshElemTypeMap::const_iterator me2sme, me2smeEnd = med2smesh.end();
|
||||
for ( int i = 0; i < size /**datasetSize*/; )
|
||||
for ( size_t i = 0; i < info.size(); )
|
||||
{
|
||||
int medType = info[i++];
|
||||
int nbElems = info[i++];
|
||||
if ( !nbElems ) break;
|
||||
me2sme = med2smesh.find( (MED::EGeometrieElement) medType );
|
||||
if ( me2sme != me2smeEnd && nbElems )
|
||||
if ( me2sme != me2smeEnd )
|
||||
setNb( me2sme->second, nbElems );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user