]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
improve HEXA27 management
authorgeay <anthony.geay@cea.fr>
Wed, 5 Mar 2014 16:49:03 +0000 (17:49 +0100)
committergeay <anthony.geay@cea.fr>
Wed, 5 Mar 2014 16:49:03 +0000 (17:49 +0100)
src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.cxx
src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.hxx
src/MEDLoader/MEDFileFieldOverView.cxx
src/MEDLoader/MEDFileFieldOverView.hxx

index 42ef1a89d3dcf1ac6282e1eeace1936673141037..97ccac266fe9aef2fd66275933ba93b101ca6d8b 100644 (file)
@@ -443,8 +443,16 @@ void GaussInfo::initLocalInfo()
         }
       break;
 
+    case NORM_HEXA27:
+      _my_local_ref_dim = 3;
+      _my_local_nb_ref  = 27;
+      hexa27aInit();
+      aSatify = isSatisfy();
+      CHECK_MACRO
+      break;
+
     default:
-      throw INTERP_KERNEL::Exception("Not manged cell type !");
+      throw INTERP_KERNEL::Exception("Not managed cell type !");
       break;
     }
 }
@@ -2462,7 +2470,178 @@ void GaussInfo::hexa20bInit()
    SHAPE_FUN_MACRO_END;
 }
 
