}
}
+
+ //---------------------------------------------------------------
+ void
+ BuildFieldMap(PMEDMesh theMesh,
+ const MED::TEntityInfo& theEntityInfo,
+ const MED::TMKey2Profile& theMKey2Profile,
+ const MED::TKey2Gauss& theKey2Gauss,
+ MED::PWrapper theMEDWrapper)
+ {
+ TInt aNbFields = theMEDWrapper->GetNbFields();
+ MED::PMeshInfo aMeshInfo = theMesh->myMeshInfo;
+ const std::string& aMeshName = theMesh->myName;
+ INITMSG(MYDEBUG,"BuildFieldMap: aNbFields = "<<aNbFields<<"\n");
+ for(TInt iField = 1; iField <= aNbFields; iField++){
+ MED::PFieldInfo aFieldInfo = theMEDWrapper->GetPFieldInfo(aMeshInfo,iField);
+ TInt aNbComp = aFieldInfo->GetNbComp();
+ std::string aFieldName = aFieldInfo->GetName();
+
+ MED::TGeom2Size aGeom2Size;
+ MED::EEntiteMaillage aMEntity;
+ TInt aNbTimeStamps = theMEDWrapper->GetNbTimeStamps(aFieldInfo,
+ theEntityInfo,
+ aMEntity,
+ aGeom2Size);
+ if(aNbTimeStamps < 1)
+ continue;
+
+ TEntity aVEntity = MEDEntityToVTK(aMEntity);
+ PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[aVEntity];
+ TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+ PMEDField aField = aFieldMap[aFieldName](new TMEDField());
+ aField->myId = iField;
+ aField->myNbComp = aNbComp;
+ aField->myEntity = aVEntity;
+ aField->myName = aFieldName;
+ aField->myMeshName = aMeshName;
+ aField->myDataSize = aMeshOnEntity->myNbCells * aNbComp;
+ aField->myCompNames.resize(aNbComp);
+ aField->myUnitNames.resize(aNbComp);
+
+ INITMSG(MYDEBUG,"myName = '"<<aField->myName<<"'"<<
+ "; myId = "<<aField->myId<<
+ "; myEntity = "<<aField->myEntity<<
+ "; myDataSize = "<<aField->myDataSize<<
+ "; myNbComp = "<<aField->myNbComp<<"\n");
+
+ for(TInt iComp = 0; iComp < aNbComp; iComp++){
+ aField->myCompNames[iComp] = aFieldInfo->GetCompName(iComp);
+ aField->myUnitNames[iComp] = aFieldInfo->GetUnitName(iComp);
+ }
+
+ for(TInt iTimeStamp = 1; iTimeStamp <= aNbTimeStamps; iTimeStamp++){
+ MED::PTimeStampInfo aTimeStampInfo = theMEDWrapper->GetPTimeStampInfo(aFieldInfo,
+ aMEntity,
+ aGeom2Size,
+ iTimeStamp);
+ TFloat aDt = aTimeStampInfo->GetDt();
+ std::string anUnitDt = aTimeStampInfo->GetUnitDt();
+ MED::PTimeStampVal aTimeStampVal = theMEDWrapper->GetPTimeStampVal(aTimeStampInfo,
+ theMKey2Profile,
+ theKey2Gauss);
+ TValField& aValField = aField->myValField;
+ PMEDValForTime aValForTime = aValField[iTimeStamp](new TMEDValForTime());
+ aValForTime->myId = iTimeStamp;
+ aValForTime->myFieldName = aField->myName;
+ aValForTime->myEntity = aField->myEntity;
+ aValForTime->myMeshName = aField->myMeshName;
+ aValForTime->myNbGauss = aTimeStampInfo->GetNbGauss();
+ aValForTime->myTime = VISU::TTime(aDt,anUnitDt);
+ INITMSG(MYDEBUG,"aDt = '"<<aDt<<", "<<anUnitDt<<"'\n");
+
+ InitGaussProfile(aTimeStampVal,
+ aMeshOnEntity,
+ aGeom2Size,
+ aValForTime);
+ }
+ }
+ }
+
}
aNodeInfo,
aMed);
- TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
-
- TInt aNbFields = aMed->GetNbFields();
- BEGMSG(MYDEBUG,"TField: aNbFields = "<<aNbFields<<"\n");
- for(TInt iField = 1; iField <= aNbFields; iField++){
- MED::PFieldInfo aFieldInfo = aMed->GetPFieldInfo(aMeshInfo,iField);
- TInt aNbComp = aFieldInfo->GetNbComp();
- const std::string& aFieldName = aFieldInfo->GetName();
-
- MED::TGeom2Size aGeom2Size;
- MED::EEntiteMaillage aMEntity;
- TInt aNbTimeStamps = aMed->GetNbTimeStamps(aFieldInfo,
- aEntityInfo,
- aMEntity,
- aGeom2Size);
- if(aNbTimeStamps < 1)
- continue;
-
- TEntity aVEntity = MEDEntityToVTK(aMEntity);
- PMEDMeshOnEntity aMeshOnEntity = aMesh->myMeshOnEntityMap[aVEntity];
- TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
- PMEDField aField = aFieldMap[aFieldName](new TMEDField());
- aField->myId = iField;
- aField->myNbComp = aNbComp;
- aField->myEntity = aVEntity;
- aField->myName = aFieldName;
- aField->myMeshName = aMeshName;
- aField->myDataSize = aMeshOnEntity->myNbCells * aNbComp;
- aField->myCompNames.resize(aNbComp);
- aField->myUnitNames.resize(aNbComp);
-
- INITMSG(MYDEBUG,"myName = '"<<aField->myName<<
- "'; myId = "<<aField->myId<<
- "; myEntity = "<<aField->myEntity<<
- "; myDataSize = "<<aField->myDataSize<<
- "; myNbComp = "<<aField->myNbComp<<"\n");
-
- for(TInt iComp = 0; iComp < aNbComp; iComp++){
- aField->myCompNames[iComp] = aFieldInfo->GetCompName(iComp);
- aField->myUnitNames[iComp] = aFieldInfo->GetUnitName(iComp);
- }
-
- for(TInt iTimeStamp = 1; iTimeStamp <= aNbTimeStamps; iTimeStamp++){
- MED::PTimeStampInfo aTimeStampInfo = aMed->GetPTimeStampInfo(aFieldInfo,
- aMEntity,
- aGeom2Size,
- iTimeStamp);
- TFloat aDt = aTimeStampInfo->GetDt();
- const std::string& anUnitDt = aTimeStampInfo->GetUnitDt();
- MED::PTimeStampVal aTimeStampVal = aMed->GetPTimeStampVal(aTimeStampInfo,
- aMKey2Profile,
- aKey2Gauss);
- TValField& aValField = aField->myValField;
- PMEDValForTime aValForTime = aValField[iTimeStamp](new TMEDValForTime());
- aValForTime->myId = iTimeStamp;
- aValForTime->myFieldName = aField->myName;
- aValForTime->myEntity = aField->myEntity;
- aValForTime->myMeshName = aField->myMeshName;
- aValForTime->myNbGauss = aTimeStampInfo->GetNbGauss();
- aValForTime->myTime = VISU::TTime(aDt,anUnitDt);
- INITMSG(MYDEBUG,"aDt = '"<<aDt<<", "<<anUnitDt<<"'\n");
-
- InitGaussProfile(aTimeStampVal,
- aMeshOnEntity,
- aGeom2Size,
- aValForTime);
- }
- }
+ BuildFieldMap(aMesh,
+ aEntityInfo,
+ aMKey2Profile,
+ aKey2Gauss,
+ aMed);
#ifndef _LOAD_FAMILIES_
continue;