}
//
_field_per_mesh[0]=MEDFileFieldPerMesh::NewOnRead(fid,this,0,meshnumdt,meshnumit,nasc,mm,entities);
- _nb_of_tuples_to_be_allocated=0;
- _field_per_mesh[0]->loadOnlyStructureOfDataRecursively(fid,_nb_of_tuples_to_be_allocated,nasc);
+ //_nb_of_tuples_to_be_allocated=0;
+ //_field_per_mesh[0]->loadOnlyStructureOfDataRecursively(fid,_nb_of_tuples_to_be_allocated,nasc);
}
void MEDFileAnyTypeField1TSWithoutSDA::loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc)
void MEDFileAnyTypeFieldMultiTSWithoutSDA::loadStructureOrStructureAndBigArraysRecursively(med_idt fid, int nbPdt, med_field_type fieldTyp, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities)
{
_time_steps.resize(nbPdt);
- int nentitype(MEDfieldnEntityType(fid,_name.c_str(),MED_ALL_NUMDT,MED_ALL_NUMDT));
- INTERP_KERNEL::AutoPtr<med_entity_type> types(new med_entity_type[nentitype]);
- med_int usedbyncs;
- MEDFILESAFECALLERRD0(MEDfieldEntityType,(fid,_name.c_str(),MED_ALL_NUMDT,MED_ALL_NUMDT,types,&usedbyncs));
- for(int i=0;i<nentitype;i++)
- {
- int ngeotype(MEDfieldnGeotype(fid,_name.c_str(),MED_ALL_NUMDT,MED_ALL_NUMDT,types[i]));
- INTERP_KERNEL::AutoPtr<med_geometry_type> geotypes(new med_geometry_type[ngeotype]);
- med_int geousedbyncs;
- MEDFILESAFECALLERRD0(MEDfieldGeotype,(fid,_name.c_str(),MED_ALL_NUMDT,MED_ALL_NUMDT,types[i],geotypes,&geousedbyncs));
+ INTERP_KERNEL::AutoCppPtr<MEDFileEntities> entitiesFast;
+ const MEDFileEntities *entitiesForSubInstances(entities);
+ if(!entities)
+ {
+ int nentitype(MEDfieldnEntityType(fid,_name.c_str(),MED_ALL_NUMDT,MED_ALL_NUMDT));
+ INTERP_KERNEL::AutoPtr<med_entity_type> types(new med_entity_type[nentitype]);
+ med_int usedbyncs;
+ MEDFILESAFECALLERRD0(MEDfieldEntityType,(fid,_name.c_str(),MED_ALL_NUMDT,MED_ALL_NUMDT,types,&usedbyncs));
+ std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesFastP;
+ for(int i=0;i<nentitype;i++)
+ {
+ int ngeotype(MEDfieldnGeotype(fid,_name.c_str(),MED_ALL_NUMDT,MED_ALL_NUMDT,types[i]));
+ INTERP_KERNEL::AutoPtr<med_geometry_type> geotypes(new med_geometry_type[ngeotype]);
+ med_int geousedbyncs;
+ MEDFILESAFECALLERRD0(MEDfieldGeotype,(fid,_name.c_str(),MED_ALL_NUMDT,MED_ALL_NUMDT,types[i],geotypes,&geousedbyncs));
+ for(int j=0;j<ngeotype;j++)
+ {
+ std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> p(MEDFileMesh::ConvertFromMEDFileEntity(types[i]),MEDFileJointOneStep::ConvertGeometryType(geotypes[j]));
+ entitiesFastP.push_back(p);
+ }
+ }
+ entitiesFast=new MEDFileStaticEntities(entitiesFastP);
+ entitiesForSubInstances=entitiesFast;
}
for(int i=0;i<nbPdt;i++)
{
throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTSWithoutSDA::loadStructureOrStructureAndBigArraysRecursively : managed field type are : FLOAT64, INT32, FLOAT32 !");
}
if(loadAll)
- _time_steps[i]->loadStructureAndBigArraysRecursively(fid,*this,ms,entities);
+ _time_steps[i]->loadStructureAndBigArraysRecursively(fid,*this,ms,entitiesForSubInstances);
else
- _time_steps[i]->loadOnlyStructureOfDataRecursively(fid,*this,ms,entities);
+ _time_steps[i]->loadOnlyStructureOfDataRecursively(fid,*this,ms,entitiesForSubInstances);
synchronizeNameScope();
}
}
loc_geo_type, rem_ent_type, rem_geo_type, correspondence->getPointer()));
MEDFileJointCorrespondence *cor=MEDFileJointCorrespondence::New();
cor->setIsNodal( loc_ent_type == MED_NODE );
- cor->setLocalGeometryType ( convertGeometryType( loc_geo_type ));
- cor->setRemoteGeometryType( convertGeometryType( rem_geo_type ));
+ cor->setLocalGeometryType ( ConvertGeometryType( loc_geo_type ));
+ cor->setRemoteGeometryType( ConvertGeometryType( rem_geo_type ));
cor->setCorrespondence( correspondence );
_correspondences.push_back(cor);
}
return oss.str();
}
-INTERP_KERNEL::NormalizedCellType MEDFileJointOneStep::convertGeometryType(med_geometry_type geotype)
+INTERP_KERNEL::NormalizedCellType MEDFileJointOneStep::ConvertGeometryType(med_geometry_type geotype)
{
INTERP_KERNEL::NormalizedCellType result=INTERP_KERNEL::NORM_ERROR;
for(int i=0; i<MED_N_CELL_FIXED_GEO; i++)