source: anuga_work/development/2010-projects/anuga_1d/generic/generic_mesh.py @ 7842

Last change on this file since 7842 was 7842, checked in by steve, 14 years ago

Adding in a few new files

File size: 499 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 interval_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)
21    boundary = {(0, 0): 'left', (n-1, 1): 'right'}
22
23    return points, boundary
Note: See TracBrowser for help on using the repository browser.