From dd0e741332dd7c6190e71e01ea4778f66e1b40b4 Mon Sep 17 00:00:00 2001 From: apo Date: Fri, 2 Sep 2005 06:24:02 +0000 Subject: [PATCH] To improve Gauss Points mapping --- src/CONVERTOR/VISUConvertor.cxx | 59 ++++++++++++++++------------- src/CONVERTOR/VISU_MedConvertor.cxx | 11 +++--- 2 files changed, 38 insertions(+), 32 deletions(-) diff --git a/src/CONVERTOR/VISUConvertor.cxx b/src/CONVERTOR/VISUConvertor.cxx index a45cbf73..8fc31f24 100644 --- a/src/CONVERTOR/VISUConvertor.cxx +++ b/src/CONVERTOR/VISUConvertor.cxx @@ -69,16 +69,6 @@ void parseFile(const char* theFileName) const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap; VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter; - //Importing groups - const VISU::TGroupMap& aGroupMap = aMesh->myGroupMap; - VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin(); - for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){ - const string& aGroupName = aGroupMapIter->first; - aCon->GetMeshOnGroup(aMeshName,aGroupName); - } - - continue; - //Import fields aMeshOnEntityMapIter = aMeshOnEntityMap.begin(); for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){ @@ -94,27 +84,44 @@ void parseFile(const char* theFileName) for(; aValFieldIter != aValField.end(); aValFieldIter++){ int aTimeStamp = aValFieldIter->first; - VISU::PIDMapper anIDMapper = - aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp); - VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput(); - - int aNbCells = aDataSet->GetNumberOfCells(); - for(int anCellId = 0; anCellId < aNbCells; anCellId++){ - int anObjID = anIDMapper->GetElemObjID(anCellId); - int aVTKID = anIDMapper->GetElemVTKID(anObjID); - cout<GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp); - else{ - aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp); + if(anEntity != VISU::NODE_ENTITY){ + VISU::TVTKOutput* aDataSet = + aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp); + VISU::PGaussMesh aGaussMesh = + aCon->GetGaussMesh(aMeshName,anEntity,aFieldName,aTimeStamp); + + int aNbCells = aDataSet->GetNumberOfCells(); + for(int anCellId = 0; anCellId < aNbCells; anCellId++){ + VISU::TGaussPointID anObjID = aGaussMesh->GetObjID(anCellId); + cout<GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp); + VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput(); + + int aNbCells = aDataSet->GetNumberOfCells(); + for(int anCellId = 0; anCellId < aNbCells; anCellId++){ + int anObjID = anIDMapper->GetElemObjID(anCellId); + int aVTKID = anIDMapper->GetElemVTKID(anObjID); + cout<myGroupMap; + VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin(); + for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){ + const string& aGroupName = aGroupMapIter->first; + aCon->GetMeshOnGroup(aMeshName,aGroupName); + } + + //continue; + //Import mesh on entity cout << "\n\n ** TEST GetMeshOnEntityIDMapper ***" << endl; aMeshOnEntityMapIter = aMeshOnEntityMap.begin(); diff --git a/src/CONVERTOR/VISU_MedConvertor.cxx b/src/CONVERTOR/VISU_MedConvertor.cxx index 6d53a6d3..c9d54906 100644 --- a/src/CONVERTOR/VISU_MedConvertor.cxx +++ b/src/CONVERTOR/VISU_MedConvertor.cxx @@ -737,13 +737,12 @@ namespace TMEDGaussSubMesh ::GetObjID(vtkIdType theID) const { - TCellID aCellID = theID / myGauss->myNbPoints; - TLocalPntID aLocalPntID = theID % myGauss->myNbPoints; - + TInt aNbPoints = myGauss->myNbPoints; + TCellID aCellID = theID / aNbPoints; if(myIsElemNum) - aCellID = myElemNum[theID]; - else - aCellID = theID; + aCellID = myElemNum[aCellID]; + + TLocalPntID aLocalPntID = theID % aNbPoints; return TGaussPointID(aCellID,aLocalPntID); } -- 2.39.2