From: eap Date: Tue, 26 Jan 2010 07:37:01 +0000 (+0000) Subject: 0020643: Wrong behavior with a structured field X-Git-Tag: V5_1_3_patch02~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7b390998de2f2453723b326cc277fe94be0af86e;p=modules%2Fvisu.git 0020643: Wrong behavior with a structured field * Support fields on sub-cells of a structured mesh --- diff --git a/src/CONVERTOR/VISU_MedConvertor.cxx b/src/CONVERTOR/VISU_MedConvertor.cxx index 4beb4133..457fde69 100644 --- a/src/CONVERTOR/VISU_MedConvertor.cxx +++ b/src/CONVERTOR/VISU_MedConvertor.cxx @@ -186,11 +186,11 @@ namespace //--------------------------------------------------------------- VISU::PMEDSubProfile CrSubProfile(const MED::PWrapper& theMEDWrapper, - const MED::PMeshInfo& theMeshInfo, - MED::EEntiteMaillage theMEntity, - MED::EGeometrieElement theMGeom, - const MED::TGeom2Size& theGeom2Size, - const MED::TGeom2Profile& theGeom2Profile) + const MED::PMeshInfo& theMeshInfo, + MED::EEntiteMaillage theMEntity, + MED::EGeometrieElement theMGeom, + const MED::TGeom2Size& theGeom2Size, + const MED::TGeom2Profile& theGeom2Profile) { VISU::EGeometry aEGeom = MEDGeom2VISU(theMGeom); vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom); @@ -206,87 +206,87 @@ namespace else{ MED::TGeom2Profile::const_iterator aProfileIter = theGeom2Profile.find(theMGeom); if(aProfileIter != theGeom2Profile.end()){ - MED::PProfileInfo aProfileInfo = aProfileIter->second; - - aSubProfile->myName = aProfileInfo->GetName(); - aSubProfile->myStatus = VISU::eAddPart; - - const MED::TElemNum& anElemNum = aProfileInfo->myElemNum; - TInt aNbElem = anElemNum.size(); - aSubProfile->myNbCells = aNbElem; - switch(theMGeom){ - case MED::ePOLYGONE: { - MED::PPolygoneInfo aPolygoneInfo = - theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom); - for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){ - TInt aNbConn = aPolygoneInfo->GetNbConn( anElemNum[ anElemId ] - 1 ); - aSubProfile->myCellsSize += aNbConn; - } - break; - } - case MED::ePOLYEDRE: { - MED::PPolyedreInfo aPolyedreInfo = - theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom); - for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){ - MED::TCConnSliceArr aConnSliceArr = - aPolyedreInfo->GetConnSliceArr( anElemNum[ anElemId ] - 1 ); - TInt aNbFaces = aConnSliceArr.size(); - TInt aCellSize = 0; - for(TInt iFace = 0; iFace < aNbFaces; iFace++){ - MED::TCConnSlice aConnSlice = aConnSliceArr[iFace]; - TInt aNbConn = aConnSlice.size(); - aCellSize += aNbConn; - } - aSubProfile->myCellsSize += aCellSize; - } - break; - } - default: { - aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes; - }} + MED::PProfileInfo aProfileInfo = aProfileIter->second; + + aSubProfile->myName = aProfileInfo->GetName(); + aSubProfile->myStatus = VISU::eAddPart; + + const MED::TElemNum& anElemNum = aProfileInfo->myElemNum; + TInt aNbElem = anElemNum.size(); + aSubProfile->myNbCells = aNbElem; + switch(theMGeom){ + case MED::ePOLYGONE: { + MED::PPolygoneInfo aPolygoneInfo = + theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom); + for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){ + TInt aNbConn = aPolygoneInfo->GetNbConn( anElemNum[ anElemId ] - 1 ); + aSubProfile->myCellsSize += aNbConn; + } + break; + } + case MED::ePOLYEDRE: { + MED::PPolyedreInfo aPolyedreInfo = + theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom); + for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){ + MED::TCConnSliceArr aConnSliceArr = + aPolyedreInfo->GetConnSliceArr( anElemNum[ anElemId ] - 1 ); + TInt aNbFaces = aConnSliceArr.size(); + TInt aCellSize = 0; + for(TInt iFace = 0; iFace < aNbFaces; iFace++){ + MED::TCConnSlice aConnSlice = aConnSliceArr[iFace]; + TInt aNbConn = aConnSlice.size(); + aCellSize += aNbConn; + } + aSubProfile->myCellsSize += aCellSize; + } + break; + } + default: { + aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes; + }} }else{ - TInt aNbElem = aTimeStampIter->second; - aSubProfile->myNbCells = aNbElem; - switch(theMGeom){ - case MED::ePOLYGONE: { - MED::PPolygoneInfo aPolygoneInfo = - theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom); - for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){ - TInt aNbConn = aPolygoneInfo->GetNbConn(anElemId); - aSubProfile->myCellsSize += aNbConn; - } - break; - } - case MED::ePOLYEDRE: { - MED::PPolyedreInfo aPolyedreInfo = - theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom); - for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){ - MED::TCConnSliceArr aConnSliceArr = - aPolyedreInfo->GetConnSliceArr(anElemId); - TInt aNbFaces = aConnSliceArr.size(); - TInt aCellSize = 0; - for(TInt iFace = 0; iFace < aNbFaces; iFace++){ - MED::TCConnSlice aConnSlice = aConnSliceArr[iFace]; - TInt aNbConn = aConnSlice.size(); - aCellSize += aNbConn; - } - aSubProfile->myCellsSize += aCellSize; - } - break; - } - default: { - aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes; - }} + TInt aNbElem = aTimeStampIter->second; + aSubProfile->myNbCells = aNbElem; + switch(theMGeom){ + case MED::ePOLYGONE: { + MED::PPolygoneInfo aPolygoneInfo = + theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom); + for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){ + TInt aNbConn = aPolygoneInfo->GetNbConn(anElemId); + aSubProfile->myCellsSize += aNbConn; + } + break; + } + case MED::ePOLYEDRE: { + MED::PPolyedreInfo aPolyedreInfo = + theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom); + for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){ + MED::TCConnSliceArr aConnSliceArr = + aPolyedreInfo->GetConnSliceArr(anElemId); + TInt aNbFaces = aConnSliceArr.size(); + TInt aCellSize = 0; + for(TInt iFace = 0; iFace < aNbFaces; iFace++){ + MED::TCConnSlice aConnSlice = aConnSliceArr[iFace]; + TInt aNbConn = aConnSlice.size(); + aCellSize += aNbConn; + } + aSubProfile->myCellsSize += aCellSize; + } + break; + } + default: { + aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes; + }} } } INITMSG(MYDEBUG, - "- aMGeom = "<first; VISU::PSubProfile aSubProfile = CrSubProfile(theMEDWrapper, - theMeshInfo, - theMEntity, - aMGeom, - theGeom2Size, - aGeom2Profile); + theMeshInfo, + theMEntity, + aMGeom, + theGeom2Size, + aGeom2Profile); aProfileKey.insert(aSubProfile); } @@ -326,12 +326,12 @@ namespace //--------------------------------------------------------------- void InitProfile(const MED::PWrapper& theMEDWrapper, - const MED::PMeshInfo& theMeshInfo, - MED::PTimeStampValueBase& theTimeStampValue, - VISU::TMEDMeshOnEntity& theMeshOnEntity, - MED::EEntiteMaillage theMEntity, - const MED::TGeom2Size& theGeom2Size, - VISU::TMEDValForTime& theValForTime) + const MED::PMeshInfo& theMeshInfo, + MED::PTimeStampValueBase& theTimeStampValue, + VISU::TMEDMeshOnEntity& theMeshOnEntity, + MED::EEntiteMaillage theMEntity, + const MED::TGeom2Size& theGeom2Size, + VISU::TMEDValForTime& theValForTime) { VISU::TTimerLog aTimerLog(MYDEBUG,"InitProfile"); INITMSG(MYDEBUG,"InitProfile"<myIsAll && aSubProfile->myStatus != VISU::eAddAll) - aProfile->myIsAll = false; + if(aProfile->myIsAll && aSubProfile->myStatus != VISU::eAddAll) + aProfile->myIsAll = false; - VISU::EGeometry aEGeom = aSubProfile->myGeom; - aGeom2SubProfile[aEGeom] = aSubProfile; + VISU::EGeometry aEGeom = aSubProfile->myGeom; + aGeom2SubProfile[aEGeom] = aSubProfile; } aProfileMap[aProfileKey] = aProfile; @@ -373,9 +373,9 @@ namespace //--------------------------------------------------------------- VISU::TGaussKey GetGaussKey(const MED::PTimeStampValueBase& theTimeStampValue, - const VISU::TMEDMeshOnEntity& theMeshOnEntity, - const MED::TGeom2Size& theGeom2Size, - VISU::TMEDValForTime& theValForTime) + const VISU::TMEDMeshOnEntity& theMeshOnEntity, + const MED::TGeom2Size& theGeom2Size, + VISU::TMEDValForTime& theValForTime) { VISU::TTimerLog aTimerLog(MYDEBUG,"GetGaussKey"); INITMSG(MYDEBUG,"GetGaussKey"<second; MED::TGeom2Size::const_iterator aTimeStampIter = theGeom2Size.find(aMGeom); if(aTimeStampIter != theGeom2Size.end()){ - TInt aNbCells = aTimeStampIter->second; - if(aSubProfile->myStatus == VISU::eAddPart) - aNbCells = aSubProfile->myNbCells; - - VISU::PMEDGaussSubMesh aGaussSubMesh(new VISU::TMEDGaussSubMesh()); - aGaussSubMesh->mySubProfile = aSubProfile; - aGaussSubMesh->myStatus = aSubProfile->myStatus; - - VISU::PMEDGauss aGauss(new VISU::TMEDGauss()); - aGaussSubMesh->myGauss = aGauss; - aGauss->myGeom = aEGeom; - aGauss->myNbPoints = 1; - - MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom); - if(aGaussIter != aGeom2Gauss.end()){ - MED::PGaussInfo aGaussInfo = aGaussIter->second; - aGauss->myGaussInfo = aGaussInfo; - aGauss->myName = aGaussInfo->GetName(); - aGauss->myNbPoints = aGaussInfo->GetNbGauss(); - } else if ( aTimeStampInfo.GetNbGauss(aMGeom) > 1 ) - EXCEPTION( std::runtime_error, "aGaussIter == aGeom2Gauss.end()" - " && aTimeStampInfo.GetNbGauss(aMGeom) > 1 !!!" ); - - aGaussSubMesh->myNbCells = aNbCells*aGauss->myNbPoints; - aGaussSubMesh->myCellsSize = aGaussSubMesh->myNbCells*2; - - aGaussKey.insert(aGaussSubMesh); - - INITMSGA(MYDEBUG,0, - "- aEGeom = "<myGeom<< - "; aName = '"<myName<<"'"<< - "; aNbGauss = "<myNbPoints<< - "; aStatus = "<myStatus<< - "; aNbCells = "<myNbCells<< - "; aCellsSize = "<myCellsSize<< - endl); - - //break; + TInt aNbCells = aTimeStampIter->second; + if(aSubProfile->myStatus == VISU::eAddPart) + aNbCells = aSubProfile->myNbCells; + + VISU::PMEDGaussSubMesh aGaussSubMesh(new VISU::TMEDGaussSubMesh()); + aGaussSubMesh->mySubProfile = aSubProfile; + aGaussSubMesh->myStatus = aSubProfile->myStatus; + + VISU::PMEDGauss aGauss(new VISU::TMEDGauss()); + aGaussSubMesh->myGauss = aGauss; + aGauss->myGeom = aEGeom; + aGauss->myNbPoints = 1; + + MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom); + if(aGaussIter != aGeom2Gauss.end()){ + MED::PGaussInfo aGaussInfo = aGaussIter->second; + aGauss->myGaussInfo = aGaussInfo; + aGauss->myName = aGaussInfo->GetName(); + aGauss->myNbPoints = aGaussInfo->GetNbGauss(); + } else if ( aTimeStampInfo.GetNbGauss(aMGeom) > 1 ) + EXCEPTION( std::runtime_error, "aGaussIter == aGeom2Gauss.end()" + " && aTimeStampInfo.GetNbGauss(aMGeom) > 1 !!!" ); + + aGaussSubMesh->myNbCells = aNbCells*aGauss->myNbPoints; + aGaussSubMesh->myCellsSize = aGaussSubMesh->myNbCells*2; + + aGaussKey.insert(aGaussSubMesh); + + INITMSGA(MYDEBUG,0, + "- aEGeom = "<myGeom<< + "; aName = '"<myName<<"'"<< + "; aNbGauss = "<myNbPoints<< + "; aStatus = "<myStatus<< + "; aNbCells = "<myNbCells<< + "; aCellsSize = "<myCellsSize<< + endl); + + //break; } } @@ -450,9 +450,9 @@ namespace //--------------------------------------------------------------- void InitGaussMesh(MED::PTimeStampValueBase& theTimeStampValue, - VISU::TMEDMeshOnEntity& theMeshOnEntity, - const MED::TGeom2Size& theGeom2Size, - VISU::TMEDValForTime& theValForTime) + VISU::TMEDMeshOnEntity& theMeshOnEntity, + const MED::TGeom2Size& theGeom2Size, + VISU::TMEDValForTime& theValForTime) { VISU::TTimerLog aTimerLog(MYDEBUG,"InitGaussMesh"); INITMSG(MYDEBUG,"InitGaussMesh"<myGeom2GaussSubMesh; { - VISU::TGaussKey::const_iterator anIter = aGaussKey.begin(); - for(; anIter != aGaussKey.end(); anIter++){ - VISU::PMEDGaussSubMesh aGaussSubMesh(*anIter); - VISU::PMEDGauss aGauss = aGaussSubMesh->myGauss; - VISU::EGeometry aEGeom = aGauss->myGeom; - aGeom2GaussSubMesh[aEGeom] = aGaussSubMesh; - } + VISU::TGaussKey::const_iterator anIter = aGaussKey.begin(); + for(; anIter != aGaussKey.end(); anIter++){ + VISU::PMEDGaussSubMesh aGaussSubMesh(*anIter); + VISU::PMEDGauss aGauss = aGaussSubMesh->myGauss; + VISU::EGeometry aEGeom = aGauss->myGeom; + aGeom2GaussSubMesh[aEGeom] = aGaussSubMesh; + } } { - VISU::TGaussSubMeshArr& aGaussSubMeshArr = aGaussMesh->myGaussSubMeshArr; - aGaussSubMeshArr.resize(aGeom2GaussSubMesh.size()); - VISU::TGeom2GaussSubMesh::const_iterator anIter = aGeom2GaussSubMesh.begin(); - for(TInt anID = 0; anIter != aGeom2GaussSubMesh.end(); anIter++, anID++){ - const VISU::PGaussSubMeshImpl& aGaussSubMesh = anIter->second; - aGaussSubMeshArr[anID] = aGaussSubMesh; - } + VISU::TGaussSubMeshArr& aGaussSubMeshArr = aGaussMesh->myGaussSubMeshArr; + aGaussSubMeshArr.resize(aGeom2GaussSubMesh.size()); + VISU::TGeom2GaussSubMesh::const_iterator anIter = aGeom2GaussSubMesh.begin(); + for(TInt anID = 0; anIter != aGeom2GaussSubMesh.end(); anIter++, anID++){ + const VISU::PGaussSubMeshImpl& aGaussSubMesh = anIter->second; + aGaussSubMeshArr[anID] = aGaussSubMesh; + } } INITMSG(MYDEBUG,"aGaussMeshMap[aGaussKey] = aGaussMesh"<myEntity = aVEntity; aMeshOnEntity->myMeshName = aMeshName; aMeshOnEntity->myGeom2Size = aGeom2Size; @@ -526,107 +526,107 @@ namespace VISU::TGeom2ElemID2FamilyID& aGeom2ElemID2FamilyID = aMeshOnEntity->myGeom2ElemID2FamilyID; INITMSG(MYDEBUG, - "- aMEntity = "<myGrilleStructure; if ( theGrilleInfo->GetGrilleType() != MED::eGRILLE_STANDARD ) for ( int aDimId = 0; aDimId < theMesh->myDim; aDimId++ ) - aGrilleStructure[aDimId] = theGrilleInfo->GetNbIndexes(aDimId); + aGrilleStructure[aDimId] = theGrilleInfo->GetNbIndexes(aDimId); else { MED::TIntVector aVector = theGrilleInfo->GetGrilleStructure(); for ( int aDimId = 0; aDimId < aVector.size(); aDimId++ ) - aGrilleStructure[aDimId] = aVector[aDimId]; + aGrilleStructure[aDimId] = aVector[aDimId]; } int kMax = aGrilleStructure[2]; @@ -665,25 +665,25 @@ namespace switch ( theMesh->myDim ) { case 1: for ( int i = 1; i <= iMax; i++ ) - aObj2StructuredId[i-1][0] = i; + aObj2StructuredId[i-1][0] = i; break; case 2: for ( int j = 1; j <= jMax; j++ ) - for ( int i = 1; i <= iMax; i++ ) { - aObj2StructuredId[iii][0] = i; - aObj2StructuredId[iii][1] = j; - iii++; - } + for ( int i = 1; i <= iMax; i++ ) { + aObj2StructuredId[iii][0] = i; + aObj2StructuredId[iii][1] = j; + iii++; + } break; case 3: for ( int k = 1; k <= kMax; k++ ) - for ( int j = 1; j <= jMax; j++ ) - for ( int i = 1; i <= iMax; i++ ) { - aObj2StructuredId[iii][0] = i; - aObj2StructuredId[iii][1] = j; - aObj2StructuredId[iii][2] = k; - iii++; - } + for ( int j = 1; j <= jMax; j++ ) + for ( int i = 1; i <= iMax; i++ ) { + aObj2StructuredId[iii][0] = i; + aObj2StructuredId[iii][1] = j; + aObj2StructuredId[iii][2] = k; + iii++; + } } for(; anEntityIter != theEntityInfo.end(); anEntityIter++){ @@ -692,7 +692,7 @@ namespace VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity); VISU::PMEDMeshOnEntity aMeshOnEntity = - aMeshOnEntityMap[aVEntity](new VISU::TMEDMeshOnEntity()); + aMeshOnEntityMap[aVEntity](new VISU::TMEDMeshOnEntity()); aMeshOnEntity->myEntity = aVEntity; aMeshOnEntity->myMeshName = aMeshName; aMeshOnEntity->myGeom2Size = aGeom2Size; @@ -700,58 +700,60 @@ namespace VISU::TGeom2ElemID2FamilyID& aGeom2ElemID2FamilyID = aMeshOnEntity->myGeom2ElemID2FamilyID; INITMSG(MYDEBUG, - "- aMEntity = "<GetNbFields(); @@ -774,7 +776,7 @@ namespace MED::TErr anError = 0; MED::PFieldInfo aFieldInfo = theMEDWrapper->GetPFieldInfo(aMeshInfo, iField, &anError); if ( anError < 0 ) - continue; + continue; TInt aNbComp = aFieldInfo->GetNbComp(); std::string aFieldName = aFieldInfo->GetName(); @@ -782,19 +784,19 @@ namespace MED::TGeom2Size aGeom2Size; MED::EEntiteMaillage aMEntity; TInt aNbTimeStamps = theMEDWrapper->GetNbTimeStamps(aFieldInfo, - theEntityInfo, - aMEntity, - aGeom2Size); + theEntityInfo, + aMEntity, + aGeom2Size); if(aNbTimeStamps < 1) - continue; + continue; VISU::TEntity aVEntity = MEDEntityToVTK( aMEntity ); vtkIdType aDataType = VTK_DOUBLE; if ( aFieldInfo->GetType() != MED::eFLOAT64 ) { #if defined(HAVE_F77INT64) - aDataType = VTK_LONG; -#else - aDataType = VTK_INT; + aDataType = VTK_LONG; +#else + aDataType = VTK_INT; #endif } VISU::PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[aVEntity]; @@ -809,53 +811,53 @@ namespace aField->myIsELNO = ( aMEntity == MED::eNOEUD_ELEMENT ); INITMSG(MYDEBUG,"myName = '"<myName<<"'"<< - "; myId = "<myId<< - "; myEntity = "<myEntity<< - "; myDataSize = "<myDataSize<< - "; myNbComp = "<myNbComp<<"\n"); + "; myId = "<myId<< + "; myEntity = "<myEntity<< + "; myDataSize = "<myDataSize<< + "; myNbComp = "<myNbComp<<"\n"); for(TInt iComp = 0; iComp < aNbComp; iComp++){ - aField->myCompNames[iComp] = aFieldInfo->GetCompName(iComp); - aField->myUnitNames[iComp] = aFieldInfo->GetUnitName(iComp); + aField->myCompNames[iComp] = aFieldInfo->GetCompName(iComp); + aField->myUnitNames[iComp] = aFieldInfo->GetUnitName(iComp); } for(TInt iTimeStamp = 1; iTimeStamp <= aNbTimeStamps; iTimeStamp++){ - VISU::TTimerLog aTimerLog(MYDEBUG,"GetPTimeStampInfo"); - - MED::TErr anError = 0; - MED::PTimeStampInfo aTimeStampInfo = theMEDWrapper->GetPTimeStampInfo(aFieldInfo, - aMEntity, - aGeom2Size, - iTimeStamp, - &anError); - if ( anError < 0 ) - continue; - - TFloat aDt = aTimeStampInfo->GetDt(); - std::string anUnitDt = aTimeStampInfo->GetUnitDt(); - - VISU::TValField& aValField = aField->myValField; - VISU::PMEDValForTime aValForTime = aValField[iTimeStamp](new VISU::TMEDValForTime()); - aValForTime->myId = iTimeStamp; - aValForTime->myFieldName = aField->myName; - aValForTime->myEntity = aField->myEntity; - aValForTime->myMeshName = aField->myMeshName; - aValForTime->myTime = VISU::TTime(aDt,anUnitDt); - INITMSG(MYDEBUG,"aDt = '"<myGeom2NbGauss; - const MED::TGeom2NbGauss& aMGeom2NbGauss = aTimeStampInfo->myGeom2NbGauss; - MED::TGeom2NbGauss::const_iterator anIter = aMGeom2NbGauss.begin(); - for(; anIter != aMGeom2NbGauss.end(); anIter++){ - const MED::EGeometrieElement& aMGeom = anIter->first; - VISU::EGeometry aEGeom = MEDGeom2VISU( aMGeom ); - TInt aNbGauss = anIter->second; - aVGeom2NbGauss[ aEGeom ] = aNbGauss; - - // ELNO data should satisfy the following condition ( implicitly ) - vtkIdType aNbNodes = MEDGeom2NbNodes( aMGeom ); - aField->myIsELNO &= ( aNbGauss == aNbNodes ); - } + VISU::TTimerLog aTimerLog(MYDEBUG,"GetPTimeStampInfo"); + + MED::TErr anError = 0; + MED::PTimeStampInfo aTimeStampInfo = theMEDWrapper->GetPTimeStampInfo(aFieldInfo, + aMEntity, + aGeom2Size, + iTimeStamp, + &anError); + if ( anError < 0 ) + continue; + + TFloat aDt = aTimeStampInfo->GetDt(); + std::string anUnitDt = aTimeStampInfo->GetUnitDt(); + + VISU::TValField& aValField = aField->myValField; + VISU::PMEDValForTime aValForTime = aValField[iTimeStamp](new VISU::TMEDValForTime()); + aValForTime->myId = iTimeStamp; + aValForTime->myFieldName = aField->myName; + aValForTime->myEntity = aField->myEntity; + aValForTime->myMeshName = aField->myMeshName; + aValForTime->myTime = VISU::TTime(aDt,anUnitDt); + INITMSG(MYDEBUG,"aDt = '"<myGeom2NbGauss; + const MED::TGeom2NbGauss& aMGeom2NbGauss = aTimeStampInfo->myGeom2NbGauss; + MED::TGeom2NbGauss::const_iterator anIter = aMGeom2NbGauss.begin(); + for(; anIter != aMGeom2NbGauss.end(); anIter++){ + const MED::EGeometrieElement& aMGeom = anIter->first; + VISU::EGeometry aEGeom = MEDGeom2VISU( aMGeom ); + TInt aNbGauss = anIter->second; + aVGeom2NbGauss[ aEGeom ] = aNbGauss; + + // ELNO data should satisfy the following condition ( implicitly ) + vtkIdType aNbNodes = MEDGeom2NbNodes( aMGeom ); + aField->myIsELNO &= ( aNbGauss == aNbNodes ); + } } } } @@ -864,10 +866,10 @@ namespace //--------------------------------------------------------------- void BuildFamilyMap(VISU::PMEDMesh theMesh, - const MED::TEntityInfo& theEntityInfo, - const MED::TEntity2TGeom2ElemInfo& theEntity2TGeom2ElemInfo, - const MED::TFamilyInfoSet& theFamilyInfoSet, - MED::PWrapper theMEDWrapper) + const MED::TEntityInfo& theEntityInfo, + const MED::TEntity2TGeom2ElemInfo& theEntity2TGeom2ElemInfo, + const MED::TFamilyInfoSet& theFamilyInfoSet, + MED::PWrapper theMEDWrapper) { VISU::TTimerLog aTimerLog(MYDEBUG,"BuildFamilyMap"); INITMSG(MYDEBUG,"BuildFamilyMap\n"); @@ -884,61 +886,61 @@ namespace const VISU::TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize; VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap; VISU::TFamilyIDMap& aFamilyIDMap = aMeshOnEntity->myFamilyIDMap; - + if(aFamilyTSizeSet.empty()) - continue; - + continue; + INITMSG(MY_FAMILY_DEBUG, - "- aMEntity = "<(aFamilyTSize); + TInt aSize = boost::get<1>(aFamilyTSize); + TInt anId = aFamilyInfo->GetId(); + if(anId == 0) + continue; + + std::string aFamilyName = aFamilyInfo->GetName(); + + VISU::PMEDFamily aFamily = aFamilyMap[aFamilyName](new VISU::TMEDFamily()); + aFamily->myId = anId; + aFamily->myEntity = aVEntity; + aFamily->myName = aFamilyName; + aFamily->myNbCells = aSize; + + aFamily->myCellsSize = 0; + VISU::TFamilyID2CellsSize::const_iterator anIter = aFamilyID2CellsSize.find(anId); + if(anIter != aFamilyID2CellsSize.end()) + aFamily->myCellsSize = anIter->second; + + const TInt aNbGroup = aFamilyInfo->GetNbGroup(); + VISU::TNames& aGroupNames = aFamily->myGroupNames; + aGroupNames.resize(aNbGroup); + for(TInt i = 0; i < aNbGroup; i++){ + std::string aGroupName = aFamilyInfo->GetGroupName(i); + aGroupNames[i] = aGroupName; + } + + aFamilyIDMap[anId] = aFamily; + + INITMSG(MY_FAMILY_DEBUG, + "- aFamilyName = '"<GetId(); if(anId == 0) - continue; + continue; std::string aFamilyName = aFamilyInfo->GetName(); const MED::EEntiteMaillage& aMEntity = MED::GetEntityByFamilyId(aGrilleInfo, - anId); + anId); VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity); VISU::PMEDMeshOnEntity aMeshOnEntity; VISU::TMeshOnEntityMap::iterator aMeshOnEntityIter = aMeshOnEntityMap.find(aVEntity); if(aMeshOnEntityIter != aMeshOnEntityMap.end()) - aMeshOnEntity = aMeshOnEntityIter->second; + aMeshOnEntity = aMeshOnEntityIter->second; VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap; VISU::TFamilyIDMap& aFamilyIDMap = aMeshOnEntity->myFamilyIDMap; @@ -998,30 +1000,30 @@ namespace const VISU::TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize; VISU::TFamilyID2CellsSize::const_iterator aFamilyid2CellsSizeIter = aFamilyID2CellsSize.find(anId); if(aFamilyid2CellsSizeIter != (aMeshOnEntity->myFamilyID2CellsSize).end()) - aFamily->myCellsSize = aFamilyid2CellsSizeIter->second; + aFamily->myCellsSize = aFamilyid2CellsSizeIter->second; MED::TFamilyID2NbCells::const_iterator aFam2NbCellsIter = aFam2NbCells.find(anId); if(aFam2NbCellsIter != aFam2NbCells.end()) - aFamily->myNbCells = aFam2NbCellsIter->second; + aFamily->myNbCells = aFam2NbCellsIter->second; const TInt aNbGroup = aFamilyInfo->GetNbGroup(); VISU::TNames& aGroupNames = aFamily->myGroupNames; aGroupNames.resize(aNbGroup); for(TInt i = 0; i < aNbGroup; i++){ - std::string aGroupName = aFamilyInfo->GetGroupName(i); - aGroupNames[i] = aGroupName; + std::string aGroupName = aFamilyInfo->GetGroupName(i); + aGroupNames[i] = aGroupName; } aFamilyIDMap[anId] = aFamily; INITMSG(MY_FAMILY_DEBUG, - "- aFamilyName =|"<myName<<"|" - << "; myId = "<myId - << "; aNbAttr = "<GetNbAttr() - << "; aNbGroup = "<GetNbGroup() - << "; aVEntity = "<myName<<"|" + << "; myId = "<myId + << "; aNbAttr = "<GetNbAttr() + << "; aNbGroup = "<GetNbGroup() + << "; aVEntity = "<second; MED::TFamilyInfoSet::const_iterator aFamilyIter = aFamilyInfoSet.begin(); for(; aFamilyIter != aFamilyInfoSet.end(); aFamilyIter++){ - const MED::PFamilyInfo& aFamilyInfo = *aFamilyIter; - std::string aFamilyName = aFamilyInfo->GetName(); - - VISU::TEntity aVEntity = VISU::TEntity(-1); - VISU::PMEDFamily aFamily; - - // Find aVisuEntity - const VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap; - VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityIter = aMeshOnEntityMap.begin(); - for(; aMeshOnEntityIter != aMeshOnEntityMap.end(); aMeshOnEntityIter++){ - const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityIter->second; - const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap; - VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin(); - for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){ - const std::string& aName = aFamilyMapIter->first; - if(aName == aFamilyName){ + const MED::PFamilyInfo& aFamilyInfo = *aFamilyIter; + std::string aFamilyName = aFamilyInfo->GetName(); + + VISU::TEntity aVEntity = VISU::TEntity(-1); + VISU::PMEDFamily aFamily; + + // Find aVisuEntity + const VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap; + VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityIter = aMeshOnEntityMap.begin(); + for(; aMeshOnEntityIter != aMeshOnEntityMap.end(); aMeshOnEntityIter++){ + const VISU::PMeshOnEntity& aMeshOnEntity = aMeshOnEntityIter->second; + const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap; + VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin(); + for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){ + const std::string& aName = aFamilyMapIter->first; + if(aName == aFamilyName){ aFamily = aFamilyMapIter->second; - aVEntity = aFamily->myEntity; - goto exit_lable; - } - } - } + aVEntity = aFamily->myEntity; + goto exit_lable; + } + } + } exit_lable: - if(aFamily && aVEntity >= 0){ - aFamilySet.insert(aFamily); - INITMSG(MY_GROUP_DEBUG, - "- aFamilyName = '"<= 0){ + aFamilySet.insert(aFamily); + INITMSG(MY_GROUP_DEBUG, + "- aFamilyName = '"<GetNbElem(); @@ -1149,7 +1151,7 @@ namespace VISU VISU::TCoordSlice aVCoordSlice = GetCoordSlice(iElem); MED::TNodeCoord aMCoord = theGrilleInfo->GetCoord(iElem); for(TInt iDim = 0; iDim < aDim; iDim++){ - aVCoordSlice[iDim] = aMCoord[iDim]; + aVCoordSlice[iDim] = aMCoord[iDim]; } } } @@ -1171,13 +1173,13 @@ namespace VISU if(myIsElemNum){ // To prepare corresponding mapper engine if(myObj2VTKID.empty()){ - vtkIdType anEnd = myElemNum->size(); - for(vtkIdType anID = 0; anID < anEnd; anID++) - myObj2VTKID[(*myElemNum)[anID]] = anID; + vtkIdType anEnd = myElemNum->size(); + for(vtkIdType anID = 0; anID < anEnd; anID++) + myObj2VTKID[(*myElemNum)[anID]] = anID; } TObj2VTKID::const_iterator anIter = myObj2VTKID.find(theID); if(anIter != myObj2VTKID.end()) - return anIter->second; + return anIter->second; return -1; } return TNamedPointCoords::GetVTKID(theID); @@ -1239,10 +1241,10 @@ namespace VISU { if ( myIsElemNum ) for ( size_t anId = 0; anId < (*myElemNum).size(); anId++ ) - if ( (*myElemNum)[ anId ] == theID ) { - theID = anId; - break; - } + if ( (*myElemNum)[ anId ] == theID ) { + theID = anId; + break; + } return TSubProfileImpl::GetElemVTKID( theID ); } @@ -1264,14 +1266,14 @@ namespace VISU void TMEDGauss ::LessThan(const PGaussImpl& theGauss, - bool& theResult) const + bool& theResult) const { TGaussImpl::LessThan(theGauss,theResult); if(myGaussInfo){ if(PMEDGauss aGauss = theGauss){ - const MED::TGaussInfo& aLeft = myGaussInfo; - const MED::TGaussInfo& aReight = aGauss->myGaussInfo; - theResult = MED::TGaussInfo::TLess()(aLeft,aReight); + const MED::TGaussInfo& aLeft = myGaussInfo; + const MED::TGaussInfo& aReight = aGauss->myGaussInfo; + theResult = MED::TGaussInfo::TLess()(aLeft,aReight); } } } @@ -1334,7 +1336,7 @@ namespace VISU void TMEDSubMesh ::Init(const MED::PElemInfo& theElemInfo, - MED::EVersion theVersion) + MED::EVersion theVersion) { myVersion = theVersion; myIsElemNum = theElemInfo->IsElemNum(); @@ -1439,7 +1441,7 @@ VISU_MedConvertor std::string aMeshName = aMeshInfo->GetName(); TInt aDim = aMeshInfo->GetDim(); MED::EMaillage aType = aMeshInfo->GetType(); - + // creating TMesh structure and TMeshOnEntityMap VISU::PMEDMesh aMesh = aMeshMap[aMeshName](new VISU::TMEDMesh()); @@ -1449,66 +1451,67 @@ VISU_MedConvertor aMesh->myNamedPointCoords(new VISU::TMEDNamedPointCoords()); INITMSG(MYDEBUG,"aMeshName = '"<GetPNodeInfo(aMeshInfo)){ - MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo); + if(MED::PNodeInfo aNodeInfo = myMed->GetPNodeInfo(aMeshInfo)){ + MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo); - aMesh->myNbPoints = aNodeInfo->GetNbElem(); - aMesh->myEntityInfo = anEntityInfo; - - + aMesh->myNbPoints = aNodeInfo->GetNbElem(); + aMesh->myEntityInfo = anEntityInfo; + + #ifndef _DEXCEPT_ - try{ + try{ #endif - INITMSG(MYDEBUG,"myNbPoints = "<myNbPoints<< - "; anEntityInfo.size() = "<GetPGrilleInfo(aMeshInfo); - - MED::TEntityInfo anEntityInfo; - anEntityInfo[MED::eNOEUD][MED::ePOINT1] = aGrilleInfo->GetNbNodes(); - anEntityInfo[aGrilleInfo->GetEntity()][aGrilleInfo->GetGeom()] = aGrilleInfo->GetNbCells(); - - aMesh->myNbPoints = aGrilleInfo->GetNbNodes(); - aMesh->myEntityInfo = anEntityInfo; - - aMesh->myIsPolarType = (MED::eGRILLE_POLAIRE == aGrilleInfo->GetGrilleType()); - aMesh->myIsStructured = true; + MED::PGrilleInfo aGrilleInfo = myMed->GetPGrilleInfo(aMeshInfo); + + MED::TEntityInfo anEntityInfo; + anEntityInfo[MED::eNOEUD][MED::ePOINT1] = aGrilleInfo->GetNbNodes(); + anEntityInfo[aGrilleInfo->GetEntity()][aGrilleInfo->GetGeom()] = aGrilleInfo->GetNbCells(); + anEntityInfo[aGrilleInfo->GetSubEntity()][aGrilleInfo->GetSubGeom()] = aGrilleInfo->GetNbSubCells(); + + aMesh->myNbPoints = aGrilleInfo->GetNbNodes(); + aMesh->myEntityInfo = anEntityInfo; + + aMesh->myIsPolarType = (MED::eGRILLE_POLAIRE == aGrilleInfo->GetGrilleType()); + aMesh->myIsStructured = true; #ifndef _DEXCEPT_ - try{ + try{ #endif - BEGMSG(MYDEBUG,"anEntityInfo.size() = "<second; INITMSG(MYDEBUG,"aMeshName = '"<GetEntityInfo(aMeshInfo); + MED::TEntityInfo anEntityInfo = myMed->GetEntityInfo(aMeshInfo); - BuildFieldMap(aMesh, - anEntityInfo, - myMed); + BuildFieldMap(aMesh, + anEntityInfo, + myMed); #ifndef _DEXCEPT_ }catch(std::exception& exc){ - MSG(MYDEBUG,"Follow exception was occured in:\n"< void BuildTimeStampMinMax(MED::SharedPtr theTimeStampValue, - const VISU::PMEDMeshOnEntity theMeshOnEntity, - const MED::TGeom2Gauss& theGeom2Gauss, - VISU::TMetric2Comp2MinMax& theMetric2Comp2MinMax, + const VISU::PMEDMeshOnEntity theMeshOnEntity, + const MED::TGeom2Gauss& theGeom2Gauss, + VISU::TMetric2Comp2MinMax& theMetric2Comp2MinMax, VISU::TMetric2Comp2MinMax& theMetric2Comp2AverageMinMax, - VISU::TMetric2Comp2Group2MinMax& theMetric2Comp2Group2MinMax, - VISU::TMetric2Comp2Group2MinMax& theMetric2Comp2Group2AverageMinMax, - TInt theNbComp, - TInt theNbComp2) + VISU::TMetric2Comp2Group2MinMax& theMetric2Comp2Group2MinMax, + VISU::TMetric2Comp2Group2MinMax& theMetric2Comp2Group2AverageMinMax, + TInt theNbComp, + TInt theNbComp2) { const VISU::TFamilyIDMap& aFamilyIDMap = theMeshOnEntity->myFamilyIDMap; VISU::TGeom2ElemID2FamilyID aGeom2ElemID2FamilyID = theMeshOnEntity->myGeom2ElemID2FamilyID; @@ -1615,19 +1618,19 @@ BuildTimeStampMinMax(MED::SharedPtr theTimeStampValue, for(; anIter != aGeom2Value.end(); anIter++){ const typename TimeStampValueType::TTMeshValue& aMMeshValue = anIter->second; MED::EGeometrieElement aMGeom = anIter->first; - + TInt aNbElem = aMMeshValue.myNbElem; TInt aNbGauss = aMMeshValue.myNbGauss; - + MED::TGeom2Gauss::const_iterator aGaussIter = theGeom2Gauss.find(aMGeom); if(aGaussIter == theGeom2Gauss.end()) aNbGauss = 1; - + INITMSG(MYDEBUG, - "- aMGeom = "<GetEntityInfo(aMeshInfo); - - for(TInt iField = 1; iField <= aNbFields; iField++){ - VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPFieldInfo()"); - - MED::TErr anError = 0; - MED::PFieldInfo aFieldInfo = myMed->GetPFieldInfo(aMeshInfo, iField, &anError); - if ( anError < 0 ) - continue; - - std::string aFieldName = aFieldInfo->GetName(); - INITMSG(MYDEBUG,"- aFieldName = '"<GetNbTimeStamps(aFieldInfo, - anEntityInfo, - aMEntity, - aGeom2Size); - if(aNbTimeStamps < 1) - continue; - - VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity); - VISU::PMEDMeshOnEntity aMeshOnEntity = aMesh->myMeshOnEntityMap[aVEntity]; - VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap; - VISU::PMEDField aField = aFieldMap[aFieldName]; - - TInt aNbComp = aField->myNbComp; - int aNbComp2 = aNbComp; - if(aNbComp == 2 || aNbComp == 4) - aNbComp2 = 2; - else if(aNbComp > 4) - aNbComp2 = 3; - - VISU::TMetric2Comp2MinMax& aMetric2Comp2MinMax = aField->myMetric2Comp2MinMax; + TInt aNbFields = myMed->GetNbFields(); + + INITMSG(MYDEBUG, + "- aMeshName = '"<GetEntityInfo(aMeshInfo); + + for(TInt iField = 1; iField <= aNbFields; iField++){ + VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPFieldInfo()"); + + MED::TErr anError = 0; + MED::PFieldInfo aFieldInfo = myMed->GetPFieldInfo(aMeshInfo, iField, &anError); + if ( anError < 0 ) + continue; + + std::string aFieldName = aFieldInfo->GetName(); + INITMSG(MYDEBUG,"- aFieldName = '"<GetNbTimeStamps(aFieldInfo, + anEntityInfo, + aMEntity, + aGeom2Size); + if(aNbTimeStamps < 1) + continue; + + VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity); + VISU::PMEDMeshOnEntity aMeshOnEntity = aMesh->myMeshOnEntityMap[aVEntity]; + VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap; + VISU::PMEDField aField = aFieldMap[aFieldName]; + + TInt aNbComp = aField->myNbComp; + int aNbComp2 = aNbComp; + if(aNbComp == 2 || aNbComp == 4) + aNbComp2 = 2; + else if(aNbComp > 4) + aNbComp2 = 3; + + VISU::TMetric2Comp2MinMax& aMetric2Comp2MinMax = aField->myMetric2Comp2MinMax; VISU::TMetric2Comp2MinMax& aMetric2Comp2AverageMinMax = aField->myMetric2Comp2AverageMinMax; VISU::TMetric2Comp2Group2MinMax& aMetric2Comp2Group2MinMax = aField->myMetric2Comp2Group2MinMax; VISU::TMetric2Comp2Group2MinMax& aMetric2Comp2Group2AverageMinMax = aField->myMetric2Comp2Group2AverageMinMax; - TSetIsDone aSetIsDone(aField->myIsMinMaxInitilized); - for(TInt iTimeStamp = aNbTimeStamps; iTimeStamp >= 1; iTimeStamp--){ - VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPTimeStampInfo()"); - INITMSG(MYDEBUG,"- iTimeStamp = "<myIsMinMaxInitilized); + for(TInt iTimeStamp = aNbTimeStamps; iTimeStamp >= 1; iTimeStamp--){ + VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPTimeStampInfo()"); + INITMSG(MYDEBUG,"- iTimeStamp = "<GetType() == MED::eFLOAT64) BuildTimeStampMinMax(CastToFloatTimeStampValue(aTimeStampValue), - aMeshOnEntity, + aMeshOnEntity, aGeom2Gauss, aMetric2Comp2MinMax, aMetric2Comp2AverageMinMax, - aMetric2Comp2Group2MinMax, - aMetric2Comp2Group2AverageMinMax, + aMetric2Comp2Group2MinMax, + aMetric2Comp2Group2AverageMinMax, aNbComp, aNbComp2); else BuildTimeStampMinMax(CastToIntTimeStampValue(aTimeStampValue), - aMeshOnEntity, + aMeshOnEntity, aGeom2Gauss, aMetric2Comp2MinMax, aMetric2Comp2AverageMinMax, - aMetric2Comp2Group2MinMax, - aMetric2Comp2Group2AverageMinMax, + aMetric2Comp2Group2MinMax, + aMetric2Comp2Group2AverageMinMax, aNbComp, aNbComp2); @@ -1990,17 +1993,17 @@ VISU_MedConvertor MSG(MYDEBUG,"Unknown exception !!!"); } #endif - } - for(TInt iComp = 0; iComp <= aNbComp; iComp++){ - VISU::TMinMax aMinMax = aField->GetMinMax(iComp, VISU::TNames()); - INITMSG(MYDEBUG,"- "<GetMinMax(iComp, VISU::TNames()); + INITMSG(MYDEBUG,"- "<second; INITMSG(MYDEBUG,"aMeshName = '"<GetEntityInfo(aMeshInfo); MED::TEntity2TGeom2ElemInfo anEntity2TGeom2ElemInfo = - MED::GetEntity2TGeom2ElemInfo(myMed, aMeshInfo, anEntityInfo); + MED::GetEntity2TGeom2ElemInfo(myMed, aMeshInfo, anEntityInfo); #ifndef _DEXCEPT_ try{ #endif - MED::TFamilyInfoSet aFamilyInfoSet = MED::GetFamilyInfoSet(myMed, aMeshInfo); - - if(aType == MED::eNON_STRUCTURE) - BuildFamilyMap(aMesh, - anEntityInfo, - anEntity2TGeom2ElemInfo, - aFamilyInfoSet, - myMed); - else - BuildGrilleFamilyMap(aMesh, - anEntityInfo, - aFamilyInfoSet, - myMed); - - BuildGroupMap(aMesh, - aFamilyInfoSet); + MED::TFamilyInfoSet aFamilyInfoSet = MED::GetFamilyInfoSet(myMed, aMeshInfo); + + if(aType == MED::eNON_STRUCTURE) + BuildFamilyMap(aMesh, + anEntityInfo, + anEntity2TGeom2ElemInfo, + aFamilyInfoSet, + myMed); + else + BuildGrilleFamilyMap(aMesh, + anEntityInfo, + aFamilyInfoSet, + myMed); + + BuildGroupMap(aMesh, + aFamilyInfoSet); #ifndef _DEXCEPT_ }catch(std::exception& exc){ - MSG(MYDEBUG,"Follow exception was occured in:\n"<myCell2Connect; aCell2Connect.resize(aNbElem); for (int iElem = 0; iElem < aNbElem; iElem++) - aCell2Connect[iElem] = VISU::TConnect(1,iElem); + aCell2Connect[iElem] = VISU::TConnect(1,iElem); } // END NON_STRUCTURED else { // STRUCTURED //Main part of code @@ -2272,7 +2275,7 @@ VISU_MedConvertor VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; aCell2Connect.resize(aNbElem); for(int iElem = 0; iElem < aNbElem; iElem++) - aCell2Connect[iElem] = VISU::TConnect(1,iElem); + aCell2Connect[iElem] = VISU::TConnect(1,iElem); } @@ -2294,8 +2297,8 @@ VISU_MedConvertor int VISU_MedConvertor ::LoadPointsOnFamily(const MED::PWrapper& theMed, - const VISU::PMEDMesh theMesh, - const VISU::PMEDFamily theFamily) + const VISU::PMEDMesh theMesh, + const VISU::PMEDFamily theFamily) { VISU::TTimerLog aTimerLog(MYDEBUG,"LoadPointsOnFamily"); try{ @@ -2311,11 +2314,11 @@ VISU_MedConvertor TInt aNbElem = aNodeInfo->GetNbElem(); if(aNbElem > 0){ - TInt anId = theFamily->myId; - VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VISU::ePOINT1]; - for(TInt iElem = 0; iElem < aNbElem; iElem++) - if(aNodeInfo->GetFamNum(iElem) == anId) - aSubMeshID.push_back(iElem); + TInt anId = theFamily->myId; + VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VISU::ePOINT1]; + for(TInt iElem = 0; iElem < aNbElem; iElem++) + if(aNodeInfo->GetFamNum(iElem) == anId) + aSubMeshID.push_back(iElem); } } else { @@ -2323,11 +2326,11 @@ VISU_MedConvertor TInt aNbElem = aGrilleInfo->GetNbNodes(); if(aNbElem > 0){ - TInt anId = theFamily->myId; - VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VISU::ePOINT1]; - for(TInt iElem = 0; iElem < aNbElem; iElem++) - if(aGrilleInfo->GetFamNumNode(iElem) == anId) - aSubMeshID.push_back(iElem); + TInt anId = theFamily->myId; + VISU::TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VISU::ePOINT1]; + for(TInt iElem = 0; iElem < aNbElem; iElem++) + if(aGrilleInfo->GetFamNumNode(iElem) == anId) + aSubMeshID.push_back(iElem); } } @@ -2349,8 +2352,8 @@ VISU_MedConvertor int VISU_MedConvertor ::LoadCellsOnEntity(const MED::PWrapper& theMed, - const VISU::PMEDMesh theMesh, - const VISU::PMEDMeshOnEntity theMeshOnEntity) + const VISU::PMEDMesh theMesh, + const VISU::PMEDMeshOnEntity theMeshOnEntity) { VISU::TTimerLog aTimerLog(MYDEBUG,"LoadCellsOnEntity"); #ifndef _DEXCEPT_ @@ -2381,75 +2384,75 @@ VISU_MedConvertor VISU::TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh; for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){ - const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first; - VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom); - INITMSG(MYDEBUG,"aMGeom = "<second;//aGrilleInfo->GetNbCells(); - - if(aNbElem > 0){ - VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh()); - - aSubMesh->Init(aGrilleInfo); - aSubMesh->myNbCells = aNbElem; - aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1); - - VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; - aCell2Connect.resize(aNbElem); - - TInt aMNbNodes = MEDGeom2NbNodes(aMGeom); - VISU::TVector aConnect(aMNbNodes); - - for(TInt iElem = 0; iElem < aNbElem; iElem++) { - MED::TIntVector aConn = aGrilleInfo->GetConn(iElem); - VISU::TConnect& anArray = aCell2Connect[iElem]; - anArray.resize(aVNbNodes); - - if(anIsNodeNum){ - for(TInt iConn = 0; iConn < aMNbNodes; iConn++){ - aConnect[iConn] = aNodeIdMap[aConn[iConn] - 1]; - } - }else{ - for(int iConn = 0; iConn < aMNbNodes; ++iConn){ - aConnect[iConn] = aConn[iConn]; - } - } - - switch(aMGeom){ - case MED::eQUAD4: - anArray[0] = aConnect[0]; - anArray[1] = aConnect[2]; - anArray[2] = aConnect[3]; - anArray[3] = aConnect[1]; - break; - case MED::eHEXA8: - anArray[0] = aConnect[0]; - anArray[1] = aConnect[2]; - anArray[2] = aConnect[3]; - anArray[3] = aConnect[1]; - anArray[4] = aConnect[4]; - anArray[5] = aConnect[6]; - anArray[6] = aConnect[7]; - anArray[7] = aConnect[5]; - break; - default: - for(int iNode = 0; iNode < aVNbNodes; iNode++) - anArray[iNode] = aConnect[iNode]; - } - - for(int iNode = 0; iNode < aVNbNodes; iNode++) - if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode]) - EXCEPTION(std::runtime_error,"LoadCellsOnEntity - "<< - " aNbPoints("<first; + VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom); + INITMSG(MYDEBUG,"aMGeom = "<second;//aGrilleInfo->GetNbCells(); + + if(aNbElem > 0){ + VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh()); + + aSubMesh->Init(aGrilleInfo); + aSubMesh->myNbCells = aNbElem; + aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1); + + VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; + aCell2Connect.resize(aNbElem); + + TInt aMNbNodes = MEDGeom2NbNodes(aMGeom); + VISU::TVector aConnect(aMNbNodes); + + for(TInt iElem = 0; iElem < aNbElem; iElem++) { + MED::TIntVector aConn = aGrilleInfo->GetConn(iElem, theMeshOnEntity->myEntity != VISU::CELL_ENTITY); + VISU::TConnect& anArray = aCell2Connect[iElem]; + anArray.resize(aVNbNodes); + + if(anIsNodeNum){ + for(TInt iConn = 0; iConn < aMNbNodes; iConn++){ + aConnect[iConn] = aNodeIdMap[aConn[iConn] - 1]; + } + }else{ + for(int iConn = 0; iConn < aMNbNodes; ++iConn){ + aConnect[iConn] = aConn[iConn]; + } + } + + switch(aMGeom){ + case MED::eQUAD4: + anArray[0] = aConnect[0]; + anArray[1] = aConnect[2]; + anArray[2] = aConnect[3]; + anArray[3] = aConnect[1]; + break; + case MED::eHEXA8: + anArray[0] = aConnect[0]; + anArray[1] = aConnect[2]; + anArray[2] = aConnect[3]; + anArray[3] = aConnect[1]; + anArray[4] = aConnect[4]; + anArray[5] = aConnect[6]; + anArray[6] = aConnect[7]; + anArray[7] = aConnect[5]; + break; + default: + for(int iNode = 0; iNode < aVNbNodes; iNode++) + anArray[iNode] = aConnect[iNode]; + } + + for(int iNode = 0; iNode < aVNbNodes; iNode++) + if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode]) + EXCEPTION(std::runtime_error,"LoadCellsOnEntity - "<< + " aNbPoints("<myIsDone = true; @@ -2468,7 +2471,7 @@ VISU_MedConvertor EBooleen anIsNodeNum = aNodeInfo->IsElemNum(); if(anIsNodeNum){ for(TInt i = 0; i < aNbPoints; i++){ - aNodeIdMap[aNodeInfo->GetElemNum(i)-1] = i; + aNodeIdMap[aNodeInfo->GetElemNum(i)-1] = i; } } #endif @@ -2483,198 +2486,198 @@ VISU_MedConvertor INITMSG(MYDEBUG,"aMGeom = "<GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom); - TInt aNbElem = aPolygoneInfo->GetNbElem(); - if(aNbElem > 0){ - VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh()); - - aSubMesh->Init(MED::PElemInfo(aPolygoneInfo),theMed->GetVersion()); - aSubMesh->myNbCells = aNbElem; - - VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; - aCell2Connect.resize(aNbElem); - - for(TInt iElem = 0; iElem < aNbElem; iElem++) { - MED::TCConnSlice aConnSlice = aPolygoneInfo->GetConnSlice(iElem); - TInt aNbConn = aPolygoneInfo->GetNbConn(iElem); - aSubMesh->myCellsSize += aNbConn; - VISU::TConnect& anArray = aCell2Connect[iElem]; - anArray.resize(aNbConn); - for(TInt iConn = 0; iConn < aNbConn; iConn++) - anArray[iConn] = aConnSlice[iConn] - 1; - } - } - break; + MED::PPolygoneInfo aPolygoneInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom); + TInt aNbElem = aPolygoneInfo->GetNbElem(); + if(aNbElem > 0){ + VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh()); + + aSubMesh->Init(MED::PElemInfo(aPolygoneInfo),theMed->GetVersion()); + aSubMesh->myNbCells = aNbElem; + + VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; + aCell2Connect.resize(aNbElem); + + for(TInt iElem = 0; iElem < aNbElem; iElem++) { + MED::TCConnSlice aConnSlice = aPolygoneInfo->GetConnSlice(iElem); + TInt aNbConn = aPolygoneInfo->GetNbConn(iElem); + aSubMesh->myCellsSize += aNbConn; + VISU::TConnect& anArray = aCell2Connect[iElem]; + anArray.resize(aNbConn); + for(TInt iConn = 0; iConn < aNbConn; iConn++) + anArray[iConn] = aConnSlice[iConn] - 1; + } + } + break; } case MED::ePOLYEDRE: { - MED::PPolyedreInfo aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom); - TInt aNbElem = aPolyedreInfo->GetNbElem(); - - if(aNbElem > 0){ - VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh()); - - aSubMesh->Init(MED::PElemInfo(aPolyedreInfo),theMed->GetVersion()); - aSubMesh->myNbCells = aNbElem; - - VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; - aCell2Connect.resize(aNbElem); - - for(TInt iElem = 0; iElem < aNbElem; iElem++){ - MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(iElem); - VISU::TConnect& anArray = aCell2Connect[iElem]; - typedef std::set TConnectSet; - TConnectSet aConnectSet; - TInt aNbFaces = aConnSliceArr.size(); - for(TInt iFace = 0; iFace < aNbFaces; iFace++){ - MED::TCConnSlice aConnSlice = aConnSliceArr[iFace]; - TInt aNbConn = aConnSlice.size(); - aSubMesh->myCellsSize += aNbConn; - for(TInt iConn = 0; iConn < aNbConn; iConn++){ - aConnectSet.insert(aConnSlice[iConn]); - } - } - - int aNbConn = aConnectSet.size(); - anArray.resize(aNbConn); - TConnectSet::iterator anIter = aConnectSet.begin(); - for(int i = 0; anIter != aConnectSet.end(); anIter++, i++){ - TInt anId = *anIter; - anArray[i] = anId - 1; - } - } - } - - break; + MED::PPolyedreInfo aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom); + TInt aNbElem = aPolyedreInfo->GetNbElem(); + + if(aNbElem > 0){ + VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh()); + + aSubMesh->Init(MED::PElemInfo(aPolyedreInfo),theMed->GetVersion()); + aSubMesh->myNbCells = aNbElem; + + VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; + aCell2Connect.resize(aNbElem); + + for(TInt iElem = 0; iElem < aNbElem; iElem++){ + MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(iElem); + VISU::TConnect& anArray = aCell2Connect[iElem]; + typedef std::set TConnectSet; + TConnectSet aConnectSet; + TInt aNbFaces = aConnSliceArr.size(); + for(TInt iFace = 0; iFace < aNbFaces; iFace++){ + MED::TCConnSlice aConnSlice = aConnSliceArr[iFace]; + TInt aNbConn = aConnSlice.size(); + aSubMesh->myCellsSize += aNbConn; + for(TInt iConn = 0; iConn < aNbConn; iConn++){ + aConnectSet.insert(aConnSlice[iConn]); + } + } + + int aNbConn = aConnectSet.size(); + anArray.resize(aNbConn); + TConnectSet::iterator anIter = aConnectSet.begin(); + for(int i = 0; anIter != aConnectSet.end(); anIter++, i++){ + TInt anId = *anIter; + anArray[i] = anId - 1; + } + } + } + + break; } default: { - vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom); - INITMSG(MYDEBUG,"aVNbNodes = "<GetPCellInfo(aMeshInfo,aMEntity,aMGeom); - TInt aNbElem = aCellInfo->GetNbElem(); - - if(aNbElem > 0){ - VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh()); - - aSubMesh->Init(MED::PElemInfo(aCellInfo), theMed->GetVersion()); - aSubMesh->myNbCells = aNbElem; - aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1); - - VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; - aCell2Connect.resize(aNbElem); - - TInt aMNbNodes = MEDGeom2NbNodes(aMGeom); - VISU::TVector aConnect(aMNbNodes); - - for(TInt iElem = 0; iElem < aNbElem; iElem++) { - MED::TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem); - VISU::TConnect& anArray = aCell2Connect[iElem]; - anArray.resize(aVNbNodes); - - if(anIsNodeNum){ - for(TInt iConn = 0; iConn < aMNbNodes; iConn++){ - aConnect[iConn] = aNodeIdMap[aConnSlice[iConn] - 1]; - } - }else{ - for(int iConn = 0; iConn < aMNbNodes; iConn++){ - aConnect[iConn] = aConnSlice[iConn] - 1; - } - } - - switch(aMGeom){ + vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom); + INITMSG(MYDEBUG,"aVNbNodes = "<GetPCellInfo(aMeshInfo,aMEntity,aMGeom); + TInt aNbElem = aCellInfo->GetNbElem(); + + if(aNbElem > 0){ + VISU::PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new VISU::TMEDSubMesh()); + + aSubMesh->Init(MED::PElemInfo(aCellInfo), theMed->GetVersion()); + aSubMesh->myNbCells = aNbElem; + aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1); + + VISU::TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; + aCell2Connect.resize(aNbElem); + + TInt aMNbNodes = MEDGeom2NbNodes(aMGeom); + VISU::TVector aConnect(aMNbNodes); + + for(TInt iElem = 0; iElem < aNbElem; iElem++) { + MED::TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem); + VISU::TConnect& anArray = aCell2Connect[iElem]; + anArray.resize(aVNbNodes); + + if(anIsNodeNum){ + for(TInt iConn = 0; iConn < aMNbNodes; iConn++){ + aConnect[iConn] = aNodeIdMap[aConnSlice[iConn] - 1]; + } + }else{ + for(int iConn = 0; iConn < aMNbNodes; iConn++){ + aConnect[iConn] = aConnSlice[iConn] - 1; + } + } + + switch(aMGeom){ #if !(defined(VTK_QUADRATIC_EDGE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC) - case MED::eSEG3: - anArray[0] = aConnect[0]; - anArray[2] = aConnect[1]; + case MED::eSEG3: + anArray[0] = aConnect[0]; + anArray[2] = aConnect[1]; - anArray[1] = aConnect[2]; - break; + anArray[1] = aConnect[2]; + break; #endif #if !(defined(VTK_QUADRATIC_TRIANGLE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC) - case MED::eTRIA6: - anArray[0] = aConnect[0]; - anArray[2] = aConnect[1]; - anArray[4] = aConnect[2]; - - anArray[1] = aConnect[3]; - anArray[3] = aConnect[4]; - anArray[5] = aConnect[5]; - break; + case MED::eTRIA6: + anArray[0] = aConnect[0]; + anArray[2] = aConnect[1]; + anArray[4] = aConnect[2]; + + anArray[1] = aConnect[3]; + anArray[3] = aConnect[4]; + anArray[5] = aConnect[5]; + break; #endif #if !(defined(VTK_QUADRATIC_QUAD) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC) - case MED::eQUAD8: - anArray[0] = aConnect[0]; - anArray[2] = aConnect[1]; - anArray[4] = aConnect[2]; - anArray[6] = aConnect[3]; - - anArray[1] = aConnect[4]; - anArray[3] = aConnect[5]; - anArray[5] = aConnect[6]; - anArray[7] = aConnect[7]; - break; + case MED::eQUAD8: + anArray[0] = aConnect[0]; + anArray[2] = aConnect[1]; + anArray[4] = aConnect[2]; + anArray[6] = aConnect[3]; + + anArray[1] = aConnect[4]; + anArray[3] = aConnect[5]; + anArray[5] = aConnect[6]; + anArray[7] = aConnect[7]; + break; #endif #if (defined(VTK_QUADRATIC_TETRA) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC) - case MED::eTETRA10: - anArray[0] = aConnect[0]; - anArray[1] = aConnect[2]; - anArray[2] = aConnect[1]; - anArray[3] = aConnect[3]; - - anArray[4] = aConnect[6]; - anArray[5] = aConnect[5]; - anArray[6] = aConnect[4]; - - anArray[7] = aConnect[7]; - anArray[8] = aConnect[9]; - anArray[9] = aConnect[8]; - break; + case MED::eTETRA10: + anArray[0] = aConnect[0]; + anArray[1] = aConnect[2]; + anArray[2] = aConnect[1]; + anArray[3] = aConnect[3]; + + anArray[4] = aConnect[6]; + anArray[5] = aConnect[5]; + anArray[6] = aConnect[4]; + + anArray[7] = aConnect[7]; + anArray[8] = aConnect[9]; + anArray[9] = aConnect[8]; + break; #endif - case MED::eTETRA4: - anArray[0] = aConnect[0]; - anArray[1] = aConnect[2]; - anArray[2] = aConnect[1]; - anArray[3] = aConnect[3]; - break; + case MED::eTETRA4: + anArray[0] = aConnect[0]; + anArray[1] = aConnect[2]; + anArray[2] = aConnect[1]; + anArray[3] = aConnect[3]; + break; #if (defined(VTK_QUADRATIC_PYRAMID) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC) - case MED::ePYRA13: - anArray[0] = aConnect[0]; - anArray[1] = aConnect[3]; - anArray[2] = aConnect[2]; - anArray[3] = aConnect[1]; - anArray[4] = aConnect[4]; - - anArray[5] = aConnect[8]; - anArray[6] = aConnect[7]; - anArray[7] = aConnect[6]; - anArray[8] = aConnect[5]; - - anArray[9] = aConnect[9]; - anArray[10] = aConnect[12]; - anArray[11] = aConnect[11]; - anArray[12] = aConnect[10]; - break; + case MED::ePYRA13: + anArray[0] = aConnect[0]; + anArray[1] = aConnect[3]; + anArray[2] = aConnect[2]; + anArray[3] = aConnect[1]; + anArray[4] = aConnect[4]; + + anArray[5] = aConnect[8]; + anArray[6] = aConnect[7]; + anArray[7] = aConnect[6]; + anArray[8] = aConnect[5]; + + anArray[9] = aConnect[9]; + anArray[10] = aConnect[12]; + anArray[11] = aConnect[11]; + anArray[12] = aConnect[10]; + break; #endif - case MED::ePYRA5: - anArray[0] = aConnect[0]; - anArray[1] = aConnect[3]; - anArray[2] = aConnect[2]; - anArray[3] = aConnect[1]; - anArray[4] = aConnect[4]; - break; - default: - for(int iNode = 0; iNode < aVNbNodes; iNode++) - anArray[iNode] = aConnect[iNode]; - } - for(int iNode = 0; iNode < aVNbNodes; iNode++) - if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode]) - EXCEPTION(std::runtime_error,"LoadCellsOnEntity - "<< - " aNbPoints("<first; if(aType == MED::eNON_STRUCTURE){ - MED::PElemInfo anElemInfo; - switch(aMGeom){ - case MED::ePOLYGONE: { - anElemInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom); - break; - } - case MED::ePOLYEDRE: { - anElemInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom); - break; - } - default: { - anElemInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom); - break; - }} - if(anElemInfo){ - if(TInt aNbElem = anElemInfo->GetNbElem()){ - VISU::TSubMeshID aSubMeshID; - for(TInt iElem = 0; iElem < aNbElem; iElem++) - if(anElemInfo->GetFamNum(iElem) == anId) - aSubMeshID.push_back(iElem); - if(!aSubMeshID.empty()){ - VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom); - INITMSG(MYDEBUG,"aMGeom = "<GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom); + break; + } + case MED::ePOLYEDRE: { + anElemInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom); + break; + } + default: { + anElemInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom); + break; + }} + if(anElemInfo){ + if(TInt aNbElem = anElemInfo->GetNbElem()){ + VISU::TSubMeshID aSubMeshID; + for(TInt iElem = 0; iElem < aNbElem; iElem++) + if(anElemInfo->GetFamNum(iElem) == anId) + aSubMeshID.push_back(iElem); + if(!aSubMeshID.empty()){ + VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom); + INITMSG(MYDEBUG,"aMGeom = "<GetPGrilleInfo(aMeshInfo); - if(anElemInfo){ - TInt aNbElem = anElemInfo->GetNbCells(); - if(aNbElem>0 && (aMGeom == anElemInfo->GetGeom()) ){ - VISU::TSubMeshID aSubMeshID; - for(TInt iElem = 0; iElem < aNbElem; iElem++) - if(anElemInfo->GetFamNum(iElem) == anId) - aSubMeshID.push_back(iElem); - if(!aSubMeshID.empty()){ - VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom); - INITMSG(MYDEBUG,"aMGeom = "<GetPGrilleInfo(aMeshInfo); + if(anElemInfo){ + TInt aNbElem = anElemInfo->GetNbCells(); + if(aNbElem>0 && (aMGeom == anElemInfo->GetGeom()) ){ + VISU::TSubMeshID aSubMeshID; + for(TInt iElem = 0; iElem < aNbElem; iElem++) + if(anElemInfo->GetFamNum(iElem) == anId) + aSubMeshID.push_back(iElem); + if(!aSubMeshID.empty()){ + VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom); + INITMSG(MYDEBUG,"aMGeom = "<myElemNum; if(!anElemNum.empty()){ - VISU::TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID; - TInt aSize = anElemNum.size(); - aSubMeshID.resize(aSize); - for(TInt anId = 0; anId < aSize; anId++) - aSubMeshID[anId] = anElemNum[anId] - 1; + VISU::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, - "- aEGeom = "<GetPPolygoneInfo(aMeshInfo, - aMEntity, - aMGeom); + aMEntity, + aMGeom); anElemInfo = aPolygoneInfo; break; case MED::ePOLYEDRE: aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo, - aMEntity, - aMGeom); + aMEntity, + aMGeom); anElemInfo = aPolyedreInfo; break; default: aCellInfo = theMed->GetPCellInfo(aMeshInfo, - aMEntity, - aMGeom); + aMEntity, + aMGeom); anElemInfo = aCellInfo; } aGaussSubMesh->myIsElemNum = anElemInfo->IsElemNum(); @@ -2931,69 +2934,69 @@ LoadGaussMesh(const MED::PWrapper& theMed, VISU::PMEDGauss aGauss = aGaussSubMesh->myGauss; MED::PGaussInfo aGaussInfo = aGauss->myGaussInfo; if(aGaussInfo){ - aName = aGaussInfo->GetName(); - if(!aSubMeshID.empty()){ - const std::string& aProfileName = aSubProfile->myName; - MED::PProfileInfo aProfileInfo = MED::GetProfileInfo(theMed, - aProfileName); - if(aProfileInfo){ - const MED::TElemNum& anElemNum = aProfileInfo->myElemNum; - anIsGaussCoord3D = MED::GetGaussCoord3D(aGaussInfo, - aCellInfo, - aNodeInfo, - aGaussCoord, - anElemNum); - } - }else - anIsGaussCoord3D = MED::GetGaussCoord3D(aGaussInfo, - aCellInfo, - aNodeInfo, - aGaussCoord); + aName = aGaussInfo->GetName(); + if(!aSubMeshID.empty()){ + const std::string& aProfileName = aSubProfile->myName; + MED::PProfileInfo aProfileInfo = MED::GetProfileInfo(theMed, + aProfileName); + if(aProfileInfo){ + const MED::TElemNum& anElemNum = aProfileInfo->myElemNum; + anIsGaussCoord3D = MED::GetGaussCoord3D(aGaussInfo, + aCellInfo, + aNodeInfo, + aGaussCoord, + anElemNum); + } + }else + anIsGaussCoord3D = MED::GetGaussCoord3D(aGaussInfo, + aCellInfo, + aNodeInfo, + aGaussCoord); } }else{ if(!aSubMeshID.empty()){ - const std::string& aProfileName = aSubProfile->myName; - MED::PProfileInfo aProfileInfo = MED::GetProfileInfo(theMed, - aProfileName); - if(aProfileInfo){ - const MED::TElemNum& anElemNum = aProfileInfo->myElemNum; - switch(aMGeom){ - case MED::ePOLYGONE: - anIsGaussCoord3D = MED::GetBaryCenter(aPolygoneInfo, - aNodeInfo, - aGaussCoord, - anElemNum); - break; - case MED::ePOLYEDRE: - anIsGaussCoord3D = MED::GetBaryCenter(aPolyedreInfo, - aNodeInfo, - aGaussCoord, - anElemNum); - break; - default: - anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo, - aNodeInfo, - aGaussCoord, - anElemNum); - } - } + const std::string& aProfileName = aSubProfile->myName; + MED::PProfileInfo aProfileInfo = MED::GetProfileInfo(theMed, + aProfileName); + if(aProfileInfo){ + const MED::TElemNum& anElemNum = aProfileInfo->myElemNum; + switch(aMGeom){ + case MED::ePOLYGONE: + anIsGaussCoord3D = MED::GetBaryCenter(aPolygoneInfo, + aNodeInfo, + aGaussCoord, + anElemNum); + break; + case MED::ePOLYEDRE: + anIsGaussCoord3D = MED::GetBaryCenter(aPolyedreInfo, + aNodeInfo, + aGaussCoord, + anElemNum); + break; + default: + anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo, + aNodeInfo, + aGaussCoord, + anElemNum); + } + } }else - switch(aMGeom){ - case MED::ePOLYGONE: - anIsGaussCoord3D = MED::GetBaryCenter(aPolygoneInfo, - aNodeInfo, - aGaussCoord); - break; - case MED::ePOLYEDRE: - anIsGaussCoord3D = MED::GetBaryCenter(aPolyedreInfo, - aNodeInfo, - aGaussCoord); - break; - default: - anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo, - aNodeInfo, - aGaussCoord); - } + switch(aMGeom){ + case MED::ePOLYGONE: + anIsGaussCoord3D = MED::GetBaryCenter(aPolygoneInfo, + aNodeInfo, + aGaussCoord); + break; + case MED::ePOLYEDRE: + anIsGaussCoord3D = MED::GetBaryCenter(aPolyedreInfo, + aNodeInfo, + aGaussCoord); + break; + default: + anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo, + aNodeInfo, + aGaussCoord); + } } if(anIsGaussCoord3D){ @@ -3009,13 +3012,13 @@ LoadGaussMesh(const MED::PWrapper& theMed, TInt aNbCells = aNbElem*aNbGauss; INITMSG(MYDEBUG, - "- aEGeom = "< void FillValForTime(MED::SharedPtr theTimeStampValue, - const VISU::TGeom2SubProfile& theGeom2SubProfile, - VISU::PMEDValForTime theValForTime, - VISU::PMEDField theField) + const VISU::TGeom2SubProfile& theGeom2SubProfile, + VISU::PMEDValForTime theValForTime, + VISU::PMEDField theField) { theField->myDataSize = 0; TInt aNbComp = theField->myNbComp; @@ -3047,10 +3050,10 @@ FillValForTime(MED::SharedPtr theTimeStampValue, TInt aNbGauss = theValForTime->GetNbGauss(aEGeom); INITMSG(MYDEBUG, - "- aEGeom = "<