X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FMEDWrapper%2FFactory%2FMED_Test.cxx;fp=src%2FMEDWrapper%2FFactory%2FMED_Test.cxx;h=0000000000000000000000000000000000000000;hp=c8f72f33c6790e9d04faa6934e18487783c25378;hb=d3e1cabf77f67408ac401e2d387e721605cb3b10;hpb=d5029840731bccaa1718e65f0abf3b19198c7293 diff --git a/src/MEDWrapper/Factory/MED_Test.cxx b/src/MEDWrapper/Factory/MED_Test.cxx deleted file mode 100644 index c8f72f33c..000000000 --- a/src/MEDWrapper/Factory/MED_Test.cxx +++ /dev/null @@ -1,347 +0,0 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -#include "MED_Utilities.hxx" -#include "MED_Algorithm.hxx" -#include "MED_GaussUtils.hxx" -#include "MED_Factory.hxx" - -#ifdef _DEBUG_ -static int MYDEBUG = 1; -#else -// static int MYDEBUG = 0; -#endif - -static int MYWRITEDEBUG = 1; - -using namespace MED; - -#undef _DEBUG_ - -void CheckMed(const std::string& theFileName) -{ - MSG(MYDEBUG,"CheckMed - theFileName = '"<GetNbProfiles() = "<GetNbProfiles()<GetNbMeshes(); - BEGMSG(MYDEBUG,"GetNbMeshes() = "<GetPMeshInfo(iMesh); - INITMSG(MYDEBUG,"aMeshInfo->GetName() = '"<GetName()<<"'"<GetEntityInfo(aMeshInfo); - - TEntity2TGeom2ElemInfo anEntity2TGeom2ElemInfo = - GetEntity2TGeom2ElemInfo(aMed,aMeshInfo,aEntityInfo); - - TFieldInfo2TimeStampInfoSet aFieldInfo2TimeStampInfoSet = - GetFieldInfo2TimeStampInfoSet(aMed,aMeshInfo,aEntityInfo); - - TEntite2TFieldInfo2TimeStampInfoSet anEntite2TFieldInfo2TimeStampInfoSet = - GetEntite2TFieldInfo2TimeStampInfoSet(aFieldInfo2TimeStampInfoSet); - - TEntite2TFieldInfo2TimeStampInfoSet::const_iterator anEntite2TFieldInfo2TimeStampInfoSetIter = - anEntite2TFieldInfo2TimeStampInfoSet.begin(); - for(; anEntite2TFieldInfo2TimeStampInfoSetIter != anEntite2TFieldInfo2TimeStampInfoSet.end(); anEntite2TFieldInfo2TimeStampInfoSetIter++){ - const TFieldInfo2TimeStampInfoSet& aFieldInfo2TimeStampInfoSet = anEntite2TFieldInfo2TimeStampInfoSetIter->second; - TFieldInfo2TimeStampInfoSet::const_iterator aFieldInfo2TimeStampInfoSetIter = aFieldInfo2TimeStampInfoSet.begin(); - for(; aFieldInfo2TimeStampInfoSetIter != aFieldInfo2TimeStampInfoSet.end(); aFieldInfo2TimeStampInfoSetIter++){ - PFieldInfo aFieldInfo = aFieldInfo2TimeStampInfoSetIter->first; - INITMSG(MYDEBUG, - "GetPFieldInfo "<< - "- aName = '"<GetName()<<"'"<< - "; aType = "<GetType()<< - "; aNbComp = "<GetNbComp()<< - std::endl); - const TTimeStampInfoSet& aTimeStampInfoSet = aFieldInfo2TimeStampInfoSetIter->second; - TTimeStampInfoSet::const_iterator aTimeStampInfoSettIter = aTimeStampInfoSet.begin(); - for(; aTimeStampInfoSettIter != aTimeStampInfoSet.end(); aTimeStampInfoSettIter++){ - PTimeStampInfo aTimeStampInfo = *aTimeStampInfoSettIter; - INITMSG(MYDEBUG, - "GetPTimeStampInfo "<< - "- anEntity = "<GetEntity()<< - "; aNumDt = "<GetNumDt()<< - std::endl); - PTimeStampValueBase aTimeStampValue = - aMed->GetPTimeStampValue(aTimeStampInfo, - aMKey2Profile, - aKey2Gauss); - } - } - } - - continue; - - TFamilyInfoSet aFamilyInfoSet = GetFamilyInfoSet(aMed,aMeshInfo); - - TEntity2FamilySet aEntity2FamilySet = - GetEntity2FamilySet(aMed,anEntity2TGeom2ElemInfo,aFamilyInfoSet); - - TGroupInfo aGroupInfo = GetGroupInfo(aFamilyInfoSet); - - PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo); - TEntity2TGeom2ElemInfo::const_iterator anIter = anEntity2TGeom2ElemInfo.begin(); - for(; anIter != anEntity2TGeom2ElemInfo.end(); anIter++){ - const EEntiteMaillage& anEntity = anIter->first; - if(anEntity != eNOEUD){ - const TGeom2ElemInfo& aGeom2ElemInfo = anIter->second; - TKey2Gauss::const_iterator anIter2 = aKey2Gauss.begin(); - for(; anIter2 != aKey2Gauss.end(); anIter2++){ - const TGaussInfo::TKey& aKey = anIter2->first; - EGeometrieElement aGeom = boost::get<0>(aKey); - TGeom2ElemInfo::const_iterator anIter3 = aGeom2ElemInfo.find(aGeom); - if(anIter3 != aGeom2ElemInfo.end()){ - if(PCellInfo aCellInfo = anIter3->second){ - PGaussInfo aGaussInfo = anIter2->second; - TGaussCoord aGaussCoord; - GetGaussCoord3D(aGaussInfo,aCellInfo,aNodeInfo,aGaussCoord); - } - } - } - } - } - - } - } - MSG(MYDEBUG,"OK"); -} - - -void CopyMed(const PWrapper& theMed, - const PWrapper& theMed2, - int theIncr) -{ - TKey2Gauss aKey2Gauss = GetKey2Gauss(theMed); - TMKey2Profile aMKey2Profile = GetMKey2Profile(theMed); - - TInt aNbMeshes = theMed->GetNbMeshes(); - MSG(MYDEBUG,"aNbMeshes = "<GetPMeshInfo(iMesh+1); -#ifdef _DEBUG_ - TInt aDim = aMeshInfo->myDim; - aName = aMeshInfo->GetName(); - INITMSG(MYDEBUG,"GetMeshInfo - aName = '"<CrMeshInfo(aMeshInfo); - if(MYWRITEDEBUG){ - aName = aMeshInfo2->GetName(); - - aName[0] += theIncr; - aMeshInfo2->SetName(aName); - theMed2->SetMeshInfo(aMeshInfo2); - BEGMSG(MYDEBUG,"aNbMeshes2 = "<GetNbMeshes()<<"\n"); - } - - TEntityInfo aEntityInfo = theMed->GetEntityInfo(aMeshInfo); - - //continue; - - TInt aNbFields = theMed->GetNbFields(); - MSG(MYDEBUG,"GetNbFields() = "<GetPFieldInfo(aMeshInfo,iField+1); -#ifdef _DEBUG_ - TInt aNbComp = aFieldInfo->GetNbComp(); - INITMSG(MYDEBUG,"aName = '"<GetName()<<"'; aNbComp = "<CrFieldInfo(aMeshInfo2,aFieldInfo); - - if(MYWRITEDEBUG){ - aName = aFieldInfo->GetName(); - aName[0] += theIncr; - aFieldInfo2->SetName(aName); - theMed2->SetFieldInfo(aFieldInfo2); - } - - EEntiteMaillage anEntity; - TGeom2Size aGeom2Size; - TInt aNbTimeStamps = - theMed->GetNbTimeStamps(aFieldInfo,aEntityInfo,anEntity,aGeom2Size); - { - INITMSG(MYDEBUG,"GetNbTimeStamps = "<GetPTimeStampInfo(aFieldInfo,anEntity,aGeom2Size,iTimeStamp+1); -#ifdef _DEBUG_ - TInt aNumDt = aTimeStampInfo->GetNumDt(); - INITMSG(MYDEBUG,"aNumDt = "<CrTimeStampInfo(aFieldInfo2,aTimeStampInfo); - - PTimeStampValueBase aTimeStampValue = - theMed->GetPTimeStampValue(aTimeStampInfo, - aMKey2Profile, - aKey2Gauss); - - PTimeStampValueBase aTimeStampValue2 = - theMed->CrTimeStampValue(aTimeStampInfo2, - aTimeStampValue); - - if(MYWRITEDEBUG) theMed2->SetTimeStamp(aTimeStampValue2); - } - } - } - - TInt aNbFam = theMed->GetNbFamilies(aMeshInfo); - MSG(MYDEBUG,"GetNbFamilies() = "<GetPFamilyInfo(aMeshInfo,iFam+1); - TInt aNbGroup = aFamilyInfo->GetNbGroup(); -#ifdef _DEBUG_ - TInt aNbAttr = aFamilyInfo->GetNbAttr(); -#endif - TInt anId = aFamilyInfo->GetId(); - if(anId == 0) - continue; - - aName = aFamilyInfo->GetName(); -#ifdef _DEBUG_ - INITMSG(MYDEBUG,"aName = '"<CrFamilyInfo(aMeshInfo2,aFamilyInfo); - for(TInt iGroup = 0; iGroup < aNbGroup; iGroup++){ - aName = aFamilyInfo->GetGroupName(iGroup); - INITMSG(MYDEBUG,"aGroupName = '"<SetGroupName(iGroup,aName); - } - - if(MYWRITEDEBUG){ - aName = aFamilyInfo->GetName(); - aName[0] += theIncr; - aFamilyInfo2->SetName(aName); - theMed2->SetFamilyInfo(aFamilyInfo2); - INITMSG(MYDEBUG,"GetNbFamilies = "<GetNbFamilies(aMeshInfo2)<GetPNodeInfo(aMeshInfo); - PNodeInfo aNodeInfo2 = theMed->CrNodeInfo(aMeshInfo2,aNodeInfo); - if(MYWRITEDEBUG) theMed2->SetNodeInfo(aNodeInfo2); - continue; - } - TGeom2Size& aGeom2Size = anEntityInfoIter->second; - TGeom2Size::iterator aGeomIter = aGeom2Size.begin(); - for(; aGeomIter != aGeom2Size.end(); aGeomIter++){ - const EGeometrieElement& aGeom = aGeomIter->first; -#ifdef _DEBUG_ - const TInt& aNbElem = aGeomIter->second; - INITMSG(MYDEBUG,"aGeom = "<GetPPolygoneInfo(aMeshInfo,anEntity,aGeom); - PPolygoneInfo aPolygoneInfo2 = theMed->CrPolygoneInfo(aMeshInfo2,aPolygoneInfo); - if(MYWRITEDEBUG) theMed2->SetPolygoneInfo(aPolygoneInfo2); - break; - } - case ePOLYEDRE: { - PPolyedreInfo aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,anEntity,aGeom); - PPolyedreInfo aPolyedreInfo2 = theMed->CrPolyedreInfo(aMeshInfo2,aPolyedreInfo); - if(MYWRITEDEBUG) theMed2->SetPolyedreInfo(aPolyedreInfo2); - break; - } - default: - PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo,anEntity,aGeom); - PCellInfo aCellInfo2 = theMed2->CrCellInfo(aMeshInfo2,aCellInfo); - if(MYWRITEDEBUG) theMed2->SetCellInfo(aCellInfo2); - } - } - } - - } - MSG(MYDEBUG,"OK"); -} - - -void CopyMed(const std::string& theFileName, - const std::string& theFileName2, - MED::EVersion theVersion, - int theNbCopy) -{ - MSG(MYDEBUG,"CopyMed - theFileName = '"<