#ifdef _DEBUG_
static int MYDEBUG = 1;
+static int MY_FAMILY_DEBUG = 0;
+static int MY_GROUP_DEBUG = 0;
#else
static int MYDEBUG = 0;
+static int MY_FAMILY_DEBUG = 0;
+static int MY_GROUP_DEBUG = 0;
#endif
const MED::TGeom2Size& theGeom2Size,
const MED::TGeom2Profile& theGeom2Profile)
{
- INITMSG(MYDEBUG,"CrSubProfile()"<<endl);
-
vtkIdType aVGeom = MEDGeomToVTK(theMGeom);
vtkIdType aVNbNodes = VTKGeom2NbNodes(aVGeom);
TGeom2Profile::const_iterator aProfileIter = theGeom2Profile.find(theMGeom);
if(aProfileIter != theGeom2Profile.end()){
PProfileInfo aProfileInfo = aProfileIter->second;
+
aSubProfile->myNbCells = aProfileInfo->myElemNum.size();
aSubProfile->myName = aProfileInfo->GetName();
+ aSubProfile->myProfileInfo = aProfileInfo;
+
aSubProfile->myStatus = eAddPart;
}
}
aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
- INITMSGA(MYDEBUG,0,
- "- aVGeom = "<<aVGeom<<
- "; aName = '"<<aSubProfile->myName<<"'"<<
- "; aStatus = "<<aSubProfile->myStatus<<
- "; aNbCells = "<<aSubProfile->myNbCells<<
- "; aCellsSize = "<<aSubProfile->myCellsSize<<
- endl);
+ INITMSG(MYDEBUG,
+ "- aVGeom = "<<aVGeom<<
+ "; aName = '"<<aSubProfile->myName<<"'"<<
+ "; aStatus = "<<aSubProfile->myStatus<<
+ "; aNbCells = "<<aSubProfile->myNbCells<<
+ "; aCellsSize = "<<aSubProfile->myCellsSize<<
+ endl);
return aSubProfile;
}
TProfileMap::const_iterator anIter = aProfileMap.find(aProfileKey);
if(anIter != aProfileMap.end()){
theValForTime.myProfile = anIter->second;
+ INITMSG(MYDEBUG,"aProfileMap.find(aProfileKey)"<<endl);
}else{
PMEDProfile aProfile(new TMEDProfile());
TGeom2SubProfile& aGeom2SubProfile = aProfile->myGeom2SubProfile;
const MED::TGeom2Size& theGeom2Size,
VISU::TMEDValForTime& theValForTime)
{
+ int MYDEBUG = true;
INITMSG(MYDEBUG,"GetGaussKey"<<endl);
PMEDProfile aProfile = theValForTime.myProfile;
TGaussMeshMap::const_iterator anIter = aGaussMeshMap.find(aGaussKey);
if(anIter != aGaussMeshMap.end()){
theValForTime.myGaussMesh = anIter->second;
+ INITMSG(MYDEBUG,"aGaussMeshMap.find(aGaussKey)"<<endl);
}else{
PMEDGaussMesh aGaussMesh(new TMEDGaussMesh());
TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh;
TElemGroup aElemGroup = GetElemsByEntity(aMed,aMeshInfo,aEntityInfo);
- TFamilyGroup aFamilyGroup = GetFamilies(aMed,aMeshInfo);
-
- TFamilyByEntity aFamilyByEntity = GetFamiliesByEntity(aMed,aElemGroup,aFamilyGroup);
-
- TGroupInfo aGroupInfo = GetFamiliesByGroup(aFamilyGroup);
-
// creating TMesh structure and TMeshOnEntityMap
typedef map<TInt,TInt> TFamilyCounterMap;
TFamilyCounterMap aFamilyNbCellsCounterMap, aFamilyCellsSizeCounterMap;
}
}
+ TInt aNbFields = aMed->GetNbFields();
+ BEGMSG(MYDEBUG,"TField: aNbFields = "<<aNbFields<<"\n");
+ for(TInt iField = 1; iField <= aNbFields; iField++){
+ PFieldInfo aFieldInfo = aMed->GetPFieldInfo(aMeshInfo,iField);
+ TInt aNbComp = aFieldInfo->GetNbComp();
+ const string& aFieldName = aFieldInfo->GetName();
+
+ MED::TGeom2Size aGeom2Size;
+ 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++){
+ PTimeStampInfo aTimeStampInfo = aMed->GetPTimeStampInfo(aFieldInfo,
+ aMEntity,
+ aGeom2Size,
+ iTimeStamp);
+ TFloat aDt = aTimeStampInfo->GetDt();
+ const string& anUnitDt = aTimeStampInfo->GetUnitDt();
+ 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);
+
+ TGaussMap& aGaussMap = aValForTime->myGaussMap;
+ const TGeom2Gauss& aGeom2Gauss = aTimeStampInfo->GetGeom2Gauss();
+ TGeom2Gauss::const_iterator anIter = aGeom2Gauss.begin();
+ for(; anIter != aGeom2Gauss.end(); anIter++){
+ EGeometrieElement aMGeom = anIter->first;
+ PGaussInfo aGaussInfo = anIter->second;
+ PMEDGauss aMEDGauss(new TMEDGauss());
+ aMEDGauss->myGaussInfo = aGaussInfo;
+ aMEDGauss->myNbPoints = aGaussInfo->GetNbGauss();
+ aGaussMap[MEDGeomToVTK(aMGeom)] = aMEDGauss;
+ }
+ }
+ }
+
+ continue;
+
+ TFamilyGroup aFamilyGroup = GetFamilies(aMed,aMeshInfo);
+ TFamilyByEntity aFamilyByEntity = GetFamiliesByEntity(aMed,aElemGroup,aFamilyGroup);
TFamilyByEntity::const_iterator aFamilyByEntityIter = aFamilyByEntity.begin();
- BEGMSG(MYDEBUG,"TFamilyByEntity:\n");
+ BEGMSG(MY_FAMILY_DEBUG,"TFamilyByEntity:\n");
for(; aFamilyByEntityIter != aFamilyByEntity.end(); aFamilyByEntityIter++){
const EEntiteMaillage& aMEntity = aFamilyByEntityIter->first;
const TFamilyGroup& aFamilyGroup = aFamilyByEntityIter->second;
if(aFamilyGroup.empty())
continue;
- INITMSG(MYDEBUG,"aMEntity = "<<aMEntity<<"; aVEntity = "<<aVEntity<<"\n");
+ INITMSG(MY_FAMILY_DEBUG,"aMEntity = "<<aMEntity<<"; aVEntity = "<<aVEntity<<"\n");
TFamilyGroup::const_iterator aFamilyGroupIter = aFamilyGroup.begin();
for(; aFamilyGroupIter != aFamilyGroup.end(); aFamilyGroupIter++){
const PFamilyInfo& aFamilyInfo = *aFamilyGroupIter;
aFamily->myNbCells = aFamilyNbCellsCounterMap[aFamily->myId];
aFamily->myCellsSize = aFamilyCellsSizeCounterMap[aFamily->myId];
- INITMSG(MYDEBUG,"aFamilyName = '"<<aFamily->myName<<
+ INITMSG(MY_FAMILY_DEBUG,"aFamilyName = '"<<aFamily->myName<<
"'; myId = "<<aFamily->myId<<"; "<<
"; aNbAttr = "<<aFamilyInfo->GetNbAttr()<<
"; aNbGroup = "<<aFamilyInfo->GetNbGroup()<<
for(TInt i = 0; i < aNbGroup; i++){
const string& aGroupName = aFamilyInfo->GetGroupName(i);
aBindGroups.insert(aGroupName);
- INITMSG(MYDEBUG,"aGroupName = '"<<aGroupName<<"'\n");
+ INITMSG(MY_FAMILY_DEBUG,"aGroupName = '"<<aGroupName<<"'\n");
}
}
}
- BEGMSG(MYDEBUG,"TGroup:\n");
-
+ BEGMSG(MY_GROUP_DEBUG,"TGroup:\n");
VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
+ TGroupInfo aGroupInfo = GetFamiliesByGroup(aFamilyGroup);
TGroupInfo::const_iterator aGroupInfoIter = aGroupInfo.begin();
for(;aGroupInfoIter != aGroupInfo.end(); aGroupInfoIter++){
const string& aGroupName = aGroupInfoIter->first;
aGroup->myName = aGroupName;
aGroup->myMeshName = aMesh->myName;
- INITMSG(MYDEBUG,"aGroup->myName = '"<<aGroup->myName<<"'\n");
+ INITMSG(MY_GROUP_DEBUG,"aGroup->myName = '"<<aGroup->myName<<"'\n");
TFamilyGroup::const_iterator aFamilyIter = aFamilyGroup.begin();
for(; aFamilyIter != aFamilyGroup.end(); aFamilyIter++){
exit_lable:
if(aFamily && aVEntity >= 0){
aGroup->myFamilyAndEntitySet.insert(TFamilyAndEntity(aFamilyName,aVEntity));
- INITMSG(MYDEBUG,"aFamilyName = '"<<aFamilyName<<"'; '"<<aFamily->myName<<"'; aVEntity = "<<aVEntity<<"\n");
+ INITMSG(MY_GROUP_DEBUG,
+ "aFamilyName = '"<<aFamilyName<<"'"<<
+ "; '"<<aFamily->myName<<"'"<<
+ "; aVEntity = "<<aVEntity<<
+ "\n");
aGroup->myNbCells += aFamily->myNbCells;
aGroup->myCellsSize += aFamily->myCellsSize;
}
}
if(!aGroup->myFamilyAndEntitySet.empty() && aGroup->myNbCells > 0){
- BEGMSG(MYDEBUG,"myNbCells = "<<aGroup->myNbCells<<
- "; myCellsSize = "<<aGroup->myCellsSize<<"\n");
+ BEGMSG(MY_GROUP_DEBUG,
+ "myNbCells = "<<aGroup->myNbCells<<
+ "; myCellsSize = "<<aGroup->myCellsSize<<
+ "\n");
aGroupMap.insert(VISU::TGroupMap::value_type(aGroupName,aGroup));
}
}
- TInt aNbFields = aMed->GetNbFields();
- BEGMSG(MYDEBUG,"TField: aNbFields = "<<aNbFields<<"\n");
- for(TInt iField = 1; iField <= aNbFields; iField++){
- PFieldInfo aFieldInfo = aMed->GetPFieldInfo(aMeshInfo,iField);
- TInt aNbComp = aFieldInfo->GetNbComp();
- const string& aFieldName = aFieldInfo->GetName();
-
- MED::TGeom2Size aGeom2Size;
- 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++){
- PTimeStampInfo aTimeStampInfo = aMed->GetPTimeStampInfo(aFieldInfo,
- aMEntity,
- aGeom2Size,
- iTimeStamp);
- TFloat aDt = aTimeStampInfo->GetDt();
- const string& anUnitDt = aTimeStampInfo->GetUnitDt();
- 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);
-
- TGaussMap& aGaussMap = aValForTime->myGaussMap;
- const TGeom2Gauss& aGeom2Gauss = aTimeStampInfo->GetGeom2Gauss();
- TGeom2Gauss::const_iterator anIter = aGeom2Gauss.begin();
- for(; anIter != aGeom2Gauss.end(); anIter++){
- EGeometrieElement aMGeom = anIter->first;
- PGaussInfo aGaussInfo = anIter->second;
- PMEDGauss aMEDGauss(new TMEDGauss());
- aMEDGauss->myGaussInfo = aGaussInfo;
- aMEDGauss->myNbPoints = aGaussInfo->GetNbGauss();
- aGaussMap[MEDGeomToVTK(aMGeom)] = aMEDGauss;
- }
- }
- }
} catch(std::exception& exc){
MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
} catch(...){
TGeom2SubProfile::const_iterator anIter2 = aGeom2SubProfile.find(aVGeom);
if(anIter2 != aGeom2SubProfile.end()){
PMEDSubProfile aSubProfile = anIter2->second;
- aSubProfile->mySubMeshID = aProfileInfo->myElemNum;
+
+ MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
+ if(!anElemNum.empty()){
+ TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID;
+ TInt aSize = anElemNum.size();
+ aSubMeshID.resize(aSize);
+ for(TInt anId = 0; anId < aSize; anId++)
+ aSubMeshID[anId] = anElemNum[anId] - 1;
+ }
INITMSG(MYDEBUG,
"- aVGeom = "<<aVGeom<<
VISU::TMEDValForTime& theValForTime,
VISU::TMEDMeshOnEntity& theMeshOnEntity)
{
+ int MYDEBUG = true;
INITMSG(MYDEBUG,"LoadGaussMesh"<<endl);
PMEDGaussMesh aGaussMesh = theValForTime.myGaussMesh;
aMEntity,
aMGeom);
- PMEDSubProfile aSubProfile = aGaussSubMesh->mySubProfile;
- TElemNum anElemNum = aSubProfile->mySubMeshID;
-
MED::TGaussCoord aGaussCoord;
- MED::GetGaussCoord3D(aGaussInfo,
- aCellInfo,
- aNodeInfo,
- aGaussCoord,
- anElemNum);
- TPoints& aPoints = aGaussSubMesh->myPoints;
+ PMEDSubProfile aSubProfile = aGaussSubMesh->mySubProfile;
+ const TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID;
+
+ if(!aSubMeshID.empty()){
+ MED::PProfileInfo aProfileInfo = aSubProfile->myProfileInfo;
+ const MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
+ MED::GetGaussCoord3D(aGaussInfo,
+ aCellInfo,
+ aNodeInfo,
+ aGaussCoord,
+ anElemNum);
+ }else
+ MED::GetGaussCoord3D(aGaussInfo,
+ aCellInfo,
+ aNodeInfo,
+ aGaussCoord);
+
+ TInt aSize = aGaussCoord.size();
+ if(aSize){
+ TPoints& aPoints = aGaussSubMesh->myPoints;
+ }
INITMSG(MYDEBUG,
"- aVGeom = "<<aVGeom<<