Changeset 8871


Ignore:
Timestamp:
May 20, 2013, 7:26:28 PM (11 years ago)
Author:
steve
Message:

Added some comments to boyd_box_operator

Location:
trunk/anuga_core
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/compile_all.py

    r8835 r8871  
    1717
    1818# Attempt to compile all ANUGA extensions
    19 
    2019execfile('compile_all.py')
    21 
    22 #os.chdir('utilities')
    23 #subprocess.call([sys.executable, 'compile.py', 'quad_tree.c'])
    24 #subprocess.call([sys.executable, 'compile.py', 'sparse_dok.c'])
    25 #subprocess.call([sys.executable, 'compile.py', 'sparse_csr.c'])
    26 #execfile('compile_all.py')
    27 #
    28 #os.chdir('..')
    29 #os.chdir('advection')
    30 #execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
    31 #
    32 #os.chdir('..')
    33 #os.chdir('operators')
    34 #execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
    35 #
    36 #os.chdir('..')
    37 #os.chdir('file_conversion')
    38 #execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
    39 #
    40 #os.chdir('..')
    41 #os.chdir('geometry')
    42 #execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
    43 #
    44 #os.chdir('..')
    45 #os.chdir('structures')
    46 #execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
    47 #
    48 #os.chdir('..')
    49 #os.chdir('abstract_2d_finite_volumes')
    50 #execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
    51 #
    52 #os.chdir('..')
    53 #os.chdir('file')
    54 #execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
    55 #
    56 #os.chdir('..')
    57 #os.chdir('shallow_water')
    58 #execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
    59 #
    60 #
    61 #os.chdir('..')
    62 #os.chdir('mesh_engine')
    63 #execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
    64 #
    65 #os.chdir('..')
    66 #os.chdir('fit_interpolate')
    67 #subprocess.call([sys.executable, '..' + os.sep + 'utilities' + os.sep + 'compile.py', 'rand48.c'])
    68 #subprocess.call([sys.executable, '..' + os.sep + 'utilities' + os.sep + 'compile.py', 'ptinpoly.c'])
    69 #execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
    7020
    7121
  • trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/quantity.py

    r8820 r8871  
    745745
    746746                # Brute force
    747                 for i in range(len(indices)):
    748                     self.centroid_values[indices[i]] = values[i]
     747                self.centroid_values[indices] = values
     748                #for i in range(len(indices)):
     749                #    self.centroid_values[indices[i]] = values[i]
    749750        elif location == 'unique vertices':
    750751            msg = 'Values array must be 1d'
     
    768769                    self.vertex_values[:] = values
    769770                else:
    770                     for element_index, value in map(None, indices, values):
    771                         self.vertex_values[element_index] = value
     771                    self.vertex_values[indices] = values
     772                    #for element_index, value in map(None, indices, values):
     773                    #    self.vertex_values[element_index] = value
    772774            else:
    773775                msg = 'Values array must be 1d or 2d'
  • trunk/anuga_core/source/anuga/operators/rate_operators.py

    r8853 r8871  
    281281            else:
    282282                rate = self.get_non_spatial_rate() # rate is a scalar
     283                fid = self.full_indices
    283284                return num.sum(self.areas[fid]*rate)*self.factor
    284285        else:
     
    337338            min_rate = num.min(rate)
    338339            max_rate = num.max(rate)
    339             message  = indent + self.label + ': Min rate = %g, Max rate = %g '% (min_rate,max_rate)
     340            Q = self.get_Q()
     341            message  = indent + self.label + ': Min rate = %g m/s, Max rate = %g m/s, Total Q = %g m^3/s'% (min_rate,max_rate, Q)
    340342        else:
    341             message  = indent + self.label + ': Rate = ' + str(self.get_non_spatial_rate())
     343            rate = self.get_non_spatial_rate()
     344            Q = self.get_Q()
     345            message  = indent + self.label + ': Rate = %g m/s, Total Q = %g m^3/s' % (rate, Q)
    342346
    343347
  • trunk/anuga_core/source/anuga/operators/run_rate_spatial_operator.py

    r8853 r8871  
    141141    abd t a scalar
    142142    """
    143     if t<10:
     143    if t<=5.0:
    144144        return (x+y)
    145145    else:
    146146        return 0*x
    147147
     148factor = 1e-3
     149op3 = Rate_operator(domain, rate = rain, factor=factor)
     150Q3 = numpy.sum(op3.get_spatial_rate()*domain.areas)*factor
    148151
    149 #op3 = Rate_operator(domain, rate = rain, factor=1e-3)
    150 area3 = numpy.sum(domain.areas)
    151 Q3 = numpy.sum(op3.get_rate(t)*area3)
     152
     153#op3()
     154#domain.fractional_step_operators.remove(op3)
     155
    152156
    153157#------------------------------------------------------------------------------
     
    169173
    170174    print indent + 'Exact accumultion = ', accum
    171     accum += (Q1+Q2)*yieldstep
     175    dd = max(min(yieldstep,5.0-t),0.0)
     176    accum += (Q1+Q2)*yieldstep + dd*Q3
    172177
    173178
  • trunk/anuga_core/source/anuga/structures/boyd_box_operator.py

    r8861 r8871  
    7575        self.culvert_height = self.get_culvert_height()
    7676
     77        #FIXME SR: Why is this hard coded!
    7778        self.max_velocity = 10.0
    7879
     
    9091
    9192    def discharge_routine(self):
     93        """Procedure to determine the inflow and outflow inlets.
     94        Then use boyd_box_function to do the actual calculation
     95        """
    9296
    9397        local_debug = False
    9498
     99        # If the cuvert has been closed, then no water gets through
    95100        if self.culvert_height <= 0.0:
    96101            Q = 0.0
     
    102107
    103108
     109        #  delta_total_energy will determine which inlet is inflow
    104110        if self.use_velocity_head:
    105111            self.delta_total_energy = \
     
    118124
    119125
     126        # Only calculate flow if there is some water at the inflow inlet.
    120127        if self.inflow.get_enquiry_depth() > 0.01: #this value was 0.01:
    121128
  • trunk/anuga_core/source/anuga_parallel/run_parallel_sw_merimbula.py

    r8870 r8871  
    105105
    106106if myid == 0 and verbose: print 'DISTRIBUTING DOMAIN'
    107 domain = distribute(domain)
     107domain = distribute(domain, verbose=verbose)
    108108
    109109#--------------------------------------------------------------------------
  • trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/carrier_greenspan_periodic

    • Property svn:ignore set to
      .deps
  • trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/parabolic_basin

    • Property svn:ignore set to
      .deps
  • trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/trapezoidal_channel

    • Property svn:ignore set to
      .deps
  • trunk/anuga_core/source/anuga_validation_tests/Case_studies/Merewether/merewether.py

    r8833 r8871  
    137137
    138138domain.sww_merge()
     139
     140
     141finalize()
  • trunk/anuga_core/source/anuga_validation_tests/Other_references/radial_dam_break_dry

    • Property svn:ignore set to
      .deps
Note: See TracChangeset for help on using the changeset viewer.