]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Introducing of Gauss Points SubMesh data structure
authorapo <apo@opencascade.com>
Thu, 21 Jul 2005 10:08:19 +0000 (10:08 +0000)
committerapo <apo@opencascade.com>
Thu, 21 Jul 2005 10:08:19 +0000 (10:08 +0000)
src/CONVERTOR/VISUConvertor.cxx
src/CONVERTOR/VISU_Convertor.hxx
src/CONVERTOR/VISU_Convertor_impl.cxx
src/CONVERTOR/VISU_Convertor_impl.hxx
src/CONVERTOR/VISU_MedConvertor.cxx
src/CONVERTOR/VISU_MedConvertor.hxx

index 5bdeef6f04cdfbc2ab5134b21ada786099c44b19..e43e8c0bbdb67618a5cc6eff2d09970e5af2e31a 100644 (file)
@@ -75,7 +75,8 @@ void parseFile(const char* theFileName) {
          }
        }
       }
-      //continue;
+      continue;
+
       //Importing groups
       const VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
       VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
index 8cd141fccf376f61441ea85ff52b4fef31e17c4c..31e38ff3b416af5d7ea8ad09ed87a848962a763a 100644 (file)
@@ -29,7 +29,6 @@
 
 #include <stdio.h>
 
-#include <list>
 #include <map>
 #include <set>
 #include <utility>
