1 // VISU OBJECT : interactive object for VISU entities implementation
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File : VISU_MedConvertor.cxx
24 // Author : Alexey PETROV
28 #include "VISU_MedConvertor.hxx"
29 #include "VISU_Convertor.hxx"
30 #include "VISU_ConvertorUtils.hxx"
32 #include "MED_Factory.hxx"
33 #include "MED_Algorithm.hxx"
34 #include "MED_GaussUtils.hxx"
35 #include "MED_Utilities.hxx"
37 #include "CASCatch.hxx"
39 #include <vtkCellType.h>
49 static int MYDEBUG = 0;
50 static int MYVALUEDEBUG = 0;
51 static int MY_FAMILY_DEBUG = 0;
52 static int MY_GROUP_DEBUG = 0;
55 static int MYDEBUG = 0;
56 static int MYVALUEDEBUG = 0;
57 static int MY_FAMILY_DEBUG = 0;
58 static int MY_GROUP_DEBUG = 0;
61 #define _LOAD_FAMILIES_
62 #define _EDF_NODE_IDS_
66 //---------------------------------------------------------------
68 MEDGeom2NbNodes(MED::EGeometrieElement theMEDGeomType)
70 return theMEDGeomType % 100;
74 //---------------------------------------------------------------
76 MEDGeom2VISU(MED::EGeometrieElement theGeom)
79 case MED::ePOINT1: return VISU::ePOINT1;
80 case MED::eSEG2: return VISU::eSEG2;
81 case MED::eTRIA3: return VISU::eTRIA3;
82 case MED::eQUAD4: return VISU::eQUAD4;
83 case MED::eTETRA4: return VISU::eTETRA4;
84 case MED::eHEXA8: return VISU::eHEXA8;
85 case MED::ePENTA6: return VISU::ePENTA6;
86 case MED::ePYRA5: return VISU::ePYRA5;
88 case MED::eSEG3: return VISU::eSEG3;
89 case MED::eTRIA6: return VISU::eTRIA6;
90 case MED::eQUAD8: return VISU::eQUAD8;
91 case MED::eTETRA10: return VISU::eTETRA10;
92 case MED::eHEXA20: return VISU::eHEXA20;
93 case MED::ePENTA15: return VISU::ePENTA15;
94 case MED::ePYRA13: return VISU::ePYRA13;
96 case MED::ePOLYGONE: return VISU::ePOLYGONE;
97 case MED::ePOLYEDRE: return VISU::ePOLYEDRE;
103 //---------------------------------------------------------------
104 MED::EGeometrieElement
105 VISUGeom2MED(int theGeom)
108 case VISU::ePOINT1: return MED::ePOINT1;
109 case VISU::eSEG2: return MED::eSEG2;
110 case VISU::eTRIA3: return MED::eTRIA3;
111 case VISU::eQUAD4: return MED::eQUAD4;
112 case VISU::eTETRA4: return MED::eTETRA4;
113 case VISU::eHEXA8: return MED::eHEXA8;
114 case VISU::ePENTA6: return MED::ePENTA6;
115 case VISU::ePYRA5: return MED::ePYRA5;
117 case VISU::eSEG3: return MED::eSEG3;
118 case VISU::eTRIA6: return MED::eTRIA6;
119 case VISU::eQUAD8: return MED::eQUAD8;
120 case VISU::eTETRA10: return MED::eTETRA10;
121 case VISU::eHEXA20: return MED::eHEXA20;
122 case VISU::ePENTA15: return MED::ePENTA15;
123 case VISU::ePYRA13: return MED::ePYRA13;
125 case VISU::ePOLYGONE: return MED::ePOLYGONE;
126 case VISU::ePOLYEDRE: return MED::ePOLYEDRE;
128 return MED::EGeometrieElement(-1);
132 //---------------------------------------------------------------
134 MEDEntityToVTK(MED::EEntiteMaillage theMEDEntity)
136 switch(theMEDEntity){
137 case MED::eNOEUD: return NODE_ENTITY;
138 case MED::eARETE: return EDGE_ENTITY;
139 case MED::eFACE: return FACE_ENTITY;
140 case MED::eMAILLE: return CELL_ENTITY;
142 return VISU::TEntity(-1);
146 //---------------------------------------------------------------
148 VTKEntityToMED(TEntity theVTKEntity)
150 switch(theVTKEntity){
151 case NODE_ENTITY: return MED::eNOEUD;
152 case EDGE_ENTITY: return MED::eARETE;
153 case FACE_ENTITY: return MED::eFACE;
154 case CELL_ENTITY: return MED::eMAILLE;
156 return MED::EEntiteMaillage(-1);
160 //---------------------------------------------------------------
162 CrSubProfile(const MED::PWrapper& theMEDWrapper,
163 const MED::PMeshInfo& theMeshInfo,
164 MED::EEntiteMaillage theMEntity,
165 MED::EGeometrieElement theMGeom,
166 const MED::TGeom2Size& theGeom2Size,
167 const MED::TGeom2Profile& theGeom2Profile)
169 VISU::EGeometry aEGeom = MEDGeom2VISU(theMGeom);
170 vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
172 PMEDSubProfile aSubProfile(new TMEDSubProfile());
173 aSubProfile->myGeom = aEGeom;
174 aSubProfile->myMGeom = theMGeom;
175 aSubProfile->myStatus = eAddAll;
177 MED::TGeom2Size::const_iterator aTimeStampIter = theGeom2Size.find(theMGeom);
178 if(aTimeStampIter == theGeom2Size.end())
179 aSubProfile->myStatus = eRemoveAll;
181 MED::TGeom2Profile::const_iterator aProfileIter = theGeom2Profile.find(theMGeom);
182 if(aProfileIter != theGeom2Profile.end()){
183 MED::PProfileInfo aProfileInfo = aProfileIter->second;
185 aSubProfile->myName = aProfileInfo->GetName();
186 aSubProfile->myStatus = eAddPart;
188 const MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
189 TInt aNbElem = anElemNum.size();
190 aSubProfile->myNbCells = aNbElem;
192 case MED::ePOLYGONE: {
193 MED::PPolygoneInfo aPolygoneInfo =
194 theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom);
195 for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
196 TInt aNbConn = aPolygoneInfo->GetNbConn(anElemNum[anElemId]);
197 aSubProfile->myCellsSize += aNbConn;
201 case MED::ePOLYEDRE: {
202 MED::PPolyedreInfo aPolyedreInfo =
203 theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom);
204 for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
205 MED::TCConnSliceArr aConnSliceArr =
206 aPolyedreInfo->GetConnSliceArr(anElemNum[anElemId]);
207 TInt aNbFaces = aConnSliceArr.size();
209 for(TInt iFace = 0; iFace < aNbFaces; iFace++){
210 MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
211 TInt aNbConn = aConnSlice.size();
212 aCellSize += aNbConn;
214 aSubProfile->myCellsSize += aCellSize;
219 aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
222 TInt aNbElem = aTimeStampIter->second;
223 aSubProfile->myNbCells = aNbElem;
225 case MED::ePOLYGONE: {
226 MED::PPolygoneInfo aPolygoneInfo =
227 theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom);
228 for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
229 TInt aNbConn = aPolygoneInfo->GetNbConn(anElemId);
230 aSubProfile->myCellsSize += aNbConn;
234 case MED::ePOLYEDRE: {
235 MED::PPolyedreInfo aPolyedreInfo =
236 theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom);
237 for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
238 MED::TCConnSliceArr aConnSliceArr =
239 aPolyedreInfo->GetConnSliceArr(anElemId);
240 TInt aNbFaces = aConnSliceArr.size();
242 for(TInt iFace = 0; iFace < aNbFaces; iFace++){
243 MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
244 TInt aNbConn = aConnSlice.size();
245 aCellSize += aNbConn;
247 aSubProfile->myCellsSize += aCellSize;
252 aSubProfile->myCellsSize = aSubProfile->myNbCells*aVNbNodes;
257 "- aMGeom = "<<theMGeom<<
258 "; aEGeom = "<<aEGeom<<
259 "; aName = '"<<aSubProfile->myName<<"'"<<
260 "; aStatus = "<<aSubProfile->myStatus<<
261 "; aNbCells = "<<aSubProfile->myNbCells<<
262 "; aCellsSize = "<<aSubProfile->myCellsSize<<
269 //---------------------------------------------------------------
271 GetProfileKey(const MED::PWrapper& theMEDWrapper,
272 const MED::PMeshInfo& theMeshInfo,
273 const MED::TTimeStampVal& theTimeStampVal,
274 const VISU::TMEDMeshOnEntity& theMeshOnEntity,
275 MED::EEntiteMaillage theMEntity,
276 const MED::TGeom2Size& theGeom2Size)
278 INITMSG(MYDEBUG,"GetProfileKey"<<endl);
280 TProfileKey aProfileKey;
281 const MED::TGeom2Profile& aGeom2Profile = theTimeStampVal.GetGeom2Profile();
283 const MED::TGeom2Size& aGeom2Size = theMeshOnEntity.myGeom2Size;
284 MED::TGeom2Size::const_iterator anIter = aGeom2Size.begin();
285 for(; anIter != aGeom2Size.end(); anIter++){
286 MED::EGeometrieElement aMGeom = anIter->first;
287 PSubProfile aSubProfile = CrSubProfile(theMEDWrapper,
293 aProfileKey.insert(aSubProfile);
300 //---------------------------------------------------------------
302 InitProfile(const MED::PWrapper& theMEDWrapper,
303 const MED::PMeshInfo& theMeshInfo,
304 MED::TTimeStampVal& theTimeStampVal,
305 VISU::TMEDMeshOnEntity& theMeshOnEntity,
306 MED::EEntiteMaillage theMEntity,
307 const MED::TGeom2Size& theGeom2Size,
308 VISU::TMEDValForTime& theValForTime)
310 TTimerLog aTimerLog(MYDEBUG,"InitProfile");
311 INITMSG(MYDEBUG,"InitProfile"<<endl);
313 TProfileMap& aProfileMap = theMeshOnEntity.myProfileMap;
315 TProfileKey aProfileKey = GetProfileKey(theMEDWrapper,
322 TProfileMap::const_iterator anIter = aProfileMap.find(aProfileKey);
323 if(anIter != aProfileMap.end()){
324 theValForTime.myProfile = anIter->second;
325 INITMSG(MYDEBUG,"aProfileMap.find(aProfileKey)"<<endl);
327 PMEDProfile aProfile(new TMEDProfile());
328 TGeom2SubProfile& aGeom2SubProfile = aProfile->myGeom2SubProfile;
330 TProfileKey::const_iterator anIter = aProfileKey.begin();
331 for(; anIter != aProfileKey.end(); anIter++){
332 PMEDSubProfile aSubProfile(*anIter);
334 if(aProfile->myIsAll && aSubProfile->myStatus != eAddAll)
335 aProfile->myIsAll = false;
337 VISU::EGeometry aEGeom = aSubProfile->myGeom;
338 aGeom2SubProfile[aEGeom] = aSubProfile;
341 aProfileMap[aProfileKey] = aProfile;
342 theValForTime.myProfile = aProfile;
347 //---------------------------------------------------------------
349 GetGaussKey(const MED::TTimeStampVal& theTimeStampVal,
350 const VISU::TMEDMeshOnEntity& theMeshOnEntity,
351 const MED::TGeom2Size& theGeom2Size,
352 VISU::TMEDValForTime& theValForTime)
354 TTimerLog aTimerLog(MYDEBUG,"GetGaussKey");
355 INITMSG(MYDEBUG,"GetGaussKey"<<endl);
358 PMEDProfile aProfile = theValForTime.myProfile;
359 TGeom2SubProfile& aGeom2SubProfile = aProfile->myGeom2SubProfile;
361 const MED::TTimeStampInfo& aTimeStampInfo = theTimeStampVal.GetTimeStampInfo();
362 const MED::TGeom2Gauss& aGeom2Gauss = aTimeStampInfo.GetGeom2Gauss();
364 const MED::TGeom2Size& aGeom2Size = theMeshOnEntity.myGeom2Size;
365 MED::TGeom2Size::const_iterator anIter = aGeom2Size.begin();
366 for(; anIter != aGeom2Size.end(); anIter++){
367 MED::EGeometrieElement aMGeom = anIter->first;
368 VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
370 TGeom2SubProfile::iterator anIter2 = aGeom2SubProfile.find(aEGeom);
371 if(anIter2 == aGeom2SubProfile.end()){
372 INITMSG(MYDEBUG,"anIter2 == aGeom2SubProfile.end!!"<<endl);
375 PMEDSubProfile aSubProfile = anIter2->second;
377 MED::TGeom2Size::const_iterator aTimeStampIter = theGeom2Size.find(aMGeom);
378 if(aTimeStampIter != theGeom2Size.end()){
379 TInt aNbCells = aTimeStampIter->second;
380 if(aSubProfile->myStatus == eAddPart)
381 aNbCells = aSubProfile->myNbCells;
383 PMEDGaussSubMesh aGaussSubMesh(new TMEDGaussSubMesh());
384 aGaussSubMesh->mySubProfile = aSubProfile;
385 aGaussSubMesh->myStatus = aSubProfile->myStatus;
387 PMEDGauss aGauss(new TMEDGauss());
388 aGaussSubMesh->myGauss = aGauss;
389 aGauss->myGeom = aEGeom;
390 aGauss->myNbPoints = 1;
392 MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom);
393 if(aGaussIter != aGeom2Gauss.end()){
394 MED::PGaussInfo aGaussInfo = aGaussIter->second;
395 aGauss->myGaussInfo = aGaussInfo;
396 aGauss->myName = aGaussInfo->GetName();
397 aGauss->myNbPoints = aGaussInfo->GetNbGauss();
400 aGaussSubMesh->myNbCells = aNbCells*aGauss->myNbPoints;
401 aGaussSubMesh->myCellsSize = aGaussSubMesh->myNbCells*2;
403 aGaussKey.insert(aGaussSubMesh);
406 "- aEGeom = "<<aGauss->myGeom<<
407 "; aName = '"<<aGauss->myName<<"'"<<
408 "; aNbGauss = "<<aGauss->myNbPoints<<
409 "; aStatus = "<<aGaussSubMesh->myStatus<<
410 "; aNbCells = "<<aGaussSubMesh->myNbCells<<
411 "; aCellsSize = "<<aGaussSubMesh->myCellsSize<<
420 //---------------------------------------------------------------
422 InitGaussMesh(MED::TTimeStampVal& theTimeStampVal,
423 VISU::TMEDMeshOnEntity& theMeshOnEntity,
424 const MED::TGeom2Size& theGeom2Size,
425 VISU::TMEDValForTime& theValForTime)
427 TTimerLog aTimerLog(MYDEBUG,"InitGaussMesh");
428 INITMSG(MYDEBUG,"InitGaussMesh"<<endl);
430 if(theMeshOnEntity.myEntity == NODE_ENTITY)
433 TGaussMeshMap& aGaussMeshMap = theMeshOnEntity.myGaussMeshMap;
435 TGaussKey aGaussKey = GetGaussKey(theTimeStampVal,
440 TGaussMeshMap::const_iterator anIter = aGaussMeshMap.find(aGaussKey);
441 if(anIter != aGaussMeshMap.end()){
442 theValForTime.myGaussMesh = anIter->second;
443 INITMSG(MYDEBUG,"aGaussMeshMap.find(aGaussKey)"<<endl);
445 PMEDGaussMesh aGaussMesh(new TMEDGaussMesh());
446 TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh;
448 TGaussKey::const_iterator anIter = aGaussKey.begin();
449 for(; anIter != aGaussKey.end(); anIter++){
450 PMEDGaussSubMesh aGaussSubMesh(*anIter);
451 PMEDGauss aGauss = aGaussSubMesh->myGauss;
452 VISU::EGeometry aEGeom = aGauss->myGeom;
453 aGeom2GaussSubMesh[aEGeom] = aGaussSubMesh;
457 TGaussSubMeshArr& aGaussSubMeshArr = aGaussMesh->myGaussSubMeshArr;
458 aGaussSubMeshArr.resize(aGeom2GaussSubMesh.size());
459 TGeom2GaussSubMesh::const_iterator anIter = aGeom2GaussSubMesh.begin();
460 for(TInt anID = 0; anIter != aGeom2GaussSubMesh.end(); anIter++, anID++){
461 const PGaussSubMeshImpl& aGaussSubMesh = anIter->second;
462 aGaussSubMeshArr[anID] = aGaussSubMesh;
465 INITMSG(MYDEBUG,"aGaussMeshMap[aGaussKey] = aGaussMesh"<<endl);
466 aGaussMeshMap[aGaussKey] = aGaussMesh;
467 theValForTime.myGaussMesh = aGaussMesh;
472 //---------------------------------------------------------------
474 InitGaussProfile(const MED::PWrapper& theMEDWrapper,
475 const MED::PMeshInfo& theMeshInfo,
476 MED::TTimeStampVal& theTimeStampVal,
477 VISU::TMEDMeshOnEntity& theMeshOnEntity,
478 MED::EEntiteMaillage theMEntity,
479 const MED::TGeom2Size& theGeom2Size,
480 VISU::TMEDValForTime& theValForTime)
482 TTimerLog aTimerLog(MYDEBUG,"InitGaussProfile");
483 INITMSG(MYDEBUG,"InitGaussProfile"<<endl);
485 // The order of the function calls is important
486 InitProfile(theMEDWrapper,
494 InitGaussMesh(theTimeStampVal,
501 //---------------------------------------------------------------
503 BuildMeshOnEntityMap(PMEDMesh theMesh,
504 const MED::TEntityInfo& theEntityInfo,
505 const MED::PNodeInfo& theNodeInfo,
506 const MED::PWrapper& theMEDWrapper)
508 TTimerLog aTimerLog(MYDEBUG,"BuildMeshOnEntityMap");
509 INITMSG(MYDEBUG,"BuildMeshOnEntityMap"<<endl);
511 MED::PMeshInfo aMeshInfo = theMesh->myMeshInfo;
512 const std::string& aMeshName = theMesh->myName;
513 TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
514 MED::TEntityInfo::const_iterator anEntityIter = theEntityInfo.begin();
515 for(; anEntityIter != theEntityInfo.end(); anEntityIter++){
516 const MED::EEntiteMaillage& aMEntity = anEntityIter->first;
517 const MED::TGeom2Size& aGeom2Size = anEntityIter->second;
519 TEntity aVEntity = MEDEntityToVTK(aMEntity);
520 PMEDMeshOnEntity aMeshOnEntity = aMeshOnEntityMap[aVEntity](new TMEDMeshOnEntity());
521 aMeshOnEntity->myEntity = aVEntity;
522 aMeshOnEntity->myMeshName = aMeshName;
523 aMeshOnEntity->myGeom2Size = aGeom2Size;
524 TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize;
527 "- aMEntity = "<<aMEntity<<
528 "; aVEntity = "<<aVEntity<<
531 if(aMEntity == MED::eNOEUD){
532 aMeshOnEntity->myNbCells = theMesh->myNbPoints;
533 aMeshOnEntity->myCellsSize = 2*theMesh->myNbPoints;
535 for(TInt iElem = 0; iElem < theMesh->myNbPoints; iElem++){
536 TInt aFamId = theNodeInfo->GetFamNum(iElem);
538 aFamilyID2CellsSize[aFamId] += 2;
542 "- myNbCells = "<<aMeshOnEntity->myNbCells<<
543 "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
547 MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
548 aMeshOnEntity->myNbCells = 0;
549 aMeshOnEntity->myCellsSize = 0;
550 for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
551 const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
554 case MED::ePOLYGONE: {
555 MED::PPolygoneInfo aPolygoneInfo = theMEDWrapper->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
556 TInt aNbElem = aPolygoneInfo->GetNbElem();
559 "- aMGeom = "<<aMGeom<<
560 "; aNbElem = "<<aNbElem<<
563 aMeshOnEntity->myNbCells += aNbElem;
564 for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
565 TInt aNbConn = aPolygoneInfo->GetNbConn(anElemId);
566 aMeshOnEntity->myCellsSize += aNbConn;
567 TInt aFamId = aPolygoneInfo->GetFamNum(anElemId);
569 aFamilyID2CellsSize[aFamId] += aNbConn + 1;
573 case MED::ePOLYEDRE: {
574 MED::PPolyedreInfo aPolyedreInfo = theMEDWrapper->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
575 TInt aNbElem = aPolyedreInfo->GetNbElem();
578 "- aMGeom = "<<aMGeom<<
579 "; aNbElem = "<<aNbElem<<
582 aMeshOnEntity->myNbCells += aNbElem;
583 for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
584 MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(anElemId);
585 TInt aNbFaces = aConnSliceArr.size();
587 for(TInt iFace = 0; iFace < aNbFaces; iFace++){
588 MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
589 TInt aNbConn = aConnSlice.size();
590 aCellSize += aNbConn;
592 aMeshOnEntity->myCellsSize += aCellSize;
593 TInt aFamId = aPolyedreInfo->GetFamNum(anElemId);
595 aFamilyID2CellsSize[aFamId] += aCellSize + 1;
600 VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
601 vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
602 MED::PCellInfo aCellInfo = theMEDWrapper->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
603 TInt aNbElem = aCellInfo->GetNbElem();
604 aMeshOnEntity->myNbCells += aNbElem;
605 aMeshOnEntity->myCellsSize += aNbElem*(aVNbNodes+1);
608 "- aMGeom = "<<aMGeom<<
609 "; aNbElem = "<<aNbElem<<
610 "; myNbCells = "<<aMeshOnEntity->myNbCells<<
611 "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
614 for(TInt iElem = 0; iElem < aNbElem; iElem++){
615 TInt aFamId = aCellInfo->GetFamNum(iElem);
617 aFamilyID2CellsSize[aFamId] += aVNbNodes + 1;
619 }} // end switch(...)
625 //---------------------------------------------------------------
627 BuildMeshGrilleOnEntityMap(PMEDMesh theMesh,
628 const MED::TEntityInfo& theEntityInfo,
629 const MED::PGrilleInfo& theGrilleInfo,
630 const MED::PWrapper& theMEDWrapper)
632 TTimerLog aTimerLog(MYDEBUG,"BuildMeshGrilleOnEntityMap");
633 INITMSG(MYDEBUG,"BuildMeshGrilleOnEntityMap"<<endl);
635 MED::PMeshInfo aMeshInfo = theMesh->myMeshInfo;
636 const std::string& aMeshName = theMesh->myName;
637 TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
638 MED::TEntityInfo::const_iterator anEntityIter = theEntityInfo.begin();
639 for(; anEntityIter != theEntityInfo.end(); anEntityIter++){
640 const MED::EEntiteMaillage& aMEntity = anEntityIter->first;
641 const MED::TGeom2Size& aGeom2Size = anEntityIter->second;
643 TEntity aVEntity = MEDEntityToVTK(aMEntity);
644 PMEDMeshOnEntity aMeshOnEntity = aMeshOnEntityMap[aVEntity](new TMEDMeshOnEntity());
645 aMeshOnEntity->myEntity = aVEntity;
646 aMeshOnEntity->myMeshName = aMeshName;
647 aMeshOnEntity->myGeom2Size = aGeom2Size;
648 // TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize;
651 "- aMEntity = "<<aMEntity<<
652 "; aVEntity = "<<aVEntity<<
655 if(aMEntity == MED::eNOEUD){
656 aMeshOnEntity->myNbCells = theGrilleInfo->GetNbNodes();
657 aMeshOnEntity->myCellsSize = 2*theGrilleInfo->GetNbNodes();
659 // must be implemented (shadow point for GRILLE STANDARD,CARTESIAN,...)
660 // for(TInt iElem = 0; iElem < theMesh->myNbPoints; iElem++){
661 // TInt aFamId = theNodeInfo->GetFamNum(iElem);
663 // aFamilyID2CellsSize[aFamId] += 2;
667 "- myNbCells = "<<aMeshOnEntity->myNbCells<<
668 "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
672 MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
673 aMeshOnEntity->myNbCells = 0;
674 aMeshOnEntity->myCellsSize = 0;
675 for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
676 const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
677 VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
678 vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
679 TInt aNbElem = theGrilleInfo->GetNbCells();
680 aMeshOnEntity->myNbCells += aNbElem;
681 aMeshOnEntity->myCellsSize += aNbElem*(aVNbNodes+1);
684 "- aMGeom = "<<aMGeom<<
685 "; aNbElem = "<<aNbElem<<
686 "; myNbCells = "<<aMeshOnEntity->myNbCells<<
687 "; myCellsSize = "<<aMeshOnEntity->myCellsSize<<
690 // for(TInt iElem = 0; iElem < aNbElem; iElem++){
691 // TInt aFamId = aCellInfo->GetFamNum(iElem);
693 // aFamilyID2CellsSize[aFamId] += aVNbNodes + 1;
705 //---------------------------------------------------------------
707 BuildFieldMap(PMEDMesh theMesh,
708 const MED::TEntityInfo& theEntityInfo,
709 MED::PWrapper theMEDWrapper)
711 TTimerLog aTimerLog(MYDEBUG,"BuildFieldMap");
712 TInt aNbFields = theMEDWrapper->GetNbFields();
713 MED::PMeshInfo aMeshInfo = theMesh->myMeshInfo;
714 const std::string& aMeshName = theMesh->myName;
715 INITMSG(MYDEBUG,"BuildFieldMap: aNbFields = "<<aNbFields<<"\n");
716 for(TInt iField = 1; iField <= aNbFields; iField++){
717 TTimerLog aTimerLog(MYDEBUG,"GetPFieldInfo");
718 MED::PFieldInfo aFieldInfo = theMEDWrapper->GetPFieldInfo(aMeshInfo,iField);
719 TInt aNbComp = aFieldInfo->GetNbComp();
720 std::string aFieldName = aFieldInfo->GetName();
722 MED::TGeom2Size aGeom2Size;
723 MED::EEntiteMaillage aMEntity;
724 TInt aNbTimeStamps = theMEDWrapper->GetNbTimeStamps(aFieldInfo,
728 if(aNbTimeStamps < 1)
731 TEntity aVEntity = MEDEntityToVTK(aMEntity);
732 PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[aVEntity];
733 TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
734 PMEDField aField = aFieldMap[aFieldName](new TMEDField());
735 aField->myId = iField;
736 aField->InitArrays(aNbComp);
737 aField->myEntity = aVEntity;
738 aField->myName = aFieldName;
739 aField->myMeshName = aMeshName;
740 aField->myDataSize = aMeshOnEntity->myNbCells * aNbComp;
742 INITMSG(MYDEBUG,"myName = '"<<aField->myName<<"'"<<
743 "; myId = "<<aField->myId<<
744 "; myEntity = "<<aField->myEntity<<
745 "; myDataSize = "<<aField->myDataSize<<
746 "; myNbComp = "<<aField->myNbComp<<"\n");
748 for(TInt iComp = 0; iComp < aNbComp; iComp++){
749 aField->myCompNames[iComp] = aFieldInfo->GetCompName(iComp);
750 aField->myUnitNames[iComp] = aFieldInfo->GetUnitName(iComp);
753 for(TInt iTimeStamp = 1; iTimeStamp <= aNbTimeStamps; iTimeStamp++){
754 TTimerLog aTimerLog(MYDEBUG,"GetPTimeStampInfo");
755 MED::PTimeStampInfo aTimeStampInfo = theMEDWrapper->GetPTimeStampInfo(aFieldInfo,
759 TFloat aDt = aTimeStampInfo->GetDt();
760 std::string anUnitDt = aTimeStampInfo->GetUnitDt();
762 TValField& aValField = aField->myValField;
763 PMEDValForTime aValForTime = aValField[iTimeStamp](new TMEDValForTime());
764 aValForTime->myId = iTimeStamp;
765 aValForTime->myFieldName = aField->myName;
766 aValForTime->myEntity = aField->myEntity;
767 aValForTime->myMeshName = aField->myMeshName;
768 aValForTime->myTime = VISU::TTime(aDt,anUnitDt);
769 INITMSG(MYDEBUG,"aDt = '"<<aDt<<", "<<anUnitDt<<"'\n");
771 TGeom2NbGauss& aVGeom2NbGauss = aValForTime->myGeom2NbGauss;
772 const MED::TGeom2NbGauss& aMGeom2NbGauss = aTimeStampInfo->myGeom2NbGauss;
773 MED::TGeom2NbGauss::const_iterator anIter = aMGeom2NbGauss.begin();
774 for(; anIter != aMGeom2NbGauss.end(); anIter++){
775 const MED::EGeometrieElement& aMGeom = anIter->first;
776 EGeometry aEGeom = MEDGeom2VISU(aMGeom);
777 TInt aNbGauss = anIter->second;
778 aVGeom2NbGauss[aEGeom] = aNbGauss;
785 //---------------------------------------------------------------
787 BuildFamilyMap(PMEDMesh theMesh,
788 const MED::TEntityInfo& theEntityInfo,
789 const MED::TEntity2TGeom2ElemInfo& theEntity2TGeom2ElemInfo,
790 const MED::TFamilyInfoSet& theFamilyInfoSet,
791 MED::PWrapper theMEDWrapper)
793 TTimerLog aTimerLog(MYDEBUG,"BuildFamilyMap");
794 INITMSG(MYDEBUG,"BuildFamilyMap\n");
796 MED::PMeshInfo aMeshInfo = theMesh->myMeshInfo;
797 MED::TEntity2FamilySet aEntity2FamilySet = MED::GetEntity2FamilySet(theMEDWrapper,theEntity2TGeom2ElemInfo,theFamilyInfoSet);
798 MED::TEntity2FamilySet::const_iterator aEntity2FamilySetIter = aEntity2FamilySet.begin();
799 for(; aEntity2FamilySetIter != aEntity2FamilySet.end(); aEntity2FamilySetIter++){
800 const MED::EEntiteMaillage& aMEntity = aEntity2FamilySetIter->first;
801 const MED::TFamilyTSizeSet& aFamilyTSizeSet = aEntity2FamilySetIter->second;
803 TEntity aVEntity = MEDEntityToVTK(aMEntity);
804 PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[aVEntity];
805 const TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize;
806 TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
808 if(aFamilyTSizeSet.empty())
811 INITMSG(MY_FAMILY_DEBUG,
812 "- aMEntity = "<<aMEntity<<
813 "; aVEntity = "<<aVEntity<<
816 MED::TFamilyTSizeSet::const_iterator aFamilyTSizeSetIter = aFamilyTSizeSet.begin();
817 for(; aFamilyTSizeSetIter != aFamilyTSizeSet.end(); aFamilyTSizeSetIter++){
818 const MED::TFamilyTSize& aFamilyTSize = *aFamilyTSizeSetIter;
819 const MED::PFamilyInfo& aFamilyInfo = boost::get<0>(aFamilyTSize);
820 TInt aSize = boost::get<1>(aFamilyTSize);
821 TInt anId = aFamilyInfo->GetId();
825 std::string aFamilyName = aFamilyInfo->GetName();
827 PMEDFamily aFamily = aFamilyMap[aFamilyName](new TMEDFamily());
828 aFamily->myId = anId;
829 aFamily->myEntity = aVEntity;
830 aFamily->myName = aFamilyName;
831 aFamily->myNbCells = aSize;
833 aFamily->myCellsSize = 0;
834 TFamilyID2CellsSize::const_iterator anIter = aFamilyID2CellsSize.find(anId);
835 if(anIter != aFamilyID2CellsSize.end())
836 aFamily->myCellsSize = anIter->second;
838 INITMSG(MY_FAMILY_DEBUG,
839 "- aFamilyName = '"<<aFamilyName<<"'"<<
840 "; myId = "<<aFamily->myId<<"; "<<
841 "; aNbAttr = "<<aFamilyInfo->GetNbAttr()<<
842 "; aNbGroup = "<<aFamilyInfo->GetNbGroup()<<
843 "; aVEntity = "<<aVEntity<<
844 "; myNbCells = "<<aFamily->myNbCells<<
845 "; myCellsSize = "<<aFamily->myCellsSize<<
848 const TInt aNbGroup = aFamilyInfo->GetNbGroup();
849 for(TInt i = 0; i < aNbGroup; i++){
850 std::string aGroupName = aFamilyInfo->GetGroupName(i);
851 INITMSG(MY_FAMILY_DEBUG,"- aGroupName = '"<<aGroupName<<"'\n");
860 //---------------------------------------------------------------
862 BuildGroupMap(PMEDMesh theMesh,
863 const MED::TFamilyInfoSet& theFamilyInfoSet)
865 TTimerLog aTimerLog(MYDEBUG,"BuildGroupMap");
866 INITMSG(MYDEBUG,"BuildGroupMap\n");
868 TGroupMap& aGroupMap = theMesh->myGroupMap;
869 MED::TGroupInfo aGroupInfo = MED::GetGroupInfo(theFamilyInfoSet);
870 MED::TGroupInfo::const_iterator aGroupInfoIter = aGroupInfo.begin();
871 for(; aGroupInfoIter != aGroupInfo.end(); aGroupInfoIter++){
872 const std::string& aGroupName = aGroupInfoIter->first;
873 INITMSG(MY_GROUP_DEBUG,"aGroupName = '"<<aGroupName<<"'\n");
875 PMEDGroup aGroup(new TMEDGroup());
876 TFamilySet& aFamilySet = aGroup->myFamilySet;
878 const MED::TFamilyInfoSet& aFamilyInfoSet = aGroupInfoIter->second;
879 MED::TFamilyInfoSet::const_iterator aFamilyIter = aFamilyInfoSet.begin();
880 for(; aFamilyIter != aFamilyInfoSet.end(); aFamilyIter++){
881 const MED::PFamilyInfo& aFamilyInfo = *aFamilyIter;
882 std::string aFamilyName = aFamilyInfo->GetName();
884 TEntity aVEntity = TEntity(-1);
888 const TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
889 TMeshOnEntityMap::const_iterator aMeshOnEntityIter = aMeshOnEntityMap.begin();
890 for(; aMeshOnEntityIter != aMeshOnEntityMap.end(); aMeshOnEntityIter++){
891 const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityIter->second;
892 const TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
893 TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
894 for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
895 const std::string& aName = aFamilyMapIter->first;
896 aFamily = aFamilyMapIter->second;
897 if(aName == aFamilyName){
898 aVEntity = aFamily->myEntity;
904 if(aFamily && aVEntity >= 0){
905 aFamilySet.insert(aFamily);
906 INITMSG(MY_GROUP_DEBUG,
907 "- aFamilyName = '"<<aFamilyName<<"'"<<
908 "; aVEntity = "<<aVEntity<<
912 if(!aFamilySet.empty())
913 aGroupMap.insert(VISU::TGroupMap::value_type(aGroupName,aGroup));
918 //---------------------------------------------------------------
921 ::Init(vtkIdType theNbPoints,
923 const MED::PNodeInfo& theNodeInfo)
925 if(theNodeInfo->IsElemNum())
926 TNamedPointCoords::Init(theNbPoints,theDim,theNodeInfo->myElemNum);
928 TNamedPointCoords::Init(theNbPoints,theDim);
929 if(theNodeInfo->IsElemNames())
930 myNodeInfo = theNodeInfo;
935 ::Init(vtkIdType theNbPoints,
937 const MED::PGrilleInfo& theInfo)
939 TNamedPointCoords::Init(theNbPoints,theDim);
944 ::GetNodeName(vtkIdType theObjID) const
947 return myNodeInfo->GetElemName(theObjID);
948 return TNamedPointCoords::GetNodeName(theObjID);
952 //---------------------------------------------------------------
955 ::GetElemObjID(vtkIdType theID) const
958 return myElemNum[theID];
964 //---------------------------------------------------------------
967 ::LessThan(const PGaussImpl& theGauss,
968 bool& theResult) const
970 TGaussImpl::LessThan(theGauss,theResult);
972 if(PMEDGauss aGauss = theGauss){
973 const MED::TGaussInfo& aLeft = myGaussInfo;
974 const MED::TGaussInfo& aReight = aGauss->myGaussInfo;
975 theResult = MED::TGaussInfo::TLess()(aLeft,aReight);
981 //---------------------------------------------------------------
984 ::GetObjID(vtkIdType theID,
985 vtkIdType theStartID) const
987 TCellID aCellID = theID / myGauss->myNbPoints;
988 TLocalPntID aLocalPntID = theID % myGauss->myNbPoints;
991 aCellID = myElemNum[aCellID];
993 aCellID += theStartID;
995 return TGaussPointID(aCellID,aLocalPntID);
999 //---------------------------------------------------------------
1002 ::Init(const MED::PElemInfo& theElemInfo)
1004 myIsElemNum = theElemInfo->IsElemNum();
1007 myElemNum = theElemInfo->myElemNum;
1009 if(theElemInfo->IsElemNames())
1010 myElemInfo = theElemInfo;
1016 ::Init(const MED::PGrilleInfo& theGrilleInfo)
1018 myIsElemNum = MED::eFAUX;
1019 // must be implemented
1024 ::GetElemObjID(vtkIdType theID) const
1027 return myElemNum[theID];
1029 return TSubMeshImpl::GetElemObjID(theID);
1034 ::GetElemName(vtkIdType theObjID) const
1037 return myElemInfo->GetElemName(theObjID);
1038 return TSubMeshImpl::GetElemName(theObjID);
1044 TSetIsDone(bool& theIsDone):
1057 //---------------------------------------------------------------
1060 CreateConvertor(const string& theFileName)
1062 if(MED::PWrapper aMed = MED::CrWrapper(theFileName,true))
1063 return new VISU_MedConvertor(theFileName);
1068 ::VISU_MedConvertor(const string& theFileName):
1069 myIsEntitiesDone(false),
1070 myIsFieldsDone(false),
1071 myIsGroupsDone(false),
1072 myIsMinMaxDone(false)
1074 myFileInfo.setFile(QString(theFileName.c_str()));
1075 myName = myFileInfo.baseName().latin1();
1079 //---------------------------------------------------------------
1084 if(myIsEntitiesDone)
1087 TSetIsDone aSetIsDone(myIsEntitiesDone);
1088 TTimerLog aTimerLog(MYDEBUG,"BuildEntities");
1089 MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
1091 TInt aNbMeshes = aMed->GetNbMeshes();
1092 TMeshMap& aMeshMap = myMeshMap;
1094 INITMSG(MYDEBUG,"BuildEntities aNbMeshes = "<<aNbMeshes<<"\n");
1096 for(TInt iMesh = 1; iMesh <= aNbMeshes; iMesh++){
1100 TTimerLog aTimerLog(MYDEBUG,"GetPMeshInfo");
1102 MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh);
1103 std::string aMeshName = aMeshInfo->GetName();
1104 TInt aDim = aMeshInfo->GetDim();
1105 MED::EMaillage aType = aMeshInfo->GetType();
1107 // creating TMesh structure and TMeshOnEntityMap
1108 PMEDMesh aMesh = aMeshMap[aMeshName](new TMEDMesh());
1110 aMesh->myDim = aDim;
1111 aMesh->myName = aMeshName;
1112 aMesh->myMeshInfo = aMeshInfo;
1113 aMesh->myNamedPointCoords(new TMEDNamedPointCoords());
1115 INITMSG(MYDEBUG,"aMeshName = '"<<aMeshName<<
1116 "; aDim = "<<aDim<<"\n");
1118 if(aType == MED::eNON_STRUCTURE){
1120 if(MED::PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo)){
1121 MED::TEntityInfo anEntityInfo = aMed->GetEntityInfo(aMeshInfo);
1123 aMesh->myNbPoints = aNodeInfo->GetNbElem();
1124 aMesh->myEntityInfo = anEntityInfo;
1130 INITMSG(MYDEBUG,"myNbPoints = "<<aMesh->myNbPoints<<
1131 "; anEntityInfo.size() = "<<anEntityInfo.size()<<
1134 BuildMeshOnEntityMap(aMesh,
1140 }catch(std::exception& exc){
1141 MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
1143 MSG(MYDEBUG,"Unknown exception !!!");
1147 } // NON STRUCTURED MESH
1149 MED::PGrilleInfo aGrilleInfo = aMed->GetPGrilleInfo(aMeshInfo);
1151 MED::TEntityInfo anEntityInfo;
1152 anEntityInfo[MED::eNOEUD][MED::ePOINT1] = aGrilleInfo->GetNbNodes();
1153 anEntityInfo[aGrilleInfo->GetEntity()][aGrilleInfo->GetGeom()] = aGrilleInfo->GetNbCells();
1155 aMesh->myNbPoints = aGrilleInfo->GetNbNodes();
1156 aMesh->myEntityInfo = anEntityInfo;
1161 BEGMSG(MYDEBUG,"anEntityInfo.size() = "<<anEntityInfo.size()<<"\n");
1163 BuildMeshGrilleOnEntityMap(aMesh,
1169 }catch(std::exception& exc){
1170 MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
1172 MSG(MYDEBUG,"Unknown exception !!!");
1179 }catch(std::exception& exc){
1180 MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
1182 MSG(MYDEBUG,"Unknown exception !!!");
1191 //---------------------------------------------------------------
1199 TSetIsDone aSetIsDone(myIsFieldsDone);
1200 TTimerLog aTimerLog(MYDEBUG,"BuildFields");
1201 MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
1203 TInt aNbMeshes = aMed->GetNbMeshes();
1204 TMeshMap& aMeshMap = myMeshMap;
1206 INITMSG(MYDEBUG,"BuildFields - aNbMeshes = "<<aNbMeshes<<"\n");
1208 for(TInt iMesh = 1; iMesh <= aNbMeshes; iMesh++){
1212 TTimerLog aTimerLog(MYDEBUG,"GetPMeshInfo");
1214 MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh);
1215 std::string aMeshName = aMeshInfo->GetName();
1217 TMeshMap::const_iterator anIter = aMeshMap.find(aMeshName);
1218 if(anIter == aMeshMap.end())
1220 PMEDMesh aMesh = anIter->second;
1222 INITMSG(MYDEBUG,"aMeshName = '"<<aMeshName<<"'\n");
1226 MED::TEntityInfo anEntityInfo = aMed->GetEntityInfo(aMeshInfo);
1228 BuildFieldMap(aMesh,
1232 }catch(std::exception& exc){
1233 MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
1235 MSG(MYDEBUG,"Unknown exception !!!");
1240 }catch(std::exception& exc){
1241 MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
1243 MSG(MYDEBUG,"Unknown exception !!!");
1252 //---------------------------------------------------------------
1260 TSetIsDone aSetIsDone(myIsMinMaxDone);
1261 TTimerLog aTimerLog(MYDEBUG,"BuildMinMax");
1262 MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
1264 MED::TKey2Gauss aKey2Gauss = MED::GetKey2Gauss(aMed);
1265 MED::TMKey2Profile aMKey2Profile = MED::GetMKey2Profile(aMed);
1267 TInt aNbMeshes = aMed->GetNbMeshes();
1268 TMeshMap& aMeshMap = myMeshMap;
1270 INITMSG(MYDEBUG,"BuildMinMax - aNbMeshes = "<<aNbMeshes<<"\n");
1272 for(TInt iMesh = 1; iMesh <= aNbMeshes; iMesh++){
1276 TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPMeshInfo");
1278 MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh);
1279 std::string aMeshName = aMeshInfo->GetName();
1281 TMeshMap::const_iterator anIter = aMeshMap.find(aMeshName);
1282 if(anIter == aMeshMap.end())
1284 PMEDMesh aMesh = anIter->second;
1289 TInt aNbFields = aMed->GetNbFields();
1292 "- aMeshName = '"<<aMeshName<<"'"<<
1293 "; aNbFields = "<<aNbFields<<"\n");
1295 MED::TEntityInfo anEntityInfo = aMed->GetEntityInfo(aMeshInfo);
1297 for(TInt iField = 1; iField <= aNbFields; iField++){
1298 TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPFieldInfo()");
1299 MED::PFieldInfo aFieldInfo = aMed->GetPFieldInfo(aMeshInfo,iField);
1300 std::string aFieldName = aFieldInfo->GetName();
1301 INITMSG(MYDEBUG,"- aFieldName = '"<<aFieldName<<"'\n");
1303 MED::TGeom2Size aGeom2Size;
1304 MED::EEntiteMaillage aMEntity;
1305 TInt aNbTimeStamps = aMed->GetNbTimeStamps(aFieldInfo,
1309 if(aNbTimeStamps < 1)
1312 TEntity aVEntity = MEDEntityToVTK(aMEntity);
1313 PMEDMeshOnEntity aMeshOnEntity = aMesh->myMeshOnEntityMap[aVEntity];
1314 TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
1315 PMEDField aField = aFieldMap[aFieldName];
1317 TInt aNbComp = aField->myNbComp;
1318 int aNbComp2 = aNbComp;
1319 if(aNbComp == 2 || aNbComp == 4)
1321 else if(aNbComp > 4)
1324 TMinMaxArr& aMinMaxArr = aField->myMinMaxArr;
1325 TSetIsDone aSetIsDone(aField->myIsMinMaxInitilized);
1326 for(TInt iTimeStamp = aNbTimeStamps; iTimeStamp >= 1; iTimeStamp--){
1327 TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPTimeStampInfo()");
1328 INITMSG(MYDEBUG,"- iTimeStamp = "<<iTimeStamp<<endl);
1334 MED::PTimeStampInfo aTimeStampInfo = aMed->GetPTimeStampInfo(aFieldInfo,
1339 MED::PTimeStampVal aTimeStampVal = aMed->GetPTimeStampVal(aTimeStampInfo,
1343 const MED::TGeom2Gauss& aGeom2Gauss = aTimeStampInfo->GetGeom2Gauss();
1345 const MED::TTimeStampVal& aTimeStampValRef = aTimeStampVal;
1347 const MED::TGeom2Value& aGeom2Value = aTimeStampValRef.myGeom2Value;
1348 MED::TGeom2Value::const_iterator anIter = aGeom2Value.begin();
1349 for(; anIter != aGeom2Value.end(); anIter++){
1350 const MED::TMeshValue& aMMeshValue = anIter->second;
1351 MED::EGeometrieElement aMGeom = anIter->first;
1353 TInt aNbElem = aMMeshValue.myNbElem;
1354 TInt aNbGauss = aMMeshValue.myNbGauss;
1356 MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom);
1357 if(aGaussIter == aGeom2Gauss.end())
1361 "- aMGeom = "<<aMGeom<<
1362 "; aNbElem = "<<aNbElem<<
1363 "; aNbGauss = "<<aNbGauss<<
1366 // To calculate min/max per components
1367 for(TInt iElem = 0; iElem < aNbElem; iElem++){
1368 MED::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetCompValueSliceArr(iElem);
1369 for(TInt iComp = 0; iComp < aNbComp; iComp++){
1370 const MED::TCValueSlice& aMValueSlice = aMValueSliceArr[iComp];
1371 TMinMax& aMinMax = aMinMaxArr[iComp+1];
1372 vtkFloatingPointType& aMin = aMinMax.first;
1373 vtkFloatingPointType& aMax = aMinMax.second;
1374 for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
1375 const vtkFloatingPointType& aVal = aMValueSlice[iGauss];
1376 aMin = min(aMin,aVal);
1377 aMax = max(aMax,aVal);
1382 // To calculate min/max per vector modulus
1383 TMinMax& aMinMax = aMinMaxArr[0];
1384 vtkFloatingPointType& aMin = aMinMax.first;
1385 vtkFloatingPointType& aMax = aMinMax.second;
1386 for(TInt iElem = 0; iElem < aNbElem; iElem++){
1387 MED::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetGaussValueSliceArr(iElem);
1388 for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
1389 const MED::TCValueSlice& aMValueSlice = aMValueSliceArr[iGauss];
1390 vtkFloatingPointType aValue = 0.0;
1391 for(TInt iComp = 0; iComp < aNbComp2; iComp++){
1392 vtkFloatingPointType aVal = aMValueSlice[iComp];
1393 aValue += aVal*aVal;
1395 aValue = sqrt(aValue);
1396 aMin = min(aMin,aValue);
1397 aMax = max(aMax,aValue);
1402 }catch(std::exception& exc){
1403 MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
1405 MSG(MYDEBUG,"Unknown exception !!!");
1407 }CASCatch_CATCH(Standard_Failure){
1408 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
1409 MSG(MYDEBUG,"Follow signal was occured in:\n"<<aFail->GetMessageString());
1413 for(TInt iComp = 0; iComp <= aNbComp; iComp++){
1414 VISU::TMinMax aMinMax = aField->GetMinMax(iComp);
1415 INITMSG(MYDEBUG,"- "<<iComp<<": "<<aMinMax.first<<"; "<<aMinMax.second<<endl);
1419 }catch(std::exception& exc){
1420 MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
1422 MSG(MYDEBUG,"Unknown exception !!!");
1427 }catch(std::exception& exc){
1428 MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
1430 MSG(MYDEBUG,"Unknown exception !!!");
1439 //---------------------------------------------------------------
1447 TSetIsDone aSetIsDone(myIsGroupsDone);
1448 TTimerLog aTimerLog(MYDEBUG,"BuildGroups");
1449 MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
1451 TInt aNbMeshes = aMed->GetNbMeshes();
1452 TMeshMap& aMeshMap = myMeshMap;
1454 INITMSG(MYDEBUG,"BuildGroups - aNbMeshes = "<<aNbMeshes<<"\n");
1456 for(TInt iMesh = 1; iMesh <= aNbMeshes; iMesh++){
1460 TTimerLog aTimerLog(MYDEBUG,"GetPMeshInfo");
1462 MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh);
1463 std::string aMeshName = aMeshInfo->GetName();
1465 TMeshMap::const_iterator anIter = aMeshMap.find(aMeshName);
1466 if(anIter == aMeshMap.end())
1468 PMEDMesh aMesh = anIter->second;
1470 INITMSG(MYDEBUG,"aMeshName = '"<<aMeshName<<"'\n");
1472 MED::TEntityInfo anEntityInfo = aMed->GetEntityInfo(aMeshInfo);
1474 MED::TEntity2TGeom2ElemInfo anEntity2TGeom2ElemInfo =
1475 MED::GetEntity2TGeom2ElemInfo(aMed,aMeshInfo,anEntityInfo);
1480 MED::TFamilyInfoSet aFamilyInfoSet = MED::GetFamilyInfoSet(aMed,aMeshInfo);
1482 BuildFamilyMap(aMesh,
1484 anEntity2TGeom2ElemInfo,
1488 BuildGroupMap(aMesh,
1491 }catch(std::exception& exc){
1492 MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
1494 MSG(MYDEBUG,"Unknown exception !!!");
1499 }catch(std::exception& exc){
1500 MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
1502 MSG(MYDEBUG,"Unknown exception !!!");
1511 //---------------------------------------------------------------
1514 ::LoadMeshOnEntity(VISU::PMeshImpl theMesh,
1515 VISU::PMeshOnEntityImpl theMeshOnEntity)
1517 TTimerLog aTimerLog(MYDEBUG,"LoadMeshOnEntity");
1518 INITMSG(MYDEBUG,"LoadMeshOnEntity"<<endl);
1520 MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
1521 const TEntity& anEntity = theMeshOnEntity->myEntity;
1523 int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
1524 if(anEntity == NODE_ENTITY){
1525 isPointsUpdated += LoadPoints(aMed,theMesh);
1527 isPointsUpdated += LoadPoints(aMed,theMesh);
1528 isCellsOnEntityUpdated += LoadCellsOnEntity(aMed,theMesh,theMeshOnEntity);
1531 return (isPointsUpdated || isCellsOnEntityUpdated);
1535 //---------------------------------------------------------------
1538 ::LoadFamilyOnEntity(VISU::PMeshImpl theMesh,
1539 VISU::PMeshOnEntityImpl theMeshOnEntity,
1540 VISU::PFamilyImpl theFamily)
1542 TTimerLog aTimerLog(MYDEBUG,"LoadFamilyOnEntity");
1543 INITMSG(MYDEBUG,"LoadFamilyOnEntity"<<endl);
1545 MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
1546 const TEntity& anEntity = theMeshOnEntity->myEntity;
1548 int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
1549 if(anEntity == NODE_ENTITY){
1550 isPointsUpdated += LoadPointsOnFamily(aMed,theMesh,theFamily);
1552 isPointsUpdated += LoadPoints(aMed,theMesh);
1553 isCellsOnEntityUpdated += LoadCellsOnFamily(aMed,theMesh,theMeshOnEntity,theFamily);
1556 return (isPointsUpdated || isCellsOnEntityUpdated);
1560 //---------------------------------------------------------------
1563 ::LoadMeshOnGroup(VISU::PMeshImpl theMesh,
1564 const VISU::TFamilySet& theFamilySet)
1566 TTimerLog aTimerLog(MYDEBUG,"LoadMeshOnGroup");
1567 INITMSG(MYDEBUG,"LoadMeshOnGroup"<<endl);
1569 MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
1570 int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
1571 TFamilySet::const_iterator aFamilyIter = theFamilySet.begin();
1572 for(; aFamilyIter != theFamilySet.end(); aFamilyIter++){
1573 PMEDFamily aFamily = *aFamilyIter;
1574 const TEntity& anEntity = aFamily->myEntity;
1575 const PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[anEntity];
1576 isPointsUpdated += LoadPoints(aMed,theMesh);
1577 if(anEntity == NODE_ENTITY){
1578 isPointsUpdated += LoadPointsOnFamily(aMed,theMesh,aFamily);
1580 isCellsOnEntityUpdated += LoadCellsOnFamily(aMed,theMesh,aMeshOnEntity,aFamily);
1584 return (isPointsUpdated || isCellsOnEntityUpdated);
1588 //---------------------------------------------------------------
1591 ::LoadValForTimeOnMesh(VISU::PMeshImpl theMesh,
1592 VISU::PMeshOnEntityImpl theMeshOnEntity,
1593 VISU::PFieldImpl theField,
1594 VISU::PValForTimeImpl theValForTime)
1596 TTimerLog aTimerLog(MYDEBUG,"LoadValForTimeOnMesh");
1597 INITMSG(MYDEBUG,"LoadValForTimeOnMesh"<<endl);
1599 MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
1601 const TEntity& anEntity = theMeshOnEntity->myEntity;
1602 int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
1603 isPointsUpdated += LoadPoints(aMed,theMesh);
1604 if(anEntity != NODE_ENTITY)
1605 isCellsOnEntityUpdated += LoadCellsOnEntity(aMed,theMesh,theMeshOnEntity);
1606 int isFieldUpdated = LoadValForTimeOnMesh(aMed,theMesh,theMeshOnEntity,theField,theValForTime);
1608 return (isPointsUpdated || isCellsOnEntityUpdated || isFieldUpdated);
1612 //---------------------------------------------------------------
1615 ::LoadValForTimeOnGaussPts(VISU::PMeshImpl theMesh,
1616 VISU::PMeshOnEntityImpl theMeshOnEntity,
1617 VISU::PFieldImpl theField,
1618 VISU::PValForTimeImpl theValForTime)
1620 TTimerLog aTimerLog(MYDEBUG,"LoadValForTimeOnGaussPts");
1621 INITMSG(MYDEBUG,"LoadValForTimeOnGaussPts"<<endl);
1623 MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
1625 const TEntity& anEntity = theMeshOnEntity->myEntity;
1626 int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
1627 if(anEntity != NODE_ENTITY)
1628 isCellsOnEntityUpdated += LoadCellsOnEntity(aMed,theMesh,theMeshOnEntity);
1629 int isFieldUpdated = LoadValForTimeOnGaussPts(aMed,theMesh,theMeshOnEntity,theField,theValForTime);
1631 return (isPointsUpdated || isCellsOnEntityUpdated || isFieldUpdated);
1635 //---------------------------------------------------------------
1638 ::LoadPoints(const MED::PWrapper& theMed,
1639 VISU::PMEDMesh theMesh)
1641 TTimerLog aTimerLog(MYDEBUG,"LoadPoints");
1643 //Check on existing family
1644 PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[VISU::NODE_ENTITY];
1645 aMeshOnEntity->myMeshName = theMesh->myName;
1646 aMeshOnEntity->myEntity = NODE_ENTITY;
1648 INITMSG(MYDEBUG,"LoadPoints - theMesh->myIsDone = "<<theMesh->myIsDone<<"'\n");
1650 //Check on loading already done
1651 if(theMesh->myIsDone)
1654 MED::EMaillage aType = theMesh->myMeshInfo->GetType();
1656 if(aType == MED::eNON_STRUCTURE){
1658 MED::PNodeInfo aNodeInfo = theMed->GetPNodeInfo(theMesh->myMeshInfo);
1659 TInt aNbElem = aNodeInfo->GetNbElem();
1660 TInt aDim = theMesh->myDim;
1662 PMEDNamedPointCoords aNamedPointCoords = theMesh->myNamedPointCoords;
1663 TMEDNamedPointCoords& aCoords = aNamedPointCoords;
1664 aCoords.Init(aNbElem,aDim,aNodeInfo);
1666 for(int iDim = 0; iDim < aDim; iDim++)
1667 aCoords.GetName(iDim) = aNodeInfo->GetCoordName(iDim);
1669 for(int iElem = 0; iElem < aNbElem; iElem++){
1670 TCoordSlice aVCoordSlice = aCoords.GetCoordSlice(iElem);
1671 MED::TCCoordSlice aMCoordSlice = aNodeInfo->GetCoordSlice(iElem);
1672 for(int iDim = 0; iDim < aDim; iDim++)
1673 aVCoordSlice[iDim] = aMCoordSlice[iDim];
1676 TGeom2SubMesh& aGeom2SubMesh = aMeshOnEntity->myGeom2SubMesh;
1677 PMEDSubMesh aSubMesh = aGeom2SubMesh[VISU::ePOINT1](new TMEDSubMesh());
1679 aSubMesh->Init(MED::PElemInfo(aNodeInfo));
1680 aSubMesh->myNbCells = theMesh->myNbPoints;
1681 aSubMesh->myCellsSize = 2*theMesh->myNbPoints;
1683 TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
1684 aCell2Connect.resize(aNbElem);
1685 for (int iElem = 0; iElem < aNbElem; iElem++)
1686 aCell2Connect[iElem] = VISU::TConnect(1,iElem);
1687 } // END NON_STRUCTURED
1688 else { // STRUCTURED
1690 MED::PGrilleInfo aGrilleInfo = theMed->GetPGrilleInfo(theMesh->myMeshInfo);
1691 TInt aNbElem = aGrilleInfo->GetNbNodes();
1692 TInt aDim = theMesh->myDim;
1694 PMEDNamedPointCoords aNamedPointCoords = theMesh->myNamedPointCoords;
1695 TMEDNamedPointCoords& aCoords = aNamedPointCoords;
1696 aCoords.Init(aNbElem,aDim,aGrilleInfo);
1698 for(int iDim = 0; iDim < aDim; iDim++)
1699 aCoords.GetName(iDim) = aGrilleInfo->GetCoordName(iDim);
1701 for(int iElem = 0; iElem < aNbElem; iElem++){
1702 TCoordSlice aVCoordSlice = aCoords.GetCoordSlice(iElem);
1703 MED::TNodeCoord aMCoord = aGrilleInfo->GetCoord(iElem);
1704 for(int iDim = 0; iDim < aDim; iDim++){
1705 aVCoordSlice[iDim] = aMCoord[iDim];
1709 TGeom2SubMesh& aGeom2SubMesh = aMeshOnEntity->myGeom2SubMesh;
1710 PMEDSubMesh aSubMesh = aGeom2SubMesh[VISU::ePOINT1](new TMEDSubMesh());
1712 aSubMesh->Init(aGrilleInfo);
1713 aSubMesh->myNbCells = theMesh->myNbPoints;
1714 aSubMesh->myCellsSize = 2*theMesh->myNbPoints;
1716 TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
1717 aCell2Connect.resize(aNbElem);
1718 for (int iElem = 0; iElem < aNbElem; iElem++)
1719 aCell2Connect[iElem] = VISU::TConnect(1,iElem);
1723 theMesh->myIsDone = true;
1727 }catch(std::exception& exc){
1730 EXCEPTION(runtime_error,"Unknown exception !!!");
1737 //---------------------------------------------------------------
1740 ::LoadPointsOnFamily(const MED::PWrapper& theMed,
1741 const VISU::PMEDMesh theMesh,
1742 const VISU::PMEDFamily theFamily)
1744 TTimerLog aTimerLog(MYDEBUG,"LoadPointsOnFamily");
1746 if(theFamily->myIsDone)
1750 MED::PNodeInfo aNodeInfo = theMed->GetPNodeInfo(theMesh->myMeshInfo);
1751 TInt aNbElem = aNodeInfo->GetNbElem();
1754 TInt anId = theFamily->myId;
1755 TSubMeshID& aSubMeshID = theFamily->myGeom2SubMeshID[VISU::ePOINT1];
1756 for(TInt iElem = 0; iElem < aNbElem; iElem++)
1757 if(aNodeInfo->GetFamNum(iElem) == anId)
1758 aSubMeshID.push_back(iElem);
1761 theFamily->myIsDone = true;
1765 }catch(std::exception& exc){
1768 EXCEPTION(runtime_error,"Unknown exception !!!");
1775 //---------------------------------------------------------------
1778 ::LoadCellsOnEntity(const MED::PWrapper& theMed,
1779 const VISU::PMEDMesh theMesh,
1780 const VISU::PMEDMeshOnEntity theMeshOnEntity)
1782 TTimerLog aTimerLog(MYDEBUG,"LoadCellsOnEntity");
1786 const TEntity& aVEntity = theMeshOnEntity->myEntity;
1787 const MED::EEntiteMaillage& aMEntity = VTKEntityToMED(aVEntity);
1789 INITMSG(MYDEBUG,"LoadCellsOnEntity - aVEntity = "<<aVEntity<<"\n");
1791 if(theMeshOnEntity->myIsDone)
1794 const MED::PMeshInfo& aMeshInfo = theMesh->myMeshInfo;
1796 MED::EMaillage aType = aMeshInfo->GetType();
1798 if(aType == MED::eSTRUCTURE){
1800 MED::PGrilleInfo aGrilleInfo = theMed->GetPGrilleInfo(aMeshInfo);
1801 TInt aNbPoints = aGrilleInfo->GetNbNodes();
1803 std::map<TInt,TInt> aNodeIdMap;
1804 EBooleen anIsNodeNum = MED::eFAUX;
1806 const MED::TGeom2Size& aGeom2Size = theMeshOnEntity->myGeom2Size;
1807 MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
1808 TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh;
1810 for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
1811 const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
1812 VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
1813 INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"; aEGeom = "<<aEGeom<<"\n");
1815 vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
1816 INITMSG(MYDEBUG,"aVNbNodes = "<<aVNbNodes<<"\n");
1818 TInt aNbElem = aGrilleInfo->GetNbCells();
1821 PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new TMEDSubMesh());
1823 aSubMesh->Init(aGrilleInfo);
1824 aSubMesh->myNbCells = aNbElem;
1825 aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1);
1827 TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
1828 aCell2Connect.resize(aNbElem);
1830 TInt aMNbNodes = MEDGeom2NbNodes(aMGeom);
1831 TVector<TInt> aConnect(aMNbNodes);
1833 for(TInt iElem = 0; iElem < aNbElem; iElem++) {
1834 MED::TIntVector aConn = aGrilleInfo->GetConn(iElem);
1835 TConnect& anArray = aCell2Connect[iElem];
1836 anArray.resize(aVNbNodes);
1839 for(TInt iConn = 0; iConn < aMNbNodes; iConn++){
1840 aConnect[iConn] = aNodeIdMap[aConn[iConn] - 1];
1843 for(int iConn = 0; iConn < aMNbNodes; ++iConn){
1844 aConnect[iConn] = aConn[iConn];
1850 anArray[0] = aConnect[0];
1851 anArray[1] = aConnect[2];
1852 anArray[2] = aConnect[3];
1853 anArray[3] = aConnect[1];
1856 anArray[0] = aConnect[0];
1857 anArray[1] = aConnect[2];
1858 anArray[2] = aConnect[3];
1859 anArray[3] = aConnect[1];
1860 anArray[4] = aConnect[4];
1861 anArray[5] = aConnect[6];
1862 anArray[6] = aConnect[7];
1863 anArray[7] = aConnect[5];
1866 for(int iNode = 0; iNode < aVNbNodes; iNode++)
1867 anArray[iNode] = aConnect[iNode];
1870 for(int iNode = 0; iNode < aVNbNodes; iNode++)
1871 if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode])
1872 EXCEPTION(runtime_error,"LoadCellsOnEntity - "<<
1873 " aNbPoints("<<aNbPoints<<") "<<
1874 "<= anArray["<<iElem<<"]"<<
1876 "("<<anArray[iNode]<<") < 0");
1882 theMeshOnEntity->myIsDone = true;
1888 MED::PNodeInfo aNodeInfo = theMed->GetPNodeInfo(aMeshInfo);
1889 TInt aNbPoints = aNodeInfo->GetNbElem();
1891 std::map<TInt,TInt> aNodeIdMap;
1892 #ifdef _EDF_NODE_IDS_
1893 EBooleen anIsNodeNum = MED::eFAUX;
1895 EBooleen anIsNodeNum = aNodeInfo->IsElemNum();
1897 for(TInt i = 0; i < aNbPoints; i++){
1898 aNodeIdMap[aNodeInfo->GetElemNum(i)-1] = i;
1903 const MED::TGeom2Size& aGeom2Size = theMeshOnEntity->myGeom2Size;
1904 MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
1905 TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh;
1907 for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
1908 const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
1909 VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
1910 INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"; aEGeom = "<<aEGeom<<"\n");
1912 case MED::ePOLYGONE: {
1913 MED::PPolygoneInfo aPolygoneInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
1914 TInt aNbElem = aPolygoneInfo->GetNbElem();
1916 PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new TMEDSubMesh());
1918 aSubMesh->Init(MED::PElemInfo(aPolygoneInfo));
1919 aSubMesh->myNbCells = aNbElem;
1921 TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
1922 aCell2Connect.resize(aNbElem);
1924 for(TInt iElem = 0; iElem < aNbElem; iElem++) {
1925 MED::TCConnSlice aConnSlice = aPolygoneInfo->GetConnSlice(iElem);
1926 TInt aNbConn = aPolygoneInfo->GetNbConn(iElem);
1927 aSubMesh->myCellsSize += aNbConn;
1928 TConnect& anArray = aCell2Connect[iElem];
1929 anArray.resize(aNbConn);
1930 for(TInt iConn = 0; iConn < aNbConn; iConn++)
1931 anArray[iConn] = aConnSlice[iConn] - 1;
1936 case MED::ePOLYEDRE: {
1937 MED::PPolyedreInfo aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
1938 TInt aNbElem = aPolyedreInfo->GetNbElem();
1941 PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new TMEDSubMesh());
1943 aSubMesh->Init((MED::PElemInfo)aPolyedreInfo);
1944 aSubMesh->myNbCells = aNbElem;
1946 TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
1947 aCell2Connect.resize(aNbElem);
1949 for(TInt iElem = 0; iElem < aNbElem; iElem++){
1950 MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(iElem);
1951 TConnect& anArray = aCell2Connect[iElem];
1952 typedef std::set<TInt> TConnectSet;
1953 TConnectSet aConnectSet;
1954 TInt aNbFaces = aConnSliceArr.size();
1955 for(TInt iFace = 0; iFace < aNbFaces; iFace++){
1956 MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
1957 TInt aNbConn = aConnSlice.size();
1958 aSubMesh->myCellsSize += aNbConn;
1959 for(TInt iConn = 0; iConn < aNbConn; iConn++){
1960 aConnectSet.insert(aConnSlice[iConn]);
1964 int aNbConn = aConnectSet.size();
1965 anArray.resize(aNbConn);
1966 TConnectSet::iterator anIter = aConnectSet.begin();
1967 for(int i = 0; anIter != aConnectSet.end(); anIter++, i++){
1968 TInt anId = *anIter;
1969 anArray[i] = anId - 1;
1977 vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
1978 INITMSG(MYDEBUG,"aVNbNodes = "<<aVNbNodes<<"\n");
1980 MED::PCellInfo aCellInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
1981 TInt aNbElem = aCellInfo->GetNbElem();
1984 PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new TMEDSubMesh());
1986 aSubMesh->Init((MED::PElemInfo)aCellInfo);
1987 aSubMesh->myNbCells = aNbElem;
1988 aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1);
1990 TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
1991 aCell2Connect.resize(aNbElem);
1993 TInt aMNbNodes = MEDGeom2NbNodes(aMGeom);
1994 TVector<TInt> aConnect(aMNbNodes);
1996 for(TInt iElem = 0; iElem < aNbElem; iElem++) {
1997 MED::TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem);
1998 TConnect& anArray = aCell2Connect[iElem];
1999 anArray.resize(aVNbNodes);
2002 for(TInt iConn = 0; iConn < aMNbNodes; iConn++){
2003 aConnect[iConn] = aNodeIdMap[aConnSlice[iConn] - 1];
2006 for(int iConn = 0; iConn < aMNbNodes; iConn++){
2007 aConnect[iConn] = aConnSlice[iConn] - 1;
2012 #if !(defined(VTK_QUADRATIC_EDGE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
2014 anArray[0] = aConnect[0];
2015 anArray[2] = aConnect[1];
2017 anArray[1] = aConnect[2];
2020 #if !(defined(VTK_QUADRATIC_TRIANGLE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
2022 anArray[0] = aConnect[0];
2023 anArray[2] = aConnect[1];
2024 anArray[4] = aConnect[2];
2026 anArray[1] = aConnect[3];
2027 anArray[3] = aConnect[4];
2028 anArray[5] = aConnect[5];
2031 #if !(defined(VTK_QUADRATIC_QUAD) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
2033 anArray[0] = aConnect[0];
2034 anArray[2] = aConnect[1];
2035 anArray[4] = aConnect[2];
2036 anArray[6] = aConnect[3];
2038 anArray[1] = aConnect[4];
2039 anArray[3] = aConnect[5];
2040 anArray[5] = aConnect[6];
2041 anArray[7] = aConnect[7];
2044 #if (defined(VTK_QUADRATIC_TETRA) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
2046 anArray[0] = aConnect[0];
2047 anArray[1] = aConnect[2];
2048 anArray[2] = aConnect[1];
2049 anArray[3] = aConnect[3];
2051 anArray[4] = aConnect[6];
2052 anArray[5] = aConnect[5];
2053 anArray[6] = aConnect[4];
2055 anArray[7] = aConnect[7];
2056 anArray[8] = aConnect[9];
2057 anArray[9] = aConnect[8];
2061 anArray[0] = aConnect[0];
2062 anArray[1] = aConnect[2];
2063 anArray[2] = aConnect[1];
2064 anArray[3] = aConnect[3];
2066 #if (defined(VTK_QUADRATIC_PYRAMID) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
2068 anArray[0] = aConnect[0];
2069 anArray[1] = aConnect[3];
2070 anArray[2] = aConnect[2];
2071 anArray[3] = aConnect[1];
2072 anArray[4] = aConnect[4];
2074 anArray[5] = aConnect[5];
2075 anArray[6] = aConnect[8];
2076 anArray[7] = aConnect[7];
2077 anArray[8] = aConnect[6];
2079 anArray[9] = aConnect[9];
2080 anArray[10] = aConnect[12];
2081 anArray[11] = aConnect[11];
2082 anArray[12] = aConnect[10];
2086 anArray[0] = aConnect[0];
2087 anArray[1] = aConnect[3];
2088 anArray[2] = aConnect[2];
2089 anArray[3] = aConnect[1];
2090 anArray[4] = aConnect[4];
2093 for(int iNode = 0; iNode < aVNbNodes; iNode++)
2094 anArray[iNode] = aConnect[iNode];
2096 for(int iNode = 0; iNode < aVNbNodes; iNode++)
2097 if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode])
2098 EXCEPTION(runtime_error,"LoadCellsOnEntity - "<<
2099 " aNbPoints("<<aNbPoints<<") "<<
2100 "<= anArray["<<iElem<<"]"<<
2102 "("<<anArray[iNode]<<") < 0");
2108 // END NON_STRUCTURED
2110 theMeshOnEntity->myIsDone = true;
2115 }catch(std::exception& exc){
2118 EXCEPTION(runtime_error,"Unknown exception !!!");
2126 //---------------------------------------------------------------
2129 ::LoadCellsOnFamily(const MED::PWrapper& theMed,
2130 const VISU::PMEDMesh theMesh,
2131 const VISU::PMEDMeshOnEntity theMeshOnEntity,
2132 const VISU::PMEDFamily theFamily)
2134 TTimerLog aTimerLog(MYDEBUG,"LoadCellsOnFamily");
2138 const TEntity& aVEntity = theMeshOnEntity->myEntity;
2139 const MED::EEntiteMaillage& aMEntity = VTKEntityToMED(aVEntity);
2141 INITMSG(MYDEBUG,"LoadCellsOnFamily - aVEntity = "<<aVEntity<<"\n");
2143 if(theFamily->myIsDone)
2146 TInt anId = theFamily->myId;
2148 const MED::PMeshInfo& aMeshInfo = theMesh->myMeshInfo;
2149 TGeom2SubMeshID& aGeom2SubMeshID = theFamily->myGeom2SubMeshID;
2151 const MED::TGeom2Size& aGeom2Size = theMeshOnEntity->myGeom2Size;
2152 MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
2153 for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
2154 const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
2155 MED::PElemInfo anElemInfo;
2157 case MED::ePOLYGONE: {
2158 anElemInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom);
2161 case MED::ePOLYEDRE: {
2162 anElemInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom);
2166 anElemInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom);
2170 if(TInt aNbElem = anElemInfo->GetNbElem()){
2171 TSubMeshID aSubMeshID;
2172 for(TInt iElem = 0; iElem < aNbElem; iElem++)
2173 if(anElemInfo->GetFamNum(iElem) == anId)
2174 aSubMeshID.push_back(iElem);
2175 if(!aSubMeshID.empty()){
2176 VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
2177 INITMSG(MYDEBUG,"aMGeom = "<<aMGeom<<"\n");
2178 aGeom2SubMeshID.insert(TGeom2SubMeshID::value_type(aEGeom,aSubMeshID));
2184 theFamily->myIsDone = true;
2189 }catch(std::exception& exc){
2192 EXCEPTION(runtime_error,"Unknown exception !!!");
2200 //---------------------------------------------------------------
2202 LoadProfile(const MED::PWrapper& theMed,
2203 VISU::PMEDMesh theMesh,
2204 MED::TTimeStampVal& theTimeStampVal,
2205 VISU::TMEDValForTime& theValForTime,
2206 VISU::TMEDMeshOnEntity& theMeshOnEntity)
2208 TTimerLog aTimerLog(MYDEBUG,"LoadProfile");
2209 INITMSG(MYDEBUG,"LoadProfile"<<endl);
2211 PMEDProfile aProfile = theValForTime.myProfile;
2212 if(aProfile->myIsDone)
2215 const TGeom2SubProfile& aGeom2SubProfile = aProfile->myGeom2SubProfile;
2216 const MED::TGeom2Profile& aGeom2Profile = theTimeStampVal.GetGeom2Profile();
2217 MED::TGeom2Profile::const_iterator anIter = aGeom2Profile.begin();
2218 for(; anIter != aGeom2Profile.end(); anIter++){
2219 MED::PProfileInfo aProfileInfo = anIter->second;
2220 MED::EGeometrieElement aMGeom = anIter->first;
2221 VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
2223 TGeom2SubProfile::const_iterator anIter2 = aGeom2SubProfile.find(aEGeom);
2224 if(anIter2 != aGeom2SubProfile.end()){
2225 PMEDSubProfile aSubProfile = anIter2->second;
2227 MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
2228 if(!anElemNum.empty()){
2229 TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID;
2230 TInt aSize = anElemNum.size();
2231 aSubMeshID.resize(aSize);
2232 for(TInt anId = 0; anId < aSize; anId++)
2233 aSubMeshID[anId] = anElemNum[anId] - 1;
2237 "- aEGeom = "<<aEGeom<<
2238 "; aNbCells = "<<aSubProfile->mySubMeshID.size()<<
2243 const MED::PMeshInfo& aMeshInfo = theMesh->myMeshInfo;
2245 TEntity aVEntity = theMeshOnEntity.myEntity;
2246 MED::EEntiteMaillage aMEntity = VTKEntityToMED(aVEntity);
2248 const TGeom2SubProfile& aGeom2SubProfile = aProfile->myGeom2SubProfile;
2249 TGeom2SubProfile::const_iterator anIter = aGeom2SubProfile.begin();
2250 for(; anIter != aGeom2SubProfile.end(); anIter++){
2251 const PMEDSubProfile& aSubProfile = anIter->second;
2252 MED::EGeometrieElement aMGeom = aSubProfile->myMGeom;
2253 MED::PElemInfo anElemInfo;
2254 anElemInfo = theMed->GetPElemInfo(aMeshInfo,aMEntity,aMGeom);
2255 aSubProfile->myIsElemNum = anElemInfo->IsElemNum();
2256 aSubProfile->myElemNum = anElemInfo->myElemNum;
2260 aProfile->myIsDone = true;
2264 //---------------------------------------------------------------
2266 LoadGaussMesh(const MED::PWrapper& theMed,
2267 VISU::PMEDMesh theMesh,
2268 MED::TTimeStampVal& theTimeStampVal,
2269 VISU::TMEDValForTime& theValForTime,
2270 VISU::TMEDMeshOnEntity& theMeshOnEntity)
2272 TTimerLog aTimerLog(MYDEBUG,"LoadGaussMesh");
2273 INITMSG(MYDEBUG,"LoadGaussMesh"<<endl);
2275 // this part of code must be reimplemented in connection with GRILLE structures
2276 if(theMesh->myMeshInfo->GetType() == MED::eSTRUCTURE)
2277 EXCEPTION(runtime_error,"LoadGaussMesh - Gauss Points localization error!!!");
2279 PMEDGaussMesh aGaussMesh = theValForTime.myGaussMesh;
2280 if(!aGaussMesh || aGaussMesh->myIsDone)
2283 const MED::PMeshInfo& aMeshInfo = theMesh->myMeshInfo;
2284 MED::PNodeInfo aNodeInfo = theMed->GetPNodeInfo(aMeshInfo);
2286 TEntity aVEntity = theMeshOnEntity.myEntity;
2287 MED::EEntiteMaillage aMEntity = VTKEntityToMED(aVEntity);
2289 const TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh;
2290 const MED::TTimeStampInfo& aTimeStampInfo = theTimeStampVal.GetTimeStampInfo();
2291 const MED::TGeom2Gauss& aGeom2Gauss = aTimeStampInfo.GetGeom2Gauss();
2293 TGeom2GaussSubMesh::const_iterator aSubMeshIter = aGeom2GaussSubMesh.begin();
2294 for(; aSubMeshIter != aGeom2GaussSubMesh.end(); aSubMeshIter++){
2295 PMEDGaussSubMesh aGaussSubMesh = aSubMeshIter->second;
2296 VISU::EGeometry aEGeom = aSubMeshIter->first;
2298 if(aGaussSubMesh->myIsDone)
2301 PMEDSubProfile aSubProfile = aGaussSubMesh->mySubProfile;
2302 const TSubMeshID& aSubMeshID = aSubProfile->mySubMeshID;
2303 MED::EGeometrieElement aMGeom = aSubProfile->myMGeom;
2305 MED::PPolygoneInfo aPolygoneInfo;
2306 MED::PPolyedreInfo aPolyedreInfo;
2307 MED::PCellInfo aCellInfo;
2308 MED::PElemInfo anElemInfo;
2311 case MED::ePOLYGONE:
2312 aPolygoneInfo = theMed->GetPPolygoneInfo(aMeshInfo,
2315 anElemInfo = aPolygoneInfo;
2317 case MED::ePOLYEDRE:
2318 aPolyedreInfo = theMed->GetPPolyedreInfo(aMeshInfo,
2321 anElemInfo = aPolyedreInfo;
2324 aCellInfo = theMed->GetPCellInfo(aMeshInfo,
2327 anElemInfo = aCellInfo;
2329 aGaussSubMesh->myIsElemNum = anElemInfo->IsElemNum();
2330 aGaussSubMesh->myElemNum = anElemInfo->myElemNum;
2333 MED::TGaussCoord aGaussCoord;
2334 bool anIsGaussCoord3D = false;
2336 MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom);
2337 if(aGaussIter != aGeom2Gauss.end()){
2338 PMEDGauss aGauss = aGaussSubMesh->myGauss;
2339 MED::PGaussInfo aGaussInfo = aGauss->myGaussInfo;
2341 aName = aGaussInfo->GetName();
2342 if(!aSubMeshID.empty()){
2343 const std::string& aProfileName = aSubProfile->myName;
2344 MED::PProfileInfo aProfileInfo = MED::GetProfileInfo(theMed,
2347 const MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
2348 anIsGaussCoord3D = MED::GetGaussCoord3D(aGaussInfo,
2355 anIsGaussCoord3D = MED::GetGaussCoord3D(aGaussInfo,
2361 if(!aSubMeshID.empty()){
2362 const std::string& aProfileName = aSubProfile->myName;
2363 MED::PProfileInfo aProfileInfo = MED::GetProfileInfo(theMed,
2366 const MED::TElemNum& anElemNum = aProfileInfo->myElemNum;
2368 case MED::ePOLYGONE:
2369 anIsGaussCoord3D = MED::GetBaryCenter(aPolygoneInfo,
2374 case MED::ePOLYEDRE:
2375 anIsGaussCoord3D = MED::GetBaryCenter(aPolyedreInfo,
2381 anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo,
2389 case MED::ePOLYGONE:
2390 anIsGaussCoord3D = MED::GetBaryCenter(aPolygoneInfo,
2394 case MED::ePOLYEDRE:
2395 anIsGaussCoord3D = MED::GetBaryCenter(aPolyedreInfo,
2400 anIsGaussCoord3D = MED::GetBaryCenter(aCellInfo,
2406 if(anIsGaussCoord3D){
2407 TPointCoords& aCoords = aGaussSubMesh->myPointCoords;
2408 TInt aNbGauss = aGaussCoord.GetNbGauss();
2409 TInt aNbElem = aGaussCoord.GetNbElem();
2410 TInt aDim = aGaussCoord.GetDim();
2411 vtkIdType aNbCells = aNbElem*aNbGauss;
2412 aCoords.Init(aNbCells,aDim);
2413 for(TInt anElemId = 0, aNodeId = 0; anElemId < aNbElem; anElemId++){
2414 MED::TCoordSliceArr aCoordSliceArr = aGaussCoord.GetCoordSliceArr(anElemId);
2415 for(TInt aGaussId = 0; aGaussId < aNbGauss; aGaussId++, aNodeId++){
2416 MED::TCoordSlice aCoordSlice = aCoordSliceArr[aGaussId];
2417 TCoordSlice aSlice = aCoords.GetCoordSlice(aNodeId);
2418 for(TInt aDimId = 0; aDimId < aDim; aDimId++)
2419 aSlice[aDimId] = aCoordSlice[aDimId];
2423 aGaussSubMesh->myIsDone = true;;
2426 "- aEGeom = "<<aEGeom<<
2427 "; aName = '"<<aName<<"'"<<
2428 "; aStatus = "<<aGaussSubMesh->myStatus<<
2429 "; aNbElem = "<<aNbElem<<
2430 "; aNbGauss = "<<aNbGauss<<
2431 "; aNbCells = "<<aNbCells<<
2434 EXCEPTION(runtime_error,"LoadGaussMesh - Gauss Points localization error!!!");
2437 aGaussMesh->myIsDone = true;
2441 //---------------------------------------------------------------
2443 LoadValForTime(const MED::PWrapper& theMed,
2444 VISU::PMEDMesh theMesh,
2445 VISU::PMEDMeshOnEntity theMeshOnEntity,
2446 VISU::PMEDField theField,
2447 VISU::PMEDValForTime theValForTime,
2451 TTimerLog aTimerLog(MYDEBUG,"LoadValForTime");
2452 INITMSG(MYDEBUG,"LoadValForTime - theIsGauss = "<<theIsGauss<<endl);
2454 //Check on loading already done
2459 const std::string& aMeshName = theMeshOnEntity->myMeshName;
2460 const MED::PMeshInfo& aMeshInfo = theMesh->myMeshInfo;
2461 MED::PFieldInfo aFieldInfo = theMed->GetPFieldInfo(aMeshInfo,
2464 MED::TGeom2Size aGeom2Size;
2465 MED::EEntiteMaillage aMEntity;
2466 theMed->GetNbTimeStamps(aFieldInfo,
2467 theMesh->myEntityInfo,
2471 MED::PTimeStampInfo aTimeStampInfo =
2472 theMed->GetPTimeStampInfo(aFieldInfo,
2475 theValForTime->myId);
2477 MED::TKey2Gauss aKey2Gauss = GetKey2Gauss(theMed);
2478 MED::TMKey2Profile aMKey2Profile = GetMKey2Profile(theMed);
2480 MED::PTimeStampVal aTimeStampVal =
2481 theMed->GetPTimeStampVal(aTimeStampInfo,
2485 InitGaussProfile(theMed,
2500 LoadGaussMesh(theMed,
2506 PMEDProfile aProfile = theValForTime->myProfile;
2507 TGeom2SubProfile& aGeom2SubProfile = aProfile->myGeom2SubProfile;
2509 TInt aNbComp = theField->myNbComp;
2512 "- aMeshName = '"<<aMeshName<<"'"<<
2513 "; aFieldName = '"<<aFieldInfo->GetName()<<"'"<<
2514 "; aMEntity = "<<aMEntity<<
2515 "; aNbComp = "<<aNbComp<<
2518 theField->myDataSize = 0;
2520 const MED::TTimeStampVal& aTimeStampValRef = aTimeStampVal;
2521 TGeom2SubProfile::const_iterator anIter = aGeom2SubProfile.begin();
2522 for(; anIter != aGeom2SubProfile.end(); anIter++){
2523 VISU::EGeometry aEGeom = anIter->first;
2524 PMEDSubProfile aSubProfile(anIter->second);
2526 TInt aNbElem = aSubProfile->myNbCells;
2527 theField->myDataSize += aNbElem*aNbComp;
2529 if(aSubProfile->myStatus != eRemoveAll){
2530 TInt aNbGauss = theValForTime->GetNbGauss(aEGeom);
2533 "- aEGeom = "<<aEGeom<<
2534 "; aNbElem = "<<aNbElem<<
2535 "; aNbGauss = "<<aNbGauss<<
2538 TMeshValue& aVMeshValue = theValForTime->GetMeshValue(aEGeom);
2539 aVMeshValue.Init(aNbElem,aNbGauss,aNbComp);
2541 MED::EGeometrieElement aMGeom = aSubProfile->myMGeom;
2542 const MED::TMeshValue& aMMeshValue = aTimeStampValRef.GetMeshValue(aMGeom);
2543 for(TInt iElem = 0; iElem < aNbElem; iElem++){
2544 TValueSliceArr aVValueSliceArr = aVMeshValue.GetGaussValueSliceArr(iElem);
2545 MED::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetGaussValueSliceArr(iElem);
2546 ADDMSG(MYVALUEDEBUG,"{");
2547 for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
2548 TValueSlice& aVValueSlice = aVValueSliceArr[iGauss];
2549 const MED::TCValueSlice& aMValueSlice = aMValueSliceArr[iGauss];
2550 for(TInt iComp = 0; iComp < aNbComp; iComp++){
2551 aVValueSlice[iComp] = aMValueSlice[iComp];
2552 ADDMSG(MYVALUEDEBUG,aVValueSlice[iComp]<<" ");
2554 ADDMSG(MYVALUEDEBUG,"| ");
2556 ADDMSG(MYVALUEDEBUG,"} ");
2558 ADDMSG(MYDEBUG,"\n");
2568 //---------------------------------------------------------------
2571 ::LoadValForTimeOnMesh(const MED::PWrapper& theMed,
2572 VISU::PMEDMesh theMesh,
2573 VISU::PMEDMeshOnEntity theMeshOnEntity,
2574 VISU::PMEDField theField,
2575 VISU::PMEDValForTime theValForTime)
2577 PIDMapperFilter anIDMapperFilter = theValForTime->myIDMapperFilter;
2578 return LoadValForTime(theMed,
2584 anIDMapperFilter->myIsVTKDone);
2588 //---------------------------------------------------------------
2591 ::LoadValForTimeOnGaussPts(const MED::PWrapper& theMed,
2592 VISU::PMEDMesh theMesh,
2593 VISU::PMEDMeshOnEntity theMeshOnEntity,
2594 VISU::PMEDField theField,
2595 VISU::PMEDValForTime theValForTime)
2597 PGaussPtsIDFilter aGaussPtsIDFilter = theValForTime->myGaussPtsIDFilter;
2598 return LoadValForTime(theMed,
2604 aGaussPtsIDFilter->myIsVTKDone);