Changeset 1191


Ignore:
Timestamp:
Apr 4, 2005, 11:05:16 AM (20 years ago)
Author:
prow
Message:

adding function 'set_to_incribed_circle' as another way to use other timestep.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/mesh.py

    r1190 r1191  
    151151               %(self.coordinates.shape[0], len(self), len(self.boundary))
    152152
     153
     154    def set_to_incribed_circle(self):
     155        #FIXME phase out eventually
     156        from math import sqrt
     157        N = self.number_of_elements
     158        V = self.vertex_coordinates
     159        for i in range(N):
     160            x0 = V[i, 0]; y0 = V[i, 1]
     161            x1 = V[i, 2]; y1 = V[i, 3]
     162            x2 = V[i, 4]; y2 = V[i, 5]
     163            a = sqrt((x0-x1)**2+(y0-y1)**2)
     164            b = sqrt((x1-x2)**2+(y1-y2)**2)
     165            c = sqrt((x2-x0)**2+(y2-y0)**2)
     166
     167            self.radii[i]=self.areas[i]/(2*(a+b+c))
    153168
    154169    def build_neighbour_structure(self):
Note: See TracChangeset for help on using the changeset viewer.