]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
debug salome tests
authorPaul RASCLE <paul.rascle@edf.fr>
Fri, 1 Jun 2018 07:39:05 +0000 (09:39 +0200)
committerPaul RASCLE <paul.rascle@edf.fr>
Fri, 1 Jun 2018 07:39:05 +0000 (09:39 +0200)
doc/salome/examples/h014_caseDigueManualInterpolZ.py
doc/salome/examples/h017_interpolationLineaire.py
doc/salome/examples/h018_streamInterpolation.py
src/HYDROData/HYDROData_CalculationCase.cxx
src/HYDROData/HYDROData_Region.cxx
src/HYDROData/HYDROData_ShapesGroup.cxx

index adfe9dcf6d540c2d5d0932c67d2d53134d08ccd3..0b34a67aa823a5c96c5452de0c61f41ecfc494f1 100644 (file)
@@ -613,7 +613,7 @@ m3d = True
 statz = interpolZ(nomCas, fichierMaillage, dicoGroupeRegion, zUndef, interpolMethod, m3d)
 #print statz
 refstatz = {'riveDroite': (10.88, 32.61, 24.09, 5.13, 17.57, 31.33, 0.2),
-            'riveGauche': (7.72, 72.40, 21.59, 8.37, 16.71, 35.71, 0.2),
+            'riveGauche': (7.72, 72.40, 21.59, 8.37, 16.71, 35.71, 0.3),
             'litMineur': (2.06, 25.41, 13.93, 4.33, 8.47, 21.78),
             'digue': (14.10, 27.09, 22.01, 2.56, 18.15, 25.02)}
 controlStatZ(statz, refstatz)
index d9be303b3f8a1352b6274eb4dd272c24a2d66e0e..86ef8deade166db48452d5ba95e3a9fc02631655 100644 (file)
@@ -365,7 +365,7 @@ m3d = True
 # --- Z interpolation on the bathymety/altimetry on the mesh nodes
 statz = interpolZ(nomCas, fichierMaillage, dicoGroupeRegion, zUndef, interpolMethod, m3d)
 #print statz
-refstatz = {'domaine': (27.10, 168.28, 91.77, 46.047, 28.637, 161.17)}
+refstatz = {'domaine': (27.10, 168.28, 91.77, 46.047, 28.637, 161.17, 0.2)}
 controlStatZ(statz, refstatz)
 
 # --- add a field on nodes of type double with z values, named "BOTTOM"
index 23e2d5c3cbb8c9a7b4e7b606230600d833c7b2e0..263eb1dfa02d25bda0e5718b18c5147dc927dda9 100644 (file)
@@ -358,8 +358,25 @@ geompy = geomBuilder.New(theStudy)
 # --- manual definition: useful groups of edges
 Case_1_plaine_Outer = geompy.CreateGroup(HYDRO_Case_1, geompy.ShapeType["EDGE"])
 geompy.UnionIDs(Case_1_plaine_Outer, [4, 12, 19, 23, 25, 21, 14, 9])
+
+# --- manual identification of all useful edge groups (boundary conditions)
+
+allEdgesIds = geompy.SubShapeAllIDs(HYDRO_Case_1, geompy.ShapeType["EDGE"])
+print "allEdgesIds", allEdgesIds
+
+(isDone, ClosedFreeBoundary, OpenFreeBoundary) = geompy.GetFreeBoundary(HYDRO_Case_1)
+geompy.addToStudyInFather(HYDRO_Case_1, ClosedFreeBoundary[0], "ClosedFreeBoundary")
+
+freeBoundary = geompy.ExtractShapes(ClosedFreeBoundary[0], geompy.ShapeType["EDGE"], True)
+freeBoundaryIds = [ geompy.GetSubShapeID(HYDRO_Case_1, freeBoundary[i]) for i in range(len(freeBoundary)) ]
+print "freeBoundaryIds", freeBoundaryIds
+
+edges_litMineur = geompy.GetSharedShapesMulti([HYDRO_Case_1, litMineur], geompy.ShapeType["EDGE"], True)
+edges_litMineurIds = [ geompy.GetSubShapeID(HYDRO_Case_1, edges_litMineur[i]) for i in range(len(edges_litMineur)) ]
+sectionsIds = [Id for Id in edges_litMineurIds if Id in freeBoundaryIds]
+print "sectionsIds", sectionsIds
 sections = geompy.CreateGroup(HYDRO_Case_1, geompy.ShapeType["EDGE"])
-geompy.UnionIDs(sections, [14, 12])
+geompy.UnionIDs(sections, sectionsIds)
 
 # --- publish in study
 geompy.addToStudyInFather( HYDRO_Case_1, riveGauche, 'riveGauche' )
