Ignore:
Timestamp:
Sep 18, 2011, 9:28:18 PM (13 years ago)
Author:
steve
Message:

Rudy created a mesh which produced a degenerate surrogate triangle. Changed throwing an error to defaulting to a first order reconstruction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/neighbour_mesh.py

    r8200 r8219  
    675675            # Check that area hasn't been compromised
    676676            area = self.areas[i]
    677             ref = abs((x1*y0-x0*y1)+(x2*y1-x1*y2)+(x0*y2-x2*y0))/2
    678             msg = 'Wrong area for vertex coordinates: %f %f %f %f %f %f'\
    679                   %(x0,y0,x1,y1,x2,y2)
     677            ref = -((x1*y0-x0*y1)+(x2*y1-x1*y2)+(x0*y2-x2*y0))/2
     678            msg = 'Triangle %i (%f,%f), (%f,%f), (%f, %f)' % (i, x0,y0,x1,y1,x2,y2)
     679            msg += 'Wrong area: %f  %f'\
     680                  %(area, ref)
    680681            assert abs((area - ref)/area) < epsilon, msg
    681682
    682             msg = 'Triangle (%f,%f), (%f,%f), (%f, %f)' % (x0,y0,x1,y1,x2,y2)
     683            msg = 'Triangle %i (%f,%f), (%f,%f), (%f, %f)' % (i, x0,y0,x1,y1,x2,y2)
    683684            msg += ' is degenerate:  area == %f' % self.areas[i]
    684685            assert area > 0.0, msg
Note: See TracChangeset for help on using the changeset viewer.