Last active
August 29, 2015 14:06
-
-
Save wd15/00366e8f8833eb2f218f to your computer and use it in GitHub Desktop.
Plotting subdomain with FiPy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fipy as fp | |
L = 12 | |
nx = 200. | |
ny = nx | |
dx = L/nx | |
dy = L/ny | |
mesh = fp.Grid2D(nx=nx, ny=ny, dx=dx, dy=dy) + [[-L/2]] | |
x, y = mesh.getCellCenters() | |
X, Y = mesh.faceCenters | |
phi = fp.CellVariable(name = "solution variable", | |
mesh = mesh, | |
value = x * y) | |
width = L / 2. | |
viewer = fp.Viewer(vars=phi, | |
limits={'xmin': -width / 2, 'xmax': width / 2, 'ymin': -width / 2, 'ymax': width / 2, 'datamax': 4.}) | |
viewer.plot() | |
raw_input('stopped') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment