Changeset 2793
- Timestamp:
- May 3, 2006, 1:46:17 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/pyvolution/domain.py
r2784 r2793 21 21 22 22 23 #FIXME (Ole): I would like this interface to automatically work out 24 #whether input is mesh data or a filename (as in set_quantity). 25 #That way the user need not remember the keyword arguments. 26 # DONE (DSG): It does mean that coordinates sometimes means mesh_filename 27 # though 28 def __init__(self, coordinates=None, 29 vertices=None, 23 def __init__(self, source=None, 24 triangles=None, 30 25 boundary=None, 31 26 conserved_quantities=None, other_quantities=None, … … 33 28 use_inscribed_circle=False, 34 29 mesh_filename=None): 35 if type(coordinates) == types.StringType: 36 mesh_filename = coordinates 30 """Instantiate generic computational Domain. 31 Input: 32 source: Either a mesh filename or coordinates of mesh vertices. If it is a 33 filename values specified for triangles will be overridden. 34 triangles: Mesh connectivity (see mesh.py for more information) 35 boundary: See mesh.py for more information 36 37 conserved_quantities: List of quantity names entering the conservation equations 38 other_quantities: List of other quantity names 39 40 tagged_elements: 41 ... 42 43 44 """ 45 46 # Determine whether source is a mesh filename or coordinates 47 if type(source) == types.StringType: 48 mesh_filename = source 49 else: 50 coordinates = source 51 52 53 # In case a filename has been specified, extract content 37 54 if mesh_filename is not None: 38 coordinates, vertices, boundary, vertex_quantity_dict \ 39 ,tagged_elements, geo_reference = \ 40 pmesh_to_domain(file_name=mesh_filename) 41 42 Mesh.__init__(self, coordinates, vertices, boundary, 55 coordinates, triangles, boundary, vertex_quantity_dict, \ 56 tagged_elements, geo_reference = \ 57 pmesh_to_domain(file_name=mesh_filename) 58 59 60 # Initialise underlying mesh structure 61 Mesh.__init__(self, coordinates, triangles, boundary, 43 62 tagged_elements, geo_reference, use_inscribed_circle) 44 63 … … 46 65 from quantity import Quantity, Conserved_quantity 47 66 48 #List of quantity names entering 49 #the conservation equations 50 #(Must be a subset of quantities) 67 # List of quantity names entering 68 # the conservation equations 51 69 if conserved_quantities is None: 52 70 self.conserved_quantities = [] … … 54 72 self.conserved_quantities = conserved_quantities 55 73 74 # List of other quantity names 56 75 if other_quantities is None: 57 76 self.other_quantities = []
Note: See TracChangeset
for help on using the changeset viewer.