Diff of /branches/arrayview_from_1695_trunk/escript/py_src/pdetools.py

revision 1780 by jfenwick, Mon Aug 11 03:33:40 2008 UTC revision 1781 by jfenwick, Thu Sep 11 05:03:14 2008 UTC
1795  #  #
1796  #      return u,p  #      return u,p
1797
1799     """     """
1800     create a mask on the given function space which one for samples     create a mask on the Solution(domain) function space which one for samples
1801     that touch the boundary tagged by tags.     that touch the boundary tagged by tags.
1802
1804
1805     @param function_space: a given function space     @param domain: a given domain
1806     @type function_space: L{escript.FunctionSpace}     @type domain: L{escript.Domain}
1807     @param tags: boundray tags     @param tags: boundray tags
1808     @type tags: C{str}     @type tags: C{str}
1809     @return: a mask which marks samples used by C{function_space} that are touching the     @return: a mask which marks samples that are touching the boundary tagged by any of the given tags.
boundary tagged by any of the given tags.
1810     @rtype: L{escript.Data} of rank 0     @rtype: L{escript.Data} of rank 0
1811     """     """
1812     pde=linearPDEs.LinearPDE(function_space.getDomain(),numEquations=1, numSolutions=1)     pde=linearPDEs.LinearPDE(domain,numEquations=1, numSolutions=1)
1813     d=escript.Scalar(0.,escript.FunctionOnBoundary(function_space.getDomain()))     d=escript.Scalar(0.,escript.FunctionOnBoundary(function_space.getDomain()))
1814     for t in tags: d.setTaggedValue(t,1.)     for t in tags: d.setTaggedValue(t,1.)
1815     pde.setValue(y=d)     pde.setValue(y=d)
1816     out=util.whereNonZero(pde.getRightHandSide())     return util.whereNonZero(pde.getRightHandSide())
if out.getFunctionSpace() == function_space:
return out
else:
return util.whereNonZero(util.interpolate(out,function_space))

Legend:
 Removed from v.1780 changed lines Added in v.1781