+void GaussInfo::hexa27aInit()
+{
+  LOCAL_COORD_MACRO_BEGIN;
+ case 0:
+   coords[0] = -1.0;
+   coords[1] = -1.0;
+   coords[2] = -1.0;
+   break;
+ case 1:
+   coords[0] = -1.0;
+   coords[1] =  1.0;
+   coords[2] = -1.0;
+   break;
+ case 2:
+   coords[0] =  1.0;
+   coords[1] =  1.0;
+   coords[2] = -1.0;
+   break;
+ case 3:
+   coords[0] =  1.0;
+   coords[1] = -1.0;
+   coords[2] = -1.0;
+   break;
+ case 4:
+   coords[0] = -1.0;
+   coords[1] = -1.0;
+   coords[2] =  1.0;
+   break;
+ case 5:
+   coords[0] = -1.0;
+   coords[1] =  1.0;
+   coords[2] =  1.0;
+   break;
+ case 6:
+   coords[0] =  1.0;
+   coords[1] =  1.0;
+   coords[2] =  1.0;
+   break;
+ case 7:
+   coords[0] =  1.0;
+   coords[1] = -1.0;
+   coords[2] =  1.0;
+   break;
+ case 8:
+   coords[0] = -1.0;
+   coords[1] =  0.0;
+   coords[2] = -1.0;
+   break;
+ case 9:
+   coords[0] =  0.0;
+   coords[1] =  1.0;
+   coords[2] = -1.0;
+   break;
+ case 10:
+   coords[0] =  1.0;
+   coords[1] =  0.0;
+   coords[2] = -1.0;
+   break;
+ case 11:
+   coords[0] =  0.0;
+   coords[1] = -1.0;
+   coords[2] = -1.0;
+   break;
+ case 12:
+   coords[0] = -1.0;
+   coords[1] =  0.0;
+   coords[2] =  1.0;
+   break;
+ case 13:
+   coords[0] =  0.0;
+   coords[1] =  1.0;
+   coords[2] =  1.0;
+   break;
+ case 14:
+   coords[0] =  1.0;
+   coords[1] =  0.0;
+   coords[2] =  1.0;
+   break;
+ case 15:
+   coords[0] =  0.0;
+   coords[1] = -1.0;
+   coords[2] =  1.0;
+   break;
+ case 16:
+   coords[0] = -1.0;
+   coords[1] = -1.0;
+   coords[2] =  0.0;
+   break;
+ case 17:
+   coords[0] = -1.0;
+   coords[1] =  1.0;
+   coords[2] =  0.0;
+   break;
+ case 18:
+   coords[0] =  1.0;
+   coords[1] =  1.0;
+   coords[2] =  0.0;
+   break;
+ case 19:
+   coords[0] =  1.0;
+   coords[1] = -1.0;
+   coords[2] =  0.0;
+   break;
+ case 20:
+   coords[0] =  0.0;
+   coords[1] =  0.0;
+   coords[2] = -1.0;
+   break;
+ case 21:
+   coords[0] = -1.0;
+   coords[1] =  0.0;
+   coords[2] =  0.0;
+   break;
+ case 22:
+   coords[0] =  0.0;
+   coords[1] =  1.0;
+   coords[2] =  0.0;
+   break;
+ case 23:
+   coords[0] =  1.0;
+   coords[1] =  0.0;
+   coords[2] =  0.0;
+   break;
+ case 24:
+   coords[0] =  0.0;
+   coords[1] = -1.0;
+   coords[2] =  0.0;
+   break;
+ case 25:
+   coords[0] =  0.0;
+   coords[1] =  0.0;
+   coords[2] =  1.0;
+   break;
+ case 26:
+   coords[0] =  0.0;
+   coords[1] =  0.0;
+   coords[2] =  0.0;
+   break;
+   LOCAL_COORD_MACRO_END;
 
+   SHAPE_FUN_MACRO_BEGIN;
+
+   funValue[0] =0.125*gc[0]*(gc[0]-1.)*gc[1]*(gc[1]-1.)*gc[2]*(gc[2]-1.);
+   funValue[1] =0.125*gc[0]*(gc[0]-1.)*gc[1]*(gc[1]+1.)*gc[2]*(gc[2]-1.);
+   funValue[2] =0.125*gc[0]*(gc[0]+1.)*gc[1]*(gc[1]+1.)*gc[2]*(gc[2]-1.);
+   funValue[3] =0.125*gc[0]*(gc[0]+1.)*gc[1]*(gc[1]-1.)*gc[2]*(gc[2]-1.);
+   funValue[4] =0.125*gc[0]*(gc[0]-1.)*gc[1]*(gc[1]-1.)*gc[2]*(gc[2]+1.);
+   funValue[5] =0.125*gc[0]*(gc[0]-1.)*gc[1]*(gc[1]+1.)*gc[2]*(gc[2]+1.);
+   funValue[6] =0.125*gc[0]*(gc[0]+1.)*gc[1]*(gc[1]+1.)*gc[2]*(gc[2]+1.);
+   funValue[7] =0.125*gc[0]*(gc[0]+1.)*gc[1]*(gc[1]-1.)*gc[2]*(gc[2]+1.);
+   funValue[8] =0.25*(1.-gc[0])*(1.-gc[1]*gc[1])*(1.-gc[2]);
+   funValue[9] =0.25*(1.-gc[0]*gc[0])*(1.+gc[1])*(1.-gc[2]);
+   funValue[10]=0.25*(1.+gc[0])*(1.-gc[1]*gc[1])*(1.-gc[2]);
+   funValue[11]=0.25*(1.-gc[0]*gc[0])*(1.-gc[1])*(1.-gc[2]);
+   funValue[12]=0.25*(1.-gc[0])*(1.-gc[1]*gc[1])*(1.+gc[2]);
+   funValue[13]=0.25*(1.-gc[0]*gc[0])*(1.+gc[1])*(1.+gc[2]);
+   funValue[14]=0.25*(1.+gc[0])*(1.-gc[1]*gc[1])*(1.+gc[2]);
+   funValue[15]=0.25*(1.-gc[0]*gc[0])*(1.-gc[1])*(1.+gc[2]);
+   funValue[16]=0.25*(1.-gc[0])*(1.-gc[1])*(1.-gc[2]*gc[2]);
+   funValue[17]=0.25*(1.-gc[0])*(1.+gc[1])*(1.-gc[2]*gc[2]);
+   funValue[18]=0.25*(1.+gc[0])*(1.+gc[1])*(1.-gc[2]*gc[2]);
+   funValue[19]=0.25*(1.+gc[0])*(1.-gc[1])*(1.-gc[2]*gc[2]);
+   funValue[20]=0.5*(1.-gc[0]*gc[0])*(1.-gc[1]*gc[1])*gc[2]*(gc[2]-1.);
+   funValue[21]=0.5*gc[0]*(gc[0]-1.)*(1.-gc[1]*gc[1])*(1.-gc[2]*gc[2]);
+   funValue[22]=0.5*(1.-gc[0]*gc[0])*gc[1]*(gc[1]+1.)*(1.-gc[2]*gc[2]);
+   funValue[23]=0.5*gc[0]*(gc[0]+1.)*(1.-gc[1]*gc[1])*(1.-gc[2]*gc[2]);
+   funValue[24]=0.5*(1.-gc[0]*gc[0])*gc[1]*(gc[1]-1.)*(1.-gc[2]*gc[2]);
+   funValue[25]=0.5*(1.-gc[0]*gc[0])*(1.-gc[1]*gc[1])*gc[2]*(gc[2]+1.);
+   funValue[26]=(1.-gc[0]*gc[0])*(1.-gc[1]*gc[1])*(1.-gc[2]*gc[2]);
+   
+   SHAPE_FUN_MACRO_END;
+}
 
 ////////////////////////////////////////////////////////////////////////////////////////////////
 //                                GAUSS COORD CLASS                                           //
