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

revision 3359 by jfenwick, Thu Feb 4 04:05:36 2010 UTC revision 3360 by jfenwick, Thu Nov 18 00:20:21 2010 UTC
# Line 25  import math Line 25  import math
25
26  class FaultSystem:  class FaultSystem:
27    """    """
28    The FaultSystem class defines a system of faults in the Earth's crust.    The FaultSystem class defines a system of faults in the Earth's crust.
29
30    A fault system is defined by set of faults index by a tag. Each fault is defined by a starting point V0 and a list of    A fault system is defined by set of faults index by a tag. Each fault is defined by a starting point V0 and a list of
31    strikes ``strike`` and length ``l``. The strikes and the length is used to define a polyline with points ``V[i]`` such that    strikes ``strike`` and length ``l``. The strikes and the length is used to define a polyline with points ``V[i]`` such that
32
33    - ``V[0]=V0``    - ``V[0]=V0``
34    - ``V[i]=V[i]+ls[i]*array(cos(strike[i]),sin(strike[i]),0)''    - ``V[i]=V[i]+ls[i]*array(cos(strike[i]),sin(strike[i]),0)``
35
36    So ``strike`` defines the angle between the direction of the fault segment and the x0 axis. ''ls[i]``==0 is allowed.    So ``strike`` defines the angle between the direction of the fault segment and the x0 axis. ls[i]==0 is allowed.
37
38    In case of a 3D model a fault plane is defined through a dip and depth.    In case of a 3D model a fault plane is defined through a dip and depth.
39
# Line 77  class FaultSystem: Line 77  class FaultSystem:
77    def getStart(self,tag=None):    def getStart(self,tag=None):
78       """       """
79       returns the starting point of fault ``tag``       returns the starting point of fault ``tag``
80       :rtype: `numpy.ndarray'.       :rtype: `numpy.ndarray`.
81       """       """
82       return self.getTopPolyline(tag)[0]       return self.getTopPolyline(tag)[0]
83
# Line 100  class FaultSystem: Line 100  class FaultSystem:
100
101       :param tag: the tag of the fault       :param tag: the tag of the fault
102       :type tag: ``float`` or ``str``       :type tag: ``float`` or ``str``
103       :return: the list of vertices defining the top of the fault.  The coordinates are `numpy.ndarray'.       :return: the list of vertices defining the top of the fault.  The coordinates are `numpy.ndarray`.
104       """       """
105       if tag==None: tag=self.NOTAG       if tag==None: tag=self.NOTAG
106       return self.__top[tag]       return self.__top[tag]
107    def getStrikes(self, tag=None):    def getStrikes(self, tag=None):
108       """       """
109       returns the strike of the segements in fault ``tag``       :return: the strike of the segements in fault ``tag``
110       :rtype: ``list`` of ``float``       :rtype: ``list`` of ``float``
111       """       """
112       if tag==None: tag=self.NOTAG       if tag==None: tag=self.NOTAG
113       return self.__strikes[tag]       return self.__strikes[tag]
114    def getStrikeVectors(self, tag=None):    def getStrikeVectors(self, tag=None):
115       """       """
116       returns the strike vectors of fault ``tag``       :return: the strike vectors of fault ``tag``
117       :rtype: ``list`` of `numpy.ndarray'.       :rtype: ``list`` of `numpy.ndarray`.
118       """       """
119       if tag==None: tag=self.NOTAG       if tag==None: tag=self.NOTAG
120       return self.__strike_vectors[tag]       return self.__strike_vectors[tag]
121    def getLengths(self, tag=None):    def getLengths(self, tag=None):
122       """       """
123       returns the lengths of segments in fault ``tag``       :return: the lengths of segments in fault ``tag``
124       :rtype: ``list`` of `float``       :rtype: ``list`` of ``float``
125       """       """
126       if tag==None: tag=self.NOTAG       if tag==None: tag=self.NOTAG
127       return self.__ls[tag]       return self.__ls[tag]
128
129    def getTotalLength(self, tag=None):    def getTotalLength(self, tag=None):
130       """       """
131       returns the total unrolled length of fault ``tag``       :return: the total unrolled length of fault ``tag``
132       :rtype: `float``       :rtype: ``float``
133       """       """
134       if tag==None: tag=self.NOTAG       if tag==None: tag=self.NOTAG
135       return self.__total_length[tag]       return self.__total_length[tag]
# Line 306  class FaultSystem: Line 306  class FaultSystem:
306       is used to define a polyline with points ``V[i]`` such that       is used to define a polyline with points ``V[i]`` such that
307
308       - ``V[0]=V0``       - ``V[0]=V0``
309       - ``V[i]=V[i]+ls[i]*array(cos(strikes[i]),sin(strikes[i]),0)''       - ``V[i]=V[i]+ls[i]*array(cos(strikes[i]),sin(strikes[i]),0)``
310
311       So ``strikes`` defines the angle between the direction of the fault segment and the x0 axis. In 3D ''ls[i]``==0 is allowed.       So ``strikes`` defines the angle between the direction of the fault segment and the x0 axis. In 3D ``ls[i]``==0 is allowed.
312
313       In case of a 3D model a fault plane is defined through a dip ``dips`` and depth ``depths``.       In case of a 3D model a fault plane is defined through a dip ``dips`` and depth ``depths``.
314       From the dip and the depth the polyline ``bottom`` of the bottom of the fault is computed.       From the dip and the depth the polyline ``bottom`` of the bottom of the fault is computed.
315
316
317       Each segment in the fault is decribed by the for vertices ``v0=top[i]``, ``v1``==``top[i+1]``, ``v2=bottom[i]`` and ``v3=bottom[i+1]``       Each segment in the fault is decribed by the for vertices ``v0=top[i]``, ``v1==top[i+1]``, ``v2=bottom[i]`` and ``v3=bottom[i+1]``
318       The segment is parametrized by ``w0`` and ``w1`` with ``w0_offsets[i]<=w0<=w0_offsets[i+1]`` and ``-w1_max<=w1<=0``. Moreover       The segment is parametrized by ``w0`` and ``w1`` with ``w0_offsets[i]<=w0<=w0_offsets[i+1]`` and ``-w1_max<=w1<=0``. Moreover
319
320       - ``(w0,w1)=(w0_offsets[i]  ,       0)->v0``       - ``(w0,w1)=(w0_offsets[i]  ,       0)->v0``
# Line 480  class FaultSystem: Line 480  class FaultSystem:
480       :param f: a distribution of values       :param f: a distribution of values
481       :type f: `escript.Data`       :type f: `escript.Data`
482       :param tol: relative tolerance used to decide if point is on fault       :param tol: relative tolerance used to decide if point is on fault
483       :type f: ``tol``       :type tol: ``tol``
484       :return: the fault tag the maximum is taken, and a `Locator` object to collect the value at location of maximum value.       :return: the fault tag the maximum is taken, and a `Locator` object to collect the value at location of maximum value.
485       """       """
486       ref=-Lsup(f)*2       ref=-Lsup(f)*2
# Line 509  class FaultSystem: Line 509  class FaultSystem:
509       :param f: a distribution of values       :param f: a distribution of values
510       :type f: `escript.Data`       :type f: `escript.Data`
511       :param tol: relative tolerance used to decide if point is on fault       :param tol: relative tolerance used to decide if point is on fault
512       :type f: ``tol``       :type tol: ``tol``
513       :return: the fault tag the minimum is taken, and a `Locator` object to collect the value at location of minimum value.       :return: the fault tag the minimum is taken, and a `Locator` object to collect the value at location of minimum value.
514       """       """
515       ref=Lsup(f)*2       ref=Lsup(f)*2

Legend:
 Removed from v.3359 changed lines Added in v.3360