From 81e67f26e0990b125bdce7a3f9aeb5a1a5c3257b Mon Sep 17 00:00:00 2001 From: geay Date: Wed, 5 Mar 2014 17:49:03 +0100 Subject: [PATCH] improve HEXA27 management --- .../GaussPoints/InterpKernelGaussCoords.cxx | 181 +++++++++++++++++- .../GaussPoints/InterpKernelGaussCoords.hxx | 2 +- src/MEDLoader/MEDFileFieldOverView.cxx | 25 ++- src/MEDLoader/MEDFileFieldOverView.hxx | 1 + 4 files changed, 202 insertions(+), 7 deletions(-) diff --git a/src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.cxx b/src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.cxx index 42ef1a89d..97ccac266 100644 --- a/src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.cxx +++ b/src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.cxx @@ -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 // diff --git a/src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.hxx b/src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.hxx index 1e4409f26..465f191fd 100644 --- a/src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.hxx +++ b/src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.hxx @@ -118,7 +118,7 @@ namespace INTERP_KERNEL static void Hexa8DegQuad4cInit(GaussInfo& obj) { obj.hexa8DegQuad4cInit(); } void hexa20aInit(); void hexa20bInit(); - + void hexa27aInit(); private: //INFORMATION from MEDMEM diff --git a/src/MEDLoader/MEDFileFieldOverView.cxx b/src/MEDLoader/MEDFileFieldOverView.cxx index a677c4b05..a77d36324 100644 --- a/src/MEDLoader/MEDFileFieldOverView.cxx +++ b/src/MEDLoader/MEDFileFieldOverView.cxx @@ -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;igetCellModelEnum()!=INTERP_KERNEL::NORM_HEXA27) + { + int nnpc(scur->getNumberOfNodesPerCell()); + for(int i=0;i