Changeset 2793


Ignore:
Timestamp:
May 3, 2006, 1:46:17 PM (19 years ago)
Author:
ole
Message:

Renaming and comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/pyvolution/domain.py

    r2784 r2793  
    2121
    2222
    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,
    3025                 boundary=None,
    3126                 conserved_quantities=None, other_quantities=None,
     
    3328                 use_inscribed_circle=False,
    3429                 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   
    3754        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,
    4362                      tagged_elements, geo_reference, use_inscribed_circle)
    4463
     
    4665        from quantity import Quantity, Conserved_quantity
    4766
    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
    5169        if conserved_quantities is None:
    5270            self.conserved_quantities = []
     
    5472            self.conserved_quantities = conserved_quantities
    5573
     74        # List of other quantity names
    5675        if other_quantities is None:
    5776            self.other_quantities = []
Note: See TracChangeset for help on using the changeset viewer.