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

revision 2674 by gross, Wed Sep 16 02:56:02 2009 UTC revision 2675 by gross, Mon Sep 21 02:32:17 2009 UTC
# Line 498  class FaultSystem: Line 498  class FaultSystem:
498
499       return f_max, t_max, p_max       return f_max, t_max, p_max
500
501      def getMinValue(self,f, tol=sqrt(EPSILON)):
502         """
503         returns the minimum value of ``f``, the fault and the location on the fault in fault coordinates.
504
505         :param f: a distribution of values
506         :type f: `escript.Data`
507         :param tol: relative tolerance used to decide if point is on fault
508         :type f: ``tol``
509         :return: the minimum value of across all faults in the fault system, the fault tag the minimum is taken, and the coordinates of the location in the coordinates of the fault. The returned fault tag is ``None`` if no points on the fault are available
510         """
511         ref=Lsup(f)*2
512         f_min=ref
513         t_min=None
514         p_min=None
515         x=f.getFunctionSpace().getX()
516         for t in self.getTags():
517            p,m=self.getParametrization(x,tag=t, tol=tol)
518            loc=((m*f)+(1.-m)*ref).minGlobalDataPoint()
519            f_t=f.getTupleForGlobalDataPoint(*loc)[0]
520            if f_t<f_min:
521               f_min=f_t
522               t_min=t
523               p_min=p.getTupleForGlobalDataPoint(*loc)[0]
524
525         return f_min, t_min, p_min
526
527    def getParametrization(self,x,tag=None, tol=sqrt(EPSILON), outsider=None):    def getParametrization(self,x,tag=None, tol=sqrt(EPSILON), outsider=None):
528      """      """
529      returns the parametrization of the fault ``tag`` in the fault system. In fact the values of the parametrization for at given coordinates ``x`` is returned. In addition to the value of the parametrization a mask is returned indicating if the given location is on the fault with given tolerance ``tol``.      returns the parametrization of the fault ``tag`` in the fault system. In fact the values of the parametrization for at given coordinates ``x`` is returned. In addition to the value of the parametrization a mask is returned indicating if the given location is on the fault with given tolerance ``tol``.

Legend:
 Removed from v.2674 changed lines Added in v.2675