@@ -90,6 +89,12 @@ namespace VISU{
   typedef SharedPtr<TMesh> PMesh;
   typedef std::map<std::string,PMesh> TMeshMap;
 
+  struct TGaussSubMesh;
+  typedef SharedPtr<TGaussSubMesh> PGaussSubMesh;
+
+  struct TGaussMesh;
+  typedef SharedPtr<TGaussMesh> PGaussMesh;
+
   struct TSubProfile;
   typedef SharedPtr<TSubProfile> PSubProfile;
 
@@ -114,6 +119,8 @@ namespace VISU{
   struct TValForTime;
   typedef SharedPtr<TValForTime> PValForTime;
 
+  typedef std::vector<std::string> TNames;
+
 
   //---------------------------------------------------------------
   struct TBaseStructure
@@ -122,7 +129,15 @@ namespace VISU{
     {}
   };
 
-  typedef std::vector<std::string> TNames;
+
+  //---------------------------------------------------------------
+  struct TIntId: virtual TBaseStructure
+  {
+    int myId;
+
+    TIntId(): myId(0)
+    {}
+  };
 
 
   //---------------------------------------------------------------
@@ -160,18 +175,50 @@ namespace VISU{
     bool
     operator()(const PSubProfile& theLeft, const PSubProfile& theRight) const;
   };
+
   typedef std::set<PSubProfile,TSubProfileLess> TProfileKey;
+  typedef std::map<TProfileKey,PProfile> TProfileMap;
+
+
+  //---------------------------------------------------------------
+  struct TGauss: virtual TBaseStructure
+  {};
+
+
+  //---------------------------------------------------------------
+  struct TGaussSubMesh: virtual TBaseStructure
+  {
+    PSubProfile mySubProfile;
+    PGauss myGauss;
+  };
+
+  
+  //---------------------------------------------------------------
+  struct TGaussMesh: virtual TBaseStructure
+  {};
+
+
+  //---------------------------------------------------------------
+  struct TGaussSubMeshLess
+  {
+    bool
+    operator()(const PGaussSubMesh& theLeft, const PGaussSubMesh& theRight) const;
+  };
+
+  typedef std::set<PGaussSubMesh,TGaussSubMeshLess> TGaussKey;
+  typedef std::map<TGaussKey,PGaussMesh> TGaussMeshMap;
 
 
   //---------------------------------------------------------------
-  typedef std::map<TProfileKey,PProfile> TProfileMap;
 
   typedef std::map<std::string,PFamily> TFamilyMap;
   typedef std::map<std::string,PField> TFieldMap;
 
   struct TMeshOnEntity: virtual TBaseStructure
   {
+    TGaussMeshMap myGaussMeshMap;
     TProfileMap myProfileMap;
+
     TFamilyMap myFamilyMap;
     TFieldMap myFieldMap;
 
@@ -183,7 +230,7 @@ namespace VISU{
   //---------------------------------------------------------------
   typedef std::set<std::string> TBindGroups;
 
-  struct TFamily: virtual TBaseStructure
+  struct TFamily: virtual TIntId
   {
     TBindGroups myGroups;
     std::string myName;
@@ -206,7 +253,7 @@ namespace VISU{
   //---------------------------------------------------------------
   typedef std::map<int,PValForTime> TValField;
 
-  struct TField: virtual TBaseStructure
+  struct TField: virtual TIntId
   {
     TEntity myEntity;
     std::string myName;
@@ -221,16 +268,11 @@ namespace VISU{
   };
  
 
-  //---------------------------------------------------------------
-  struct TGauss: virtual TBaseStructure
-  {};
-
-
   //---------------------------------------------------------------
   typedef std::pair<double,std::string> TTime;
   typedef std::map<int,PGauss> TGaussMap;
 
-  struct TValForTime: virtual TBaseStructure
+  struct TValForTime: virtual TIntId
   {
     TEntity myEntity;
     std::string myMeshName;
@@ -238,6 +280,7 @@ namespace VISU{
     TTime myTime;
     
     PProfile myProfile;
+    PGaussMesh myGaussMesh;
     TGaussMap myGaussMap;
   };
 
index 53982f41ae3f897600c64eb5ec113de57772ab73..f1a7cc744eaa06b40b40544f305e6bad5560e250 100644 (file)
@@ -57,7 +57,7 @@ static float ERR_SIZE_CALC = 1.00;
 static int MYVTKDEBUG = 0;
 
 #ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
 static int MYDEBUGWITHFILES = 1;
 #else
 static int MYDEBUG = 0;
@@ -93,6 +93,22 @@ namespace VISU
   }
 
 
+  bool
+  TGaussSubMeshLess::
+  operator()(const PGaussSubMesh& theLeft, const PGaussSubMesh& theRight) const
+  {
+    PGaussImpl aLeft(theLeft->myGauss), aRight(theRight->myGauss);
+
+    if(aLeft->myGeom != aRight->myGeom)
+      return aLeft->myGeom < aRight->myGeom;
+
+    if(aLeft->myName != aRight->myName)
+      return aLeft->myName < aRight->myName;
+
+    return TSubProfileLess()(theLeft->mySubProfile,theRight->mySubProfile);
+  }
+
+
   bool
   TSubProfileLess
   ::operator()(const PSubProfile& theLeft, const PSubProfile& theRight) const
@@ -113,6 +129,11 @@ namespace VISU
   }
 
 
+  TGaussSubMeshImpl::TGaussSubMeshImpl():
+    myStatus(eNone)
+  {}
+  
+
   pair<int,int> 
   TMeshOnEntityImpl
   ::GetCellsDims(const string& theFamilyName) const
@@ -137,7 +158,7 @@ namespace VISU
     TGaussMap::const_iterator anIter2 = myGaussMap.find(theGeom);
     if(anIter2 != myGaussMap.end()){
       PGaussImpl aGauss = anIter2->second;
-      return aGauss->myNbPts;
+      return aGauss->myNbPoints;
     }
     return myNbGauss;
   }
@@ -304,9 +325,11 @@ namespace
       vtkIdType iEnd = theMesh->myPointsCoord.size();
       vtkIdType aNbPoints = iEnd / theMesh->myDim;
       aPoints->SetNumberOfPoints(aNbPoints);
+
       INITMSG(MYDEBUG,"GetPoints - aNbPoints = "<<aNbPoints<<
-             "; myDim = "<<theMesh->myDim<<
+             "; aDim = "<<theMesh->myDim<<
              endl);
+
       for(vtkIdType i = 0, j = 0; i < iEnd; i += theMesh->myDim, j++) 
        aPoints->SetPoint(j,
                          aCoordHelperPtr->GetCoord(i,eX),
@@ -356,21 +379,21 @@ namespace
     VISU::TGeom2Cell2Connect::const_iterator aGeom2Cell2ConnectIter = aGeom2Cell2Connect.begin();
     for(int i = 0, j = 0; aGeom2Cell2ConnectIter != aGeom2Cell2Connect.end(); aGeom2Cell2ConnectIter++){
       const VISU::TCell2Connect& anArray = aGeom2Cell2ConnectIter->second;
-      int aVtkType = aGeom2Cell2ConnectIter->first;
-      INITMSG(MYDEBUG,"aVtkType = "<<aVtkType<<
+      vtkIdType aGeom = aGeom2Cell2ConnectIter->first;
+      INITMSG(MYDEBUG,"aGeom = "<<aGeom<<
              "; anArray.size() = "<<anArray.size()<<
              endl);
       if(!aFamily)
        for(int k = 0, kEnd = anArray.size(); k < kEnd; k++, i++){
          PrintCells(i,aConnectivity,anArray[k]);
-         aCellTypesArray->SetValue(j++,(unsigned char)aVtkType);
+         aCellTypesArray->SetValue(j++,(unsigned char)aGeom);
        }
       else{
        const VISU::TGeom2SubMeshID& aGeom2SubMeshID = aFamily->myGeom2SubMeshID;
        if(aGeom2SubMeshID.empty()) 
          EXCEPTION(runtime_error,"GetCells >> There is no elements on the family !!!");
 
-       VISU::TGeom2SubMeshID::const_iterator aGeom2SubMeshIDIter = aGeom2SubMeshID.find(aVtkType);
+       VISU::TGeom2SubMeshID::const_iterator aGeom2SubMeshIDIter = aGeom2SubMeshID.find(aGeom);
        if(aGeom2SubMeshIDIter == aGeom2SubMeshID.end()) 
          continue;
 
@@ -382,7 +405,7 @@ namespace
        VISU::TSubMeshID::const_iterator aSubMeshIDIter = aSubMeshID.begin();
        for(; aSubMeshIDIter != aSubMeshID.end(); aSubMeshIDIter++, i++){
          PrintCells(i,aConnectivity,anArray[*aSubMeshIDIter]);
-         aCellTypesArray->SetValue(j++,(unsigned char)aVtkType);
+         aCellTypesArray->SetValue(j++,(unsigned char)aGeom);
        }
       }
     }
@@ -407,6 +430,7 @@ namespace
                  const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet) 
   {
     //Calculate dimentions of the group
+    INITMSG(MYDEBUG,"GetCellsOnGroup\n");
     int aNbCells = 0, aCellsSize = 0;
     VISU::TFamilyAndEntitySet::const_iterator aFamilyAndEntitySetIter = theFamilyAndEntitySet.begin();
     for(; aFamilyAndEntitySetIter != theFamilyAndEntitySet.end(); aFamilyAndEntitySetIter++){
@@ -434,19 +458,22 @@ namespace
       VISU::TGeom2Cell2Connect::const_iterator aGeom2Cell2ConnectIter = aGeom2Cell2Connect.begin();
       for(; aGeom2Cell2ConnectIter != aGeom2Cell2Connect.end(); aGeom2Cell2ConnectIter++){
        const VISU::TCell2Connect& anArray = aGeom2Cell2ConnectIter->second;
-       int aVtkType = aGeom2Cell2ConnectIter->first;
-       MSG(MYDEBUG,"GetCellsOnGroup - aVtkType = "<<aVtkType<<"; anArray.size() = "<<anArray.size());
+       vtkIdType aGeom = aGeom2Cell2ConnectIter->first;
+       INITMSG(MYDEBUG,"aGeom = "<<aGeom<<"; anArray.size() = "<<anArray.size());
+
        const VISU::TGeom2SubMeshID& aGeom2SubMeshID = aFamily->myGeom2SubMeshID;
        if(aGeom2SubMeshID.empty()) 
          EXCEPTION(runtime_error,"GetCells >> There is no elements on the family !!!");
-       VISU::TGeom2SubMeshID::const_iterator aGeom2SubMeshIDIter = aGeom2SubMeshID.find(aVtkType);
-       if(aGeom2SubMeshIDIter == aGeom2SubMeshID.end()) continue;
-       const VISU::TSubMeshID& aSubMeshID = aGeom2SubMeshIDIter->second;
-       MSG(MYDEBUG,"GetCellsOnGroup - aSubMeshID.size() = "<<aSubMeshID.size());
-       VISU::TSubMeshID::const_iterator aSubMeshIDIter = aSubMeshID.begin();
-       for(; aSubMeshIDIter != aSubMeshID.end(); aSubMeshIDIter++, i++){
-         PrintCells(i,aConnectivity,anArray[*aSubMeshIDIter]);
-         aCellTypesArray->SetValue(j++,(unsigned char)aVtkType);
+
+       VISU::TGeom2SubMeshID::const_iterator aGeom2SubMeshIDIter = aGeom2SubMeshID.find(aGeom);
+       if(aGeom2SubMeshIDIter != aGeom2SubMeshID.end()){
+         const VISU::TSubMeshID& aSubMeshID = aGeom2SubMeshIDIter->second;
+         INITMSG(MYDEBUG,"aSubMeshID.size() = "<<aSubMeshID.size());
+         VISU::TSubMeshID::const_iterator aSubMeshIDIter = aSubMeshID.begin();
+         for(; aSubMeshIDIter != aSubMeshID.end(); aSubMeshIDIter++, i++){
+           PrintCells(i,aConnectivity,anArray[*aSubMeshIDIter]);
+           aCellTypesArray->SetValue(j++,(unsigned char)aGeom);
+         }
        }
       }
     }
@@ -478,7 +505,7 @@ namespace
 
     const VISU::TValForCells& aValForCells = theValForTime->myValForCells;
     VISU::TValForCells::const_iterator anIter = aValForCells.begin();
-    for(int k = 0; anIter != aValForCells.end(); anIter++) {
+    for(int aTupleId = 0; anIter != aValForCells.end(); anIter++) {
       int aGeom = anIter->first;
       const VISU::TValForCellsWithType& anArray = anIter->second;
 
@@ -505,7 +532,7 @@ namespace
            }else
              aValue = anArray.at(aFirstId);
 
-           theFloatArray->SetTuple1(k++,aValue);
+           theFloatArray->SetTuple1(aTupleId++,aValue);
          }
        }
        break;
@@ -522,7 +549,7 @@ namespace
              aValue[iComp] = anArray[aFirstId];
 
          }
-         theFloatArray->SetTuple3(k++,aValue[0],aValue[1],0.0);
+         theFloatArray->SetTuple3(aTupleId++,aValue[0],aValue[1],0.0);
        }
        break;
       case 4:
@@ -538,7 +565,7 @@ namespace
              aValue[iComp] = anArray[aFirstId];
 
          }
-         theFloatArray->SetTuple3(k++,aValue[0],aValue[1],0.0);
+         theFloatArray->SetTuple3(aTupleId++,aValue[0],aValue[1],0.0);
        }
        break;
       default:
@@ -555,7 +582,7 @@ namespace
                aValue[iComp] = anArray[aFirstId];
              
            }
-           theFloatArray->SetTuple3(k++,aValue[0],aValue[1],aValue[2]);
+           theFloatArray->SetTuple3(aTupleId++,aValue[0],aValue[1],aValue[2]);
          }
        else
          EXCEPTION(runtime_error,"GetTimeStamp3 - There is no an algorithm for representation of the field !!!");
@@ -579,11 +606,9 @@ namespace
                const VISU::PFieldImpl theField, 
                const VISU::PValForTimeImpl theValForTime)
   {
-    int aNumberOfTuples = theField->myDataSize/theField->myNbComp;
+    int aNbTuples = theField->myDataSize/theField->myNbComp;
     string aFieldName = GenerateFieldName(theField,theValForTime);
-    INITMSG(MYDEBUG,"GetTimeStamp2"<<
-           "; aNumberOfTuples = "<<aNumberOfTuples<<
-           endl);
+    INITMSG(MYDEBUG,"GetTimeStamp2 - aNbTuples = "<<aNbTuples<<endl);
     
     vtkDataSetAttributes* aDataSetAttributes;
     switch(theField->myEntity){
@@ -606,7 +631,7 @@ namespace
     }
 
     GetTimeStamp3(aFloatArray,
-                 aNumberOfTuples,
+                 aNbTuples,
                  aFieldName,
                  theField,
                  theValForTime);
@@ -699,13 +724,18 @@ VISU_Convertor_impl
 ::GetMeshOnGroup(const string& theMeshName, 
                 const string& theGroupName)
 {
-  MSG(MYDEBUG,"GetMeshOnGroup - theMeshName = '"<<theMeshName<<
-      "'; theGroupName = '"<<theGroupName<<"'");
+  INITMSG(MYDEBUG,"GetMeshOnGroup\n");
+  INITMSGA(MYDEBUG,0,
+          "- theMeshName = '"<<theMeshName<<
+          "'; theGroupName = '"<<theGroupName<<"'"<<
+          endl);
+
   //Cheching possibility do the query
   TFindMeshOnGroup aFindMeshOnGroup = FindMeshOnGroup(theMeshName,theGroupName);
   PMeshImpl aMesh = boost::get<0>(aFindMeshOnGroup);
   PGroupImpl aGroup = boost::get<1>(aFindMeshOnGroup);
   const VISU::TFamilyAndEntitySet& aFamilyAndEntitySet = aGroup->myFamilyAndEntitySet;
+
   //Main part of code
   TVTKSource& aSource = aGroup->mySource;
   try{
@@ -740,14 +770,14 @@ GetCells(VISU::TVTKSource& theSource,
 {
   vtkIdType aNbCells = theSubProfile->myNbCells;
   vtkIdType aCellsSize = theSubProfile->myCellsSize;
-  vtkIdType aVGeom = theSubProfile->myGeom;
-  vtkIdType aNbNodes = VTKGeom2NbNodes(aVGeom);
+  vtkIdType aGeom = theSubProfile->myGeom;
+  vtkIdType aNbNodes = VTKGeom2NbNodes(aGeom);
 
   const TSubMeshID& aSubMeshID = theSubProfile->mySubMeshID;
   const TGeom2Cell2Connect& aGeom2Cell2Connect = theMeshOnEntity->myGeom2Cell2Connect;
-  TGeom2Cell2Connect::const_iterator aConnectIter = aGeom2Cell2Connect.find(aVGeom);
+  TGeom2Cell2Connect::const_iterator aConnectIter = aGeom2Cell2Connect.find(aGeom);
   if(aConnectIter == aGeom2Cell2Connect.end())
-    EXCEPTION(runtime_error,"GetCells >> There is no elements for the GEOM("<<aVGeom<<")");
+    EXCEPTION(runtime_error,"GetCells >> There is no elements for the GEOM("<<aGeom<<")");
   
   const TCell2Connect& aCell2Connect = aConnectIter->second;
     
@@ -762,7 +792,7 @@ GetCells(VISU::TVTKSource& theSource,
     for(vtkIdType anId = 0, aConnId = 0; anIter != aCell2Connect.end(); anIter++){
       const TConnect& anArray = aCell2Connect[anId];
       PrintCells(aConnId,aConnectivity,anArray);
-      aCellTypesArray->SetValue(anId,(unsigned char)aVGeom);
+      aCellTypesArray->SetValue(anId,(unsigned char)aGeom);
       aConnId += aNbNodes;
       anId++;
     }
@@ -772,7 +802,7 @@ GetCells(VISU::TVTKSource& theSource,
       vtkIdType aSubId = *anIter;
       const TConnect& anArray = aCell2Connect[aSubId];
       PrintCells(aConnId,aConnectivity,anArray);
-      aCellTypesArray->SetValue(anId,(unsigned char)aVGeom);
+      aCellTypesArray->SetValue(anId,(unsigned char)aGeom);
       aConnId += aNbNodes;
       anId++;
     }
@@ -800,14 +830,14 @@ GetMeshOnSubProfile(PMeshImpl theMesh,
                    PProfileImpl theProfile,
                    PSubProfileImpl theSubProfile)
 {
-  INITMSG(MYDEBUG,"GetMeshOnSubProfile"<<endl);
+  INITMSG(MYDEBUG,"GetMeshOnSubProfile - aGeom = "<<theSubProfile->myGeom<<endl);
 
   TVTKSource& aSource = theSubProfile->mySource;
   if(theSubProfile->myIsInitialized)
     return;
 
   GetPoints(aSource,theMesh);
-  BEGMSG(MYDEBUG,"GetNumberOfPoints = "<<aSource->GetNumberOfPoints()<<endl);
+  INITMSGA(MYDEBUG,0,"GetNumberOfPoints - "<<aSource->GetNumberOfPoints()<<endl);
   GetCells(aSource,theSubProfile,theMeshOnEntity);
   BEGMSG(MYDEBUG,"GetNumberOfCells - "<<aSource->GetNumberOfCells()<<endl);
 
index 5d226983297a0fcef354d0f74eb22f1a8c771413..09a8e3e866708f9fc0c040584ef7416385b018b4 100644 (file)
@@ -43,15 +43,6 @@ namespace VISU
   };
 
 
-  struct TIntId: virtual TBaseStructure
-  {
-    vtkIdType myId;
-
-    TIntId(): myId(0)
-    {}
-  };
-
-
   //---------------------------------------------------------------
   struct TMeshImpl: virtual TMesh
   {
@@ -105,6 +96,31 @@ namespace VISU
   typedef SharedPtr<TProfileImpl> PProfileImpl;
 
 
+  //---------------------------------------------------------------
+  struct TGaussImpl: virtual TGauss
+  {
+    vtkIdType myGeom;
+    std::string myName;
+
+    vtkIdType myNbPoints;
+  };
+  typedef SharedPtr<TGaussImpl> PGaussImpl;
+
+
+  //---------------------------------------------------------------
+  struct TGaussSubMeshImpl: virtual TGaussSubMesh, virtual TSource
+  {
+    TGaussSubMeshImpl();
+
+    ESubMeshStatus myStatus;
+  };
+
+
+  //---------------------------------------------------------------
+  struct TGaussMeshImpl: virtual TGaussMesh
+  {};
+
+
   //---------------------------------------------------------------
   typedef std::vector<vtkIdType> TConnect;
   typedef std::vector<TConnect> TCell2Connect;
@@ -121,7 +137,7 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  struct TFamilyImpl: virtual TFamily, virtual TSource, virtual TIntId
+  struct TFamilyImpl: virtual TFamily, virtual TSource
   {
     TGeom2SubMeshID myGeom2SubMeshID;
   };
@@ -136,7 +152,7 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  struct TFieldImpl: virtual TField, virtual TIntId
+  struct TFieldImpl: virtual TField
   {
     vtkIdType myDataSize;
 
@@ -146,25 +162,18 @@ namespace VISU
   typedef SharedPtr<TFieldImpl> PFieldImpl;
 
 
-  //---------------------------------------------------------------
-  struct TGaussImpl: virtual TGauss
-  {
-    vtkIdType myNbPts;
-  };
-  typedef SharedPtr<TGaussImpl> PGaussImpl;
-
-
   //---------------------------------------------------------------
   typedef std::vector<float> TValForCellsWithType;
   typedef std::map<vtkIdType,TValForCellsWithType> TValForCells;
 
-  struct TValForTimeImpl: virtual TValForTime, virtual TSource, virtual TIntId
+  struct TValForTimeImpl: virtual TValForTime, virtual TSource
   {
     TValForCells myValForCells;
 
+    int myNbGauss;
+
     int
     GetNbGauss(vtkIdType theGeom) const;
-    int myNbGauss;
   };
   typedef SharedPtr<TValForTimeImpl> PValForTimeImpl;
 
index 3dde308d14e629678d664e0ed1b3f938ba46d1d1..38c8266061b083f0703726ae11e3686b706d772a 100644 (file)
@@ -42,7 +42,7 @@ using namespace MED;
 using namespace VISU;
 
 #ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
 #else
 static int MYDEBUG = 0;
 #endif
@@ -54,6 +54,7 @@ namespace{
   using namespace VISU;
   
 
+  //---------------------------------------------------------------
   int
   MEDGeom2NbNodes(MED::EGeometrieElement theMEDGeomType)
   { 
@@ -61,6 +62,7 @@ namespace{
   }
 
 
+  //---------------------------------------------------------------
   int
   MEDGeomToVTK(MED::EGeometrieElement theMEDGeomType)
   { 
@@ -87,6 +89,7 @@ namespace{
   }
 
 
+  //---------------------------------------------------------------
   MED::EGeometrieElement 
   VTKGeomToMED(int theVTKGeomType)
   { 
@@ -106,6 +109,7 @@ namespace{
   }
 
 
+  //---------------------------------------------------------------
   TEntity
   MEDEntityToVTK(MED::EEntiteMaillage theMEDEntity)
   {
@@ -119,6 +123,7 @@ namespace{
   }
 
 
+  //---------------------------------------------------------------
   MED::EEntiteMaillage 
   VTKEntityToMED(TEntity theVTKEntity)
   {
@@ -132,49 +137,137 @@ namespace{
   }
 
 
-  TProfileKey
-  GetProfileKey(const MED::TTimeStampVal& theTimeStampVal,
-               const VISU::TMEDMeshOnEntity& theMeshOnEntity,
-               const MED::TGeom2Size& theGeom2Size)
+  //---------------------------------------------------------------
+  PMEDSubProfile
+  CrSubProfile(MED::EGeometrieElement theMGeom,
+              const MED::TGeom2Size& theGeom2Size,
+              const MED::TGeom2Profile& theGeom2Profile)
   {
-    INITMSG(MYDEBUG,"GetProfileKey"<<endl);
+    INITMSG(MYDEBUG,"CrSubProfile()"<<endl);
+
+    vtkIdType aVGeom = MEDGeomToVTK(theMGeom);
+    vtkIdType aVNbNodes = VTKGeom2NbNodes(aVGeom);
+
+    PMEDSubProfile aSubProfile(new TMEDSubProfile());
+    aSubProfile->myGeom = aVGeom;
+    aSubProfile->myStatus = eAddAll;
+
+    TGeom2Size::const_iterator aTimeStampIter = theGeom2Size.find(theMGeom);
+    if(aTimeStampIter == theGeom2Size.end())
+      aSubProfile->myStatus = eRemoveAll;
+    else{
+      aSubProfile->myNbCells = aTimeStampIter->second;
+      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->myStatus = eAddPart;
+      }
+    }
+    aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
     
-    TProfileKey aProfileKey;
+    INITMSGA(MYDEBUG,0,
+            "- aVGeom = "<<aVGeom<<
+            "; aName = '"<<aSubProfile->myName<<"'"<<
+            "; aStatus = "<<aSubProfile->myStatus<<
+            "; aNbCells = "<<aSubProfile->myNbCells<<
+            "; aCellsSize = "<<aSubProfile->myCellsSize<<
+            endl);
+    
+    return aSubProfile;
+  }
+
+
+  //---------------------------------------------------------------
+  TGaussKey
+  GetGaussKey(const MED::TTimeStampVal& theTimeStampVal,
+             const VISU::TMEDMeshOnEntity& theMeshOnEntity,
+             const MED::TGeom2Size& theGeom2Size)
+  {
+    INITMSG(MYDEBUG,"GetGaussKey"<<endl);
+
+    TGaussKey aGaussKey;
     const TGeom2Profile& aGeom2Profile = theTimeStampVal.GetGeom2Profile();
+    const TTimeStampInfo& aTimeStampInfo = theTimeStampVal.GetTimeStampInfo();
+    const TGeom2Gauss& aGeom2Gauss = aTimeStampInfo.GetGeom2Gauss();
     const TGeom2Size& aGeom2Size = theMeshOnEntity.myGeom2Size;
     TGeom2Size::const_iterator anIter = aGeom2Size.begin();
     for(; anIter != aGeom2Size.end(); anIter++){
-      MED::EGeometrieElement aMGeom = anIter->first;
+      EGeometrieElement aMGeom = anIter->first;
+      PMEDGaussSubMesh aGaussSubMesh(new TMEDGaussSubMesh());
+      aGaussSubMesh->myStatus = eAddAll;
+
+      PSubProfile aSubProfile = CrSubProfile(aMGeom,theGeom2Size,aGeom2Profile);
+      aGaussSubMesh->mySubProfile = aSubProfile;
+      PMEDGauss aGauss(new TMEDGauss());
+      aGaussSubMesh->myGauss = aGauss;
+
       vtkIdType aVGeom = MEDGeomToVTK(aMGeom);
       vtkIdType aVNbNodes = VTKGeom2NbNodes(aVGeom);
-      
-      PMEDSubProfile aSubProfile(new TMEDSubProfile());
-      aSubProfile->myGeom = aVGeom;
-      aSubProfile->myStatus = eAddAll;
-      aSubProfile->myNbCells = 0;
-      
-      MED::TGeom2Size::const_iterator aTimeStampIter = theGeom2Size.find(aMGeom);
+      aGauss->myGeom = aVGeom;
+
+      std::string aName;
+      TInt aNbGauss = 0;
+
+      TGeom2Size::const_iterator aTimeStampIter = theGeom2Size.find(aMGeom);
       if(aTimeStampIter == theGeom2Size.end())
-       aSubProfile->myStatus = eRemoveAll;
+       aGaussSubMesh->myStatus = eRemoveAll;
       else{
-       aSubProfile->myNbCells = aTimeStampIter->second;
-       MED::TGeom2Profile::const_iterator aProfileIter = aGeom2Profile.find(aMGeom);
-       if(aProfileIter != aGeom2Profile.end()){
-         MED::PProfileInfo aProfileInfo = aProfileIter->second;
-         aSubProfile->myNbCells = aProfileInfo->myElemNum.size();
-         aSubProfile->myName = aProfileInfo->GetName();
-         aSubProfile->myStatus = eAddPart;
+       TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom);
+       TInt aNbCells = aTimeStampIter->second;
+       if(aGaussIter != aGeom2Gauss.end()){
+         PGaussInfo aGaussInfo = aGaussIter->second;
+
+         aName = aGaussInfo->GetName();
+         aGauss->myName = aName;
+
+         aNbGauss = aGaussInfo->GetNbGauss();
+         aGauss->myNbPoints = aNbGauss;
+
+         aGaussSubMesh->myNbCells = aNbCells*aNbGauss;
+         aGaussSubMesh->myCellsSize = aGaussSubMesh->myNbCells*2;
+
+         aGaussSubMesh->myStatus = eAddPart;
+       }else{
+         aGaussSubMesh->myNbCells = aNbCells;
+         aGaussSubMesh->myCellsSize = aGaussSubMesh->myNbCells*(aVNbNodes+1);
        }
       }
-      aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
-      
-      INITMSG(MYDEBUG,"aVGeom = "<<aVGeom<<
-             "; aNbCells = "<<aSubProfile->myNbCells<<
-             "; aCellsSize = "<<aSubProfile->myCellsSize<<
-             "; aStatus = "<<aSubProfile->myStatus<<
-             "; aName = '"<<aSubProfile->myName<<"'"<<
-             endl);
-      
+
+      INITMSGA(MYDEBUG,0,
+              "- aVGeom = "<<aVGeom<<
+              "; aName = '"<<aName<<"'"<<
+              "; aNbGauss = "<<aNbGauss<<
+              "; aStatus = "<<aGaussSubMesh->myStatus<<
+              "; aNbCells = "<<aGaussSubMesh->myNbCells<<
+              "; aCellsSize = "<<aGaussSubMesh->myCellsSize<<
+              endl);
+    
+      aGaussKey.insert(aGaussSubMesh);
+    }
+
+    return aGaussKey;
+  }
+
+
+  //---------------------------------------------------------------
+  TProfileKey
+  GetProfileKey(const MED::TTimeStampVal& theTimeStampVal,
+               const VISU::TMEDMeshOnEntity& theMeshOnEntity,
+               const MED::TGeom2Size& theGeom2Size)
+  {
+    INITMSG(MYDEBUG,"GetProfileKey"<<endl);
+    
+    TProfileKey aProfileKey;
+    const TGeom2Profile& aGeom2Profile = theTimeStampVal.GetGeom2Profile();
+
+    const TGeom2Size& aGeom2Size = theMeshOnEntity.myGeom2Size;
+    TGeom2Size::const_iterator anIter = aGeom2Size.begin();
+    for(; anIter != aGeom2Size.end(); anIter++){
+      EGeometrieElement aMGeom = anIter->first;
+      PSubProfile aSubProfile = CrSubProfile(aMGeom,theGeom2Size,aGeom2Profile);
       aProfileKey.insert(aSubProfile);
     }
     
@@ -182,6 +275,7 @@ namespace{
   }
   
 
+  //---------------------------------------------------------------
   void
   InitProfile(MED::TTimeStampVal& theTimeStampVal,
              VISU::TMEDValForTime& theValForTime,
@@ -340,7 +434,8 @@ VISU_MedConvertor
                aMeshOnEntity->myCellsSize += aNbConnii;
              }
              
-             INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<
+             INITMSG(MYDEBUG,
+                     "- aMGeom = "<<aMGeom<<
                      "; aNbElem = "<<aNbElem<<
                      "; aNbConn= "<<aNbConn<<
                      endl);
@@ -352,7 +447,6 @@ VISU_MedConvertor
                  aFamilyCellsSizeCounterMap[aFamId] += aPolygoneInfo->GetNbConn(iElem) + 1;
                }
              }
-             ADDMSG(MYDEBUG,endl);
              break;
            }
            case ePOLYEDRE: {
@@ -369,7 +463,9 @@ VISU_MedConvertor
                int aNbConnii = aPolyedreInfo->GetNbConn(ii);
                aMeshOnEntity->myCellsSize += aNbConnii;
              }
-             INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<
+
+             INITMSG(MYDEBUG,
+                     "- aMGeom = "<<aMGeom<<
                      "; aNbElem = "<<aNbElem<<
                      "; aNbConn= "<<aNbConn<<
                      endl);
@@ -381,7 +477,6 @@ VISU_MedConvertor
                  aFamilyCellsSizeCounterMap[aFamId] += aPolyedreInfo->GetNbConn(iElem) + 1;
                }
              }
-             ADDMSG(MYDEBUG,endl);
              break;
            }
            default: {
@@ -391,7 +486,9 @@ VISU_MedConvertor
              TInt aNbElem = aCellInfo->GetNbElem();
              aMeshOnEntity->myNbCells += aNbElem;
              aMeshOnEntity->myCellsSize += aNbElem*(aVNbNodes+1);
-             INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<
+
+             INITMSG(MYDEBUG,
+                     "- aMGeom = "<<aMGeom<<
                      "; aNbElem = "<<aNbElem<<
                      "; myNbCells = "<<aMeshOnEntity->myNbCells<<
                      "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
@@ -404,9 +501,7 @@ VISU_MedConvertor
                  aFamilyCellsSizeCounterMap[aFamId] += aVNbNodes + 1;
                }
              }
-             ADDMSG(MYDEBUG,endl);
-           }
-           } // end switch(...)
+           }} // end switch(...)
          }
        }
       }
@@ -458,7 +553,7 @@ VISU_MedConvertor
        }
       }
       
