source: trunk/anuga_work/development/2010-projects/anuga_1d/base/generic_mesh.py @ 7884

Last change on this file since 7884 was 7884, checked in by steve, 12 years ago

Moving 2010 project

File size: 500 bytes
Line 
1#! /usr/bin/python
2
3# To change this template, choose Tools | Templates
4# and open the template in the editor.
5
6__author__="steve"
7__date__ ="$15/06/2010 3:08:41 PM$"
8
9
10import numpy
11
12def uniform_mesh(n, x_0=0.0, x_1=1.0):
13    """Create points, and boundary for a uniform mesh with n sub-interval
14    ranging from x_0 to x_1
15    """
16
17    assert n>0
18
19
20    points  = x_0 + (x_1 - x_0)*numpy.arange(n+1,dtype=numpy.float)/n
21    boundary = {(0, 0): 'left', (n-1, 1): 'right'}
22
23    return points, boundary
Note: See TracBrowser for help on using the repository browser.