Salome HOME
Update copyrights
[modules/med.git] / src / MEDCalculator / Swig / test2.spy
1 # Copyright (C) 2007-2019  CEA/DEN, EDF R&D
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19 # Author : Anthony Geay (CEA/DEN)
20
21 e=MEDCalculatorBrowserLiteStruct("hfile1.med")
22 f=e.getField(0)
23 Power=MEDCalculatorDBFieldReal(f)
24 Power[1:3,:,4:]^Power[5:7,:,4:]
25 Power(1:3,:,2)+3
26 Power(1:3,:,2)+3.6
27 Power(1:3,:,2)+(3+5)
28 (Power(1:3,:,2)+(3+5))
29 Power(2:4,:,5)=(Power[1:3,:,2]+(3+5))
30 3+Power(1:3,:,2)
31 3.6+Power(1:3,:,2)
32 (3.6+Power(1:3,:,2))*((4.2*7.8)+Power(5:7,:,2))
33 Power2=Power(1:3,:,2:)+(3+5)
34 3.6+Power2(0:2,:,2)
35 Power=0
36 Power3=Power2
37 3.6/Power3(0:2,:,2)
38 print(2+Power3(0:2,:,:)*4)
39 Power4=Power3.magnitude()
40 print(Power3.getValues())
41 Power4.applyFunc("3*x")
42 Power6=Power(0:2,:,1:4)
43 Power7=Power(7:9,:,4:)
44 Power5=4*Power7.dot(Power(0:2,:,1:4))+3
45 del Power7