/[escript]/trunk/escript/py_src/symbols.py
ViewVC logotype

Annotation of /trunk/escript/py_src/symbols.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2169 - (hide annotations)
Wed Dec 17 03:08:58 2008 UTC (10 years, 10 months ago) by caltinay
File MIME type: text/x-python
File size: 3834 byte(s)
Assorted spelling, grammar, whitespace and copy/paste error fixes (Part 2).
All epydoc warnings for these files have been fixed.
This commit should be a no-op.

1 ksteube 1809
2     ########################################################
3 ksteube 1312 #
4 ksteube 1809 # Copyright (c) 2003-2008 by University of Queensland
5     # Earth Systems Science Computational Center (ESSCC)
6     # http://www.uq.edu.au/esscc
7 ksteube 1312 #
8 ksteube 1809 # Primary Business: Queensland, Australia
9     # Licensed under the Open Software License version 3.0
10     # http://www.opensource.org/licenses/osl-3.0.php
11 ksteube 1312 #
12 ksteube 1809 ########################################################
13 jgs 150
14 ksteube 1809 __copyright__="""Copyright (c) 2003-2008 by University of Queensland
15     Earth Systems Science Computational Center (ESSCC)
16     http://www.uq.edu.au/esscc
17     Primary Business: Queensland, Australia"""
18     __license__="""Licensed under the Open Software License version 3.0
19     http://www.opensource.org/licenses/osl-3.0.php"""
20     __url__="http://www.uq.edu.au/esscc/escript-finley"
21    
22 jgs 154 ## @file symbols.py
23    
24 jgs 150 """
25 gross 345 some tools supporting the usage of symbols.
26    
27     @var __author__: name of author
28 gross 637 @var __copyright__: copyrights
29 elspeth 614 @var __license__: licence agreement
30 gross 345 @var __url__: url entry point on documentation
31     @var __version__: version
32     @var __date__: date of the version
33 jgs 150 """
34 ksteube 1809
35 gross 345 __author__="Lutz Gross, l.gross@uq.edu.au"
36 jgs 150
37 gross 345 from util import Symbol
38 jgs 150
39 gross 345 def ScalarSymbol(dim=None):
40     """
41 caltinay 2169 Returns a rank 0 L{Symbol}.
42 gross 345
43 caltinay 2169 @param dim: spatial dimension or an object that has the C{getDim} method
44     defining the spatial dimension. If dim=C{None}, the spatial
45     diminsion of the returned L{Symbol} is undefined.
46 gross 345 @type dim: C{None}, C{int} or any object with a C{getDim} method
47 caltinay 2169 @return: a L{Symbol} of rank 0
48     @rtype: L{Symbol}
49 gross 345 """
50     if hasattr(dim,"getDim"):
51     d=dim.getDim()
52     else:
53     d=dim
54     return Symbol(shape=(),dim=d,args=[])
55    
56    
57     def VectorSymbol(dim=3):
58     """
59 caltinay 2169 Returns a vector L{Symbol} of rank 1 and spatial dimension C{dim}.
60 gross 345
61 caltinay 2169 @param dim: spatial dimension or an object that has the C{getDim} method
62     defining the spatial dimension
63 gross 345 @type dim: C{int} or any object with a C{getDim} method
64 caltinay 2169 @return: a L{Symbol} of shape (C{dim},)
65     @rtype: L{Symbol}
66 gross 345 """
67     if hasattr(dim,"getDim"):
68     d=dim.getDim()
69     else:
70     d=dim
71     return Symbol(shape=(d,),dim=d,args=[])
72    
73     def TensorSymbol(dim=3):
74     """
75 caltinay 2169 Returns a tensor L{Symbol} of rank 2 and spatial dimension C{dim}.
76 gross 345
77 caltinay 2169 @param dim: spatial dimension or an object that has the C{getDim} method
78     defining the spatial dimension
79 gross 345 @type dim: C{int} or any object with a C{getDim} method
80 caltinay 2169 @return: a L{Symbol} of shape (C{dim},C{dim})
81     @rtype: L{Symbol}
82 gross 345 """
83     if hasattr(dim,"getDim"):
84     d=dim.getDim()
85     else:
86     d=dim
87     return Symbol(shape=(d,d),dim=d,args=[])
88    
89     def Tensor3Symbol(dim=3):
90     """
91 caltinay 2169 Returns a tensor L{Symbol} of rank 3 and spatial dimension C{dim}.
92 gross 345
93 caltinay 2169 @param dim: spatial dimension or an object that has the C{getDim} method
94     defining the spatial dimension
95 gross 345 @type dim: C{int} or any object with a C{getDim} method
96 caltinay 2169 @return: a L{Symbol} of shape (C{dim},C{dim},C{dim})
97     @rtype: L{Symbol}
98 gross 345 """
99     if hasattr(dim,"getDim"):
100     d=dim.getDim()
101 caltinay 2169 else:
102 gross 345 d=dim
103     return Symbol(shape=(d,d,d),dim=d,args=[])
104    
105     def Tensor4Symbol(dim=3):
106     """
107 caltinay 2169 Returns a tensor L{Symbol} of rank 4 and spatial dimension C{dim}.
108 gross 345
109 caltinay 2169 @param dim: spatial dimension or an object that has the C{getDim} method
110     defining the spatial dimension
111 gross 345 @type dim: C{int} or any object with a C{getDim} method
112 caltinay 2169 @return: a L{Symbol} of shape (C{dim},C{dim},C{dim},C{dim})
113     @rtype: L{Symbol}
114     """
115 gross 345 if hasattr(dim,"getDim"):
116     d=dim.getDim()
117 caltinay 2169 else:
118 gross 345 d=dim
119     return Symbol(shape=(d,d,d,d),dim=d,args=[])
120     #
121     # $Log:$
122     #
123     # vim: expandtab shiftwidth=4:

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26