Changeset 8585


Ignore:
Timestamp:
Sep 18, 2012, 5:22:47 PM (13 years ago)
Author:
steve
Message:

Added in get_minimum_allowed_height to domain

Location:
trunk/anuga_core/source
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/shallow_water/shallow_water_domain.py

    r8582 r8585  
    770770        self.minimum_storable_height = minimum_storable_height
    771771
     772
     773    def get_minimum_storable_height(self):
     774
     775        return self.minimum_storable_height
     776
     777
    772778    def set_minimum_allowed_height(self, minimum_allowed_height):
    773779        """Set minimum depth that will be recognised in the numerical scheme.
     
    787793        self.minimum_allowed_height = minimum_allowed_height
    788794        self.H0 = minimum_allowed_height
     795
     796
     797
     798    def get_minimum_allowed_height(self):
     799
     800        return self.minimum_allowed_height
    789801
    790802    def set_maximum_allowed_speed(self, maximum_allowed_speed):
  • trunk/anuga_core/source/anuga_parallel/parallel_shallow_water.py

    r8538 r8585  
    3636                 number_of_full_triangles=None,
    3737                 geo_reference=None,
     38                 processor = None,
     39                 numproc = None,
    3840                 number_of_global_triangles=None, ## SR added this
    3941                 number_of_global_nodes= None, ## SR added this
     
    4244                 tri_l2g = None, ## SR added this
    4345                 node_l2g = None, #): ## SR added this
    44                  ghost_layer_width = 2):
     46                 ghost_layer_width = 2): ## SR added this
     47
     48
     49
     50        #-----------------------------------------
     51        # Sometimes we want to manually
     52        # create instances of the parallel_domain
     53        # otherwise ...
     54        #----------------------------------------
     55        if processor is None:
     56            processor = pypar.rank()
     57        if numproc is None:
     58            numproc = pypar.size()
    4559
    4660        Domain.__init__(self,
     
    5064                        full_send_dict=full_send_dict,
    5165                        ghost_recv_dict=ghost_recv_dict,
    52                         processor=pypar.rank(),
    53                         numproc=pypar.size(),
     66                        processor=processor,
     67                        numproc=numproc,
    5468                        number_of_full_nodes=number_of_full_nodes,
    5569                        number_of_full_triangles=number_of_full_triangles,
  • trunk/anuga_core/source/anuga_parallel/run_parallel_sw_rectangular_tsunami.py

    r8583 r8585  
    6363                                              len1=length, len2=width, verbose=verbose)
    6464
     65    #---------------------------------------
     66    # Add these two commands to use Gareth's
     67    # tsunami algorithm. Play with the
     68    # minimum allowed height to remove possible
     69    # unrealistic large velocities
     70    #---------------------------------------
     71    domain.set_flow_algorithm('tsunami')
     72    domain.set_minimum_allowed_height(0.01)
     73
    6574    domain.set_store(True)
    66     domain.set_minimum_allowed_height(0.01)
    6775    domain.set_quantity('elevation',topography)     # Use function for elevation
    6876    domain.get_quantity('elevation').smooth_vertex_values()
     
    7078    domain.set_quantity('stage', stagefun)          # Constant negative initial stage
    7179    domain.get_quantity('stage').smooth_vertex_values()
    72     domain.set_flow_algorithm('tsunami')
     80
    7381    domain.set_name('rectangular_tsunami')
    74     domain.set_minimum_allowed_height(0.01)
     82
    7583    domain.print_statistics()
    7684else:
Note: See TracChangeset for help on using the changeset viewer.