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

Reply via email to