Ignore:
Timestamp:
Mar 27, 2006, 1:54:32 PM (19 years ago)
Author:
duncan
Message:

Add mesh_file to Domain interface, ticket 56

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/pyvolution/domain.py

    r2569 r2601  
    1414from generic_boundary_conditions import Time_boundary
    1515from generic_boundary_conditions import Transmissive_boundary
     16from pmesh2domain import _pmesh_to_domain
    1617
    1718import types
     
    1920class Domain(Mesh):
    2021
    21     def __init__(self, coordinates, vertices, boundary = None,
    22                  conserved_quantities = None, other_quantities = None,
    23                  tagged_elements = None, geo_reference = None,
    24                  use_inscribed_circle=False):
     22    def __init__(self, coordinates=None, vertices=None,
     23                 boundary=None,
     24                 conserved_quantities=None, other_quantities=None,
     25                 tagged_elements=None, geo_reference=None,
     26                 use_inscribed_circle=False,
     27                 mesh_file=None):
     28
     29        if mesh_file is not None:
     30            coordinates, vertices, boundary, vertex_quantity_dict \
     31                                ,tagged_elements, geo_reference = \
     32                                _pmesh_to_domain(file_name=mesh_file)
     33            # FIXME(DSG-DSG) have to do something with vertex_quantity_dict
    2534
    2635        Mesh.__init__(self, coordinates, vertices, boundary,
     
    100109        self.already_computed_flux = zeros((N, 3), Int)
    101110
     111        if mesh_file is not None:
     112            # If the mesh file passed any quantity values
     113            # , initialise with these values.
     114            self.set_quantity_vertices_dict(vertex_quantity_dict)
     115
     116       
    102117
    103118    def set_default_order(self, n):
Note: See TracChangeset for help on using the changeset viewer.