X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling_Swig%2FMEDCouplingDataForTest.py;h=f88aad24490a97d8dd27702466f7eb7bc30cd96b;hb=9f966e0ed55cc976b59a17318a7be82445529eda;hp=5ed647cbaa86cc3978e1524ccd93ddf2f52abefa;hpb=be4c3bb042d5426fbbe54378b9d7b35173ab27ef;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling_Swig/MEDCouplingDataForTest.py b/src/MEDCoupling_Swig/MEDCouplingDataForTest.py index 5ed647cba..f88aad244 100644 --- a/src/MEDCoupling_Swig/MEDCouplingDataForTest.py +++ b/src/MEDCoupling_Swig/MEDCouplingDataForTest.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 @@ -701,6 +701,25 @@ class MEDCouplingDataForTest: baseMesh.finishInsertingCells() return baseMesh + def buildCircle2(self, center_X, center_Y, radius): + from cmath import rect + from math import pi + + c = [rect(radius, i*pi/4.0) for i in range(8)] + coords = [] + for i in range(8): + coords.extend([c[i].real,c[i].imag]) + connec = [7,5,3,1, 6,4,2,0] + baseMesh = MEDCouplingUMesh.New("circle", 2) + baseMesh.allocateCells(1) + meshCoords = DataArrayDouble.New(coords, len(coords)/2, 2) + meshCoords += (center_X, center_Y) + baseMesh.setCoords(meshCoords) + + baseMesh.insertNextCell(NORM_QPOLYG, connec) + baseMesh.finishInsertingCells() + return baseMesh + build2DTargetMesh_1=classmethod(build2DTargetMesh_1) build2DSourceMesh_1=classmethod(build2DSourceMesh_1) build3DTargetMesh_1=classmethod(build3DTargetMesh_1) @@ -730,6 +749,7 @@ class MEDCouplingDataForTest: buildFieldOnGauss_3=classmethod(buildFieldOnGauss_3) buildFieldOnGauss_4=classmethod(buildFieldOnGauss_4) buildCircle=classmethod(buildCircle) + buildCircle2=classmethod(buildCircle2) pass