index aac4b9badf1ad3177b16aeff8f63ec337f4addb4..7a18f687bd3acee687da0a0b3e41bf7334833ced 100644 (file)
@@ -1074,6 +1074,7 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var  theGeomEngine,
                                         QString& theErrorMsg,
                                         QString& statMess) const
 {
+  DEBTRACE("Export");
   HYDROData_ShapesGroup::SeqOfGroupsDefs aSeqOfGroupsDefs;
 
   // Get groups definitions
index 80c005cc4ad8b8ff1e6a443e587074745221b421..5961978fe65e7b570be9886567f85593f21a73f5 100644 (file)
@@ -51,6 +51,9 @@
 #include "gp_Pln.hxx"
 #include "BRepTools_ReShape.hxx"
 
+//#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
 //#define DEB_GET_REGION_SHAPE
 
 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Region, HYDROData_Entity)
@@ -246,6 +249,7 @@ void getUsedGroups( const TopoDS_Shape&                     theShape,
 
 TopoDS_Shape HYDROData_Region::GetShape( HYDROData_ShapesGroup::SeqOfGroupsDefs* theSeqOfGroups, const TopTools_SequenceOfShape* IntSh ) const
 {
+  DEBTRACE("GetShape");
   HYDROData_ShapesGroup::SeqOfGroupsDefs aSeqOfGroups;
   HYDROData_ShapesGroup::SeqOfGroupsDefs aSeqOfUsedGroups;
   if ( theSeqOfGroups )
@@ -285,6 +289,7 @@ TopoDS_Shape HYDROData_Region::GetShape( HYDROData_ShapesGroup::SeqOfGroupsDefs*
     getUsedGroups( aZoneFace, aSeqOfGroups, aSeqOfUsedGroups );
   } // zones iterator
 
+  DEBTRACE("--- IntSh->Length():" << IntSh->Length());
   for (int i = 1; i <= IntSh->Length(); i++)
   {
     const TopoDS_Shape& CS = (*IntSh)(i);
@@ -299,6 +304,7 @@ TopoDS_Shape HYDROData_Region::GetShape( HYDROData_ShapesGroup::SeqOfGroupsDefs*
 
   if ( aRegionFacesList.Extent() == 1 )
   {
+    DEBTRACE("--- aRegionFacesList.Extent() == 1 ");
     aResShape = TopoDS::Face( aRegionFacesList.First() );
   }
   else
@@ -330,6 +336,7 @@ TopoDS_Shape HYDROData_Region::GetShape( HYDROData_ShapesGroup::SeqOfGroupsDefs*
       //update history of internal edges
       TopTools_IndexedMapOfShape DIE;
       TopTools_ListOfShape newSh1, newSh2;
+      DEBTRACE("IE.Extent():" << IE.Extent());
       for (int i = 1; i <= IE.Extent(); i++)
       {
         const TopoDS_Shape& CSH = IE(i);
@@ -368,6 +375,7 @@ TopoDS_Shape HYDROData_Region::GetShape( HYDROData_ShapesGroup::SeqOfGroupsDefs*
     TopoDS_Face DF;
     if (!IE.IsEmpty())
     {
+      DEBTRACE("---!IE.IsEmpty() ");
       //add dummy face to existing shell
       //this face contains all internal edges
       //USD algo will skip such edges and will not perform unifying through them 
index 96b3d6c959fb535491589d8f79fdc2e108f33176..7eaad896c05b0786c72a1decae36ea25ab0044f3 100644 (file)
@@ -32,6 +32,9 @@
 #include <ShapeUpgrade_UnifySameDomain.hxx>
 #include <BRepTools_ReShape.hxx>
 
+//#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ShapesGroup,HYDROData_Entity)
 
 void HYDROData_ShapesGroup::GroupDefinition::Update( SeqOfGroupsDefs*          theGroupsDefs,
@@ -93,7 +96,13 @@ void HYDROData_ShapesGroup::GroupDefinition::Update( SeqOfGroupsDefs*
     {
       TopoDS_Shape aShape = aGroupDef.Shapes.Value( i );
 
-      TopoDS_Shape aGeneratedByAlgo = theAlgo->History()->Modified(aShape).First(); //??TODO check
+      TopoDS_Shape aGeneratedByAlgo = TopoDS_Shape();
+      if ( !theAlgo->History().IsNull() && ! aShape.IsNull())
+        {
+          const TopTools_ListOfShape& listModified = theAlgo->History()->Modified(aShape);
+          if (listModified.Extent() > 0)
+            aGeneratedByAlgo = listModified.First();
+        }
       if ( aGeneratedByAlgo.IsNull() )
       {
         // Edge has been removed