Hi Zhiwen,
The changes I made in order to see something were as follows
3d2
< from fipy import *
Need this, it wasn't in yours.
5,11c4,8
< scale = 1e+6
<
< cellSize=0.1e-7 * scale
< trenchDepth=0.2e-6 * scale
< aspectRatio=1.47
< trenchSpacing=0.5e-6 * scale
< boundaryLayerDepth=90.0e-6 * scale
---
> cellSize=0.1e-7
> trenchDepth=0.2e-6
> aspectRatio=1.47
> trenchSpacing=0.5e-6
> boundaryLayerDepth=90.0e-6
I've scaled everything up. I've had problems with Mayavi in the past when
trying to view small stuff.
34,36c31,33
< ##var.setValue(0,where=mesh.getNoSidesMask())
< ##var.setValue(0)
< ##import fipy.viewers
---
> var.setValue(0,where=mesh.getNoSidesMask())
>
> import fipy.viewers
The mesh doesn't have the method "getNoSidesMask".
38,39c35,36
< ##viewer = fipy.viewers.make(vars = var, limits = {'datamin': 0.,
'datamax': 1.0})
< viewer = MayaviViewer(vars = var, limits = {'datamin': 0., 'datamax': 1.0})
---
> viewer = fipy.viewers.make(vars = var, limits = {'datamin': 0., 'datamax':
> 1.0})
> ##viewer = MayaviViewer(vars = var, limits = {'datamin': 0., 'datamax': 1.0})
The gist viewer doesn't seem to display meshes with elements of
different topologies
so I switched back to mayavi. The mesh is extremly thin so you have to
play with the
middle and right mouse buttons in order to see anything. You need to zoom into
the bottom of the mesh to see the finer grid.
41d37
< raw_input()
You need this so that mayavi doesn't just start up and die.
Why are you using this particular mesh?
On 10/3/07, Zhiwen Liang <[EMAIL PROTECTED]> wrote:
> Hi Daniel,
>
> Sorry I did not mention some small changes I made. Otherwise I will not get
> those errors directly. I still could not get it work. Please try running the
> following:
>
> #!/usr/bin/env python
>
>
> cellSize=0.1e-7
> trenchDepth=0.2e-6
> aspectRatio=1.47
> trenchSpacing=0.5e-6
> boundaryLayerDepth=90.0e-6
> taperAngle=6.0
> cellsBelowTrench = 10
>
> from fipy import TrenchMesh
> mesh = TrenchMesh(cellSize = cellSize,
> trenchSpacing = trenchSpacing,
> trenchDepth = trenchDepth,
> boundaryLayerDepth = boundaryLayerDepth,
> aspectRatio = aspectRatio,
> angle = numerix.pi * taperAngle / 180.,
> bowWidth = 0.,
> overBumpRadius = 0.,
> overBumpWidth = 0.)
>
>
> from fipy.variables.cellVariable import CellVariable
> from fipy.tools.numerix import random
>
> var = CellVariable(name = "phase field",
> mesh = mesh,
> #value = 1)
> value = random.random(mesh.getNumberOfCells ()))
> var.setValue(0,where=mesh.getNoSidesMask())
>
> import fipy.viewers
> ##from fipy.viewers.mayaviViewer.mayaviViewer import
> MayaviViewer
> viewer = fipy.viewers.make(vars = var, limits = {'datamin': 0., 'datamax':
> 1.0})
> ##viewer = MayaviViewer(vars = var, limits = {'datamin': 0., 'datamax':
> 1.0})
> viewer.plot()
>
> I am trying to display the "var" even before it is solved but I could not. I
> got the same errors.
>
> What we are trying to do is to model the growth coupled with Cahn Hilliard
> problem using a mesh that is similar to the trench mesh.
>
> Thank you very much for your time!
>
> Zhiwen
>
>
>
>
> On 10/3/07, Daniel Wheeler <[EMAIL PROTECTED]> wrote:
> > On 10/2/07, Zhiwen Liang <[EMAIL PROTECTED]> wrote:
> > > Hi Daniel,
> > >
> > > Thank you for your prompt reply. For the first error, the only thing I
> did
> > > was to use the input2D.py in the Cahn Hilliard example and then replace
> the
> > > mesh with the trench mesh in the levelset method. That is, I replace the
> > > following two lines:
> > >
> > > from fipy.meshes.grid2D import Grid2D
> > > mesh = Grid2D(dx, dy, nx, ny)
> > >
> > > with:
> > >
> > > cellSize=0.1e-7
> > > trenchDepth=0.2e-6
> > > aspectRatio=1.47
> > > trenchSpacing=0.5e-6
> > > boundaryLayerDepth=90.0e-6
> > > taperAngle= 6.0
> > > cellsBelowTrench = 10
> > >
> > > from fipy import TrenchMesh
> > > mesh = TrenchMesh(cellSize = cellSize,
> > > trenchSpacing = trenchSpacing,
> > > trenchDepth = trenchDepth,
> > > boundaryLayerDepth = boundaryLayerDepth,
> > > aspectRatio = aspectRatio,
> > > angle = numerix.pi * taperAngle / 180.,
> > > bowWidth = 0.,
> > > overBumpRadius = 0.,
> > > overBumpWidth = 0.)
> >
> > If you do that naively, you will end up with "var" having the wrong
> > size. You need
> > to change to this otherwise the variable will have the wrong number of
> > elements.
> >
> > var = CellVariable(name = "phase field",
> > mesh = mesh,
> > value = random.random(mesh.getNumberOfCells()))
> >
> > and this (TrenchMesh does not know about faces top etc),
> >
> > BCs = (FixedFlux(mesh.getExteriorFaces(), 0),
> > NthOrderBoundaryCondition(mesh.getExteriorFaces(), 0, 3))
> >
> > The problem ran, but did not converge. The TrenchMesh has cells with a
> > very large
> > area range and since Cahn-Hilliard is fourth order the condition
> > number of the matrix is probably off the map. Why are you using the
> > TrenchMesh for
> > a CH problem? What are you really trying to do?
> >
> > Cheers
> >
> > --
> > Daniel Wheeler
> >
>
>
--
Daniel Wheeler