From: smh Date: Tue, 18 May 2004 04:58:22 +0000 (+0000) Subject: Fix on Bug SMESH5864 X-Git-Tag: Ecole_Ete_a6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f096a915381f6a9ca3f3e5465711a03d4f42e1cd;p=modules%2Fsmesh.git Fix on Bug SMESH5864 - Med file writer does not respect MED specifications for elements (Ecole_Ete_a4) --- diff --git a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx index 99da911a2..c37f1e60a 100644 --- a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx @@ -257,16 +257,23 @@ DriverMED_R_SMESHDS_Mesh::ReadStatus DriverMED_R_SMESHDS_Mesh::ReadMySelf() aNbNodes = 8; break; } -// if(anIsElemNum) -// cout<GetElemNum(iElem)<<": "; -// else -// cout< aNodeIds(aNbNodes); - for(int i = 0; i < aNbNodes; i++){ - aNodeIds.at(i) = aCellInfo->GetConn(iElem,i); - //cout<GetElemNum(aCellInfo->GetConn(iElem,i)-1); + } + }else{ + for(int i = 0; i < aNbNodes; i++){ + aNodeIds.at(i) = aCellInfo->GetConn(iElem,i); + } } - //cout<GetElemNum(iElem)<<": "; + //else + // cout< TNodeIdMap; + TNodeIdMap aNodeIdMap; + med_int aNbElems = myMesh->NbNodes(); MED::TIntVector anElemNums(aNbElems); MED::TIntVector aFamilyNums(aNbElems); @@ -218,7 +221,9 @@ void DriverMED_W_SMESHDS_Mesh::Add() aCoordinates[iCoord] = aNode->X(); aCoordinates[iCoord+1] = aNode->Y(); aCoordinates[iCoord+2] = aNode->Z(); - anElemNums[iNode] = aNode->GetID(); + TNodeIdMap::key_type aNodeId = aNode->GetID(); + anElemNums[iNode] = aNodeId; + aNodeIdMap[aNodeId] = iNode+1; //cout<GetID()<<": "<X()<<", "<Y()<<", "<Z()<nodesIterator(); for(med_int iNode = 0; iNode < aNbConnectivity && aNodesIter->more(); iNode++){ const SMDS_MeshElement* aNode = aNodesIter->next(); - aConnectivity[iConn+iNode] = aNode->GetID(); + aConnectivity[iConn+iNode] = aNodeIdMap[aNode->GetID()]; } anElemNums[iElem] = anElem->GetID(); - //cout<GetID()<<": "; - //for(med_int iNode = 0; iNode < aNbNodes; iNode++) - // cout<<(*aConnectivity)[iConn+iNode]<<", "; - //cout<push_back(anElem->GetID()); - //cout<GetID()<<": "; - //for(med_int iNode = 0; iNode < aNbNodes; iNode++) - // cout<<(*aConnectivity)[aSize+iNode]<<", "; - //cout<push_back(anElemFamMap[anElem]); @@ -464,14 +461,14 @@ void DriverMED_W_SMESHDS_Mesh::Add() // There is some difference between SMDS and MED in cells mapping switch(aNbNodes){ case 5: - (*aConnectivity)[aSize+0] = aVector[0]; - (*aConnectivity)[aSize+1] = aVector[3]; - (*aConnectivity)[aSize+2] = aVector[2]; - (*aConnectivity)[aSize+3] = aVector[1]; - (*aConnectivity)[aSize+4] = aVector[4]; + (*aConnectivity)[aSize+0] = aNodeIdMap[aVector[0]]; + (*aConnectivity)[aSize+1] = aNodeIdMap[aVector[3]]; + (*aConnectivity)[aSize+2] = aNodeIdMap[aVector[2]]; + (*aConnectivity)[aSize+3] = aNodeIdMap[aVector[1]]; + (*aConnectivity)[aSize+4] = aNodeIdMap[aVector[4]]; default: for(med_int iNode = 0; iNode < aNbNodes; iNode++) - (*aConnectivity)[aSize+iNode] = aVector[iNode]; + (*aConnectivity)[aSize+iNode] = aNodeIdMap[aVector[iNode]]; } anElemNums->push_back(anElem->GetID());