Changeset 8505
- Timestamp:
- Aug 12, 2012, 6:36:21 PM (13 years ago)
- Location:
- trunk/anuga_core/source/anuga
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/general_mesh.py
r8503 r8505 363 363 364 364 # Build structure listing which triangles belong to which node. 365 if verbose: log.critical(' Building inverted triangle structure')365 if verbose: log.critical('General Mesh: Building inverted triangle structure') 366 366 self.build_inverted_triangle_structure() 367 367 … … 774 774 #number_of_triangles_per_node = num.zeros(self.number_of_nodes, num.int) 775 775 776 number_of_triangles_per_node = num.bincount(self.triangles.flat ten())776 number_of_triangles_per_node = num.bincount(self.triangles.flat) 777 777 778 778 number_of_lone_nodes = self.number_of_nodes - len(number_of_triangles_per_node) … … 796 796 # find vertices associated with a node. 797 797 # ie There are number_of_triangles_per_node[i] vertices 798 vertex_value_indices = num.argsort(self.triangles.flatten()) 798 vertex_value_indices = num.argsort(self.triangles.flat) 799 #vertex_value_indices = num.argsort(self.triangles.flatten()) 800 801 # node_index = num.zeros((self.number_of_nodes)+1, dtype = num.int) 802 # node_index[0] = 0 803 # for i in xrange(self.number_of_nodes): 804 # node_index[i+1] = node_index[i] + number_of_triangles_per_node[i] 799 805 800 806 node_index = num.zeros((self.number_of_nodes)+1, dtype = num.int) 801 802 k = 0 803 node_index[0] = 0804 for i in range(self.number_of_nodes): 805 node_index[i+1] = node_index[i] + number_of_triangles_per_node[i] 807 node_index[1:] = num.cumsum(number_of_triangles_per_node) 808 809 #assert num.allclose(node_index,node_index_new) 810 811 806 812 807 813 -
trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/generic_domain.py
r8503 r8505 33 33 Generic computational Domain constructor. 34 34 ''' 35 35 36 36 37 def __init__(self, source=None, … … 72 73 """ 73 74 75 76 if verbose: log.critical('Domain: Initialising') 77 74 78 # FIXME SR: This is a bug 75 79 number_of_full_nodes=None … … 82 86 coordinates = source 83 87 84 if verbose: log.critical('Domain: Initialising') 88 85 89 86 90 # In case a filename has been specified, extract content 87 91 if mesh_filename is not None: 92 88 93 coordinates, triangles, boundary, vertex_quantity_dict, \ 89 94 tagged_elements, geo_reference = \ … … 101 106 #number_of_full_triangles=number_of_full_triangles, 102 107 verbose=verbose) 108 109 if verbose: log.critical('Domain: Expose mesh attributes') 103 110 104 111 # Expose Mesh attributes (FIXME: Maybe turn into methods) … … 134 141 135 142 136 143 if verbose: log.critical('Domain: Expose quantity names and types') 137 144 # List of quantity names entering the conservation equations 138 145 if conserved_quantities is None: … … 160 167 161 168 169 if verbose: log.critical('Domain: Build Quantities') 162 170 # Build dictionary of Quantity instances keyed by quantity names 163 171 self.quantities = {} … … 198 206 199 207 # Setup Communication Buffers 200 if verbose: log.critical('Domain: Set up communication buffers ' 201 '(parallel)') 208 if verbose: log.critical('Domain: Set up communication buffers ') 202 209 self.nsys = len(self.conserved_quantities) 203 210 for key in self.full_send_dict: … … 213 220 214 221 215 222 # Setup triangle full flag 223 if verbose: log.critical('Domain: Set up triangle/node full flags ') 216 224 N = len(self) #number_of_elements 217 225 self.number_of_elements = N 218 226 219 # Setup cell full flag227 220 228 # =1 for full 221 229 # =0 for ghost … … 229 237 230 238 231 # Identify full nodes as those that intersect a full triangle.239 # Identify full nodes as those that intersect a full triangle. 232 240 233 241 Vol_ids = self.vertex_value_indices/3 234 242 W = num.repeat(self.tri_full_flag, 3) 235 243 236 self.node_full_flag = num.minimum(num.bincount(self.triangles.flat ten(), weights = W).astype(num.int), 1)244 self.node_full_flag = num.minimum(num.bincount(self.triangles.flat, weights = W).astype(num.int), 1) 237 245 238 246 … … 250 258 251 259 # Defaults 260 if verbose: log.critical('Domain: Set defaults') 261 252 262 from anuga.config import max_smallsteps, beta_w, epsilon 253 263 from anuga.config import CFL … … 301 311 self.simulation_name = 'domain' 302 312 self.checkpoint = False 313 314 if verbose: log.critical('Domain: Set work arrays') 315 303 316 304 317 # To avoid calculating the flux across each edge twice, keep an integer -
trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/pmesh2domain.py
r8148 r8505 9 9 import sys 10 10 import numpy as num 11 import anuga.utilities.log as log 11 12 12 13 … … 89 90 use_cache: True means that caching is attempted for the computed domain. 90 91 """ 91 92 93 if verbose: log.critical('Pmesh_to_Domain: Initialising') 94 92 95 if use_cache is True: 93 96 from caching import cache … … 97 100 else: 98 101 result = apply(_pmesh_to_domain, (file_name, mesh_instance)) 99 102 103 if verbose: log.critical('Pmesh_to_Domain: Done') 104 100 105 return result 101 106 -
trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/quantity.py
r8503 r8505 673 673 assert len(values.shape) == 1 or num.allclose(values.shape[1:], 1), msg 674 674 675 self.set_vertex_values(values.flat ten(), indices=indices,675 self.set_vertex_values(values.flat, indices=indices, 676 676 use_cache=use_cache, verbose=verbose) 677 677 else: -
trunk/anuga_core/source/anuga/pmesh/mesh_interface.py
r8340 r8505 243 243 244 244 # Test that we have a polygon 245 if len(num.array(interior_polygon).flat ten()) < 6:245 if len(num.array(interior_polygon).flat) < 6: 246 246 msg = 'Interior hole polygon %s has too few (<3) points.\n' \ 247 247 %(str(interior_polygon))
Note: See TracChangeset
for help on using the changeset viewer.