1 # Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
3 # Copyright (C) 2003-2007 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, or (at your option) any later version.
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 #============================================================================
24 # File : PYCALCULATOR_TEST.py
25 # Author : Vadim SANDLER, OPEN CASCADE S.A.S. (vadim.sandler@opencascade.com)
26 #============================================================================
33 import PYCALCULATOR_ORB
35 from MEDCouplingCorba import *
36 from MEDCoupling import *
37 from MEDLoader import *
39 pc = salome.lcc.FindOrLoadComponent('FactoryServer','PYCALCULATOR')
41 medFile = os.path.join(os.getenv("MED_ROOT_DIR"), "share/salome/resources/med/pointe.med")
43 fieldName = "fieldcelldoublevector"
44 print medFile, meshName, fieldName
46 f = MEDLoader.ReadFieldCell(medFile, meshName, 0, fieldName, -1, -1)
47 forig = MEDCouplingFieldDoubleServant._this(f)
49 fcopy = pc.Clone(forig)
50 f1 = pc.Add(forig, fcopy)
51 f2 = pc.Mul(forig, fcopy)
52 f3 = pc.AddConstant(forig, 3.5)
53 f4 = pc.MulConstant(forig, 3.5)