From c8978c3dedaa21e001970ef98231adf712b42333 Mon Sep 17 00:00:00 2001 From: apo Date: Wed, 3 Aug 2005 12:27:48 +0000 Subject: [PATCH] To implement mapping a pseudo Gauss Points that is located at BaryCenter of the mesh elements --- src/CONVERTOR/VISU_Convertor_impl.cxx | 20 +-- src/CONVERTOR/VISU_MedConvertor.cxx | 186 ++++++++++++++------------ 2 files changed, 108 insertions(+), 98 deletions(-) diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index ae2be549..a0ece5a6 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -334,12 +334,14 @@ namespace VISU ::GetNbGauss(vtkIdType theGeom) const { PGaussMeshImpl aGaussMesh = myGaussMesh; - const TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh; - TGeom2GaussSubMesh::const_iterator anIter = aGeom2GaussSubMesh.find(theGeom); - if(anIter != aGeom2GaussSubMesh.end()){ - PGaussSubMesh aGaussSubMesh = anIter->second; - PGaussImpl aGauss = aGaussSubMesh->myGauss; - return aGauss->myNbPoints; + if(aGaussMesh){ + const TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh; + TGeom2GaussSubMesh::const_iterator anIter = aGeom2GaussSubMesh.find(theGeom); + if(anIter != aGeom2GaussSubMesh.end()){ + PGaussSubMesh aGaussSubMesh = anIter->second; + PGaussImpl aGauss = aGaussSubMesh->myGauss; + return aGauss->myNbPoints; + } } return myNbGauss; } @@ -1327,15 +1329,15 @@ VISU_Convertor_impl PProfileImpl aProfile = aValForTime->myProfile; PGaussMeshImpl aGaussMesh = aValForTime->myGaussMesh; - const TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh; - INITMSG(MYDEBUG,"aGeom2GaussSubMesh.size() = "<myGeom2SubProfile; - TGaussKey aGaussKey; const MED::TGeom2Profile& aGeom2Profile = theTimeStampVal.GetGeom2Profile(); const MED::TTimeStampInfo& aTimeStampInfo = theTimeStampVal.GetTimeStampInfo(); const MED::TGeom2Gauss& aGeom2Gauss = aTimeStampInfo.GetGeom2Gauss(); @@ -276,45 +276,45 @@ namespace INITMSG(MYDEBUG,"anIter2 == aGeom2SubProfile.end!!"<second; MED::TGeom2Size::const_iterator aTimeStampIter = theGeom2Size.find(aMGeom); if(aTimeStampIter != theGeom2Size.end()){ - MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom); - if(aGaussIter != aGeom2Gauss.end()){ - PMEDGaussSubMesh aGaussSubMesh(new TMEDGaussSubMesh()); - - PMEDSubProfile aSubProfile = anIter2->second; - aGaussSubMesh->mySubProfile = aSubProfile; - aGaussSubMesh->myStatus = aSubProfile->myStatus; + TInt aNbCells = aTimeStampIter->second; + + PMEDGaussSubMesh aGaussSubMesh(new TMEDGaussSubMesh()); + aGaussSubMesh->mySubProfile = aSubProfile; + aGaussSubMesh->myStatus = aSubProfile->myStatus; - PMEDGauss aGauss(new TMEDGauss()); - aGaussSubMesh->myGauss = aGauss; - aGauss->myGeom = aVGeom; + PMEDGauss aGauss(new TMEDGauss()); + aGaussSubMesh->myGauss = aGauss; + aGauss->myGeom = aVGeom; + + TInt aNbGauss = 1; + std::string aName; + MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom); + if(aGaussIter != aGeom2Gauss.end()){ MED::PGaussInfo aGaussInfo = aGaussIter->second; aGauss->myGaussInfo = aGaussInfo; - - std::string aName = aGaussInfo->GetName(); - aGauss->myName = aName; - - TInt aNbCells = aTimeStampIter->second; - TInt aNbGauss = aGaussInfo->GetNbGauss(); - aGauss->myNbPoints = aNbGauss; - - aGaussSubMesh->myNbCells = aNbCells*aNbGauss; - aGaussSubMesh->myCellsSize = aGaussSubMesh->myNbCells*2; - - INITMSGA(MYDEBUG,0, - "- aVGeom = "<myIsDone) + if(!aGaussMesh || aGaussMesh->myIsDone) return; const MED::PMeshInfo& aMeshInfo = theMesh->myMeshInfo; @@ -1150,33 +1153,33 @@ LoadGaussMesh(const MED::PWrapper& theMed, const TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh; const MED::TTimeStampInfo& aTimeStampInfo = theTimeStampVal.GetTimeStampInfo(); const MED::TGeom2Gauss& aGeom2Gauss = aTimeStampInfo.GetGeom2Gauss(); - MED::TGeom2Gauss::const_iterator anIter = aGeom2Gauss.begin(); - for(; anIter != aGeom2Gauss.end(); anIter++){ - MED::PGaussInfo aGaussInfo = anIter->second; - MED::EGeometrieElement aMGeom = anIter->first; - vtkIdType aVGeom = MEDGeomToVTK(aMGeom); - TGeom2GaussSubMesh::const_iterator anIter2 = aGeom2GaussSubMesh.find(aVGeom); - if(anIter2 != aGeom2GaussSubMesh.end()){ - PMEDGaussSubMesh aGaussSubMesh = anIter2->second; + TGeom2GaussSubMesh::const_iterator aSubMeshIter = aGeom2GaussSubMesh.begin(); + for(; aSubMeshIter != aGeom2GaussSubMesh.end(); aSubMeshIter++){ + PMEDGaussSubMesh aGaussSubMesh = aSubMeshIter->second; + vtkIdType aVGeom = aSubMeshIter->first; + + if(aGaussSubMesh->myIsDone) + continue; + + PMEDSubProfile aSubProfile = aGaussSubMesh->mySubProfile; + const TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID; + MED::EGeometrieElement aMGeom = aSubProfile->myMGeom; - if(aGaussSubMesh->myIsDone) - continue; + MED::PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo, + aMEntity, + aMGeom); + + std::string aName; + MED::TGaussCoord aGaussCoord; + bool anIsGaussCoord3D = false; + MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom); + if(aGaussIter != aGeom2Gauss.end()){ PMEDGauss aGauss = aGaussSubMesh->myGauss; MED::PGaussInfo aGaussInfo = aGauss->myGaussInfo; - if(aGaussInfo){ - MED::PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo, - aMEntity, - aMGeom); - - MED::TGaussCoord aGaussCoord; - - PMEDSubProfile aSubProfile = aGaussSubMesh->mySubProfile; - const TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID; - - bool anIsGaussCoord3D = false; + aName = aGaussInfo->GetName(); if(!aSubMeshID.empty()){ MED::PProfileInfo aProfileInfo = aSubProfile->myProfileInfo; const MED::TElemNum& anElemNum = aProfileInfo->myElemNum; @@ -1190,41 +1193,46 @@ LoadGaussMesh(const MED::PWrapper& theMed, aCellInfo, aNodeInfo, aGaussCoord); - - if(anIsGaussCoord3D){ - TPointCoords& aCoords = aGaussSubMesh->myPointCoords; - TInt aNbGauss = aGaussCoord.GetNbGauss(); - TInt aNbElem = aGaussCoord.GetNbElem(); - TInt aDim = aGaussCoord.GetDim(); - vtkIdType aNbCells = aNbElem*aNbGauss; - aCoords.Init(aNbCells,aDim); - for(TInt anElemId = 0, aNodeId = 0; anElemId < aNbElem; anElemId++){ - MED::TCoordSliceArr aCoordSliceArr = aGaussCoord.GetCoordSliceArr(anElemId); - for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++, aNodeId++){ - MED::TCoordSlice aCoordSlice = aCoordSliceArr[aGaussId]; - TCoordSlice aSlice = aCoords.GetCoordSlice(aNodeId); - for(TInt aDimId = 0; aDimId < aDim; aDimId++) - aSlice[aDimId] = aCoordSlice[aDimId]; - } - } - - aGaussSubMesh->myIsDone = true;; - - INITMSG(MYDEBUG, - "- aVGeom = "<