X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FSwig%2FMEDLoaderDataForTest.py;h=e8f0f5332b857827cbbfd53cda293fb31e21e50e;hb=281f5b3852ce7e4e71642292f133e0138b27d5e9;hp=22e8cfc28b27994d7c0e7ca897a78ae02e6a4a8c;hpb=de8da643a7f441fb2154818cde04b7b24ca76bb4;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/Swig/MEDLoaderDataForTest.py b/src/MEDLoader/Swig/MEDLoaderDataForTest.py index 22e8cfc28..e8f0f5332 100644 --- a/src/MEDLoader/Swig/MEDLoaderDataForTest.py +++ b/src/MEDLoader/Swig/MEDLoaderDataForTest.py @@ -1,10 +1,10 @@ # -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2013 CEA/DEN, EDF R&D +# Copyright (C) 2007-2015 CEA/DEN, EDF R&D # # 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. +# 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 @@ -657,6 +657,55 @@ class MEDLoaderDataForTest: # data=MEDFileData() ; data.setMeshes(ms) ; data.setFields(fs) return data + + def buildAMEDFileDataWithGroupOnOneFamilyForSauv(self): + # Coordinates + coords = [0.,0., 0.,1., 1.,1., 1.,0.] + # lvl 0 connectivity + conn2D = [1,2,3,4] + # lvl -1 connectivity + conn1D = [0,1, 1,2, 2,3, 4,1] + # lvl 0 mesh + mesh2D=MEDCouplingUMesh.New() + mesh2D.setMeshDimension(2) + mesh2D.allocateCells(1) + mesh2D.insertNextCell(NORM_QUAD4,4,conn2D) + mesh2D.finishInsertingCells() + # lvl -1 mesh + mesh1D=MEDCouplingUMesh.New() + mesh1D.setMeshDimension(1) + mesh1D.allocateCells(4) + mesh1D.insertNextCell(NORM_SEG2,2,conn1D[0:2]) + mesh1D.insertNextCell(NORM_SEG2,2,conn1D[2:4]) + mesh1D.insertNextCell(NORM_SEG2,2,conn1D[4:6]) + mesh1D.insertNextCell(NORM_SEG2,2,conn1D[6:8]) + mesh1D.finishInsertingCells() + # assigning coordinates + meshCoords=DataArrayDouble.New() + meshCoords.setValues(coords, 4, 2) + mesh2D.setCoords(meshCoords) + mesh1D.setCoords(meshCoords) + # Creating a multi level mesh + mm = MEDFileUMesh.New() + mm.setMeshAtLevel(0, mesh2D) + mm.setMeshAtLevel(-1, mesh1D) + mm.setName("carre") + # Creating groups + # Creating a group with an element on level -1 + grp0_LM1 = DataArrayInt.New([0]) + grp0_LM1.setName("grp0_LM1") + # Creating a group with all elements on level -1 + grp1_LM1 = DataArrayInt.New([0,1,2,3]) + grp1_LM1.setName("grp1_LM1") + # + mm.setGroupsAtLevel(-1,[grp0_LM1,grp1_LM1]) + # + ms=MEDFileMeshes.New() + ms.setMeshAtPos(0,mm) + mfd=MEDFileData.New() + mfd.setMeshes(ms) + # + return mfd build1DMesh_1=classmethod(build1DMesh_1) build2DCurveMesh_1=classmethod(build2DCurveMesh_1) @@ -675,4 +724,5 @@ class MEDLoaderDataForTest: buildVecFieldOnGauss_2_Simpler=classmethod(buildVecFieldOnGauss_2_Simpler) buildVecFieldOnGaussNE_1=classmethod(buildVecFieldOnGaussNE_1) buildACompleteMEDDataStructureWithFieldsOnCells_1=classmethod(buildACompleteMEDDataStructureWithFieldsOnCells_1) + buildAMEDFileDataWithGroupOnOneFamilyForSauv=classmethod(buildAMEDFileDataWithGroupOnOneFamilyForSauv) pass