Back to index

salome-med  6.5.0
MEDMEMTest.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #include "MEDMEMTest.hxx"
00021 #include <cppunit/TestAssert.h>
00022 
00023 #include "MEDMEM_Exception.hxx"
00024 #include "MEDMEM_Group.hxx"
00025 #include "MEDMEM_IndexCheckingPolicy.hxx"
00026 #include "MEDMEM_MedFieldDriver.hxx"
00027 #include "MEDMEM_Mesh.hxx"
00028 #include "MEDMEM_Meshing.hxx"
00029 #include "MEDMEM_STRING.hxx"
00030 #include "MEDMEM_Remapper.hxx"
00031 
00032 #include <sstream>
00033 #include <cmath>
00034 #include <stdexcept>
00035 
00036 #ifdef WNT
00037 #include <windows.h>
00038 #endif
00039 
00040 using namespace std;
00041 
00042 // ============================================================================
00046 // ============================================================================
00047 void MEDMEMTest::setUp()
00048 {
00049 }
00050 
00051 // ============================================================================
00055 // ============================================================================
00056 void MEDMEMTest::tearDown()
00057 {
00058 }
00059 
00060 /*
00061 // #1: MEDMEM_Array.hxx                \
00062 // #2: MEDMEM_ArrayConvert.hxx          }  MEDMEMTest_Array.cxx
00063 // #3: MEDMEM_ArrayInterface.hxx (-)   /
00064 // #4: MEDMEM_AsciiFieldDriver.hxx      }  MEDMEMTest_AsciiFieldDriver.cxx
00065 // #5: MEDMEM_CellModel.hxx             }  MEDMEMTest.cxx (-)
00066 // #7: MEDMEM_Connectivity.hxx          }  MEDMEMTest_Connectivity.cxx
00067 // #8: MEDMEM_Coordinate.hxx            }  MEDMEMTest_Coordinate.cxx
00068 // #9: MEDMEM_DriverFactory.hxx         }  MEDMEMTest_DriverFactory.cxx
00069 // #10: MEDMEM_DriversDef.hxx           }  MEDMEMTest.cxx (-)
00070 // #11: MEDMEM_DriverTools.hxx          }  MEDMEMTest.cxx (-)
00071 // #12: MEDMEM_Exception.hxx            }  MEDMEMTest_Exception.cxx
00072 // #13: MEDMEM_Family.hxx               }  MEDMEMTest.cxx
00073 // #14: MEDMEM_Field.hxx                \
00074 // #15: MEDMEM_FieldConvert.hxx         /  MEDMEMTest_Field.cxx
00075 // #16: MEDMEM_FieldForward.hxx         }  no methods to test
00076 // #17: MEDMEM_Formulae.hxx             }  MEDMEMTest_Formulae.cxx
00077 // #18: MEDMEM_GaussLocalization.hxx    }  MEDMEMTest_GaussLocalization.cxx
00078 // #19: MEDMEM_GenDriver.hxx  }  abstract class; implemented methods are tested during its successors testing
00079 // #20: MEDMEM_GibiMeshDriver.hxx       }  MEDMEMTest_GibiMeshDriver.cxx
00080 // #21: MEDMEM_Grid.cxx                 }  MEDMEMTest_Grid.cxx
00081 // #22: MEDMEM_Group.cxx                }  MEDMEMTest_Group.cxx
00082 // #23: MEDMEM_IndexCheckingPolicy.cxx  }  MEDMEMTest.cxx
00083 // #24: MEDMEM_Init.cxx                 }  MEDMEMTest.cxx
00084 // #25: MEDMEM_InterlacingPolicy.hxx    }  MEDMEMTest.cxx (-)
00085 // #26: MEDMEM_InterlacingTraits.hxx    }  MEDMEMTest.cxx (-)
00086 // #28: MEDMEM_MedFieldDriver.hxx       }  MEDMEMTest_MedFieldDriver.cxx
00087 // #34: MEDMEM_MEDMEMchampLire.hxx      }  MEDMEMTest.cxx (-)
00088 // #35: MEDMEM_MEDMEMgaussEcr.hxx       }  MEDMEMTest.cxx (-)
00089 // #36: MEDMEM_MEDMEMprofilEcr.hxx      }  MEDMEMTest.cxx (-)
00090 // #37: MEDMEM_MedMeshDriver.hxx        }  MEDMEMTest_MedMeshDriver.cxx
00091 // #40: MEDMEM_MedVersion.hxx           }  MEDMEMTest_MedVersion.cxx
00092 // #41: MEDMEM_Mesh.hxx                 \
00093 // #42: MEDMEM_Meshing.hxx              /  MEDMEMTest_MeshAndMeshing.cxx
00094 // #43: MEDMEM_ModulusArray.hxx         }  MEDMEMTest_ModulusArray.cxx
00095 // #44: MEDMEM_nArray.hxx               }  MEDMEMTest_nArray.cxx
00096 // #45: MEDMEM_PointerOf.hxx            }  MEDMEMTest_PointerOf.cxx
00097 // #47: MEDMEM_PorflowMeshDriver.hxx    }  MEDMEMTest_PorflowMeshDriver.cxx
00098 // #48: MEDMEM_RCBase.hxx               }  MEDMEMTest.cxx (-)
00099 // #49: MEDMEM_SetInterlacingType.hxx   }  MEDMEMTest.cxx (-)
00100 // #50: MEDMEM_SkyLineArray.hxx         }  MEDMEMTest_SkyLineArray.cxx
00101 // #51: MEDMEM_STRING.hxx               }  MEDMEMTest.cxx
00102 // #52: MEDMEM_Support.hxx              }  MEDMEMTest_Support.cxx
00103 // #53: MEDMEM_Tags.hxx                 }  MEDMEMTest.cxx (-)
00104 // #54: MEDMEM_TopLevel.hxx             }  MEDMEMTest_TopLevel.cxx
00105 // #55: MEDMEM_TypeMeshDriver.hxx       }  MEDMEMTest.cxx
00106 // #56: MEDMEM_Unit.hxx                 }  MEDMEMTest_Unit.cxx
00107 // #57: MEDMEM_VtkFieldDriver.hxx       }  MEDMEMTest_VtkFieldDriver.cxx
00108 // #58: MEDMEM_VtkMedDriver.hxx         }  MEDMEMTest_VtkMedDriver.cxx
00109 // #59: MEDMEM_VtkMeshDriver.hxx        }  MEDMEMTest_VtkMeshDriver.cxx
00110 // #60: MEDMEM_medimport_src.hxx        }  MEDMEMTest.cxx (-)
00111 */
00112 
00128 void MEDMEMTest::testIndexCheckingPolicy()
00129 {
00130   MEDMEM::IndexCheckPolicy do_check;
00131   MEDMEM::NoIndexCheckPolicy no_check;
00132 
00133   int min = 3;
00134   int max = 10;
00135 
00136   string aClassName ("MEDMEMTest::testIndexCheckingPolicy");
00137 
00138   // IndexCheckPolicy: throw, if index does not satisfy criteria
00139   CPPUNIT_ASSERT_THROW(do_check.checkMoreThanZero(aClassName, -1), MEDMEM::MEDEXCEPTION);
00140   CPPUNIT_ASSERT_THROW(do_check.checkLessOrEqualThan(aClassName, max, 13), MEDMEM::MEDEXCEPTION);
00141   CPPUNIT_ASSERT_THROW(do_check.checkInInclusiveRange(aClassName, min, max, 1), MEDMEM::MEDEXCEPTION);
00142   // checkEquality() check that values are not equal
00143   CPPUNIT_ASSERT_THROW(do_check.checkEquality(aClassName, 21, 21), MEDMEM::MEDEXCEPTION);
00144 
00145   // NoIndexCheckPolicy: do not throw, if index does not satisfy criteria
00146   CPPUNIT_ASSERT_NO_THROW(no_check.checkMoreThanZero(aClassName, -1));
00147   CPPUNIT_ASSERT_NO_THROW(no_check.checkLessOrEqualThan(aClassName, max, 13));
00148   CPPUNIT_ASSERT_NO_THROW(no_check.checkInInclusiveRange(aClassName, min, max, 1));
00149   CPPUNIT_ASSERT_NO_THROW(no_check.checkEquality(aClassName, 21, 21));
00150 
00151   // IndexCheckPolicy: do not throw, if index satisfy criteria
00152   CPPUNIT_ASSERT_NO_THROW(do_check.checkMoreThanZero(aClassName, 5));
00153   CPPUNIT_ASSERT_NO_THROW(do_check.checkLessOrEqualThan(aClassName, max, 7));
00154   CPPUNIT_ASSERT_NO_THROW(do_check.checkInInclusiveRange(aClassName, min, max, 6));
00155   CPPUNIT_ASSERT_NO_THROW(do_check.checkEquality(aClassName, 21, 28));
00156 
00157   // NoIndexCheckPolicy: do not throw, if index satisfy criteria
00158   CPPUNIT_ASSERT_NO_THROW(no_check.checkMoreThanZero(aClassName, 5));
00159   CPPUNIT_ASSERT_NO_THROW(no_check.checkLessOrEqualThan(aClassName, max, 7));
00160   CPPUNIT_ASSERT_NO_THROW(no_check.checkInInclusiveRange(aClassName, min, max, 6));
00161   CPPUNIT_ASSERT_NO_THROW(no_check.checkEquality(aClassName, 21, 28));
00162 }
00163 
00168 void MEDMEMTest::testInit()
00169 {
00170   // We cannot check here effect of initialization, done in MEDMEM_Init.cxx,
00171   // because environment variable, set there, is visible only in libmedmem.la
00172   // and its child processes (if any).
00173 
00174   // Check effect of MEDMEM_Init.cxx
00175   //char* traceKind = getenv("SALOME_trace");
00176   //CPPUNIT_ASSERT(traceKind);
00177 }
00178 
00182 //void MEDMEMTest::testInterlacingPolicy()
00183 //{
00184 //  CPPUNIT_FAIL("Case Not Implemented (not in spec)");
00185 //}
00186 
00190 //void MEDMEMTest::testInterlacingTraits()
00191 //{
00192 //  CPPUNIT_FAIL("Case Not Implemented (not in spec)");
00193 //}
00194 
00198 //void MEDMEMTest::testMedFieldDriver()
00199 //{
00200 //  CPPUNIT_FAIL("Case Not Implemented (not in spec)");
00201 //}
00202 
00206 //void MEDMEMTest::testMEDMEMchampLire()
00207 //{
00208 //  CPPUNIT_FAIL("Case Not Implemented (not in spec)");
00209 //}
00210 
00214 //void MEDMEMTest::testMEDMEMgaussEcr()
00215 //{
00216 //  CPPUNIT_FAIL("Case Not Implemented (not in spec)");
00217 //}
00218 
00222 //void MEDMEMTest::testMEDMEMprofilEcr()
00223 //{
00224 //  CPPUNIT_FAIL("Case Not Implemented (not in spec)");
00225 //}
00226 
00230 //void MEDMEMTest::testMedMeshDriver()
00231 //{
00232 //  CPPUNIT_FAIL("Case Not Implemented (not in spec)");
00233 //}
00234 
00242 //void MEDMEMTest::testRCBase()
00243 //{
00244 //  // nothing to test
00245 //}
00246 
00250 //void MEDMEMTest::testSetInterlacingType()
00251 //{
00252 //  CPPUNIT_FAIL("Case Not Implemented (not in spec)");
00253 //}
00254 
00265 void MEDMEMTest::testSTRING()
00266 {
00267   {
00268     // empty constructor
00269     MEDMEM::STRING medstr;
00270     CPPUNIT_ASSERT(strcmp(medstr.c_str(), "") == 0);
00271 
00272     // template <class T> STRING & operator<<(const T &valeur) with T == char*
00273     //medstr << <char*>"filling 1";
00274     medstr << "filling " << 1 << " !!!";
00275     CPPUNIT_ASSERT(strcmp(medstr.c_str(), "filling 1 !!!") == 0);
00276 
00277     // operator const char * ()
00278     CPPUNIT_ASSERT(strcmp((const char *)medstr, "filling 1 !!!") == 0);
00279     CPPUNIT_ASSERT(strcmp(              medstr, "filling 1 !!!") == 0);
00280   }
00281 
00282   MEDMEM::MESH * aMesh1 = MEDMEMTest_createTestMesh();
00283   ostringstream ostr;
00284   ostr << *aMesh1;
00285 
00286   {
00287     // template <class T> STRING & operator<<(const T &valeur) with T == MEDMEM::MESH
00288     MEDMEM::STRING medstr;
00289     //medstr << <char*>"filling 1";
00290     medstr << *aMesh1;
00291     CPPUNIT_ASSERT(strcmp(medstr, ostr.str().c_str()) == 0);
00292   }
00293 
00294   {
00295     // Constructor STRING(const T &valeur) with T == char*
00296     //MEDMEM::STRING medstr<char*>("filling 2");
00297     MEDMEM::STRING medstr ("filling 2");
00298     CPPUNIT_ASSERT(strcmp(medstr.c_str(), "filling 2") == 0);
00299     CPPUNIT_ASSERT(strcmp(medstr, "filling 2") == 0);
00300   }
00301 
00302   {
00303     // Constructor STRING(const T &valeur) with T == MEDMEM::MESH
00304     MEDMEM::STRING medstr (*aMesh1);
00305     CPPUNIT_ASSERT(strcmp(medstr, ostr.str().c_str()) == 0);
00306   }
00307   if(aMesh1)
00308     aMesh1->removeReference();
00309 }
00310 
00314 //void MEDMEMTest::testTags()
00315 //{
00316 //  CPPUNIT_FAIL("Case Not Implemented (not in spec)");
00317 //}
00318 
00358 void MEDMEMTest::testTypeMeshDriver()
00359 {
00360   CPPUNIT_FAIL("TYPE_MESH_DRIVER: not implemented");
00361 }
00362 
00366 //void MEDMEMTest::testmedimport_src()
00367 //{
00368 //  CPPUNIT_FAIL("Case Not Implemented (not in spec)");
00369 //}
00370 
00371 //60
00372 //21 not in spec
00373 
00375 // HELP METHODS, used in many tests //
00377 
00431 MEDMEM::MESH * MEDMEMTest_createTestMesh ()
00432 {
00433   // MESH DATA
00434   int SpaceDimension = 3;
00435 
00436   // coordinates
00437   int NumberOfNodes = 19;
00438 
00439   string Names[3] = { "X","Y","Z" };
00440   string Units[3] = { "cm","cm","cm" };
00441 
00442   double Coordinates[57] = {
00443      0.0,  0.0, 0.0, // n1
00444      0.0,  0.0, 1.0, // n2
00445      2.0,  0.0, 1.0, // n3
00446      0.0,  2.0, 1.0, // n4
00447     -2.0,  0.0, 1.0, // n5
00448      0.0, -2.0, 1.0, // n6
00449      1.0,  1.0, 2.0, // n7
00450     -1.0,  1.0, 2.0, // n8
00451     -1.0, -1.0, 2.0, // n9
00452      1.0, -1.0, 2.0, // n10
00453      1.0,  1.0, 3.0, // n11
00454     -1.0,  1.0, 3.0, // n12
00455     -1.0, -1.0, 3.0, // n13
00456      1.0, -1.0, 3.0, // n14
00457      1.0,  1.0, 4.0, // n15
00458     -1.0,  1.0, 4.0, // n16
00459     -1.0, -1.0, 4.0, // n17
00460      1.0, -1.0, 4.0, // n18
00461      0.0,  0.0, 5.0  // n19
00462   };
00463 
00464   // cells connectivities
00465   const int NumberOfCellTypes = 3;
00466   MED_EN::medGeometryElement CellTypes[NumberOfCellTypes] =
00467     {MED_EN::MED_TETRA4, MED_EN::MED_PYRA5, MED_EN::MED_HEXA8};
00468   const int NumberOfCells[NumberOfCellTypes] = {12, 2, 2};
00469 
00470   int ConnectivityTetra[12 * 4] = {
00471     1,2,3,6,
00472     1,2,4,3,
00473     1,2,5,4,
00474     1,2,6,5,
00475     2,7,4,3,
00476     2,8,5,4,
00477     2,9,6,5,
00478     2,10,3,6,
00479     2,7,3,10,
00480     2,8,4,7,
00481     2,9,5,8,
00482     2,10,6,9
00483   };
00484 
00485   int ConnectivityPyra[2 * 5] = {
00486     7,8,9,10,2,
00487     15,18,17,16,19
00488   };
00489 
00490   int ConnectivityHexa[2 * 8] = {
00491     11,12,13,14,7,8,9,10,
00492     15,16,17,18,11,12,13,14
00493   };
00494 
00495   // faces connectivities
00496   const int NumberOfFaceTypes = 2;
00497   MED_EN::medGeometryElement FaceTypes[NumberOfFaceTypes] = {MED_EN::MED_TRIA3, MED_EN::MED_QUAD4};
00498   const int NumberOfFaces[NumberOfFaceTypes] = {4, 4};
00499 
00500   int ConnectivityTria[4 * 3] = {
00501     1,4,3,
00502     1,5,4,
00503     1,6,5,
00504     1,3,6
00505   };
00506 
00507   int ConnectivityQua[4 * 4] = {
00508     7,8,9,10,
00509     11,12,13,14,
00510     11,7,8,12,
00511     12,8,9,13
00512   };
00513 
00514 
00515   // CREATE THE MESH
00516   MEDMEM::MESHING* myMeshing = new MEDMEM::MESHING;
00517 
00518   myMeshing->setName("meshing");
00519 
00520   myMeshing->setCoordinates(SpaceDimension, NumberOfNodes, Coordinates,
00521                            "CARTESIAN", MED_EN::MED_FULL_INTERLACE);
00522   myMeshing->setCoordinatesNames(Names);
00523   myMeshing->setCoordinatesUnits(Units);
00524 
00525   // define connectivities
00526   myMeshing->setNumberOfTypes(NumberOfCellTypes, MED_EN::MED_CELL);
00527   myMeshing->setTypes(CellTypes, MED_EN::MED_CELL);
00528   myMeshing->setNumberOfElements(NumberOfCells, MED_EN::MED_CELL);
00529 
00530   myMeshing->setConnectivity(MED_EN::MED_CELL, MED_EN::MED_TETRA4, ConnectivityTetra );
00531   myMeshing->setConnectivity(MED_EN::MED_CELL, MED_EN::MED_PYRA5 , ConnectivityPyra  );
00532   myMeshing->setConnectivity(MED_EN::MED_CELL, MED_EN::MED_HEXA8 , ConnectivityHexa  );
00533 
00534   myMeshing->setNumberOfTypes(NumberOfFaceTypes, MED_EN::MED_FACE);
00535   myMeshing->setTypes(FaceTypes, MED_EN::MED_FACE);
00536   myMeshing->setNumberOfElements(NumberOfFaces, MED_EN::MED_FACE);
00537 
00538   myMeshing->setConnectivity(MED_EN::MED_FACE, MED_EN::MED_TRIA3,ConnectivityTria);
00539   myMeshing->setConnectivity(MED_EN::MED_FACE, MED_EN::MED_QUAD4,ConnectivityQua);
00540 
00541   // edges connectivities
00542   // not yet implemented : if set, results are unpredictable.
00543 
00544   // groups of nodes
00545   {
00546     MEDMEM::GROUP *myGroup=new MEDMEM::GROUP;
00547     myGroup->setName("SomeNodes");
00548     myGroup->setMesh(myMeshing);
00549     myGroup->setEntity(MED_EN::MED_NODE);
00550     myGroup->setNumberOfGeometricType(1);
00551     MED_EN::medGeometryElement myTypes[1] = {MED_EN::MED_NONE};
00552     myGroup->setGeometricType(myTypes);
00553     const int myNumberOfElements[1] = {4};
00554     myGroup->setNumberOfElements(myNumberOfElements);
00555     const int index[1+1] = {1,5};
00556     const int value[4] = {1,4,5,7};
00557     myGroup->setNumber(index,value);
00558     myMeshing->addGroup(*myGroup);
00559     myGroup->removeReference();
00560   }
00561   {
00562     MEDMEM::GROUP *myGroup=new MEDMEM::GROUP;
00563     myGroup->setName("OtherNodes");
00564     myGroup->setMesh(myMeshing);
00565     myGroup->setEntity(MED_EN::MED_NODE);
00566     myGroup->setNumberOfGeometricType(1);
00567     MED_EN::medGeometryElement myTypes[1] = {MED_EN::MED_NONE};
00568     myGroup->setGeometricType(myTypes);
00569     const int myNumberOfElements[1] = {3};
00570     myGroup->setNumberOfElements(myNumberOfElements);
00571     const int index[1+1] = {1,4};
00572     const int value[3] = {2,3,6};
00573     myGroup->setNumber(index,value);
00574     myMeshing->addGroup(*myGroup);
00575     myGroup->removeReference();
00576   }
00577 
00578   // groups of cells
00579   {
00580     MEDMEM::GROUP *myGroup=new MEDMEM::GROUP;
00581     myGroup->setName("SomeCells");
00582     myGroup->setMesh(myMeshing);
00583     myGroup->setEntity(MED_EN::MED_CELL);
00584     myGroup->setNumberOfGeometricType(3);
00585     MED_EN::medGeometryElement myTypes[3] = {MED_EN::MED_TETRA4,MED_EN::MED_PYRA5,MED_EN::MED_HEXA8};
00586     myGroup->setGeometricType(myTypes);
00587     const int myNumberOfElements[3] = {4,1,2};
00588     myGroup->setNumberOfElements(myNumberOfElements);
00589     const int index[3+1] = {1,5,6,8};
00590     const int value[4+1+2] = {2,7,8,12,  13,  15,16};
00591     myGroup->setNumber(index,value);
00592     myMeshing->addGroup(*myGroup);
00593     myGroup->removeReference();
00594   }
00595   {
00596     MEDMEM::GROUP *myGroup=new MEDMEM::GROUP;
00597     myGroup->setName("OtherCells");
00598     myGroup->setMesh(myMeshing);
00599     myGroup->setEntity(MED_EN::MED_CELL);
00600     myGroup->setNumberOfGeometricType(2);
00601     MED_EN::medGeometryElement myTypes[] = {MED_EN::MED_TETRA4,MED_EN::MED_PYRA5};
00602     myGroup->setGeometricType(myTypes);
00603     const int myNumberOfElements[] = {4,1};
00604     myGroup->setNumberOfElements(myNumberOfElements);
00605     const int index[2+1] = {1,5,6};
00606     const int value[4+1] = {3,4,5,9,  14};
00607     myGroup->setNumber(index,value);
00608     myMeshing->addGroup(*myGroup);
00609     myGroup->removeReference();
00610   }
00611 
00612   // groups of faces
00613   {
00614     MEDMEM::GROUP *myGroup=new MEDMEM::GROUP;
00615     myGroup->setName("SomeFaces");
00616     myGroup->setMesh(myMeshing);
00617     myGroup->setEntity(MED_EN::MED_FACE);
00618     myGroup->setNumberOfGeometricType(2);
00619     MED_EN::medGeometryElement myTypes[2] = {MED_EN::MED_TRIA3,MED_EN::MED_QUAD4};
00620     myGroup->setGeometricType(myTypes);
00621     const int myNumberOfElements[2] = {2,3};
00622     myGroup->setNumberOfElements(myNumberOfElements);
00623     const int index[2+1] = {1,3,6};
00624     const int value[2+3] = {2,4,  5,6,8};
00625     myGroup->setNumber(index,value);
00626     myMeshing->addGroup(*myGroup);
00627     myGroup->removeReference();
00628   }
00629   {
00630     MEDMEM::GROUP *myGroup=new MEDMEM::GROUP;
00631     myGroup->setName("OtherFaces");
00632     myGroup->setMesh(myMeshing);
00633     myGroup->setEntity(MED_EN::MED_FACE);
00634     myGroup->setNumberOfGeometricType(1);
00635     MED_EN::medGeometryElement myTypes[1] = {MED_EN::MED_TRIA3};
00636     myGroup->setGeometricType(myTypes);
00637     const int myNumberOfElements[1] = {2};
00638     myGroup->setNumberOfElements(myNumberOfElements);
00639     const int index[1+1] = {1,3};
00640     const int value[2] = {1,3};
00641     myGroup->setNumber(index,value);
00642     myMeshing->addGroup(*myGroup);
00643     myGroup->removeReference();
00644   }
00645 
00646   return myMeshing;
00647 }
00648 
00653 MEDMEMTest_TmpFilesRemover::~MEDMEMTest_TmpFilesRemover()
00654 {
00655   set<string>::iterator it = myTmpFiles.begin();
00656   for (; it != myTmpFiles.end(); it++) {
00657 #ifdef WNT
00658     //if (GetFileAttributes((*it).data()) & FILE_ATTRIBUTE_NORMAL)
00659     if (GetFileAttributes((*it).data()) != INVALID_FILE_ATTRIBUTES)
00660 #else
00661     if (access((*it).data(), F_OK) == 0)
00662 #endif
00663       remove((*it).data());
00664   }
00665   myTmpFiles.clear();
00666   //cout << "~MEDMEMTest_TmpFilesRemover()" << endl;
00667 }
00668 
00669 bool MEDMEMTest_TmpFilesRemover::Register(const string theTmpFile)
00670 {
00671   return (myTmpFiles.insert(theTmpFile)).second;
00672 }