Changeset 8219


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

Location:
trunk/anuga_core/source/anuga
Files:
4 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
  • trunk/anuga_core/source/anuga/shallow_water/shallow_water_ext.c

    r8129 r8219  
    14381438     
    14391439      // If the mesh is 'weird' near the boundary,
    1440       // the triangle might be flat or clockwise:
     1440      // the triangle might be flat or clockwise
     1441      // Default to zero gradient
    14411442      if (area2 <= 0)
    14421443      {
    1443           report_python_error(AT, "Negative triangle area");
    1444           return -1;
     1444          //printf("Error negative triangle area \n");
     1445          //report_python_error(AT, "Negative triangle area");
     1446          //return -1;
     1447
     1448          stage_vertex_values[k3]   = stage_centroid_values[k];
     1449          stage_vertex_values[k3+1] = stage_centroid_values[k];
     1450          stage_vertex_values[k3+2] = stage_centroid_values[k];
     1451          xmom_vertex_values[k3]    = xmom_centroid_values[k];
     1452          xmom_vertex_values[k3+1]  = xmom_centroid_values[k];
     1453          xmom_vertex_values[k3+2]  = xmom_centroid_values[k];
     1454          ymom_vertex_values[k3]    = ymom_centroid_values[k];
     1455          ymom_vertex_values[k3+1]  = ymom_centroid_values[k];
     1456          ymom_vertex_values[k3+2]  = ymom_centroid_values[k];
     1457
     1458          continue;
    14451459      } 
    14461460     
  • trunk/anuga_core/source/anuga/structures

    • Property svn:ignore set to
      .python_cache
  • trunk/anuga_core/source/anuga/structures/structure_operator.py

    r8164 r8219  
    239239            self.culvert_vector = centre_point1 - centre_point0
    240240        else:
    241             self.culvert_vector = self.end_points[1] - end_points[0]
     241            self.culvert_vector = self.end_points[1] - self.end_points[0]
    242242       
    243243        self.culvert_length = math.sqrt(num.sum(self.culvert_vector**2))
Note: See TracChangeset for help on using the changeset viewer.