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

Diff of /trunk/escript/py_src/util.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1042 by gross, Mon Mar 19 03:50:34 2007 UTC revision 1247 by ksteube, Tue Aug 14 01:29:20 2007 UTC
# Line 27  import numarray Line 27  import numarray
27  import escript  import escript
28  import os  import os
29  from esys.escript import C_GeneralTensorProduct  from esys.escript import C_GeneralTensorProduct
30    from esys.escript import getVersion
31    
32  #=========================================================  #=========================================================
33  #   some helpers:  #   some helpers:
# Line 37  def getTagNames(domain): Line 38  def getTagNames(domain):
38    
39            
40      @param domain: a domain object      @param domain: a domain object
41      @type domain: C{escript.Domain}      @type domain: L{escript.Domain}
42      @return: a list of the tag name used by the domain.      @return: a list of the tag name used by the domain.
43      @rtype: C{list} of C{str}      @rtype: C{list} of C{str}
44      """      """
45      return [n.strip() for n in domain.showTagNames().split(",") ]      return [n.strip() for n in domain.showTagNames().split(",") ]
46    
47    def insertTagNames(domain,**kwargs):
48        """
49        inserts tag names into the domain
50    
51        @param domain: a domain object
52        @type domain: C{escript.Domain}
53        @keyword <tag name>: tag key assigned to <tag name>
54        @type <tag name>: C{int}
55        """
56        for  k in kwargs:
57             domain.setTagMap(k,kwargs[k])
58    
59    def insertTaggedValues(target,**kwargs):
60        """
61        inserts tagged values into the tagged using tag names
62    
63        @param target: data to be filled by tagged values
64        @type target: L{escript.Data}
65        @keyword <tag name>: value to be used for <tag name>
66        @type <tag name>: C{float} or {numarray.NumArray}
67        @return: C{target}
68        @rtype: L{escript.Data}
69        """
70        for k in kwargs:
71            target.setTaggedValue(k,kwargs[k])
72        return target
73    
74            
75  def saveVTK(filename,domain=None,**data):  def saveVTK(filename,domain=None,**data):
76      """      """

Legend:
Removed from v.1042  
changed lines
  Added in v.1247

  ViewVC Help
Powered by ViewVC 1.1.26