Salome HOME
medcalc and commands history
[modules/med.git] / src / MEDOP / tui / xmedpy / fieldguide.py
1 #  -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2011-2015  CEA/DEN, EDF R&D
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20 # Author : Guillaume Boulant (EDF) 
21
22 #
23 # ===================================================================
24 # Th module must be imported as global in the SALOME python console to
25 # provide the user with documentation on fields operations.
26 # ===================================================================
27 #
28
29 class UserGuide:
30     """
31     In this python console, you manipulate variables that identifies
32     field objects. These variables are proxy objects towards the real
33     MED fields stored as MEDCoupling instances in the SALOME
34     container.
35
36     What you can do with this proxy object:
37
38     - you can manipulate this object in algebric operations (+,-,*,/):
39     >>> add = f1 + f2
40     >>> dif = f1 - f2
41     >>> mul = f1 * f2
42     >>> div = f1 / f2 (an exception is raised in case of division by 0)
43     >>> square = pow(f1, 2)
44
45     - the operande could be a scalar numerical value:
46     >>> offset  = f1 + 4.2
47     >>> scaling = 3.8 * f1
48     
49     - any combination of this operations can be done on a single instruction:
50     >>> x = f1 + pow(f2)
51     >>> y = f1 + x - f2
52
53     - you can request some helper functions on this object:
54     >>> doc      : print the user documentation for field operations
55     >>> print f  : print the main properties of the field f (name, values, ...)
56     >>> f.dup()  : create a dublicate of the field f
57     >>> dup(f)   : do the same thing
58     >>> f.visu() : display the modulus of this field using VISU post-processor.    
59     """
60
61     def __repr__(self):
62         return UserGuide.__doc__
63
64     def __call__(self, command):
65         print "help on command %s"%command
66
67 doc=UserGuide()