Changeset 4475
 Timestamp:
 May 22, 2007, 6:02:51 PM (16 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

anuga_core/source/anuga/abstract_2d_finite_volumes/neighbour_mesh.py
r4471 r4475 595 595 from anuga.utilities.numerical_tools import anglediff 596 596 597 from Numeric import sort, allclose 598 597 599 N = len(self) 598 600 #Get x,y coordinates for all vertices for all triangles … … 646 648 self.lone_vertices = [] 647 649 #Check that all vertices have been registered 648 for v_id, v in enumerate(self.vertexlist): 649 650 #msg = 'Vertex %s does not belong to an element.' 651 #assert v is not None, msg 652 if v is None: 653 #print msg%v_id 654 self.lone_vertices.append(v_id) 655 656 #Check integrity of neighbour structure 650 for node, count in enumerate(self.number_of_triangles_per_node): 651 652 #msg = 'Node %d does not belong to an element.' %node 653 #assert count > 0, msg 654 if count == 0: 655 self.lone_vertices.append(node) 656 657 658 659 #Check neighbour structure 657 660 for i in range(N): 658 # print i 659 for v in self.triangles[i, :]: 660 #Check that all vertices have been registered 661 assert self.vertexlist[v] is not None 662 663 #Check that this triangle is listed with at least one vertex 664 assert (i, 0) in self.vertexlist[v] or\ 665 (i, 1) in self.vertexlist[v] or\ 666 (i, 2) in self.vertexlist[v] 667 668 669 670 #Check neighbour structure 661 # For each triangle 662 671 663 for k, neighbour_id in enumerate(self.neighbours[i,:]): 672 664 … … 701 693 # 702 694 #See domain.set_boundary 695 696 697 698 #Check integrity of inverted triangle structure 699 700 V = self.vertex_value_indices[:] #Take a copy 701 V = sort(V) 702 assert allclose(V, range(3*N)) 703 704 assert sum(self.number_of_triangles_per_node) ==\ 705 len(self.vertex_value_indices) 706 707 # Check number of triangles per node 708 count = [0]*self.number_of_nodes 709 for triangle in self.triangles: 710 for i in triangle: 711 count[i] += 1 712 713 assert allclose(count, self.number_of_triangles_per_node) 714 703 715 704 716 # Check integrity of vertex_value_indices
Note: See TracChangeset
for help on using the changeset viewer.