-      BEGMSG(MYDEBUG,"VISU::TGroup:\n");
+      BEGMSG(MYDEBUG,"TGroup:\n");
       
       VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
       TGroupInfo::const_iterator aGroupInfoIter = aGroupInfo.begin();
@@ -506,7 +601,7 @@ VISU_MedConvertor
        }
        if(!aGroup->myFamilyAndEntitySet.empty() && aGroup->myNbCells > 0){
          BEGMSG(MYDEBUG,"myNbCells = "<<aGroup->myNbCells<<
-                "; myCellsSize = "<<aGroup->myCellsSize<<"\n\n");
+                "; myCellsSize = "<<aGroup->myCellsSize<<"\n");
          aGroupMap.insert(VISU::TGroupMap::value_type(aGroupName,aGroup));
        }
       }
@@ -570,7 +665,11 @@ VISU_MedConvertor
          aValForTime->myNbGauss = aTimeStampInfo->GetNbGauss();
          aValForTime->myTime = VISU::TTime(aDt,anUnitDt);
          INITMSG(MYDEBUG,"aDt = "<<aDt<<", "<<anUnitDt<<"\n");
-         
+
+         GetGaussKey(aTimeStampVal,
+                     aMeshOnEntity,
+                     aGeom2Size);
+
          InitProfile(aTimeStampVal,
                      aValForTime,
                      aMeshOnEntity,
@@ -584,7 +683,7 @@ VISU_MedConvertor
            PGaussInfo aGaussInfo = anIter->second;
            PMEDGauss aMEDGauss(new TMEDGauss());
            aMEDGauss->myGaussInfo = aGaussInfo;
-           aMEDGauss->myNbPts = aGaussInfo->GetNbGauss();
+           aMEDGauss->myNbPoints = aGaussInfo->GetNbGauss();
            aGaussMap[MEDGeomToVTK(aMGeom)] = aMEDGauss;
          }
        }
