Changeset 9655


Ignore:
Timestamp:
Feb 10, 2015, 6:31:03 PM (9 years ago)
Author:
davies
Message:

Allowing polygon shapefiles used as breaklines to keep final point. Also printing more info on structure inlets

Location:
trunk/anuga_core/anuga
Files:
4 edited

Legend:

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

    r9001 r9655  
    548548
    549549            for proc in self.procs:
    550                 message += '======> inlet triangle indices and centres at P%d\n' %(proc)
     550                message += '======> inlet triangle indices and centres and elevation at P%d\n' %(proc)
    551551                message += '%s' % tri_indices[proc]
    552552                message += '\n'
     
    554554                message += '%s' % self.domain.get_centroid_coordinates()[tri_indices[proc]]
    555555                message += '\n'
     556
     557                elev = self.domain.quantities['elevation'].centroid_values[tri_indices[proc]]
     558                message += '%s' % elev
     559                message += '\n'
     560
     561                if elev.min() != elev.max():
     562                    message += 'Warning: Non-constant inlet elevation can lead to well-balancing problems'
     563
    556564               
    557565            message += 'line\n'
  • trunk/anuga_core/anuga/structures/internal_boundary_functions.py

    r9654 r9655  
    9191            internal_boundary_curves[:, 0])
    9292        self.free_flow_curve = interp1d(
    93             free_flow_data[:, 0], free_flow_data[:, 1])
     93            free_flow_data[:, 0], free_flow_data[:, 1], kind='linear')
    9494        self.free_flow_data = free_flow_data
    9595
     
    152152
    153153            self.nonfree_flow_curves.append(
    154                 interp1d(curve_data[:, 0], curve_data[:, 1]))
     154                interp1d(curve_data[:, 0], curve_data[:, 1], kind='linear'))
    155155            curve_counter += 1
    156156
     
    310310            Q = (w0 * upper_curve_Q + w1 * lower_curve_Q) / (w0 + w1)
    311311
     312        print 'Q: ', Q , ' HW: ', hw, ' TW:', tw
     313
    312314        return(Q*sign_multiplier)
    313315
  • trunk/anuga_core/anuga/structures/structure_operator.py

    r9652 r9655  
    471471            message += '-------------------------------------\n'
    472472
    473             message += 'inlet triangle indices and centres\n'
     473            message += 'inlet triangle indices and centres and elevations\n'
    474474            message += '%s' % inlet.triangle_indices
    475475            message += '\n'
     
    477477            message += '%s' % self.domain.get_centroid_coordinates()[inlet.triangle_indices]
    478478            message += '\n'
     479
     480            elev = self.domain.quantities['elevation'].centroid_values[inlet.triangle_indices]
     481            message += '%s' % elev
     482            message += '\n'
     483           
     484            if elev.min() != elev.max():
     485                message += 'Warning: non-constant inlet elevation can cause well-balancing problems'
    479486
    480487            message += 'region\n'
  • trunk/anuga_core/anuga/utilities/spatialInputUtil.py

    r9553 r9655  
    171171           
    172172    ###########################################################################
    173     def read_polygon(filename):
     173    def read_polygon(filename, close_polygon_shapefiles=False):
    174174        """
    175175
     
    192192            # Read as either a polygon or line shapefile
    193193            try:
    194                 outPol=readShp_1PolyGeo(filename)
     194                outPol=readShp_1PolyGeo(filename, dropLast = (not close_polygon_shapefiles))
    195195                assert len(outPol)>1
    196196            except:
     
    11701170        allBreakLines = {}
    11711171        for shapefile in fileList:
    1172             allBreakLines[shapefile] = read_polygon(shapefile)
     1172            allBreakLines[shapefile] = read_polygon(shapefile,
     1173                close_polygon_shapefiles=True)
    11731174
    11741175        return allBreakLines
Note: See TracChangeset for help on using the changeset viewer.