Changeset 8763


Ignore:
Timestamp:
Mar 17, 2013, 10:08:46 PM (12 years ago)
Author:
steve
Message:

Added in xllcorner and yllcorner into fitsmooth (caused a problem on cairns demo)

Location:
trunk/anuga_core
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/demos/cairns/project.py

    r8728 r8763  
    5757
    5858# bigger base_scale == less triangles
    59 base_scale = 100000
    60 base_scale = 100000
     59#base_scale = 100000 # 162170 triangles
     60base_scale = 400000 # 42093
    6161default_res = 100 * base_scale   # Background resolution
    6262islands_res = base_scale
  • trunk/anuga_core/demos/cairns/run_cairns.py

    r8728 r8763  
    6565domain.set_flow_algorithm('tsunami')
    6666
     67
     68                                   
    6769#------------------------------------------------------------------------------
    6870# Setup initial conditions
  • trunk/anuga_core/source/anuga/fit_interpolate/fit.py

    r8757 r8763  
    4646import sys
    4747
    48 # Setup for c fitting routines
    49 #from anuga.utilities import compile
    50 #if compile.can_use_C_extension('fitsmooth.c'):
     48#----------------------------------------------
     49# C code to build interpolation matrices
     50#----------------------------------------------
    5151import fitsmooth
    52 #else:
    53 #    msg = "C implementation of fitting algorithms (fitsmooth.c) not avalaible"
    54 #    raise Exception(msg)
    55 
    56 # Setup for quad_tree extension
    57 #from anuga.utilities import compile
    58 #if compile.can_use_C_extension('quad_tree_ext.c'):
    59 #from anuga.utilities import quad_tree_ext
    60 #else:
    61 #    msg = "C implementation of quad tree extension not avaliable"
    62 #    raise Exception(msg)
    63 
    64 # Setup for sparse_matrix extension
    65 #from anuga.utilities import compile
    66 #if compile.can_use_C_extension('sparse_matrix_ext.c'):
    67 #from anuga.utilities import sparse_matrix_ext
    68 #else:
    69 #    msg = "C implementation of sparse_matrix extension not avaliable"
    70 #    raise Exception(msg)
    71 
    7252
    7353
     
    8767        Padarn Note 05/12/12: This documentation should probably
    8868        be updated to account for the fact that the fitting is now
    89         done in c. I wasn't sure what details were neccesary though.
     69        done in C. I wasn't sure what details were neccesary though.
    9070
    9171        Fit data at points to the vertices of a mesh.
     
    134114
    135115        # NOTE PADARN: NEEDS FIXING - currently need smoothing matrix
    136         # even if alpha is zero, due to c function expecting it. This
     116        # even if alpha is zero, due to C function expecting it. This
    137117        # could and should be removed.
    138118        if True:
     
    206186
    207187    # NOTE PADARN: This function was added to emulate behavior of the original
    208     # class not using external c functions. This method is dangerous as D could
     188    # class not using external C functions. This method is dangerous as D could
    209189    # be very large - it was added as it is used in a unit test.
    210190    def get_D(self):
     
    212192
    213193    # NOTE PADARN: This function was added to emulate behavior of the original
    214     # class so as to pass a unit test. It is completely uneeded.
     194    # class so as to pass a unit test. It is completely unneeded.
    215195    def build_fit_subset(self, point_coordinates, z=None, attribute_name=None,
    216196                              verbose=False, output='dot'):
     
    310290        # PADARN NOTE: THe following block of code is translated from
    311291        # things that were being done in the Geospatial_data object
    312         # which is no longer required if data from file in c.
     292        # which is no longer required if data from file in C.
    313293        #---------------------------------------------------------
    314294        # Default attribute name here seems to only have possibility
     
    358338
    359339        Inputs:
    360         point_coordinates: The co-ordinates of the data points.
     340        point_coordinates_or_filename: The co-ordinates of the data points.
     341              A filename of a .pts file or a
    361342              List of coordinate pairs [x, y] of
    362         data points or an nx2 numeric array or a Geospatial_data object
     343              data points or an nx2 numeric array or a Geospatial_data object
    363344              or points file filename
    364345          z: Single 1d vector or array of data at the point_coordinates.
     
    368349            if point_coordinates_or_filename[-4:] != ".pts":
    369350                use_blocking_option2 = False
     351
    370352        # NOTE PADARN 12/12/12: Currently trying to get all blocking to be done
    371         # in c, but blocking option 1, which does everything using the python
     353        # in C, but blocking option 1, which does everything using the python
    372354        # interface can be used in the meantime (much slower).
     355
    373356        #-----------------------BLOCKING OPTION 1----------------------------
    374357        if use_blocking_option2 is False:
     
    401384            else:
    402385                point_coordinates = point_coordinates_or_filename
     386
    403387        #-----------------------BLOCKING OPTION 2----------------------------
    404388        else:
  • trunk/anuga_core/source/anuga/fit_interpolate/fitsmooth.c

    r8752 r8763  
    9292
    9393    *x = (int)length;
     94
     95    if ((status = nc_close(ncid))) ERR(status);
     96
     97    return 0;
     98
     99}
     100
     101// Takes a netcdf file and gets the x and y corners
     102int _read_net_cdf_corners(char * filename,double *xllcorner, double *yllcorner){
     103
     104    int status;                       /* error status */
     105    int ncid;
     106
     107    if ((status = nc_open(filename, NC_NOWRITE, &ncid))) ERR(status);
     108
     109    if ((status = nc_get_att_double(ncid, NC_GLOBAL, "xllcorner", xllcorner))) ERR(status);
     110    if ((status = nc_get_att_double(ncid, NC_GLOBAL, "yllcorner", yllcorner))) ERR(status);
    94111
    95112    if ((status = nc_close(ncid))) ERR(status);
     
    270287    //n=10;
    271288
     289    double xllcorner, yllcorner;
     290    _read_net_cdf_corners(filename,&xllcorner,&yllcorner);
     291
     292    //printf(" xllcorner %g yllcorner %g\n",xllcorner,yllcorner);
     293
     294
    272295    double * point_coordinates = malloc(2*sizeof(double)*blocksize);
    273296    double * point_values = malloc(sizeof(double)*blocksize);
     
    301324
    302325
    303                 double x = point_coordinates[2*k];
    304                 double y = point_coordinates[2*k+1];
     326                double x = point_coordinates[2*k]+xllcorner;
     327                double y = point_coordinates[2*k+1]+yllcorner;
    305328                triangle * T = search(quadtree,x,y);
    306329
  • trunk/anuga_core/source/anuga_parallel/pymetis/Makefile

    r8762 r8763  
    2020
    2121pymetis_module:
    22         (cd pymetis; METIS_DIR=$(METIS_DIR) python setup.py build; sh ./get_module)
     22        (cd pymetis; METIS_DIR=$(METIS_DIR) python setup.py build; sh get_module)
    2323
    2424for_win32: metis_win32 pymetis_module_win32
  • trunk/anuga_core/source/anuga_parallel/run_parallel_sw_merimbula.py

    r8760 r8763  
    4545#mesh_filename = "merimbula_17156.tsh"   ; x0 = 756000.0 ; x1 = 756500.0; yieldstep = 50; finaltime = 500
    4646#mesh_filename = "merimbula_43200_1.tsh"   ; x0 = 756000.0 ; x1 = 756500.0; yieldstep = 50; finaltime = 500
    47 mesh_filename = "test-100.tsh" ; x0 = 200.0 ; x1 = 300.0; yieldstep = 1; finaltime = 50
     47#mesh_filename = "test-100.tsh" ; x0 = 200.0 ; x1 = 300.0; yieldstep = 1; finaltime = 50
    4848#mesh_filename = "test-20.tsh" ; x0 = 250.0 ; x1 = 350.0; yieldstep = 1; finaltime = 50
    4949
     
    8888    domain.set_name('merimbula_new')
    8989    domain.set_store(True)
    90     domain.set_store_vertices_smoothly(False)
     90    domain.set_store_vertices_smoothly(True)
    9191    #domain.set_quantity('elevation', Set_Elevation(500.0))
    9292
Note: See TracChangeset for help on using the changeset viewer.