@@ -999,11 +1098,12 @@ VISU_MedConvertor
   const TGeom2Gauss& aGeom2Gauss = aTimeStampInfo->GetGeom2Gauss();
   TInt aNbComp = theField->myNbComp;
 
-  BEGMSG(MYDEBUG,"aMeshName = '"<<aMeshName<<"'"<<
-        "; aFieldName = '"<<aFieldInfo->GetName()<<"'"<<
-        "; aMEntity = "<<aMEntity<<
-        "; aNbComp = "<<aNbComp<<
-        endl);
+  INITMSGA(MYDEBUG,0,
+          "- aMeshName = '"<<aMeshName<<"'"<<
+          "; aFieldName = '"<<aFieldInfo->GetName()<<"'"<<
+          "; aMEntity = "<<aMEntity<<
+          "; aNbComp = "<<aNbComp<<
+          endl);
 
   theField->myDataSize = 0;
 
@@ -1015,16 +1115,17 @@ VISU_MedConvertor
     TInt aNbElem = aSubProfile->myNbCells;
     theField->myDataSize += aNbElem*aNbComp;
 
-    MED::EGeometrieElement aMGeom = VTKGeomToMED(aVGeom);
-    TInt aNbGauss = theValForTime->GetNbGauss(aMGeom);
+    TInt aNbGauss = theValForTime->GetNbGauss(aVGeom);
 
     if(aSubProfile->myStatus != eRemoveAll){
-      INITMSG(MYDEBUG,"aVGeom = "<<aVGeom<<
+      INITMSG(MYDEBUG,
+             "- aVGeom = "<<aVGeom<<
              "; aNbElem = "<<aNbElem<<
              "; aNbGauss = "<<aNbGauss<<
              endl);
 
       TValForCellsWithType& anArray = theValForTime->myValForCells[aVGeom];
+      MED::EGeometrieElement aMGeom = VTKGeomToMED(aVGeom);
       anArray.resize(aNbComp*aNbElem*aNbGauss);
       for(TInt iElem = 0, anId = 0; iElem < aNbElem; iElem++){
        for(TInt iComp = 0; iComp < aNbComp; iComp++){
index c931b5b5af0c802b85b94a2771e644ca1abb93a1..58b2afb16f0d6ca6c5352611ef63430c93c10047 100644 (file)
@@ -24,38 +24,66 @@ namespace VISU{
   };
   typedef SharedPtr<TMEDMesh> PMEDMesh;
 
+
+  //---------------------------------------------------------------
   struct TMEDSubProfile: TSubProfileImpl
   {};
   typedef SharedPtr<TMEDSubProfile> PMEDSubProfile;
 
+
+  //---------------------------------------------------------------
   struct TMEDProfile: TProfileImpl
   {};
   typedef SharedPtr<TMEDProfile> PMEDProfile;
 
+
+  //---------------------------------------------------------------
+  struct TMEDGauss: TGaussImpl
+  {
+    MED::PGaussInfo myGaussInfo;
+  };
+  typedef SharedPtr<TMEDGauss> PMEDGauss;
+
+
+  //---------------------------------------------------------------
+  struct TMEDGaussSubMesh: virtual TGaussSubMeshImpl
+  {};
+  typedef SharedPtr<TMEDGaussSubMesh> PMEDGaussSubMesh;
+
+
+  //---------------------------------------------------------------
+  struct TMEDGaussMesh: virtual TGaussMeshImpl
+  {};
+  typedef SharedPtr<TMEDGaussMesh> PMEDGaussMesh;
+
+
+  //---------------------------------------------------------------
   struct TMEDMeshOnEntity: TMeshOnEntityImpl
   {
     MED::TGeom2Size myGeom2Size;
   };
   typedef SharedPtr<TMEDMeshOnEntity> PMEDMeshOnEntity;
 
+
+  //---------------------------------------------------------------
   struct TMEDFamily: TFamilyImpl
   {};
   typedef SharedPtr<TMEDFamily> PMEDFamily;
   
+
+  //---------------------------------------------------------------
   struct TMEDGroup: TGroupImpl
   {};
   typedef SharedPtr<TMEDGroup> PMEDGroup;
 
+
+  //---------------------------------------------------------------
   struct TMEDField: TFieldImpl
   {};
   typedef SharedPtr<TMEDField> PMEDField;
 
-  struct TMEDGauss: TGaussImpl
-  {
-    MED::PGaussInfo myGaussInfo;
-  };
-  typedef SharedPtr<TMEDGauss> PMEDGauss;
 
+  //---------------------------------------------------------------
   struct TMEDValForTime: TValForTimeImpl
   {};
   typedef SharedPtr<TMEDValForTime> PMEDValForTime;