]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Addition of polyline type.
authorageay <ageay>
Thu, 16 Feb 2012 13:45:19 +0000 (13:45 +0000)
committerageay <ageay>
Thu, 16 Feb 2012 13:45:19 +0000 (13:45 +0000)
src/INTERP_KERNEL/Bases/NormalizedUnstructuredMesh.hxx
src/INTERP_KERNEL/CellModel.cxx
src/MEDLoader/MEDLoader.cxx

index a5520aeb32a834416ef239d96fb8bf4dc2eda933..4421cd65bd9fe417130b806c143f822f1396f257 100644 (file)
@@ -35,6 +35,7 @@ namespace INTERP_KERNEL
       NORM_SEG2    =  1,
       NORM_SEG3    =  2,
       NORM_TRI3    =  3,
+      NORM_POLYL   =  33,
       NORM_QUAD4   =  4,
       NORM_POLYGON =  5,
       NORM_TRI6    =  6,
@@ -52,7 +53,7 @@ namespace INTERP_KERNEL
       NORM_HEXA20  = 30,
       NORM_POLYHED = 31,
       NORM_ERROR   = 40,
-      NORM_MAXTYPE = 32
+      NORM_MAXTYPE = 33
     } NormalizedCellType;
 
   class GenericMesh
index da006cbb65c8a87d34c4543f2d3707c88e9ba324..4c1ea74ddad4eeb3837dbc9037057fe913fe7c7d 100644 (file)
@@ -34,7 +34,7 @@ namespace INTERP_KERNEL
                                             "NORM_PYRA5", "NORM_PENTA6", "", "NORM_HEXA8", "",//15->19
                                             "NORM_TETRA10", "", "NORM_HEXGP12", "NORM_PYRA13", "",//20->24
                                             "NORM_PENTA15", "", "", "", "",//25->29
-                                            "NORM_HEXA20", "NORM_POLYHED", "NORM_QPOLYG", "", "",//30->34
+                                            "NORM_HEXA20", "NORM_POLYHED", "NORM_QPOLYG", "NORM_POLYL", "",//30->34
                                             "", "", "", "", "",//35->39
                                             "NORM_ERROR"};
 
@@ -98,6 +98,7 @@ namespace INTERP_KERNEL
     _map_of_unique_instance.insert(std::make_pair(NORM_POLYGON,CellModel(NORM_POLYGON)));
     _map_of_unique_instance.insert(std::make_pair(NORM_POLYHED,CellModel(NORM_POLYHED)));
     _map_of_unique_instance.insert(std::make_pair(NORM_QPOLYG,CellModel(NORM_QPOLYG)));
+    _map_of_unique_instance.insert(std::make_pair(NORM_POLYL,CellModel(NORM_POLYL)));
   }
 
   CellModel::CellModel(NormalizedCellType type):_type(type)
@@ -281,6 +282,10 @@ namespace INTERP_KERNEL
           _nb_of_pts=0; _nb_of_sons=0; _dim=2; _dyn=true; _is_simplex=false; _quadratic=true;
         }
         break;
+      case NORM_POLYL:
+        {
+          _nb_of_pts=0; _nb_of_sons=0; _dim=1; _dyn=true; _extruded_type=NORM_POLYGON; _is_simplex=false;
+        }
       case NORM_ERROR:
         {
           _nb_of_pts=std::numeric_limits<unsigned>::max(); _nb_of_sons=std::numeric_limits<unsigned>::max(); _dim=std::numeric_limits<unsigned>::max();
@@ -303,6 +308,8 @@ namespace INTERP_KERNEL
         else
           return lgth/2;
       }
+    else if(_dim==1)
+      return lgth;//NORM_POLYL
     else
       return std::count(conn,conn+lgth,-1)+1;
   }
@@ -321,6 +328,8 @@ namespace INTERP_KERNEL
         else
           return NORM_SEG3;
       }
+    else if(_dim==1)
+      return NORM_ERROR;//NORM_POLYL
     //polyedron
     return NORM_POLYGON;
   }
@@ -360,7 +369,7 @@ namespace INTERP_KERNEL
                 return 3;
               }
           }
-        else
+        else if(_dim==3)
           {//polyedron
             const int *where=nodalConn;
             for(int i=0;i<sonId;i++)
@@ -372,6 +381,8 @@ namespace INTERP_KERNEL
             std::copy(where,where2,sonNodalConn);
             return where2-where;
           }
+        else
+          throw INTERP_KERNEL::Exception("CellModel::fillSonCellNodalConnectivity2 : no sons on NORM_POLYL !");
       }
   }
 
@@ -393,7 +404,7 @@ namespace INTERP_KERNEL
         else
           return 3;
       }
-    else
+    else if(_dim==3)
       {//polyedron
         const int *where=nodalConn;
         for(unsigned int i=0;i<sonId;i++)
@@ -404,6 +415,8 @@ namespace INTERP_KERNEL
         const int *where2=std::find(where,nodalConn+lgth,-1);
         return where2-where;
       }
+    else
+      throw INTERP_KERNEL::Exception("CellModel::getNumberOfNodesConstituentTheSon2 : no sons on NORM_POLYL !");
   }
 
   /*!
index 72d588b865326adca5039e4b8e5065f2ccbcc935..09d8ddbe80a8a9d891655495db5b532579c84346 100644 (file)
@@ -91,7 +91,7 @@ INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO] = { INTERP_KERNE
                                                                     INTERP_KERNEL::NORM_POLYGON,
                                                                     INTERP_KERNEL::NORM_POLYHED };
 
-med_geometry_type typmai3[32] = { MED_POINT1,//0
+med_geometry_type typmai3[34] = { MED_POINT1,//0
                                   MED_SEG2,//1
                                   MED_SEG3,//2
                                   MED_TRIA3,//3
@@ -122,7 +122,9 @@ med_geometry_type typmai3[32] = { MED_POINT1,//0
                                   MED_NONE,//28
                                   MED_NONE,//29
                                   MED_HEXA20,//30
-                                  MED_POLYHEDRON//31
+                                  MED_POLYHEDRON,//31
+                                  MED_NONE,//32
+                                  MED_NONE//33
 };
 
 double MEDLoader::_EPS_FOR_NODE_COMP=1.e-12;