From f4ca8ef1016a9177a5b666b4acda00b03b877c37 Mon Sep 17 00:00:00 2001 From: apo Date: Mon, 3 Oct 2005 06:24:37 +0000 Subject: [PATCH] To introduce quadratic mesh elements --- src/CONVERTOR/VISU_Convertor_impl.cxx | 48 +++++-- src/CONVERTOR/VISU_Convertor_impl.hxx | 7 + src/CONVERTOR/VISU_MedConvertor.cxx | 178 ++++++++++++++++++++++---- 3 files changed, 193 insertions(+), 40 deletions(-) diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index 196b65bc..94a61b7e 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -841,9 +841,32 @@ namespace VISU case VTK_HEXAHEDRON: return 8; case VTK_WEDGE: return 6; case VTK_PYRAMID: return 5; + + case QUADRATIC_EDGE: return 3; + case QUADRATIC_TRIANGLE: return 6; + case QUADRATIC_QUAD: return 8; + case QUADRATIC_TETRA: return 10; + case QUADRATIC_HEXAHEDRON: return 20; + case QUADRATIC_WEDGE: return 15; + case QUADRATIC_PYRAMID: return 13; } return -1; } + + vtkIdType + VTKGeom2VISU(vtkIdType theGeom) + { + switch(theGeom){ + case QUADRATIC_EDGE: return VTK_POLY_LINE; + case QUADRATIC_TRIANGLE: return VTK_POLYGON; + case QUADRATIC_QUAD: return VTK_POLYGON; + case QUADRATIC_TETRA: return VTK_CONVEX_POINT_SET; + case QUADRATIC_HEXAHEDRON: return VTK_CONVEX_POINT_SET; + case QUADRATIC_WEDGE: return VTK_CONVEX_POINT_SET; + case QUADRATIC_PYRAMID: return VTK_CONVEX_POINT_SET; + } + return theGeom; + } } @@ -1245,15 +1268,16 @@ namespace { vtkIdType aNbCells = theSubProfile->myNbCells; vtkIdType aCellsSize = theSubProfile->myCellsSize; - vtkIdType aGeom = theSubProfile->myGeom; - vtkIdType aNbNodes = VTKGeom2NbNodes(aGeom); - + vtkIdType aVGeom = theSubProfile->myGeom; + vtkIdType aNbNodes = VTKGeom2NbNodes(aVGeom); + vtkIdType aGeom = VTKGeom2VISU(aVGeom); + const TSubMeshID& aSubMeshID = theSubProfile->mySubMeshID; const VISU::TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh; - VISU::TGeom2SubMesh::const_iterator anIter = aGeom2SubMesh.find(aGeom); + VISU::TGeom2SubMesh::const_iterator anIter = aGeom2SubMesh.find(aVGeom); if(anIter == aGeom2SubMesh.end()) - EXCEPTION(runtime_error,"GetCells >> There is no elements for the GEOM("<> There is no elements for the GEOM("<second; const TCell2Connect& aCell2Connect = aSubMesh.myCell2Connect; @@ -1308,7 +1332,7 @@ namespace const PProfileImpl& theProfile, const PSubProfileImpl& theSubProfile) { - INITMSG(MYDEBUG,"GetMeshOnSubProfile - aGeom = "<myGeom<> Can't find values for corresponding Gauss Points SubMesh"); @@ -1439,7 +1463,7 @@ namespace if(aNbGauss < 1) continue; - INITMSG(MYDEBUG,"- aGeom = "<first; - PSubProfile aSubProfile = CrSubProfile(aMGeom,theGeom2Size,aGeom2Profile); + PSubProfile aSubProfile = CrSubProfile(theMEDWrapper, + theMeshInfo, + theMEntity, + aMGeom, + theGeom2Size, + aGeom2Profile); aProfileKey.insert(aSubProfile); } @@ -219,8 +304,11 @@ namespace //--------------------------------------------------------------- void - InitProfile(MED::TTimeStampVal& theTimeStampVal, + InitProfile(const MED::PWrapper& theMEDWrapper, + const MED::PMeshInfo& theMeshInfo, + MED::TTimeStampVal& theTimeStampVal, VISU::TMEDMeshOnEntity& theMeshOnEntity, + MED::EEntiteMaillage theMEntity, const MED::TGeom2Size& theGeom2Size, VISU::TMEDValForTime& theValForTime) { @@ -228,8 +316,11 @@ namespace TProfileMap& aProfileMap = theMeshOnEntity.myProfileMap; - TProfileKey aProfileKey = GetProfileKey(theTimeStampVal, + TProfileKey aProfileKey = GetProfileKey(theMEDWrapper, + theMeshInfo, + theTimeStampVal, theMeshOnEntity, + theMEntity, theGeom2Size); TProfileMap::const_iterator anIter = aProfileMap.find(aProfileKey); @@ -383,15 +474,29 @@ namespace //--------------------------------------------------------------- void - InitGaussProfile(MED::TTimeStampVal& theTimeStampVal, + InitGaussProfile(const MED::PWrapper& theMEDWrapper, + const MED::PMeshInfo& theMeshInfo, + MED::TTimeStampVal& theTimeStampVal, VISU::TMEDMeshOnEntity& theMeshOnEntity, + MED::EEntiteMaillage theMEntity, const MED::TGeom2Size& theGeom2Size, VISU::TMEDValForTime& theValForTime) { INITMSG(MYDEBUG,"InitGaussProfile"<GetPCellInfo(aMeshInfo,aMEntity,aMGeom); TInt aNbElem = aCellInfo->GetNbElem(); aMeshOnEntity->myNbCells += aNbElem; @@ -809,8 +914,11 @@ namespace aValForTime->myTime = VISU::TTime(aDt,anUnitDt); INITMSG(MYDEBUG,"aDt = '"<first; - int aVGeom = MEDGeomToVTK(aMGeom); + vtkIdType aVGeom = MEDGeomToVTK(aMGeom); INITMSG(MYDEBUG,"aMGeom = "<GetPCellInfo(aMeshInfo,aMEntity,aMGeom); TInt aNbElem = aCellInfo->GetNbElem(); @@ -1514,15 +1622,29 @@ VISU_MedConvertor } switch(aMGeom){ - case MED::eTETRA4: case MED::eTETRA10: + anArray[4] = aConnect[4]; + anArray[5] = aConnect[5]; + anArray[6] = aConnect[7]; + anArray[7] = aConnect[6]; + anArray[8] = aConnect[8]; + anArray[9] = aConnect[9]; + case MED::eTETRA4: anArray[0] = aConnect[0]; anArray[1] = aConnect[1]; anArray[2] = aConnect[3]; anArray[3] = aConnect[2]; break; - case MED::ePYRA5: case MED::ePYRA13: + anArray[5] = aConnect[5]; + anArray[6] = aConnect[8]; + anArray[7] = aConnect[7]; + anArray[8] = aConnect[6]; + anArray[9] = aConnect[9]; + anArray[10] = aConnect[10]; + anArray[11] = aConnect[11]; + anArray[12] = aConnect[12]; + case MED::ePYRA5: anArray[0] = aConnect[0]; anArray[1] = aConnect[3]; anArray[2] = aConnect[2]; -- 2.39.2