Changeset 8662 for trunk


Ignore:
Timestamp:
Dec 5, 2012, 6:49:46 PM (12 years ago)
Author:
steve
Message:

Dealing with error message for enquiry point in a hole

Location:
trunk/anuga_core/source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/file/sww.py

    r8353 r8662  
    103103        fid = NetCDFFile(self.filename, mode)
    104104        if mode[0] == 'w':
    105             description = 'Output from anuga.abstract_2d_finite_volumes ' \
     105            description = 'Output from anuga.file.sww' \
    106106                          'suitable for plotting'
    107107                         
  • trunk/anuga_core/source/anuga/fit_interpolate/interpolate.py

    r8615 r8662  
    4646from anuga.geometry.polygon import interpolate_polyline, in_and_outside_polygon
    4747import anuga.utilities.log as log
     48
    4849
    4950import numpy as num
     
    539540                        froude_file=None,
    540541                        time_thinning=1,
     542                        g = 9.80665,
    541543                        verbose=True,
    542544                        use_cache = True):
     
    633635                froude = NAN
    634636            else:
     637
    635638                froude = sqrt(velocity_x*velocity_x + velocity_y*velocity_y)/ \
    636                          sqrt(depth * 9.8066) # gravity m/s/s
     639                         sqrt(depth * g) # gravity m/s/s
    637640
    638641            depths.append(depth)
  • trunk/anuga_core/source/anuga/structures/inlet_enquiry.py

    r8250 r8662  
    3737        msg += ' did not fall within the domain boundary.'
    3838        assert is_inside_polygon(point, bounding_polygon), msg
    39            
    40         self.enquiry_index = self.domain.get_triangle_containing_point(self.enquiry_pt)
    4139
     40        try:
     41            self.enquiry_index = self.domain.get_triangle_containing_point(self.enquiry_pt)
     42        except:
     43            msg = "Enquiry point %s doesn't intersect mesh, maybe inside a building, try reducing enquiry_gap" % str(self.enquiry_pt)
     44            raise Exception(msg)
     45
     46       
    4247        if self.enquiry_index in self.triangle_indices:
    4348            msg = 'Enquiry point %s' % (self.enquiry_pt)
  • trunk/anuga_core/source/anuga_parallel/parallel_operator_factory.py

    r8653 r8662  
    384384        assert len(inlet_procs) > 0, "Line does not intersect any domain"
    385385        assert inlet_master_proc >= 0, "No master processor assigned"
    386         if enquiry_point is not None: assert inlet_enq_proc >= 0, "Enquiry point %s not assigned to a processor" % str(enquiry_point)
     386
     387        if enquiry_point is not None:
     388            msg = "Enquiry point %s doesn't intersect mesh, maybe inside a building, try reducing enquiry_gap" % str(enquiry_point)
     389            if inlet_enq_proc < 0:
     390                raise Exception(msg)
    387391
    388392        # Send inlet_master_proc and inlet_procs to all processors in inlet_procs
Note: See TracChangeset for help on using the changeset viewer.