index 1e4409f260c890904704d1ee6da06ca2e639f183..465f191fd016778a5fc09b411d84f0eeea4f51c8 100644 (file)
@@ -118,7 +118,7 @@ namespace INTERP_KERNEL
     static void Hexa8DegQuad4cInit(GaussInfo& obj) { obj.hexa8DegQuad4cInit(); }
     void hexa20aInit();
     void hexa20bInit();
-
+    void hexa27aInit();
 
   private:
     //INFORMATION from MEDMEM
index a677c4b05629368989f9458e3918244c2b425d35..a77d36324762fccdeddee20e568269f1073996fa 100644 (file)
@@ -29,6 +29,8 @@ using namespace ParaMEDMEM;
 const unsigned char MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE[MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE_LGTH]=
   {1,3,21,5,9,7,22,34,23,28,255,255,255,255,10,14,13,255,12,255,24,255,16,27,255,26,255,29,255,255,25,42,36,4};
 
+const unsigned char MEDMeshMultiLev::HEXA27_PERM_ARRAY[27]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,24,22,21,23,20,25,26};
+
 const char MEDFileField1TSStructItem2::NEWLY_CREATED_PFL_NAME[]="???";
 
 MEDFileMeshStruct *MEDFileMeshStruct::New(const MEDFileMesh *mesh)
@@ -945,12 +947,25 @@ bool MEDUMeshMultiLev::buildVTUArrays(DataArrayDouble *& coords, DataArrayByte *
         throw INTERP_KERNEL::Exception("MEDUMeshMultiLev::getVTUArrays : internal error !");
       if(scur)
         {
-          int nnpc(scur->getNumberOfNodesPerCell());
-          for(int i=0;i<curNbCells;i++,connPtr+=nnpc)
+          if(cur->getCellModelEnum()!=INTERP_KERNEL::NORM_HEXA27)
+            {
+              int nnpc(scur->getNumberOfNodesPerCell());
+              for(int i=0;i<curNbCells;i++,connPtr+=nnpc)
+                {
+                  *dPtr++=nnpc;
+                  dPtr=std::copy(connPtr,connPtr+nnpc,dPtr);
+                  *cPtr++=k; k+=nnpc+1;
+                }
+            }
+          else
             {
-              *dPtr++=nnpc;
-              dPtr=std::copy(connPtr,connPtr+nnpc,dPtr);
-              *cPtr++=k; k+=nnpc+1;
+              for(int i=0;i<curNbCells;i++,connPtr+=27)
+                {
+                  *dPtr++=27;
+                  for(int j=0;j<27;j++,dPtr++)
+                    *dPtr=connPtr[HEXA27_PERM_ARRAY[j]];
+                  *cPtr++=k; k+=28;
+                }
             }
           if(isPolyh)
             { std::fill(ePtr,ePtr+curNbCells,-1); ePtr+=curNbCells; }
index b6d0da38c232eb5110f801d5582b2f28ea5524eb..6b7924565bc2a4e8320b36276e3ee0d20f3a8cd5 100644 (file)
@@ -120,6 +120,7 @@ namespace ParaMEDMEM
   public:
     static const int PARAMEDMEM_2_VTKTYPE_LGTH=34;
     static const unsigned char PARAMEDMEM_2_VTKTYPE[PARAMEDMEM_2_VTKTYPE_LGTH];
+    static const unsigned char HEXA27_PERM_ARRAY[27];
   };
   
   class MEDStructuredMeshMultiLev;