Ignore:
Timestamp:
Oct 4, 2016, 4:13:00 PM (9 years ago)
Author:
steve
Message:

Commit svn after a lot of git updates

Location:
trunk/anuga_core/anuga/parallel
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/anuga/parallel/parallel_api.py

    r9500 r9737  
    4343
    4444
     45def collect_value(value):
     46   
     47    value = value
     48
     49    if myid == 0:
     50        for i in range(numprocs):
     51            if i == 0: continue
     52            val = receive(i)
     53            value = value + val
     54    else:
     55        send(value, 0)
     56
     57    return value   
     58   
     59
     60
     61
    4562def distribute(domain, verbose=False, debug=False, parameters = None):
    4663    """ Distribute the domain to all processes
     
    6178                domain_name, domain_dir, domain_store, domain_store_centroids, \
    6279                domain_minimum_storable_height, domain_minimum_allowed_height, \
    63                 domain_flow_algorithm, georef = partition.extract_submesh(0)
     80                domain_flow_algorithm, domain_georef, \
     81                domain_quantities_to_be_stored, domain_smooth \
     82                 = partition.extract_submesh(0)
    6483       
    6584        for p in range(1, numprocs):
     
    7291
    7392        kwargs, points, vertices, boundary, quantities, boundary_map, \
    74                        domain_name, domain_dir, domain_store, domain_store_centroids, \
    75                        domain_minimum_storable_height, domain_minimum_allowed_height, \
    76                        domain_flow_algorithm, georef = receive(0)
     93            domain_name, domain_dir, domain_store, domain_store_centroids, \
     94            domain_minimum_storable_height, domain_minimum_allowed_height, \
     95            domain_flow_algorithm, domain_georef, \
     96            domain_quantities_to_be_stored, domain_smooth \
     97             = receive(0)
    7798
    7899    #---------------------------------------------------------------------------
     
    111132    parallel_domain.set_minimum_allowed_height(domain_minimum_allowed_height)
    112133    parallel_domain.set_flow_algorithm(domain_flow_algorithm)
    113     parallel_domain.geo_reference = georef
    114 
     134    parallel_domain.geo_reference = domain_georef
     135    parallel_domain.set_quantities_to_be_stored(domain_quantities_to_be_stored)
     136    parallel_domain.smooth = domain_smooth
    115137
    116138    return parallel_domain
     
    465487
    466488##     return l2g
    467 
  • trunk/anuga_core/anuga/parallel/parallel_boyd_box_operator.py

    r9681 r9737  
    2323                 losses,
    2424                 width,
     25                 blockage=0.0, #added PM 24/7/2016
    2526                 z1=0.0,
    26                  z2=0.0,
    27                  height=None,
     27                 z2=0.0,               
     28                 height=None,               
    2829                 end_points=None,
    2930                 exchange_lines=None,
     
    5556                                          width=width,
    5657                                          height=height,
     58                                          blockage=0.0, #added PM 24/7/2016
    5759                                          z1=0.0,
    5860                                          z2=0.0,
    59                                           diameter= None,
     61                                          diameter= None,                                         
    6062                                          apron=apron,
    6163                                          manning=manning,
     
    9294        self.culvert_width = self.get_culvert_width()
    9395        self.culvert_height = self.get_culvert_height()
     96        self.culvert_blockage = self.get_culvert_blockage()#added PM 24/7/2016
    9497
    9598        self.max_velocity = 10.0
     
    283286                                                flow_width          =self.culvert_width,
    284287                                                length              =self.culvert_length,
     288                                                blockage            =self.culvert_blockage, #added PM 24/7/2016
    285289                                                driving_energy      =self.driving_energy,
    286290                                                delta_total_energy  =self.delta_total_energy,
  • trunk/anuga_core/anuga/parallel/parallel_generic_communications.py

    r9529 r9737  
    134134
    135135
    136 def communicate_ghosts_asynchronous(domain):
     136def communicate_ghosts_asynchronous(domain, quantities=None):
    137137
    138138    # We must send the information from the full cells and
     
    145145    import time
    146146    t0 = time.time()
     147   
     148    if quantities is None:
     149        quantities = domain.conserved_quantities
    147150
    148151    # update of non-local ghost cells by copying full cell data into the
     
    156159        Xout = domain.full_send_dict[send_proc][2]
    157160
    158         for i, q in enumerate(domain.conserved_quantities):
     161        for i, q in enumerate(quantities):
    159162            #print 'Store send data',i,q
    160163            Q_cv =  domain.quantities[q].centroid_values
     
    163166
    164167
    165 #    from pprint import pprint
    166 #
    167 #    if pypar.rank() == 0:
    168 #        print 'Before commun 0'
    169 #        pprint(domain.full_send_dict)
    170 #
    171 #    if pypar.rank() == 1:
    172 #        print 'Before commun 1'
    173 #        pprint(domain.full_send_dict)
     168
    174169
    175170
     
    197192        #print X
    198193
    199         for i, q in enumerate(domain.conserved_quantities):
     194        for i, q in enumerate(quantities):
    200195            #print 'Read receive data',i,q
    201196            Q_cv =  domain.quantities[q].centroid_values
  • trunk/anuga_core/anuga/parallel/parallel_operator_factory.py

    r9672 r9737  
    118118def Boyd_box_operator(domain,
    119119                       losses,
    120                        width,
    121                        height=None,
     120                       width,                       
     121                       height=None,                                           
     122                       blockage=0.0, #added by DPM 24/7/2016
    122123                       z1=0.0,
    123124                       z2=0.0,
     
    147148                                                                    width=width,
    148149                                                                    height=height,
     150                                                                    blockage=blockage,#added by DPM 24/7/2016
    149151                                                                    z1=0.0,
    150152                                                                    z2=0.0,
     
    253255                                         width=width,
    254256                                         height=height,
     257                                         blockage=blockage, #added by DPM 24/7/2016
    255258                                         end_points=end_points,
    256259                                         exchange_lines=exchange_lines,
  • trunk/anuga_core/anuga/parallel/parallel_shallow_water.py

    r9500 r9737  
    136136
    137137
    138     def update_ghosts(self):
     138    def update_ghosts(self, quantities=None):
    139139        """We must send the information from the full cells and
    140140        receive the information for the ghost cells
    141141        """
    142142           
    143         generic_comms.communicate_ghosts_asynchronous(self)
     143        generic_comms.communicate_ghosts_asynchronous(self, quantities)
    144144        #generic_comms.communicate_ghosts_blocking(self)
    145145
  • trunk/anuga_core/anuga/parallel/parallel_structure_operator.py

    r9682 r9737  
    4646                 z1,#added by PM 22/10/2013
    4747                 z2,#added by PM 22/10/2013
     48                 blockage,#added by PM 24/7/2016 
    4849                 apron,
    4950                 manning,
     
    117118        self.z1 = z1 #added by PM 22/10/2013
    118119        self.z2 = z2 #added by PM 22/10/2013
     120        self.blockage = blockage #added by PM 24/7/2016 
    119121        self.apron  = apron
    120122        self.manning = manning
     
    710712    def get_culvert_z2(self): #added by PM 22/10/2013       
    711713        return self.z2
    712        
     714
     715    def get_culvert_blockage(self): #added by PM 24/7/2016             
     716        return self.blockage #added by PM 24/7/2016
     717               
    713718    def get_culvert_apron(self):
    714719        return self.apron
     
    746751
    747752        self.culvert_z2 = z2 
    748        
     753
     754    def set_culvert_blockage(self, blockage): #added by PM 24/7/2016 
     755
     756        self.culvert_blockage = blockage  #added by PM 24/7/2016
     757               
    749758    def parallel_safe(self):
    750759        return True
  • trunk/anuga_core/anuga/parallel/parallel_weir_orifice_trapezoid_operator.py

    r9681 r9737  
    247247           
    248248                Q, barrel_velocity, outlet_culvert_depth, flow_area, case = \
    249                               weir_orifice_trapezoid_function(depth               =self.culvert_height,
     249                              weir_orifice_trapezoid_function(depth =self.culvert_height,
    250250                                                width               =self.culvert_width,
    251251                                                z1                  =self.culvert_z1,
  • trunk/anuga_core/anuga/parallel/sequential_distribute.py

    r9501 r9737  
    6060        self.domain_minimum_allowed_height = domain.get_minimum_allowed_height()
    6161        self.domain_georef = domain.geo_reference
     62        self.domain_quantities_to_be_stored = domain.quantities_to_be_stored
     63        self.domain_smooth = domain.smooth
    6264        self.number_of_global_triangles = domain.number_of_triangles
    6365        self.number_of_global_nodes = domain.number_of_nodes
     
    193195        domain_flow_algorithm = self.domain_flow_algorithm
    194196        domain_georef = self.domain_georef
     197        domain_quantities_to_be_stored = self.domain_quantities_to_be_stored
     198        domain_smooth = self.domain_smooth
    195199           
    196200        tostore = (kwargs, points, vertices, boundary, quantities, \
     
    199203                   domain_minimum_storable_height, \
    200204                   domain_minimum_allowed_height, domain_flow_algorithm, \
    201                    domain_georef)
     205                   domain_georef, domain_quantities_to_be_stored, domain_smooth)
    202206
    203207
     
    269273                   domain_name, domain_dir, domain_store, domain_store_centroids, \
    270274                   domain_minimum_storable_height, domain_minimum_allowed_height, \
    271                    domain_flow_algorithm, georef = cPickle.load(f)
     275                   domain_flow_algorithm, domain_georef, \
     276                   domain_quantities_to_be_stored, domain_smooth = cPickle.load(f)
    272277    f.close()
    273278
     
    304309    domain.set_minimum_storable_height(domain_minimum_storable_height)
    305310    domain.set_minimum_allowed_height(domain_minimum_allowed_height)
    306     domain.geo_reference = georef
    307 
     311    domain.geo_reference = domain_georef
     312    domain.set_quantities_to_be_stored(domain_quantities_to_be_stored)
     313    domain.smooth = domain_smooth
    308314
    309315    return domain
  • trunk/anuga_core/anuga/parallel/tests/test_sequential_dist_sw_flow.py

    r9571 r9737  
    4141#--------------------------------------------------------------------------
    4242yieldstep = 0.25
    43 finaltime = 3.0
     43finaltime = 1.0
    4444nprocs = 4
    4545N = 29
     
    149149        if verbose:
    150150           
    151             order = 0
     151            order = 2
    152152            print 'PDOMAIN CENTROID VALUES'
    153153            print num.linalg.norm(odomain_c.x-pdomain_c.x,ord=order)
Note: See TracChangeset for help on using the changeset viewer.