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

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

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

revision 2497 by gross, Mon Jun 22 04:22:19 2009 UTC revision 2498 by gross, Mon Jun 29 04:25:23 2009 UTC
# Line 1747  def MaskFromBoundaryTag(domain,*tags): Line 1747  def MaskFromBoundaryTag(domain,*tags):
1747     pde.setValue(y=d)     pde.setValue(y=d)
1748     return util.whereNonZero(pde.getRightHandSide())     return util.whereNonZero(pde.getRightHandSide())
1749    
1750    def MaskFromTag(domain,*tags):
1751       """
1752       Creates a mask on the Solution(domain) function space where the value is
1753       one for samples that touch regions tagged by tags.
1754    
1755       Usage: m=MaskFromTag(domain, "ham")
1756    
1757       @param domain: domain to be used
1758       @type domain: L{escript.Domain}
1759       @param tags: boundary tags
1760       @type tags: C{str}
1761       @return: a mask which marks samples that are touching the boundary tagged
1762                by any of the given tags
1763       @rtype: L{escript.Data} of rank 0
1764       """
1765       pde=linearPDEs.LinearPDE(domain,numEquations=1, numSolutions=1)
1766       d=escript.Scalar(0.,escript.Function(domain))
1767       for t in tags: d.setTaggedValue(t,1.)
1768       pde.setValue(Y=d)
1769       return util.whereNonZero(pde.getRightHandSide())
1770    
1771    

Legend:
Removed from v.2497  
changed lines
  Added in v.2498

  ViewVC Help
Powered by ViewVC 1.1.26